Summary of the invention
The purpose of the invention is to overcome the shortcomings of above-mentioned background technique, a kind of net cast website is provided and is based on user
Barrage behavior generates the system and method for white list,
The present invention provides a kind of system that net cast website generates white list based on user's barrage behavior, which includes
Client and server end, the server end include distributed several real-time computing units, and client obtains user's input
Barrage content, the barrage information of the EIC equipment identification code containing encryption is sent to server end, server end is worked as to watching
The all clients of preceding live streaming broadcast barrage;
Server end is cached and is pre-processed to the barrage information that client is submitted, and the undesirable number of format is abandoned
According to;
Server end submits to the data in caching according to time granularity or the batch mode of fixed size data slice
Distributed several real-time computing units;
Real-time computing unit verifies the validity of user's barrage behavior according to the UUID of data slice, if verifying is effectively,
User ID is updated into white list fragment, white list carries out fragment storage according to User ID;If verifying is invalid, use is abandoned
Family barrage information;
The EIC equipment identification code encrypted in barrage information is decrypted in server end, then takes out timestamp and equipment
Whether whether identification code, checking time stamp in zone of reasonableness, calibration equipment identification code meet specification;
Obtained white list by Restful interface or remote procedure call interface, is supplied to it by server end
He using.
Based on the above technical solution, the client is submitted in the barrage information of server end comprising several use
In identification the behavior of user's barrage mark: direct broadcasting room address, user input content, user's uniqueness ID and according to specific rule
The EIC equipment identification code of the encryption then generated.
Based on the above technical solution, the create-rule of the EIC equipment identification code is: timestamp+equipment application programming
The Unique Device ID+ random number that interface API is obtained, the EIC equipment identification code of generation is regular length, is then known to the equipment of generation
Other code is encrypted.
Based on the above technical solution, the format is undesirable refers to: barrage content includes sensitive or illegal
Content, direct broadcasting room address format are illegal, Customs Assigned Number be it is empty, do not meet data field type, timestamp format not to, client
Type identification is illegal.
Based on the above technical solution, the server end according to specified data slice ID Hash strategy, by data
Piece distributes to specified real-time computing unit processing, and specific implementation is: to data slice distribute one it is random general unique
Identification code UUID obtains the ID of real-time computing unit to the number modulus of real-time computing unit, submits to the real-time computing unit
Data slice.
The behavior of user's barrage, which is based on, the present invention also provides a kind of net cast website suitable for above system generates white name
Single method, comprising the following steps:
S1, client obtain the barrage content of user's input, send the EIC equipment identification code containing encryption to server end
Barrage information, server end broadcast barrage to all clients for watching current live;
S2, server end are cached and are pre-processed to the barrage information that client is submitted, and it is undesirable to abandon format
Data;
S3, server end propose the data in caching according to time granularity or the batch mode of fixed size data slice
Give distributed several real-time computing units;
S4, real-time computing unit verify the validity of user's barrage behavior according to the UUID of data slice, if verifying has
Effect then updates User ID into white list fragment, and white list carries out fragment storage according to User ID;If verifying is invalid,
Abandon user's barrage information;
The EIC equipment identification code encrypted in barrage information is decrypted in S5, server end, then take out timestamp and
Whether whether EIC equipment identification code, checking time stamp in zone of reasonableness, calibration equipment identification code meet specification;
S6, server end by Restful interface or remote procedure call interface, provide obtained white list
It is used to other application.
Based on the above technical solution, in step S1, client, which is submitted in the barrage information of server end, includes
The mark of several barrage behaviors of user for identification: direct broadcasting room address, user input content, user's uniqueness ID and according to
The EIC equipment identification code for the encryption that ad hoc rules generates.
Based on the above technical solution, the create-rule of the EIC equipment identification code is: timestamp+equipment application programming
The Unique Device ID+ random number that interface API is obtained, the EIC equipment identification code of generation is regular length, is then known to the equipment of generation
Other code is encrypted.
Based on the above technical solution, in step S2, format is undesirable to be referred to: barrage content include it is sensitive or
Illegal contents, direct broadcasting room address format are illegal, Customs Assigned Number be it is empty, do not meet data field type, timestamp format not to, visitor
Family end type identification is illegal.
Based on the above technical solution, in step S3, server end according to specified data slice ID Hash strategy,
Data slice is distributed into specified real-time computing unit processing, specific implementation is: to data slice distribute one it is random logical
The ID of real-time computing unit is obtained to the number modulus of real-time computing unit with unique identifier UUID, it is single to the real-time calculating
Member submits data slice.
Compared with prior art, advantages of the present invention is as follows:
(1) the present invention is based on user's barrage behaviors to generate white list, can limit inactive users and cheating user participates in
The interactive event of main broadcaster guarantees effective progress of interactive event.
(2) white list that the present invention generates, can filter inactive users account in multiple important scenes.
Specific embodiment
With reference to the accompanying drawing and specific embodiment the present invention is described in further detail.
The embodiment of the present invention provides a kind of system that net cast website generates white list based on user's barrage behavior, this is
System includes client and server end, and server end includes distributed several real-time computing units.
Shown in Figure 1, the embodiment of the present invention provides a kind of net cast website suitable for above system and is based on user
The method of barrage behavior generation white list, comprising the following steps:
S1, certain customers can send barrage during watching live streaming to express the emotion of oneself, client, which obtains, to be used
The barrage content of family input, the barrage information of the EIC equipment identification code containing encryption is sent to server end, server end is to
The all clients for watching current live broadcast barrage.
Client submits to the mark in the barrage information of server end comprising several barrage behaviors of user for identification: straight
Broadcast an address, user input content, user's uniqueness ID and according to ad hoc rules generate encryption EIC equipment identification code.
The create-rule of EIC equipment identification code is: timestamp+equipment API (Application Programming
Interface, Application Programming Interface) obtain Unique Device ID+ random number, the EIC equipment identification code of generation is regular length, so
The EIC equipment identification code of generation is encrypted afterwards.
S2, server end are cached and are pre-processed to the barrage information that client is submitted, and it is undesirable to abandon format
Data, format is undesirable to be referred to: barrage content includes that sensitive or illegal contents, direct broadcasting room address format be illegal, user
Number be it is empty, do not meet data field type, timestamp format, client type is not identified it is illegal.
S3, server end propose the data in caching according to time granularity or the batch mode of fixed size data slice
Give distributed several real-time computing units;For example, strategy of the server end according to specified data slice ID Hash, by data
Piece distributes to specified real-time computing unit processing, in order to the horizontal extension ability of real-time computing unit is improved, in this way,
Server end can accordingly increase and decrease the quantity for participating in the real-time computing unit calculated according to the scale of data volume.Specific implementation side
Formula is: distributing random UUID (Universally Unique Identifier, a general unique identification to data slice
Code), then to the number modulus of real-time computing unit, the ID of real-time computing unit is obtained, is then mentioned to the real-time computing unit
Hand over data slice.Time granularity, fixed size data slice are set according to actual needs, in practical applications, can be by time granularity
It is set as 1 second, fixed size data slice is set as 1MB.
S4, real-time computing unit verify the validity of user's barrage behavior according to the UUID of data slice, if verifying has
Effect then updates User ID into white list fragment, and white list carries out fragment storage according to User ID;If verifying is invalid,
User's barrage information is abandoned, normal users barrage is just only considered as by the barrage that normal client is sent.
The EIC equipment identification code encrypted in barrage information is decrypted in S5, server end, then take out timestamp and
Whether whether EIC equipment identification code, checking time stamp in zone of reasonableness, calibration equipment identification code meet specification.
S6, server end by obtained white list by Restful (Representational State Transfer,
A kind of software architecture style) interface or RPC (Remote Procedure Call, remote procedure call) interface, it is supplied to it
He using.
The white list generated according to the method described above can filter inactive users account in multiple important scenes.
Those skilled in the art can carry out various modifications to the embodiment of the present invention and modification, if these modifications and change
For type within the scope of the claims in the present invention and its equivalent technologies, then these modifications and variations are also in protection scope of the present invention
Within.
The prior art that the content being not described in detail in specification is known to the skilled person.