CN116943142A - Thermomigration method, apparatus, device, storage medium and program product for cloud game - Google Patents

Thermomigration method, apparatus, device, storage medium and program product for cloud game Download PDF

Info

Publication number
CN116943142A
CN116943142A CN202211477541.4A CN202211477541A CN116943142A CN 116943142 A CN116943142 A CN 116943142A CN 202211477541 A CN202211477541 A CN 202211477541A CN 116943142 A CN116943142 A CN 116943142A
Authority
CN
China
Prior art keywords
cloud game
server
migrated
cloud
target
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.)
Pending
Application number
CN202211477541.4A
Other languages
Chinese (zh)
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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202211477541.4A priority Critical patent/CN116943142A/en
Publication of CN116943142A publication Critical patent/CN116943142A/en
Pending legal-status Critical Current

Links

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
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F2300/00Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
    • A63F2300/50Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game characterized by details of game servers
    • A63F2300/53Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game characterized by details of game servers details of basic data processing
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The application provides a thermomigration method, a thermomigration device, electronic equipment, a storage medium and a program product of a cloud game; the method comprises the following steps: acquiring operation information of each cloud game server in the plurality of cloud game servers, wherein the operation information comprises the number of cloud game instances operated on the cloud game servers based on containers; determining a server to be migrated for cloud game migration and a corresponding target server from a plurality of cloud game servers based on the number of cloud game instances running on each cloud game server; obtaining byte streams of cloud game instances running on a server to be migrated from the server to be migrated, wherein the byte streams are obtained by serializing corresponding cloud game instances; the byte stream of each cloud game instance is sent to a target server, which is used to deserialize the byte stream to recreate each cloud game instance. According to the cloud game server running method and device, running cost of the cloud game server can be effectively saved, and running efficiency is improved.

Description

