[go: up one dir, main page]

CN111359205A - Operation method and device of cloud game, computer equipment and storage medium - Google Patents

Operation method and device of cloud game, computer equipment and storage medium Download PDF

Info

Publication number
CN111359205A
CN111359205A CN202010116098.2A CN202010116098A CN111359205A CN 111359205 A CN111359205 A CN 111359205A CN 202010116098 A CN202010116098 A CN 202010116098A CN 111359205 A CN111359205 A CN 111359205A
Authority
CN
China
Prior art keywords
game
scheduler
target
resource
execution node
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202010116098.2A
Other languages
Chinese (zh)
Other versions
CN111359205B (en
Inventor
谭显林
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN202010116098.2A priority Critical patent/CN111359205B/en
Publication of CN111359205A publication Critical patent/CN111359205A/en
Application granted granted Critical
Publication of CN111359205B publication Critical patent/CN111359205B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/30Interconnection arrangements between game servers and game devices; Interconnection arrangements between game devices; Interconnection arrangements between game servers
    • A63F13/35Details of game servers
    • A63F13/358Adapting the game course according to the network or server load, e.g. for reducing latency due to different connection speeds between clients
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • H04L67/1004Server selection for load balancing
    • H04L67/1014Server selection for load balancing based on the content of a request

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention provides an operation method and device of a cloud game, computer equipment and a storage medium, wherein the method comprises the following steps: a load balancer receives a game operation request sent by a client, wherein the game operation request comprises a game identifier and a resource requirement; the load balancer selects a target dispatcher matched with the game operation request from a plurality of candidate dispatchers; and the load balancer receives the address information of the target execution node returned by the target scheduler, and sends the address information of the target execution node to the client so that the client can operate the cloud game by connecting the target execution node.

Description

Operation method and device of cloud game, computer equipment and storage medium
Technical Field
The invention relates to the technical field of cloud computing, in particular to an operation method and device of a cloud game, computer equipment and a storage medium.
Background
With the rapid development of the game industry, terminal technology and network bandwidth in recent years, online cloud games have become an indispensable component in people's life. The cloud game is a process that a client can experience the game only by providing a display device and a network transmission device, the client does not need to install any game program, and all game running processes are run through a cloud server.
However, the existing cloud game continuously meets the requirements of the clients, and meanwhile, there still exist some disadvantages, for example, each time a user sends a game request, the user needs to wait for a long time to load the game, and when the number of online users is large, the game is often stuck or even disconnected in the game process, which seriously affects the game experience of the user. Therefore, how to provide a cloud game scheme with higher speed and higher reliability becomes a problem to be solved urgently by those skilled in the art.
Disclosure of Invention
The present invention is directed to a method and an apparatus for operating a cloud game, a computer device and a storage medium, which solve the above-mentioned drawbacks in the prior art.
In order to achieve the above object, the present invention provides an operation method of a cloud game, including the following steps:
a load balancer receives a game operation request sent by a client, wherein the game operation request comprises a game identifier and a resource requirement;
the load balancer selects a target dispatcher matched with the game operation request from a plurality of candidate dispatchers;
and the load balancer receives the address information of the target execution node returned by the target scheduler, and sends the address information of the target execution node to the client so that the client can operate the cloud game by connecting the target execution node.
According to the operation method of the cloud game provided by the invention, the step of selecting the target scheduler matched with the game operation request from a plurality of candidate schedulers by the load balancer comprises the following steps:
calculating a first hash code corresponding to the game identifier, wherein the first hash code is a remainder of a hash value of the game identifier divided by a total number of schedulers;
and taking the candidate scheduler with the number corresponding to the first hash code as a first target scheduler.
According to the operation method of the cloud game provided by the present invention, after the step of using the candidate scheduler with the number corresponding to the hash code as the first target scheduler, the method further includes:
determining whether an execution resource contained by the first target scheduler is larger than the resource request, wherein the execution resource refers to an available resource in all execution nodes managed by the first target scheduler;
if not, calculating a second hash code corresponding to the game identifier, wherein the second hash code is the remainder of the sum of the hash value of the game identifier and a calibration value, and then dividing the sum by the total number of the schedulers, and the calibration value is a prime number relative to the total number of the schedulers;
judging whether the execution resources contained in the scheduler corresponding to the second hash code are larger than the resource request or not;
if so, taking the scheduler corresponding to the second hash code as a second target scheduler;
if not, after the calibration value is replaced, the second Hash code corresponding to the game identifier is calculated again until the execution resource contained in the scheduler corresponding to the second Hash code after calculation again is larger than the resource requirement;
and taking the scheduler corresponding to the recalculated second hash code as a second target scheduler.
In order to achieve the above object, the present invention provides an operation method of a cloud game, including the following steps:
the method comprises the steps that a dispatcher receives a game operation request of a cloud game sent by a load balancer, wherein the game operation request comprises a game identifier and a resource requirement;
the dispatcher judges whether the internal memory of the execution node managed by the dispatcher contains a target game resource corresponding to the game identifier or not;
if yes, the scheduler sends the address of a first execution node containing the target game resource to the load balancer;
if not, the scheduler acquires a second execution node with idle resources larger than the resource demand, and sends the address of the second execution node to the load balancer.
The operation method of the cloud game provided by the invention further comprises the following steps:
if the scheduler cannot acquire a second execution node with idle resources larger than the resource requirement from a plurality of execution nodes, releasing the memory resources in the execution nodes to acquire a third execution node with idle resources larger than the resource requirement, and sending the address of the second execution node to the load balancer.
In order to achieve the above object, the present invention provides an operating device for a cloud game, including:
the request receiving module is suitable for the load balancer to receive a game operation request sent by a client, wherein the game operation request comprises a game identifier and a resource requirement;
the scheduler selection module is suitable for the load balancer to select a target scheduler matched with the game operation request from a plurality of candidate schedulers;
and the address returning module is suitable for receiving the address information of the target execution node returned by the target scheduler by the load balancer and sending the address information of the target execution node to the client so that the client can operate the cloud game by connecting the target execution node.
According to the operation device provided by the invention, the scheduler selection module comprises:
the hash calculation module is used for calculating a first hash code corresponding to the game identifier, wherein the first hash code is the remainder of the hash value of the game identifier divided by the total number of the schedulers;
a target determination module adapted to take the candidate scheduler with a number corresponding to the first hash code as a first target scheduler.
In order to achieve the above object, the present invention provides an operating device for a cloud game, including:
the request receiving module is suitable for the dispatcher to receive a game operation request of the cloud game sent by the load balancer, and the game operation request comprises a game identifier and a resource requirement;
the resource judging module is suitable for the scheduler to judge whether target game resources corresponding to the game identifiers are loaded in the execution nodes managed by the scheduler;
a first address sending module, adapted to send, if a target game resource corresponding to the game identifier has been loaded in an execution node managed by the scheduler, an address of a first execution node containing the target game resource to the load balancer;
and the second address sending module is suitable for the scheduler to obtain a second execution node with idle resources larger than the resource requirement if the target game resource corresponding to the game identifier is not loaded in the execution node managed by the scheduler, and send the address of the second execution node to the load balancer.
To achieve the above object, the present invention further provides a computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the above method when executing the computer program.
To achieve the above object, the present invention also provides a computer-readable storage medium having stored thereon a computer program which, when being executed by a processor, carries out the steps of the above method.
The operation method and device of the cloud game, the computer equipment and the computer readable storage medium provided by the invention provide a cloud game scheme with higher speed and higher reliability. Based on the technical scheme of the invention, after a user sends an operation request of the cloud game at a client, the operation request is firstly sent to the load balancer. The load balancer determines a target scheduler which is matched with the operation request most from the schedulers, and then the target scheduler determines a target execution node which is matched with the operation request most from the execution nodes. And finally, the client is connected with the target execution node to serve as a carrier for really executing the game, so that the aim that a user can experience the cloud game with high quality without purchasing or installing any hardware resource is fulfilled. Compared with the prior art, the method has the advantages that the specific game request can be connected to the same scheduler through the specific algorithm, so that the game data are prevented from being reloaded when the game request is sent each time, and the game connection speed is greatly improved; in addition, a certain amount of common game memory data can be stored in the execution node, when a user frequently operates the same game, the game can be directly operated from the execution node loaded with the game, a remote game resource library does not need to be connected, so that the game waiting time is further shortened, and the game experience of the user is improved.
Drawings
Fig. 1 is a flowchart of a first method for operating a cloud game according to an embodiment of the present invention;
fig. 2 is a schematic diagram of program modules of a first operating device of a cloud game according to an embodiment of the present invention;
fig. 3 is a schematic hardware structure diagram of a first operating device of a cloud game according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. 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.
The operation method and device of the cloud game, the computer equipment and the computer readable storage medium provided by the invention provide a cloud game scheme with higher speed and higher reliability. Based on the technical scheme of the invention, after a user sends an operation request of the cloud game at a client, the operation request is firstly sent to the load balancer. The load balancer determines a target scheduler which is matched with the operation request most from the schedulers, and then the target scheduler determines a target execution node which is matched with the operation request most from the execution nodes. And finally, the client is connected with the target execution node to serve as a carrier for really executing the game, so that the aim that a user can experience the cloud game with high quality without purchasing or installing any hardware resource is fulfilled. Compared with the prior art, the method has the advantages that the specific game request can be connected to the same scheduler through the specific algorithm, so that the game data are prevented from being reloaded when the game request is sent each time, and the game connection speed is greatly improved; in addition, a certain amount of common game memory data can be stored in the execution node, when a user frequently operates the same game, the game can be directly operated from the execution node loaded with the game, a remote game resource library does not need to be connected, so that the game waiting time is further shortened, and the game experience of the user is improved.
Example one
The operation method of the cloud game provided by the invention is suitable for the operation system of the cloud game shown in fig. 1. As shown in fig. 1, an operating system of a cloud game includes a client, a load balancer, an invoker (invoker), and an execution node (worker), except for the client, the main components in the present invention all support horizontal expansion, that is, the present invention may include a plurality of load balancers, a plurality of invokers, and a plurality of execution nodes, thereby satisfying an increasing number of game users and ensuring high reliability of the cloud game.
Referring to fig. 2, the present embodiment provides an operation method of a cloud game, which specifically includes the following steps:
and S1, the load balancer receives a game operation request for the target game sent by the client, wherein the game operation request comprises a game identifier and a resource requirement.
The client comprises any terminal equipment with a display function and a network transmission function, such as a smart phone, a tablet computer, a notebook computer and the like. The load balancer refers to a hardware or software device capable of reasonably distributing game operation requests sent by a client to an available computing node.
The game operation request of the invention can be a request sent by a user clicking a 'start game' button on a web game interface through a client, and the game operation request at least comprises a game identifier and a resource requirement. The game identifier is used for uniquely determining the current game to be operated, and preferably, the game identifier is a string of unique serial numbers and is used for representing a specific version of game with a specific name; the resource requirement refers to one or more of CPU resource, memory resource, GPU resource and FPGA resource required by the target game to be run.
S2, the load balancer selects a target scheduler matching the game operation request from a plurality of candidate schedulers.
The scheduler in the invention is used for allocating various resources required for running the target game for the user, such as the above mentioned CPU resource, memory resource, GPU resource and FPGA resource. In the present embodiment, the scheduler includes a plurality of schedulers, and thus the present invention can be applied to a case where a plurality of game operation requests issued by a plurality of clients are received at the same time.
The steps of the present invention for selecting a target scheduler from a plurality of candidate schedulers are as follows:
and S21, calculating a first hash code corresponding to the game identifier, wherein the first hash code is the remainder of the hash value of the game identifier divided by the total number of the dispatchers.
In a specific embodiment of the present invention, the game identifier is a uniquely determined serial number, and assuming that the total number of the current candidate schedulers is invokerSize, hash operation is performed on the serial number to obtain a hash value hash; the hash value hash is then divided by the total number of schedulers and the remainder is taken to obtain a first hash code H1, as shown in the following equation:
H1=hash%invokerSize。
and S22, taking the candidate scheduler with the number corresponding to the first hash code as a first target scheduler.
In the present invention, a plurality of candidate schedulers are numbered, for example, 10 candidate schedulers are currently in total, and the 10 candidate schedulers are numbered, respectively, to obtain 10 numbers of 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9 in total.
The first hash code H1 is obtained by dividing the serial number by the total number of the scheduler and taking the remainder, and all possible values of the first hash code H1 are from ten numbers of 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9 according to the characteristics of the remainder operation.
Based on the above operations, the present invention may associate the first hash encoding H1 with the encoding of the candidate scheduler, so that the target scheduler may be determined from the first hash encoding H1.
For example, when the first hash code H1 is calculated to be 5, the candidate scheduler with the number 5 is the target scheduler in the present invention.
The invention determines the target dispatcher by the remainder algorithm, and can ensure that the same game request is necessarily corresponding to the same target dispatcher because the serial number of the game request is unique and unchangeable. Therefore, when the user initiates the game operation request for the same game again, the same target scheduler can be corresponded to the last time, and then the target scheduler can directly run the corresponding target game from the local memory of the execution node managed by the target scheduler according to the past record, so that the problem that the waiting time of repeatedly loading the game is too long is avoided.
S23, judging whether the executing resource contained in the first target scheduler is larger than the resource demand, wherein the executing resource refers to the available resource in all executing nodes managed by the first target scheduler.
In the invention, each scheduler manages a plurality of execution nodes, and allocates game operation tasks to proper execution nodes according to the resource use conditions of the execution nodes. If the first target scheduler is obtained according to step S22, it needs to be further determined whether the available resources in all the execution nodes managed by the first target scheduler are greater than the resource requirement for running the target game, and if so, the first target scheduler has the ability to allocate a suitable execution node to run the target game; if not, it represents that the first target scheduler does not currently have sufficient resources to be allocated to run the target game.
And S24, if not, calculating a second hash code corresponding to the game identifier, wherein the second hash code is the remainder of the sum of the hash value of the game identifier and a calibration value and then dividing the sum by the total number of the schedulers, and the calibration value is a prime number relative to the total number of the schedulers.
This step is used to replace the target scheduler in case the execution resources currently comprised by the first target scheduler are insufficient. Specifically, the method comprises the following steps of adding the hash value of the game identifier and a calibration value, and dividing the sum by the remainder of the total number of the dispatchers to obtain a second hash code:
H2=(hash+P)%invokerSize;
where P is a number that is relatively prime to the total number of schedulers. For example, a total number of schedulers of 10, then a number that is coprime to 10 includes 1, 3, 7, and 9. The calibration value P used in the calculation of H2 by the present invention is taken from any one of 1, 3, 7, and 9. Those skilled in the art will appreciate that H2 and H1 obtained by the above calculation must not be the same.
S25, judging whether the execution resource contained in the scheduler corresponding to the second hash code is larger than the resource request; if so, taking the scheduler corresponding to the second hash code as a second target scheduler; if not, after the calibration value is replaced, the second Hash code corresponding to the game identifier is calculated again until the execution resource contained in the scheduler corresponding to the second Hash code after calculation again is larger than the resource requirement; and taking the scheduler corresponding to the recalculated second hash code as a second target scheduler.
The step is used for calculating whether the dispatcher corresponding to the current second Hash code contains enough execution resources to run the target game, if so, the identification can select the dispatcher corresponding to the current second Hash code; if not, the scheduler needs to be continuously replaced until the corresponding scheduler contains enough execution resources to run the target game.
It will be understood by those skilled in the art that in the case that the calibration value includes a plurality of calibration values, a new second hash code will be obtained each time the calibration value is replaced, and the second hash codes calculated by different calibration values must be different from each other.
Further, if the scheduler containing enough execution resources still cannot be obtained after all calibration values P are replaced, the present invention randomly selects one of the schedulers from the candidate schedulers, and waits for resource release after setting the timeout waiting time. If the execution resources contained in the randomly selected scheduler are still smaller than the resource requirement of the target game after the overtime waiting time, the load balancer sends an error report to remind that no available resources exist currently.
And S3, the dispatcher receives a game operation request of the cloud game sent by the load balancer, wherein the game operation request comprises a game identifier and a resource requirement.
Upon determining the appropriate target scheduler, the load balancer of the present invention will send the game operation request to the determined target scheduler. That is, the target scheduler receives the game operation request issued by the load balancer, and further selects a suitable execution node to run the corresponding target game according to the game operation.
And S4, the dispatcher judges whether the execution node managed by the dispatcher is loaded with the target game resource corresponding to the game identifier.
The execution node in the invention can be an actual physical machine, and can also be a virtual software execution module, as long as the relevant functions of CPU, memory, GPU, FPGA and the like can be realized. When the scheduler selects the execution node, whether the execution node of the target game corresponding to the game representation is loaded or not is judged, if yes, the user can directly utilize the execution node of the loaded target game to carry out relevant operation, the time for waiting for game loading is reduced, and the game experience is improved.
It should be noted that, in order to improve the game operation efficiency, after the execution node in the present invention executes a game operation process, the loaded game content is not released immediately, that is, the related hardware or software resources such as the CPU, the memory, the GPU, the FPGA, and the like related to the previous game are not released. The advantage of this is that when the operation request of the same game is received again next time, the executing node does not need to download and run the corresponding game program to the remote game resource library again, but can immediately enter the game operation state from the local, which saves time. Of course, the game standby mode of the present invention also causes a certain waste of resources, so that a part of the loaded game resources can be released according to actual situations when necessary.
And S5, if yes, the dispatcher sends the address of the first execution node where the target game resource is located to the load balancer.
If the first execution node loaded with the corresponding target game is found, the dispatcher directly sends the address of the first execution node to the load balancer, so that the load balancer returns the address of the first execution node to the client.
And S6, if not, the scheduler acquires a second execution node with idle resources larger than the resource requirements from a plurality of execution nodes, and sends the address of the second execution node to the load balancer.
On the basis that all candidate execution nodes are not loaded with the target game, the scheduler selects one of the idle execution nodes as a second execution node for running the target game, and sends the address of the second execution node to the load balancer.
Regarding the specific algorithm for selecting the second executing node, this step is applicable to all arrangement algorithms in the prior art, for example, the order is selected according to the number of the executing nodes, the size is selected according to the executing resource of the executing nodes, and the like, which is not limited by the present invention.
And S7, the load balancer receives the address of the first execution node or the second execution node returned by the target scheduler, and sends the address information to the client so that the client can connect the address, and the cloud game is operated through the first execution node or the second execution node.
And finally, the load balancer sends the received address of the first execution node or the address of the second execution node to the client side so that the client side can directly operate the target game through the first execution node, or the client side can download and operate the target game through the second execution node and then operate the target game.
Referring to fig. 2, an operating device of a cloud game is shown, in the embodiment, the operating device 10 of the cloud game may include or be divided into one or more program modules, and the one or more program modules are stored in a storage medium and executed by one or more processors to implement the operating method of the cloud game. The program module referred to in the present invention refers to a series of computer program instruction segments capable of performing specific functions, and is more suitable for describing the execution process of the operation device 10 of the cloud game in the storage medium than the program itself. The following description will specifically describe the functions of the program modules of the present embodiment:
the request receiving module 11 is adapted to receive a game operation request sent by a client by a load balancer, where the game operation request includes a game identifier and a resource requirement;
a scheduler selection module 12, adapted to select a target scheduler matching the game operation request from a plurality of candidate schedulers by the load balancer;
and an address returning module 13, adapted to receive, by the load balancer, address information of the target execution node returned by the target scheduler, and send the address information of the target execution node to the client, so that the client operates the cloud game by connecting to the target execution node.
According to the operating device provided by the present invention, the scheduler selecting module 12 includes:
a hash calculation module 121, adapted to calculate a first hash code corresponding to the game identifier, where the first hash code is a remainder obtained by dividing a hash value of the game identifier by a total number of the scheduler;
a target determination module 122 adapted to take the candidate scheduler with the number corresponding to the first hash code as the first target scheduler.
In addition, for the case that it is determined that the target game has been loaded, the present invention further provides an operating device 40 for a cloud game, including:
the request receiving module 41 is adapted to receive a game operation request of the cloud game sent by the load balancer, where the game operation request includes a game identifier and a resource requirement;
a resource judging module 41, adapted to judge whether a target game resource corresponding to the game identifier is loaded in an execution node managed by the scheduler;
a first address sending module 43, adapted to, if a target game resource corresponding to the game identifier has been loaded in an execution node managed by the scheduler, send, by the scheduler, an address of a first execution node in the memory, where the first execution node includes the target game resource, to the load balancer;
a second address sending module 44, configured to, if the target game resource corresponding to the game identifier is not loaded in the execution node managed by the scheduler, the scheduler obtains a second execution node from the multiple execution nodes, where an idle resource of the second execution node is greater than the resource requirement, and sends an address of the second execution node to the load balancer.
The embodiment also provides a computer device, such as a smart phone, a tablet computer, a notebook computer, a desktop computer, a rack server, a blade server, a tower server or a rack server (including an independent server or a server cluster composed of a plurality of servers) capable of executing programs, and the like. The computer device 20 of the present embodiment includes at least, but is not limited to: a memory 21, a processor 22, which may be communicatively coupled to each other via a system bus, as shown in FIG. 3. It is noted that fig. 3 only shows the computer device 20 with components 21-22, but it is to be understood that not all shown components are required to be implemented, and that more or fewer components may be implemented instead.
In the present embodiment, the memory 21 (i.e., a readable storage medium) includes a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, and the like. In some embodiments, the storage 21 may be an internal storage unit of the computer device 20, such as a hard disk or a memory of the computer device 20. In other embodiments, the memory 21 may also be an external storage device of the computer device 20, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), or the like, provided on the computer device 20. Of course, the memory 21 may also include both internal and external storage devices of the computer device 20. In this embodiment, the memory 21 is generally used to store an operating system installed in the computer device 20 and various application software, such as a program code of the operating device 10 of the cloud game in the first embodiment. Further, the memory 21 may also be used to temporarily store various types of data that have been output or are to be output.
Processor 22 may be a Central Processing Unit (CPU), controller, microcontroller, microprocessor, or other data Processing chip in some embodiments. The processor 22 is typically used to control the overall operation of the computer device 20. In this embodiment, the processor 22 is configured to run the program code stored in the memory 21 or process data, for example, run the operation device 10 of the cloud game, so as to implement the operation method of the cloud game in the first embodiment.
The present embodiment also provides a computer-readable storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, a server, an App application mall, etc., on which a computer program is stored, which when executed by a processor implements corresponding functions. The computer-readable storage medium of the embodiment is used for storing the operation device 10 of the cloud game, and when being executed by the processor, the operation device of the cloud game implements the operation method of the cloud game of the first embodiment.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing specific logical functions or steps of the process, and alternate implementations are included within the scope of the preferred embodiment of the present invention in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the present invention.
It will be understood by those skilled in the art that all or part of the steps carried by the method for implementing the above embodiments may be implemented by hardware related to instructions of a program, which may be stored in a computer readable medium, and when executed, the program includes one or a combination of the steps of the method embodiments.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example" or "some examples" or the like are intended to mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (10)

