WO2019061599A1 - 一种鉴权方法及服务器 - Google Patents
一种鉴权方法及服务器 Download PDFInfo
- Publication number
- WO2019061599A1 WO2019061599A1 PCT/CN2017/107088 CN2017107088W WO2019061599A1 WO 2019061599 A1 WO2019061599 A1 WO 2019061599A1 CN 2017107088 W CN2017107088 W CN 2017107088W WO 2019061599 A1 WO2019061599 A1 WO 2019061599A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- client
- blockchain
- target
- server
- computing
- Prior art date
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/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/25808—Management of client data
- H04N21/25816—Management of client data involving client authentication
-
- 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/10—Protocols in which an application is distributed across nodes in the network
-
- 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/25808—Management of client data
- H04N21/25833—Management of client data involving client hardware characteristics, e.g. manufacturer, processing or storage capabilities
-
- 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/858—Linking data to content, e.g. by linking an URL to a video object, by creating a hotspot
Definitions
- the present invention relates to the field of video playback technologies, and in particular, to an authentication method and a server.
- the live video broadcast is performed by using the Internet and streaming media technology, and then the video content provider has the video stream address obtained by the third-party platform, so that the video can be directly viewed without going through the live website, that is, the video player bypassing the live website.
- the video is provided for playback, which reduces the traffic to the website for video sites.
- the embodiment of the invention provides an authentication method and a server to solve the situation that the video resource of the live broadcast platform is stolen from the video stream.
- the application provides an authentication method, the method comprising:
- the server When receiving the video stream address request sent by the target client, the server sends a first blockchain for authenticating the target client, so that the target client generates according to the first blockchain.
- Second blockchain Second blockchain
- the server selects a target auxiliary computing client in a predetermined set of auxiliary computing clients, where the target secondary computing client and the target client are different clients;
- the server instructing the target client to send the second blockchain to the target secondary computing client, such that the target secondary computing client pairs the target client through the second blockchain Check to determine if it is legal;
- the method further includes:
- each client After receiving the third blockchain, each client generates a fourth blockchain, and sends the fourth blockchain to the server, where the fourth blockchain includes client computing capability information;
- the server selects, according to the received computing capability information of the client, a preset number of clients whose computing power reaches a preset requirement, as a set of auxiliary computing clients of the server.
- the client computing capability information is used by the client to generate a processor computing time consumed by the fourth blockchain, and the server selects a pre-determined computing capability according to the received computing capability information of the client.
- the number of clients, as a step of the server's auxiliary computing client set, includes:
- the server generates, according to the received processor calculation time of the fourth blockchain consumed by each client, and selects a preset number of clients whose processor calculates a time lower than a preset time threshold, as an auxiliary of the server. Calculate the client collection,
- the server generates, according to the received processor calculation time, the processor calculation time consumed by the fourth blockchain, and selects a processor to calculate a preset number of clients with the shortest time as the auxiliary computing client of the server. set.
- the second blockchain includes computing capability information of the target client; the method further includes:
- the target client After determining that the target client is legal, if the computing capability of the target client reaches a preset requirement, the target client is added to the auxiliary computing client set of the server.
- the method further includes:
- the target client After the target client is added to the auxiliary computing client set of the server, if it is detected that the target client leaves the live broadcast platform, the target client is deleted in the auxiliary computing client set.
- the data structure includes a block number of the blockchain, a hash value of the previous blockchain, a processor calculation time for calculating a new blockchain consumption, a key value required for calculating a new blockchain, a timestamp of the current time, and a block.
- the chain function data and the current blockchain hash value, the blockchain function data includes a room number of a room where the current client is located, a user identifier of the client, and a flag of the client.
- the application provides a server, where the server includes:
- a first sending module configured to: when receiving a video stream address request sent by the target client, send a first blockchain for authenticating the target client, so that the target client is configured according to the The first blockchain generates a second blockchain;
- a selection module configured to select a target auxiliary computing client in a predetermined set of auxiliary computing clients, where the target secondary computing client and the target client are different clients;
- An indication module configured to instruct the target client to send the second blockchain to the target assistant Assisting the computing client, so that the target auxiliary computing client checks the target client through the second blockchain to determine whether it is legal;
- a receiving module configured to receive a verification result of the target auxiliary computing client to the target client
- a second sending module configured to send a video stream address to the target client when the verification result of the target client is legal, and refuse to the target when the verification result of the target client is illegal
- the client sends the video stream address.
- server further includes:
- a third sending module configured to send a third blockchain to all clients of the live platform before the selecting module selects the target auxiliary computing client in the predetermined set of auxiliary computing clients, so that the live broadcast platform
- each client After receiving the third blockchain, each client generates a fourth blockchain, and sends the fourth blockchain to the server, where the fourth blockchain includes client computing capability information;
- the selecting module is configured to select, according to the received computing capability information of the client, a preset number of clients whose computing power reaches a preset requirement, as a set of auxiliary computing clients of the server.
- the client computing capability information is used by the client to generate a processor calculation time consumed by the fourth blockchain, and the selecting module is specifically configured to:
- the processor selects a preset number of clients with the shortest time to calculate as a set of auxiliary computing clients of the server.
- the second blockchain includes computing capability information of the target client; the server further includes:
- server further includes:
- a deleting module configured to delete the target in the auxiliary computing client set after detecting that the target client leaves the live broadcast platform after adding the target client to the auxiliary computing client set of the server Client.
- the data structure includes a block number of the blockchain, a hash value of the previous blockchain, and a new blockchain calculation.
- the consumed processor calculates the time, calculates the key value required for the new blockchain, the current timestamp, the blockchain function data, and the current blockchain hash value, and the blockchain function data includes the current client's room. The room number, the user ID of the client, and the logo of the client.
- the present invention also provides a server, comprising: a memory, a processor, and a computer program stored on the memory and operable on the processor, wherein when the processor executes the computer program
- a server comprising: a memory, a processor, and a computer program stored on the memory and operable on the processor, wherein when the processor executes the computer program
- the present invention further provides a computer readable storage medium having stored thereon a computer program, the program being implemented by the processor to implement the method of any of the first aspects.
- the server when receiving the video stream address request sent by the target client, the server sends a first blockchain for authenticating the target client, so that the target client is according to the first block.
- the chain generates a second blockchain; the server selects the target auxiliary computing client in the predetermined set of auxiliary computing clients; the server instructs the target client to send the second blockchain to the target auxiliary computing client, so that the target assisted computing
- the client verifies the target client through the second blockchain to determine whether it is legal; the server receives the verification result of the target auxiliary computing client to the target client, and when the verification result of the target client is legal, the target client
- the video stream address is delivered.
- the client that initiates the video stream request is authenticated by using the blockchain technology to reject the invalid client video stream request, thereby avoiding video stream piracy, and selecting the calculation in the live platform client.
- the powerful client is combined into a secondary computing group of the server to assist in verifying the clients of other video streaming requests, which reduces the pressure on the computing performance of the server.
- FIG. 1 is a schematic diagram of an embodiment of an authentication method in an embodiment of the present invention.
- FIG. 2 is a schematic diagram of another embodiment of an authentication method in an embodiment of the present invention.
- FIG. 3 is a schematic diagram of an embodiment of a server in an embodiment of the present invention.
- FIG. 4 is a schematic diagram of another embodiment of a server in an embodiment of the present invention.
- FIG. 5 is a schematic diagram of another embodiment of a server in an embodiment of the present invention.
- FIG. 6 is a schematic diagram of another embodiment of a server in an embodiment of the present invention.
- FIG. 7 is a schematic diagram of another embodiment of a server in an embodiment of the present invention.
- an embodiment of an authentication method in an embodiment of the present invention includes:
- the server When receiving the video stream address request sent by the target client, the server sends a first blockchain for authenticating the target client, so that the target client generates the second block according to the first blockchain. chain;
- the server is the server corresponding to the live broadcast platform
- the client may be a user terminal, such as a smart terminal such as a mobile phone or a tablet computer
- the room is a live broadcast room established by the anchor on the live broadcast platform
- the target client is requesting the video stream address.
- a blockchain is a chained data structure that combines data blocks in a chronological order in a sequential manner, and cryptographically guaranteed non-tamperable and unforgeable distributed ledgers.
- the server selects a target auxiliary computing client in a predetermined set of auxiliary computing clients.
- the target auxiliary computing client and the target client are different clients, and the target auxiliary computing client selects a secondary computing client selected by the server for verifying the target client, and the auxiliary computing client set is a login.
- a live broadcast platform (server) that predetermines a set of clients that the server authenticates to the client that initiated the video stream address request.
- the server instructs the target client to send the second blockchain to the target auxiliary computing client, so that the target auxiliary computing client checks the target client through the second blockchain to determine whether it is legal.
- the server instructs the target client to send the second blockchain to the target auxiliary computing client.
- the server may send the indication information to the target client, where the indication information includes information of the target auxiliary computing client, for example, the target auxiliary computing client.
- the user identifier, the network address, and the like, so that the target client sends the second blockchain to the target auxiliary computing client, and the target auxiliary computing client checks the target client through the second blockchain to determine whether the target client is Legally, the target auxiliary computing client performs verification on the target client and sends a verification result to the target client to the server.
- the server receives the verification result of the target auxiliary calculation client to the target client, and sends a video stream address to the target client when the verification result of the target client is legal.
- the server rejects Send the video stream address to the target client.
- the server when the server receives the verification result of the target client sent by the target auxiliary computing client, if the verification result is legal, the server determines that the target client is a legitimate client, and sends a video stream address to the target client. If the verification result is illegal, it is determined that the target client is an illegal client, and the video stream address is refused to be delivered to the target client, thereby preventing the illegal client from stealing the video stream.
- the server when receiving the video stream address request sent by the target client, the server sends a first blockchain for authenticating the target client, so that the target client is according to the first block.
- the chain generates a second blockchain; the server selects the target auxiliary computing client in the predetermined set of auxiliary computing clients; the server instructs the target client to send the second blockchain to the target auxiliary computing client, so that the target assisted computing
- the client verifies the target client through the second blockchain to determine whether it is legal; the server receives the verification result of the target auxiliary computing client to the target client, and when the verification result of the target client is legal, the target client
- the video stream address is delivered.
- the client that initiates the video stream request is authenticated by using the blockchain technology to reject the invalid client video stream request, thereby avoiding video stream piracy, and selecting the calculation in the live platform client.
- the powerful client is combined into a secondary computing group of the server to assist in verifying the clients of other video streaming requests, which reduces the pressure on the computing performance of the server.
- the server determines that the current live broadcast peak (which can be determined according to the number of simultaneous online clients, and reaches a preset number, that is, a viewing peak)
- the server is in the predetermined auxiliary computing client set.
- the server can directly verify the client that sends the video stream address request.
- the client's check result is valid, the video stream address is sent to the client.
- the verification result on the client is If it is illegal, it refuses to send the video stream address to the client.
- the method of the embodiment of the present invention may further include:
- the server sends the third blockchain to all clients of the live platform, so that each client on the live broadcast platform receives the third blockchain, generates a fourth blockchain, and sends the fourth blockchain to the client.
- the fourth blockchain includes client computing capability information, where the third blockchain may be the same as or different from the first blockchain.
- the third blockchain and the first blockchain are Differently, because the server sends the third blockchain to calculate the computing power of each client of the live platform, the size of the third blockchain can be smaller than the first blockchain to save the computing resources of the client.
- the server selects, according to the received computing capability information of the client, a preset number of clients whose computing power reaches a preset requirement, as a set of auxiliary computing clients of the server.
- the preset requirement may be that the preset client computing capability (described in detail below) is reached, and the preset number may be preset, for example, five, ten, and the like.
- the client in the auxiliary computing client set can be used to complete some work of the server, for example, the present invention.
- the client that sends the video stream address request is verified, which can reduce the server computing pressure.
- the client computing capability information is a processor calculation time for the client to generate the fourth blockchain consumption, and the foregoing step S106 may specifically include:
- the server generates, according to the received processor calculation time, the processor calculation time consumed by the fourth blockchain, and selects, by the processor, a preset number of clients whose computing time is lower than the preset time threshold, as the auxiliary computing client of the server. End collection,
- the server generates, according to the received processor calculation time consumed by the fourth blockchain by each client, and selects a preset number of clients whose processor calculates the shortest time as the auxiliary computing client set of the server.
- the second blockchain includes computing capability information of the target client.
- the method in the embodiment of the present invention further includes: after determining that the target client is legal, if the target client is When the computing power reaches the preset requirement, the target client is added to the server's auxiliary computing client set.
- the server may determine the computing capability of the target client according to the computing capability information of the target client in the second blockchain. If the computing capability of the target client reaches the preset requirement, the target client is added to the auxiliary computing client of the server. Collections so that subsequent tasks can be assigned to the target client. It can be understood that, for other clients that are newly added to the live platform server, the server may also deliver the third blockchain, so that the newly added client generates a fourth blockchain according to the third blockchain.
- the four-blockchain includes computing capability information of the newly added client, so that the server can determine the capability of the newly added client, and when the requirement is met, the newly added client can be added to the secondary computing client set of the server.
- the method in the embodiment of the present invention may further include:
- the target client After the target client is added to the set of auxiliary computing clients of the server, if the When the target client leaves the live broadcast platform, the target client is deleted in the secondary computing client collection.
- the auxiliary computing client set of the server can delete the invalid client that exits the live platform in time, and avoid invalid task assignment of the invalid server.
- the data structures of the first blockchain, the second blockchain, the third blockchain, and the fourth blockchain are the same;
- the data structure includes a block number of the blockchain,
- the blockchain function data includes a room number of a room where the current client is located, a user identifier of the client, and a logo of the client.
- the foregoing data structure is specifically implemented as follows:
- index is used to indicate the block number of the blockchain, usually starting from 0; previousHash is the HASH value of the previous blockchain; imestamp is the timestamp; key is the key value needed to calculate the new block; timeelaps means calculating the new
- the processor calculates the time consumed by the block; the data represents the splicing of some data (ie, the above-mentioned blockchain function data), and the content of the data field is designed according to the functions required by the blockchain, and is directed to the present invention.
- the data may include a room number of a room where the current client is located, a user identifier of the client, a logo of the client, and a previously encrypted value of the current time stamp; and a hash indicates a hash value of the current content of the blockchain.
- the first blockchain may be an initial blockchain generated by the server.
- the initial blockchain is the first generated blockchain
- the initial The block number of the blockchain is 0, the timestamp is the current time, and the hash value of the previous blockchain is 0.
- an algorithm for generating a new blockchain in a blockchain is simultaneously designed.
- an initial blockchain (such as a first blockchain) is generated by a server, and the server sends the request to each initiated video stream address.
- Client then after the client receives the initial blockchain, an algorithm is needed to generate the next blockchain.
- the specific implementation is as follows: First, the data structure of the previous blockchain has been obtained, and the next blockchain is generated according to the data of the previous blockchain.
- the block number of the new blockchain is the current block number plus one.
- the timestamp of the new blockchain is to get the current time.
- the hash value of the previous blockchain of the new blockchain is the hash of the previous blockchain obtained.
- Newblock.key prevblock.key
- the key value of the previous blockchain of the new blockchain is the key value of the previous blockchain obtained.
- Newblock.data AES.encrypt(Newblock.roomid+Newblock.uid+Newblock.token+Newblock.timestamp,Newblock.key);
- the data data of the new blockchain is the client token (token) obtained by the current client login, the client's user identifier (uid), the room number currently requesting to watch the live video, and the current timestamp, and then used together.
- the encryption algorithm AES further encrypts the data, and the key value used is the key value sent by the server.
- the encryption algorithm can also use a more complicated encryption algorithm, and the AES encryption algorithm is not limited herein.
- Newblock.hash HASH(index+previousHash+timestamp+data+key);
- the hash value of the new blockchain is the index field with the new blockchain and the previousHash field and the timestamp field, and the data field and the key field.
- the hash (HASH) algorithm corresponding to the hash value is unified, and the HASH algorithm may be the SHA-256 algorithm, and may be other HASH algorithms, such as SHA-1, etc., which is not limited herein.
- Time is as follows:
- timeEnd is the time obtained after the calculation is completed
- timeStart is the time when the calculation starts. Between the two, the difference is the processor calculation time consumed by the new block.
- the target auxiliary computing client performs verification on the target client through the second blockchain, and the step of determining whether the data is legal may include: assuming that the name of the previous blockchain (the first blockchain) is Prevblock, then received a newly generated blockchain (second blockchain) whose name is newblock.
- Newblock.index! prevblock.index+1;
- block number of the new blockchain is not the block number of the previous block plus 1, it indicates that the new blockchain is invalid and directly returns the blockchain error information.
- the new blockchain is considered illegal and directly returns the blockchain error information.
- the hash value of the new blockchain is the hash result of the entire data of the new blockchain.
- the new blockchain is considered invalid, and the blockchain error information is directly returned to determine that the target client is illegal. .
- the data value of the new blockchain is encrypted by an encryption algorithm.
- the data is decrypted to determine the legitimacy of the data.
- Newblock.data AES.decrypt(Newblock.data,Newblock.key);
- the data field is decrypted to obtain the original data data.
- the uid, token, room number, and timestamp can be known.
- the target auxiliary computing client verifies that the target client's uid is Is not a valid uid, whether the token is a token issued by the server, and whether the room number is a valid room number. If the check is legal, the target auxiliary computing client will report the verification result to the server, and the server will not use the room number.
- the corresponding video stream address is delivered to the target client.
- Embodiments of the server in the embodiment of the present invention are described below.
- FIG. 3 it is a schematic diagram of an embodiment of a server according to an embodiment of the present invention.
- the server includes:
- the first sending module 301 is configured to: when receiving the video stream address request sent by the target client, send a first blockchain for authenticating the target client, so that the target client is configured according to the The first blockchain generates a second blockchain;
- the selecting module 302 is configured to select a target auxiliary computing client in the predetermined set of auxiliary computing clients, where the target secondary computing client and the target client are different clients;
- the indicating module 303 is configured to instruct the target client to send the second blockchain to the target auxiliary computing client, so that the target auxiliary computing client passes the second blockchain pair
- the target client performs verification to determine whether it is legal;
- the receiving module 304 is configured to receive a verification result of the target auxiliary computing client to the target client.
- the second sending module 305 is configured to: when the verification result of the target client is legal, send a video stream address to the target client, and if the verification result of the target client is illegal, reject the The target client delivers the video stream address.
- the server further includes:
- the third sending module 306 is configured to send the third blockchain to all clients of the live platform before the selecting module selects the target auxiliary computing client in the predetermined set of auxiliary computing clients, so that the live broadcast
- each client on the platform After receiving the third blockchain, each client on the platform generates a fourth blockchain, and sends the fourth blockchain to the server, where the fourth blockchain includes client computing Capability information;
- the selecting module 307 is configured to select, according to the received computing capability information of the client, a preset number of clients whose computing power reaches a preset requirement, as a set of auxiliary computing clients of the server.
- the client computing capability information is used by the client to generate a processor calculation time consumed by the fourth blockchain, and the selecting module 307 is specifically configured to:
- the processor selects a preset number of clients with the shortest time to calculate as a set of auxiliary computing clients of the server.
- the second blockchain includes computing capability information of the target client; the server further includes:
- the adding module 308 is configured to join the target client to the auxiliary computing client set of the server if the computing capability of the target client reaches a preset requirement after determining that the target client is legal.
- the server further includes:
- a deleting module 309 configured to delete the target client in the auxiliary computing client set after detecting that the target client leaves the live broadcast platform after adding the target client to the auxiliary computing client set of the server Target client.
- the data structure includes a block number of the blockchain, a hash value of the previous blockchain, a processor calculation time for calculating a new blockchain consumption, a key value required for calculating a new blockchain, a timestamp of the current time, and a block.
- the chain function data and the current blockchain hash value, the blockchain function data includes a room number of a room where the current client is located, a user identifier of the client, and a flag of the client.
- a server is also provided in the embodiment of the present invention. Referring to FIG. 7, the server includes:
- the memory 701 is a processor 702 and a computer program 703 stored on the memory and operable on the processor, wherein the processor 702 can implement the above authentication method when the computer program 703 is executed.
- the memory 701 can be used to store a computer program 703 including software programs, modules, and data, and the processor 702 executes various computer applications 703 stored in the memory 701 to execute various functional applications and data processing of the server.
- the memory 701 can be used to store software programs and modules, and the processor 702 executes various functional applications and data processing of the server by running software programs and modules stored in the memory 701.
- the memory 701 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application required for at least one function (for example, a game application, a chat application), and the like; and the storage data area may be stored. Data created based on the use of the server (game configuration data, audio data), and the like.
- the memory 701 may include a high speed random access memory, and may also include a nonvolatile memory such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
- the processor 702 is a control center of the server, and connects various parts of the entire server using various interfaces and lines, by executing or executing software programs and/or modules stored in the memory 701, and calling data stored in the memory 701, executing The server's various functions and processing data to monitor the server as a whole.
- the processor 702 can include one or more processing units; preferably, the processor 702 can integrate an application processor, wherein the application processor mainly processes an operating system, a user interface, an application, and the like.
- the embodiment of the present invention further provides a computer readable storage medium, wherein the computer readable storage medium may store a program, and the program includes some or all of the steps of the authentication method described in the foregoing method embodiments.
- the disclosed system, apparatus, and method may be implemented in other manners.
- the device embodiments described above are merely illustrative.
- the division of the unit is only a logical function division.
- there may be another division manner for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored or not executed.
- the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
- the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
- each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
- the above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
- the integrated unit if implemented in the form of a software functional unit and sold or used as a standalone product, may be stored in a computer readable storage medium.
- the technical solution of the present invention which is essential or contributes to the prior art, or all or part of the technical solution, may be embodied in the form of a software product stored in a storage medium.
- a number of instructions are included to cause a computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention.
- the foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like. .
Landscapes
- Engineering & Computer Science (AREA)
- Signal Processing (AREA)
- Databases & Information Systems (AREA)
- Multimedia (AREA)
- Computer Graphics (AREA)
- Computer Security & Cryptography (AREA)
- Computer Networks & Wireless Communication (AREA)
- Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)
- Information Transfer Between Computers (AREA)
Abstract
本发明公开了一种鉴权方法及服务器。本发明实施例方法包括:服务器在接收到目标客户端发送的视频流地址请求时,下发用于对目标客户端鉴权的第一区块链;服务器在预先确定的辅助计算客户端集合中选择目标辅助计算客户端;服务器指示目标客户端将第二区块链发送到目标辅助计算客户端,以使得目标辅助计算客户端对目标客户端进行校验;在目标客户端的校验结果为合法时,向目标客户端下发视频流地址。本发明实施例中利用区块链技术对发起视频流请求的客户端进行鉴权,避免了视频流盗播,同时利用服务器的辅助计算客户端集合中客户端对其他视频流请求的客户端进行校验,降低了服务器计算性能压力。
Description
本发明涉及视频播放技术领域,特别涉及一种鉴权方法及服务器。
目前,视频直播是利用互联网及流媒体技术进行直播,然后视频内容的提供方存在视频流地址被第三方平台获取,从而可以不通过直播网站直接观看视频,即绕过了直播网站的视频播放器提供的视频播放,从而对于视频网站减少了网站的流量。
因此,需要有一种方法能够对客户端的请求流地址的接口进行鉴别,以阻止不是直播平台的客户端的视频流地址的请求,从而对视频流地址进行保护,防止盗取视频流,防止盗刷视频流量。
发明内容
本发明实施例提供了一种鉴权方法及服务器,以解决目前直播平台视频资源被盗取视频流的情况。
第一方面,本申请提供了一种鉴权方法,该方法包括:
服务器在接收到目标客户端发送的视频流地址请求时,下发用于对所述目标客户端鉴权的第一区块链,以使得所述目标客户端根据所述第一区块链生成第二区块链;
所述服务器在预先确定的辅助计算客户端集合中选择目标辅助计算客户端,所述目标辅助计算客户端与所述目标客户端为不同的客户端;
所述服务器指示所述目标客户端将所述第二区块链发送到所述目标辅助计算客户端,以使得所述目标辅助计算客户端通过所述第二区块链对所述目标客户端进行校验,确定是否合法;
所述服务器接收所述目标辅助计算客户端对所述目标客户端的校验结果,在所述目标客户端的校验结果为合法时,向所述目标客户端下发视频流地址,在所述目标客户端的校验结果为非法时,拒绝向所述目标客户端下发视频流地址。
进一步的,在所述服务器在预先确定的辅助计算客户端集合中选择目标辅助计算客户端之前,所述方法还包括:
所述服务器下发第三区块链到直播平台所有客户端,以使得所述直播平台
上的各客户端收到所述第三区块链后生成第四区块链,并将所述第四区块链发送到所述服务器,所述第四区块链中包括客户端计算能力信息;
所述服务器根据接收到的客户端计算能力信息,挑选计算能力达到预设要求的预设数量的客户端作为所述服务器的辅助计算客户端集合。
进一步的,所述客户端计算能力信息为客户端生成所述第四区块链消耗的处理器计算时间,所述服务器根据接收到的客户端计算能力信息,挑选计算能力达到预设要求的预设数量的客户端,作为所述服务器的辅助计算客户端集合的步骤,包括:
所述服务器根据接收到的各客户端生成所述第四区块链消耗的处理器计算时间,挑选处理器计算时间低于预设时间阈值的预设数量的客户端,作为所述服务器的辅助计算客户端集合,
或者,所述服务器根据接收到的各客户端生成所述第四区块链消耗的处理器计算时间,挑选处理器计算时间最短的预设数量的客户端,作为所述服务器的辅助计算客户端集合。
进一步的,所述第二区块链中包括所述目标客户端的计算能力信息;所述方法还包括:
在确定所述目标客户端合法后,若所述目标客户端的计算能力到达预设要求,则将所述目标客户端加入所述服务器的辅助计算客户端集合。
进一步的,所述方法还包括:
在将所述目标客户端加入所述服务器的辅助计算客户端集合后,若检测到所述目标客户端离开直播平台,则在所述辅助计算客户端集合中删除所述目标客户端。
进一步的,所述第一区块链、所述第二区块链的数据结构相同;
所述数据结构包括区块链的块号、前一个区块链的哈希值、计算新区块链消耗的处理器计算时间、计算新区块链需要的key值、当前时间的时间戳、区块链功能数据及当前区块链哈希值,所述区块链功能数据包括当前客户端所在房间的房间号,所述客户端的用户标识以及所述客户端的标志。
第二方面,本申请提供一种服务器,该服务器包括:
第一发送模块,用于在接收到目标客户端发送的视频流地址请求时,下发用于对所述目标客户端鉴权的第一区块链,以使得所述目标客户端根据所述第一区块链生成第二区块链;
选择模块,用于在预先确定的辅助计算客户端集合中选择目标辅助计算客户端,所述目标辅助计算客户端与所述目标客户端为不同的客户端;
指示模块,用于指示所述目标客户端将所述第二区块链发送到所述目标辅
助计算客户端,以使得所述目标辅助计算客户端通过所述第二区块链对所述目标客户端进行校验,确定是否合法;
接收模块,用于接收所述目标辅助计算客户端对所述目标客户端的校验结果;
第二发送模块,用于在所述目标客户端的校验结果为合法时,向所述目标客户端下发视频流地址,在所述目标客户端的校验结果为非法时,拒绝向所述目标客户端下发视频流地址。
进一步的,所述服务器还包括:
第三发送模块,用于在所述选择模块在预先确定的辅助计算客户端集合中选择目标辅助计算客户端之前,下发第三区块链到直播平台所有客户端,以使得所述直播平台上的各客户端收到所述第三区块链后生成第四区块链,并将所述第四区块链发送到所述服务器,所述第四区块链中包括客户端计算能力信息;
挑选模块,用于根据接收到的客户端计算能力信息,挑选计算能力达到预设要求的预设数量的客户端作为所述服务器的辅助计算客户端集合。
进一步的,所述客户端计算能力信息为客户端生成所述第四区块链消耗的处理器计算时间,所述挑选模块具体用于:
根据接收到的各客户端生成所述第四区块链消耗的处理器计算时间,挑选处理器计算时间低于预设时间阈值的预设数量的客户端,作为所述服务器的辅助计算客户端集合,
或者,根据接收到的各客户端生成所述第四区块链消耗的处理器计算时间,挑选处理器计算时间最短的预设数量的客户端,作为所述服务器的辅助计算客户端集合。
进一步的,所述第二区块链中包括所述目标客户端的计算能力信息;所述服务器还包括:
添加模块,用于在确定所述目标客户端合法后,若所述目标客户端的计算能力到达预设要求,则将所述目标客户端加入所述服务器的辅助计算客户端集合。
进一步的,所述服务器还包括:
删除模块,用于在将所述目标客户端加入所述服务器的辅助计算客户端集合后,若检测到所述目标客户端离开直播平台,则在所述辅助计算客户端集合中删除所述目标客户端。
进一步的,所述第一区块链、所述第二区块链的数据结构相同;
所述数据结构包括区块链的块号、前一个区块链的哈希值、计算新区块链
消耗的处理器计算时间、计算新区块链需要的key值、当前时间的时间戳、区块链功能数据及当前区块链哈希值,所述区块链功能数据包括当前客户端所在房间的房间号,所述客户端的用户标识以及所述客户端的标志。
第三方面,本发明还提供一种服务器,包括:存储器,处理器及存储在所述存储器上并可在所述处理器上运行的计算机程序,其中,所述处理器执行所述计算机程序时可以实现第一方面中任一所述的方法。
第四方面,本发明还提供一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现第一方面中任一所述的方法。
本发明实施例中,服务器在接收到目标客户端发送的视频流地址请求时,下发用于对目标客户端鉴权的第一区块链,以使得目标客户端根据所述第一区块链生成第二区块链;服务器在预先确定的辅助计算客户端集合中选择目标辅助计算客户端;服务器指示目标客户端将第二区块链发送到目标辅助计算客户端,以使得目标辅助计算客户端通过第二区块链对目标客户端进行校验,确定是否合法;服务器接收目标辅助计算客户端对目标客户端的校验结果,在目标客户端的校验结果为合法时,向目标客户端下发视频流地址。本发明实施例中利用区块链技术对发起视频流请求的客户端进行鉴权,以拒绝不合法的客户端视频流请求,避免了视频流盗播,同时,在直播平台客户端中挑选计算能力强的客户端组合成服务器的辅助计算群,辅助对其他视频流请求的客户端进行校验,降低了服务器计算性能压力。
上述说明仅是本发明技术方案的概述,为了能够更清楚了解本发明的技术手段,而可依照说明书的内容予以实施,并且为了让本发明的上述和其它目的、特征和优点能够更明显易懂,以下特举本发明的具体实施方式。
通过阅读下文优选实施方式的详细描述,各种其他的优点和益处对于本领域普通技术人员将变得清楚明了。附图仅用于示出优选实施方式的目的,而并不认为是对本发明的限制。而且在整个附图中,用相同的参考符号表示相同的部件。在附图中:
图1是本发明实施例中鉴权方法的一个实施例示意图;
图2是本发明实施例中鉴权方法的另一个实施例示意图;
图3是本发明实施例中服务器的一个实施例示意图;
图4是本发明实施例中服务器的另一个实施例示意图;
图5是本发明实施例中服务器的另一个实施例示意图;
图6是本发明实施例中服务器的另一个实施例示意图;
图7是本发明实施例中服务器的另一个实施例示意图。
为了使本技术领域的人员更好地理解本发明方案,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分的实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都应当属于本发明保护的范围。
本发明的说明书和权利要求书及上述附图中的术语“第一”、“第二”等(如果存在)是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的实施例能够以除了在这里图示或描述的内容以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、***、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。
请参阅图1,本发明实施例中鉴权方法的一个实施例包括:
S101、服务器在接收到目标客户端发送的视频流地址请求时,下发用于对目标客户端鉴权的第一区块链,以使得目标客户端根据第一区块链生成第二区块链;
本实施例中,服务器即即直播平台对应的服务器,客户端可以是用户终端,例如手机、平板电脑等智能终端,房间为直播平台上主播建立的直播间,目标客户端为请求视频流地址的客户端。区块链是一种按照时间顺序将数据区块以顺序相连的方式组合成的一种链式数据结构,并以密码学方式保证的不可篡改和不可伪造的分布式账本。
S102、服务器在预先确定的辅助计算客户端集合中选择目标辅助计算客户端;
其中,该目标辅助计算客户端与该目标客户端为不同的客户端,该目标辅助计算客户端为该服务器选择的用于校验该目标客户端的辅助计算客户端,辅助计算客户端集合为登录直播平台(服务器),服务器预先确定的辅助该服务器对发起视频流地址请求的客户端进行校验的客户端集合。
S103、服务器指示目标客户端将第二区块链发送到目标辅助计算客户端,以使得目标辅助计算客户端通过第二区块链对目标客户端进行校验,确定是否合法;
具体的,服务器指示目标客户端将第二区块链发送到目标辅助计算客户可以是服务器发送指示信息到目标客户端,该指示信息中包括目标辅助计算客户端的信息,例如,目标辅助计算客户端的用户标识,网络地址等,使得目标客户端将第二区块链发送到目标辅助计算客户端,目标辅助计算客户端通过第二区块链对目标客户端进行校验,确定该目标客户端是否合法,目标辅助计算客户端在对目标客户端进行校验完成,发送对目标客户端的校验结果给服务器。
S104、服务器接收目标辅助计算客户端对目标客户端的校验结果,在目标客户端的校验结果为合法时,向目标客户端下发视频流地址,在目标客户端的校验结果为非法时,拒绝向目标客户端下发视频流地址。
具体的,服务器在接收到目标辅助计算客户端发送的目标客户端的校验结果时,若校验结果为合法时,则确定目标客户端为合法客户端,向目标客户端下发视频流地址,若校验结果为非法时,则确定目标客户端为非法客户端,拒绝向目标客户端下发视频流地址,避免了非法客户端盗播视频流。
本发明实施例中,服务器在接收到目标客户端发送的视频流地址请求时,下发用于对目标客户端鉴权的第一区块链,以使得目标客户端根据所述第一区块链生成第二区块链;服务器在预先确定的辅助计算客户端集合中选择目标辅助计算客户端;服务器指示目标客户端将第二区块链发送到目标辅助计算客户端,以使得目标辅助计算客户端通过第二区块链对目标客户端进行校验,确定是否合法;服务器接收目标辅助计算客户端对目标客户端的校验结果,在目标客户端的校验结果为合法时,向目标客户端下发视频流地址。本发明实施例中利用区块链技术对发起视频流请求的客户端进行鉴权,以拒绝不合法的客户端视频流请求,避免了视频流盗播,同时,在直播平台客户端中挑选计算能力强的客户端组合成服务器的辅助计算群,辅助对其他视频流请求的客户端进行校验,降低了服务器计算性能压力。
优选的,本发明实施例中,服务器在确定当前为观看直播的高峰(可以根据同时在线客户端数量确定,达到预设数量即为观看高峰)时,服务器才在预先确定的辅助计算客户端集合中选择目标辅助计算客户端。在非观看直播的高峰,服务器可以自身直接对发送视频流地址请求的客户端进行校验,在客户端的校验结果为合法时,向客户端下发视频流地址,在客户端的校验结果为非法时,拒绝向客户端下发视频流地址。
如图2所示,在上述步骤S102之前,本发明实施例方法还可以进一步包括:
S105、服务器下发第三区块链到直播平台所有客户端,以使得直播平台上的各客户端收到第三区块链后生成第四区块链,并将第四区块链发送到服务器;
其中,该第四区块链中包括客户端计算能力信息,其中第三区块链与上述第一区块链可以相同也可以不同,优选的,第三区块链与上述第一区块链不同,由于服务器下发第三区块链是为了计算直播平台各客户端计算能力的,因此第三区块链的大小可以小于第一区块链,以节约客户端的计算资源。
S106、服务器根据接收到的客户端计算能力信息,挑选计算能力达到预设要求的预设数量的客户端作为服务器的辅助计算客户端集合。
具体的,达到预设要求可以是达到预设客户端计算能力(下文详述),预设数量可以是预先设定的,例如5个,10个等。
本实施例中,通过预先确定好服务器的辅助计算客户端集合,在服务器需要时(例如观看直播高峰时),即可利用辅助计算客户端集合中的客户端完成服务器的一些工作,例如本发明实施例中的对发送视频流地址请求的客户端进行校验,可以降低服务器计算压力。
进一步的,所述客户端计算能力信息为客户端生成所述第四区块链消耗的处理器计算时间,上述步骤S106,具体可以包括:
服务器根据接收到的各客户端生成所述第四区块链消耗的处理器计算时间,挑选处理器计算时间低于预设时间阈值的预设数量的客户端,作为所述服务器的辅助计算客户端集合,
或者,服务器根据接收到的各客户端生成所述第四区块链消耗的处理器计算时间,挑选处理器计算时间最短的预设数量的客户端,作为所述服务器的辅助计算客户端集合。
进一步的,在本发明一些实施例中,所述第二区块链中包括所述目标客户端的计算能力信息;本发明实施例中方法还包括:在确定目标客户端合法后,若目标客户端的计算能力到达预设要求,则将目标客户端加入服务器的辅助计算客户端集合。
本实施例中,服务器根据第二区块链中目标客户端的计算能力信息可以确定目标客户端的计算能力,若目标客户端的计算能力到达预设要求,则将目标客户端加入服务器的辅助计算客户端集合,以便后续可以分配任务给目标客户端进行。可以理解的是,对于其他新加入直播平台服务器的客户端,服务器也可以下发上述第三区块链,使得该新加入的客户端根据第三区块链生成第四区块链,该第四区块链中包括新加入的客户端的计算能力信息,这样服务器可以确定新加入的客户端的能力,在满足要求时,可以将新加入的客户端加入所述服务器的辅助计算客户端集合。
在本发明另一些实施例中,本发明实施例中方法还可以进一步包括:
在将目标客户端加入所述服务器的辅助计算客户端集合后,若检测到所述
目标客户端离开直播平台,则在辅助计算客户端集合中删除目标客户端。
这样在服务器的辅助计算客户端集合可以及时的删除退出直播平台的无效客户端,避免无效服务器的无效任务分配。
本发明实施例中,所述第一区块链、所述第二区块链、第三区块链、第四区块链的数据结构相同;所述数据结构包括区块链的块号、前一个区块链的哈希值、计算新区块链消耗的处理器计算时间、计算新区块链需要的key值、当前时间的时间戳、区块链功能数据及当前区块链哈希值,所述区块链功能数据包括当前客户端所在房间的房间号,所述客户端的用户标识以及所述客户端的标志。本发明实施例中,上述数据结构具体实现如下:
Struct BlockData{
Int64 index;
String previousHash;
Int64 timestamp;
String key;
Int64 timeelaps;
String data;
String hash;
}
其中,index用来表示区块链的块号,通常从0开始递增;previousHash表示前一个区块链的HASH值;imestamp表示时间戳;key表示计算新区块需要的key值;timeelaps表示计算新的区块所消耗的处理器计算时间;data则表示一些数据的拼接(即上述区块链功能数据),这个data字段的内容则是依据区块链所需要完成的功能所设计,针对于本发明实施例,data可以包括当前客户端所在房间的房间号,客户端的用户标识、客户端的标志及当前时间戳以前加密后的值;hash表示当前这个区块链的内容的hash值。有了这个区块链的设计后,则可以对新产生的区块链里面的数据进行校验。
本发明实施例中,第一区块链可以是服务器生成的初始区块链,当第一区块链为初始区块链时,初始区块链由于是第一个生成的区块链,初始区块链的区块号为0,时间戳则为当前时间,上一个区块链的hash值为0。
本发明实施例中同时设计了区块链中新区块链生成的算法,首先初始的区块链(如第一区块链)是服务器生成的,服务器会下发到每个发起视频流地址请求的客户端,那么该客户端收到初始区块链后,需要算法来生成下一个区块链。具体实现如下:首先已经获取到了上一个区块链的数据结构,下一个区块链则是依据上一个区块链的数据进行生成。
本发明实施例中,假设上一个区块链的名字是prevblock,新生成的区块链的名字是newblock,具体生成新的区块链的过程如下:
(1)计算新的区块链的区块号。
Newblock.index=prevblock.index+1;
则新的区块链的块号是当前块号加1。
(2)计算新的区块链的时间戳。
Newblock.timestamp=time();
新区块链的时间戳则是获取当前的时间。
(3)计算新的区块链的上一个区块链的hash值。
Newblock.previousHash=prevblock.hash;
新区块链的上一个区块链的hash值则是获取的上一个区块链的hash。
(4)计算新的区块链的上一个区块链的key值。
Newblock.key=prevblock.key;
新区块链的上一个区块链的key值则是获取的上一个区块链的key值。
(5)计算新的区块链的数据。
Newblock.data=AES.encrypt(Newblock.roomid+Newblock.uid+Newblock.token+Newblock.timestamp,Newblock.key);
新区块链的data数据则是由当前客户端登陆时获取的客户端标志(token),客户端的用户标识(uid),以及当前请求观看视频直播的房间号,以及当前的时间戳,然后一起使用加密算法AES来对数据进行进一步的加密,其中使用的key值则是服务器下发的key值。当然加密算法也可以使用更为复杂的加密算法,此处不限定AES加密算法。
(6)计算新的区块链的hash值。
Newblock.hash=HASH(index+previousHash+timestamp+data+key);
新区块链的hash值则是有新区块链的index字段和previousHash字段和timestamp字段和data字段和key字段。
本发明实施例中,哈希值对应的哈希(HASH)算法统一,该HASH算法可以是SHA-256算法,当然也可以是其他HASH算法,例如SHA-1等,此处不作限定。
(7)计算新的区块链的timeelaps值。
在计算新的区块链之前会先获取下当前的时间,计算新的区块链完成后会再次获取当前时间,该2个时间差值则表明计算新的区块链的消耗的处理器计算时间,具体如下:
Newblock.timeelaps=timeEnd()-timeStart();
其中timeEnd则是计算完成后获取的时间,timeStart则是计算开始时的时
间,2个差值则是新区块消耗的处理器计算时间。
至此,通过上述步骤就实现了通过一个区块链生成一个新的区块链的算法。而本发明实施例中,客户端通过接收第一区块链生成第二区块链时,即采用上述步骤实现。
本发明实施例中,目标辅助计算客户端通过第二区块链对目标客户端进行校验,确定是否合法的步骤具体可以包括:假设上一个区块链(第一区块链)的名字是prevblock,然后收到了一个新生成的区块链(第二区块链)的名字是newblock。
(1)首先判断其index是否正确。
Newblock.index!=prevblock.index+1;
如果新的区块链的区块号不是上一个区块的区块号加1,则说明新的区块链不合法,直接返回区块链错误信息。
(2)然后判断区块链的hash值。
Newblock.previousHash!=prevblock.hash
如果新的区块链的上一个区块链的hash值不等于上一个区块链的hash值则认为新的区块链不合法,直接返回区块链错误信息。
(3)判断新的区块链的hash值。
新的区块链的hash值是新区块链的整个数据的hash结果。
HASH(Newblock.index+Newblock.previousHash+Newblock.timestamp+Newblock.data)!=Newblock.hash;
如果新的区块链的整个区块链的数据的hash值不等于新的区块链hash值,则认为新的区块链不合法,直接返回区块链错误信息,确定目标客户端不合法。
(4)判断新的区块链的data值。
新的区块链的data值是通过加密算法将数据进行加密的。在此则会解密数据来判断数据的合法性。
Newblock.data=AES.decrypt(Newblock.data,Newblock.key);
此时将data字段进行解密后从而得到原始的data数据,从data中则可以得知其uid,token,房间号,时间戳,此时目标辅助计算客户端则会校验此目标客户端的uid是不是一个合法的uid,token是否是服务器下发的token,房间号是否是合法的房间号,如果校验合法,则目标辅助计算客户端会上报校验结果给服务器,服务器才会将该房间号对应的视频流地址下发到目标客户端。
下面介绍本发明实施例中服务器的实施例。
请参阅图3,为本发明实施例中服务器的一个实施例示意图,该服务器包括:
第一发送模块301,用于在接收到目标客户端发送的视频流地址请求时,下发用于对所述目标客户端鉴权的第一区块链,以使得所述目标客户端根据所述第一区块链生成第二区块链;
选择模块302,用于在预先确定的辅助计算客户端集合中选择目标辅助计算客户端,所述目标辅助计算客户端与所述目标客户端为不同的客户端;
指示模块303,用于指示所述目标客户端将所述第二区块链发送到所述目标辅助计算客户端,以使得所述目标辅助计算客户端通过所述第二区块链对所述目标客户端进行校验,确定是否合法;
接收模块304,用于接收所述目标辅助计算客户端对所述目标客户端的校验结果;
第二发送模块305,用于在所述目标客户端的校验结果为合法时,向所述目标客户端下发视频流地址,在所述目标客户端的校验结果为非法时,拒绝向所述目标客户端下发视频流地址。
进一步的,如图4所示,所述服务器还包括:
第三发送模块306,用于在所述选择模块在预先确定的辅助计算客户端集合中选择目标辅助计算客户端之前,下发第三区块链到直播平台所有客户端,以使得所述直播平台上的各客户端收到所述第三区块链后生成第四区块链,并将所述第四区块链发送到所述服务器,所述第四区块链中包括客户端计算能力信息;
挑选模块307,用于根据接收到的客户端计算能力信息,挑选计算能力达到预设要求的预设数量的客户端作为所述服务器的辅助计算客户端集合。
进一步的,所述客户端计算能力信息为客户端生成所述第四区块链消耗的处理器计算时间,所述挑选模块307具体用于:
根据接收到的各客户端生成所述第四区块链消耗的处理器计算时间,挑选处理器计算时间低于预设时间阈值的预设数量的客户端,作为所述服务器的辅助计算客户端集合,
或者,根据接收到的各客户端生成所述第四区块链消耗的处理器计算时间,挑选处理器计算时间最短的预设数量的客户端,作为所述服务器的辅助计算客户端集合。
进一步的,如图5所示,所述第二区块链中包括所述目标客户端的计算能力信息;所述服务器还包括:
添加模块308,用于在确定所述目标客户端合法后,若所述目标客户端的计算能力到达预设要求,则将所述目标客户端加入所述服务器的辅助计算客户端集合。
进一步的,如图6所示,所述服务器还包括:
删除模块309,用于在将所述目标客户端加入所述服务器的辅助计算客户端集合后,若检测到所述目标客户端离开直播平台,则在所述辅助计算客户端集合中删除所述目标客户端。
进一步的,所述第一区块链、所述第二区块链的数据结构相同;
所述数据结构包括区块链的块号、前一个区块链的哈希值、计算新区块链消耗的处理器计算时间、计算新区块链需要的key值、当前时间的时间戳、区块链功能数据及当前区块链哈希值,所述区块链功能数据包括当前客户端所在房间的房间号,所述客户端的用户标识以及所述客户端的标志。
本发明实施例中还提供一种服务器,请参见图7,所述服务器包括:
存储器701,处理器702及存储在所述存储器上并可在所述处理器上运行的计算机程序703,其中,所述处理器702执行所述计算机程序703时可以实现上述鉴权方法。
为了便于说明,仅示出了与本发明实施例相关的部分,具体技术细节未揭示的,请参照本发明实施例方法部分。存储器701可用于存储计算机程序703,上述计算机程序包括软件程序、模块和数据,处理器702通过运行执行存储在存储器701的计算机程序703,从而执行服务器的各种功能应用以及数据处理。
在具体的实施过程中,存储器701可用于存储软件程序以及模块,处理器702通过运行存储在存储器701的软件程序以及模块,从而执行服务器的各种功能应用以及数据处理。存储器701可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作***、至少一个功能所需的应用程序(例如游戏类应用程序、聊天类应用程序)等;存储数据区可存储根据服务器的使用所创建的数据(游戏配置数据、音频数据)等。此外,存储器701可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。处理器702是服务器的控制中心,利用各种接口和线路连接整个服务器的各个部分,通过运行或执行存储在存储器701内的软件程序和/或模块,以及调用存储在存储器701内的数据,执行服务器的各种功能和处理数据,从而对服务器进行整体监控。可选的,处理器702可包括一个或多个处理单元;优选的,处理器702可集成应用处理器,其中,应用处理器主要处理操作***、用户界面和应用程序等。
本发明实施例还提供一种计算机可读存储介质,其中,该计算机可读存储介质可存储有程序,该程序执行时包括上述方法实施例中记载的鉴权方法的部分或全部步骤。
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述
的***,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
在本申请所提供的几个实施例中,应该理解到,所揭露的***,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个***,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。
以上所述,以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的精神和范围。
Claims (10)
- 一种鉴权方法,其特征在于,所述方法包括:服务器在接收到目标客户端发送的视频流地址请求时,下发用于对所述目标客户端鉴权的第一区块链,以使得所述目标客户端根据所述第一区块链生成第二区块链;所述服务器在预先确定的辅助计算客户端集合中,选择目标辅助计算客户端,所述目标辅助计算客户端与所述目标客户端为不同的客户端;所述服务器指示所述目标客户端将所述第二区块链发送到所述目标辅助计算客户端,以使得所述目标辅助计算客户端通过所述第二区块链对所述目标客户端进行校验,确定是否合法;所述服务器接收所述目标辅助计算客户端对所述目标客户端的校验结果,在所述目标客户端的校验结果为合法时,向所述目标客户端下发视频流地址,在所述目标客户端的校验结果为非法时,拒绝向所述目标客户端下发视频流地址。
- 根据权利要求1所述的方法,其特征在于,在所述服务器在预先确定的辅助计算客户端集合中选择目标辅助计算客户端之前,所述方法还包括:所述服务器下发第三区块链到直播平台所有客户端,以使得所述直播平台上的各客户端收到所述第三区块链后生成第四区块链,并将所述第四区块链发送到所述服务器,所述第四区块链中包括客户端计算能力信息;所述服务器根据接收到的客户端计算能力信息,挑选计算能力达到预设要求的预设数量的客户端作为所述服务器的辅助计算客户端集合。
- 根据权利要求2所述的方法,其特征在于,所述客户端计算能力信息为客户端生成所述第四区块链消耗的处理器计算时间,所述服务器根据接收到的客户端计算能力信息,挑选计算能力达到预设要求的预设数量的客户端,作为所述服务器的辅助计算客户端集合的步骤,包括:所述服务器根据接收到的各客户端生成所述第四区块链消耗的处理器计算时间,挑选处理器计算时间低于预设时间阈值的预设数量的客户端,作为所述服务器的辅助计算客户端集合,或者,所述服务器根据接收到的各客户端生成所述第四区块链消耗的处理器计算时间,挑选处理器计算时间最短的预设数量的客户端,作为所述服务器 的辅助计算客户端集合。
- 根据权利要求1所述的方法,其特征在于,所述第二区块链中包括所述目标客户端的计算能力信息;所述方法还包括:在确定所述目标客户端合法后,若所述目标客户端的计算能力到达预设要求,则将所述目标客户端加入所述服务器的辅助计算客户端集合。
- 根据权利要求3所述的方法,其特征在于,所述方法还包括:在将所述目标客户端加入所述服务器的辅助计算客户端集合后,若检测到所述目标客户端离开直播平台,则在所述辅助计算客户端集合中删除所述目标客户端。
- 根据权利要求1所述的方法,其特征在于,所述第一区块链、所述第二区块链的数据结构相同;所述数据结构包括区块链的块号、前一个区块链的哈希值、计算新区块链消耗的处理器计算时间、计算新区块链需要的key值、当前时间的时间戳、区块链功能数据及当前区块链哈希值,所述区块链功能数据包括当前客户端所在房间的房间号,所述客户端的用户标识以及所述客户端的标志。
- 一种服务器,其特征在于,所述服务器包括:第一发送模块,用于在接收到目标客户端发送的视频流地址请求时,下发用于对所述目标客户端鉴权的第一区块链,以使得所述目标客户端根据所述第一区块链生成第二区块链;选择模块,用于在预先确定的辅助计算客户端集合中选择目标辅助计算客户端,所述目标辅助计算客户端与所述目标客户端为不同的客户端;指示模块,用于指示所述目标客户端将所述第二区块链发送到所述目标辅助计算客户端,以使得所述目标辅助计算客户端通过所述第二区块链对所述目标客户端进行校验,确定是否合法;接收模块,用于接收所述目标辅助计算客户端对所述目标客户端的校验结果;第二发送模块,用于在所述目标客户端的校验结果为合法时,向所述目标客户端下发视频流地址,在所述目标客户端的校验结果为非法时,拒绝向所述目标客户端下发视频流地址。
- 根据权利要求6所述的服务器,其特征在于,所述服务器还包括:第三发送模块,用于在所述选择模块在预先确定的辅助计算客户端集合中选择目标辅助计算客户端之前,下发第三区块链到直播平台所有客户端,以使得所述直播平台上的各客户端收到所述第三区块链后生成第四区块链,并将所述第四区块链发送到所述服务器,所述第四区块链中包括客户端计算能力信息;挑选模块,用于根据接收到的客户端计算能力信息,挑选计算能力达到预设要求的预设数量的客户端作为所述服务器的辅助计算客户端集合。
- 根据权利要求8所述的服务器,其特征在于,所述客户端计算能力信息为客户端生成所述第四区块链消耗的处理器计算时间,所述挑选模块具体用于:根据接收到的各客户端生成所述第四区块链消耗的处理器计算时间,挑选处理器计算时间低于预设时间阈值的预设数量的客户端,作为所述服务器的辅助计算客户端集合,或者,根据接收到的各客户端生成所述第四区块链消耗的处理器计算时间,挑选处理器计算时间最短的预设数量的客户端,作为所述服务器的辅助计算客户端集合。
- 一种服务器,其特征在于,包括:存储器,处理器及存储在所述存储器上并可在所述处理器上运行的计算机程序,其中,所述处理器执行所述计算机程序时可以实现权利要求1至6任一所述的方法。
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710884349.X | 2017-09-26 | ||
CN201710884349.XA CN107801059B (zh) | 2017-09-26 | 2017-09-26 | 一种鉴权方法及服务器 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2019061599A1 true WO2019061599A1 (zh) | 2019-04-04 |
Family
ID=61532442
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2017/107088 WO2019061599A1 (zh) | 2017-09-26 | 2017-10-20 | 一种鉴权方法及服务器 |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN107801059B (zh) |
WO (1) | WO2019061599A1 (zh) |
Families Citing this family (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108521590B (zh) * | 2018-04-10 | 2022-08-26 | 北京息通网络技术有限公司 | 一种防止虚假视频数据中继的方法与*** |
US11019059B2 (en) * | 2018-04-26 | 2021-05-25 | Radware, Ltd | Blockchain-based admission processes for protected entities |
CN109040783A (zh) * | 2018-09-11 | 2018-12-18 | 北京朗达和顺科技有限公司 | 一种视频防伪***、方法及装置 |
CN109361661B (zh) * | 2018-10-08 | 2020-07-10 | 莆田市烛火信息技术有限公司 | 一种依附相关链算力的区块链的共识装置 |
US10972777B2 (en) | 2018-10-24 | 2021-04-06 | At&T Intellectual Property I, L.P. | Method and apparatus for authenticating media based on tokens |
TWI689194B (zh) * | 2019-01-22 | 2020-03-21 | 開曼群島商現代財富控股有限公司 | 基於無分派者秘密共享的門檻式簽章系統及其方法 |
CN111355980B (zh) * | 2020-04-16 | 2022-05-03 | 中奥科技发展(深圳)有限公司 | 用于数字化视频产品的版权归属处理方法及*** |
CN113938702A (zh) * | 2020-07-13 | 2022-01-14 | 富泰华工业(深圳)有限公司 | 基于区块链***的多媒体数据流防篡改装置、方法及介质 |
CN113645214B (zh) * | 2021-08-03 | 2023-08-15 | 北京百度网讯科技有限公司 | 数据检测方法、装置、电子设备及可读存储介质 |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106303715A (zh) * | 2016-08-25 | 2017-01-04 | 乐视控股(北京)有限公司 | 弹幕存储处理方法及装置 |
CN107018432A (zh) * | 2017-03-28 | 2017-08-04 | 华为技术有限公司 | 媒体内容的许可方法以及设备 |
CN107172135A (zh) * | 2017-05-03 | 2017-09-15 | 施瑞琦 | 基于区块链的收视率统计方法及*** |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102572558B (zh) * | 2011-12-31 | 2015-11-25 | 华为技术有限公司 | 一种视频插播的方法、装置及*** |
CN104394366B (zh) * | 2014-11-26 | 2018-01-30 | 东南大学 | 分布式视频流媒体转码访问控制的方法和*** |
CN105657474B (zh) * | 2016-02-19 | 2019-04-26 | 微鲸科技有限公司 | 在视频应用中使用基于身份签名体制的防盗链方法及*** |
CN107094261A (zh) * | 2017-03-17 | 2017-08-25 | 武汉斗鱼网络科技有限公司 | 视频播放的权限校验方法及装置 |
CN107171785A (zh) * | 2017-05-18 | 2017-09-15 | 电子科技大学 | 一种基于区块链技术的数字版权管理方法 |
-
2017
- 2017-09-26 CN CN201710884349.XA patent/CN107801059B/zh active Active
- 2017-10-20 WO PCT/CN2017/107088 patent/WO2019061599A1/zh active Application Filing
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106303715A (zh) * | 2016-08-25 | 2017-01-04 | 乐视控股(北京)有限公司 | 弹幕存储处理方法及装置 |
CN107018432A (zh) * | 2017-03-28 | 2017-08-04 | 华为技术有限公司 | 媒体内容的许可方法以及设备 |
CN107172135A (zh) * | 2017-05-03 | 2017-09-15 | 施瑞琦 | 基于区块链的收视率统计方法及*** |
Also Published As
Publication number | Publication date |
---|---|
CN107801059B (zh) | 2018-09-04 |
CN107801059A (zh) | 2018-03-13 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2019061599A1 (zh) | 一种鉴权方法及服务器 | |
WO2019153433A1 (zh) | 一种密钥的提供、视频播放方法、服务器及客户端 | |
US20220394026A1 (en) | Network identity protection method and device, and electronic equipment and storage medium | |
WO2017215514A1 (zh) | 音视频的加密播放方法及其*** | |
WO2017028593A1 (zh) | 网络接入设备接入无线网络接入点的方法、网络接入设备、应用程序服务器和非易失性计算机可读存储介质 | |
US8631481B2 (en) | Access to a network for distributing digital content | |
US9219607B2 (en) | Provisioning sensitive data into third party | |
WO2018024061A1 (zh) | 一种共享数字内容的许可证的方法、装置及*** | |
JP5626816B2 (ja) | デジタルコンテンツの部分的暗号化のための方法および装置 | |
CN109150897B (zh) | 一种端到端的通信加密方法及装置 | |
WO2013097588A1 (zh) | 应用程序登录方法、装置和移动终端 | |
WO2013056622A1 (zh) | 验证机顶盒接入身份的方法和认证服务器 | |
CN110011950B (zh) | 一种视频流地址的鉴权方法及装置 | |
CN104836784B (zh) | 一种信息处理方法、客户端和服务器 | |
JP2005525622A (ja) | 許可の第三者認証を提供するための方法およびシステム | |
JP2005102163A (ja) | 機器認証システム、機器認証サーバ、端末機器、機器認証方法、機器認証プログラム、及び記憶媒体 | |
CN110958209B (zh) | 基于共享密钥的双向认证方法及***、终端 | |
CN110662091B (zh) | 第三方直播视频接入方法、存储介质、电子设备及*** | |
WO2019110018A1 (zh) | 通信网络***的消息验证方法、通信方法和通信网络*** | |
WO2020062667A1 (zh) | 数据资产管理方法、数据资产管理装置及计算机可读介质 | |
WO2022100356A1 (zh) | 身份认证***、方法、装置、设备及计算机可读存储介质 | |
WO2019061626A1 (zh) | 一种数据校验方法及服务器 | |
CN109040079A (zh) | 直播链接地址的组建和验证方法及相应装置 | |
WO2019061598A1 (zh) | 一种数据校验方法及客户端 | |
US20230132485A1 (en) | System for Thin Client Devices in Hybrid Edge Cloud Systems |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 17926536 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 17926536 Country of ref document: EP Kind code of ref document: A1 |