CN108769718B - Barrage verification method, computer equipment and storage medium - Google Patents
Barrage verification method, computer equipment and storage medium Download PDFInfo
- Publication number
- CN108769718B CN108769718B CN201810316801.7A CN201810316801A CN108769718B CN 108769718 B CN108769718 B CN 108769718B CN 201810316801 A CN201810316801 A CN 201810316801A CN 108769718 B CN108769718 B CN 108769718B
- Authority
- CN
- China
- Prior art keywords
- field
- bullet screen
- protocol
- sending
- server
- 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.)
- Active
Links
Images
Classifications
-
- 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/20—Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
- H04N21/23—Processing of content or additional data; Elementary server operations; Server middleware
- H04N21/235—Processing of additional data, e.g. scrambling of additional data or processing content descriptors
- H04N21/2351—Processing of additional data, e.g. scrambling of additional data or processing content descriptors involving encryption of additional data
-
- 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/25—Management operations performed by the server for facilitating the content distribution or administrating data related to end-users or client devices, e.g. end-user or client device authentication, learning user preferences for recommending movies
- H04N21/258—Client or end-user data management, e.g. managing client capabilities, user preferences or demographics, processing of multiple end-users preferences to derive collaborative data
- H04N21/25866—Management of end-user data
- H04N21/25875—Management of end-user data involving end-user authentication
-
- 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
- H04N21/643—Communication protocols
-
- 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/80—Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
- H04N21/85—Assembly of content; Generation of multimedia applications
- H04N21/854—Content authoring
- H04N21/8547—Content authoring involving timestamps for synchronizing content
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Databases & Information Systems (AREA)
- Computer Security & Cryptography (AREA)
- Theoretical Computer Science (AREA)
- Computer Graphics (AREA)
- Information Transfer Between Computers (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The invention provides a bullet screen verification method, computer equipment and a storage medium, wherein the method comprises the following steps: sending a login protocol to a bullet screen server of a live broadcast platform; if the login is successful, receiving a token field, a random field r and a time field returned by the bullet screen server; generating a bullet screen protocol; performing time m 5 calculation on the random field R to obtain a field R; calculating a k field according to the token field, the room number of the live broadcast room, the timestamp of the bullet screen protocol, the sending times of the bullet screen, the content of the bullet screen and the field R; encrypting the k field; adding the encrypted k field into the bullet screen protocol, and sending the bullet screen protocol added with the encrypted k field to the bullet screen server; and if the bullet screen is successfully sent, receiving the next random field r sent by the bullet screen server. Therefore, the method and the device can find the illegal user in time through the verification of the login protocol, and identify the illegal barrage protocol through the verification of the k field, thereby enriching the mode of processing the barrage swiping.
Description
Technical Field
The invention belongs to the technical field of computers, and particularly relates to a bullet screen verification method, computer equipment and a storage medium.
Background
Currently, live broadcasting is increasingly popular with people. And the barrage is a very good interactive mode in live broadcasting. For example, when the anchor is live, the viewer can interact with the anchor by sending a barrage to post comments. Any barrage sent by the viewer is visible to all users in the live room.
However, there are some illegal users who continuously advertise on the live platform by sending the barrage by making use of the feature that the barrage can be seen by all viewers, for example, by creating a link to the live platform server and forging the barrage protocol to refresh the barrage, and writing an automated script to refresh the barrage. The existing method is to filter and prevent the recognition of brushing the bullet screen at the live broadcast platform server side to block the behavior of brushing the bullet screen.
Therefore, the prior art has a single processing mode for brushing the bullet screen.
Disclosure of Invention
The embodiment of the application solves the problem that the processing mode for swiping the bullet screen is single in the prior art by providing the bullet screen verification method, the computer device and the storage medium.
In a first aspect, an embodiment of the present application provides a bullet screen verification method, where the method is applied to a client device, and the method includes:
sending a login protocol to a bullet screen server of a live broadcast platform;
if the login is successful, receiving a token field, a random field r and a time field returned by the bullet screen server;
generating a bullet screen protocol, wherein the bullet screen protocol comprises bullet screen contents and a timestamp of the bullet screen protocol;
performing time m 5 calculation on the random field R, thereby obtaining a field R;
calculating a k field according to the token field, the room number of the live broadcast room, the timestamp of the bullet screen protocol, the sending times of the bullet screen, the bullet screen content and the field R, wherein the room number of the live broadcast room is obtained by sending a protocol for obtaining room information to the bullet screen server, the sending times of the bullet screen is the times of successful bullet screen sending, and the initial value is 0;
encrypting the k field;
adding the encrypted k field into the bullet screen protocol, and sending the bullet screen protocol added with the encrypted k field to the bullet screen server;
and if the bullet screen is successfully sent, receiving a next random field r sent by the bullet screen server, wherein the next random field r is used for calculating a k field of a next bullet screen protocol.
Optionally, the calculating the k field according to the token field, the room number of the live broadcast room, the timestamp of the barrage protocol, the sending times of the barrage, the content of the barrage, and the field R includes calculating the k field according to the following formula:
k=md5.create(token+roomid+ts+no+content+R);
wherein, md5.create is a computing interface of the hash algorithm md 5;
token is the token field;
roomid is the room number of the live room;
ts is the timestamp of the bullet screen protocol;
no is the number of times of sending the bullet screen;
content is the bullet screen content;
r is the result of the random field R making time md5 calculations.
Optionally, the encrypting the k field includes encrypting the k field according to the following formula:
encryptk=TEA.encrypt(r,ts)
encrypt is an encryption interface of an encryption algorithm tea;
r is the random field r;
ts is the timestamp of the bullet screen protocol;
encryptk is the encryption result of the k field.
In a second aspect, the present application further provides a barrage verification method, where the method is applied to a barrage server of a live broadcast platform, and the method includes:
receiving a login protocol sent by client equipment;
if the login is successful, returning a token field, a random field r and a times field to the client equipment;
receiving a barrage protocol sent by the client equipment, wherein the barrage protocol comprises an encrypted k field;
judging whether the difference value between the timestamp of the bullet screen protocol and the timestamp of the bullet screen server is within a preset range, if so, decrypting the encrypted k field to obtain the k field;
searching a field R in a configuration file, wherein the field R is a result of performing time m 5 calculation on the random field R, and the configuration file is a corresponding relation among the random field R, the time field and the field R;
calculating a k field according to the token field, the room number of the live broadcast room, the timestamp of the bullet screen protocol, the sending times of the bullet screen, the bullet screen content and the field R;
and judging whether the k field obtained by decryption is consistent with the k field obtained by calculation, if so, passing the verification, and sending the next random field r to the client equipment.
Optionally, the calculating the k field according to the token field, the room number of the live broadcast room, the timestamp of the barrage protocol, the sending times of the barrage, the content of the barrage, and the field R includes calculating the k field according to the following formula:
k=md5.create(token+roomid+ts+no+content+R);
wherein, md5.create is a computing interface of the hash algorithm md 5;
token is the token field;
roomid is the room number of the live room;
ts is the timestamp of the bullet screen protocol;
no is the number of times of sending the bullet screen;
content is the bullet screen content;
r is the result of the random field R making time md5 calculations.
Optionally, the decrypting the encrypted k field to obtain the k field includes decrypting the encrypted k field according to the following formula to obtain the k field:
k=TEA.decrypt(r,encryptk);
wherein, TEA is the decryption interface of the TEA encryption algorithm;
r is the random field r;
encryptk is the encrypted k field.
In a third aspect, the present application further provides a computer-readable storage medium storing a computer program, wherein the computer program when executed by a processor implements the steps of:
sending a login protocol to a bullet screen server of a live broadcast platform;
if the login is successful, receiving a token field, a random field r and a time field returned by the bullet screen server;
generating a bullet screen protocol, wherein the bullet screen protocol comprises bullet screen contents and a timestamp of the bullet screen protocol;
performing time m 5 calculation on the random field R, thereby obtaining a field R;
calculating a k field according to the token field, the room number of the live broadcast room, the timestamp of the bullet screen protocol, the sending times of the bullet screen, the bullet screen content and the field R, wherein the room number of the live broadcast room is obtained by sending a protocol for obtaining room information to the bullet screen server, the sending times of the bullet screen is the times of successful bullet screen sending, and the initial value is 0;
encrypting the k field;
adding the encrypted k field into the bullet screen protocol, and sending the bullet screen protocol added with the encrypted k field to the bullet screen server;
and if the bullet screen is successfully sent, receiving a next random field r sent by the bullet screen server, wherein the next random field r is used for calculating a k field of a next bullet screen protocol.
In a fourth aspect, the present application further provides a computer device comprising a processor, a memory, and a computer program stored on the memory and executable on the processor, wherein the processor, when executing the computer program, implements the steps of:
sending a login protocol to a bullet screen server of a live broadcast platform;
if the login is successful, receiving a token field, a random field r and a time field returned by the bullet screen server;
generating a bullet screen protocol, wherein the bullet screen protocol comprises bullet screen contents and a timestamp of the bullet screen protocol;
performing time m 5 calculation on the random field R, thereby obtaining a field R;
calculating a k field according to the token field, the room number of the live broadcast room, the timestamp of the bullet screen protocol, the sending times of the bullet screen, the bullet screen content and the field R, wherein the room number of the live broadcast room is obtained by sending a protocol for obtaining room information to the bullet screen server, the sending times of the bullet screen is the times of successful bullet screen sending, and the initial value is 0;
encrypting the k field;
adding the encrypted k field into the bullet screen protocol, and sending the bullet screen protocol added with the encrypted k field to the bullet screen server;
and if the bullet screen is successfully sent, receiving a next random field r sent by the bullet screen server, wherein the next random field r is used for calculating a k field of a next bullet screen protocol.
In a fifth aspect, the present application further provides a computer-readable storage medium storing a computer program, wherein the computer program when executed by a processor implements the steps of:
receiving a login protocol sent by client equipment;
if the login is successful, returning a token field, a random field r and a times field to the client equipment;
receiving a barrage protocol sent by the client equipment, wherein the barrage protocol comprises an encrypted k field;
judging whether the difference value between the timestamp of the bullet screen protocol and the timestamp of the bullet screen server is within a preset range, if so, decrypting the encrypted k field to obtain the k field;
searching a field R in a configuration file, wherein the field R is a result of performing time m 5 calculation on the random field R, and the configuration file is a corresponding relation among the random field R, the time field and the field R;
calculating a k field according to the token field, the room number of the live broadcast room, the timestamp of the bullet screen protocol, the sending times of the bullet screen, the bullet screen content and the field R;
and judging whether the k field obtained by decryption is consistent with the k field obtained by calculation, if so, passing the verification, and sending the next random field r to the client equipment.
In a sixth aspect, the present application further provides a computer device comprising a processor, a memory, and a computer program stored on the memory and executable on the processor, wherein the processor, when executing the computer program, implements the steps of:
receiving a login protocol sent by client equipment;
if the login is successful, returning a token field, a random field r and a times field to the client equipment;
receiving a barrage protocol sent by the client equipment, wherein the barrage protocol comprises an encrypted k field;
judging whether the difference value between the timestamp of the bullet screen protocol and the timestamp of the bullet screen server is within a preset range, if so, decrypting the encrypted k field to obtain the k field;
searching a field R in a configuration file, wherein the field R is a result of performing time m 5 calculation on the random field R, and the configuration file is a corresponding relation among the random field R, the time field and the field R;
calculating a k field according to the token field, the room number of the live broadcast room, the timestamp of the bullet screen protocol, the sending times of the bullet screen, the bullet screen content and the field R;
and judging whether the k field obtained by decryption is consistent with the k field obtained by calculation, if so, passing the verification, and sending the next random field r to the client equipment.
In the embodiment of the application, the client equipment sends a login protocol to a barrage server of a live broadcast platform; the bullet screen server verifies the login protocol, if the verification is passed, the login is successful, and the bullet screen server returns a token field, a random field r and a time field to the client; the client equipment generates a bullet screen protocol; performing time m 5 calculation on the random field R, thereby obtaining a field R; the client device calculates a k field according to the token field, the room number of the live broadcast room, the timestamp of the bullet screen protocol, the sending times of the bullet screen, the bullet screen content and the field R, and encrypts the k field; adding the encrypted k field into the bullet screen protocol, and sending the bullet screen protocol added with the encrypted k field to the bullet screen server; after receiving a bullet screen protocol, a bullet screen server judges whether the difference value between the timestamp of the bullet screen protocol and the timestamp of the bullet screen server is within a preset range, and if so, decrypts the encrypted k field to obtain the k field; searching a field R in a configuration file, wherein the field R is a result of performing time secondary md5 calculation on the random field R, and the configuration file is a corresponding relation among the random field R, the time field and the field R; then calculating a k field according to the token field, the room number of the live broadcast room, the timestamp of the bullet screen protocol, the sending times of the bullet screen, the bullet screen content and the field R; and judging whether the k field obtained by decryption is consistent with the k field obtained by self calculation of the bullet screen server, if so, verifying to pass, playing the bullet screen content in the live broadcast room, and sending a next random field r to the client equipment, wherein the client equipment can calculate the k field of a next bullet screen protocol according to the next random field r. Therefore, according to the method and the device for processing the bullet screen, the illegal user can be timely found through verification of the login protocol, the illegal bullet screen protocol is identified through verification of the k field, and the mode of processing the bullet screen refreshing is enriched.
In addition, because MD5 can consume a certain CPU resource in calculation, and the more times the times of times the CPU is consumed, the scheme of performing MD5 calculation on the random field r for times of times in the embodiment of the present application can consume the CPU resource of the compiled automation script, so that an illegal device cannot generate a large number of check fields at the same time, and thus cannot realize batch behavior of swiping a bullet screen. Furthermore, the issuing of the random field r of the bullet screen server also enhances the control of the bullet screen server on the k field generated by the client device, and the client must rely on the random field r returned by the bullet screen server every time the k field is generated.
Drawings
Fig. 1 is a flowchart of a bullet screen verification method provided in an embodiment of the present application;
fig. 2 is a flowchart of another bullet screen verification method provided in the embodiments of the present application;
fig. 3 is an interaction diagram of a bullet screen verification method provided in an embodiment of the present application;
FIG. 4 is a schematic structural diagram of a computer-readable storage medium provided in an embodiment of the present application;
FIG. 5 is a schematic structural diagram of a computer device provided in an embodiment of the present application;
FIG. 6 is a schematic structural diagram of another computer-readable storage medium provided in an embodiment of the present application;
FIG. 7 is a schematic structural diagram of another computer device provided in an embodiment of the present application;
Detailed Description
The embodiment of the application provides a bullet screen verification method, computer equipment and a storage medium, and solves the problem that in the prior art, the processing mode for brushing bullet screens is single. According to the method and the device, the illegal user can be timely found through the verification of the login protocol, the illegal barrage protocol is identified through verifying the k field, and the method for processing the barrage swiping is enriched.
In order to better understand the technical solutions, the technical solutions are further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application. Meanwhile, for convenience of introducing the technical solution in the embodiment of the present invention, the following description will be made based on a network structure including a live broadcast platform and a bullet screen server, and is not limited to the present application, where the client device and the bullet screen server are connected by a TCP protocol. It is to be understood that the function names or variable names used in the embodiments of the present application are not limited to the present application, and in some other possible implementations, other naming manners may be used.
The first embodiment is as follows:
referring to fig. 1, the barrage verification method provided in this embodiment is applied to a client device, and the method includes the following steps:
s101, sending a login protocol to a barrage server of a live broadcast platform;
s102, if the login is successful, receiving a token field, a random field r and a time field returned by the bullet screen server;
s103, generating a bullet screen protocol;
the bullet screen protocol comprises bullet screen content and a time stamp of the bullet screen protocol.
S104, performing time m 5 calculation on the random field R to obtain a field R;
s105, calculating a k field according to the token field, the room number of the live broadcast room, the timestamp of the bullet screen protocol, the sending times of the bullet screen, the bullet screen content and the field R;
the method comprises the steps that a room number of a live broadcast room is obtained by sending a protocol for obtaining room information to a bullet screen server, the sending times of bullet screens are the times of successful bullet screen sending, and the initial value is 0 and is obtained by calculation according to bullet screen sending success information returned by the bullet screen server.
S106, encrypting the k field;
s107, adding the encrypted k field into the bullet screen protocol, and sending the bullet screen protocol added with the encrypted k field to the bullet screen server;
and S108, if the bullet screen is successfully sent, receiving the next random field r sent by the bullet screen server, wherein the next random field r is used for calculating the k field of the next bullet screen protocol.
Therefore, the login protocol is added on the client device side, and the k field is added in the barrage protocol, so that the illegal user and the illegal barrage protocol are distinguished, and the method for processing the barrage swiping is enriched.
The foregoing is a bullet screen verification method based on a client device, and based on the same inventive concept, the present application also provides another bullet screen verification method, which is applied to a bullet screen server of a live broadcast platform, and is specifically shown in fig. 2, and a second embodiment will be described below with reference to fig. 2.
Example two:
referring to fig. 2, the barrage verification method provided in this embodiment is applied to a barrage server of a live broadcast platform, and the method includes the following steps:
s201, receiving a login protocol sent by client equipment;
s202, if the login is successful, returning a token field, a random field r and a time field to the client equipment;
s203, receiving a barrage protocol sent by the client equipment, wherein the barrage protocol comprises an encrypted k field;
s204, judging whether the difference value between the timestamp of the bullet screen protocol and the timestamp of the bullet screen server is within a preset range, and if so, decrypting the encrypted k field to obtain the k field;
s205, searching a field R in the configuration file;
the field R is the result of time secondary md5 calculation on the random field R, and the configuration file is the corresponding relation of the random field R, the times field and the field R;
s206, calculating a k field according to the token field, the room number of the live broadcast room, the timestamp of the bullet screen protocol, the sending times of the bullet screen, the bullet screen content and the field R;
and S207, judging whether the k field obtained by decryption is consistent with the k field obtained by calculation, if so, passing the verification, and sending the next random field r to the client equipment.
Therefore, the verification of the login protocol and the verification of the k field in the bullet screen protocol are added on the bullet screen server side, so that the illegal user and the illegal bullet screen protocol are distinguished, and the mode of processing the bullet screen refreshing is enriched.
The bullet screen verification method provided by the second embodiment of the present application and the bullet screen verification method provided by the first embodiment of the present application belong to the same concept, and for better understanding of the present application, detailed description will be given below from the perspective of interaction between the client device and the bullet screen server with reference to fig. 3, please refer to the third embodiment.
Example three:
referring to fig. 3, the embodiment provides a barrage verification method from the perspective of interaction between a client device and a barrage server, and the method includes the following steps:
s301, the client device sends a login protocol to a bullet screen server of the live broadcast platform;
correspondingly, the bullet screen server receives the login protocol sent by the client device.
Specifically, for the client device successfully linked to the live broadcast platform bullet screen server through the TCP, the client device actively logs in through an account password. The client equipment sends a login protocol to a barrage server of the live broadcast platform, the barrage server judges the legality of login information of the client equipment and judges whether the login information is a registered user, if the login information is illegal or not, the login fails, the barrage server can actively disconnect the link, and therefore false clients or unregistered users cannot send barrages on the live broadcast platform. And the login protocol can carry out complicated encryption verification on the account number and the password of the user, the barrage server can check the login encryption verification of the user, if the verification is correct, the login is successful, the client equipment is legal, and the subsequent barrage sending function can be carried out.
It should be noted that the client device includes, but is not limited to, a mobile phone, a tablet computer, a desktop computer, a PDA (Personal Digital Assistant), a vehicle-mounted computer, and a smart watch.
S302, if the login is successful, the client device receives a token field, a random field r and a time field returned by the bullet screen server;
correspondingly, if the login is successful, the bullet screen server returns a token field, a random field r and a time field to the client device.
the token is a user which can effectively verify whether the client device is registered and logged in by one live broadcast platform, and the token can guarantee that the token values of different users are different. In the embodiment, the token field is added into the calculation of the bullet screen verification field, so that different users are guaranteed, and finally, the calculated verification fields are different.
The random field r is a random number generated by the bullet screen server, specifically, a 16-bit random number generated by calling a system random function and corresponding to the client device to record the data, and meanwhile, the bullet screen server can reply a login return message to the client device and carry the random field r in a subsequent bullet screen sending protocol, so that the client device can use different random fields r to calculate the k field each time the client device sends the bullet screen protocol. Therefore, the client device cannot independently complete the calculation of the verification field when sending the barrage each time, and the calculation of the verification field of the next barrage can be completed only by sending the verification field through the server, so that the capability of the barrage server for controlling the client device is greatly enhanced.
As an example, the existing bullet screen server replies to the client device with an authentication protocol, which includes a bullet screen successful sending message or a bullet screen failed sending message, and may also be referred to as a bullet screen sending protocol, and is configured to notify the client device whether the bullet screen is successfully sent:
type@=chatres/len=50/code@=0/
the type @ ═ chatres is the message type replied by the server;
wherein len-50 is the content length of the whole barrage protocol;
wherein code @ ═ 0 indicates that the bullet screen is successfully sent.
In this embodiment, a field information, that is, a random field r, issued by the bullet screen server is added to the protocol, and is used for participating in the verification calculation of the bullet screen protocol when the client sends the bullet screen next time.
In this embodiment, for each bullet screen protocol sent to the bullet screen server, a random number with a length of 16 bits is generated and added to the authentication protocol replied to the client device. The specific implementation may use a function R ═ rand (), where the bullet screen server calls a system random function to generate a 16-bit random number, and records the data to the client device, and meanwhile, carries the field information in the existing authentication protocol replied to the client, as an example, the authentication protocol after adding the random field R is as follows:
type@=chatres/len=50/code@=0/r@=48ac3dbca9823456/
meanwhile, the first barrage protocol of the client is a barrage protocol without a server reply verification protocol, so when the random field r of the first barrage protocol is logged in the barrage server by the client equipment, the barrage server carries the field in a message returned by login.
In addition, the embodiment adds a time field for informing the client device of the number of times of calculating the random field r.
S303, the client device generates a bullet screen protocol;
the bullet screen protocol comprises bullet screen content and a time stamp of the bullet screen protocol. It is understood that the barrage protocol is an existing barrage protocol, for example, the existing barrage protocol is as follows:
type@=chatmessage/content@=666/style@=/ts@=1520128375/
wherein "type @ chatessage" indicates that this protocol is a protocol for transmitting a bullet screen.
Wherein "content @ ═ 666" indicates that the bullet screen content is "666".
Wherein "style @ ═ indicates the style, color size, etc. of the bullet screen.
Where "ts @ ═ 1520128375" denotes the timestamp information of this bullet screen protocol.
In this embodiment, an authentication field k field is added to the existing bullet screen protocol for verifying the validity of the bullet screen protocol.
S304, the client device calculates the random field R by time md5 to obtain a field R;
specifically, the client device obtains the value of the time field.
Then, the MD5 value of time is repeatedly calculated for the content of the random field r according to the value of the time field, and a for loop can be written, where the loop time is time, for example:
For(int i=0;i<times;i++)
R=md5.create(r);
each cycle is to calculate the md5 value for the random field R, and the last calculated md5 result is used as the input for the next calculation, thus resulting in the md5 value for the field R, i.e., the random field R, calculated times. Since md5 consumes a certain CPU resource, the greater the times, the more CPU resources are consumed.
S305, the client device calculates a k field according to the token field, the room number of the live broadcast room, the timestamp of the bullet screen protocol, the sending times of the bullet screen, the bullet screen content and the field R;
specifically, the k field can be calculated by the following formula:
k=md5.create(token+roomid+ts+no+content+R);
wherein md5.create is a calculation interface of the hash algorithm MD5, and in this embodiment, the MD5 is used to calculate a k field, and finally a verification field with a fixed length of 32 bits is obtained, it can be understood that in some possible implementation manners, other algorithms may be selected, and this is not limited too much;
the token is the token field, wherein different users can be realized by adding the token, and finally calculated verification fields are different;
the roomid is a room number of the live broadcast room, wherein the room number of the live broadcast room is added, so that the final verification fields of the same user, the same barrage content and different live broadcast rooms at the same time are different, and specifically, the room number of the live broadcast room is obtained by sending a protocol for obtaining room information to the barrage server;
ts is a timestamp of the bullet screen protocol and can be obtained from the bullet screen protocol, wherein for the same bullet screen content, the same user and the same live broadcast room, the time of the bullet screen protocol is added into the verification fields, so that the final verification fields at different moments can be guaranteed to be different;
no is the number of times of sending the bullet screen, and it can be understood that the number of times of sending the bullet screen refers to the number of times of successfully sending the bullet screen, and 1 is added to no every time a bullet screen is successfully sent. Specifically, after the bullet screen is sent successfully, the number of times of sending of bullet screen can be calculated according to the bullet screen that the bullet screen server returned and is sent the successful message and obtain, and the initial value is 0, and every bullet screen that receives a bullet screen server and return sends the successful message, client device's bullet screen calculated value no then can add 1, and is corresponding, and the bullet screen server also has the number of times of sending of record bullet screen, and after the bullet screen sends successfully, bullet screen calculated value no of bullet screen server also can add 1.
In addition, as the time of the client device and the time of the bullet screen server cannot be completely guaranteed to be consistent, the common rule is that the timestamp for sending the bullet screen reported by the client device is subjected to compatibility processing within a certain range, and the timestamp of the bullet screen protocol and the timestamp of the bullet screen server are considered to be legal as long as the difference value of the timestamp of the bullet screen protocol and the timestamp of the bullet screen server is within a preset range, so that for illegal bullet screen brushing, the same timestamp of the bullet screen protocol can be used for bypassing the verification at different moments, the sending times of the bullet screen are added, and the timestamp of the same bullet screen protocol can be avoided, so that the verification at different moments is bypassed;
content is the barrage content, i.e. the barrage content that the barrage protocol prepares to send, and can be obtained from the barrage protocol.
R is the result of the random field R making time md5 calculations.
S306, the k field is encrypted by the client device;
in order to further protect the k field, the embodiment encrypts the k field again, thereby further improving the security of data transmission and the threshold of being broken. For the live broadcast platform, the total bullet screen amount is huge, and the bullet screen amount received by the bullet screen server at the same moment is also huge, if a complex encryption verification algorithm is adopted, the performance bottleneck of the bullet screen server can be finally caused, and therefore greater calculation pressure is caused for the bullet screen server. Therefore, a lightweight encryption algorithm may be employed to perform encryption and decryption calculations on the data. In this embodiment, a TEA encryption algorithm is used to further encrypt the final k field, which is not limited to this application, and in some possible implementations, other encryption manners may also be used. In addition, in order to ensure that the encryption result changes every time, the present embodiment adopts r as the key value of the encryption algorithm TEA.
Specifically, encrypt is tea (r, ts);
encrypt is an encryption interface of an encryption algorithm tea;
r is the random field r;
ts is the timestamp of the bullet screen protocol;
encryptk is the encryption result of the k field.
S307, the client device adds the encrypted k field into the barrage protocol and sends the barrage protocol added with the encrypted k field to the barrage server;
specifically, step S307 can be divided into S307a and S307 b:
s307a, adding the encrypted k field into the barrage protocol by the client;
in consideration of the functions compatible with the existing barrage protocol and different versions of the client, the embodiment does not need to modify the existing barrage protocol, but adds the k field into the existing barrage protocol by adding one field.
S307b, the client device sends the barrage protocol added with the encrypted k field to the barrage server;
correspondingly, the barrage server receives a barrage protocol sent by the client equipment, wherein the barrage protocol comprises an encrypted k field;
s308, the bullet screen server judges whether the difference value between the timestamp of the bullet screen protocol and the timestamp of the bullet screen server is within a preset range, and if so, decrypts the encrypted k field to obtain the k field;
in order to prevent that the illegal part of the bullet screen from bypassing the checking strategy, and use the fixed bullet screen protocol timestamp, this embodiment can check the timestamp in the current bullet screen protocol, and the bullet screen server can acquire the timestamp of bullet screen server, judges whether the difference of the timestamp of this bullet screen server and the timestamp of client device's bullet screen protocol is in the preset range, if yes, then explains that client device's timestamp information is legal, otherwise is illegal. Preferably, the preset range may be 5 minutes. And if the difference value is within a preset range, decrypting the encrypted k field to obtain the original k field.
Specifically, the encrypted k field may be decrypted by the following formula:
k=TEA.decrypt(r,encryptk);
wherein, TEA is the decryption interface of the TEA encryption algorithm;
r is the random field r;
encryptk is the encrypted k field.
It is understood that the decryption algorithm of the bullet screen server corresponds to the encryption algorithm of the client.
S309, the bullet screen server searches a field R in the configuration file;
the field R is the result of performing time secondary md5 calculation on the random field R, and the configuration file is the corresponding relation of the random field R, the times field and the field R.
In order to reduce the calculation pressure of the bullet screen server, the bullet screen server can generate random data in advance, then MD5 operation of time times is carried out on the random data to obtain a field R, and then the corresponding relation between the random field R, the time field and the field R is stored in a configuration file, so that the bullet screen server does not need to calculate the MD5 value of the time times of the random field R after receiving a bullet screen protocol every time, and only needs to calculate the field R from the configuration file through the random field R and the time field.
Meanwhile, in order to prevent hackers from obtaining all configurations of the bullet screen server through an exhaustion method, the bullet screen server can regularly replace the whole configuration content and issue the configuration through regeneration.
S310, calculating a k field by the bullet screen server according to the token field, the room number of the live broadcast room, the timestamp of the bullet screen protocol, the sending times of the bullet screen, the bullet screen content and the field R;
the bullet screen server will use the same method as the client to calculate the original k field information. The client device calculates the k field by using token + roomid + ts + no + content + R to calculate the MD5 result, and the bullet screen server calculates the k field by the same method. The token is issued to the client by the bullet screen server, so that the bullet screen server stores the token value of the client device. The barrage server records the room number of the live broadcast room of the client device when the client device logs in, so the barrage server stores the room number roomid of the live broadcast room of the client device. The bullet screen server also records the number of times of bullet screens sent by the client device, so that the bullet screen server also has the number no of times of sending bullet screens, which is the same as that of the client device. content is the barrage content sent by the client, and the barrage server can obtain the barrage content from the barrage protocol sent by the client. Similarly, the timestamp ts of the bullet screen protocol can also be obtained from the bullet screen protocol. The field R may be looked up in a configuration file. So that all the field bullet screen servers that compute the k field have, the same md5 algorithm can be used to compute the original k field.
k=md5.create(token+roomid+ts+no+content+R);
Wherein, md5.create is a computing interface of the hash algorithm md 5;
token is the token field;
roomid is the room number of the live room;
ts is the timestamp of the bullet screen protocol;
no is the number of times of sending the bullet screen;
content is the bullet screen content.
R is the result of the random field R making time md5 calculations.
And S311, judging whether the k field obtained by decryption is consistent with the k field obtained by calculation, if so, passing the verification, and sending the next random field r to the client equipment.
Step S311 can be further divided into S311a and S311b, as follows:
s311a, judging whether the k field obtained by decryption is consistent with the k field obtained by calculation, if so, passing the verification;
after the k field is calculated, the bullet screen server compares whether the k field calculated by the bullet screen server is consistent with the k field reported from the client, namely whether the k field obtained by decryption is consistent with the k field obtained by calculation, if not, the bullet screen protocol is illegal, otherwise, the bullet screen protocol is considered to be legal, and the verification is passed.
Through the same md5 calculation, the token, the room number, the timestamp, the bullet screen sending times, the bullet screen content and the field R of the client are indirectly checked, and the same k field can be finally obtained only if the client and the bullet screen server are consistent.
S311b, the bullet screen server sends the next random field r to the client device.
Correspondingly, if the bullet screen is successfully sent, the client device receives the next random field r sent by the bullet screen server, and the next random field r is used for calculating the k field of the next bullet screen protocol, so that the process is repeated. The bullet screen server can carry the random field r in a bullet screen sending protocol which is replied to the client device, and the protocol is also used for informing the client device of successful bullet screen sending. It is to be understood that the generation of the random field r and the calculation and verification of the k field have been described in detail above, and the subsequent generation of each random field r and the calculation and verification of each k field are similar and will not be described herein again.
It should be further noted that, when the live broadcast platform performs some large event activities, the bullet screen amount of the live broadcast platform is many times of the ordinary bullet screen amount, and in consideration of the performance pressure of the bullet screen server, whether to perform verification or not can be flexibly selected according to the actual situation, or verification is performed by adopting a spot check method. Therefore, the bullet screen server can be easily compatible with the original bullet screen protocol and the bullet screen protocol added with verification.
In the embodiment of the application, the client equipment sends a login protocol to a barrage server of a live broadcast platform; the bullet screen server verifies the login protocol, if the verification is passed, the login is successful, and the bullet screen server returns a token field, a random field r and a time field to the client; the client equipment generates a bullet screen protocol; performing time m 5 calculation on the random field R, thereby obtaining a field R; the client device calculates a k field according to the token field, the room number of the live broadcast room, the timestamp of the bullet screen protocol, the sending times of the bullet screen, the bullet screen content and the field R, and encrypts the k field; adding the encrypted k field into the bullet screen protocol, and sending the bullet screen protocol added with the encrypted k field to the bullet screen server; after receiving a bullet screen protocol, a bullet screen server judges whether the difference value between the timestamp of the bullet screen protocol and the timestamp of the bullet screen server is within a preset range, and if so, decrypts the encrypted k field to obtain the k field; searching a field R in a configuration file, wherein the field R is a result of performing time secondary md5 calculation on the random field R, and the configuration file is a corresponding relation among the random field R, the time field and the field R; then calculating a k field according to the token field, the room number of the live broadcast room, the timestamp of the bullet screen protocol, the sending times of the bullet screen, the bullet screen content and the field R; and judging whether the k field obtained by decryption is consistent with the k field obtained by self calculation of the bullet screen server, if so, verifying to pass, playing the bullet screen content in the live broadcast room, and sending a next random field r to the client equipment, wherein the client equipment can calculate the k field of a next bullet screen protocol according to the next random field r. Therefore, according to the method and the device for processing the bullet screen, the illegal user can be timely found through verification of the login protocol, the illegal bullet screen protocol is identified through verification of the k field, and the mode of processing the bullet screen refreshing is enriched.
In addition, because MD5 can consume a certain CPU resource in calculation, and the more times the times of times the CPU is consumed, the scheme of performing MD5 calculation on the random field r for times of times in the embodiment of the present application can consume the CPU resource of the compiled automation script, so that an illegal device cannot generate a large number of check fields at the same time, and thus cannot realize batch behavior of swiping a bullet screen. Furthermore, the issuing of the random field r of the bullet screen server also enhances the control of the bullet screen server on the k field generated by the client device, and the client must rely on the random field r returned by the bullet screen server every time the k field is generated.
Based on the same inventive concept, the present application provides a computer-readable storage medium, which is shown in fig. 4 in detail, and a fourth embodiment will be described with reference to fig. 4.
Example four:
the present embodiment provides a computer-readable storage medium 400, the computer-readable storage medium 400 storing a computer program 411, the computer program 411 realizing the following steps when executed by a processor:
sending a login protocol to a bullet screen server of a live broadcast platform;
if the login is successful, receiving a token field, a random field r and a time field returned by the bullet screen server;
generating a bullet screen protocol, wherein the bullet screen protocol comprises bullet screen contents and a timestamp of the bullet screen protocol;
performing time m 5 calculation on the random field R, thereby obtaining a field R;
calculating a k field according to the token field, the room number of the live broadcast room, the timestamp of the bullet screen protocol, the sending times of the bullet screen, the bullet screen content and the field R, wherein the room number of the live broadcast room is obtained by sending a protocol for obtaining room information to the bullet screen server, the sending times of the bullet screen is the times of successful bullet screen sending, and the initial value is 0;
encrypting the k field;
adding the encrypted k field into the bullet screen protocol, and sending the bullet screen protocol added with the encrypted k field to the bullet screen server;
and if the bullet screen is successfully sent, receiving a next random field r sent by the bullet screen server, wherein the next random field r is used for calculating a k field of a next bullet screen protocol.
In a specific implementation process, when the computer program 411 is executed by a processor, all the steps performed by the client device in the above embodiments may be implemented, which is not described herein again.
Based on the same inventive concept, the present application further provides a computer device, which is detailed in fig. 5, and a fifth embodiment will be described with reference to fig. 5.
Example five:
the present application provides a computer device 500 comprising a processor 520, a memory 510 and a computer program 511 stored on the memory 510 and executable on the processor 520, the processor 520 realizing the following steps when executing the computer program 511:
sending a login protocol to a bullet screen server of a live broadcast platform;
if the login is successful, receiving a token field, a random field r and a time field returned by the bullet screen server;
generating a bullet screen protocol, wherein the bullet screen protocol comprises bullet screen contents and a timestamp of the bullet screen protocol;
performing time m 5 calculation on the random field R, thereby obtaining a field R;
calculating a k field according to the token field, the room number of the live broadcast room, the timestamp of the bullet screen protocol, the sending times of the bullet screen, the bullet screen content and the field R, wherein the room number of the live broadcast room is obtained by sending a protocol for obtaining room information to the bullet screen server, the sending times of the bullet screen is the times of successful bullet screen sending, and the initial value is 0;
encrypting the k field;
adding the encrypted k field into the bullet screen protocol, and sending the bullet screen protocol added with the encrypted k field to the bullet screen server;
and if the bullet screen is successfully sent, receiving a next random field r sent by the bullet screen server, wherein the next random field r is used for calculating a k field of a next bullet screen protocol.
In a specific implementation process, the computer device 500 includes, but is not limited to, a client device, and all steps performed by the client device in the foregoing embodiments may be implemented by the computer device 500, which is not described herein again.
Based on the same inventive concept, the present application provides a computer-readable storage medium, which is shown in fig. 6 in detail, and a sixth embodiment will be described below with reference to fig. 6.
Example six:
the present embodiment provides a computer-readable storage medium 600, the computer-readable storage medium 600 storing a computer program 611, the computer program 611 implementing the following steps when executed by a processor:
receiving a login protocol sent by client equipment;
if the login is successful, returning a token field, a random field r and a times field to the client equipment;
receiving a barrage protocol sent by the client equipment, wherein the barrage protocol comprises an encrypted k field;
judging whether the difference value between the timestamp of the bullet screen protocol and the timestamp of the bullet screen server is within a preset range, if so, decrypting the encrypted k field to obtain the k field;
searching a field R in a configuration file, wherein the field R is a result of performing time m 5 calculation on the random field R, and the configuration file is a corresponding relation among the random field R, the time field and the field R;
calculating a k field according to the token field, the room number of the live broadcast room, the timestamp of the bullet screen protocol, the sending times of the bullet screen, the bullet screen content and the field R;
and judging whether the k field obtained by decryption is consistent with the k field obtained by calculation, if so, passing the verification, and sending the next random field r to the client equipment.
In a specific implementation process, when the computer program 611 is executed by the processor, all the steps performed by the bullet screen server in the above embodiments may be implemented, which is not described herein again.
Based on the same inventive concept, the present application further provides a computer device, which is detailed in fig. 7, and a seventh embodiment will be described with reference to fig. 7.
Example seven:
the present application provides a computer arrangement 700 comprising a processor 720, a memory 710 and a computer program 711 stored on the memory 710 and executable on the processor 720, said processor 720 realizing the following steps when executing said computer program 711:
receiving a login protocol sent by client equipment;
if the login is successful, returning a token field, a random field r and a times field to the client equipment;
receiving a barrage protocol sent by the client equipment, wherein the barrage protocol comprises an encrypted k field;
judging whether the difference value between the timestamp of the bullet screen protocol and the timestamp of the bullet screen server is within a preset range, if so, decrypting the encrypted k field to obtain the k field;
searching a field R in a configuration file, wherein the field R is a result of performing time m 5 calculation on the random field R, and the configuration file is a corresponding relation among the random field R, the time field and the field R;
calculating a k field according to the token field, the room number of the live broadcast room, the timestamp of the bullet screen protocol, the sending times of the bullet screen, the bullet screen content and the field R;
and judging whether the k field obtained by decryption is consistent with the k field obtained by calculation, if so, passing the verification, and sending the next random field r to the client equipment.
In a specific implementation process, the computer device 700 includes, but is not limited to, a bullet screen server, and the computer device 700 may implement all the steps performed by the bullet screen server in the foregoing embodiments, which are not described herein again.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While the preferred embodiments of the present application have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all alterations and modifications as fall within the scope of the application.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.
Claims (10)
1. A bullet screen verification method is applied to a client device and comprises the following steps:
sending a login protocol to a bullet screen server of a live broadcast platform;
if the login is successful, receiving a token field, a random field r and a time field returned by the bullet screen server;
generating a bullet screen protocol, wherein the bullet screen protocol comprises bullet screen contents and a timestamp of the bullet screen protocol;
performing time m 5 calculation on the random field R, thereby obtaining a field R;
calculating a k field according to the token field, the room number of the live broadcast room, the timestamp of the bullet screen protocol, the sending times of the bullet screen, the bullet screen content and the field R, wherein the room number of the live broadcast room is obtained by sending a protocol for obtaining room information to the bullet screen server, the sending times of the bullet screen is the times of successful bullet screen sending, and the initial value is 0;
encrypting the k field;
adding the encrypted k field into the bullet screen protocol, and sending the bullet screen protocol added with the encrypted k field to the bullet screen server;
and if the bullet screen is successfully sent, receiving a next random field r sent by the bullet screen server, wherein the next random field r is used for calculating a k field of a next bullet screen protocol.
2. The method of claim 1, wherein said calculating a k field from the token field, the room number of the live room, the timestamp of the barrage protocol, the number of transmissions of the barrage, the content of the barrage, and the field R comprises calculating a k field according to the following formula:
k=md5.create(token+roomid+ts+no+content+R);
wherein, md5.create is a computing interface of the hash algorithm md 5;
token is the token field;
roomid is the room number of the live room;
ts is the timestamp of the bullet screen protocol;
no is the number of times of sending the bullet screen;
content is the bullet screen content;
r is the result of the random field R making time md5 calculations.
3. The method of claim 1 or 2, wherein said encrypting the k field comprises encrypting the k field according to the following formula:
encryptk=TEA.encrypt(r,ts)
encrypt is an encryption interface of an encryption algorithm tea;
r is the random field r;
ts is the timestamp of the bullet screen protocol;
encryptk is the encryption result of the k field.
4. A barrage verification method is applied to a barrage server of a live broadcast platform, and comprises the following steps:
receiving a login protocol sent by client equipment;
if the login is successful, returning a token field, a random field r and a times field to the client equipment;
receiving a barrage protocol sent by the client equipment, wherein the barrage protocol comprises an encrypted k field;
judging whether the difference value between the timestamp of the bullet screen protocol and the timestamp of the bullet screen server is within a preset range, if so, decrypting the encrypted k field to obtain the k field;
searching a field R in a configuration file, wherein the field R is a result of performing time m 5 calculation on the random field R, and the configuration file is a corresponding relation among the random field R, the time field and the field R;
calculating a k field according to the token field, the room number of the live broadcast room, the timestamp of the bullet screen protocol, the sending times of the bullet screen, the bullet screen content and the field R;
and judging whether the k field obtained by decryption is consistent with the k field obtained by calculation, if so, passing the verification, and sending the next random field r to the client equipment.
5. The method of claim 4, wherein calculating the k field from the token field, the room number of the live room, the timestamp of the barrage protocol, the number of transmissions of the barrage, the content of the barrage, and the field R comprises calculating the k field according to the following formula:
k=md5.create(token+roomid+ts+no+content+R);
wherein, md5.create is a computing interface of the hash algorithm md 5;
token is the token field;
roomid is the room number of the live room;
ts is the timestamp of the bullet screen protocol;
no is the number of times of sending the bullet screen;
content is the bullet screen content;
r is the result of the random field R making time md5 calculations.
6. The method of claim 4 or 5, wherein decrypting the encrypted k field to obtain the k field comprises decrypting the encrypted k field to obtain the k field according to the following formula:
k=TEA.decrypt(r,encryptk);
wherein, TEA is the decryption interface of the TEA encryption algorithm;
r is the random field r;
encryptk is the encrypted k field.
7. A computer-readable storage medium storing a computer program, the computer program when executed by a processor implementing the steps of:
sending a login protocol to a bullet screen server of a live broadcast platform;
if the login is successful, receiving a token field, a random field r and a time field returned by the bullet screen server;
generating a bullet screen protocol, wherein the bullet screen protocol comprises bullet screen contents and a timestamp of the bullet screen protocol;
performing time m 5 calculation on the random field R, thereby obtaining a field R;
calculating a k field according to the token field, the room number of the live broadcast room, the timestamp of the bullet screen protocol, the sending times of the bullet screen, the bullet screen content and the field R, wherein the room number of the live broadcast room is obtained by sending a protocol for obtaining room information to the bullet screen server, the sending times of the bullet screen is the times of successful bullet screen sending, and the initial value is 0;
encrypting the k field;
adding the encrypted k field into the bullet screen protocol, and sending the bullet screen protocol added with the encrypted k field to the bullet screen server;
and if the bullet screen is successfully sent, receiving a next random field r sent by the bullet screen server, wherein the next random field r is used for calculating a k field of a next bullet screen protocol.
8. A computer device comprising a processor, a memory, and a computer program stored on the memory and executable on the processor, wherein the processor when executing the computer program implements the steps of:
sending a login protocol to a bullet screen server of a live broadcast platform;
if the login is successful, receiving a token field, a random field r and a time field returned by the bullet screen server;
generating a bullet screen protocol, wherein the bullet screen protocol comprises bullet screen contents and a timestamp of the bullet screen protocol;
performing time m 5 calculation on the random field R, thereby obtaining a field R;
calculating a k field according to the token field, the room number of the live broadcast room, the timestamp of the bullet screen protocol, the sending times of the bullet screen, the bullet screen content and the field R, wherein the room number of the live broadcast room is obtained by sending a protocol for obtaining room information to the bullet screen server, the sending times of the bullet screen is the times of successful bullet screen sending, and the initial value is 0;
encrypting the k field;
adding the encrypted k field into the bullet screen protocol, and sending the bullet screen protocol added with the encrypted k field to the bullet screen server;
and if the bullet screen is successfully sent, receiving a next random field r sent by the bullet screen server, wherein the next random field r is used for calculating a k field of a next bullet screen protocol.
9. A computer-readable storage medium storing a computer program, the computer program when executed by a processor implementing the steps of:
receiving a login protocol sent by client equipment;
if the login is successful, returning a token field, a random field r and a times field to the client equipment;
receiving a barrage protocol sent by the client equipment, wherein the barrage protocol comprises an encrypted k field;
judging whether the difference value between the timestamp of the bullet screen protocol and the timestamp of the bullet screen server is within a preset range, if so, decrypting the encrypted k field to obtain the k field;
searching a field R in a configuration file, wherein the field R is a result of performing time m 5 calculation on the random field R, and the configuration file is a corresponding relation among the random field R, the time field and the field R;
calculating a k field according to the token field, the room number of the live broadcast room, the timestamp of the bullet screen protocol, the sending times of the bullet screen, the bullet screen content and the field R;
and judging whether the k field obtained by decryption is consistent with the k field obtained by calculation, if so, passing the verification, and sending the next random field r to the client equipment.
10. A computer device comprising a processor, a memory, and a computer program stored on the memory and executable on the processor, wherein the processor when executing the computer program implements the steps of:
receiving a login protocol sent by client equipment;
if the login is successful, returning a token field, a random field r and a times field to the client equipment;
receiving a barrage protocol sent by the client equipment, wherein the barrage protocol comprises an encrypted k field;
judging whether the difference value between the timestamp of the bullet screen protocol and the timestamp of the bullet screen server is within a preset range, if so, decrypting the encrypted k field to obtain the k field;
searching a field R in a configuration file, wherein the field R is a result of performing time m 5 calculation on the random field R, and the configuration file is a corresponding relation among the random field R, the time field and the field R;
calculating a k field according to the token field, the room number of the live broadcast room, the timestamp of the bullet screen protocol, the sending times of the bullet screen, the bullet screen content and the field R;
and judging whether the k field obtained by decryption is consistent with the k field obtained by calculation, if so, passing the verification, and sending the next random field r to the client equipment.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810316801.7A CN108769718B (en) | 2018-04-10 | 2018-04-10 | Barrage verification method, computer equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810316801.7A CN108769718B (en) | 2018-04-10 | 2018-04-10 | Barrage verification method, computer equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108769718A CN108769718A (en) | 2018-11-06 |
CN108769718B true CN108769718B (en) | 2020-12-15 |
Family
ID=63981661
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810316801.7A Active CN108769718B (en) | 2018-04-10 | 2018-04-10 | Barrage verification method, computer equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108769718B (en) |
Family Cites Families (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103647777B (en) * | 2013-12-13 | 2017-04-12 | 华为技术有限公司 | Safety certificate method and bidirectional forwarding detection BFD equipment |
CN105847717B (en) * | 2016-05-30 | 2019-06-04 | 武汉斗鱼网络科技有限公司 | A kind of method, client and the server of barrage report |
CN106060057B (en) * | 2016-06-17 | 2019-04-05 | 武汉斗鱼网络科技有限公司 | Net cast website generates the system and method for white list based on user's barrage behavior |
CN105939485B (en) * | 2016-06-27 | 2018-11-06 | 武汉斗鱼网络科技有限公司 | System and method based on user's barrage behavior monitoring barrage service availability |
CN106534905B (en) * | 2016-12-09 | 2019-08-02 | 武汉斗鱼网络科技有限公司 | A kind of method and system of the live streaming of video barrage platform and the intercommunication of third-party platform barrage |
CN106788983B (en) * | 2017-03-01 | 2020-07-10 | 北京同有飞骥科技股份有限公司 | Communication data encryption method and device based on client/server mode |
CN107155113B (en) * | 2017-03-31 | 2021-03-16 | 武汉斗鱼网络科技有限公司 | Method and server for protecting bullet screen information |
CN107484032B (en) * | 2017-09-08 | 2018-08-03 | 武汉斗鱼网络科技有限公司 | Prevent the verification method brushed and device |
-
2018
- 2018-04-10 CN CN201810316801.7A patent/CN108769718B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN108769718A (en) | 2018-11-06 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10790976B1 (en) | System and method of blockchain wallet recovery | |
CN107251035B (en) | Account recovery protocol | |
CN107302438B (en) | Private key protection method, system and device based on key updating | |
US8539241B2 (en) | Method and system for securing communication | |
US20130166909A1 (en) | Client-Side Player File and Content License Verification | |
CN109729041B (en) | Method and device for issuing and acquiring encrypted content | |
Ghaffar et al. | An improved authentication scheme for remote data access and sharing over cloud storage in cyber-physical-social-systems | |
CN108199847B (en) | Digital security processing method, computer device, and storage medium | |
CN107370599B (en) | Management method, device and system for remotely destroying private key | |
EP3457309A1 (en) | Processing method for presenting copy attack, and server and client | |
CN109981576B (en) | Key migration method and device | |
CN109088810A (en) | Communication means, device, relevant device, system and the storage medium of group message | |
CN105812366A (en) | Server, anti-crawler system and anti-crawler verification method | |
CN110380859B (en) | Quantum communication service station identity authentication method and system based on asymmetric key pool pair and DH protocol | |
US9075798B2 (en) | Verifying authenticity of input using a hashing algorithm | |
CN115242553B (en) | Data exchange method and system supporting safe multi-party calculation | |
CN117240625B (en) | Tamper-resistant data processing method and device and electronic equipment | |
CN114553590A (en) | Data transmission method and related equipment | |
Shin et al. | A Survey of Public Provable Data Possession Schemes with Batch Verification in Cloud Storage. | |
CN111131127B (en) | Communication method based on live broadcast platform and related device | |
Al‐Balasmeh et al. | Framework of data privacy preservation and location obfuscation in vehicular cloud networks | |
CN111241492A (en) | Product multi-tenant secure credit granting method, system and electronic equipment | |
CN114117406A (en) | Data processing method, device, equipment and storage medium | |
CN108933766B (en) | Method and client for improving equipment ID security | |
CN113329004A (en) | Authentication method, system and device |
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 |