Disclosure of Invention
In order to solve the above problems, an object of the present invention is to provide a live broadcast method based on a cloud game, in which a user only needs to install a cloud game APP, and can broadcast a traditional end-play game through a mobile phone with the same broadcast effect as that obtained by broadcasting through a computer host, and at the same time, the cost of time for a host to download and install related game software is saved.
Based on this, the invention provides a live broadcast method based on a cloud game, and the method comprises the following steps:
the method comprises the steps that a first mobile terminal sends a game request to a service server and receives a game picture returned by a cloud host, and the service server distributes a cloud platform to the first mobile terminal;
the first mobile terminal obtains a video stream to be output of a game picture compressed by the streaming media server through a low-delay channel;
and the first mobile terminal pushes the video stream to be output.
Wherein, the first mobile terminal pushing the video stream to be output comprises:
the first mobile terminal sends an opening request to the service server, the service server obtains a stream pushing address from the opening server and sends a stream pushing request to the signaling server, the signaling server controls the streaming media server to package a video stream and then push the video stream to the streaming media CDN, and the streaming media CDN distributes the video stream to a plurality of second mobile terminals.
Wherein, the service server obtaining the stream pushing address from the broadcasting server comprises: and the broadcasting server generates a stream pushing address through a preset algorithm and returns the stream pushing address to the service server.
The service server also sends a broadcast success response to the first mobile terminal;
the method for the first mobile terminal to receive the game picture returned by the cloud host comprises the following steps:
the cloud host comprises a signaling server and a media server;
and the signaling server receives the game request sent by the service server, starts a game process, and simultaneously, the media server intercepts a game picture and sends a response success to the first mobile terminal.
After the first mobile terminal sends a game request to a service server, the game request also comprises encrypted Token information carried by the game request, an identifier UID of the first mobile terminal on a cloud platform is obtained, whether the identifier UID is consistent with the identifier UID in the cloud host distribution record or not is judged, and if yes, the game request is safe.
The game request carries a domain name identifier, an application identifier, a video stream identifier and a visual effect instruction.
An embodiment of the present invention further provides a live broadcast device based on a cloud game, which is capable of executing the live broadcast method based on the cloud game according to any one of claims 1 to 6, and the device includes:
the request module is used for sending a game request to a service server and receiving a game picture returned by a cloud host, and the service server distributes the cloud platform to the first mobile terminal;
the acquisition module is used for acquiring a video stream to be output of a game picture compressed by the streaming media server through a low-delay channel;
and the pushing module is used for pushing the video stream to be output.
The embodiment of the invention also provides live broadcast equipment based on the cloud game, which comprises a processor, a memory and a computer program which is stored in the memory and configured to be executed by the processor, wherein the live broadcast method based on the cloud game is realized when the processor executes the computer program.
The embodiment of the invention also provides a computer-readable storage medium, which comprises a stored computer program, wherein when the computer program runs, the device where the computer-readable storage medium is located is controlled to execute the live broadcast method based on the cloud game.
The method comprises the steps that a game request is sent to a business server through a first mobile terminal, and a game picture returned by a cloud host is received, wherein the business server distributes a cloud platform to the first mobile terminal; the first mobile terminal obtains a video stream to be output of a game picture compressed by the streaming media server through a low-delay channel; and the first mobile terminal pushes the video stream to be output. The method and the system can realize that the user only needs to install the cloud game APP, can play the traditional end game through the mobile phone, have the same playing effect as that obtained by playing through the computer host, and simultaneously save the cost of time for downloading and installing the related game software by the anchor.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 1 is a flowchart of a live broadcast method based on a cloud game according to an embodiment of the present invention, where the method includes:
s101, a first mobile terminal sends a game request to a service server and receives a game picture returned by a cloud host, and the service server distributes a cloud platform to the first mobile terminal;
the game request may carry a domain name identification, an application identification, a video stream identification, and a visual effect instruction.
The first mobile terminal receiving the game picture returned by the cloud host comprises the following steps:
the cloud host comprises a signaling server and a media server;
cloud game host computer: the server for running the game can be a physical machine or a virtual machine, different games have requirements on a CPU, a GPU and a memory thereof, the different games have the main responsibility of finishing the rendering of game pictures, and simultaneously, running environments are provided for the signaling server and the media server.
A signaling server: the cloud host computer and the media server assist to complete the functions of starting, running and monitoring of games on the cloud host computer, and meanwhile receive the control command of the service server and complete corresponding operations.
The media server: the core service of the cloud game platform is deployed on a cloud game host together with a signaling server, receives a control command of the signaling server and completes related work, and the core function of the cloud game platform is to capture a game picture, compress the picture by adopting a specific algorithm and send the picture to a user. A service server: the cloud game platform management and distribution system is a control center of the cloud game platform, is responsible for completing scheduling and controlling users to the cloud host of the characteristics, and has other service control logics such as wheat order, charging and other related functions.
The first mobile terminal is provided with a cloud game APP.
After the first mobile terminal sends the game request to the service server, the service server detects the validity of the game request. And the signaling server receives the game request sent by the service server, starts a game process, and simultaneously, the media server intercepts a game picture and sends a response success to the first mobile terminal.
S102, the first mobile terminal obtains a video stream to be output of a game picture compressed by a streaming media server through a low-delay channel;
the streaming media server: the method has the advantages that the cloud game streaming media processing function is provided, meanwhile, the streaming media processing function of the live broadcasting software is also born, and the core functions of capturing, preprocessing, coding and the like of game pictures are completed.
S103, the first mobile terminal pushes the video stream to be output.
The first mobile terminal pushing the video stream to be output comprises the following steps:
the first mobile terminal sends an opening request to the service server, the service server obtains a stream pushing address from the opening server and sends a stream pushing request to the signaling server, the signaling server controls the streaming media server to package a video stream and then push the video stream to the streaming media CDN, and the streaming media CDN distributes the video stream to a plurality of second mobile terminals.
The broadcasting server: in the live broadcast platform, the service processes responsible for the functions of anchor broadcast management, authentication, broadcast stream address generation, etc. often adopt a micro-service architecture in implementation.
CDN: it is called Content Delivery Network, i.e. Content distribution Network. The CDN is a content delivery network constructed on the network, and by means of edge servers deployed in various places, a user can obtain required content nearby through functional modules of a central platform, such as load balancing, content delivery, scheduling and the like, so that network congestion is reduced, and the access response speed and hit rate of the user are improved. The key technology of the CDN is mainly content storage and distribution technology. The streaming media CDN is used for distributing game picture streaming media.
The service server obtaining the stream pushing address from the broadcasting server comprises: and the broadcasting server generates a stream pushing address through a preset algorithm and returns the stream pushing address to the service server.
The service server also sends a broadcast success response to the first mobile terminal;
in practical application, when a user opens a live broadcast room to watch live video, the client on the second mobile terminal will send a video stream address request message to the server to obtain a video stream address of a live broadcast room. In order to protect the safety and effectiveness of the video stream address, the client needs to carry the client information and the client verification code in the request message when requesting. The client information comprises some personal information of the user and a Token value returned by the live broadcast server; the user information includes a device identifier (such as a device unique ID number) and an IP address of the client, a live broadcast room ID (such as a room number of a live broadcast room), a random number KEY transmitted to the user by the login server of the login server, and a system Time of the current client. And the Token value returned by the live broadcast server is the Token value returned by the website when the user logs in the live broadcast website. The client side can splice the information and generate a KEY value of a video stream address request by using an MD5 algorithm, namely a client side verification code, after the information is reported to the server, the server can generate another new KEY value by using the same MD5 algorithm according to the client side information reported by the client side, namely the server verification code, the server can judge whether the KEY value generated by the server is consistent with the KEY value of the client side, if not, the server rejects the request, if so, the server returns a video stream address of the client side, and the client side can play videos by the address.
The validity of the video stream address is valid for the first time, namely, a valid address is used for one time, the address can be used only once, and the video stream is obtained by using the same video stream address for the next time and is regarded as invalid, so that a hacker or a malicious third party is effectively prevented from obtaining the address and then pulling the video stream arbitrarily. Furthermore, in the video stream address algorithm in the embodiment of the present invention, the token when the user logs in is used as a part of the KEY value calculation, so that the user must log in before pulling the video stream address, and a hacker or a malicious third party who steals the stream address must implement the login function of the website, thereby increasing the implementation threshold thereof. Meanwhile, in order to further protect the video stream address, in the embodiment of the invention, some personal user information of the client is used as a part of the technical KEY value, wherein the personal user information comprises the IP address of the client, the unique ID of the equipment, the random KEY value which is passed by the server to the client, the current system time and the like, so that the security of the video stream address can be greatly protected.
After the first mobile terminal sends a game request to a service server, the game request also comprises encrypted Token information carried by the game request, an identifier UID of the first mobile terminal on a cloud platform is obtained, whether the identifier UID is consistent with the identifier UID in the cloud host distribution record or not is judged, if yes, the game request is safe, and if not, the game request is invalid.
The method comprises the steps that a game request is sent to a business server through a first mobile terminal, and a game picture returned by a cloud host is received, wherein the business server distributes a cloud platform to the first mobile terminal; the first mobile terminal obtains a video stream to be output of a game picture compressed by the streaming media server through a low-delay channel; and the first mobile terminal pushes the video stream to be output. The method and the system can realize that the user only needs to install the cloud game APP, can play the traditional end game through the mobile phone, have the same playing effect as that obtained by playing through the computer host, and simultaneously save the cost of time for downloading and installing the related game software by the anchor.
Fig. 2 is a schematic diagram of a cloud game based live broadcast device provided in an embodiment of the present invention, where the device includes:
a request module 201, configured to send a game request to a service server and receive a game screen returned by a cloud host, where the service server allocates the cloud platform to the first mobile terminal;
an obtaining module 202, configured to obtain, through a low-latency channel, a video stream to be output of a game picture compressed by a streaming media server;
the pushing module 203 is configured to push the video stream to be output.
Technical features and technical effects of the live broadcast device based on the cloud game provided by the embodiment of the invention are the same as those of the method provided by the embodiment of the invention, and are not repeated herein.
Fig. 3 is a schematic structural diagram of a live broadcast method based on a cloud game according to an embodiment of the present invention, please refer to fig. 3, which includes:
the method comprises the steps that a first mobile terminal sends a game request to a service server and receives a game picture returned by a cloud host, and the service server distributes a cloud platform to the first mobile terminal;
the first mobile terminal obtains a video stream to be output of a game picture compressed by the streaming media server through a low-delay channel;
and the first mobile terminal pushes the video stream to be output.
The streaming media server provides a cloud game streaming media processing function, simultaneously bears a streaming media processing function of live broadcasting software, completes core functions of capturing, preprocessing, encoding and the like of game pictures, simultaneously, the service server bears a function of a signaling proxy in the live broadcasting software, and interacts with a broadcasting server of a live broadcasting platform to obtain a main broadcasting source address, namely a source address played by a first mobile terminal, and control the streaming media server to push obtained media information to the streaming media, and a second mobile terminal, namely a user side watching live broadcasting, can obtain the streaming media through a specific address through an edge node of a streaming media CDN to watch.
Fig. 4 is an interaction diagram of a live broadcast method based on a cloud game according to an embodiment of the present invention, please refer to fig. 4, which includes:
the method comprises the steps that a first mobile terminal, namely a live broadcast user terminal, initiates a game playing request in a cloud game platform, and after the service server detects that the validity is passed, a cloud host is distributed to the first mobile terminal, and the request is forwarded to a signaling server.
After the signaling server receives the request and completes the validity check, the related game process is started, and the media server is informed to intercept the game picture, and the initialization of the media server is completed.
And sending a successful response to the first mobile terminal, and after receiving the response, the anchor connects with a corresponding streaming media server and acquires a compressed game picture media stream through a low-delay channel.
The first mobile terminal completes game-related operations through the low-delay channel and continuously acquires the media stream.
The first mobile terminal initiates a broadcast request, the service server interacts with the broadcast server, the broadcast server generates a streaming address through a specific algorithm and returns the streaming address to the service server, and the service server sends a broadcast success response to the first mobile terminal.
The service server sends a stream pushing request to the signaling server, the signaling server controls the streaming media server to package a video stream and then push the video stream to a specified source address in the streaming media CDN, and sends a pushing notification to inform the first mobile terminal that the playing is successful.
The streaming media CDN completes the distribution of the video stream, and the second mobile terminal, namely a user side watching the live broadcast, acquires the watching address through a channel and watches the watching address.
The embodiment of the invention also provides live broadcast equipment based on the cloud game, which comprises a processor, a memory and a computer program which is stored in the memory and configured to be executed by the processor, wherein the live broadcast method based on the cloud game is realized when the processor executes the computer program.
The embodiment of the invention also provides a computer-readable storage medium, which comprises a stored computer program, wherein when the computer program runs, the device where the computer-readable storage medium is located is controlled to execute the live broadcast method based on the cloud game.
The logic and/or steps represented in the flowcharts or otherwise described herein, e.g., an ordered listing of executable instructions that can be considered to implement logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device.
More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium could even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, via for instance optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner if necessary, and then stored in a computer memory.
It should be understood that portions of the present invention may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
It is noted that, in this document, relational terms such as "first" and "second," and the like, may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The above description is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and substitutions can be made without departing from the technical principle of the present invention, and these modifications and substitutions should also be regarded as the protection scope of the present invention.