Thermomigration method, apparatus, device, storage medium and program product for cloud game
Technical Field
The present application relates to the field of cloud technologies, and in particular, to a method and apparatus for thermomigration of a cloud game, an electronic device, a storage medium, and a program product.
Background
The hot migration can help save server expenses and server maintenance updates, etc., for example, only a small number of users on some servers are online, and the running instances on these servers can be centrally migrated to one server through the hot migration without affecting online users, and then the servers are shut down to save power or make maintenance updates.
In the related art, because the container has no hardware virtualization, the container hot migration in the related art can only synchronize the container process, the memory and the like, and cannot be applied to the hot migration of the cloud game server, so that the operation cost of the cloud game server in the related art is higher, and the operation efficiency is low.
Disclosure of Invention
The embodiment of the application provides a cloud game thermomigration method, a cloud game thermomigration device, electronic equipment, a computer readable storage medium and a computer program product, which can effectively save the running cost of a cloud game server and improve the running efficiency.
The technical scheme of the embodiment of the application is realized as follows:
the embodiment of the application provides a thermomigration method of a cloud game, which comprises the following steps:
Acquiring operation information of each cloud game server in a plurality of cloud game servers, wherein the operation information comprises the number of cloud game instances operated on the cloud game servers based on containers;
determining a server to be migrated for cloud game migration and a corresponding target server from the plurality of cloud game servers based on the number of cloud game instances running on each cloud game server;
obtaining byte streams of each cloud game instance running on the server to be migrated from the server to be migrated, wherein the byte streams are obtained by serializing the corresponding cloud game instances;
and sending the byte stream of each cloud game instance to the target server, wherein the target server is used for deserializing the byte stream to recreate each cloud game instance.
The embodiment of the application provides a thermomigration device for a cloud game, which comprises:
an obtaining module, configured to obtain operation information of each cloud game server in a plurality of cloud game servers, where the operation information includes a number of cloud game instances that are operated on the cloud game server based on a container;
the determining module is used for determining a server to be migrated for cloud game migration and a corresponding target server from the plurality of cloud game servers based on the number of cloud game instances running on each cloud game server;
The migration module is used for acquiring byte streams of each cloud game instance running on the server to be migrated from the server to be migrated, wherein the byte streams are obtained by serializing the corresponding cloud game instances;
and the sending module is used for sending the byte stream of each cloud game instance to the target server, and the target server is used for deserializing the byte stream to recreate each cloud game instance.
In some embodiments, the determining module is further configured to determine the cloud game server whose number of the running cloud game instances is less than a first threshold as the server to be migrated, and obtain a first number of the servers to be migrated; determining the cloud game servers with the number of the running cloud game instances being greater than or equal to the first threshold and smaller than a second threshold as candidate cloud game servers, and acquiring the second number of the candidate cloud game servers; and determining the target server corresponding to the server to be migrated from the plurality of cloud game servers based on the first number and the second number.
In some embodiments, the determining module is further configured to select, when the first number is smaller than the second number, the first number of candidate cloud game servers from the second number of candidate cloud game servers as the target servers corresponding to the servers to be migrated; when the first number is equal to the second number, determining each candidate cloud game server as the target server corresponding to the server to be migrated; and when the first quantity is larger than the second quantity, acquiring the total quantity of the cloud game instances running on each server to be migrated as a first total quantity and the total quantity of the cloud game instances running in each candidate cloud game server as a second total quantity, and determining the target server corresponding to the server to be migrated based on the first total quantity and the second total quantity.
In some embodiments, the determining module is further configured to determine each of the candidate cloud game servers as a first target server when the first total number is greater than the second total number, and obtain a difference between the first total number and the second total number, and determine a second target server from the plurality of cloud game servers based on the difference, where an idle number of the second target server is greater than or equal to the difference, the idle number is a number of cloud game instances that can be carried by the second target server subtracted from a number of carriers, the number of carriers being a maximum number of cloud game instances that can be carried by the second target server; determining the first target server and the second target server as the target servers corresponding to the servers to be migrated; and when the first total number is smaller than or equal to the second total number, determining each candidate cloud game server as the target server corresponding to the server to be migrated.
In some embodiments, the containers are in a one-to-one correspondence with the cloud game instances, each container corresponds to one of the graphics processors, and the migration module is further configured to send a byte stream acquisition request to the server to be migrated, so that the server to be migrated acquires page table information of the graphics processor corresponding to each container, and based on each page table information, reads a byte stream of each cloud game instance from a video memory space of the corresponding graphics processor; and receiving byte streams of the cloud game instances sent by the server to be migrated.
In some embodiments, the containers are in one-to-one correspondence with the cloud game instances, each container corresponds to one of the graphics processors, and the migration module is further configured to send a byte stream acquisition request to the server to be migrated; receiving page table information of an image processor corresponding to each container sent by the server to be migrated; based on each page table information, a byte stream of each cloud game instance is read from a corresponding video memory space of the image processor.
In some embodiments, the migration module is further configured to obtain the number of objects corresponding to each cloud game instance running on the server to be migrated, where the number of objects is the number of virtual objects in a virtual scene corresponding to the cloud game instance; sequencing all cloud game instances running on the server to be migrated according to the sequence from small to large of the object number to obtain a cloud game instance queue; and sequentially acquiring byte streams of each cloud game instance in the cloud game instance queue from the head of the cloud game instance queue.
In some embodiments, the sending module is further configured to send the byte stream of each cloud game instance to the target server sequentially according to an acquisition order of the byte stream of each cloud game instance.
In some embodiments, the foregoing migration module is further configured to perform the following processing for each of the cloud game instances running on the server to be migrated: determining a dynamic virtual object and a static virtual object from virtual objects included in a virtual scene corresponding to the cloud game instance; the dynamic virtual object is the virtual object in a moving state in the virtual scene, and the static virtual object is the virtual object in a static state in the virtual scene; acquiring byte streams corresponding to the static virtual objects; and acquiring the byte stream corresponding to each dynamic virtual object in response to the completion of acquiring the byte stream corresponding to each static virtual object.
In some embodiments, the migration module is further configured to obtain an acquisition priority of each of the dynamic virtual objects, where the acquisition priority is inversely related to a movement frequency of the dynamic virtual object, and the movement frequency characterizes a number of times the dynamic virtual object moves in the virtual scene in a unit time; sequentially acquiring byte streams corresponding to the dynamic virtual objects according to the order of the acquisition priority from high to low; the sending module is further configured to send byte streams corresponding to the dynamic virtual objects to the target server sequentially according to an acquisition sequence of the byte streams corresponding to the dynamic virtual objects.
In some embodiments, the foregoing thermomigration device for cloud game further includes: the cloud game migration module is used for obtaining terminal information corresponding to cloud game instances running on the server to be migrated, wherein the terminal information indicates a target terminal for displaying the cloud games; and sending the terminal information to the target server so that the target server establishes communication connection with the target terminal based on the terminal information.
In some embodiments, the foregoing thermomigration device for cloud game further includes: the disconnection module is used for responding to the migration completion message sent by the target server and sending a disconnection instruction to the server to be migrated; the disconnection instruction is used for disconnecting the server to be migrated from a target terminal, and the target terminal is a terminal for displaying the cloud game.
An embodiment of the present application provides an electronic device, including:
a memory for storing computer executable instructions or computer programs;
and the processor is used for realizing the thermomigration method of the cloud game when executing the computer executable instructions or the computer programs stored in the memory.
The embodiment of the application provides a computer readable storage medium, which stores computer executable instructions for causing a processor to execute, so as to realize the thermomigration method of the cloud game.
Embodiments of the present application provide a computer program product comprising a computer program or computer-executable instructions stored in a computer-readable storage medium. The processor of the electronic device reads the computer executable instructions from the computer readable storage medium, and the processor executes the computer executable instructions, so that the electronic device executes the thermal migration method of the cloud game according to the embodiment of the application.
The embodiment of the application has the following beneficial effects:
determining a server to be migrated and a target server from a plurality of cloud game servers by acquiring the number of cloud game instances running on each cloud game server based on a container, acquiring byte streams of each cloud game instance running on the server to be migrated from the server to be migrated, transmitting the acquired byte streams to the target server, and performing deserialization on the byte streams through the target server to recreate the cloud game instance migrated from the server to be migrated in the target server. Therefore, cloud game instances operated by the server to be migrated can be ensured to be continuously operated to the target server among cloud game servers operated based on the container, the target terminal connected with the server to be migrated for operating the cloud game can be ensured not to be influenced by the migration of the cloud game instances, the intelligent regulation and control of the operation space of the cloud game server is realized, the cloud game instances operated on the server to be migrated are effectively and intensively migrated to the target server, and therefore the operation space of the server to be migrated is released, the operation cost of the cloud game server is effectively saved, and the operation efficiency is improved.
Drawings
FIG. 1 is a schematic diagram of a thermal migration system for a cloud game according to an embodiment of the present application;
fig. 2 is a schematic structural diagram of an electronic device for thermomigration of a cloud game according to an embodiment of the present application;
FIG. 3 is a flowchart of a method for performing thermomigration on a cloud game according to an embodiment of the present application;
fig. 4 to 5 are schematic diagrams of a thermomigration method of a cloud game according to an embodiment of the present application;
fig. 6 is a schematic diagram of a thermomigration method of a cloud game according to an embodiment of the present application;
fig. 7 to 11 are schematic flow diagrams of a method for thermomigration of a cloud game according to an embodiment of the present application;
fig. 12 to 13 are schematic diagrams of a thermomigration method of a cloud game according to an embodiment of the present application;
fig. 14 is a flowchart of a method for thermomigration of a cloud game according to an embodiment of the present application.
Detailed Description
The present application will be further described in detail with reference to the accompanying drawings, for the purpose of making the objects, technical solutions and advantages of the present application more apparent, and the described embodiments should not be construed as limiting the present application, and all other embodiments obtained by those skilled in the art without making any inventive effort are within the scope of the present application.
In the following description, reference is made to "some embodiments" which describe a subset of all possible embodiments, but it is to be understood that "some embodiments" can be the same subset or different subsets of all possible embodiments and can be combined with one another without conflict.
In the following description, the terms "first", "second", "third" and the like are merely used to distinguish similar objects and do not represent a specific ordering of the objects, it being understood that the "first", "second", "third" may be interchanged with a specific order or sequence, as permitted, to enable embodiments of the application described herein to be practiced otherwise than as illustrated or described herein.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of the application only and is not intended to be limiting of the application.
Before describing embodiments of the present application in further detail, the terms and terminology involved in the embodiments of the present application will be described, and the terms and terminology involved in the embodiments of the present application will be used in the following explanation.
1) Virtual scene: is a scene that the game program displays when running on the terminal device. The scene may be a simulation environment for the real world, a semi-simulation and semi-fictional environment, or a purely fictional virtual environment. The virtual scene may be any one of a two-dimensional virtual scene, a 2.5-dimensional virtual scene or a three-dimensional virtual scene, and the dimension of the virtual scene is not limited in the embodiment of the present application. For example, a virtual scene may include sky, land, sea, etc., the land may include environmental elements of a desert, city, etc., and a user may control a virtual object to move in the virtual scene.
2) Static virtual object: is a virtual object which cannot be interacted in the virtual scene, namely, a resource which cannot be changed in the state in the game process, for example, a static resource can be a building construction, a road surface scene, a mountain ocean and the like in the network game. The static virtual object is a virtual object in a static state in a virtual scene.
3) Dynamic virtual object: virtual objects that are interactable in a virtual scene, i.e. virtual objects whose state may change during the course of a game, for example dynamic resources may be roles controlled by a player, walls that may be destroyed, bullets, etc. The dynamic virtual object is a virtual object in a moving state in the virtual scene.
4) In response to: for representing a condition or state upon which an operation is performed, one or more operations performed may be in real-time or with a set delay when the condition or state upon which the operation is dependent is satisfied; without being specifically described, there is no limitation in the execution sequence of the plurality of operations performed.
5) Cloud gaming: in a cloud computing-based game mode, in a cloud game running mode, all games run on a server side, and rendered game pictures are compressed and then transmitted to a client side through a network. At the client, the user's game device does not need any high-end processor and graphics card, but only needs basic video decompression capability.
6) Client side: a game application running in the terminal.
7) And (3) game: also known as Video Games (Video Games) refer to all interactive Games that run on the platform of an electronic device. The operating media are divided into five categories: host games (in a narrow sense, herein specifically referred to as home games), palm games, arcade games, computer games, and cell phone games.
8) Game engine: refers to the core components of some compiled editable computer game systems or some interactive real-time image applications. These systems provide game designers with a variety of tools required to write games in order to allow the game designer to easily and quickly make game programs without starting from scratch. Most support a variety of operating platforms such as Linux, mac OS X, microsoft Windows. The game engine comprises the following systems: rendering engines (i.e., "renderers," including two-dimensional and three-dimensional image engines), physics engines, collision detection systems, sound effects, script engines, computer animations, artificial intelligence, network engines, and scene management.
9) Element (b): is a container of all components (elements), the elements include two-dimensional elements and three-dimensional elements, all game objects in a game are essentially elements, the game objects themselves do not add any properties to the game, but rather are containers of components (elements) that implement the actual functions.
10 Game engine editor: including scene editors, particle effect editors, model browsers, animation editors, texture editors, and the like. The scene editor is used for placing model objects, light sources, cameras and the like; the particle special effect editor is used for manufacturing various game special effects; the animation editor is used for editing animation functions and can trigger certain events in the game logic; and the material editor is used for editing the model effect.
11 Man-machine interface (Human Machine Interaction, HMI): also known as user interfaces or user interfaces, are media and dialog interfaces for transferring and exchanging information between a person and a computer, and are an important component of computer systems. Is the medium of interaction and information exchange between the system and the user, which enables the conversion between the internal form of the information and the human acceptable form. Human-computer interfaces exist in all fields participating in human-computer information exchange.
10 Graphics processor (Graphics Processing Unit, GPU), also known as display core, vision processor, display chip, is a microprocessor that performs image and graphics related operations specifically on personal computers, workstations, gaming machines, and some mobile devices (e.g., tablet computers, smartphones, etc.).
11 Byte stream): refers to a continuous stream of binary byte arrays that do not contain boundaries.
In the implementation of the embodiments of the present application, the applicant found that the related art has the following problems:
in the related art, for container hot migration, because the container has no hardware virtualization, the container hot migration of the related art can only synchronize container processes, memories and the like, that is, different possibilities exist in hardware environments, that is, the image processors of the container a and the container B may have differences, so that the container B cannot read data operated by the image processor in the container a from the video memory of the synchronized image processor, and the read game objects are different, that is, the purpose of migrating the game cannot be achieved by migrating the states of the image processors.
The embodiment of the application provides a cloud game thermomigration method, a cloud game thermomigration device, an electronic device, a computer readable storage medium and a computer program product, which can effectively save the running cost of a cloud game server and improve the running efficiency.
Referring to fig. 1, fig. 1 is a schematic architecture diagram of a cloud game thermomigration system 100 according to an embodiment of the present application, where a terminal (a terminal 400 is shown in an exemplary manner) is connected to a server 200 through a network 300, where the network 300 may be a wide area network or a local area network, or a combination of the two.
The terminal 400 is configured to display a cloud game on a graphical interface 410-1 (the graphical interface 410-1 is shown as an example) using a client 410 for a user. The terminal 400 and the server 200 are connected to each other through a wired or wireless network.
In some embodiments, the server 200 may be a stand-alone physical server, a server cluster or a distributed system formed by a plurality of physical servers, or may be a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), and basic cloud computing services such as big data and artificial intelligence platforms. The terminal 400 may be, but is not limited to, a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, a smart television, a smart watch, a car terminal, etc. The electronic device provided by the embodiment of the application can be implemented as a terminal or a server. The terminal and the server may be directly or indirectly connected through wired or wireless communication, which is not limited in the embodiment of the present application.
In some embodiments, the server 200 obtains operation information of each cloud game server of the plurality of cloud game servers, determines a server to be migrated and a target server from the plurality of cloud game servers based on the operation information, obtains a byte stream of a cloud game instance running on the server to be migrated from the server to be migrated, and sends the byte stream to the target server.
In other embodiments, the terminal 400 obtains operation information of each cloud game server of the plurality of cloud game servers, determines a server to be migrated and a target server from the plurality of cloud game servers based on the operation information, obtains a byte stream of a cloud game instance running on the server to be migrated from the server to be migrated, and sends the byte stream to the target server.
In other embodiments, the embodiments of the present application may be implemented by means of Cloud Technology (Cloud Technology), which refers to a hosting Technology that unifies serial resources such as hardware, software, networks, etc. in a wide area network or a local area network, so as to implement calculation, storage, processing, and sharing of data.
The cloud technology is a generic term of network technology, information technology, integration technology, management platform technology, application technology and the like based on cloud computing business model application, can form a resource pool, and is flexible and convenient as required. Cloud computing technology will become an important support. Background services of technical network systems require a large amount of computing and storage resources.
Referring to fig. 2, fig. 2 is a schematic structural diagram of a thermomigration electronic device 500 for cloud game according to an embodiment of the present application, where the electronic device 500 shown in fig. 2 may be the server 200 or the terminal 400 in fig. 1, and the electronic device 500 shown in fig. 2 includes: at least one processor 410, a memory 450, at least one network interface 420. The various components in electronic device 500 are coupled together by bus system 440. It is understood that the bus system 440 is used to enable connected communication between these components. The bus system 440 includes a power bus, a control bus, and a status signal bus in addition to the data bus. But for clarity of illustration the various buses are labeled in fig. 2 as bus system 440.
The processor 410 may be an integrated circuit chip having signal processing capabilities such as a general purpose processor, such as a microprocessor or any conventional processor, or the like, a digital signal processor (DSP, digital Signal Processor), or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or the like.
Memory 450 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid state memory, hard drives, optical drives, and the like. Memory 450 optionally includes one or more storage devices physically remote from processor 410.
Memory 450 includes volatile memory or nonvolatile memory, and may also include both volatile and nonvolatile memory. The nonvolatile Memory may be a Read Only Memory (ROM), and the volatile Memory may be a random access Memory (RAM, random Access Memory). The memory 450 described in embodiments of the present application is intended to comprise any suitable type of memory.
In some embodiments, memory 450 is capable of storing data to support various operations, examples of which include programs, modules and data structures, or subsets or supersets thereof, as exemplified below.
An operating system 451 including system programs, e.g., framework layer, core library layer, driver layer, etc., for handling various basic system services and performing hardware-related tasks, for implementing various basic services and handling hardware-based tasks;
a network communication module 452 for accessing other electronic devices via one or more (wired or wireless) network interfaces 420, the exemplary network interface 420 comprising: bluetooth, wireless compatibility authentication (WiFi, wireless Fidelity), and universal serial bus (USB, universal Serial Bus), etc.
In some embodiments, the thermomigration device for cloud game provided in the embodiments of the present application may be implemented in software, and fig. 2 shows the thermomigration device 455 for cloud game stored in the memory 450, which may be software in the form of a program and a plug-in, and includes the following software modules: the acquisition module 4551, the determination module 4552, the migration module 4553, the transmission module 4554 are logical, and thus may be arbitrarily combined or further split according to the implemented functions. The functions of the respective modules will be described hereinafter.
In other embodiments, the thermomigration device for cloud game provided by the embodiments of the present application may be implemented in hardware, and by way of example, the thermomigration device for cloud game provided by the embodiments of the present application may be a processor in the form of a hardware decoding processor that is programmed to perform the thermomigration method for cloud game provided by the embodiments of the present application, for example, the processor in the form of a hardware decoding processor may employ one or more application specific integrated circuits (ASIC, application Specific Integrated Circuit), DSP, programmable logic device (PLD, programmable Logic Device), complex programmable logic device (CPLD, complex Programmable Logic Device), field programmable gate array (FPGA, field-Programmable Gate Array), or other electronic components.
In some embodiments, the terminal or the server may implement the method for thermomigration of the cloud game provided by the embodiment of the present application by running a computer program or computer executable instructions. For example, the computer program may be a native program (e.g., a dedicated thermo migration program) or a software module in an operating system, e.g., a thermo migration module that may be embedded in any program (e.g., an instant messaging client, an album program, an electronic map client, a navigation client); for example, a Native Application (APP) may be used, i.e. a program that needs to be installed in an operating system to be run. In general, the computer programs described above may be any form of application, module or plug-in.
The method for thermomigration of the cloud game provided by the embodiment of the application will be described in conjunction with the exemplary application and implementation of the server or the terminal provided by the embodiment of the application.
Referring to fig. 3, fig. 3 is a schematic flow chart of a cloud game thermomigration method according to an embodiment of the present application, which will be described with reference to steps 101 to 104 shown in fig. 3, and the cloud game thermomigration method according to an embodiment of the present application may be implemented by a server or a terminal alone or by a server and a terminal cooperatively, and will be described below by taking a scheduling server alone as an example.
In step 101, operational information for each of a plurality of cloud game servers is obtained, the operational information including a number of cloud game instances running on the cloud game server based on the container.
In some embodiments, the container is an operating system independent environment for running applications. The container is a special process running on the host machine, and multiple containers are used among operating system kernels of the same host machine.
In some embodiments, one container is carried on the cloud game server, and one cloud game instance is executed, that is, each container corresponds to one cloud game instance, that is, the number of cloud game instances executed on the cloud game server is equal to the number of containers carried on the cloud game server.
In some embodiments, the operational information of the cloud game server includes a number of cloud game instances on the cloud game server that are running based on the container, i.e., a number of cloud game instances on the cloud game server that are running, i.e., a number of containers on the cloud game server that are running.
As an example, referring to fig. 4, fig. 4 is a schematic diagram of a thermomigration method of a cloud game according to an embodiment of the present application. The operation information of the cloud game server 1 includes the number of cloud game instances (cloud game instance 111, cloud game instance 121, and cloud game container 131) operated on the cloud game server 1 based on the containers (container 11, container 12, and container 13), that is, the number of cloud game instances operated on the cloud game server 1 is 3.
As an example, referring to fig. 4, the operation information of the cloud game server 2 includes the number of cloud game instances (cloud game instances 221 and cloud game instances 231) operated on the cloud game server 2 based on the containers (containers 22 and 23), that is, the number of cloud game instances operated on the cloud game server 2 is 2.
In this way, the number of cloud game instances on each cloud game server is acquired by acquiring the operation information of each cloud game server in the plurality of cloud game servers, so that the number of cloud game instances on each cloud game server is convenient to accurately determine the server to be migrated and the target server based on the number of cloud game instances operated on each cloud game server, and the accuracy of the determined server to be migrated and the target server is effectively improved.
In step 102, a server to be migrated and a corresponding target server to be migrated are determined from a plurality of cloud game servers based on the number of cloud game instances running on each cloud game server.
In some embodiments, the server to be migrated refers to a cloud game server where the cloud game instance being executed needs to be migrated, and the target server refers to a cloud game server where the cloud game instance being executed by the server to be migrated needs to be received.
In some embodiments, the cloud game migration is achieved by performing cloud game migration on a cloud game instance running on a server to be migrated, and migrating the cloud game instance to a corresponding target server.
In some embodiments, cloud game migration refers to a process of migrating a cloud game instance running on a server to be migrated to a target server, so that running loss of the server to be migrated is released, meanwhile, the cloud game instance running on the server to be migrated is guaranteed, the cloud game instance can be migrated to the target server to continue running, a target terminal connected with the server to be migrated and used for running a cloud game can be guaranteed not to be influenced by the migration of the cloud game instance, intelligent regulation and control of a running space of the cloud game server are realized while no perception of the target terminal used for running the cloud game is realized, running cost of the cloud game server is effectively saved, and running efficiency is improved.
In some embodiments, referring to fig. 7, fig. 7 is a flowchart of a method for thermomigration of a cloud game according to an embodiment of the present application, and step 102 shown in fig. 7 may be implemented by executing the following steps 1021 to 1023.
In step 1021, the cloud game servers for which the number of operating cloud game instances is less than a first threshold are determined to be servers to be migrated, and a first number of servers to be migrated is obtained.
In some embodiments, the first threshold may be specifically set according to a number of bearers of the cloud game server, where the first threshold is much smaller than the number of bearers of the cloud game server (e.g., the first threshold is smaller than half of the number of bearers of the cloud game server), and the number of bearers of the cloud game server is the maximum number of cloud game instances that the cloud game server can carry.
In some embodiments, the number of bearers of the cloud game server is equal to the number of containers in the cloud game server.
As an example, when the number of bearers of the cloud game server is 10, the first threshold of the cloud game server may be set to 3.
As an example, referring to fig. 5, fig. 5 is a schematic diagram of a thermomigration method of a cloud game provided by an embodiment of the present application, when a first threshold of a cloud game server is set to 3, the number of cloud game instances operated by a cloud game server 1 is 3 (i.e., cloud game instance 111, cloud game instance 121, and cloud game instance 131), the number of cloud game instances operated by a cloud game server 2 is 2 (i.e., cloud game instance 221 and cloud game instance 231), the number of cloud game instances operated by a cloud game server 3 is 1 (i.e., cloud game instance 311), the number of cloud game instances operated by a cloud game server 4 is 3 (i.e., cloud game instance 431, cloud game instance 411, and cloud game instance), i.e., the number of cloud game instances operated by a cloud game server 2 and a cloud game server 3 is smaller than the first threshold 3, and the cloud game server 2 and the cloud game server 3 are determined as servers.
In some embodiments, the cloud game server is determined to be the server to be migrated when the number of cloud game instances run by the cloud game server is less than a first threshold.
In some embodiments, the first number of servers to be migrated may be at least one (e.g., at least two).
It can be understood that the number of cloud game instances operated by the cloud game server is smaller than the first threshold, the first number of cloud game instances operated by the cloud game server is characterized to be far smaller than the bearing number of the cloud game server, namely, the cloud game server has larger container space redundancy, so that the cloud game server can be determined as the server to be migrated, the cloud game migration is conveniently carried out on the cloud game instances operated by the server to be migrated subsequently, the intelligent regulation and control of the operation space of the cloud game server are realized while no perception of a target terminal for operating the cloud game is realized, the operation cost of the cloud game server is effectively saved, and the operation efficiency is improved.
In step 1022, the number of cloud game instances running is greater than or equal to a first threshold and less than a second threshold is determined as a candidate cloud game server and a second number of candidate cloud game servers is obtained.
As an example, referring to fig. 5, when the first threshold of the cloud game server is set to 3, and the number of bearers of the cloud game server is 11, the corresponding second threshold may be 8, the number of cloud game instances operated by the cloud game server 1 is 3 (i.e., the cloud game instance 111, the cloud instance 121, and the cloud game instance 131), the number of cloud game instances operated by the cloud game server 2 is 2 (i.e., the cloud game instance 221 and the cloud game instance 231), the number of cloud game instances operated by the cloud game server 3 is 1 (i.e., the cloud game instance 311), the number of cloud game instances operated by the cloud game server 4 is 3 (i.e., the cloud game instance 431, the cloud game instance 411, and the cloud game instance 421), the number of cloud game instances operated by the cloud game server 5 is 4 (i.e., the cloud instance 511, the cloud instance 521, the cloud instance 531, and the cloud instance 231), the number of cloud game instances operated by the cloud game server 3 is 1 (i.e., the cloud game instance 631), the number of cloud game instances is determined by the first threshold, the cloud server 4 is equal to the first threshold, and the number of cloud game instances is equal to the second threshold is equal to the threshold of the first threshold, the cloud server 4, and the number of cloud game instances is determined by the first threshold is equal to the threshold.
In some embodiments, the second threshold is a difference between a number of bearers of the cloud gaming server and the first threshold, the number of bearers being a maximum number of cloud game instances that the cloud gaming server can handle.
In some embodiments, the number of cloud game instances run by the candidate cloud game server is greater than or equal to a first threshold and less than a second threshold.
In some embodiments, the second number of candidate cloud game servers may be at least one (e.g., at least two).
Therefore, the candidate cloud game server is accurately determined from the cloud game servers according to the number of the cloud game instances to be operated, so that the cloud game instances to be operated by the server to be migrated can be migrated to the target server to continue to be operated, the target terminal for operating the cloud game is not perceived, intelligent regulation and control of the operation space of the cloud game server are realized, the operation cost of the cloud game server is effectively saved, and the operation efficiency is improved.
In step 1023, a target server corresponding to the server to be migrated is determined from the plurality of cloud game servers based on the first number and the second number.
In some embodiments, step 1023 above may be implemented by: when the first quantity is smaller than the second quantity, selecting the first quantity of candidate cloud game servers from the second quantity of candidate cloud game servers as target servers corresponding to the servers to be migrated; when the first quantity is equal to the second quantity, determining each candidate cloud game server as a target server corresponding to the server to be migrated; and when the first quantity is larger than the second quantity, acquiring the total quantity of cloud game instances running on each server to be migrated as the first quantity and the total quantity of cloud game instances running in each candidate cloud game server as the second quantity, and determining a target server corresponding to the server to be migrated based on the first quantity and the second quantity.
As an example, referring to fig. 5, the second number of candidate cloud game servers is 2 (i.e., cloud game server 1 and cloud game server 4), the first number of cloud game servers to be migrated is 2 (i.e., cloud game server 2 and cloud game server 3), and when the first number is equal to the second number, each candidate cloud game server (cloud game server 1 and cloud game server 4) is determined as a target server corresponding to the server to be migrated (cloud game server 2 and cloud game server 3), and since the number of cloud game instances running on cloud game server 1 and cloud game server 4 is the same and the number of bearers of cloud game server 1 and cloud game server 4 is the same, the free number of cloud game servers 1 and cloud game server 4 is the same, and therefore, the target servers corresponding to the server to be migrated (cloud server 2) may be cloud game server 1 or cloud game server 4, and the target servers corresponding to cloud game server 1 and cloud game server 4 may be cloud game server 4. Referring to fig. 5, fig. 5 schematically sets a target server corresponding to a server to be migrated (cloud game server 2) as a cloud game server 1, and sets a target server corresponding to a server to be migrated (cloud game server 3) as a cloud game server 4.
In some embodiments, when the first number is less than the second number, selecting the first number of candidate cloud game servers from the second number of candidate cloud game servers as target servers corresponding to the servers to be migrated. When the first number of cloud game servers to be migrated is smaller than the second number of cloud game servers Yu Houxuan, then it is described that all candidate cloud game servers are not required to be determined as target servers, and only the first number of candidate cloud game servers are required to be selected from the second number of candidate cloud game servers to be used as target servers corresponding to the servers to be migrated.
As an example, referring to fig. 6, fig. 6 is a schematic diagram of a thermomigration method of a cloud game provided by the embodiment of the present application, when the first threshold of the cloud game server is set to 3, the corresponding second threshold may be 8 when the number of bearers of the cloud game server is 11, the number of cloud game instances operated by the cloud game server 1 is 3 (i.e., the cloud game instance 111, the cloud game instance 121, and the cloud game instance 131), the number of cloud game instances operated by the cloud game server 2 is 2 (i.e., the cloud game instance 221 and the cloud game instance 231), the number of cloud game instances operated by the cloud game server 3 is 3 (i.e., the cloud game instance 311, the cloud game instance 321, and the cloud game instance 331), the number of cloud game instances operated by the cloud game server 4 is 3 (i.e., the cloud instance 431, the cloud instance 411, and the cloud instance 421), the number of cloud game instances operated by the cloud game server 5 is 2 (i.e., the cloud game instance 221 and the cloud instance 231), the number of cloud game instances operated by the cloud server 3 (i.e., the cloud game instance 311, the cloud instance 321, and the cloud instance 331), the number of cloud game instances operated by the cloud server 4 is equal to the first threshold is equal to the threshold, and the number of cloud game instances is equal to the first threshold of the cloud server 1, the cloud server is equal to the threshold of the number of cloud game instances 1, the cloud game instances is determined by the cloud server 4, and the number of the cloud server is equal to the cloud server 1 is the threshold is equal to the threshold is the threshold. The number of cloud game instances that the cloud game server 2 runs is smaller than a first threshold, and the cloud game server 2 is determined as a server to be migrated.
As an example, referring to fig. 6, when the first number (1) of servers to be migrated is smaller than the second number (2) of cloud game servers Yu Houxuan, from among the second number of candidate cloud game servers (i.e., cloud game server 1 and cloud game server 4), the first number (1) of candidate cloud game servers are selected as target servers corresponding to the servers to be migrated, and since the number of cloud game instances running in the cloud game server 1 and cloud game server 4 is the same, one can be arbitrarily selected from the cloud game server 1 and cloud game server 4 as a target server corresponding to the servers to be migrated (as cloud game server 2).
As an example, referring to fig. 6, fig. 6 schematically shows the cloud game server 1 as a target server corresponding to a server to be migrated (cloud game server 2).
In some embodiments, after the selecting the first number of candidate cloud game servers as the target servers corresponding to the servers to be migrated, when the first number is multiple (i.e. at least two), each target server may correspond to one server to be migrated, and the following processes may be sequentially performed for each server to be migrated in the first number of servers to be migrated: acquiring the idle quantity of each unmatched target server, wherein the idle quantity is equal to the bearing quantity of the target server minus the quantity of cloud game instances running on the target server; subtracting the number of cloud game instances running on the server to be migrated from the idle number of each target server to obtain a subtraction value corresponding to the idle number of each target server; and determining the target server corresponding to the minimum subtraction value as a target server matched with the server to be migrated, and determining the matched target server as a matched target server.
In some embodiments, each target server corresponds to at least one server to be migrated, i.e., one target server may correspond to at least one server to be migrated. After the first number of candidate cloud game servers are selected as the target servers corresponding to the servers to be migrated, when the first number is multiple (i.e., at least two), the following processes may be sequentially performed for each server to be migrated in the first number of servers to be migrated: acquiring the idle quantity of each target server, wherein the idle quantity is equal to the bearing quantity of the target server minus the quantity of cloud game instances running on the target server; subtracting the number of cloud game instances running on the server to be migrated from the idle number of each target server to obtain a subtraction value corresponding to the idle number of each target server; and determining the target server corresponding to the minimum subtraction value as a target server matched with the server to be migrated, and updating the idle number of the matched target server to be the idle number minus the number of cloud game instances running on the server to be migrated.
In some embodiments, after determining each candidate cloud game server as a target server corresponding to the server to be migrated when the first number is equal to the second number, when the first number is multiple (i.e., at least two), the following processing may be sequentially performed for each server to be migrated in the first number of servers to be migrated: acquiring the idle quantity of each target server, wherein the idle quantity is equal to the bearing quantity of the target server minus the quantity of cloud game instances running on the target server; subtracting the number of cloud game instances running on the server to be migrated from the idle number of each target server to obtain a subtraction value corresponding to the idle number of each target server; and determining the target server corresponding to the minimum subtraction value as a target server matched with the server to be migrated, and updating the idle number of the matched target server to be the idle number minus the number of cloud game instances running on the server to be migrated.
In some embodiments, after determining each candidate cloud game server as a target server corresponding to a server to be migrated when the first number is equal to the second number, when the first number is multiple (i.e., at least two), each target server may correspond to one server to be migrated, and the following processes may be sequentially performed for each server to be migrated in the first number of servers to be migrated: acquiring the idle quantity of each unmatched target server, wherein the idle quantity is equal to the bearing quantity of the target server minus the quantity of cloud game instances running on the target server; subtracting the number of cloud game instances running on the server to be migrated from the idle number of each target server to obtain a subtraction value corresponding to the idle number of each target server; and determining the target server corresponding to the minimum subtraction value as a target server matched with the server to be migrated, and determining the matched target server as a matched target server.
In some embodiments, the determining the target server corresponding to the server to be migrated based on the first total number and the second total number may be implemented as follows: when the first total number is greater than the second total number, determining each candidate cloud game server as a first target server, acquiring a difference value between the first total number and the second total number, and determining a second target server from a plurality of cloud game servers based on the difference value, wherein the idle number of the second target server is greater than or equal to the difference value, the idle number is the number of cloud game instances running on the second target server subtracted from the bearing number, and the bearing number is the maximum number of cloud game instances which can be borne by the second target server; determining a first target server and a second target server as target servers corresponding to the servers to be migrated; and when the first total number is smaller than or equal to the second total number, determining each candidate cloud game server as a target server corresponding to the server to be migrated.
In some embodiments, when the total number of cloud game instances running on each of the cloud game servers to be migrated is greater than the total number of cloud game instances running in each of the candidate cloud game servers, which indicates that the free capacity of the candidate cloud game servers cannot meet the requirements to be migrated of the servers to be migrated, then each of the candidate cloud game servers may be determined as a first target server (i.e., a portion of the target servers), and then a second target server (i.e., a target server other than the first target server among the plurality of target servers) is determined from the plurality of cloud game servers, so as to meet the migration requirements of the servers to be migrated.
In some embodiments, the determining, based on the difference, the second target server from the plurality of cloud game servers may be implemented as follows: a reference cloud game server is determined from a plurality of cloud game servers, wherein the reference cloud game server is a cloud game server other than the first target server. And determining the cloud game servers with the free number larger than or equal to the difference value from the reference cloud game servers, and determining the cloud game servers with the free number larger than or equal to the difference value as a second target server.
In some embodiments, when the first total number is less than or equal to the second total number, indicating that the free capacity of the candidate cloud game servers can already meet the requirement of waiting for migration of the server to be migrated, then each candidate cloud game server is determined to be the target server corresponding to the server to be migrated, and in this case, the first number of the servers to be migrated is greater than the second number of the candidate cloud game servers, and the server to be migrated corresponds to at least one candidate cloud game server (i.e., the candidate cloud game server with a greater free number corresponds to a plurality of servers to be migrated).
In this way, the number of cloud game instances operated on each cloud game server is used for determining the servers to be migrated and the candidate cloud game servers, the first number of the servers to be migrated and the second number of the candidate cloud game servers, and based on the first number, the second number and the number of the cloud game instances operated on each cloud game server, a corresponding target server is determined for each server to be migrated, so that in the process of migrating the follow-up cloud games, the cloud game instances operated on each server to be migrated can be accurately migrated to the most suitable target server to continue to operate, intelligent regulation and control of the operation space of the cloud game servers are realized, the operation cost of the cloud game servers is effectively saved, and the operation efficiency is improved.
In some embodiments, after step 102 described above, the connection between the target server and the target terminal may be established by: acquiring terminal information corresponding to cloud game instances running on a server to be migrated, wherein the terminal information indicates a target terminal for displaying the cloud game; and sending the terminal information to the target server so that the target server establishes communication connection with the target terminal based on the terminal information.
In some embodiments, the obtaining terminal information corresponding to the cloud game instance running on the server to be migrated, and sending the terminal information to the target server, so that the target server establishes communication connection with the target terminal based on the terminal information may be implemented in the following manner: the following processes are respectively executed for each server to be migrated: terminal information corresponding to cloud game instances running on the server to be migrated is obtained, and the terminal information is sent to a target server corresponding to the server to be migrated, so that the target server corresponding to the server to be migrated establishes communication connection with a target terminal based on the terminal information.
As an example, referring to fig. 13, fig. 13 is a schematic diagram of a thermomigration method of a cloud game provided by an embodiment of the present application, where a game server obtains terminal information (terminal information corresponding to a cloud game client) corresponding to a cloud game instance running on a server to be migrated (cloud game server 1), the terminal information indicating a target terminal for displaying the cloud game (a terminal running the cloud game client); the terminal information is transmitted to the target server (cloud game server 2) so that the target server (cloud game server 2) establishes a communication connection with the target terminal (terminal running the cloud game client) based on the terminal information.
After the server to be migrated and the target server are determined, terminal information corresponding to cloud game instances operated on the server to be migrated is obtained, and the terminal information is sent to the target server corresponding to the server to be migrated, so that the target server corresponding to the server to be migrated is in communication connection with the target terminal based on the terminal information, the cloud game video stream generated by rendering of the target server is conveniently sent to the target terminal for display, the target terminal connected with the server to be migrated and used for operating the cloud game can be prevented from being influenced by cloud game instance migration, intelligent regulation and control of the operation space of the cloud game server are realized while the target terminal for operating the cloud game is not perceived, the operation cost of the cloud game server is effectively saved, and the operation efficiency is improved.
In step 103, a byte stream of each cloud game instance running on the server to be migrated is obtained from the server to be migrated, and the byte stream is obtained by serializing the corresponding cloud game instance.
In some embodiments, byte stream refers to a continuous stream of binary byte arrays that do not contain boundaries.
In some embodiments, the byte stream of the cloud game instance refers to a binary byte array corresponding to the cloud game instance, the binary byte array corresponding to each game time is obtained by serializing the cloud game instance at each game time, and the binary byte arrays corresponding to each game time are ordered according to the sequence of the game time, so as to obtain the byte stream of the cloud game instance.
In some embodiments, from the server to be migrated, obtaining the byte stream of each cloud game instance running on the server to be migrated may be achieved by: mode 1 (corresponding to the following steps 1031 to 1032): the byte stream of each cloud game instance can be read through the server to be migrated, and then the byte stream of each cloud game instance is obtained from the server to be migrated; mode 2 (corresponding to steps 1033 to 1034 below): and directly acquiring page table information of the image processor corresponding to each container sent by the server to be migrated without reading byte streams of each cloud game instance by the server to be migrated, and then reading the byte streams. Through the two modes, byte streams of each cloud game instance running on the server to be migrated can be accurately obtained, so that the obtained byte streams of each cloud game instance running on the server to be migrated can be migrated to the target server conveniently, and therefore accurate migration of the cloud game instance is achieved, and the two modes are described below in connection with the steps 1031 to 1034.
In some embodiments, the containers are in a one-to-one correspondence with cloud game instances, each container corresponds to one graphics processor, referring to fig. 8, fig. 8 is a schematic flow chart of a method for thermomigration of a cloud game according to an embodiment of the present application, and step 103 shown in fig. 8 may be implemented by executing the following steps 1031 to 1032.
In step 1031, a byte stream obtaining request is sent to the server to be migrated, so that the server to be migrated obtains page table information of the graphics processor corresponding to each container, and reads the byte stream of each cloud game instance from the video memory space of the corresponding graphics processor based on each page table information.
In some embodiments, a byte stream fetch request is used to cause a server to be migrated to fetch a byte stream for each cloud instance.
In some embodiments, the byte stream refers to a continuous stream of binary byte arrays without boundaries, the byte stream of the cloud game instance refers to a binary byte array corresponding to the cloud game instance, the binary byte array corresponding to each game time is obtained by serializing the cloud game instance at each game time, and the binary byte arrays corresponding to each game time are ordered according to the sequence of the game time, so as to obtain the byte stream of the cloud game instance.
In some embodiments, the containers correspond to cloud game instances one by one, each container corresponds to a graphics processor, and the server to be migrated may perform the following processing for each container: and acquiring page table information of the graphics processor corresponding to the container, and reading the byte stream of the cloud game instance corresponding to the container from the video memory space of the graphics processor corresponding to the container based on the page table information.
In some embodiments, the page table information of the graphics processor includes a mapping relationship between each video memory space of the graphics processor and the byte stream of the cloud game instance, the mapping relationship between each video memory space and the byte stream of the cloud game instance characterizing whether the byte stream of the cloud game instance is stored in the video memory space.
It may be appreciated that the graphics processor includes a plurality of video memory spaces, where the plurality of video memory spaces includes a first video memory space for storing a byte stream of the cloud game instance and a second video memory space for storing data other than the byte stream of the cloud game instance, and then the mapping relationship may include a first mapping relationship corresponding to the first video memory space and a second mapping relationship corresponding to the second video memory space, where the first mapping relationship corresponding to the first video memory space indicates that the byte stream of the cloud game instance is stored in the first video memory space, and the second mapping relationship corresponding to the second video memory space indicates that the byte stream of the cloud game instance is not stored in the second video memory space. And obtaining mapping relations corresponding to each video memory space from page table information of a graphics processor corresponding to the container, determining a first mapping relation from the mapping relations corresponding to each video memory space, and reading byte streams of cloud game instances corresponding to the container from the video memory space corresponding to the first mapping relation.
As such, because the cloud game instances running on the cloud game server are based on container running (containers do not have hardware virtualization), i.e., there are different possibilities for the hardware environment between different containers, the containers running on the server to be migrated and the containers running on the target server may differ in the corresponding graphics processors. Because the containers running on the target server and the containers running on the server to be migrated may differ from each other, and thus the corresponding video memory space may also differ, if the page table information of the graphics processor corresponding to each container running on the server to be migrated is directly obtained, the page table information is migrated to the target server, and even if the page table information is migrated to the target server due to the difference of the video memory space, the byte stream of the cloud game instance read on the target server may not be the byte stream of the original cloud game instance on the server to be migrated based on the page table information migrated, so that accurate migration of the cloud game instance cannot be realized. Therefore, in the embodiment of the application, the byte stream of each cloud game instance is directly read at the server to be migrated, and the byte stream of the cloud game instance read at the server to be migrated is directly migrated to the target server, so that the problem of inaccurate cloud game instance migration caused by migrating page table information of the graphic processor is avoided, the accuracy of the byte stream of the cloud game instance migrated to the target server is ensured, and the accurate migration of the cloud game instance is realized.
In step 1032, a byte stream for each cloud instance sent by the server to be migrated is received.
Therefore, the byte stream of each cloud game instance is read through the server to be migrated, and the byte stream of each cloud game instance sent by the server to be migrated is received, so that the accurate acquisition of the byte stream of each cloud game instance is realized, the byte stream of each cloud game instance is conveniently and accurately migrated to the target server, the intelligent regulation and control of the running space of the cloud game server is realized, the running cost of the cloud game server is effectively saved, and the running efficiency is improved.
In some embodiments, the containers are in a one-to-one correspondence with cloud game instances, each container corresponds to one graphics processor, referring to fig. 9, fig. 9 is a schematic flow chart of a method for thermomigration of a cloud game according to an embodiment of the present application, and step 103 shown in fig. 9 may be implemented by executing the following steps 1033 to 1034.
In step 1033, a byte stream fetch request is sent to the server to be migrated.
In some embodiments, a byte stream fetch request is used to cause a server to be migrated to fetch a byte stream for each cloud instance.
In step 1034, receiving page table information of an image processor corresponding to each container sent by the server to be migrated; based on each page table information, a byte stream of each cloud game instance is read from a video memory space of a corresponding image processor.
In some embodiments, the containers correspond to cloud game instances one-to-one, each container corresponds to a graphics processor, and the foregoing step 1034 may be performed separately for each container: and acquiring page table information of the graphics processor corresponding to the container, and reading the byte stream of the cloud game instance corresponding to the container from the video memory space of the graphics processor corresponding to the container based on the page table information.
In some embodiments, the page table information of the graphics processor includes a mapping relationship between each video memory space of the graphics processor and the byte stream of the cloud game instance, the mapping relationship between each video memory space and the byte stream of the cloud game instance characterizing whether the byte stream of the cloud game instance is stored in the video memory space.
It may be appreciated that the graphics processor includes a plurality of video memory spaces, where the plurality of video memory spaces includes a first video memory space for storing a byte stream of the cloud game instance and a second video memory space for storing data other than the byte stream of the cloud game instance, and then the mapping relationship may include a first mapping relationship corresponding to the first video memory space and a second mapping relationship corresponding to the second video memory space, where the first mapping relationship corresponding to the first video memory space indicates that the byte stream of the cloud game instance is stored in the first video memory space, and the second mapping relationship corresponding to the second video memory space indicates that the byte stream of the cloud game instance is not stored in the second video memory space. And obtaining mapping relations corresponding to each video memory space from page table information of a graphics processor corresponding to the container, determining a first mapping relation from the mapping relations corresponding to each video memory space, and reading byte streams of cloud game instances corresponding to the container from the video memory space corresponding to the first mapping relation.
As such, because the cloud game instances running on the cloud game server are based on container running (containers do not have hardware virtualization), i.e., there are different possibilities for the hardware environment between different containers, the containers running on the server to be migrated and the containers running on the target server may differ in the corresponding graphics processors. Because the containers running on the target server and the containers running on the server to be migrated may differ from each other, and thus the corresponding video memory space may also differ, if the page table information of the graphics processor corresponding to each container running on the server to be migrated is directly obtained, the page table information is migrated to the target server, and even if the page table information is migrated to the target server due to the difference of the video memory space, the byte stream of the cloud game instance read on the target server may not be the byte stream of the original cloud game instance on the server to be migrated based on the page table information migrated, so that accurate migration of the cloud game instance cannot be realized. Therefore, in the embodiment of the application, the byte stream of each cloud game instance is not read through the server to be migrated, the page table information of the image processor corresponding to each container sent by the server to be migrated is directly obtained, then the byte stream is read, and the read byte stream of the cloud game instance is directly migrated to the target server, so that the problem of inaccurate cloud game instance migration caused by migrating the page table information of the image processor is avoided, the accuracy of the byte stream of the cloud game instance migrated to the target server is ensured, and the accurate migration of the cloud game instance is realized.
Thus, the page table information of the image processor corresponding to each container sent by the server to be migrated is received, and based on the page table information, the byte stream of each cloud game instance is read from the video memory space of the corresponding image processor, so that the byte stream of each cloud game instance is accurately acquired, the byte stream of each cloud game instance is accurately migrated to the target server in the follow-up process, the intelligent regulation and control of the running space of the cloud game server are realized, the running cost of the cloud game server is effectively saved, and the running efficiency is improved.
In some embodiments, the byte stream of each cloud game instance running on the server to be migrated may also be sequentially acquired, and a specific implementation of sequentially acquiring the byte stream is described below.
In some embodiments, referring to fig. 10, fig. 10 is a flowchart of a method for thermomigration of a cloud game according to an embodiment of the present application, and step 103 shown in fig. 10 may be implemented by executing the following steps 1035 to 1037 for each server to be migrated.
In step 1035, the number of objects corresponding to each cloud game instance running on the server to be migrated is obtained, where the number of objects is the number of virtual objects in the virtual scene corresponding to the cloud game instance.
In some embodiments, the virtual scene is a scene displayed when the game program runs on the terminal device, and the virtual scene may include sky, land, sea, etc., and the land may include environmental elements such as desert, city, etc., and virtual objects such as virtual characters, etc.
As an example, the number of objects corresponding to the cloud game instance 21 is 10, the number of objects corresponding to the cloud game instance 22 is 12, the number of objects corresponding to the cloud game instance 23 is 8, and the number of objects corresponding to the cloud game instance 24 is 6.
In step 1036, the cloud game instances running on the server to be migrated are ordered in order of the number of objects from small to large, resulting in a cloud game instance queue.
In some embodiments, the cloud game instance queue refers to a queue formed by arranging cloud game instances in order of small number of objects.
As an example, the number of objects corresponding to the cloud game instance 21 is 10, the number of objects corresponding to the cloud game instance 22 is 12, the number of objects corresponding to the cloud game instance 23 is 8, and the number of objects corresponding to the cloud game instance 24 is 6. The cloud game instances running on the server to be migrated are ordered according to the order of the number of objects from small to large, and a cloud game instance queue is obtained, wherein the cloud game instance queue can be { cloud game instance 24, cloud game instance 23, cloud game instance 21, cloud game instance 22}.
In step 1037, from the top of the cloud game instance queue, byte streams for each cloud game instance in the cloud game instance queue are sequentially obtained.
In some embodiments, the scheduling server sequentially obtains byte streams of each cloud game instance in the cloud game instance queue from the queue head of the cloud game instance queue, and sequentially sends the obtained byte streams of each cloud game instance to the target server in real time, so that the thermomigration of the cloud game instances is completed one by one, that is, the byte streams of each cloud game instance are sequentially sent to the target server according to the obtaining sequence of the byte streams of each cloud game instance, and the cloud game instance with smaller object number can migrate more quickly because the number of objects corresponding to the cloud game instance is proportional to the transmission speed of the cloud game instance.
As an example, from the head of the cloud game instance queue { cloud game instance 24, cloud game instance 23, cloud game instance 21, cloud game instance 22}, the byte stream of the cloud game instance queue { cloud game instance 24, cloud game instance 23, cloud game instance 21, cloud game instance 22}, cloud game instance 24, cloud game instance 23, cloud game instance 21, cloud game instance 22} is sequentially acquired.
Therefore, the byte streams of the cloud game instances are sequentially obtained according to the sequence from small to large in the number of the objects corresponding to the cloud game instances, and the cloud game instances with smaller object numbers can be quickly migrated due to the fact that the number of the objects corresponding to the cloud game instances is in direct proportion to the transmission speed of the cloud game instances, so that the running space of the server to be migrated can be quickly released, the regulation speed of the running space of the cloud game server is realized, the running cost of the cloud game server is effectively saved, and the running efficiency is improved.
In some embodiments, referring to fig. 11, fig. 11 is a flowchart of a method for thermomigration of a cloud game according to an embodiment of the present application, and step 103 shown in fig. 11 may be implemented by executing the following steps 1038 to 1039 for each cloud game instance running on a server to be migrated.
In step 1038, a dynamic virtual object and a static virtual object are determined from virtual objects included in a virtual scene corresponding to the cloud game instance.
In some embodiments, the dynamic virtual object is a virtual object in a moving state in a virtual scene, and the static virtual object is a virtual object in a static state in the virtual scene.
As an example, the dynamic virtual object may be a virtual character, a virtual animal, etc., and the static virtual object may be a virtual tree, a virtual building, etc.
In step 1039, obtaining byte streams corresponding to each static virtual object; and acquiring the byte stream corresponding to each dynamic virtual object in response to the completion of the acquisition of the byte stream corresponding to each static virtual object.
In some embodiments, the byte stream of the cloud game instance includes a byte stream corresponding to a static virtual object and a byte stream of a dynamic virtual object included in a virtual scene corresponding to the cloud game instance, and since the static virtual object does not change in position with time, the dynamic virtual object tends to change in position with time, and therefore, the byte stream corresponding to the static virtual object that does not change with time can be acquired first, and then the byte stream corresponding to the dynamic virtual object that changes with time can be acquired, so that the real-time updating of the byte stream corresponding to the dynamic virtual object is ensured by using the time difference of the byte stream corresponding to the static virtual object when acquiring, and the accuracy and the real-time performance of the byte stream of the acquired cloud game instance are ensured. In some embodiments, a byte stream corresponding to a non-virtual object, such as a virtual map, in a virtual scene may also be obtained.
In some embodiments, the byte stream of the cloud game instance includes a byte stream corresponding to a static virtual object included in a virtual scene corresponding to the cloud game instance, a byte stream of a dynamic virtual object, and a byte stream corresponding to a non-virtual object such as a virtual map in the virtual scene. Therefore, before the step 1039 or after the step 1039, or while the step 1039 is executed, the byte stream corresponding to the non-virtual objects such as the virtual map in the virtual scene is acquired, so that the acquisition integrity of the byte stream of the cloud game instance is effectively ensured.
In some embodiments, the obtaining the byte stream corresponding to each dynamic virtual object may be implemented as follows: acquiring acquisition priorities of the dynamic virtual objects, wherein the acquisition priorities are inversely related to the moving frequency of the dynamic virtual objects, and the moving frequency represents the moving times of the dynamic virtual objects in the virtual scene in unit time; and sequentially acquiring byte streams corresponding to each dynamic virtual object according to the order of the acquisition priority from high to low.
In some embodiments, the frequency of movement of the dynamic virtual object characterizes the number of movements of the dynamic virtual object in the virtual scene within a unit time, for example, the frequency of movement of the dynamic virtual object is lower by 10 times within 1s, which characterizes the number of movements of the dynamic virtual object in the virtual scene to be lower, that is, the slower the change of the dynamic virtual object is, the closer to the static virtual object, the higher the acquisition priority of the corresponding dynamic virtual object is, that is, the higher the acquisition priority of the dynamic virtual object is, that is, the lower the movement frequency is, the more preferentially the dynamic virtual object is acquired, so that the real-time updating property of byte streams corresponding to the dynamic virtual object with higher movement frequency is ensured by using the time difference of byte streams corresponding to the dynamic virtual object with lower movement frequency when acquiring, and the accuracy and the real-time property of the byte streams corresponding to the obtained dynamic virtual objects are improved.
As an example, for dynamic virtual object 31, dynamic virtual object 32, dynamic virtual object 33, and dynamic virtual object 34, the frequency of movement of dynamic virtual object 31 is greater than the frequency of movement of dynamic virtual object 33, greater than the frequency of movement of dynamic virtual object 32, greater than the frequency of movement of dynamic virtual object 34; the corresponding acquisition priority of the dynamic virtual object 31 is smaller than the acquisition priority of the dynamic virtual object 33 and smaller than the acquisition priority of the dynamic virtual object 32 and smaller than the moving frequency of the dynamic virtual object 34, so that byte streams corresponding to the dynamic virtual object 34, the dynamic virtual object 32, the dynamic virtual object 33 and the dynamic virtual object 31 can be sequentially acquired according to the order of the acquisition priority from high to low, and the byte streams corresponding to the dynamic virtual object 34 can be acquired firstly because the moving frequency of the dynamic virtual object 34 is slowest, and the dynamic virtual object 32, the dynamic virtual object 33 and the dynamic virtual object 31 still move in the virtual scene according to the moving frequency respectively in the period of acquiring the byte streams corresponding to the dynamic virtual object 34, so that the byte streams corresponding to the dynamic virtual object 32, the dynamic virtual object 33 and the dynamic virtual object 31 which are acquired later are not influenced by the dynamic virtual object 34, and higher accuracy is maintained.
In this way, the acquisition priority of each dynamic virtual object inversely related to the moving frequency is determined according to the moving frequency of the dynamic virtual object, and byte streams corresponding to each dynamic virtual object are sequentially acquired according to the order of the acquisition priority from high to low, so that byte streams corresponding to dynamic virtual objects with lower moving frequency are preferentially acquired.
In step 104, the byte stream for each cloud instance is sent to a target server, which deserializes the byte stream to recreate each cloud instance.
In some embodiments, the deserialization is the reverse process of the serialization, the byte stream of the cloud game instance refers to the binary byte array corresponding to the cloud game instance, the cloud game instance corresponding to each game time is obtained by deserializing the binary byte array corresponding to the cloud game instance at each game time, and the binary byte array corresponding to each game time is ordered according to the sequence of the game time, so that each cloud game instance can be recreated.
In some embodiments, after receiving the byte stream of each cloud game instance, the target server deserializes the byte stream, renders each cloud game instance after creating each cloud game instance, obtains the video stream of each cloud game instance, and sends the video stream of each cloud game instance to a corresponding target terminal, so that the target terminal performs cloud game display, thereby ensuring that the target terminal connected with the server to be migrated for running the cloud game can not be influenced by the migration of the cloud game instance, realizing the intelligent regulation and control of the running space of the cloud game server while realizing no perception of the target terminal for running the cloud game, effectively saving the running cost of the cloud game server, and improving the running efficiency.
In some embodiments, the step 104 may be implemented as follows: and sequentially sending the byte streams of the cloud game instances to the target server according to the acquisition sequence of the byte streams of the cloud game instances.
In some embodiments, the byte stream of each cloud instance may be in the order of acquisition: and sequentially acquiring byte streams of each cloud game instance according to the sequence of the small to large number of objects corresponding to the cloud game instance. Then, the sending order of the byte streams of the respective cloud game instances may be: and sequentially sending the byte streams of each cloud game instance to the target server according to the sequence of the small to large number of objects corresponding to the cloud game instance.
In some embodiments, the step 104 may be implemented as follows: and sequentially sending byte streams corresponding to the dynamic virtual objects to the target server according to the acquisition sequence of the byte streams corresponding to the dynamic virtual objects.
In some embodiments, the acquisition sequence of the byte stream corresponding to each dynamic virtual object may be: sequentially acquiring byte streams corresponding to each dynamic virtual object according to the order of the acquisition priority from high to low; then, the sending sequence of the byte stream corresponding to each dynamic virtual object may be: and sequentially sending the byte streams corresponding to the dynamic virtual objects to the target server according to the order of the acquisition priority from high to low.
In some embodiments, after the above step 104, the connection between the server to be migrated and the target terminal may be disconnected as follows: responding to a migration completion message sent by a target server, and sending a disconnection instruction to a server to be migrated; the connection disconnection instruction is used for disconnecting the server to be migrated from a target terminal, and the target terminal is a terminal for displaying the cloud game.
In some embodiments, the migration completion message is used to indicate that the cloud game instance has been completely migrated to the target server, and is used to trigger the sending of the disconnection instruction.
As an example, referring to fig. 13, fig. 13 is a schematic diagram of a thermomigration method of a cloud game provided by an embodiment of the present application, in response to a migration completion message sent by a target server (cloud game server 2), a disconnection instruction is sent to a server to be migrated (cloud game server 1) to disconnect the server to be migrated (cloud game server 1) from a target terminal (cloud game client), the target terminal being a terminal for displaying a cloud game.
In this way, by acquiring the number of cloud game instances running on each cloud game server based on the container, determining a server to be migrated and a target server from a plurality of cloud game servers, acquiring byte streams of each cloud game instance running on the server to be migrated from the server to be migrated, transmitting the acquired byte streams to the target server, and deserializing the byte streams by the target server to recreate the cloud game instance migrated from the server to be migrated in the target server. Therefore, cloud game instances operated by the server to be migrated can be ensured to be continuously operated to the target server among cloud game servers operated based on the container, the target terminal connected with the server to be migrated for operating the cloud game can be ensured not to be influenced by the migration of the cloud game instances, the intelligent regulation and control of the operation space of the cloud game server is realized, the cloud game instances operated on the server to be migrated are effectively and intensively migrated to the target server, and therefore the operation space of the server to be migrated is released, the operation cost of the cloud game server is effectively saved, and the operation efficiency is improved.
In the following, an exemplary application of the embodiment of the present application in an application scenario of an actual cloud game will be described.
The cloud game is a game mode based on cloud computing, and in the running mode of the cloud game, all games run on a server side, and rendered game pictures are compressed and then transmitted to a client side through a network. At the client, the user's game device does not need any high-end processor and graphics card, but only needs basic video decompression capability.
In the application scenario of cloud gaming, the game runs in a container of a cloud game server. When it is required to thermally migrate a container from one server to another, the conventional container thermal migration technique can only synchronize the state of the process, memory, network, etc. of the container to the other server, but cannot synchronize the state of the graphics processor to the other server.
The embodiment of the application does not need to directly transfer the state of the graphic processor, but uses the functions of object serialization and anti-serialization in the game engine to transmit the state of each object in the game to another server, and rebuilds the whole game state on the other server, thereby achieving the aim of thermomigration.
In some embodiments, referring to fig. 12, fig. 12 is a schematic diagram of a thermomigration method of a cloud game according to an embodiment of the present application. A plurality of cloud game containers (e.g., cloud game container 11 and cloud game container 12 as shown in fig. 12) may be run on the cloud game server, and during peak periods of cloud game operation, the cloud game containers on the cloud game server are substantially in use, and as cloud game users continue to exit, only a small number of containers may be still in use on one cloud game server. According to the embodiment of the application, the cloud game containers on the cloud game server can be thermally migrated, the scattered cloud game containers are concentrated on some cloud game servers under the condition that the user experience is not affected, and the idle cloud game servers are closed to help save the expenditure of the server, maintain and update the server and the like.
In some embodiments, the game engine generally has a serialization and deserialization function of the objects, for example, a fantasy engine (Unreal), in which all objects inherit from the base class (UObject) of the object, such as player characters, non-player characters (NPCs), maps, etc., all support the serialization and deserialization functions, and the objects can be converted into byte streams, so that the object states can be stored in files or transmitted over a network, so that the objects can be recreated when needed. The server of the network game always keeps the state information of all objects in the game, when migration starts, a new game instance is started on the target server, meanwhile, the migrated player information is used for logging in, then the game server starts to synchronize the current game state of the user to the new game instance, after the state synchronization is completed, the rendering picture of the new game instance can be the same as the picture of the original game instance, then the cloud game client end disconnects the original cloud game instance and establishes connection with the new cloud game instance, and a video stream picture of the new instance is obtained, so that migration is completed.
In some embodiments, referring to fig. 13, fig. 13 is a schematic diagram of a thermomigration method of a cloud game according to an embodiment of the present application. When migration starts, a new game instance is started on the target server (i.e., cloud game server 2 shown in fig. 13), at the same time, in cloud game server 2, login is performed with the migrated player information (i.e., player information of cloud game server 1), then the game server (i.e., cloud game server 2) starts synchronizing the current game state of the user with the new game instance, after the state synchronization is completed, at this time, the new game instance rendering screen (new game instance rendering screen on cloud game server 2) can be made the same as the original game instance screen (old game instance on cloud game server 1), and then the cloud game client disconnects from the original cloud game instance (i.e., cloud game client disconnects from cloud game server 1) and establishes connection with the new game instance (cloud game client and cloud game server 2), so as to obtain a video stream screen of the new instance, thereby completing migration.
In some embodiments, referring to fig. 14, fig. 14 is a flowchart of a method for thermomigration of a cloud game according to an embodiment of the present application, where the method for thermomigration of a cloud game according to an embodiment of the present application may be implemented through steps 201 to 208 shown in fig. 14.
In step 201, the middlebox scheduler gathers user information for the old game instance.
As an example, when migration starts, the middle stage scheduler gathers user information of the game instance to be migrated, i.e. user information of the old game instance.
In step 202, the middlebox scheduler initiates a new game instance on the target server and connects to the game server.
In step 203, the middlebox scheduler logs in user information on the new game instance.
As an example, the middlebox dispatcher logs in user information on a new game instance that needs to be modified to support two connections for the same user, and the new game instance needs to inform the game server that this connection needs to synchronize the game state.
In step 204, the game server synchronizes the object state in this user game to the new game instance.
By way of example, the game server synchronizes the object state in this user game to the new game instance, the state synchronization being performed in an iterative fashion, since the migration is performed while the player is operating, the object state will always change, but after most of the state synchronization only the changed part is synchronized.
In step 205, it is determined whether there is an unsynchronized object, and when there is an unsynchronized object, step 204 is performed.
In step 206, when there are no unsynchronized objects, a new game instance enters the game scene to begin rendering.
As an example, when synchronization is completed, the new game instance enters the actual game scene to start rendering the game screen, and at this time, the new game instance rendering screen can be the same as the original game instance screen.
In step 207, the mid-table scheduler notifies the cloud game client to connect with the new game instance.
As an example, the middle platform scheduler notifies the cloud game client to connect the new game instance, and the cloud game client disconnects the original cloud game instance and establishes connection with the new cloud game instance to obtain a video stream picture of the new instance, thereby completing migration.
In step 208, the old game instance is closed.
As an example, the middle stage scheduler closes the old game instance, completing the migration.
According to the embodiment of the application, the container on the cloud game server can be thermally migrated, the scattered cloud game containers are concentrated on certain servers under the condition that users are not influenced, and the idle servers are closed to help to save the expenditure of the servers, maintain and update the servers and the like.
In this way, by acquiring the number of cloud game instances running on each cloud game server based on the container, determining a server to be migrated and a target server from a plurality of cloud game servers, acquiring byte streams of each cloud game instance running on the server to be migrated from the server to be migrated, transmitting the acquired byte streams to the target server, and deserializing the byte streams by the target server to recreate the cloud game instance migrated from the server to be migrated in the target server. Therefore, cloud game instances operated by the server to be migrated can be ensured to be continuously operated to the target server among cloud game servers operated based on the container, the target terminal connected with the server to be migrated for operating the cloud game can be ensured not to be influenced by the migration of the cloud game instances, the intelligent regulation and control of the operation space of the cloud game server is realized, the cloud game instances operated on the server to be migrated are effectively and intensively migrated to the target server, and therefore the operation space of the server to be migrated is released, the operation cost of the cloud game server is effectively saved, and the operation efficiency is improved.
It will be appreciated that in the embodiments of the present application, related data such as operation information is involved, and when the embodiments of the present application are applied to specific products or technologies, user permissions or agreements need to be obtained, and the collection, use and processing of related data need to comply with related laws and regulations and standards of related countries and regions.
Continuing with the description below of an exemplary architecture of the cloud gaming thermomigration device 455 implemented as a software module provided by embodiments of the present application, in some embodiments, as shown in fig. 2, the software modules stored in the cloud gaming thermomigration device 455 of the memory 450 may include: an obtaining module 4551, configured to obtain operation information of each cloud game server in the plurality of cloud game servers, where the operation information includes a number of cloud game instances that are operated on the cloud game server based on the container; a determining module 4552, configured to determine, from a plurality of cloud game servers, a server to be migrated and a corresponding target server to be migrated based on the number of cloud game instances running on each cloud game server; the migration module 4553 is configured to obtain, from a server to be migrated, a byte stream of each cloud game instance running on the server to be migrated, where the byte stream is obtained by serializing a corresponding cloud game instance; and the sending module 4554 is configured to send the byte stream of each cloud game instance to a target server, and the target server is configured to deserialize the byte stream to recreate each cloud game instance.
In some embodiments, the determining module 4552 is further configured to determine the cloud game servers with the number of running cloud game instances less than the first threshold as servers to be migrated, and obtain the first number of servers to be migrated; determining the cloud game servers with the number of the running cloud game instances being greater than or equal to a first threshold and smaller than a second threshold as candidate cloud game servers, and acquiring the second number of the candidate cloud game servers; based on the first number and the second number, a target server corresponding to the server to be migrated is determined from the plurality of cloud game servers.
In some embodiments, the determining module 4552 is further configured to select, when the first number is smaller than the second number, the first number of candidate cloud game servers from the second number of candidate cloud game servers as the target servers corresponding to the servers to be migrated; when the first quantity is equal to the second quantity, determining each candidate cloud game server as a target server corresponding to the server to be migrated; and when the first quantity is larger than the second quantity, acquiring the total quantity of cloud game instances running on each server to be migrated as the first quantity and the total quantity of cloud game instances running in each candidate cloud game server as the second quantity, and determining a target server corresponding to the server to be migrated based on the first quantity and the second quantity.
In some embodiments, the determining module 4552 is further configured to determine each candidate cloud game server as a first target server when the first total number is greater than the second total number, obtain a difference between the first total number and the second total number, and determine a second target server from the plurality of cloud game servers based on the difference, where the idle number of the second target server is greater than or equal to the difference, the idle number is a number of bearers minus a number of cloud game instances running on the second target server, and the number of bearers is a maximum number of cloud game instances that the second target server can carry; determining a first target server and a second target server as target servers corresponding to the servers to be migrated; and when the first total number is smaller than or equal to the second total number, determining each candidate cloud game server as a target server corresponding to the server to be migrated.
In some embodiments, the containers are in a one-to-one correspondence with the cloud game instances, each container corresponds to one graphics processor, and the migration module 4553 is further configured to send a byte stream obtaining request to the server to be migrated, so that the server to be migrated obtains page table information of the graphics processor corresponding to each container, and reads, from a video memory space of the corresponding graphics processor, a byte stream of each cloud game instance based on each page table information; and receiving byte streams of cloud game instances sent by the server to be migrated.
In some embodiments, the containers are in a one-to-one correspondence with cloud game instances, each container corresponds to a graphics processor, and the migration module 4553 is further configured to send a byte stream obtaining request to a server to be migrated; receiving page table information of an image processor corresponding to each container sent by a server to be migrated; based on each page table information, a byte stream of each cloud game instance is read from a video memory space of a corresponding image processor.
In some embodiments, the migration module 4553 is further configured to obtain the number of objects corresponding to each cloud game instance running on the server to be migrated, where the number of objects is the number of virtual objects in the virtual scene corresponding to the cloud game instance; sequencing all cloud game instances running on the server to be migrated according to the sequence from small to large in number of objects to obtain a cloud game instance queue; and starting from the head of the cloud game instance queue, sequentially acquiring byte streams of each cloud game instance in the cloud game instance queue.
In some embodiments, the sending module 4554 is further configured to send the byte stream of each cloud game instance to the target server sequentially according to the acquisition order of the byte streams of each cloud game instance.
In some embodiments, the foregoing migration module 4553 is further configured to perform the following processing for each cloud game instance running on the server to be migrated: determining a dynamic virtual object and a static virtual object from virtual objects included in a virtual scene corresponding to the cloud game instance; the dynamic virtual object is a virtual object in a moving state in the virtual scene, and the static virtual object is a virtual object in a static state in the virtual scene; obtaining byte streams corresponding to each static virtual object; and acquiring the byte stream corresponding to each dynamic virtual object in response to the completion of the acquisition of the byte stream corresponding to each static virtual object.
In some embodiments, the migration module 4553 is further configured to obtain an acquisition priority of each dynamic virtual object, where the acquisition priority is inversely related to a movement frequency of the dynamic virtual object, and the movement frequency represents a number of movements of the dynamic virtual object in the virtual scene in a unit time; sequentially acquiring byte streams corresponding to each dynamic virtual object according to the order of the acquisition priority from high to low; the sending module 4554 is further configured to send, in sequence, the byte streams corresponding to each dynamic virtual object to the target server according to the acquisition order of the byte streams corresponding to each dynamic virtual object.
In some embodiments, the foregoing thermomigration device for cloud game further includes: the cloud game migration module is used for obtaining terminal information corresponding to cloud game instances running on a server to be migrated, wherein the terminal information indicates a target terminal for displaying the cloud game; and sending the terminal information to the target server so that the target server establishes communication connection with the target terminal based on the terminal information.
In some embodiments, the foregoing thermomigration device for cloud game further includes: the disconnection module is used for responding to the migration completion message sent by the target server and sending a disconnection instruction to the server to be migrated; the connection disconnection instruction is used for disconnecting the server to be migrated from a target terminal, and the target terminal is a terminal for displaying the cloud game.
Embodiments of the present application provide a computer program product comprising a computer program or computer-executable instructions stored in a computer-readable storage medium. The processor of the electronic device reads the computer executable instructions from the computer readable storage medium, and the processor executes the computer executable instructions, so that the electronic device executes the thermal migration method of the cloud game according to the embodiment of the application.
Embodiments of the present application provide a computer-readable storage medium having stored therein computer-executable instructions that, when executed by a processor, cause the processor to perform a method of thermomigration of a cloud game provided by embodiments of the present application, for example, a method of thermomigration of a cloud game as illustrated in fig. 3.
In some embodiments, the computer readable storage medium may be FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; but may be a variety of electronic devices including one or any combination of the above-described memories.
In some embodiments, computer-executable instructions may be written in any form of programming language, including compiled or interpreted languages, or declarative or procedural languages, in the form of programs, software modules, scripts, or code, and they may be deployed in any form, including as stand-alone programs or as modules, components, subroutines, or other units suitable for use in a computing environment.
As an example, computer-executable instructions may, but need not, correspond to files in a file system, may be stored as part of a file that holds other programs or data, such as in one or more scripts in a hypertext markup language (HTML, hyper Text Markup Language) document, in a single file dedicated to the program in question, or in multiple coordinated files (e.g., files that store one or more modules, sub-programs, or portions of code).
As an example, computer-executable instructions may be deployed to be executed on one electronic device or on multiple electronic devices located at one site or, alternatively, on multiple electronic devices distributed across multiple sites and interconnected by a communication network.
In summary, the embodiment of the application has the following beneficial effects:
(1) Determining a server to be migrated and a target server from a plurality of cloud game servers by acquiring the number of cloud game instances running on each cloud game server based on a container, acquiring byte streams of each cloud game instance running on the server to be migrated from the server to be migrated, transmitting the acquired byte streams to the target server, and performing deserialization on the byte streams through the target server to recreate the cloud game instance migrated from the server to be migrated in the target server. Therefore, cloud game instances running on the server to be migrated can be ensured to continue running on the target server between cloud game servers running on the basis of the container, the target terminal connected with the server to be migrated and used for running the cloud game can be ensured not to be influenced by the migration of the cloud game instances, intelligent regulation and control of the running space of the cloud game server are realized, the running cost of the cloud game server is effectively saved, and the running efficiency is improved.
(2) The cloud game server migration method has the advantages that the number of cloud game instances on each cloud game server is obtained by obtaining the operation information of each cloud game server in the plurality of cloud game servers, so that the follow-up determination of the servers to be migrated and the target servers based on the number of cloud game instances operated on each cloud game server is facilitated, and the accuracy of the determined servers to be migrated and the target servers is effectively improved.
(3) The cloud game migration refers to a process of migrating a cloud game instance running on a server to be migrated to a target server, so that the running loss of the server to be migrated is released, meanwhile, the cloud game instance running on the server to be migrated is ensured, the cloud game instance can be migrated to the target server to continue running, the target terminal connected with the server to be migrated and used for running the cloud game can be ensured not to be influenced by the cloud game instance migration, the intelligent regulation and control of the running space of the cloud game server are realized while the target terminal used for running the cloud game is not perceived, the running cost of the cloud game server is effectively saved, and the running efficiency is improved.
(4) The number of cloud game instances operated by the cloud game server is smaller than a first threshold, the first number of cloud game instances operated by the cloud game server is represented to be far smaller than the bearing number of the cloud game server, namely, larger container space redundancy exists in the cloud game server, so that the cloud game server can be determined to be a server to be migrated, cloud game migration is conveniently carried out on the cloud game instances operated by the server to be migrated subsequently, intelligent regulation and control of the operation space of the cloud game server are realized while no perception is realized on a target terminal for operating the cloud game, the operation cost of the cloud game server is effectively saved, and the operation efficiency is improved.
(5) The candidate cloud game servers are accurately determined from the cloud game servers according to the number of the cloud game instances to be operated, so that the cloud game instances to be operated by the server to be moved can be moved to the target server to continue to operate, the target terminal for operating the cloud game is not perceived, intelligent regulation and control of the operation space of the cloud game server are realized, the operation cost of the cloud game server is effectively saved, and the operation efficiency is improved.
(6) After the server to be migrated and the target server are determined, terminal information corresponding to cloud game instances operated on the server to be migrated is obtained, and the terminal information is sent to the target server corresponding to the server to be migrated, so that the target server corresponding to the server to be migrated is in communication connection with the target terminal based on the terminal information, the cloud game video stream generated by rendering through the target server is conveniently sent to the target terminal for display, the target terminal connected with the server to be migrated and used for operating the cloud game can be prevented from being influenced by cloud game instance migration, intelligent regulation and control of the operation space of the cloud game server are realized while the target terminal for operating the cloud game is not perceived, the operation cost of the cloud game server is effectively saved, and the operation efficiency is improved.
(7) The byte stream of each cloud game instance is read through the server to be migrated, and the byte stream of each cloud game instance sent by the server to be migrated is received, so that the accurate acquisition of the byte stream of each cloud game instance is realized, the byte stream of each cloud game instance is convenient to migrate to the target server accurately, the intelligent regulation and control of the running space of the cloud game server are realized, the running cost of the cloud game server is effectively saved, and the running efficiency is improved.
(8) According to the method, byte streams of cloud game instances are sequentially obtained according to the sequence of small to large numbers of objects corresponding to the cloud game instances, and as the number of the objects corresponding to the cloud game instances is proportional to the transmission speed of the cloud game instances, the cloud game instances with smaller number of the objects can be quickly migrated, so that the running space of a server to be migrated can be quickly released, the regulation speed of the running space of the cloud game server is realized, the running cost of the cloud game server is effectively saved, and the running efficiency is improved.
(9) The static virtual object can not change with time, so that byte streams corresponding to the static virtual object can be acquired first, and byte streams corresponding to the dynamic virtual object are acquired after the byte streams corresponding to the static virtual object are acquired, so that the real-time updating property of the byte streams corresponding to the dynamic virtual object is ensured by utilizing the time difference of the byte streams corresponding to the static virtual object when the byte streams are acquired, and the accuracy and the real-time property of the acquired byte streams are improved.
(10) The byte stream of the cloud game instance comprises the byte stream corresponding to the static virtual object and the byte stream of the dynamic virtual object, which are included in the virtual scene corresponding to the cloud game instance, and the static virtual object is not changed with time, so that the dynamic virtual object is often changed with time, and therefore, the byte stream corresponding to the static virtual object which is not changed with time can be acquired first, and then the byte stream corresponding to the dynamic virtual object which is changed with time is acquired, and the accuracy and the instantaneity of the byte stream of the acquired cloud game instance are ensured.
(11) The moving frequency of the dynamic virtual object characterizes the moving times of the dynamic virtual object in the virtual scene within a unit time, for example, the moving frequency of the dynamic virtual object is 10 times in 1s, the lower the moving frequency of the dynamic virtual object is, namely, the change of the dynamic virtual object is slower and approaches to the static virtual object, the higher the acquisition priority of the corresponding dynamic virtual object is, namely, the lower the moving frequency is, the higher the dynamic virtual object is, the acquisition priority is, so that the real-time updating property of byte streams corresponding to the dynamic virtual object with higher moving frequency is ensured by utilizing the time difference of byte streams corresponding to the dynamic virtual object with lower moving frequency when the byte streams are acquired, and the accuracy and the real-time property of the byte streams corresponding to the acquired dynamic virtual objects are improved.
(12) According to the method, the acquisition priority of each dynamic virtual object inversely related to the moving frequency is determined according to the moving frequency of the dynamic virtual object, byte streams corresponding to each dynamic virtual object are sequentially acquired according to the order of the acquisition priority from high to low, so that byte streams corresponding to dynamic virtual objects with lower moving frequency are preferentially acquired, and the time difference of the byte streams corresponding to the dynamic virtual objects with lower moving frequency during acquisition is utilized, the real-time updating property of the byte streams corresponding to the dynamic virtual objects with higher moving frequency is ensured, and the accuracy and the real-time property of the byte streams corresponding to each acquired dynamic virtual object are improved.
(13) The cloud game server migration method comprises the steps of determining a to-be-migrated server, a candidate cloud game server, a first number of to-be-migrated servers and a second number of candidate cloud game servers through the number of cloud game instances running on each cloud game server, determining a corresponding target server for each to-be-migrated server based on the first number, the second number and the number of cloud game instances running on each cloud game server, and accordingly ensuring that in the process of migration of follow-up cloud games, cloud game instances running on each to-be-migrated server can be accurately migrated to the most suitable target server to continue running, intelligent regulation of the running space of the cloud game server is achieved, running cost of the cloud game server is effectively saved, and running efficiency is improved.
The foregoing is merely exemplary embodiments of the present application and is not intended to limit the scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and scope of the present application are included in the protection scope of the present application.