1. An operation method of a cloud game is characterized by comprising the following steps:
a load balancer receives a game operation request sent by a client, wherein the game operation request comprises a game identifier and a resource requirement;
the load balancer selects a target dispatcher matched with the game operation request from a plurality of candidate dispatchers;
and the load balancer receives the address information of the target execution node returned by the target scheduler, and sends the address information of the target execution node to the client so that the client can operate the cloud game by connecting the target execution node.
2. The method of claim 1, wherein the step of the load balancer selecting a target scheduler matching the game operation request from a plurality of candidate schedulers comprises:
calculating a first hash code corresponding to the game identifier, wherein the first hash code is a remainder of a hash value of the game identifier divided by a total number of schedulers;
and taking the candidate scheduler with the number corresponding to the first hash code as a first target scheduler.
3. The method of claim 2, wherein after the step of using the candidate scheduler with the number corresponding to the hash code as the first target scheduler, the method further comprises:
determining whether an execution resource contained by the first target scheduler is larger than the resource request, wherein the execution resource refers to an available resource in all execution nodes managed by the first target scheduler;
if not, calculating a second hash code corresponding to the game identifier, wherein the second hash code is the remainder of the sum of the hash value of the game identifier and a calibration value, and then dividing the sum by the total number of the schedulers, and the calibration value is a prime number relative to the total number of the schedulers;
judging whether the execution resources contained in the scheduler corresponding to the second hash code are larger than the resource request or not;
if so, taking the scheduler corresponding to the second hash code as a second target scheduler;
if not, after the calibration value is replaced, the second Hash code corresponding to the game identifier is calculated again until the execution resource contained in the scheduler corresponding to the second Hash code after calculation again is larger than the resource requirement;
and taking the scheduler corresponding to the recalculated second hash code as a second target scheduler.
4. An operation method of a cloud game is characterized by comprising the following steps:
the method comprises the steps that a dispatcher receives a game operation request of a cloud game sent by a load balancer, wherein the game operation request comprises a game identifier and a resource requirement;
the dispatcher judges whether a target game resource corresponding to the game identifier is loaded in an execution node managed by the dispatcher;
if yes, the scheduler sends the address of the first execution node loaded with the target game resource to the load balancer;
if not, the scheduler acquires a second execution node with idle resources larger than the resource requirement from a plurality of execution nodes, and sends the address of the second execution node to the load balancer.
5. The operation method of the cloud game according to claim 4, further comprising:
if the scheduler cannot acquire a second execution node with idle resources larger than the resource requirement from a plurality of execution nodes, releasing the memory resources in the execution nodes to acquire a third execution node with idle resources larger than the resource requirement, and sending the address of the second execution node to the load balancer.
6. An operating device of a cloud game, comprising:
the request receiving module is suitable for the load balancer to receive a game operation request sent by a client, wherein the game operation request comprises a game identifier and a resource requirement;
the scheduler selection module is suitable for the load balancer to select a target scheduler matched with the game operation request from a plurality of candidate schedulers;
and the address returning module is suitable for receiving the address information of the target execution node returned by the target scheduler by the load balancer and sending the address information of the target execution node to the client so that the client can operate the cloud game by connecting the target execution node.
7. The operating device of claim 6, wherein the scheduler selection module comprises:
the hash calculation module is used for calculating a first hash code corresponding to the game identifier, wherein the first hash code is the remainder of the hash value of the game identifier divided by the total number of the schedulers;
a target determination module adapted to take the candidate scheduler with a number corresponding to the first hash code as a first target scheduler.
8. An operating device of a cloud game, comprising:
the request receiving module is suitable for the dispatcher to receive a game operation request of the cloud game sent by the load balancer, and the game operation request comprises a game identifier and a resource requirement;
the resource judging module is suitable for the scheduler to judge whether target game resources corresponding to the game identifiers are loaded in the execution nodes managed by the scheduler;
a first address sending module, adapted to send, by the scheduler, an address of a first execution node, which includes the target game resource in the memory, to the load balancer if the target game resource corresponding to the game identifier has been loaded in the execution node managed by the scheduler;
and the second address sending module is suitable for acquiring a second execution node with idle resources larger than the resource requirement from a plurality of execution nodes by the scheduler and sending the address of the second execution node to the load balancer if the target game resource corresponding to the game identifier is not loaded in the execution nodes managed by the scheduler.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the steps of the method of any of claims 1 to 5 are implemented by the processor when executing the computer program.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 5.
CN202010116098.2A 2020-02-25 2020-02-25 Operation method and device of cloud game, computer equipment and storage medium Active CN111359205B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010116098.2A CN111359205B (en) 2020-02-25 2020-02-25 Operation method and device of cloud game, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010116098.2A CN111359205B (en) 2020-02-25 2020-02-25 Operation method and device of cloud game, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111359205A true CN111359205A (en) 2020-07-03
CN111359205B CN111359205B (en) 2022-10-14

