Game instance migration method and device, electronic equipment, storage medium and program product
By introducing direct and indirect communication links into the game engine instance migration system and using a migration server as an intermediary, the problem of migration failure caused by a single communication link is solved, and the stability of game engine instance migration is improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- TENCENT TECH SHANGHAI
- Filing Date
- 2024-11-15
- Publication Date
- 2026-05-15
AI Technical Summary
In existing technologies, game engine instance migration relies on a single communication link, which can lead to migration failures due to link failures or signal interference, resulting in low stability.
Establish direct and indirect communication links between the game server and the dedicated server, and use a migration server as an intermediary to ensure the stability and reliability of information transmission.
It improves the stability of game engine instance migration, enhances the communication stability between dedicated servers and game servers, and reduces the risk of migration failure.
Smart Images

Figure CN122032072A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a method, apparatus, electronic device, storage medium, and program product for migrating instances of a game. Background Technology
[0002] As more and more game businesses utilize dedicated servers, this is because dedicated servers and game engines can be seamlessly integrated to achieve a better gaming experience and higher development efficiency. For example, game engines may come with their own dedicated servers. However, due to inherent limitations in the design of game engines, dedicated servers are not suitable for long-term operation, as they may experience issues such as memory leaks and performance degradation. Furthermore, dedicated servers are stateful services. Therefore, if long-term game business needs to be implemented using dedicated servers, it is necessary to migrate the game engine instance running on the dedicated server at appropriate times.
[0003] In related technologies, game instance migration is carried out through a single communication link between a dedicated server and the game server. If the single communication link fails, such as due to line failure or signal interference, the instance migration will be interrupted immediately, resulting in instance migration failure and thus low stability. Summary of the Invention
[0004] This application provides a method, apparatus, electronic device, computer-readable storage medium, and computer program product for migrating game instances, which can effectively improve the stability of game instance migration.
[0005] The technical solution of this application embodiment is implemented as follows:
[0006] This application provides a method for migrating game instances, applied to a game server in an instance migration system. The instance migration system includes the game server and at least two dedicated servers for running game engine instances. Direct and indirect communication links are established between the dedicated servers and the game server. The method includes:
[0007] Receive running information of a first game engine instance sent by a first dedicated server, wherein the running information is sent by the first dedicated server through the direct communication link and the indirect communication link;
[0008] When it is determined that the first game engine instance needs to be migrated based on the running information of the first game engine instance, a running instruction for the second game engine instance is sent to the second dedicated server;
[0009] If a first response result for the run instruction is received from the second dedicated server, and the first response result indicates that the second game engine instance has run successfully, then a shutdown request for the first game engine instance is sent to the first dedicated server.
[0010] This application provides a method for migrating game instances, applied to an instance migration system. The instance migration system includes a game server and at least two dedicated servers for running game engine instances. The dedicated servers and the game server are connected by direct and indirect communication links. The method includes:
[0011] The first dedicated server sends the running information of the first game engine instance to the game server through the direct communication link and the indirect communication link;
[0012] When the game server determines that the first game engine instance needs to be migrated based on the running information of the first game engine instance, the second dedicated server receives the running instructions for the second game engine instance.
[0013] The second dedicated server sends a first response result to the game server in response to the running command via the direct communication link and the indirect communication link;
[0014] When the first response indicates that the second game engine instance is running successfully, the first dedicated server receives a shutdown request for the first game engine instance.
[0015] This application provides a method for migrating game instances, applied to a migration server in an instance migration system. The instance migration system includes a game server, a migration server, and at least two dedicated servers for running game engine instances. The dedicated servers and the game server have a direct communication connection and an indirect communication link relayed through the migration server. The method includes:
[0016] Receive the running information of the first game engine instance sent by the first dedicated server, and send the running information to the game server;
[0017] Receive the running instructions sent by the game server for the second game engine instance, and send the running instructions to the second dedicated server;
[0018] Receive the first response result sent by the second dedicated server in response to the running instruction, and send the first response result to the game server;
[0019] The system receives a shutdown request from the game server for the first game engine instance and sends the shutdown request to the first dedicated server.
[0020] This application provides a game instance migration device, the device comprising:
[0021] The receiving module is used for the game server to receive the running information of the first game engine instance sent by the first dedicated server. The running information is sent by the first dedicated server through the direct communication link and the indirect communication link established between the game server and the game server.
[0022] The determination module is used to send a running instruction for the second game engine instance to the second dedicated server when it is determined, based on the running information of the first game engine instance, that the first game engine instance needs to be migrated.
[0023] The shutdown module is used to send a shutdown request for the first game engine instance to the first dedicated server if it receives a first response result from the second dedicated server for the run instruction and the first response result indicates that the second game engine instance has run successfully.
[0024] In the above scheme, the running information includes multiple running parameters of the first game engine instance, and each running parameter corresponds to an instance migration condition; the determining module is further configured to determine whether the instance migration condition corresponding to each running parameter is satisfied; when at least one instance migration condition is satisfied, a running instruction for the second game engine instance is sent to the second dedicated server.
[0025] In the above scheme, the running parameters include the runtime of the first game engine instance in the first dedicated server. The determination module is further used to compare the runtime with a runtime threshold to obtain a runtime comparison result; when the runtime comparison result indicates that the runtime has reached the runtime threshold, it is determined that the instance migration condition corresponding to the runtime has been met; when the runtime comparison result indicates that the runtime has not reached the runtime threshold, it is determined that the instance migration condition corresponding to the runtime has not been met.
[0026] In the above scheme, the operating parameters include the operating status of the first game engine instance in the first dedicated server. The above-mentioned determining module is further used to determine that the instance migration condition corresponding to the operating status is met when the operating status indicates that the first game engine instance has stopped running in the first dedicated server; and to determine that the instance migration condition corresponding to the operating status has not been met when the operating status indicates that the first game engine instance has not stopped running in the first dedicated server.
[0027] In the above scheme, the determining module is further configured to determine the second dedicated server from the at least two dedicated servers used to run the game engine instance based on the first game engine instance; and send a running instruction for the second game engine instance to the second dedicated server through the direct communication link and the indirect communication link, or send a running instruction for the second game engine instance to the second dedicated server through the direct communication link.
[0028] In the above scheme, the determining module is further configured to determine the dedicated servers other than the first dedicated server among at least two dedicated servers as first candidate servers; obtain the service performance parameters of each first candidate server and the minimum service performance parameters required to run the first game engine instance; when there is a first candidate server whose service performance parameters are not less than the minimum service performance parameters, determine the first candidate server whose service performance parameters are not less than the minimum service performance parameters as a second candidate server; and determine the second dedicated server from the second candidate servers.
[0029] In the above scheme, the determining module is further configured to output failure indication information when there is no first candidate server whose service performance parameter is not less than the minimum service performance parameter, the failure indication information being used to indicate that the migration of the first game engine instance has failed; the determining module is further configured to determine the second candidate server as the second dedicated server when there is only one second candidate server; and to determine the second candidate server with the largest service performance parameter as the second dedicated server when there are multiple second candidate servers.
[0030] In the above scheme, the determining module is further configured to, if the first execution condition or the second execution condition is met, determine the dedicated server other than the first dedicated server and the second dedicated server among at least two dedicated servers as a third candidate server; wherein, the first execution condition is that no first response result for the running instruction sent by the second dedicated server is received within a first time period; the second execution condition is that the first response result for the running instruction sent by the second dedicated server is received, and the first response result indicates that the second game engine instance has failed to run; when the number of the third candidate servers is zero, output failure indication information, the failure indication information is used to indicate that the migration of the first game engine instance has failed; when the number of the third candidate servers is at least one, determine the third dedicated server from at least one third candidate server, and send the running instruction for the second game engine instance to the third dedicated server.
[0031] In the above scheme, the determining module is further configured to receive a second response result from the first dedicated server in response to the shutdown request, the second response result being sent through the direct communication link and the indirect communication link; when the second response result indicates that the first dedicated server failed to shut down the first game engine instance, the module continues to send a shutdown request for the first game engine instance to the first dedicated server until the received second response result for the shutdown request indicates that the first dedicated server successfully shut down the first game engine instance.
[0032] In the above scheme, the receiving module is also used to receive the running information of the first game engine instance forwarded by the migration server through the indirect communication link when the direct communication link fails.
[0033] In the above scheme, the receiving module is also used to establish a heartbeat connection with the migration server; when the direct communication link fails and no running information forwarded by the migration server is received within the second time period, the running information of the first game engine instance forwarded by the migration server is received through the heartbeat connection.
[0034] In the above scheme, the migration server is a server cluster including multiple sub-migration servers. The receiving module is also used to receive the running information of the first game engine instance forwarded by any one of the sub-migration servers in the server cluster through the indirect communication link.
[0035] This application provides a game instance migration device, the device comprising:
[0036] The information sending module, the first dedicated server sends the running information of the first game engine instance to the game server through the direct communication link and the indirect communication link established with the game server;
[0037] The instruction receiving module is used to receive the running instructions for the second game engine instance when the game server determines that the first game engine instance needs to be migrated based on the running information of the first game engine instance;
[0038] The result sending module is used for the second dedicated server to send a first response result to the game server in response to the running instruction through the direct communication link and the indirect communication link;
[0039] The request receiving module is configured to receive a shutdown request for the first game engine instance from the first dedicated server when the first response result indicates that the second game engine instance is running successfully.
[0040] This application provides a game instance migration device, the device comprising:
[0041] The information forwarding module is used to allow the migration server to receive the running information of the first game engine instance sent by the first dedicated server, and to send the running information to the game server.
[0042] The instruction forwarding module is used for the migration server to receive the running instructions sent by the game server for the second game engine instance, and to send the running instructions to the second dedicated server;
[0043] The result forwarding module is used for the migration server to receive the first response result sent by the second dedicated server in response to the running instruction, and to send the first response result to the game server;
[0044] The request forwarding module is used by the migration server to receive the shutdown request sent by the game server for the first game engine instance, and to send the shutdown request to the first dedicated server.
[0045] In the above scheme, the information forwarding module is also used to send the running information to the game server and store the running information in the storage server; when no running instruction for the second game engine instance is received from the game server within a third time period, the running information is queried from the storage server and the running information is sent to the game server again through a heartbeat connection.
[0046] This application provides an electronic device, including:
[0047] Memory is used to store executable instructions or computer programs.
[0048] The processor, when executing computer-executable instructions or computer programs stored in the memory, implements the game instance migration method provided in the embodiments of this application.
[0049] This application provides a computer-readable storage medium storing computer-executable instructions for inducing a processor to execute and implement the game instance migration method provided in this application.
[0050] This application provides a computer program product, which includes a computer program or computer-executable instructions stored in a computer-readable storage medium. The processor of an electronic device reads the computer-executable instructions from the computer-readable storage medium and executes the computer-executable instructions, causing the electronic device to perform the game instance migration method described in this application.
[0051] The embodiments of this application have the following beneficial effects:
[0052] The game server receives runtime information of a first game engine instance from a first dedicated server. This runtime information is sent by the first dedicated server via the direct and indirect communication links. When it is determined that the first game engine instance needs to be migrated based on this runtime information, the game server sends a runtime instruction for the second game engine instance to a second dedicated server. If a first response result is received from the second dedicated server indicating that the second game engine instance has run successfully, a shutdown request for the first game engine instance is sent to the first dedicated server. Thus, because a direct and indirect communication link is established between the dedicated server and the game server, communication is conducted through these links to migrate game instances. This improves the stability of game instance migration by enhancing the stability of communication between the dedicated server and the game server. Attached Figure Description
[0053] Figure 1 This is a schematic diagram of the architecture of the game instance migration system provided in the embodiments of this application;
[0054] Figure 2 This is a schematic diagram of the structure of an electronic device for migrating game instances provided in an embodiment of this application. Figure 1 ;
[0055] Figure 3 This is a schematic diagram of the structure of an electronic device for migrating game instances provided in an embodiment of this application. Figure 2 ;
[0056] Figure 4 This is a schematic diagram of the structure of an electronic device for migrating game instances provided in an embodiment of this application. Figure 3 ;
[0057] Figure 5 This is a schematic diagram of the example migration system provided in the embodiments of this application;
[0058] Figure 6 This is a flowchart illustrating the game instance migration method provided in the embodiments of this application. Figure 1 ;
[0059] Figure 7 This is a flowchart illustrating the game instance migration method provided in the embodiments of this application. Figure 2 ;
[0060] Figure 8 This is a flowchart illustrating the game instance migration method provided in the embodiments of this application. Figure 3 ;
[0061] Figure 9 This is a flowchart illustrating the game instance migration method provided in the embodiments of this application. Figure 4 ;
[0062] Figure 10 This is a flowchart illustrating the game instance migration method provided in the embodiments of this application. Figure 5 ;
[0063] Figure 11 This is a flowchart illustrating the game instance migration method provided in the embodiments of this application. Figure 6 ;
[0064] Figure 12 This is a flowchart illustrating the game instance migration method provided in the embodiments of this application. Figure 7 . Detailed Implementation
[0065] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limitations on this application. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0066] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0067] In the following description, the terms "first, second, third" are used merely to distinguish similar objects and do not represent a specific ordering of objects. It is understood that "first, second, third" may be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.
[0068] Unless otherwise defined, 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 this application only and is not intended to limit this application.
[0069] Before providing a further detailed description of the embodiments of this application, the nouns and terms involved in the embodiments of this application will be explained, and the nouns and terms involved in the embodiments of this application shall be interpreted as follows.
[0070] 1) Games: Also known as game programs, these can be any of the following: Massive Multiplayer Online Role-Playing Games (MMORPGs), First-Person Shooter (FPS) games, Third-Person Shooter games, Multiplayer Online Battle Arena (MOBA) games, Virtual Reality Applications, 3D Mapping Programs, Simulation Programs, or Multiplayer Shooter Survival Games.
[0071] 2) Game Engine: A game engine refers to the core components of some pre-written, editable computer virtual systems or interactive real-time graphics applications. These systems provide designers of virtual scenes with various tools needed to create virtual scenes, with the aim of enabling designers to easily and quickly write programs. Game engines include rendering engines (including 2D rendering engines and 3D rendering engines), physics engines, collision detection engines, sound effects engines, scripting engines, animation engines, artificial intelligence engines, network engines, and scene management engines, etc.
[0072] 3) Dedicated Server: A dedicated server is a server specifically configured for a particular task or service. It does not share resources but provides exclusive services. In the gaming industry, a dedicated server specifically refers to a server that players can build themselves to run the game. A dedicated server is one where its computing resources, such as CPU, memory, hard drive space, and network bandwidth, are dedicated to running and hosting the game service. This ensures the performance and stability of the game, as server resources are not consumed by other applications or services. Players can purchase or rent server hardware and install the corresponding game server software to build a dedicated server. This gives players complete control over the game environment, including game rules, maps, and plugins. The main function of a dedicated server is to run the game service, allowing players to connect to the server for multiplayer online gaming. Unlike sharing a game console over a home network, dedicated servers typically offer higher stability and faster network connections, providing a better gaming experience. Players who build dedicated servers usually need certain technical knowledge to manage and maintain them. This includes handling game updates, configuring server settings, managing user permissions, and ensuring server security. Dedicated servers typically offer more powerful hardware configurations than home game consoles, meaning they can support more players online simultaneously and provide a smoother gaming experience. Dedicated servers are a crucial infrastructure for multiplayer online games, and they are an invaluable tool for players and communities who require a stable and controlled gaming environment.
[0073] 4) DSA: Short for Dedicated Server Agent, it's a proxy daemon used to launch the local DS process and manage and forward communication between it and the dedicated game server. DSA's main function is to launch and monitor the DS process. It can start, stop, restart, and monitor the status of the dedicated server. Furthermore, DSA handles communication between DS and external systems, such as the main game server, game clients, or other management tools. DSA ensures the dedicated server runs stably and responds quickly to management commands when needed.
[0074] 5) DSC: Short for Dedicated Server Center, it manages a cluster of DSA services. It's a management tool used to manage a group of DSA services. DSC provides a centralized management approach, allowing administrators to efficiently monitor and control multiple DSA daemons and the dedicated servers they manage. It can handle tasks such as cluster configuration, resource allocation, load balancing, and failover. DSC makes the management of a large number of dedicated servers more intuitive and automated by providing a user interface or API.
[0075] 6) Server Migration (DSR, Dedicated Server Recovery): Used to migrate and restore Dedicated Server (DS) services. DSR is typically used to migrate DS services from one server to another when a server fails or requires maintenance. This process involves data backup, configuration file transfer, and application state restoration. DSR ensures seamless server switching and data integrity, reduces downtime due to server failures, and improves system availability and reliability. DSR may also include automated recovery processes to quickly restore normal service after a server failure.
[0076] 7) Game Server (GS): Provides services for game business logic. It interacts with the DS (Distribution Server) and handles the reading and writing of player data to the storage server. In multiplayer online games or large-scale games, the GS plays a crucial role. Its main function is to process the game's business logic, such as player actions, interactions, and resource management. The GS is responsible for executing game rules and handling various events and status updates within the game. The GS is responsible for handling the core logic of the game, including player movement, attack, and defense behaviors, as well as the game's economic system, quest system, leaderboards, and other functions. The GS handles interactions between players, such as chat, team formation, and trading, ensuring that all players can communicate and interact in real time within the game world. The GS is responsible for managing player data, including but not limited to player character information, game progress, achievements, and inventory contents. This data is usually stored in a database (storage server), and the GS is responsible for reading and writing this data. The GS interacts closely with the database (storage server) for data access. For example, when a player creates a new character, the GS writes the new character's data to the database; when a player levels up or buys new equipment, the GS updates the relevant records in the database. The GS can interact with a dedicated server (DS), which may provide persistent storage for game resources or the game world. The GS communicates with the DS to obtain necessary resources or update the state of the game world.
[0077] 8) Stateless Services: The service process itself does not store state information, so abnormal termination of the service process will not lead to data loss. These are typically multi-node services. Accessing any one of the nodes is equivalent, providing high availability. A stateless service means that the service process itself does not store any state information; the service process is only responsible for processing requests and returning results to the client. Because stateless services do not store state information, abnormal termination of the service process will not lead to data loss. This type of service is usually a multi-node service, and clients can randomly access any node because each node provides the same service and is independent of the state of other nodes. This design provides high availability and scalability because service nodes can be easily added or removed without affecting the overall performance and stability of the system.
[0078] 9) Stateful Services: The service process stores state information. Abnormal process termination leads to state loss, resulting in data loss or business logic computation failure. Accessing this service typically involves routing to a specified instance address. If the specified process instance times out or experiences network instability, the request may fail. Stateful services refer to services where the service process stores state information, usually in the service process's memory or local storage. Because stateful services store state information, abnormal process termination leads to state loss, resulting in data loss or business logic computation failure. Accessing this type of service usually requires specifying an instance address for routing, as the service instance's state is unique, and different instances may provide different services or states. If the specified process instance times out or experiences network instability, the request may fail because the request depends on the specific service instance's state.
[0079] 10) Heartbeat Connection: A network communication mechanism used to periodically send simple data packets or signals between network nodes to ensure connectivity. These packets typically contain basic information, such as timestamps or status identifiers, rather than large amounts of data. The purposes of a heartbeat connection are: Connectivity testing: Confirming that the network connection between two nodes is working properly. Liveness detection: Ensuring that the communicating node is still online and responding to requests. Failure detection: If a heartbeat signal is not received within a predetermined time, it indicates a possible network failure or node malfunction. Link detection: By detecting the round-trip time (RTT) of the heartbeat signal, network latency and performance can be evaluated.
[0080] During the implementation of the embodiments of this application, the applicant discovered the following problems with the related technology:
[0081] In related technologies, game instance migration is carried out through a single communication link between a dedicated server and the game server. If the single communication link fails, such as due to line failure or signal interference, the instance migration will be interrupted immediately, resulting in instance migration failure and thus low stability.
[0082] This application provides a method, apparatus, electronic device, computer-readable storage medium, and computer program product for migrating game instances, which can effectively improve the stability of game instance migration. The exemplary application of the game instance migration system provided in this application is described below.
[0083] See Figure 1 , Figure 1 This is a schematic diagram of the architecture of the game instance migration system 100 provided in this application embodiment. The terminal (terminal 400 is shown as an example) connects to the server 200 through the network 300. The network 300 can be a wide area network or a local area network, or a combination of the two.
[0084] Terminal 400 is used by users to access client 410 and display game screens on graphical interface 410-1 (graphical interface 410-1 is shown as an example). Terminal 400 and server 200 are interconnected via wired or wireless network.
[0085] In some embodiments, server 200 can be a standalone physical server, a server cluster or business system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms. Terminal 400 can be a smartphone, tablet, laptop, desktop computer, smart speaker, smart TV, smartwatch, in-vehicle terminal, etc., but is not limited to these. The electronic device provided in this application embodiment can be implemented as a terminal or a server. The terminal and server can be directly or indirectly connected via wired or wireless communication, which is not limited in this application embodiment.
[0086] See Figure 2 , Figure 2 This is a schematic diagram of the structure of the electronic device 500 for instance migration of games provided in this application embodiment. Figure 1 ,in, Figure 2 The electronic device 500 shown can be Figure 1 Server 200 or terminal 400 in the middle, Figure 2The illustrated electronic device 500 includes at least one processor 430, a memory 450, and at least one network interface 420. The various components in the electronic device 500 are coupled together via a bus system 440. It is understood that the bus system 440 is used to implement communication between these components. In addition to a data bus, the bus system 440 also includes a power bus, a control bus, and a status signal bus. However, for clarity, ... Figure 2 The general labeled all buses as Bus System 440.
[0087] Processor 430 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor can be a microprocessor or any conventional processor, etc.
[0088] The memory 450 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state storage, hard disk drives, optical disk drives, etc. The memory 450 may optionally include one or more storage devices physically located away from the processor 430.
[0089] The memory 450 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), and the volatile memory may be random access memory (RAM). The memory 450 described in this application embodiment is intended to include any suitable type of memory.
[0090] 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 illustrated below.
[0091] Operating system 451 includes system programs for handling various basic system services and performing hardware-related tasks, such as the framework layer, core library layer, driver layer, etc., for implementing various basic business functions and handling hardware-based tasks;
[0092] The network communication module 452 is used to reach other electronic devices via one or more (wired or wireless) network interfaces 420, such as Bluetooth, WiFi, and Universal Serial Bus (USB).
[0093] In some embodiments, the game instance migration device provided in this application can be implemented in software. Figure 2 An instance migration device 455 for a game stored in memory 450 is shown. This device can be software in the form of programs and plugins, and includes the following software modules: a receiving module 4551, a determining module 4552, and a closing module 4553. These modules are logically connected and can therefore be arbitrarily combined or further separated according to their implemented functions. The functions of each module will be described below.
[0094] See Figure 3 , Figure 3 This is a schematic diagram of the structure of an electronic device for migrating game instances provided in an embodiment of this application. Figure 2 ,in, Figure 3 The electronic device 600 shown can be Figure 1 Server 200 or terminal 400 in the middle, Figure 3 The illustrated electronic device 600 includes at least one processor 530, a memory 550, and at least one network interface 520. The various components in the electronic device 600 are coupled together via a bus system 540. It is understood that the bus system 540 is used to implement communication between these components. In addition to a data bus, the bus system 540 also includes a power bus, a control bus, and a status signal bus. However, for clarity, ... Figure 3 The general labeled all buses as Bus System 540.
[0095] Processor 530 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor can be a microprocessor or any conventional processor.
[0096] The memory 550 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state storage, hard disk drives, optical disk drives, etc. The memory 550 may optionally include one or more storage devices physically located away from the processor 530.
[0097] The memory 550 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), and the volatile memory may be random access memory (RAM). The memory 550 described in this application embodiment is intended to include any suitable type of memory.
[0098] In some embodiments, memory 550 is capable of storing data to support various operations, examples of which include programs, modules, and data structures or subsets or supersets thereof, as illustrated below.
[0099] Operating system 551 includes system programs for handling various basic system services and performing hardware-related tasks, such as the framework layer, core library layer, driver layer, etc., for implementing various basic business functions and handling hardware-based tasks;
[0100] The network communication module 552 is used to reach other electronic devices via one or more (wired or wireless) network interfaces 520, such as Bluetooth, WiFi, and Universal Serial Bus (USB).
[0101] In some embodiments, the game instance migration device provided in this application can be implemented in software. Figure 3 An instance migration device 555 for a game stored in memory 550 is shown. This device can be software in the form of programs and plugins, and includes the following software modules: an information sending module 5551, an instruction receiving module 5552, a result sending module 5553, and a request receiving module 5554. These modules are logically connected and can therefore be arbitrarily combined or further separated according to their implemented functions. The functions of each module will be described below.
[0102] See Figure 4 , Figure 4 This is a schematic diagram of the structure of an electronic device for migrating game instances provided in an embodiment of this application. Figure 3 ,in, Figure 4 The electronic device 700 shown can be Figure 1 Server 200 or terminal 400 in the middle, Figure 4 The illustrated electronic device 700 includes at least one processor 630, a memory 660, and at least one network interface 620. The various components in the electronic device 700 are coupled together via a bus system 640. It is understood that the bus system 640 is used to implement communication between these components. In addition to a data bus, the bus system 640 also includes a power bus, a control bus, and a status signal bus. However, for clarity, ... Figure 4 The general labeled all buses as Bus System 640.
[0103] The processor 630 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor can be a microprocessor or any conventional processor.
[0104] The memory 660 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state storage, hard disk drives, optical disk drives, etc. The memory 660 may optionally include one or more storage devices physically located away from the processor 630.
[0105] The memory 660 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), and the volatile memory may be random access memory (RAM). The memory 660 described in this application embodiment is intended to include any suitable type of memory.
[0106] In some embodiments, memory 660 is capable of storing data to support various operations, examples of which include programs, modules, and data structures or subsets or supersets thereof, as illustrated below.
[0107] Operating system 651 includes system programs for handling various basic system services and performing hardware-related tasks, such as the framework layer, core library layer, driver layer, etc., for implementing various basic business functions and handling hardware-based tasks;
[0108] The network communication module 652 is used to reach other electronic devices via one or more (wired or wireless) network interfaces 620, exemplary network interfaces 620 including Bluetooth, WiFi, and Universal Serial Bus (USB).
[0109] In some embodiments, the game instance migration device provided in this application can be implemented in software. Figure 4 An instance migration device 666 for a game stored in memory 660 is shown. This device can be software in the form of programs and plugins, and includes the following software modules: an information forwarding module 6661, an instruction forwarding module 6662, a result forwarding module 6663, and a request forwarding module 6554. These modules are logically linked and can therefore be arbitrarily combined or further separated according to their implemented functions. The functions of each module will be described below.
[0110] In other embodiments, the game instance migration device provided in this application can be implemented in hardware. As an example, the game instance migration device provided in this application can be a processor in the form of a hardware decoding processor, which is programmed to execute the game instance migration method provided in this application. For example, the processor in the form of a hardware decoding processor can be one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), or other electronic components.
[0111] In some embodiments, the terminal or server can implement the game instance migration method provided in this application by running a computer program or computer-executable instructions. For example, the computer program can be a native program in the operating system (e.g., a dedicated game instance migration program) or a software module, such as a game instance migration module that can be embedded in any program (e.g., an instant messaging client, a photo album program, an electronic map client, a navigation client); or it can be a native application (APP), i.e., a program that needs to be installed in the operating system to run. In summary, the above-mentioned computer program can be any form of application, module, or plugin.
[0112] The method for migrating game instances provided in this application will be described by combining exemplary applications and implementations of the server or terminal provided in the embodiments of this application.
[0113] The instance migration system provided in this application includes a game server and at least two dedicated servers for running game engine instances. A direct communication link and an indirect communication link are established between the dedicated servers and the game server. The indirect communication link is constructed with the migration server as an intermediate node between the dedicated servers and the game server. The migration server is a server cluster including multiple sub-migration servers.
[0114] As an example, see Figure 5 , Figure 5This is a schematic diagram of the principle of the example migration system provided in the embodiments of this application. The example migration system provided in the embodiments of this application includes a game server and at least two dedicated servers for running game engine instances. A direct communication link and an indirect communication link are established between the dedicated servers and the game server. The indirect communication link is constructed with the migration server as an intermediate node between the dedicated servers and the game server. The migration server is a server cluster including multiple sub-migration servers.
[0115] See Figure 6 , Figure 6 This is a flowchart illustrating the game instance migration method provided in the embodiments of this application. Figure 1 , will combine Figure 6 Steps 101 to 103 are illustrated from the perspective of the game server in the instance migration system. The instance migration system includes the game server and at least two dedicated servers for running game engine instances. Direct and indirect communication links are established between the dedicated servers and the game server. The game instance migration method provided in this application embodiment can be implemented by the server or the terminal alone, or by the server and the terminal working together. The following description will take the implementation by the server alone as an example.
[0116] In step 101, the running information of the first game engine instance sent by the first dedicated server is received.
[0117] In some embodiments, the operational information is sent by a first dedicated server via a direct communication link and an indirect communication link.
[0118] In some embodiments, a dedicated server is a server configured specifically for a particular task or service, which does not share resources but provides dedicated services. In the gaming industry, a dedicated server specifically refers to a server that players can build themselves to run games. A dedicated server is a server specifically designed for this purpose, meaning that its computing resources, such as CPU, memory, hard disk space, and network bandwidth, are dedicated to running and hosting game services. This ensures the performance and stability of the game, as server resources are not consumed by other applications or services. Players can purchase or rent server hardware and install the corresponding game server software to build their own dedicated servers.
[0119] In some embodiments, runtime information refers to detailed data describing the current running state of a system or program. In the context of a game server, runtime information typically includes multiple parameters related to the running of the game engine instance. These parameters are used to detect and evaluate the instance's performance, status, and health. The runtime information includes multiple runtime parameters for the first game engine instance, each corresponding to an instance migration condition. The runtime parameters include the runtime of the first game engine instance on the first dedicated server and the running status of the first game engine instance on the first dedicated server, indicating whether the first game engine instance has stopped running on the first dedicated server.
[0120] In some embodiments, the runtime of the first game engine instance refers to the length of time the first game engine instance has been running on the first dedicated server since its startup. This parameter helps detect the utilization of system resources and assess whether the instance has been running long enough, potentially requiring migration to another server to avoid resource exhaustion or performance degradation. The running status of the first game engine instance refers to its current running status on the first dedicated server. This parameter can indicate whether the instance is running, stopped, or paused. By detecting the running status, the system can determine whether the instance needs to be restarted, migrated, or subjected to other operations. In game servers, this running information is used in automated decision-making processes. For example, when an instance's runtime is detected to be too long or its running status is abnormal, the system may decide to migrate the instance to another server to optimize performance, balance the load, or restore service. This dynamic instance migration helps improve game stability and player experience.
[0121] In some embodiments, a direct communication link refers to a point-to-point connection established between two network nodes (such as a game server and a dedicated server). In this connection, data transmission occurs directly between the two servers without any intermediate nodes or routers. Direct communication links offer the following advantages: High speed: Direct communication links typically provide high data transmission rates because the data transmission path is short and there is no additional processing latency from intermediate nodes. Low latency: Due to the absence of multiple network nodes, direct communication links generally have lower latency, making them suitable for real-time communication needs. Reliability: Direct connections reduce the likelihood of network failures, thus making communication more reliable. Simplicity: Managing direct communication links is generally simpler because they only involve connecting two nodes.
[0122] In some embodiments, an indirect communication link refers to a connection where data transmission between two network nodes requires relaying through one or more intermediate nodes or routers. In this connection, data is transmitted from one node to an intermediary node, and then through the intermediary node to another node. Indirect communication links have the following characteristics: Multi-hop transmission: Data transmission may require hops through multiple network nodes, which can increase transmission time and latency. Network flexibility: Indirect communication links offer more network configuration options to adapt to complex network environments and needs. High scalability: When connecting a large number of servers, indirect links can expand the network size by adding intermediate nodes. Potential complexity: Managing indirect communication links can be more complex because it involves configuring and detecting multiple network nodes. While direct communication links are suitable for critical operations requiring high-speed, low-latency transmission, indirect links may be more advantageous in terms of cost-effectiveness and network flexibility.
[0123] As an example, the game server receives the running information of the first game engine instance sent by the first dedicated server through a direct communication link at the first moment, and the game server receives the running information of the first game instance sent by the first dedicated server through an indirect communication link at the second moment. Since the path length of the direct communication link is shorter than that of the indirect communication link, the communication time of the direct communication link is shorter than that of the indirect communication link. Therefore, the first moment is earlier than the second moment.
[0124] As an example, the game server does not receive the running information of the first game engine instance sent by the first dedicated server through the direct communication link within the first time period. The game server receives the running information of the first game instance sent by the first dedicated server through the indirect communication link at the second time. The second time is the time after the first time period after the time when the first dedicated server sent the information.
[0125] In some embodiments, the first duration refers to a waiting period for evaluating and responding to specific conditions, specifically the period of waiting to receive a first response result from the second dedicated server in response to the running instruction. If the expected response result is not received within the first duration, or if a response result indicating that the second game engine instance has failed to run is received, appropriate measures will be taken, such as determining a third candidate server for recovery or migration operations.
[0126] As an example, the rules for setting the first duration can include the following factors: Network and system latency: Consider factors such as network transmission latency and system processing latency to ensure sufficient time to receive a response even under less than ideal network conditions. Execution condition requirements: Set the duration based on the characteristics of the first and second execution conditions. For example: First execution condition: If the expected response time is 1 second under normal network conditions, the first duration can be set to 3-5 seconds to accommodate possible network fluctuations. Second execution condition: If the second dedicated server can respond to a failure result within 2 seconds, the first duration can be set to 5-7 seconds to ensure sufficient time to process the failure response.
[0127] In this way, the game server receives the runtime information of the first game engine instance sent by the first dedicated server and transmits it through both direct and indirect communication links. Receiving runtime information via these links ensures that the game server can monitor the status of the first game engine instance in real time, promptly identifying and responding to performance issues or anomalies. Direct communication links typically provide stable data transmission, reducing the loss of runtime information due to network problems and thus improving the reliability of the monitoring data. Even if there are some network fluctuations in indirect communication links, the reliability of data transmission is still ensured due to the presence of redundant relay nodes.
[0128] In some embodiments, the aforementioned indirect communication link is constructed with a migration server as an intermediate node between the dedicated server and the game server. The aforementioned receipt of the running information of the first game engine instance sent by the first dedicated server can also be achieved in the following manner: when the direct communication link fails, the running information of the first game engine instance forwarded by the migration server is received through the indirect communication link.
[0129] In some embodiments, a migration server is used to migrate and restore services from a dedicated server. Migration servers are typically used to migrate game engine instances from one dedicated server to another when a server fails or requires maintenance. This process involves data backup, configuration file transfer, and application state restoration. Migration servers ensure seamless server switching and data integrity, reduce downtime due to server failures, and may also include automated recovery processes to quickly restore normal service after a server failure.
[0130] As an example, in the application scenario of server migration for a massively multiplayer online game (MMO), assume an MMO running on multiple dedicated servers, which handle player game sessions and interactions. The game server coordinates the state of the entire game world and player behavior. A direct communication link is established between the game server and each dedicated server for real-time exchange of player actions and game states. A migration server is added as an intermediate node between the game server and the dedicated servers to provide a backup communication path in case the direct communication link fails. Normally, the game server receives runtime information from the first game engine instance on each dedicated server via the direct communication link. This information includes player location, status, and in-game activities. Suppose the direct communication link becomes unavailable due to network failure or other reasons. When a direct communication link failure is detected, the game server can also receive runtime information from the first game engine instance forwarded by the migration server via an indirect communication link. That is, the migration server receives runtime information from the dedicated servers, and after confirming the information is complete and accurate, forwards it to the game server. Once the direct communication link is restored, the game server will re-establish the direct communication connection with the dedicated servers and continue to receive runtime information via the direct link.
[0131] As an example, in a game, players are teaming up with other players to complete a raid. A dedicated server handles the real-time logic and status of the raid. Due to a network issue, the direct communication link between the game server and the dedicated server is suddenly interrupted. The game server is temporarily unable to receive player location updates from the dedicated server. The game server detects the fault and receives the player location updates forwarded by the dedicated server via a migration server. Despite the failure of the direct link, the players' gaming experience is maintained thanks to the intervention of the indirect link, allowing them to continue their raid challenge. The use of the indirect communication link and the migration server ensures that even in the event of a direct communication link failure, the normal operation of the game server and the players' gaming experience are not affected.
[0132] Thus, when a direct communication link fails, the migration server can serve as a backup link, ensuring that operational information can continue to be transmitted from the dedicated server to the game server, thereby improving communication reliability and reducing service interruptions caused by a single link failure. For servers located in geographically distant locations, the migration server can act as a relay station, reducing latency and potential data loss over long distances. The migration server can be easily scaled to support more dedicated servers and game servers, adapting to ever-increasing network demands. Even if the direct communication link fails, the game server can still receive operational information from the primary game engine instance on the dedicated server. This effectively improves communication robustness and ensures the continuity and stability of the game service.
[0133] In some embodiments, the above-mentioned method of receiving the running information of the first game engine instance forwarded by the migration server through the indirect communication link when the direct communication link fails can be achieved by: establishing a heartbeat connection with the migration server; when the direct communication link fails and no running information forwarded by the migration server is received within a second time period, receiving the running information of the first game engine instance forwarded by the migration server through the heartbeat connection.
[0134] In some embodiments, the second duration refers to the maximum time to wait for the migration server to forward operational information after a direct communication link failure is detected. If no operational information is received within the second duration, it is assumed that communication with the migration server may have been interrupted or is experiencing a problem. The rules for setting the second duration typically consider the following factors: Network latency: This includes transmission latency, processing latency, and queuing latency, ensuring sufficient time to receive information even under poor network conditions. Load: During peak periods or when the load is high, the waiting time may need to be increased to avoid false positives. Business requirements: The necessary response time is determined based on the specific business scenario and user needs.
[0135] As an example, in practical applications, assuming the maximum latency allowed by network conditions is 500 milliseconds and the system load is normal, the second duration can be set to 2-3 seconds to allow for a certain time margin.
[0136] In some embodiments, a heartbeat connection is a mechanism used to periodically check the connectivity of the communication link. Between the game server and the migration server, the heartbeat connection ensures that both parties can periodically exchange status information. A time window (a second duration) is set; if the game server does not receive the expected runtime information from the migration server within this time window, it is assumed that there may be a problem with the indirect communication link. By establishing a heartbeat connection with the migration server, when the game server does not receive runtime information forwarded by the migration server within the second duration, it receives runtime information of the first game engine instance forwarded by the migration server via the heartbeat connection. The data sent via the heartbeat connection typically contains simple information, such as the server status, simple test messages, or timestamps, to confirm the validity of the link and test data transmission capabilities. Once the heartbeat connection is established, the game server can receive runtime information of the first game engine instance forwarded by the migration server through this link. This includes key information such as instance status updates and performance metrics. The game server continuously monitors the status of the heartbeat connection to ensure the stability and reliability of the communication link. If the heartbeat connection is broken, the server will take appropriate recovery measures, such as attempting to re-establish the connection or switching to another backup link.
[0137] In some embodiments, when the direct communication link between the game server and the dedicated server fails, the game server attempts to establish a heartbeat connection with the migration server via an indirect communication link. The purpose of this heartbeat connection is to: verify the indirect link: confirm the availability of the indirect communication link to receive runtime information; maintain communication: if the heartbeat connection is successfully established, the game server can receive runtime information from the first game engine instance forwarded by the migration server through this link; and facilitate fault recovery: establishing the heartbeat connection serves as a step in restoring communication, ensuring that the game server can still receive necessary runtime information during a direct communication link failure. The use of heartbeat connections enhances the robustness and reliability of the system, enabling the transmission of critical data to be maintained via a backup indirect link even in the event of a direct communication link failure.
[0138] As an example, suppose in a large-scale multiplayer online battle game, players can engage in real-time combat. The game server coordinates the actions of all players, while dedicated servers handle the logic of individual battle arenas. Direct communication links are established between the game server and each dedicated server to transmit the state of the battle arena and player actions in real time. A migration server is added between the game server and the dedicated servers as an intermediate node to provide a backup communication path in case the direct communication link fails. During the game, players engage in intense combat in various battle arenas. The game server receives player actions and combat status from the dedicated servers in real time. Due to network fluctuations, the direct communication link between the game server and one of the dedicated servers is suddenly interrupted, causing the game server to be unable to receive runtime information from the first game engine instance on that dedicated server. The game server does not receive runtime information forwarded by the migration server within a preset second time period (e.g., 60 seconds). The game server realizes the direct communication link failure and attempts to establish a heartbeat connection with the migration server. The heartbeat connection is successfully established, and the game server can send a request through this link to the migration server, inquiring whether it can forward runtime information from the dedicated servers. The migration server confirms that it can forward the runtime information and sends the runtime information of the first game engine instance from the dedicated server to the game server via a heartbeat connection. After receiving the runtime information, the game server updates the game status in a timely manner to ensure that the player's actions and combat results are not affected.
[0139] Continuing the previous example, two players are engaged in a tense battle when suddenly the direct communication link between the game server and the dedicated server responsible for that battlefield is interrupted. Since the game server has not received any operational information within a preset second time interval, it establishes a heartbeat connection via a migration server. Through this heartbeat connection, the game server successfully receives the players' actions and combat status, allowing the battle to continue and maintaining a consistent player experience. Even if the direct communication link fails, the game server can ensure the stable operation of the game world and provide a seamless player experience through indirect communication links and heartbeat connections.
[0140] Thus, in the game server architecture, when the direct communication link fails, the system receives the running information of the first game engine instance forwarded by the migration server through the indirect communication link and heartbeat connection. This mechanism significantly enhances stability and reliability. By detecting link failures within a preset time and switching to the backup communication path in a timely manner, it ensures continuous updates of the game status, avoids interruption of the player experience, and reduces the risk of game data loss due to link failures, thereby improving the overall stable operation of the game and player satisfaction.
[0141] In some embodiments, the migration server is a server cluster including multiple sub-migration servers. The above-mentioned receiving the running information of the first game engine instance forwarded by the migration server through an indirect communication link can be achieved in the following way: receiving the running information of the first game engine instance forwarded by any one of the sub-migration servers in the server cluster through an indirect communication link.
[0142] In some embodiments, the migration server cluster provides redundancy, ensuring high availability of the instance migration system even if one sub-migration server fails, while others continue to function normally. The sub-migration server cluster can distribute the workload of data forwarding, preventing overload of a single server, which helps improve data transmission efficiency and reduce latency. If one sub-migration server encounters a problem, the load can be transferred to other healthy sub-migration servers, achieving failover. The migration server cluster distributes network connections across multiple sub-migration servers, reducing the risk of single points of failure and improving network resilience. By receiving operational information forwarded by any sub-migration server in the cluster, the game server can ensure that even if some sub-migration servers fail, the normal operation of the entire system will not be affected. Since the sub-migration servers in the cluster may be distributed in different physical locations, this reduces the risk of data loss due to network partitioning and improves data integrity.
[0143] As an example, see Figure 5 The migration server is a server cluster that includes multiple sub-migration servers, namely sub-migration server A, sub-migration server B, and sub-migration server C.
[0144] Thus, in the game server architecture, a server cluster consisting of multiple sub-migration servers is used as the migration server, and the operation information from any one of the sub-migration servers is received through an indirect communication link. Even if some sub-migration servers fail, the other servers in the cluster can continue to provide services, thereby improving overall reliability and scalability, enhancing network resilience, reducing the risk of single point of failure, and allowing the system to dynamically adjust the data forwarding path according to network conditions, thereby optimizing network performance.
[0145] In step 102, when it is determined that the first game engine instance needs to be migrated based on the running information of the first game engine instance, a running instruction for the second game engine instance is sent to the second dedicated server.
[0146] In some embodiments, runtime information refers to a collection of data such as the status, performance, and resource usage of the first game engine instance during execution. Runtime information refers to various parameters and metrics of the first game engine instance during execution, such as CPU utilization, memory usage, runtime, and frame rate. This information helps in detecting and evaluating the performance and stability of the game engine. Runtime parameters refer to various configurable settings or variables that affect the behavior of a program or service. Runtime parameters include the runtime, CPU utilization, and memory usage of the first game engine instance on the first dedicated server. Each runtime parameter has its corresponding instance migration conditions.
[0147] In some embodiments, run instructions refer to a specific set of commands or operational guidelines, which typically include the following elements: Startup instructions: command the second game engine instance on the second dedicated server to begin running. Configuration instructions: set or update the configuration parameters of the second game engine instance to ensure its proper operation and compatibility with the first game engine instance. Migration instructions: instruct the second game engine instance to receive game state and user sessions migrated from the first game engine instance. Synchronization instructions: ensure data synchronization between the second and first game engine instances to maintain consistency of game state. When it is determined that migration is necessary based on the running information of the first game engine instance, these run instructions are sent to the second dedicated server to create an equivalent running environment on the second server and take over the work of the first game engine instance, thereby achieving a smooth service migration and a seamless user experience.
[0148] In some embodiments, the above-mentioned runtime information includes multiple runtime parameters of the first game engine instance, each runtime parameter corresponding to an instance migration condition, see [link to relevant documentation]. Figure 7 , Figure 7 This is a flowchart illustrating the game instance migration method provided in the embodiments of this application. Figure 2 , Figure 6 Step 102 shown can be achieved through Figure 7 Steps 1021 to 1022 shown are implemented.
[0149] In step 1021, for each running parameter, it is determined whether the instance migration conditions corresponding to the running parameter are met.
[0150] In some embodiments, instance migration conditions refer to the conditions under which a running instance needs to be migrated from one server or environment to another, based on a set of predefined rules and criteria. In the game engine example, instance migration conditions may include parameters such as runtime, server load, and resource utilization. When these parameters meet specific conditions, such as runtime reaching a certain threshold, instance migration will be triggered.
[0151] In some embodiments, the running parameters include the runtime of the first game engine instance in the first dedicated server. The determination of whether the instance migration conditions corresponding to the running parameters are met can be achieved as follows: the runtime is compared with a runtime threshold to obtain a runtime comparison result; when the runtime comparison result indicates that the runtime has reached the runtime threshold, it is determined that the instance migration conditions corresponding to the runtime are met; when the runtime comparison result indicates that the runtime has not reached the runtime threshold, it is determined that the instance migration conditions corresponding to the runtime are not met.
[0152] In some embodiments, runtime parameters are key indicators for detecting and evaluating system performance. Runtime is a specific runtime parameter representing the continuous running time of the first game engine instance on the first dedicated server. A runtime threshold is a predefined standard used to trigger certain operations or decisions. The runtime threshold is a critical value used to determine whether the game engine instance should be migrated. By comparing the current runtime with the preset runtime threshold, it can be determined whether the instance migration conditions are met. If the current runtime reaches or exceeds the threshold, the comparison result indicates that the instance migration conditions are met. If the current runtime does not reach the threshold, the comparison result indicates that the instance migration conditions are not met. If the duration comparison result indicates that the runtime reaches or exceeds the runtime threshold, the system will determine that the instance migration conditions corresponding to the runtime have been met and may trigger subsequent migration operations. If the duration comparison result indicates that the runtime does not reach the threshold, the system will determine that the instance migration conditions corresponding to the runtime have not been met and will not trigger migration operations.
[0153] As an example, suppose an online massively multiplayer online role-playing game (MMORPG) runs on a set of dedicated servers. To maintain smooth gameplay and a good player experience, a series of detection rules are set. One important parameter is the runtime of the first game engine instance on the first dedicated server. A runtime threshold of 12 hours is set; if a game engine instance runs continuously on the same server for more than 12 hours, it needs to be migrated to another server to maintain system performance. If the comparison result shows that the runtime has reached or exceeded 12 hours, the system determines that the instance migration condition corresponding to the runtime has been met. If the comparison result shows that the runtime has not reached 12 hours, the system determines that the instance migration condition corresponding to the runtime has not been met. When the instance migration condition is determined to be met, it automatically sends a run command to the second dedicated server, requesting the startup of a new game engine instance and preparing to receive player connections migrated from the first dedicated server. The game engine instance on the first dedicated server is gracefully shut down or transferred to the second dedicated server, and players usually do not experience noticeable service interruption because the migration process is smooth.
[0154] In this way, by promptly determining whether instances meet the migration criteria, migration can be performed in a timely manner when instance runtime reaches a threshold, thus avoiding the waste of resources on other servers due to excessive concentration of resources on a single server. Migrating instances that meet the criteria allows for the rational allocation of server resources, reducing operational costs caused by insufficient server resources. Timely migration of eligible instances helps prevent system crashes caused by excessive load on a single server, thereby ensuring the stability of the entire game.
[0155] In other embodiments, the running parameters include the running status of the first game engine instance in the first dedicated server. The determination of whether the instance migration conditions corresponding to the running parameters are met can be achieved in the following way: when the running status indicates that the first game engine instance has stopped running in the first dedicated server, it is determined that the instance migration conditions corresponding to the running status are met; when the running status indicates that the first game engine instance has not stopped running in the first dedicated server, it is determined that the instance migration conditions corresponding to the running status are not met.
[0156] In some embodiments, when the first game engine instance stops running on the first dedicated server, this typically indicates a potential server failure or resource exhaustion. In this case, if the migration conditions are met, the system can immediately initiate the migration process to transfer the instance to another healthy server, thereby minimizing the impact of the failure on the user experience. If the instance stops running on the first dedicated server, it may be due to insufficient server resources. Migrating the instance to a server with sufficient resources not only restores the instance's operation but also helps optimize resource allocation.
[0157] As an example, an online multiplayer game deploys multiple game engine instances to support a large number of concurrent users. The following is a practical application scenario for runtime parameter detection and instance migration: during peak gaming periods, when the number of players surges, some game engine instances on dedicated servers may stop running due to insufficient resources. This typically occurs on the first dedicated server, which handles a large player load. The system continuously monitors the runtime status of the first game engine instance on the first dedicated server. If the first game engine instance stops running on the first dedicated server (possibly due to 100% CPU utilization, insufficient memory, or other failures), the system will trigger an instance migration condition check. When the runtime status indicates that the instance has stopped running, the system will determine that the migration conditions are met and initiate the migration process. If the runtime status shows that the instance is still running, despite potential performance bottlenecks, the system will determine that the migration conditions are not met and will not immediately execute the migration. When the migration conditions are met, the first game engine instance will be automatically migrated from the first dedicated server to another dedicated server with lower load. This process may include saving the current game state, seamlessly transferring user sessions to a second dedicated server, and restarting the game engine instance on the second dedicated server.
[0158] In this way, by monitoring various operating parameters and determining whether the corresponding instance migration conditions are met, the system can respond to changes in operating status in real time, ensuring the efficient and stable operation of the game engine. It can promptly identify potential overload risks, such as performance degradation or resource exhaustion caused by prolonged operation. Therefore, when at least one instance migration condition is met, it quickly sends a running command to the second dedicated server to start a new game engine instance. This not only prevents server crashes and game interruptions, improving the player's gaming experience, but also optimizes server resource utilization, enhancing overall resilience and availability.
[0159] In step 1022, when at least one instance migration condition is met, a run instruction for the second game engine instance is sent to the second dedicated server.
[0160] As an example, in a game application scenario, the following example illustrates how to determine whether instance migration conditions are met based on runtime parameters, and how to send a run command to another dedicated server when the conditions are met. In a multiplayer online game application scenario, the game runs on multiple dedicated servers to ensure a smooth player experience. Here are specific examples: Runtime parameters: Runtime: The time the game engine has been running on one server. CPU utilization: The percentage of CPU resources used by the game engine instance. Memory utilization: The percentage of memory resources used by the game engine instance. Player connections: The number of players currently connected to the game engine instance. Instance migration conditions are: Runtime: If the game engine has been running for more than 24 hours, migration is considered necessary to avoid server overload. CPU utilization: If CPU utilization exceeds 80% for 10 consecutive minutes, migration is considered necessary to maintain game performance. Memory utilization: If memory utilization exceeds 90%, migration is considered necessary to prevent memory overflow. Player connections: If the number of player connections exceeds the server's capacity (e.g., 1000 players), migration is considered necessary to maintain service quality.
[0161] Continuing with the previous example, once at least one instance migration condition is met (runtime and CPU utilization), a running instruction for the second game engine instance will be automatically sent to the second dedicated server. The running instruction includes starting the new game engine instance and smoothly migrating players to the new instance, thereby reducing the load on the first dedicated server and ensuring the continuity and stability of the game.
[0162] In this way, by meticulously detecting each operating parameter and accurately determining whether the corresponding instance migration conditions are met, the system can respond promptly to the server's operating status. When at least one instance migration condition is met, the system sends an operating command for the second game engine instance to the second dedicated server. This not only ensures that the load can be quickly and seamlessly transferred to the second dedicated server when the first dedicated server encounters a problem, thereby improving elasticity and reliability, but also helps to balance server load, optimize resource allocation, and reduce the risk of single points of failure. The proactive migration strategy also helps to improve the user experience, reduce game interruptions and delays caused by server problems, and provide players with a more stable and high-quality gaming environment.
[0163] In some embodiments, sending the running instructions for the second game engine instance to the second dedicated server in step 102 above can be implemented as follows: based on the first game engine instance, determine the second dedicated server from at least two dedicated servers used to run the game engine instance; send the running instructions for the second game engine instance to the second dedicated server through a direct communication link and an indirect communication link, or send the running instructions for the second game engine instance to the second dedicated server through a direct communication link.
[0164] In some embodiments, based on the current operational status of the first game engine instance, one of at least two candidate dedicated servers needs to be selected as the second dedicated server to take over the operation of the first game engine instance. This selection process may be based on various factors, such as server load, geographical location, network latency, and resource availability.
[0165] In some embodiments, sending a run command to the second dedicated server is to enable the rapid startup of a second game engine instance on the second dedicated server when the first game engine instance needs to be migrated, taking over the work of the original instance and ensuring the continuity and stability of the game. The run command can be sent via a direct or indirect communication link, depending on the current network conditions and the quality of the communication link. The sent run command may include commands such as startup, configuration, migration, and synchronization, to ensure that the second game engine instance can accurately take over the state of the first game engine instance.
[0166] In some embodiments, the first game engine instance communicates directly with the second dedicated server, which is typically faster and has lower latency. Sending execution commands for the second game engine instance to the second dedicated server solely through a direct communication link effectively eliminates intermediate steps; however, a failure in the direct communication link will affect normal communication. Sending execution commands for the second game engine instance to the second dedicated server through both direct and indirect communication links improves communication efficiency when the direct communication link is functioning correctly, and enhances failover capability and fault tolerance when the direct communication link fails.
[0167] Thus, by employing a method of selecting a second dedicated server from multiple dedicated servers based on a first game engine instance, and combining this with a flexible command transmission mechanism using both direct and indirect communication links, not only can resource allocation be dynamically optimized to achieve load balancing and improve overall performance and stability, but the rapid response of the direct communication link and the high reliability of the indirect communication link also ensure that the game engine instance's execution commands are transmitted efficiently and accurately. Furthermore, this diversified communication approach increases fault tolerance and scalability, enabling it to adapt to constantly changing network environments and user needs, thereby enhancing user experience and reducing operating costs.
[0168] In some embodiments, the above-described determination of a second dedicated server from at least two dedicated servers used to run the game engine instance based on the first game engine instance can be achieved as follows: First candidate servers are identified from the at least two dedicated servers other than the first dedicated server; service performance parameters of each first candidate server and the minimum service performance parameters required to run the first game engine instance are obtained; when there is a first candidate server whose service performance parameters are not less than the minimum service performance parameters, the first candidate server whose service performance parameters are not less than the minimum service performance parameters is identified as the second candidate server; and the second dedicated server is determined from the second candidate servers.
[0169] In some embodiments, a first dedicated server running a first game engine instance is excluded from at least two dedicated servers, and the remaining servers are designated as first candidate servers. This narrows the selection, focusing on servers not currently running a first game engine instance. Service performance parameters are collected for each first candidate server; these parameters may include CPU utilization, memory availability, network latency, bandwidth, etc. The minimum service performance parameters required to run the first game engine instance are also determined. Based on the collected service performance parameters, first candidate servers with service performance parameters not less than the minimum service performance parameters are selected and designated as second candidate servers. This ensures that only servers meeting the performance requirements are considered as candidates to run a second game engine instance.
[0170] In some embodiments, service performance parameters refer to metrics used to measure server performance. These parameters include, but are not limited to, the following: CPU utilization: measures the activity level of the server's central processing unit, typically expressed as a percentage. Memory availability: refers to the amount of memory available on the server, which may include total memory and remaining memory. Network latency: the time required for data to travel from source to destination, typically measured in milliseconds. Bandwidth: the rate at which the server transmits data across the network, typically measured in bits per second (bps) or megabits per second (Mbps). Disk I / O: the speed of disk read and write operations, affecting the efficiency of data access. Response time: the time required for the server to respond to a request, an important indicator of user experience.
[0171] As an example, suppose a large-scale massively multiplayer online game (MMO) operator has multiple dedicated servers to support tens of thousands of players online simultaneously. To ensure smooth game operation, there are five dedicated servers (Server A, B, C, D, and E), where Server A is running the first game engine instance, responsible for handling the current game load. At this time, Servers B, C, D, and E are idle or under low load, and they are identified as the first candidate servers. Service performance parameters of Servers B, C, D, and E, such as CPU utilization, memory availability, and network latency, are collected. Simultaneously, the minimum service performance parameters required to run the first game engine instance are determined, such as: CPU utilization must not exceed 70%, memory availability must not be less than 4GB, and network latency must not exceed 30ms. After evaluation, Server B has a CPU utilization of 60%, memory availability of 8GB, and network latency of 20ms; Server C has a CPU utilization of 75%, memory availability of 2GB, and network latency of 25ms; the performance of Servers D and E does not meet the minimum standards. Therefore, Server B is identified as a second candidate server that meets the requirements. Since Server B's performance parameters meet the minimum service performance requirements, Server B is designated as the second dedicated server, and the second game engine instance is deployed to Server B. This way, when Server A's load increases or requires maintenance, Server B can immediately take over part or all of the game load, ensuring that the player experience is not affected.
[0172] This approach not only ensures resilience and reliability in the face of increased load or server maintenance, but also further enhances the game's performance and user experience by carefully selecting primary candidate servers that meet minimum performance standards. This optimizes resource allocation, improves resource utilization, and reduces operating costs by avoiding the need for long-term operation of unnecessary backup servers. The rapid response mechanism allows for the swift activation of a second dedicated server when performance degradation is detected, guaranteeing the continuity and stability of the game service and thus increasing player trust and satisfaction.
[0173] In some embodiments, after obtaining the service performance parameters of each first candidate server and the minimum service performance parameters required to run the first game engine, the following processing can also be performed: when there is no first candidate server whose service performance parameters are not less than the minimum service performance parameters, a failure indication message is output, which is used to indicate that the migration of the first game engine instance has failed.
[0174] In some embodiments, the service performance parameters of each first candidate server are evaluated to determine whether they meet the minimum performance requirements for running the first game engine instance. If the performance parameters of any first candidate server are not lower than the minimum service performance parameters, it means that there is no suitable server to undertake the task of running the first game engine instance. In this case, a failure indication message is output. This message typically includes the following: Indication of migration failure: Clearly informing the user or system administrator that the migration attempt of the first game engine instance failed due to the lack of available high-performance servers. Error code or description: Providing a specific error code or description to help quickly locate the problem and take appropriate action.
[0175] Thus, by outputting failure indication messages, the status of the migration operation can be immediately known, rather than remaining in an uncertain state. This facilitates rapid response and problem resolution. Failure indication messages typically include the reason for the failure, which helps in problem analysis, determining whether the migration failure was caused by insufficient performance, server malfunction, or configuration errors. If no suitable candidate server is available, attempting a migration may lead to instability or failure of the game engine instance. Outputting failure indication messages can prevent such erroneous migration operations, protecting the normal operation of the game.
[0176] In some embodiments, the determination of the second dedicated server from the second candidate servers can be achieved as follows: when there is only one second candidate server, the second candidate server is determined as the second dedicated server; when there are multiple second candidate servers, the second candidate server with the largest service performance parameter is determined as the second dedicated server.
[0177] In some embodiments, when there is only one second candidate server, the selection process becomes very direct and simple. The system directly identifies this single second candidate server as the second dedicated server without further comparison or evaluation. Since there is no comparison or evaluation between multiple servers, this method reduces the consumption of computing resources and time. In situations requiring rapid response, directly designating the only available second candidate server as the second dedicated server can improve the efficiency of system recovery or expansion. When multiple second candidate servers meet the performance requirements, selecting the server with the highest service performance parameter as the second dedicated server typically means selecting the currently best-performing server. This approach ensures that the second game engine instance runs in the optimal performance environment. Selecting the server with the highest performance parameter maximizes resource utilization, avoids resource waste, and also provides a better user experience.
[0178] Thus, when there is only one second candidate server, designating it as the second dedicated server effectively simplifies the decision-making process and avoids resource waste and selection difficulties. When there are multiple second candidate servers, selecting the best-performing candidate server as the second dedicated server by comparing service performance parameters maximizes resource utilization and ensures service stability and efficiency. This ensures that the second dedicated server can quickly take over in the event of a primary server failure, guaranteeing business continuity and data security. Selecting a suitable second dedicated server based on actual needs avoids resource waste and improves overall operational efficiency. Using a high-performance second dedicated server ensures a smooth user experience during the switchover process and reduces perceived service interruptions. The selection strategy for the second dedicated server can be flexibly adjusted to adapt to business development needs when the number of servers changes.
[0179] In some embodiments, after step 102 above, the following processing may also be performed: if the first execution condition is met or the second execution condition is met, the dedicated server other than the first dedicated server and the second dedicated server among at least two dedicated servers is determined as the third candidate server; when the number of third candidate servers is zero, a failure indication message is output, which is used to indicate that the migration of the first game engine instance has failed; when the number of third candidate servers is at least one, a third dedicated server is determined from at least one third candidate server, and a running instruction for the second game engine instance is sent to the third dedicated server.
[0180] In some embodiments, the first execution condition is that no first response result for the run instruction is received from the second dedicated server within a first time period; the second execution condition is that the first response result for the run instruction is received from the second dedicated server, and the first response result indicates that the second game engine instance has failed to run.
[0181] In some embodiments, the first execution condition is: if no first response to the run command is received from the second dedicated server within a predetermined first time period, this usually means that the second dedicated server may be unable to respond normally or that a communication failure has occurred. The second execution condition is: if a first response is received from the second dedicated server, but the result indicates that the second game engine instance has failed, this indicates that the second dedicated server may have encountered some kind of failure and cannot maintain the operation of the game engine instance normally. When any of the above execution conditions are met, the system will exclude the first and second dedicated servers from at least two dedicated servers, selecting other dedicated servers as third candidate servers. This selection mechanism ensures that backup server resources are available to handle failover, improving the system's resilience and availability. If no third candidate server is available, the system will output a failure indication, which helps operations personnel quickly identify the problem and take appropriate measures. This indication information indicates that the migration of the first game engine instance has failed, and further checks on the status and configuration of the dedicated servers are needed. If at least one third candidate server is available, one of them will be selected as the third dedicated server, and a run command for the second game engine instance will be sent to it. Through the backup server mechanism, reliability is enhanced, and the risk of single point of failure is reduced.
[0182] In some embodiments, a third candidate server refers to a backup server other than the first dedicated server and the second dedicated server. This backup server can act as a substitute server and take over the tasks originally performed by the primary server when the primary server fails. The first execution condition refers to the first condition that triggers the failover mechanism, namely, no response to the run instruction is received from the second dedicated server within a predetermined time period. The second execution condition refers to the second condition that triggers the failover mechanism, namely, a response is received from the second dedicated server, but the result indicates that the game engine instance has failed to run.
[0183] As an example, a massively multiplayer online role-playing game (MMORPG) is deployed on multiple dedicated servers to ensure smooth operation for tens of thousands of players online simultaneously. Dedicated server configuration: First dedicated server: Handles login and character creation. Second dedicated server: Runs the core of the game world, including player interaction and quests. Other dedicated servers: Responsible for different game areas, serving as backups and load balancing. After a game update, the second dedicated server suddenly fails and cannot respond to core game world function requests. First execution condition: Detection of no response to run instructions received from the second dedicated server within a predetermined first time period (e.g., 30 seconds). Immediately initiate a failover mechanism, marking all dedicated servers other than the first dedicated server and the failed second dedicated server as third candidate servers. Two third candidate servers are found to be available. Select a third candidate server and attempt to migrate the second game engine instance to this server. If no third candidate server is available, it will output a failure indication message, and the operations personnel will receive a warning, indicating that the migration of the first game engine instance has failed. If a response is received from the second dedicated server, but the response indicates that the second game engine instance has failed, possibly due to an internal server error or insufficient resources, a failover mechanism will be initiated. A third candidate server will be selected, and the second game engine instance will be migrated to this server. If the third candidate server successfully starts the second game engine instance, the core functionality of the game world will be quickly restored, and players will experience almost no interruption, thus maintaining a good user experience. If the migration fails, other third candidate servers will be tried, or operations personnel will intervene for manual recovery. This ensures that even if the dedicated server fails, the game can continue to provide services, thereby reducing the risk of player churn and service interruption.
[0184] Thus, if the first or second execution condition is met, other dedicated servers besides the first and second dedicated servers will be automatically selected as third candidate servers. This process effectively improves resource utilization efficiency and flexibility. By promptly identifying and switching to the third candidate server, paralysis caused by the failure of the first or second dedicated server can be avoided, thereby improving stability and reliability. Even if both the first and second dedicated servers experience problems simultaneously, the second game engine instance can continue to run through the third candidate server, ensuring the continuity of critical business operations. Timely response and migration of game engine instances helps reduce latency or interruptions experienced by players due to server failures, thereby improving the user experience.
[0185] In step 103, if a first response result for the run instruction is received from the second dedicated server and the first response result indicates that the second game engine instance has run successfully, a shutdown request for the first game engine instance is sent to the first dedicated server.
[0186] In some embodiments, a shutdown request is a command or signal sent by one system component (such as a game server) to another component (also the first dedicated server), instructing it to stop the currently executing operation or service. A shutdown request is used to stop the operation of the first game engine instance. A shutdown request typically includes necessary parameters, such as the timeout for the shutdown operation, the type of shutdown operation (such as immediate stop or graceful shutdown), etc. Sending a shutdown request can be used to save resources, maintain system security, or perform system updates.
[0187] In some embodiments, when the first dedicated server sends a run command to the second dedicated server to start the second game engine instance, it expects a response. If the second dedicated server successfully starts the second game engine instance, it sends a response back to the first dedicated server. The response includes an execution status indicating whether the second game engine instance has run successfully. If the first dedicated server receives a response indicating that the second game engine instance has run successfully, it sends a shutdown request to the first dedicated server. This may be to prevent resource waste caused by two game engine instances running simultaneously, or for necessary maintenance and updates.
[0188] In some embodiments, after performing step 103 above, the following processing may also be performed: receiving a second response result from the first dedicated server in response to the shutdown request, the second response result being sent via a direct communication link and an indirect communication link; when the second response result indicates that the first dedicated server failed to shut down the first game engine instance, continuing to send a shutdown request for the first game engine instance to the first dedicated server until the received second response result in response to the shutdown request indicates that the first dedicated server successfully shut down the first game engine instance.
[0189] In some embodiments, the game server sends a request to a first dedicated server to shut down a first game engine instance. The first dedicated server processes the request and returns a second response. The second response is sent in two ways: through a direct communication link and through an indirect communication link. When the game server receives the second response, it needs to determine whether the first dedicated server has successfully shut down the first game engine instance. If the second response indicates that the shutdown has failed, the game server will send the shutdown request to the first dedicated server again. This retry mechanism ensures that the game engine instance can be successfully shut down, preventing resource waste or inconsistent game states due to shutdown failure. The game server continuously retryes sending the shutdown request until it receives a second response indicating a successful shutdown. The retry interval and number of retry attempts may be configured according to specific circumstances to prevent excessive consumption of network and server resources.
[0190] As an example, in a multiplayer online game (MMO) scenario, the game runs on multiple servers, each responsible for handling a specific game area. The game server coordinates interactions between these game areas, while dedicated servers run specific game engine instances. The game server handles player login, matchmaking, and cross-area interactions. The first dedicated server runs the game engine instance responsible for its specific game area. Due to server maintenance or load balancing needs, the game server decides to shut down the game engine instance on the first dedicated server. The game server sends a shutdown request to the first dedicated server. The first dedicated server begins the shutdown process. The first dedicated server sends an intermediate status response to the game server via a direct communication link (e.g., via a fast intranet connection), indicating that the shutdown process has begun. Simultaneously, the first dedicated server may also send the same intermediate status response via an indirect communication link (e.g., via the internet) as redundant confirmation. The game server receives the intermediate status response sent via the direct communication link and awaits final shutdown confirmation. Due to network issues, the intermediate status response sent via the indirect communication link arrives late or may be lost. After some time, the game server does not receive the final successful shutdown response but instead receives a failure response (possibly via the direct or indirect communication link). The failure response indicates that the first dedicated server encountered a problem (e.g., resource usage, program error, etc.) while attempting to shut down the game engine instance. The game server initiates a retry mechanism and sends the shutdown request to the first dedicated server again. Upon receiving the new shutdown request, the first dedicated server attempts to shut down the game engine instance again. The first dedicated server successfully shuts down the game engine instance and sends a success response via the direct communication link. After receiving the success response, the game server confirms that the game engine instance is shut down and can proceed with subsequent maintenance or load balancing operations.
[0191] In this way, receiving the second response from the first dedicated server in response to the shutdown request, and through the dual protection of direct and indirect communication links, significantly improves the stability and reliability of the game server. When the second response indicates that shutting down the game engine instance failed, continuously retrying the shutdown request until successful not only ensures the effective release of resources and the normal operation of the system, enhancing fault tolerance and guaranteeing the completion of critical operations even in the face of network latency or failures; it also improves the real-time detection and feedback mechanism, ensuring that the game server can respond to and handle problems with the dedicated server in a timely manner.
[0192] Thus, the game server receives the running information of the first game engine instance sent by the first dedicated server via the direct and indirect communication links. When it determines that the first game engine instance needs to be migrated based on the running information, the game server sends a running instruction for the second game engine instance to the second dedicated server. If it receives a first response result from the second dedicated server indicating that the second game engine instance has run successfully, it sends a shutdown request for the first game engine instance to the first dedicated server. Because a direct and indirect communication link is established between the dedicated server and the game server, and communication is conducted through these links for game instance migration, the stability of game instance migration is effectively improved by enhancing the stability of communication between the dedicated server and the game server.
[0193] See Figure 8 , Figure 8 This is a flowchart illustrating the game instance migration method provided in the embodiments of this application. Figure 3 , will combine Figure 8 Steps 201 to 204 are illustrated from the perspective of an instance migration system. This system includes a game server and at least two dedicated servers for running game engine instances. The dedicated servers and the game server have direct communication connections and indirect communication links relayed through the migration server. The game instance migration method provided in this application can be implemented by the server or terminal alone, or by the server and terminal collaboratively. The following explanation will focus on the interaction between servers in the instance migration system.
[0194] In step 201, the first dedicated server sends the running information of the first game engine instance to the game server through direct communication links and indirect communication links.
[0195] In some embodiments, a dedicated server is a server configured specifically for a particular task or service, which does not share resources but provides dedicated services. In the gaming industry, a dedicated server specifically refers to a server that players can build themselves to run games. A dedicated server is a server specifically designed for this purpose, meaning that its computing resources, such as CPU, memory, hard disk space, and network bandwidth, are dedicated to running and hosting game services. This ensures the performance and stability of the game, as server resources are not consumed by other applications or services. Players can purchase or rent server hardware and install the corresponding game server software to build their own dedicated servers.
[0196] In some embodiments, runtime information refers to detailed data describing the current running state of a system or program. In the context of a game server, runtime information typically includes multiple parameters related to the running of the game engine instance. These parameters are used to detect and evaluate the instance's performance, status, and health. The runtime information includes multiple runtime parameters for the first game engine instance, each corresponding to an instance migration condition. The runtime parameters include the runtime of the first game engine instance on the first dedicated server and the running status of the first game engine instance on the first dedicated server, indicating whether the first game engine instance has stopped running on the first dedicated server.
[0197] In some embodiments, a direct communication link refers to a point-to-point connection established between two network nodes (such as a game server and a dedicated server). In this connection, data transmission occurs directly between the two servers without any intermediate nodes or routers. Direct communication links offer the following advantages: High speed: Direct communication links typically provide high data transmission rates because the data transmission path is short and there is no additional processing latency from intermediate nodes. Low latency: Due to the absence of multiple network nodes, direct communication links generally have lower latency, making them suitable for real-time communication needs. Reliability: Direct connections reduce the likelihood of network failures, thus making communication more reliable. Simplicity: Managing direct communication links is generally simpler because they only involve connecting two nodes.
[0198] In some embodiments, an indirect communication link refers to a connection where data transmission between two network nodes requires relaying through one or more intermediate nodes or routers. In this connection, data is transmitted from one node to an intermediary node, and then through the intermediary node to another node. Indirect communication links have the following characteristics: Multi-hop transmission: Data transmission may require hops through multiple network nodes, which can increase transmission time and latency. Network flexibility: Indirect communication links offer more network configuration options to adapt to complex network environments and needs. High scalability: When connecting a large number of servers, indirect links can expand the network size by adding intermediate nodes. Potential complexity: Managing indirect communication links can be more complex because it involves configuring and detecting multiple network nodes. While direct communication links are suitable for critical operations requiring high-speed, low-latency transmission, indirect links may be more advantageous in terms of cost-effectiveness and network flexibility.
[0199] In step 202, when the game server determines that the first game engine instance needs to be migrated based on the running information of the first game engine instance, the second dedicated server receives the running instructions for the second game engine instance.
[0200] In some embodiments, the second dedicated server may receive execution instructions for the second game engine instance via at least one of a direct communication link and an indirect communication link.
[0201] In some embodiments, run instructions refer to a specific set of commands or operational guidelines, which typically include the following elements: Startup instructions: command the second game engine instance on the second dedicated server to begin running. Configuration instructions: set or update the configuration parameters of the second game engine instance to ensure its proper operation and compatibility with the first game engine instance. Migration instructions: instruct the second game engine instance to receive game state and user sessions migrated from the first game engine instance. Synchronization instructions: ensure data synchronization between the second and first game engine instances to maintain consistency of game state. When it is determined that migration is necessary based on the running information of the first game engine instance, these run instructions are sent to the second dedicated server to create an equivalent running environment on the second server and take over the work of the first game engine instance, thereby achieving a smooth service migration and a seamless user experience.
[0202] In some embodiments, when the game server determines that the first game engine instance needs to be migrated based on the running information of the first game engine instance, it sends a running instruction for the second game engine instance to the second dedicated server, and the second dedicated server receives the running instruction for the second game engine instance.
[0203] In step 203, the second dedicated server sends the first response result to the game server in response to the running command through the direct communication link and the indirect communication link.
[0204] In some embodiments, when the first dedicated server sends a run command to the second dedicated server to start the second game engine instance, it expects a response. If the second dedicated server successfully starts the second game engine instance, it sends a response back to the first dedicated server. The response includes an execution status indicating whether the second game engine instance has run successfully. If the first dedicated server receives a response indicating that the second game engine instance has run successfully, it sends a shutdown request to the first dedicated server. This can prevent the two game engine instances from running simultaneously, thus avoiding resource waste, or it can be used for necessary maintenance and updates.
[0205] In some embodiments, the second dedicated server sends a first response result to the game server via dual communication links to indicate whether the second game engine instance is successfully running on the second dedicated server. This provides fast and reliable data transmission, suitable for communication scenarios with high real-time requirements, thus ensuring that the game server can quickly ascertain the running status of the second game engine instance. The indirect communication link serves as a backup, providing an additional data transmission path. When the direct communication link is unavailable or encounters problems, the indirect communication link ensures that the game server can still receive the first response result. Through dual communication links, even if one link fails, the system can continue to operate through the other, improving communication reliability. The indirect communication link can serve as a substitute when the direct communication link fails, ensuring that the game server does not lose detection of the second dedicated server's status due to communication problems.
[0206] In step 204, when the first response result indicates that the second game engine instance is running successfully, the first dedicated server receives a shutdown request for the first game engine instance.
[0207] In some embodiments, a shutdown request is a command or signal sent by one system component (such as a game server) to another component (also the first dedicated server), instructing it to stop the currently executing operation or service. A shutdown request is used to stop the operation of the first game engine instance. A shutdown request typically includes necessary parameters, such as the timeout for the shutdown operation, the type of shutdown operation (such as immediate stop or graceful shutdown), etc. Sending a shutdown request can be used to save resources, maintain system security, or perform system updates.
[0208] In some embodiments, after a first response indicates that the second game engine instance is successfully running on the second dedicated server, the first dedicated server receives a shutdown request for the first game engine instance. The first dedicated server receives a shutdown request from the game server, which explicitly indicates that the first game engine instance needs to be stopped. The first dedicated server needs to verify the legitimacy of the shutdown request, including the request source, request content, and authorization. Once verification is successful, the first dedicated server will begin executing the operation to shut down the first game engine instance.
[0209] In this way, the first dedicated server sends the running information of the first game engine instance to the game server through direct and indirect communication links, effectively improving the system's detection capabilities and response speed. When the game server determines that the first game engine instance needs to be migrated based on this information, the second dedicated server promptly receives the running instructions, ensuring the continuity and seamless switching of game services. Subsequently, the first response result sent by the second dedicated server through dual communication links further confirms the smooth progress of the migration, while the shutdown request received by the first dedicated server initiates the resource release and optimization process. The first dedicated server transmits the running information of the first game engine instance to the game server in real time through direct and indirect communication links, ensuring the real-time nature and accuracy of the data. When the game server determines that the first game engine instance needs to be migrated based on this information, the second dedicated server quickly receives the running instructions for the second game engine instance. This process greatly shortens the response time and improves flexibility. The second dedicated server feeds back the first response result to the game server for the running instructions through direct and indirect communication links. This feedback mechanism not only ensures the timeliness of instruction execution but also allows the game server to quickly confirm whether the migration was successful. When the first response indicates that the second game engine instance is running successfully, the first dedicated server receives the shutdown request, thereby orderly terminating the operation of the first game engine instance and avoiding waste of resources.
[0210] Thus, the game server receives the running information of the first game engine instance sent by the first dedicated server via the direct and indirect communication links. When it determines that the first game engine instance needs to be migrated based on the running information, the game server sends a running instruction for the second game engine instance to the second dedicated server. If it receives a first response result from the second dedicated server indicating that the second game engine instance has run successfully, it sends a shutdown request for the first game engine instance to the first dedicated server. Because a direct and indirect communication link is established between the dedicated server and the game server, and communication is conducted through these links for game instance migration, the stability of game instance migration is effectively improved by enhancing the stability of communication between the dedicated server and the game server.
[0211] See Figure 9 , Figure 9 This is a flowchart illustrating the game instance migration method provided in the embodiments of this application. Figure 4 , will combine Figure 9 Steps 301 to 304 are illustrated from the perspective of the migration server in the instance migration system. The instance migration system includes a game server and at least two dedicated servers for running game engine instances. The dedicated servers and the game server have a direct communication connection and an indirect communication link relayed through the migration server. The game instance migration method provided in this application embodiment can be implemented by the server or terminal alone, or by the server and terminal collaboratively. The following explanation will focus on the interaction between migration servers in the instance migration system.
[0212] In step 301, the running information of the first game engine instance sent by the first dedicated server is received, and the running information is sent to the game server.
[0213] In some embodiments, a dedicated server is a server configured specifically for a particular task or service, which does not share resources but provides dedicated services. In the gaming industry, a dedicated server specifically refers to a server that players can build themselves to run games. A dedicated server is a server specifically designed for this purpose, meaning that its computing resources, such as CPU, memory, hard disk space, and network bandwidth, are dedicated to running and hosting game services. This ensures the performance and stability of the game, as server resources are not consumed by other applications or services. Players can purchase or rent server hardware and install the corresponding game server software to build their own dedicated servers.
[0214] In some embodiments, runtime information refers to detailed data describing the current running state of a system or program. In the context of a game server, runtime information typically includes multiple parameters related to the running of the game engine instance. These parameters are used to detect and evaluate the instance's performance, status, and health. The runtime information includes multiple runtime parameters for the first game engine instance, each corresponding to an instance migration condition. The runtime parameters include the runtime of the first game engine instance on the first dedicated server and the running status of the first game engine instance on the first dedicated server, indicating whether the first game engine instance has stopped running on the first dedicated server.
[0215] In some embodiments, the migration server receives runtime information of the first game engine instance from the first dedicated server and sends this runtime information to the game server. By collecting this runtime information, the migration server can predict potential system failures or performance bottlenecks and take timely measures, such as triggering a migration process, to avoid service interruptions. The game server may need to use this information to make a decision on whether to migrate or adjust its resource allocation strategy. When a migration is decided, the runtime information sent by the migration server to the game server will be used to coordinate the migration process, such as updating the routing table and synchronizing user states, to ensure a smooth migration.
[0216] In some embodiments, the migration server receives runtime information from the first game engine instance as the basis for migration decisions, while sending this information to the game server ensures consistency during the migration process. This mechanism helps improve game stability and responsiveness.
[0217] In some embodiments, the above-mentioned sending of running information to the game server can be achieved by: sending running information to the game server and storing the running information in a storage server; when no running instruction for the second game engine instance is received from the game server within a third time period, querying the running information from the storage server, and continuing to send running information to the game server through a heartbeat connection.
[0218] In some embodiments, the third duration refers to the maximum time spent waiting to receive the run command from the game server for the second game engine instance after establishing a heartbeat connection with the migration server. If no run command is received within the third duration, an attempt will be made to re-establish the heartbeat connection with the game server. The rules for setting the third duration may include: Heartbeat frequency: Setting the waiting time based on the frequency of heartbeat connections to ensure sufficient time intervals for receiving commands. Fault recovery capability: Considering recovery capability, setting a reasonable duration so that the system can quickly recover after a failure. Tolerance: Determining the maximum tolerable latency time to ensure that the gaming experience is not affected.
[0219] As an example, in practical applications, if the heartbeat connection frequency is once per second, then the third duration might be set to 5-10 seconds, thus providing sufficient time for the game server to process and respond.
[0220] In some embodiments, migration servers are deployed as stateless services. The service process itself does not store runtime information; instead, it stores this information on a storage server for later retrieval. Therefore, abnormal termination of the service process does not result in data loss. This type of service is typically a multi-node service. Accessing any one of the nodes is equivalent, providing high availability. A stateless service means that the service process itself does not store any state information; it only handles requests and returns results. Because stateless services do not store state information, abnormal termination of the service process does not lead to data loss. This type of service is typically a multi-node service, allowing random access to any migration server, as each migration server provides the same service and is independent of the state of other migration servers.
[0221] As an example, suppose there's a single-player game that offers an online multiplayer competitive mode, allowing players to match and battle against each other via the internet. The game runs on a cloud server, with the server side divided into a game server, a migration server, and a storage server for backing up important data. To maintain smooth gameplay and responsiveness, the migration server monitors the game server's status to perform load balancing or fault recovery as needed. The migration server detects that a first game engine instance on a certain game server is handling a large number of player requests, causing a gradual increase in CPU and memory resource usage. The migration server begins sending operational information about the first game engine instance to the game server, including current load and response time. The migration server stores this operational information in the storage server to quickly restore the first game engine instance's state in case of a failure. If the migration server doesn't receive any operational instructions from the game server for a second game engine instance within a third time period, it may be due to a communication problem between the game server and the migration server. To ensure the game server can continue to operate normally and receive instructions from the migration server, the migration server attempts to establish a heartbeat connection with the game server. The heartbeat connection checks the connectivity between the two sides through periodic signal exchanges. Once the heartbeat connection is successfully established, the migration server will query the runtime information of the first game engine instance from the storage server and send this information to the game server via the heartbeat connection. This way, even if the game server is unable to receive the migration command for a short period, it can adjust its state based on the latest runtime information, ensuring that the player experience is not affected.
[0222] In this way, by sending operational information to the game server via the migration server and storing this information in the storage server, redundant backups of critical data are achieved, enhancing data reliability and system fault tolerance. If the migration server fails to receive a response from the game server within a predetermined time, a heartbeat connection is established, allowing the system to promptly detect and restore the communication link, ensuring service continuity and stability. Querying operational information from the storage server and retransmitting it via the heartbeat connection not only ensures the game server continuously receives the necessary data to maintain the current game state but also avoids service interruptions due to communication failures, thus optimizing the user experience and reducing potential losses from service outages.
[0223] In step 302, the system receives the running instructions for the second game engine instance sent by the game server and sends the running instructions to the second dedicated server.
[0224] In some embodiments, run instructions refer to a specific set of commands or operational guidelines, which typically include the following elements: Startup instructions: command the second game engine instance on the second dedicated server to begin running. Configuration instructions: set or update the configuration parameters of the second game engine instance to ensure its proper operation and compatibility with the first game engine instance. Migration instructions: instruct the second game engine instance to receive game state and user sessions migrated from the first game engine instance. Synchronization instructions: ensure data synchronization between the second and first game engine instances to maintain consistency of game state. When it is determined that migration is necessary based on the running information of the first game engine instance, these run instructions are sent to the second dedicated server to create an equivalent running environment on the second server and take over the work of the first game engine instance, thereby achieving a smooth service migration and a seamless user experience.
[0225] In some embodiments, the game server may decide to launch a new game engine instance or adjust an existing instance based on current service load, performance metrics, and business needs. The execution instructions it sends are directives to the migration server or dedicated server to perform the corresponding operations. The migration server, acting as a coordinator, sends specific execution instructions to the second dedicated server, guiding it to start, stop, or migrate a second game engine instance. The second dedicated server may be a resource specifically designed to handle a particular type of game task; through precise instruction delivery, resources can be utilized more effectively, improving overall performance and efficiency.
[0226] In some embodiments, run instructions refer to a specific set of commands or operational guidelines, which typically include the following elements: Startup instructions: command the second game engine instance on the second dedicated server to begin running. Configuration instructions: set or update the configuration parameters of the second game engine instance to ensure its proper operation and compatibility with the first game engine instance. Migration instructions: instruct the second game engine instance to receive game state and user sessions migrated from the first game engine instance. Synchronization instructions: ensure data synchronization between the second and first game engine instances to maintain consistency of game state. When it is determined that migration is necessary based on the running information of the first game engine instance, these run instructions are sent to the second dedicated server to create an equivalent running environment on the second server and take over the work of the first game engine instance, thereby achieving a smooth service migration and a seamless user experience.
[0227] In step 303, the first response result for the run command sent by the second dedicated server is received, and the first response result is sent to the game server.
[0228] In some embodiments, the second dedicated server sends a first response result to the game server via a dual communication link to indicate whether the second game engine instance is running successfully on the second dedicated server. Since the indirect communication link is implemented through a migration server, the migration server can receive the first response result for the running instruction sent by the second dedicated server and send the first response result to the game server.
[0229] In some embodiments, the migration server acts as a relay node, receiving response results from the second dedicated server. This indicates that it plays a crucial role in the system architecture, responsible for information aggregation and distribution. The migration server forwards the response results to the game server, ensuring that the game server can obtain the running status of the second game engine instance. Based on the received response results, the game server can make corresponding decisions, such as whether to continue the migration operation or make other resource adjustments.
[0230] In step 304, a shutdown request for the first game engine instance is received from the game server, and a shutdown request is sent to the first dedicated server.
[0231] As an example, suppose there's an online strategy game where players connect to a game server via the internet. The game runs on multiple dedicated servers, including a first dedicated server, a second dedicated server, and a migration server responsible for coordination. The first dedicated server is running a game engine instance, sending real-time operational information about that instance to the migration server, such as CPU and memory usage, and the number of online players. Upon receiving this information, the migration server aggregates the data and periodically sends it to the game server so that the game server can monitor the status of all game engine instances and allocate resources accordingly. If the game server detects a surge in the number of online players, it sends a run command to the migration server to start a second game engine instance to share the load and maintain game performance. Upon receiving the command, the migration server quickly forwards it to the second dedicated server, instructing it to start a new game engine instance to handle the additional player connections. The second dedicated server successfully starts the second game engine and sends a response to the migration server confirming that the new instance is ready. The migration server then forwards this response to the game server so that the game server knows the new game engine instance is ready. As the number of players decreased, the game server decided to shut down the first game engine instance to conserve resources. The game server sent a shutdown request to the migration server, which then forwarded this request to the first dedicated server, instructing it to stop running the first game engine instance. The migration server ensured that the game server could dynamically adjust resources based on the current game load, whether by adding new game engine instances to handle peak player numbers or shutting down unnecessary instances to conserve resources when player numbers decreased.
[0232] In this way, the efficient collaboration between the game server, dedicated servers, and migration servers, by receiving and forwarding the running information of the first game engine instance, can detect the game status in real time, quickly respond to potential performance issues, and ensure a smooth player experience. When the game server issues run or shut down commands based on the actual load, the relay role of the migration server ensures that these commands can be quickly and accurately transmitted to the corresponding dedicated servers, improving resource utilization efficiency and response speed. By collecting and feeding back the response results from the second dedicated server, the game server can confirm the status of command execution and make further decisions to ensure service continuity and stability, thereby improving the scalability, reliability, and operational efficiency of the entire game service.
[0233] The following will describe an exemplary application of the embodiments of this application in a real game application scenario.
[0234] This application embodiment utilizes a management service (DSC), which is the service described above for managing a group of DSA clusters, i.e. Figure 5 The management services shown), DSA (that is, the above and Figure 5 The management mechanism for communication and collaboration between the described proxy daemon process, DSR (i.e., the migration server described above), and GS (i.e., the game server described above) enables the management of the DS process migration trigger mechanism, thereby ensuring the reliability and timeliness of DS migration even in the event of machine failure, network failure, program crash, or other disasters.
[0235] This application's embodiments can be applied to all game services using dedicated server architecture, especially those requiring long-term dedicated server business logic. This application's embodiments can support reliable and rapid dedicated server migration (migrating the old dedicated server state to a new dedicated server to continue operation), thereby minimizing the impact on the player experience. Games with this requirement typically include open-world or large-scale gameplay, survival exploration gameplay, etc.
[0236] The architecture of this application embodiment is as follows: Figure 5 As shown, a migration server cluster is introduced in addition to the server and dedicated server cluster. The migration server is a stateless service that supports parallel deployment of multiple nodes. The migration server communicates with the server cluster, dedicated server cluster, and storage server.
[0237] In some embodiments, the migration server functions as follows: It provides fault tolerance for notifications from the proxy daemon to the server. The proxy daemon notifies the server simultaneously with the migration server, and the migration server notifies the server simultaneously when updating the dedicated server's state to the storage server. Thus, the server can trigger migration upon receiving notification from either the proxy daemon or the migration server. Furthermore, a short-interval heartbeat mechanism exists between the server and the migration server, with intervals of a few seconds. This allows for faster detection of the need to migrate the dedicated server even if a notification fails. Additionally, as a bypass system, the migration server does not participate in the critical path of the game's operations, has no impact on the management service or the allocation of dedicated servers by the proxy daemon, and introduces very low system risks.
[0238] In some embodiments, migration server availability is crucial. The migration server itself is a stateless service, allowing for parallel deployment of multiple nodes. Requests to the migration server can be routed to any of the migration server nodes for processing. Combined with storage servers, availability typically exceeds 99.99%. In contrast, servers are stateful services, requiring notifications to the server to specify a concrete instance address. Considering network partition failure rates and the occasional server migration, the success rate of notifications to the migration server via a proxy daemon and requests from the server to the migration server is significantly higher than that of a proxy daemon or a separate migration server notification server. Furthermore, even if the migration server becomes unavailable, it will not negatively impact the migration of a dedicated server.
[0239] In some embodiments, the constraints of dedicated server migration are that the server must ensure that the new dedicated server is successfully started and the first dedicated server is successfully shut down before executing the subsequent process of notifying player clients of the migration, in order to avoid players existing on both the new and first dedicated servers in a short period of time, which could cause conflicts in game business data.
[0240] In some embodiments, a migration process is triggered by a notification. Migration is triggered when a dedicated server has been running for an extended period. When a dedicated server has been running for too long, its state needs to be migrated to a new dedicated server process instance to continue running, in order to avoid serious consequences such as memory leaks. The migration process is triggered as follows: Figure 10 As shown, Figure 10 This is a flowchart illustrating the game instance migration method provided in the embodiments of this application. Figure 5 When the proxy daemon detects that the dedicated server's uptime exceeds a certain threshold, it notifies both the server and the migration server. The migration server updates the dedicated server's status to the storage server and then notifies the server of this event. Upon receiving notifications from either the proxy daemon or the migration server, the server determines whether migration is necessary. If so, it requests the management service to launch a new dedicated server. The management service selects a proxy daemon to launch the new dedicated server using a scheduling strategy (the selected proxy daemon instance does not necessarily have to be the same as the proxy daemon instance belonging to the first dedicated server; the flowchart only shows one proxy daemon for ease of understanding). Once the new proxy daemon confirms the launch of the new dedicated server, it notifies both the server and the migration server of successful launch. The migration server receives the notification, records the new dedicated server's status to the storage server, and also notifies the server. Upon receiving notifications from either the new proxy daemon or the migration server, the server requests the first proxy daemon to shut down the first dedicated server. The first proxy daemon shuts down the first dedicated server and notifies both the server and the migration server. The migration server receives the notification, updates the first dedicated server's status to the storage server, and also notifies the server. Upon receiving notifications from either the first proxy daemon or the migration server, the server continues the subsequent migration process.
[0241] In some embodiments, see Figure 10 The game instance migration method provided in this application embodiment can be achieved through... Figure 10 Steps 401 to 405 shown are implemented.
[0242] In step 401, the agent daemon simultaneously notifies both the server and the migration server that the dedicated server has been running for too long.
[0243] In some embodiments, a proxy daemon is used to launch the local DS process and manage and forward communications with it. It is a proxy daemon used to manage and control the operation of the dedicated game server. The main function of DSA is to launch and monitor the DS process. It can start, stop, restart, and monitor the status of the dedicated server. Furthermore, DSA is responsible for handling communication between the DS and external systems, such as the game main server, game clients, or other management tools. DSA ensures the stable operation of the dedicated server and can quickly respond to management commands when needed.
[0244] In step 402, after receiving the notification, the migration server updates the status of the dedicated server to the storage server.
[0245] In some embodiments, a migration server is used to migrate and restore DS services. A DS Recovery Server (DSSR) is typically used to migrate DS services from one server to another when a server fails or requires maintenance. This process involves data backup, configuration file transfer, and application state restoration. A DSSR ensures seamless server failover and data integrity, reduces downtime due to server failures, and improves system availability and reliability. A DSSR may also include automated recovery processes to enable rapid restoration of normal service after a server failure.
[0246] In step 403, the migration server notifies the server that the dedicated server has been running for too long.
[0247] In step 404, when the server receives a notification from either the management service or the migration server that the dedicated server has been running for too long, it determines that the dedicated server needs to be migrated.
[0248] In some embodiments, when it is determined that a dedicated server needs to be migrated, the server sends a request to the management service to launch a new dedicated server. The management service then sends a request to the agent daemon to launch the new dedicated server. The agent daemon launches the new dedicated server, and the second dedicated server reports initialization completion to the agent daemon. The agent daemon simultaneously notifies both the server and the migration server that the dedicated server launch was successful. The migration server records the dedicated server's status and notifies the dedicated server of the successful launch.
[0249] In step 405, the game server shuts down the first dedicated server through the proxy daemon.
[0250] In some embodiments, the agent daemon simultaneously notifies both the server and the migration server that the dedicated server was shut down successfully, and the migration server records the status of the dedicated server and notifies the dedicated server that the shutdown was successful.
[0251] In some embodiments, see Figure 11 , Figure 11 This is a flowchart illustrating the game instance migration method provided in the embodiments of this application. Figure 6 Migration is triggered when a dedicated server terminates abnormally (including process crashes, infinite loops, permanent blocking, or unexpected termination). Players on the original dedicated server must be immediately migrated to the new dedicated server. Since the dedicated server's state is periodically saved to the storage server in both full and real-time incremental fashion, the new dedicated server can recover from the failed server's state by reading it from the storage server. The migration triggering process is as follows: Figure 11 As shown, the proxy daemon detects that the dedicated server process has terminated abnormally and notifies both the server and the migration server. The migration server updates the state of the second dedicated server to the storage server and then notifies the server of the event. Upon receiving notifications from either the proxy daemon or the migration server, the server determines whether migration is necessary. If so, it requests the management service to launch a new dedicated server. The management service selects a proxy daemon to launch the new dedicated server using a scheduling strategy (the selected proxy daemon instance does not necessarily have to be the same as the proxy daemon instance belonging to the first dedicated server; the flowchart only shows one proxy daemon for ease of understanding). Once the new proxy daemon confirms the launch of the new dedicated server, it simultaneously notifies both the server and the migration server of successful launch. The migration server receives the notification, records the state of the second dedicated server to the storage server, and also notifies the server. Upon receiving notifications from either the new proxy daemon or the migration server, the server continues the subsequent migration process.
[0252] In some embodiments, see Figure 11 The game instance migration method provided in this application embodiment can be achieved through... Figure 11 Steps 501 to 503 shown are implemented.
[0253] In step 501, the proxy daemon detects that the dedicated server process has terminated, and the proxy daemon simultaneously notifies the server and the migration server of the abnormal termination.
[0254] In some embodiments, after the migration server changes the status of the second dedicated server to the storage server, the migration server notifies the server of an abnormal termination.
[0255] In step 502, the game server determines whether a dedicated server needs to be migrated.
[0256] In some embodiments, when migration is required, the server starts a second dedicated server through the management service, the agent daemon starts the second dedicated server, and receives the initialization completion information of the second dedicated server.
[0257] In step 503, the agent daemon simultaneously notifies both the server and the migration server that the dedicated server has been successfully launched.
[0258] In some embodiments, the migration server records the status of the dedicated server to the storage server, and the migration server notifies the dedicated server that it has been successfully started.
[0259] In some embodiments, see Figure 12 , Figure 12 This is a flowchart illustrating the game instance migration method provided in the embodiments of this application. Figure 7 Heartbeat fallback mechanism: To prevent notification failure, a timed heartbeat mechanism is used between the server and the migration server for fallback protection. This mechanism has a short heartbeat interval, typically 3-5 seconds, to provide sufficient timeliness. Since the overall availability of the migration server is very high (see reference 2), this mechanism primarily protects against notification failures between the proxy daemon and the migration server. The migration trigger process in case of notification failure is as follows: Figure 12 As shown, the proxy daemon detects that the dedicated server process has terminated abnormally and notifies both the server and the migration server. The migration server updates the status of the second dedicated server to the storage server and then notifies the server of the event. Assuming that both the proxy daemon and the migration server fail to notify the server, when the next server heartbeat reaches the migration server, the migration server, based on the dedicated server information carried in the heartbeat, first requests the proxy daemon to query the dedicated server status. If found, the proxy daemon's return is considered valid. If the migration server's access to the proxy daemon also fails, the migration server queries the storage server for the dedicated server status and, finding that the dedicated server's status has terminated abnormally, notifies the server. If this notification also fails, the same process is repeated when the server heartbeat is received next time. This continues until the server receives the migration server notification, at which point it determines whether migration is necessary. If so, it requests the management service to launch a new dedicated server. The management service selects a proxy daemon to launch the new dedicated server using a scheduling strategy (the selected proxy daemon instance does not necessarily have to be the same as the proxy daemon instance belonging to the first dedicated server). Figure 12(For ease of understanding, only one proxy daemon is shown). After the new proxy daemon confirms the start-up of the new dedicated server, it notifies both the main server and the migration server of the successful start-up. Upon receiving the notification, the migration server records the status of the second dedicated server to the storage server and also notifies the main server. After receiving notifications from either the new proxy daemon or the migration server, the main server continues the subsequent migration process.
[0260] In some embodiments, see Figure 12 The game instance migration method provided in this application embodiment can be achieved through... Figure 12 Steps 601 to 603 shown are implemented.
[0261] In some embodiments, the heartbeat mechanism can effectively handle individual notification failures caused by short-term network fluctuations, as well as notification failures caused by server migration. The agent daemon detects the termination of the dedicated server process.
[0262] In step 601, the agent daemon simultaneously notifies both the server and the migration server that the dedicated server has terminated abnormally.
[0263] In some embodiments, the migration server stores the status of the second dedicated server to the storage server and notifies the server of the abnormal termination. However, at this time, the server receives neither the notification from the agent daemon nor the notification from the migration server. The server and the migration server communicate via periodic heartbeats. If the queried dedicated server status indicates that the dedicated server has terminated abnormally, the server is notified that the dedicated server has terminated abnormally. At this time, the notification is successful.
[0264] In step 602, the game server determines whether the dedicated server needs to be migrated.
[0265] In some embodiments, when migration is required, the second dedicated server is restarted. The server restarts the second dedicated server through the management service, the agent daemon restarts the second dedicated server, and receives the initialization completion information of the second dedicated server.
[0266] In step 603, the agent daemon simultaneously notifies both the server and the migration server that the dedicated server has been successfully launched.
[0267] In some embodiments, the migration server records the status of the dedicated server to the storage server, and the migration server notifies the dedicated server that it has been successfully started.
[0268] Thus, the embodiments of this application can significantly improve the reliability of dedicated server migration notification triggering. By using a proxy daemon process and a secondary notification mechanism for the migration server, the success rate of notifications reaching the server is improved. At the same time, the embodiments of this application also significantly improve the timeliness of dedicated server migration triggering. For most notification failures such as network partition failures or server migrations, the migration triggering latency is shortened from the traditional tens of seconds heartbeat interval between the server and the dedicated server to a few seconds heartbeat interval between the server and the migration server.
[0269] It is understood that in the embodiments of this application, data related to game engine instances and the like are involved. When the embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0270] The following description continues to illustrate the exemplary structure of the game instance migration device 455 provided in the embodiments of this application as a software module. In some embodiments, such as Figure 2 As shown, the software modules in the game instance migration device 455 stored in the memory 450 may include: a receiving module, used by the game server to receive running information of a first game engine instance sent by a first dedicated server, the running information being sent by the first dedicated server through a direct communication link and an indirect communication link established between the first dedicated server and the game server; a determining module, used to send a running instruction for a second game engine instance to a second dedicated server when it is determined, based on the running information of the first game engine instance, that the first game engine instance needs to be migrated; and a closing module, used to send a closing request for the first game engine instance to the first dedicated server if a first response result for the running instruction is received from the second dedicated server, and the first response result indicates that the second game engine instance has run successfully.
[0271] In some embodiments, the running information includes multiple running parameters of the first game engine instance, each running parameter corresponding to an instance migration condition; the determining module is further configured to determine whether the instance migration condition corresponding to each running parameter is satisfied; when at least one instance migration condition is satisfied, a running instruction for the second game engine instance is sent to the second dedicated server.
[0272] In some embodiments, the running parameters include the runtime of the first game engine instance in the first dedicated server. The determining module is further configured to compare the runtime with a runtime threshold to obtain a runtime comparison result; when the runtime comparison result indicates that the runtime has reached the runtime threshold, it is determined that the instance migration condition corresponding to the runtime is satisfied; when the runtime comparison result indicates that the runtime has not reached the runtime threshold, it is determined that the instance migration condition corresponding to the runtime is not satisfied.
[0273] In some embodiments, the running parameters include the running status of the first game engine instance in the first dedicated server. The determining module is further configured to determine that the instance migration condition corresponding to the running status is met when the running status indicates that the first game engine instance has stopped running in the first dedicated server; and to determine that the instance migration condition corresponding to the running status has not been met when the running status indicates that the first game engine instance has not stopped running in the first dedicated server.
[0274] In some embodiments, the determining module is further configured to determine the second dedicated server from the at least two dedicated servers used to run the game engine instance based on the first game engine instance; and to send a running instruction for the second game engine instance to the second dedicated server through the direct communication link and the indirect communication link, or to send a running instruction for the second game engine instance to the second dedicated server through the direct communication link.
[0275] In some embodiments, the determining module is further configured to: determine the dedicated servers other than the first dedicated server among at least two dedicated servers as first candidate servers; obtain the service performance parameters of each first candidate server and the minimum service performance parameters required to run the first game engine instance; when there is a first candidate server whose service performance parameters are not less than the minimum service performance parameters, determine the first candidate server whose service performance parameters are not less than the minimum service performance parameters as a second candidate server; and determine the second dedicated server from the second candidate servers.
[0276] In some embodiments, the determining module is further configured to output failure indication information when there is no first candidate server whose service performance parameter is not less than the minimum service performance parameter, the failure indication information being used to indicate that the migration of the first game engine instance has failed; the determining module is further configured to determine the second candidate server as the second dedicated server when there is only one second candidate server; and to determine the second candidate server with the largest service performance parameter as the second dedicated server when there are multiple second candidate servers.
[0277] In some embodiments, the determining module is further configured to, if a first execution condition is met or a second execution condition is met, determine a third candidate server from at least two dedicated servers, excluding the first dedicated server and the second dedicated server; wherein the first execution condition is that no first response result for the running instruction sent by the second dedicated server is received within a first time period; the second execution condition is that the first response result for the running instruction sent by the second dedicated server is received, and the first response result indicates that the second game engine instance has failed to run; when the number of third candidate servers is zero, output failure indication information, the failure indication information being used to indicate that the migration of the first game engine instance has failed; when the number of third candidate servers is at least one, determine a third dedicated server from at least one third candidate server, and send a running instruction for the second game engine instance to the third dedicated server.
[0278] In some embodiments, the determining module is further configured to receive a second response result from the first dedicated server in response to the shutdown request, the second response result being sent through the direct communication link and the indirect communication link; when the second response result indicates that the first dedicated server failed to shut down the first game engine instance, the module continues to send a shutdown request for the first game engine instance to the first dedicated server until the received second response result for the shutdown request indicates that the first dedicated server successfully shut down the first game engine instance.
[0279] In some embodiments, the receiving module is further configured to receive the running information of the first game engine instance forwarded by the migration server through the indirect communication link when the direct communication link fails.
[0280] In some embodiments, the receiving module is further configured to establish a heartbeat connection with the migration server; when the direct communication link fails and no running information forwarded by the migration server is received within a second time period, the module receives the running information of the first game engine instance forwarded by the migration server through the heartbeat connection.
[0281] In some embodiments, the migration server is a server cluster including multiple sub-migration servers, and the receiving module is further configured to receive, through the indirect communication link, the running information of the first game engine instance forwarded by any one of the sub-migration servers in the server cluster.
[0282] The following description continues to illustrate the exemplary structure of the game instance migration device 555 provided in the embodiments of this application as a software module. In some embodiments, such as Figure 3 As shown, the software modules in the game instance migration device 555 stored in the memory 550 may include: an information sending module, wherein a first dedicated server sends the running information of a first game engine instance to the game server through a direct communication link and an indirect communication link established with the game server; an instruction receiving module, wherein when the game server determines that the first game engine instance needs to be migrated based on the running information of the first game engine instance, a second dedicated server receives a running instruction for a second game engine instance; a result sending module, wherein the second dedicated server sends a first response result for the running instruction to the game server through the direct communication link and the indirect communication link; and a request receiving module, wherein when the first response result indicates that the second game engine instance has run successfully, the first dedicated server receives a shutdown request for the first game engine instance.
[0283] The following description continues to illustrate the exemplary structure of the game instance migration device 666 provided in the embodiments of this application as a software module. In some embodiments, such as Figure 4As shown, the software modules in the game instance migration device 666 stored in the memory 660 may include: an information forwarding module, used for the migration server to receive running information of a first game engine instance sent by a first dedicated server, and to send the running information to the game server; an instruction forwarding module, used for the migration server to receive running instructions for a second game engine instance sent by the game server, and to send the running instructions to the second dedicated server; a result forwarding module, used for the migration server to receive a first response result for the running instructions sent by the second dedicated server, and to send the first response result to the game server; and a request forwarding module, used for the migration server to receive a shutdown request for the first game engine instance sent by the game server, and to send the shutdown request to the first dedicated server.
[0284] In some embodiments, the information forwarding module is further configured to send the running information to the game server and store the running information in a storage server; when no running instruction for the second game engine instance is received from the game server within a third time period, the module queries the running information from the storage server and continues to send the running information to the game server through a heartbeat connection.
[0285] This application provides a computer program product, which includes a computer program or computer-executable instructions stored in a computer-readable storage medium. The processor of an electronic device reads the computer-executable instructions from the computer-readable storage medium and executes the computer-executable instructions, causing the electronic device to perform the game instance migration method described in this application.
[0286] This application provides a computer-readable storage medium storing computer-executable instructions. When these computer-executable instructions are executed by a processor, they cause the processor to execute the game instance migration method provided in this application. For example, ... Figure 6 The game instance migration method is shown.
[0287] In some embodiments, the computer-readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or it may be a variety of electronic devices including one or any combination of the above-mentioned memories.
[0288] In some embodiments, computer-executable instructions may take the form of programs, software, software modules, scripts, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and 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.
[0289] As an example, computer-executable instructions may, but do not necessarily, correspond to files in a file system. They may be stored as part of a file that holds other programs or data, for example, in one or more scripts in a HyperText Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple co-located files (e.g., files that store one or more modules, subroutines, or code sections).
[0290] As an example, computer-executable instructions can be deployed to execute on a single electronic device, or on multiple electronic devices located at one location, or on multiple electronic devices distributed across multiple locations and interconnected via a communication network.
[0291] In summary, the embodiments of this application have the following beneficial effects:
[0292] (1) The game server receives the running information of the first game engine instance sent by the first dedicated server through the direct and indirect communication links. When it is determined that the first game engine instance needs to be migrated based on the running information of the first game engine instance, the game server sends a running instruction for the second game engine instance to the second dedicated server. If the game server receives a first response result for the running instruction from the second dedicated server, and the first response result indicates that the second game engine instance has run successfully, the game server sends a shutdown request for the first game engine instance to the first dedicated server. In this way, since a direct and indirect communication link is established between the dedicated server and the game server, communication is conducted through the direct and indirect communication links established between the dedicated server and the game server to perform game instance migration. This improves the stability of game instance migration by enhancing the stability of communication between the dedicated server and the game server.
[0293] (2) The system receives the running information of the first game engine instance sent by the first dedicated server and transmits it through direct and indirect communication links. Receiving running information through direct and indirect communication links ensures that the game server can monitor the status of the first game engine instance in real time and promptly detect and respond to performance problems or anomalies. Direct communication links typically provide stable data transmission, reducing the loss of running information due to network problems, thereby improving the reliability of the detection data. Even if there are some network fluctuations in indirect communication links, the reliability of data transmission can still be ensured because redundant relay nodes are usually configured.
[0294] (3) When a direct communication link fails, the migration server can serve as a backup link, ensuring that operational information can continue to be transmitted from the dedicated server to the game server, thereby improving communication reliability and reducing service interruptions caused by a single link failure. For servers located in geographically distant locations, the migration server can act as a relay station, reducing latency and potential data loss in long-distance transmission. The migration server can be easily expanded to support more dedicated servers and game servers, adapting to ever-increasing network demands. Even if the direct communication link fails, the game server can still receive operational information from the first game engine instance on the dedicated server. This effectively improves communication robustness and ensures the continuity and stability of game services.
[0295] (4) In the game server architecture, when the direct communication link fails, the running information of the first game engine instance forwarded by the migration server is received through the indirect communication link and heartbeat connection. This mechanism significantly enhances stability and reliability. By detecting link failures within a preset time and switching to the backup communication path in a timely manner, it ensures the continuous update of the game status, avoids interruption of the player experience, and reduces the risk of game data loss due to link failures, thereby improving the overall stable operation of the game and player satisfaction.
[0296] (5) In the game server architecture, a server cluster including multiple sub-migration servers is used as the migration server, and the operation information from any sub-migration server is received through an indirect communication link. Even if some sub-migration servers fail, the other servers in the cluster can continue to provide services, thereby improving the overall reliability and scalability, enhancing the elasticity of the network, reducing the risk of single point of failure, and allowing the system to dynamically adjust the data forwarding path according to network conditions, thereby optimizing network performance.
[0297] (6) By promptly determining whether instances meet the migration criteria, migration can be performed in a timely manner when the instance runtime reaches a threshold, thereby avoiding the waste of resources on other servers due to excessive concentration of resources on a single server. By migrating instances that meet the criteria, server resources can be allocated reasonably, reducing the operation and maintenance costs caused by insufficient server resources. Timely migration of instances that meet the criteria helps avoid system crashes caused by excessive load on a single server, thereby ensuring the stability of the entire game.
[0298] (7) By detecting each operating parameter and determining whether the corresponding instance migration conditions are met, the system can respond to changes in operating status in real time, ensuring the efficient and stable operation of the game engine. It can promptly identify potential overload risks, such as performance degradation or resource exhaustion caused by prolonged operation. When at least one instance migration condition is met, it quickly sends an operating command to the second dedicated server to start a new game engine instance. This not only prevents server crashes and game interruptions, improving the player's gaming experience, but also optimizes the use of server resources and improves overall elasticity and availability.
[0299] (8) By meticulously detecting each operating parameter and accurately determining whether the corresponding instance migration conditions are met, the system can respond promptly to the server's operating status. When at least one instance migration condition is met, an operating command for the second game engine instance is sent to the second dedicated server. This not only ensures that the load can be quickly and seamlessly transferred to the second dedicated server when the first dedicated server encounters a problem, thereby improving elasticity and reliability, but also helps to balance server load, optimize resource allocation, and reduce the risk of single points of failure. The proactive migration strategy also helps to improve the user experience, reduce game interruptions and delays caused by server problems, and provide players with a more stable and high-quality gaming environment.
[0300] (9) By employing a method of selecting a second dedicated server from multiple dedicated servers based on a first game engine instance, and combining a flexible command sending mechanism with direct and indirect communication links, not only can resource allocation be dynamically optimized to achieve load balancing and improve overall performance and stability, but the rapid response of the direct communication link and the high reliability of the indirect communication link also ensure that the game engine instance's execution commands can be transmitted efficiently and accurately. Furthermore, this diversified communication method increases fault tolerance and scalability, enabling it to adapt to constantly changing network environments and user needs, thereby improving user experience and reducing operating costs.
[0301] (10) This not only ensures resilience and reliability in the face of increased load or server maintenance, but also further improves the game's performance and user experience by carefully selecting first-choice servers that meet minimum performance standards. This optimizes resource allocation, increases resource utilization, and reduces operating costs by avoiding the need for long-term operation of unnecessary backup servers. The rapid response mechanism allows for the swift activation of a second dedicated server when performance degradation is detected, ensuring the continuity and stability of the game service and enhancing player trust and satisfaction.
[0302] (11) By outputting failure indication information, the status of the migration operation can be immediately known, rather than being in an uncertain state, which helps to respond quickly and resolve problems. Failure indication information usually includes the reason for the failure, which helps to analyze the problem and determine whether the migration failure is caused by insufficient performance, server failure, or configuration error. If there is no suitable candidate server, attempting migration may cause the game engine instance to run unstablely or fail. Outputting failure indication information can prevent such erroneous migration operations and protect the normal operation of the game.
[0303] (12) When there is only one second candidate server, designating it as the second dedicated server effectively simplifies the decision-making process and avoids resource waste and selection difficulties. When there are multiple second candidate servers, selecting the second candidate server with the best performance as the second dedicated server by comparing service performance parameters maximizes resource utilization and ensures service stability and efficiency. This ensures that the second dedicated server can quickly take over in the event of a primary server failure, guaranteeing business continuity and data security. Selecting a suitable second dedicated server based on actual needs avoids resource waste and improves overall operational efficiency. A high-performance second dedicated server ensures a smooth user experience during the switching process and reduces perceived service interruptions. The selection strategy for the second dedicated server can be flexibly adjusted to adapt to business development needs when the number of servers changes.
[0304] (13) If the first or second execution condition is met, other dedicated servers besides the first and second dedicated servers will be automatically selected as the third candidate server. This process can effectively improve resource utilization efficiency and flexibility. By timely identifying and switching to the third candidate server, paralysis caused by the failure of the first or second dedicated server can be avoided, thereby improving stability and reliability. Even if the first and second dedicated servers fail simultaneously, the second game engine instance can still continue to run through the third candidate server, ensuring the continuity of critical business. Timely response and migration of game engine instances helps reduce the latency or interruption felt by players due to server failure, thereby improving the user experience.
[0305] (14) Receiving the second response result from the first dedicated server in response to the shutdown request, and through the dual protection of direct and indirect communication links, the stability and reliability of the game server can be significantly improved. When the second response result indicates that shutting down the game engine instance has failed, the shutdown request is continuously retried until successful. This not only ensures the effective release of resources and the normal operation of the system, but also enhances fault tolerance. Even in the face of network latency or failure, it can guarantee the completion of critical operations, improve the real-time detection and feedback mechanism, and ensure that the game server can respond to and handle problems of the dedicated server in a timely manner.
[0306] (15) The efficient collaboration between the game server, dedicated server and migration server can detect the game status in real time and respond quickly to potential performance problems by receiving and forwarding the running information of the first game engine instance, ensuring the smoothness of the player experience. When the game server issues a run or shut down command based on the actual load, the relay role of the migration server ensures that these commands can be quickly and accurately transmitted to the corresponding dedicated server, improving the utilization efficiency and response speed of resources. By collecting and feeding back the response results of the second dedicated server, the game server can confirm the status of command execution and make further decisions to ensure the continuity and stability of the service, thereby improving the scalability, reliability and operation and maintenance efficiency of the entire game service.
[0307] (16) By sending operational information to the game server through the migration server and storing this information in the storage server, redundant backup of critical data is achieved, enhancing data reliability and system fault tolerance. When the migration server fails to receive a response from the game server within a predetermined time, a heartbeat connection is established, enabling the system to promptly detect and restore the communication link, ensuring service continuity and stability. Querying operational information from the storage server and retransmitting it through the heartbeat connection not only ensures that the game server can continuously receive the necessary data to maintain the current game state, but also avoids service interruptions caused by communication failures, thereby optimizing the user experience and reducing potential losses due to service interruptions.
[0308] (17) The first dedicated server sends the running information of the first game engine instance to the game server through direct and indirect communication links, which can effectively improve the system's detection capability and response speed. When the game server determines that the first game engine instance needs to be migrated based on this information, the second dedicated server receives the running instructions in a timely manner, ensuring the continuity and seamless switching of the game service. Subsequently, the first response result sent by the second dedicated server through the dual communication links further confirms the smooth progress of the migration, while the shutdown request received by the first dedicated server initiates the resource release and optimization process. The first dedicated server transmits the running information of the first game engine instance to the game server in real time through direct and indirect communication links, ensuring the real-time nature and accuracy of the data. When the game server determines that the first game engine instance needs to be migrated based on this information, the second dedicated server quickly receives the running instructions for the second game engine instance. This process greatly shortens the response time and improves flexibility. The second dedicated server feeds back the first response result for the running instructions to the game server through direct and indirect communication links. This feedback mechanism not only ensures the timeliness of instruction execution, but also enables the game server to quickly confirm whether the migration is successful. When the first response indicates that the second game engine instance is running successfully, the first dedicated server receives the shutdown request, thereby orderly terminating the operation of the first game engine instance and avoiding waste of resources.
[0309] (18) The embodiments of this application can significantly improve the reliability of DS migration notification triggering. Through the DSA and DSR secondary notification mechanism, the success rate of notification reaching GS is improved. At the same time, the embodiments of this application also significantly improve the timeliness of DS migration triggering. In the case of network partition failure or GS migration, most notification failures are reduced from the traditional GS to DS heartbeat interval of tens of seconds to the GS to DSR heartbeat interval of a few seconds.
[0310] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, and improvements made within the spirit and scope of this application are included within the scope of protection of this application.
Claims
1. A method for instance migration in a game, characterized in that, A game server applied in an instance migration system, the instance migration system including the game server and at least two dedicated servers for running game engine instances, wherein direct and indirect communication links are established between the dedicated servers and the game server; the method includes: Receive running information of a first game engine instance sent by a first dedicated server, wherein the running information is sent by the first dedicated server through the direct communication link and the indirect communication link; When it is determined that the first game engine instance needs to be migrated based on the running information of the first game engine instance, a running instruction for the second game engine instance is sent to the second dedicated server; If a first response result for the run instruction is received from the second dedicated server, and the first response result indicates that the second game engine instance has run successfully, then a shutdown request for the first game engine instance is sent to the first dedicated server.
2. The method according to claim 1, characterized in that, The operational information includes multiple operational parameters of the first game engine instance, each operational parameter corresponding to an instance migration condition; when it is determined, based on the operational information of the first game engine instance, that the first game engine instance needs to be migrated, an operational instruction for the second game engine instance is sent to the second dedicated server, including: For each of the aforementioned operating parameters, determine whether the instance migration conditions corresponding to the operating parameters are met; When at least one of the instance migration conditions is met, a run instruction for the second game engine instance is sent to the second dedicated server.
3. The method according to claim 2, characterized in that, The operating parameters include the runtime of the first game engine instance in the first dedicated server, and determining whether the instance migration conditions corresponding to the operating parameters are met includes: The runtime is compared with the runtime threshold to obtain the runtime comparison result; When the duration comparison result indicates that the runtime has reached the runtime threshold, it is determined that the instance migration condition corresponding to the runtime has been met. When the duration comparison result indicates that the runtime has not reached the runtime threshold, it is determined that the instance migration condition corresponding to the runtime has not been met.
4. The method according to claim 2, characterized in that, The operating parameters include the operating status of the first game engine instance in the first dedicated server, and determining whether the instance migration conditions corresponding to the operating parameters are met includes: When the running status indicates that the first game engine instance has stopped running in the first dedicated server, it is determined that the instance migration condition corresponding to the running status has been met. When the running status indicates that the first game engine instance is not stopped running in the first dedicated server, it is determined that the instance migration condition corresponding to the running status has not been met.
5. The method according to claim 1, characterized in that, Sending the execution instructions for the second game engine instance to the second dedicated server includes: Based on the first game engine instance, the second dedicated server is determined from the at least two dedicated servers used to run the game engine instance; Through the direct communication link and the indirect communication link, the execution instructions for the second game engine instance are sent to the second dedicated server, or The execution instructions for the second game engine instance are sent to the second dedicated server via the direct communication link.
6. The method according to claim 5, characterized in that, The step of determining the second dedicated server from the at least two dedicated servers used to run the game engine instance based on the first game engine instance includes: The dedicated server other than the first dedicated server among at least two of the dedicated servers is identified as the first candidate server; Obtain the service performance parameters of each of the first candidate servers, and the minimum service performance parameters required to run the first game engine instance; When there is a first candidate server whose service performance parameter is not less than the minimum service performance parameter, the first candidate server whose service performance parameter is not less than the minimum service performance parameter is determined as the second candidate server. The second dedicated server is determined from the second candidate servers.
7. The method according to claim 6, characterized in that, After obtaining the service performance parameters of each of the first candidate servers and the minimum service performance parameters required to run the first game engine instance, the method further includes: When there is no first candidate server whose service performance parameter is not less than the minimum service performance parameter, a failure indication message is output, which is used to indicate that the migration of the first game engine instance has failed.
8. The method according to claim 6, characterized in that, The step of determining the second dedicated server from the second candidate servers includes: When the number of the second candidate servers is one, the second candidate server is determined as the second dedicated server; When there are multiple second candidate servers, the second candidate server with the largest service performance parameter is determined as the second dedicated server.
9. The method according to claim 1, characterized in that, After sending the execution command for the second game engine instance to the second dedicated server, the method further includes: If the first execution condition is met or the second execution condition is met, the dedicated server other than the first dedicated server and the second dedicated server among the at least two dedicated servers will be determined as the third candidate server; The first execution condition is that no first response result for the running instruction is received from the second dedicated server within a first time period; The second execution condition is that a first response result is received from the second dedicated server in response to the running instruction, and the first response result indicates that the second game engine instance has failed to run; When the number of the third candidate servers is zero, a failure indication message is output, which is used to indicate that the migration of the first game engine instance has failed; When there is at least one third candidate server, a third dedicated server is determined from the at least one third candidate server, and a running instruction for the second game engine instance is sent to the third dedicated server.
10. The method according to claim 1, characterized in that, After sending a shutdown request for the first game engine instance to the first dedicated server, the method further includes: Receive a second response result from the first dedicated server in response to the shutdown request, the second response result being sent via the direct communication link and the indirect communication link; When the second response result indicates that the first dedicated server failed to shut down the first game engine instance, the server continues to send shutdown requests for the first game engine instance to the first dedicated server until the second response result received for the shutdown request indicates that the first dedicated server successfully shut down the first game engine instance.
11. The method according to claim 1, characterized in that, The indirect communication link is constructed with a migration server as an intermediate node between the dedicated server and the game server. Receiving the runtime information of the first game engine instance sent by the first dedicated server includes: When the direct communication link fails, the running information of the first game engine instance forwarded by the migration server is received through the indirect communication link.
12. The method according to claim 11, characterized in that, When the direct communication link fails, receiving the running information of the first game engine instance forwarded by the migration server through the indirect communication link includes: Establish a heartbeat connection with the migration server; When the direct communication link fails and no running information forwarded by the migration server is received within the second time period, the running information of the first game engine instance forwarded by the migration server is received through the heartbeat connection.
13. The method according to claim 11, characterized in that, The migration server is a server cluster comprising multiple sub-migration servers. Receiving the runtime information of the first game engine instance forwarded by the migration server via the indirect communication link includes: Through the indirect communication link, the system receives the running information of the first game engine instance forwarded by any of the sub-migration servers in the server cluster.
14. A method for instance migration in a game, characterized in that, The method is applied to an instance migration system, which includes a game server and at least two dedicated servers for running game engine instances, wherein the dedicated servers and the game server have direct and indirect communication links established between them; the method includes: The first dedicated server sends the running information of the first game engine instance to the game server through the direct communication link and the indirect communication link; When the game server determines that the first game engine instance needs to be migrated based on the running information of the first game engine instance, the second dedicated server receives the running instructions for the second game engine instance. The second dedicated server sends a first response result to the game server in response to the running command via the direct communication link and the indirect communication link; When the first response indicates that the second game engine instance is running successfully, the first dedicated server receives a shutdown request for the first game engine instance.
15. A method for instance migration in a game, characterized in that, A migration server is applied in an instance migration system, the instance migration system including a game server, a migration server, and at least two dedicated servers for running game engine instances, wherein the dedicated servers and the game server have a direct communication connection and an indirect communication link relayed through the migration server; the method includes: Receive the running information of the first game engine instance sent by the first dedicated server, and send the running information to the game server; Receive the running instructions sent by the game server for the second game engine instance, and send the running instructions to the second dedicated server; Receive the first response result sent by the second dedicated server in response to the running instruction, and send the first response result to the game server; The system receives a shutdown request from the game server for the first game engine instance and sends the shutdown request to the first dedicated server.
16. The method according to claim 15, characterized in that, Sending the running information to the game server includes: The running information is sent to the game server, and the running information is stored in the storage server; If no running instruction for the second game engine instance is received from the game server within the third time period, the running information is queried from the storage server, and the running information is sent to the game server again through a heartbeat connection.
17. A game instance migration device, characterized in that, The device includes: The receiving module is used for the game server to receive the running information of the first game engine instance sent by the first dedicated server. The running information is sent by the first dedicated server through the direct communication link and the indirect communication link established between the game server and the game server. The determination module is used to send a running instruction for the second game engine instance to the second dedicated server when it is determined, based on the running information of the first game engine instance, that the first game engine instance needs to be migrated. The shutdown module is used to send a shutdown request for the first game engine instance to the first dedicated server if it receives a first response result from the second dedicated server for the run instruction and the first response result indicates that the second game engine instance has run successfully.
18. An electronic device, characterized in that, The electronic device includes: Memory is used to store executable instructions or computer programs. A processor, when executing computer-executable instructions or computer programs stored in the memory, implements the instance migration method of the game as described in any one of claims 1 to 16.
19. A computer-readable storage medium storing computer-executable instructions or a computer program, characterized in that, When the computer-executable instructions or computer program are executed by a processor, they implement the instance migration method of the game as described in any one of claims 1 to 16.
20. A computer program product comprising a computer program or computer-executable instructions, characterized in that, When the computer program or computer-executable instructions are executed by a processor, they implement the instance migration method of the game as described in any one of claims 1 to 16.