Claims (15)

1. A method of thermomigration of a cloud game, the method comprising:
acquiring operation information of each cloud game server in a plurality of cloud game servers, wherein the operation information comprises the number of cloud game instances operated on the cloud game servers based on containers;
determining a server to be migrated for cloud game migration and a corresponding target server from the plurality of cloud game servers based on the number of cloud game instances running on each cloud game server;
obtaining byte streams of each cloud game instance running on the server to be migrated from the server to be migrated, wherein the byte streams are obtained by serializing the corresponding cloud game instances;
and sending the byte stream of each cloud game instance to the target server, wherein the target server is used for deserializing the byte stream to recreate each cloud game instance.
2. The method of claim 1, wherein the determining, from the plurality of cloud game servers, a server to be migrated to be cloud game migrated and a corresponding target server based on the number of cloud game instances running on each of the cloud game servers, comprises:
determining the cloud game servers with the number of the running cloud game instances smaller than a first threshold as the servers to be migrated, and acquiring the first number of the servers to be migrated;
determining the cloud game servers with the number of the running cloud game instances being greater than or equal to the first threshold and smaller than a second threshold as candidate cloud game servers, and acquiring the second number of the candidate cloud game servers;
and determining the target server corresponding to the server to be migrated from the plurality of cloud game servers based on the first number and the second number.
3. The method of claim 2, wherein the determining the target server corresponding to the server to be migrated from the plurality of cloud gaming servers based on the first number and the second number comprises:
When the first number is smaller than the second number, selecting the first number of candidate cloud game servers from the second number of candidate cloud game servers as the target servers corresponding to the servers to be migrated;
when the first number is equal to the second number, determining each candidate cloud game server as the target server corresponding to the server to be migrated;
and when the first quantity is larger than the second quantity, acquiring the total quantity of the cloud game instances running on each server to be migrated as a first total quantity and the total quantity of the cloud game instances running in each candidate cloud game server as a second total quantity, and determining the target server corresponding to the server to be migrated based on the first total quantity and the second total quantity.
4. A method according to claim 3, wherein said determining the target server corresponding to the server to be migrated based on the first total number and the second total number comprises:
when the first total number is greater than the second total number, determining each candidate cloud game server as a first target server, obtaining a difference value between the first total number and the second total number, and determining a second target server from the plurality of cloud game servers based on the difference value, wherein the idle number of the second target server is greater than or equal to the difference value, the idle number is a bearing number minus a number of cloud game instances running on the second target server, and the bearing number is a maximum number of the cloud game instances that the second target server can bear;
Determining the first target server and the second target server as the target servers corresponding to the servers to be migrated;
and when the first total number is smaller than or equal to the second total number, determining each candidate cloud game server as the target server corresponding to the server to be migrated.
5. The method of claim 1, wherein the containers are in one-to-one correspondence with the cloud game instances, each of the containers is corresponding to one of the graphics processors, and the obtaining, from the server to be migrated, a byte stream of each of the cloud game instances running on the server to be migrated comprises:
sending a byte stream acquisition request to the server to be migrated so that the server to be migrated acquires page table information of a graphics processor corresponding to each container, and reading the byte stream of each cloud game instance from a video memory space of the corresponding graphics processor based on the page table information;
and receiving byte streams of the cloud game instances sent by the server to be migrated.
6. The method of claim 1, wherein the containers are in one-to-one correspondence with the cloud game instances, each of the containers is corresponding to one of the graphics processors, and the obtaining, from the server to be migrated, a byte stream of each of the cloud game instances running on the server to be migrated comprises:
Sending a byte stream acquisition request to the server to be migrated;
receiving page table information of an image processor corresponding to each container sent by the server to be migrated;
based on each page table information, a byte stream of each cloud game instance is read from a corresponding video memory space of the image processor.
7. The method of claim 1, wherein the obtaining, from the server to be migrated, a byte stream of each of the cloud game instances running on the server to be migrated comprises:
acquiring the number of objects corresponding to each cloud game instance running on the server to be migrated, wherein the number of objects is the number of virtual objects in a virtual scene corresponding to the cloud game instance;
sequencing all cloud game instances running on the server to be migrated according to the sequence from small to large of the object number to obtain a cloud game instance queue;
sequentially obtaining byte streams of each cloud game instance in the cloud game instance queue from the head of the cloud game instance queue;
the sending the byte stream of each cloud game instance to the target server includes:
And sequentially sending the byte streams of the cloud game instances to the target server according to the acquisition sequence of the byte streams of the cloud game instances.
8. The method of claim 1, wherein the obtaining, from the server to be migrated, a byte stream of each of the cloud game instances running on the server to be migrated comprises:
the following processes are respectively executed for each cloud game instance running on the server to be migrated:
determining a dynamic virtual object and a static virtual object from virtual objects included in a virtual scene corresponding to the cloud game instance;
the dynamic virtual object is the virtual object in a moving state in the virtual scene, and the static virtual object is the virtual object in a static state in the virtual scene;
acquiring byte streams corresponding to the static virtual objects;
and acquiring the byte stream corresponding to each dynamic virtual object in response to the completion of acquiring the byte stream corresponding to each static virtual object.
9. The method of claim 8, wherein the obtaining the byte stream corresponding to each of the dynamic virtual objects comprises:
Acquiring acquisition priority of each dynamic virtual object, wherein the acquisition priority is inversely related to the moving frequency of the dynamic virtual object, and the moving frequency represents the moving times of the dynamic virtual object in the virtual scene in unit time;
sequentially acquiring byte streams corresponding to the dynamic virtual objects according to the order of the acquisition priority from high to low;
the sending the byte stream of each cloud game instance to the target server includes:
and sequentially sending byte streams corresponding to the dynamic virtual objects to the target server according to the acquisition sequence of the byte streams corresponding to the dynamic virtual objects.
10. The method of claim 1, wherein the determining a server to be migrated and a corresponding target server to be cloud game migrated from the plurality of cloud game servers based on the number of cloud game instances running on each of the cloud game servers further comprises:
acquiring terminal information corresponding to cloud game instances running on the server to be migrated, wherein the terminal information indicates a target terminal for displaying the cloud games;
And sending the terminal information to the target server so that the target server establishes communication connection with the target terminal based on the terminal information.
11. The method of claim 1, wherein after the sending the byte stream for each of the cloud game instances to the target server, the method further comprises:
responding to the migration completion message sent by the target server, and sending a disconnection instruction to the server to be migrated;
the disconnection instruction is used for disconnecting the server to be migrated from a target terminal, and the target terminal is a terminal for displaying the cloud game.
12. A thermomigration device for a cloud game, the device comprising:
an obtaining module, configured to obtain operation information of each cloud game server in a plurality of cloud game servers, where the operation information includes a number of cloud game instances that are operated on the cloud game server based on a container;
the determining module is used for determining a server to be migrated for cloud game migration and a corresponding target server from the plurality of cloud game servers based on the number of cloud game instances running on each cloud game server;
The migration module is used for acquiring byte streams of each cloud game instance running on the server to be migrated from the server to be migrated, wherein the byte streams are obtained by serializing the corresponding cloud game instances;
and the sending module is used for sending the byte stream of each cloud game instance to the target server, and the target server is used for deserializing the byte stream to recreate each cloud game instance.
13. An electronic device, the electronic device comprising:
a memory for storing computer executable instructions or computer programs;
a processor for implementing the method of thermomigration of a cloud game according to any one of claims 1 to 11 when executing computer executable instructions or computer programs stored in the memory.
14. A computer readable storage medium storing computer executable instructions which when executed by a processor implement the method of thermomigration of a cloud game according to any one of claims 1 to 11.
15. A computer program product comprising a computer program or computer-executable instructions which, when executed by a processor, implement the method of thermomigration of a cloud game according to any one of claims 1 to 11.
CN202211477541.4A 2022-11-23 2022-11-23 Thermomigration method, apparatus, device, storage medium and program product for cloud game Pending CN116943142A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211477541.4A CN116943142A (en) 2022-11-23 2022-11-23 Thermomigration method, apparatus, device, storage medium and program product for cloud game

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211477541.4A CN116943142A (en) 2022-11-23 2022-11-23 Thermomigration method, apparatus, device, storage medium and program product for cloud game