Family

ID=71201202

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010116098.2A Active CN111359205B (en) 2020-02-25 2020-02-25 Operation method and device of cloud game, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111359205B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112169312A (en) * 2020-09-27 2021-01-05 厦门雅基软件有限公司 Queuing scheduling method, device, device and storage medium for cloud game service
CN113342532A (en) * 2021-06-25 2021-09-03 深圳前海微众银行股份有限公司 Zookeeper-based distributed task scheduling method and system

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108388472A (en) * 2018-03-01 2018-08-10 吉林大学 A kind of elastic task scheduling system and method based on Docker clusters
CN110417903A (en) * 2019-08-01 2019-11-05 广州知弘科技有限公司 A kind of information processing method and system based on cloud computing

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108388472A (en) * 2018-03-01 2018-08-10 吉林大学 A kind of elastic task scheduling system and method based on Docker clusters
CN110417903A (en) * 2019-08-01 2019-11-05 广州知弘科技有限公司 A kind of information processing method and system based on cloud computing

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112169312A (en) * 2020-09-27 2021-01-05 厦门雅基软件有限公司 Queuing scheduling method, device, device and storage medium for cloud game service
CN113342532A (en) * 2021-06-25 2021-09-03 深圳前海微众银行股份有限公司 Zookeeper-based distributed task scheduling method and system
CN113342532B (en) * 2021-06-25 2023-03-21 深圳前海微众银行股份有限公司 Zookeeper-based distributed task scheduling method and system

Also Published As

Publication number Publication date
CN111359205B (en) 2022-10-14

Similar Documents

Publication Publication Date Title
CN110647394B (en) Resource allocation method, device and equipment
CN108717379B (en) Electronic device, distributed task scheduling method and storage medium
US8381216B2 (en) Dynamic thread pool management
CN109960575B (en) Computing power sharing method, system and related equipment
CN109800083B (en) Method, device, system and storage medium for micro-service collaborative call
CN104899093B (en) Data processing method, device and system
CN111104219A (en) Binding method, device, equipment and storage medium of virtual core and physical core
CN113010265A (en) Pod scheduling method, scheduler, memory plug-in and system
CN111359205B (en) Operation method and device of cloud game, computer equipment and storage medium
CN112860387A (en) Distributed task scheduling method and device, computer equipment and storage medium
CN112162856A (en) GPU virtual resource allocation method and device, computer equipment and storage medium
CN112398892B (en) Service distribution method, device and equipment
CN111709723A (en) RPA business process intelligent processing method, device, computer equipment and storage medium
CN110750336A (en) OpenStack virtual machine memory hot-expanding method
CN111796933A (en) Resource scheduling method, device, storage medium and electronic equipment
US11068317B2 (en) Information processing system and resource allocation method
WO2020211358A1 (en) Database scheduling method and apparatus, and computer device and storage medium
CN112486502B (en) Distributed task deployment method, distributed task deployment device, computer equipment and storage medium
CN107682389A (en) A kind of method, terminal and computer-readable recording medium for performing network request
CN109426561A (en) A kind of task processing method, device and equipment
CN109614242B (en) A computing power sharing method, device, equipment and medium
CN109445863B (en) Data processing method, device, equipment and medium based on FPGA
CN111796934B (en) Task issuing method and device, storage medium and electronic equipment
CN113918344A (en) Resource demand allocation method, device, equipment and computer readable medium
CN114138472A (en) Service data processing method, device and system

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