Publications (1)

Publication Number Publication Date
CN116943142A true CN116943142A (en) 2023-10-27

Family

ID=88460769

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211477541.4A Pending CN116943142A (en) 2022-11-23 2022-11-23 Thermomigration method, apparatus, device, storage medium and program product for cloud game

Country Status (1)

Country Link
CN (1) CN116943142A (en)

Similar Documents

Publication Publication Date Title
WO2020220915A1 (en) Virtual object display method and apparatus, electronic device, and storage medium
CN112614202B (en) GUI rendering display method, terminal, server, electronic equipment and storage medium
EP2807555B1 (en) Para-virtualized asymmetric gpu processors
CN112915542B (en) Collision data processing method and device, computer equipment and storage medium
CN102707986A (en) Shared memory between child and parent partitions
US20220241689A1 (en) Game Character Rendering Method And Apparatus, Electronic Device, And Computer-Readable Medium
CN104380256A (en) Method, system and executable piece of code for virtualisation of hardware resource associated with computer system
WO2022095526A1 (en) Graphics engine and graphics processing method applicable to player
US20240037839A1 (en) Image rendering
US20230229524A1 (en) Efficient multi-device synchronization barriers using multicasting
WO2023197762A1 (en) Image rendering method and apparatus, electronic device, computer-readable storage medium, and computer program product
Liu et al. Lightweight websim rendering framework based on cloud-baking
CN114570020A (en) Data processing method and system
WO2024087941A1 (en) Rendering resource-based data processing method, apparatus, device, computer readable storage medium, and computer program product
CN110362375A (en) Display methods, device, equipment and the storage medium of desktop data
CN111309421B (en) Interface resource loading method and device, terminal and storage medium
CN112807695A (en) Game scene generation method and device, readable storage medium and electronic equipment
CN113051031A (en) Container cluster deployment method of visual artificial intelligence system simulation platform
CN112486807A (en) Pressure testing method and device, electronic equipment and readable storage medium
CN116943142A (en) Thermomigration method, apparatus, device, storage medium and program product for cloud game
CN111243069B (en) Scene switching method and system of Unity3D engine
CN111476910B (en) 3D model display method, system, medium and display terminal of intelligent building BIM
CN114399580A (en) Image rendering method, device, equipment, storage medium and program product
CN117788613A (en) Graph rendering method and device based on graph layout
CN114882202A (en) Animation processing method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication