Game management method, device and equipment and computer readable storage medium
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- TENCENT TECHNOLOGY (SHENZHEN) CO LTD
- Filing Date
- 2022-03-25
- Publication Date
- 2026-08-07
AI Technical Summary
[0045] In the technical solution provided in this application embodiment, a dedicated server manages multiple game rooms, and the multiple game rooms can share the resources required for playing games included in the dedicated server, resulting in a high resource reuse rate. Moreover, since a dedicated server can manage multiple game rooms, the load capacity of the dedicated server is increased, and the memory consumption of the dedicated server is reduced.
Smart Images

Figure CN116832451B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a game management method, apparatus, device, and computer-readable storage medium. Background Technology
[0002] With the continuous development of computer technology, online games have gradually become an important internet service for users. In online games, users need to log into a game room first, and then play the game within that room. Game rooms are hosted on a dedicated server (DS), which contains the resources needed for the game. When a user logs into a game room, they are essentially logging into the dedicated server where the game room resides, and thus can use the resources available on that server for playing the game.
[0003] Therefore, a game management method is needed to improve the reuse rate of resources used for gaming on dedicated servers, reduce memory consumption on dedicated servers, and increase the load capacity of dedicated servers. Summary of the Invention
[0004] This application provides a game management method, apparatus, device, and computer-readable storage medium, which can improve the reuse rate of resources included in a dedicated server, reduce the memory consumption of the dedicated server, and increase the load capacity of the dedicated server. The technical solution is as follows:
[0005] On one hand, embodiments of this application provide a game management method, the method comprising:
[0006] Retrieve multiple game requests sent by multiple objects, wherein the game requests are used to request to play the target game;
[0007] Based on the multiple game requests, the multiple objects are grouped to obtain at least one object group, and an object group includes at least one object;
[0008] A target dedicated server is determined for the target object group in the at least one object group. The target dedicated server includes the resources required to play the target game. The target dedicated server manages multiple game rooms, and the multiple game rooms can share the resources required to play the target game.
[0009] Determine the target room corresponding to the target object group among the plurality of game rooms;
[0010] The room identifier of the target room is sent to the terminal corresponding to the object included in the target object group. The room identifier is used by the object included in the target object group to enter the target room and play the target game by using the resources required to play the target game.
[0011] On the other hand, embodiments of this application provide a game management device, the device comprising:
[0012] The acquisition module is used to acquire multiple game requests sent by multiple objects, wherein the game requests are used to request to play the target game;
[0013] The grouping module is used to group the multiple objects based on the multiple game requests to obtain at least one object group, and an object group includes at least one object;
[0014] A determination module is used to determine a target dedicated server corresponding to a target object group in the at least one object group, wherein the target dedicated server includes resources required to play the target game, the target dedicated server manages multiple game rooms, and the multiple game rooms can share the resources required to play the target game;
[0015] The determining module is further configured to determine the target room corresponding to the target object group among the plurality of game rooms;
[0016] The sending module is used to send the room identifier of the target room to the terminal corresponding to the object included in the target object group. The room identifier is used by the object included in the target object group to enter the target room and play the target game by using the resources required to play the target game.
[0017] In one possible implementation, the determining module is configured to determine the target dedicated server management device corresponding to the target object group in the at least one object group, wherein the target dedicated server management device manages multiple dedicated servers, each dedicated server including the resources required to perform the target game; and determine the target dedicated server corresponding to the target object group among the multiple dedicated servers.
[0018] In one possible implementation, the determining module is configured to acquire device information corresponding to multiple dedicated server management devices respectively; determine the load rate corresponding to each of the multiple dedicated server management devices based on the device information corresponding to each of the multiple dedicated server management devices respectively; and designate the dedicated server management device whose load rate meets the first load requirement among the multiple dedicated server management devices as the target dedicated server management device corresponding to the target object group.
[0019] In one possible implementation, the device information includes a first number of servers and a second number of servers, wherein the first number of servers is the number of dedicated servers managed by the dedicated server management device, and the second number of servers is the number of dedicated servers that are fully occupied among the dedicated servers managed by the dedicated server management device, wherein the fully occupied dedicated servers are game rooms in the game rooms managed by the dedicated server where there are no game rooms whose room status meets the status requirements.
[0020] The determining module is used to determine the load rate of any one of the plurality of dedicated server management devices by taking the quotient between the number of second servers and the number of first servers corresponding to that dedicated server management device.
[0021] In one possible implementation, the determining module is configured to acquire server information corresponding to the plurality of dedicated servers respectively; determine the load rate corresponding to the plurality of dedicated servers respectively based on the server information corresponding to the plurality of dedicated servers respectively; and designate the dedicated server whose load rate among the plurality of dedicated servers meets the second load requirement as the target dedicated server corresponding to the target object group.
[0022] In one possible implementation, the server information includes a first number of rooms and a second number of rooms, wherein the first number of rooms is the number of game rooms managed by the dedicated server, and the second number of rooms is the number of game rooms managed by the dedicated server whose room status does not meet the status requirements.
[0023] The determining module is used to determine the load rate of any one of the plurality of dedicated servers by taking the quotient between the number of second rooms and the number of first rooms corresponding to that dedicated server.
[0024] In one possible implementation, the determining module is used to determine the room status of the plurality of game rooms; select game rooms whose room status meets the status requirements as candidate rooms; and determine the target room corresponding to the target object group based on the candidate rooms.
[0025] In one possible implementation, the game request carries an object identifier;
[0026] The grouping module is used to obtain object information of the multiple objects based on the object identifiers carried in the multiple game requests; and to group the multiple objects based on the object information to obtain at least one object group.
[0027] In one possible implementation, the object information includes at least one of the object's game level in the target game, the object's location, and the object's network latency.
[0028] The grouping module is used to determine the object score corresponding to each of the multiple objects based on the object information of the multiple objects and the information weight corresponding to the object information. The object score is used to indicate the compatibility of the object with the target game. The multiple objects are grouped according to the object scores corresponding to each of the multiple objects to obtain at least one object group.
[0029] In one possible implementation, the device further includes:
[0030] The receiving module is used to receive a resource usage request sent by any object in the target room, wherein the resource usage request carries the resource identifier of the resource to be used and the first number of resources;
[0031] The allocation module is used to allocate the required resources to any object based on the resource identifier of the required resources and the first number of resources.
[0032] In one possible implementation, the determining module is configured to determine a second number of resources based on the resource identifier of the resource to be used, wherein the second number of resources is the currently available number of the resource to be used in the target dedicated server;
[0033] The allocation module is configured to allocate the number of resources to be used by the first resource to any object in response to the second resource number being not less than the first resource number.
[0034] In one possible implementation, the determining module is further configured to, in response to the second resource number being less than the first resource number, determine a third resource number based on the first resource number and the second resource number;
[0035] The acquisition module is further configured to acquire the resource code corresponding to the resource to be used based on the resource identifier of the resource to be used; and generate the number of third resources to be used based on the resource code corresponding to the resource to be used and the number of third resources.
[0036] The allocation module is further configured to allocate the second resource number of required resources and the third resource number of required resources to any object.
[0037] In one possible implementation, the device further includes:
[0038] The adjustment module is used to adjust the current number of available resources in the target dedicated server to a fourth number of resources, wherein the fourth number of resources is the difference between the second number of resources and the first number of resources.
[0039] In one possible implementation, the receiving module is further configured to receive a resource usage completion instruction sent by any of the objects;
[0040] The adjustment module is further configured to adjust the current number of available resources in the target dedicated server to the second number of resources based on the resource usage completion instruction.
[0041] On the other hand, embodiments of this application provide an electronic device, which includes a processor and a memory. The memory stores at least one piece of program code, which is loaded and executed by the processor to enable the electronic device to implement any of the game management methods described above.
[0042] On the other hand, a computer-readable storage medium is also provided, wherein at least one piece of program code is stored in the computer-readable storage medium, the at least one piece of program code being loaded and executed by a processor to enable a computer to implement any of the game management methods described above.
[0043] On the other hand, a computer program or computer program product is also provided, wherein the computer program or computer program product stores at least one computer instruction, which is loaded and executed by a processor to enable the computer to implement any of the above-mentioned game management methods.
[0044] The technical solution provided in this application has at least the following beneficial effects:
[0045] In the technical solution provided in this application embodiment, a dedicated server manages multiple game rooms, and the multiple game rooms can share the resources required for playing games included in the dedicated server, resulting in a high resource reuse rate. Moreover, since a dedicated server can manage multiple game rooms, the load capacity of the dedicated server is increased, and the memory consumption of the dedicated server is reduced. Attached Figure Description
[0046] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0047] Figure 1This is a schematic diagram of the implementation environment of a game management method provided in an embodiment of this application;
[0048] Figure 2 This is a flowchart of a game management method provided in an embodiment of this application;
[0049] Figure 3 This is an architecture diagram of a target dedicated server provided in an embodiment of this application;
[0050] Figure 4 This is an architecture diagram of a dedicated server provided in an embodiment of this application;
[0051] Figure 5 This is a schematic diagram of a network layer sending and receiving messages according to a game room, provided in an embodiment of this application;
[0052] Figure 6 This is a schematic diagram illustrating the updating of a game room according to an embodiment of this application;
[0053] Figure 7 This is a flowchart of a game management method provided in an embodiment of this application;
[0054] Figure 8 This is a performance consumption curve of a dedicated server provided in an embodiment of this application;
[0055] Figure 9 This is a schematic diagram of the structure of a game management device provided in an embodiment of this application;
[0056] Figure 10 This is a schematic diagram of the structure of a terminal provided in an embodiment of this application;
[0057] Figure 11 This is a schematic diagram of the structure of a server provided in an embodiment of this application. Detailed Implementation
[0058] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.
[0059] To facilitate understanding, several terms used in the embodiments of this application will first be explained:
[0060] Unity (game engine): refers to a cross-platform 2D (2-Dimensional) / 3D (3-Dimensional) game engine.
[0061] Game Level (single game): refers to the specific time and space that carries the core gameplay of a game and forms an independent logical closed loop experience, such as a level or a dungeon.
[0062] room: is a logical concept that refers to a game server container for a single game session.
[0063] Building: is a logical concept that includes multiple rooms.
[0064] DS (Dedicated Server): A dedicated server for a single game session. It is developed using the Unity engine, shares some code with the client for that single game session, and is responsible for allocating and managing rooms.
[0065] Multi-room DS: One DS serves multiple rooms (i.e., one building).
[0066] DSA (Dedicated Server Agent): A management module deployed on the same machine as DS, responsible for scheduling DS.
[0067] Game Server: Responsible for handling object requests and managing object data.
[0068] Figure 1 This is a schematic diagram of the implementation environment of a game management method provided in an embodiment of this application, such as... Figure 1 As shown, the implementation environment includes: electronic device 101.
[0069] The electronic device 101 can be a terminal or a server, and this application embodiment does not limit it in this way. The electronic device 101 is used to execute the game management method provided in this application embodiment.
[0070] The terminal can be at least one of a smartphone, game console, desktop computer, tablet computer, e-book reader, MP3 (Moving Picture Experts Group Audio Layer III) player, MP4 (Moving Picture Experts Group Audio Layer IV) player, and laptop computer.
[0071] A terminal can refer to one of multiple terminals; this embodiment uses only one terminal as an example. Those skilled in the art will understand that the number of terminals can be more or less. For example, there may be only one terminal, or there may be dozens or hundreds, or even more. This application embodiment does not limit the number or type of terminals.
[0072] The server can be a single server, a server cluster consisting of multiple servers, or any of the following: a cloud computing platform or a virtualization center. This application embodiment does not limit this. The server and the terminal communicate via a wired or wireless network. The server has data receiving, data processing, and data sending functions. Of course, the server may also have other functions, which are not limited in this application embodiment.
[0073] Those skilled in the art should understand that the above-described terminals and servers are merely examples, and other existing or future terminals and servers that are applicable to this application should also be included within the scope of protection of this application, and are hereby incorporated by reference.
[0074] Based on the above implementation environment, this application provides a game management method to... Figure 2 The flowchart shown in this embodiment of the application illustrates a game management method. This method can be implemented by... Figure 1 The operation is performed by electronic device 101, and the explanation will be based on the example of server 101. Figure 2 As shown, the method includes the following steps:
[0075] In step 201, multiple game requests sent by multiple objects are obtained. These game requests are used to request to play the target game.
[0076] In the exemplary embodiments of this application, each of the terminals corresponding to multiple objects has a game client installed and running, capable of running the target game. The target game is an online game developed using the Unity engine and employing the DS architecture. The target game can be any type of game, and this embodiment of the application does not limit it. Exemplarily, the target game includes, but is not limited to, first-person shooter (FPS), shooting game (STG), action role-playing game (ARPG), and massively multiplayer online role-playing game (MMORPG).
[0077] In one possible implementation, multiple objects enter the target game's game interface by selecting the target game's game client. The game interface displays controls indicating whether to start the target game. For example, this control could be a game start control. In response to an object's selection of the game start control, the corresponding terminal receives the selection instruction and sends a game request to the server. The server receives the game request from the corresponding terminal, which is used to request to start the target game.
[0078] Optionally, the server can receive game requests from various objects at any time. The target game can be a team-based game or a free-to-play game. When the target game is a free-to-play game, the server receives a game request and processes it. When the target game is a team-based game, since multiple objects need to play simultaneously in a game room, the server can process multiple game requests received within a target time period in parallel to achieve the goal of multiple objects playing simultaneously in a game room.
[0079] The target time period can be set based on experience, adjusted according to the implementation environment, or adjusted according to the game type; this embodiment does not limit this. For example, the target time period can be any time period on any date. The duration of the target time period is also not limited in this embodiment. For example, the duration of the target time period is 1 minute.
[0080] It should be noted that the shorter the target time period, the fewer game requests the server receives, and relatively speaking, the faster the server processes game requests.
[0081] In step 202, based on multiple game requests, multiple objects are grouped to obtain at least one object group, and an object group includes at least one object.
[0082] The number of objects included in each object group is the number of objects required to play one round of the target game. For example, if 10 objects are required to play one round of the target game, then each object group includes 10 objects.
[0083] Optionally, the game request carries an object identifier. The process of grouping multiple objects based on multiple game requests to obtain at least one object group includes: obtaining object information for multiple objects based on the object identifiers carried in each of the multiple game requests; and grouping the multiple objects based on the object information to obtain at least one object group.
[0084] For example, the object information includes at least one of the following: the object's game level in the target game, the object's location, and the object's network latency. The process of grouping multiple objects based on their object information to obtain at least one object group includes: determining object scores for each object based on their object information and corresponding information weights; these object scores indicate the compatibility of the object with the target game. The multiple objects are then grouped according to their respective object scores to obtain at least one object group.
[0085] The information weights corresponding to the object information are set by the developers of the target game and can be adjusted at any time. This application embodiment does not limit this.
[0086] The process of determining the object score for each object is similar. This embodiment of the application only uses the process of determining the object score for a single target object as an example for illustration. The process includes: obtaining the object information of the target object; determining the information score corresponding to the object information based on the object information and the information weight corresponding to the object information; and using the sum of the information scores corresponding to each object information as the object score corresponding to the target object.
[0087] For example, taking the target object's object information, including the target object's game level in the target game, the target object's location, and the target object's network latency, after obtaining the target object's object information, the information weight corresponding to each object information is determined, and then based on the target object's object information and the information weight corresponding to each object information, the object score corresponding to the target object is determined according to the following formula (1).
[0088] S=A*α+B*β+C*γ (1)
[0089] In the above formula (1), S is the object score corresponding to the target object, A is the game level of the target object in the target game, α is the information weight corresponding to the game level in the target game; B is the region where the target object is located, β is the information weight corresponding to the region; C is the network latency of the target object, and γ is the information weight corresponding to the network latency.
[0090] Optionally, after determining the object score for each object, the multiple objects are grouped based on their respective object scores to obtain at least one object group. This embodiment of the application does not limit the method of grouping multiple objects into at least one object group. For example, objects whose object scores fall between a first score and a second score are grouped into one object group. The first score is less than the second score. The first and second scores are set based on experience or adjusted according to the implementation environment; this embodiment of the application does not limit this. For example, the first score is 30 and the second score is 50.
[0091] Optionally, after grouping, if the number of objects in an object group exceeds the number of objects required for a game of the target game, the first excess number is determined, and the first few objects are removed from that object group. For example, based on the object scores corresponding to each object, the objects are sorted in descending order to obtain a list, and the first few objects from the end of the list are removed. Of course, the first few objects can also be randomly removed from the object group; this embodiment does not limit this approach. Alternatively, the number of objects required for a game of the target game can be selected from the object group.
[0092] For example, if 10 objects are needed for one game of the target game, after grouping, the resulting object group contains 11 objects. The object scores for these 11 objects are as follows: first object 20, second object 23, third object 24, fourth object 33, fifth object 31, sixth object 28, seventh object 32, eighth object 26, ninth object 29, tenth object 30, and eleventh object 21. Therefore, sorting these 11 objects by their object scores from highest to lowest yields the following object list: fourth object, seventh object, fifth object, tenth object, ninth object, sixth object, eighth object, third object, second object, eleventh object, and first object. Since the first object has the lowest object score, it is removed, leaving the second to eleventh objects as a single object group.
[0093] In step 203, a target dedicated server corresponding to the target object group in at least one object group is determined. The target dedicated server includes the resources required to play the target game. The target dedicated server manages multiple game rooms, and the multiple game rooms can share the resources required to play the target game.
[0094] In one possible implementation, the target object group is any one of at least one object group. The process of determining the target dedicated server corresponding to the target object group includes: determining the target dedicated server management device corresponding to the target object group; the target dedicated server management device manages multiple dedicated servers, each dedicated server including the resources required for the target game; and determining the target dedicated server corresponding to the target object group from among the multiple dedicated servers. The dedicated server management device is a dedicated server management module.
[0095] Optionally, the server management includes multiple dedicated server management devices. The process of determining the target dedicated server management device corresponding to the target object group includes: obtaining device information corresponding to each of the multiple dedicated server management devices; determining the load rate corresponding to each of the multiple dedicated server management devices based on the device information; and selecting the dedicated server management device whose load rate meets the first load requirement as the target dedicated server management device corresponding to the target object group. The load rate meeting the first load requirement can be the lowest load rate or other requirements, such as a load rate below a threshold. This embodiment of the application does not limit this requirement.
[0096] For example, the device information includes the number of first servers and the number of second servers. The first server count refers to the number of dedicated servers managed by the dedicated server management device, and the second server count refers to the number of dedicated servers managed by the dedicated server management device that are fully occupied. A fully occupied dedicated server is a game room managed by a dedicated server where no room status meets the status requirements. Optionally, room status includes two types: occupied and unoccupied. A room status meeting the status requirements means the room status is unoccupied.
[0097] The process for determining the load rate for each dedicated server management device is similar. For any dedicated server management device among multiple dedicated server management devices, the process for determining the load rate for any dedicated server management device includes: taking the quotient between the number of second servers and the number of first servers corresponding to any dedicated server management device as the load rate for that dedicated server management device.
[0098] For example, the device information of any dedicated server management device is as follows: the number of first servers is 10 and the number of second servers is 2. Therefore, the load rate corresponding to any dedicated server management device is determined to be 20%.
[0099] It should be noted that the process of determining the load rate of other dedicated server management devices among multiple dedicated server management devices is the same as the process of determining the load rate of any one of the dedicated server management devices mentioned above, and this application embodiment does not limit this process.
[0100] It should also be noted that other methods can be chosen to determine the target dedicated server management device corresponding to the target object group among multiple dedicated server management devices, and this application embodiment does not limit this. For example, any one of the multiple dedicated server management devices is taken as the target dedicated server management device corresponding to the target object group. As another example, at least one candidate dedicated server management device is determined among the multiple dedicated server management devices. A candidate dedicated server management device refers to a dedicated server management device whose room status meets the status requirements within the game room managed by the dedicated server management device. Any one of the at least one candidate dedicated server management device is taken as the target dedicated server management device corresponding to the target object group.
[0101] In one possible implementation, after identifying the target dedicated server management device, since the target dedicated server management device manages multiple dedicated servers, it is necessary to determine the target dedicated server corresponding to the target object group from among the multiple dedicated servers. This determination process includes: obtaining server information corresponding to each of the multiple dedicated servers; determining the load rate corresponding to each of the multiple dedicated servers based on the server information; and selecting the dedicated server whose load rate meets a second load requirement as the target dedicated server corresponding to the target object group. For example, meeting the second load requirement means that the load rate is the lowest or below a threshold.
[0102] The server information includes the number of first rooms and the number of second rooms. The number of first rooms refers to the number of game rooms managed by the dedicated server, and the number of second rooms refers to the number of game rooms managed by the dedicated server whose status does not meet the requirements. The process for determining the load rate for each dedicated server is similar. For any given dedicated server among multiple dedicated servers, the process for determining the load rate for that dedicated server includes: taking the quotient between the number of second rooms and the number of first rooms for that dedicated server as the load rate for that dedicated server.
[0103] For example, the server information of any dedicated server is: the number of first rooms is 10 and the number of second rooms is 4. Therefore, the load rate corresponding to any dedicated server is determined to be 40%.
[0104] It should be noted that the process of determining the load rate of other dedicated servers among multiple dedicated servers is the same as the process of determining the load rate of any one of the dedicated servers mentioned above, and this application embodiment does not limit this process.
[0105] It should also be noted that other methods can be chosen to determine the target dedicated server corresponding to the target object group among multiple dedicated servers, and this application embodiment does not limit this. For example, any one of the multiple dedicated servers can be used as the target dedicated server corresponding to the target object group. As another example, at least one candidate dedicated server can be determined among the multiple dedicated servers. A candidate dedicated server refers to a dedicated server whose room status meets the status requirements within the game room managed by the dedicated server. Any one of the at least one candidate dedicated server can be used as the target dedicated server corresponding to the target object group.
[0106] Optionally, the target dedicated server manages multiple game rooms. The target dedicated server includes the resources required for playing the target game, and multiple game rooms can share these resources. For example... Figure 3 The diagram shown is an architecture diagram of a target dedicated server provided in an embodiment of this application. The code shared by the target dedicated server and the game client is GameCore (game kernel). GameCore includes game logic such as levels, physics, and combat, as well as underlying systems such as object pools, resources, and networks. The target dedicated server extracts the object pools, resources, and network systems from GameCore so that multiple game rooms managed by the target dedicated server can share the same engine, object pool, resources, and network.
[0107] For example, the following describes the process of modifying the Unity engine code when using a dedicated server provided in the embodiments of this application to manage multiple game rooms.
[0108] Game scenes and physical scenes are isolated. Based on some new features provided by the Uinty engine, multiple game scenes can be run within a single game process using the SceneManager function, and multiple parallel, isolated physical scenes can be created using the Physics Scene system. In this embodiment, the logic layer's Room, the engine layer's Scene, and the Physics Scene are bound together to construct a dedicated server capable of running multiple game rooms simultaneously without interference. That is, this embodiment constructs multiple game rooms, each including an engine layer Scene and a Physics Scene; multiple rooms can run simultaneously without affecting each other. Figure 4The diagram shown is an architecture diagram of a dedicated server provided in an embodiment of this application. The dedicated server manages multiple game rooms, each game room including a scene, a physical scene, and a game kernel.
[0109] The physics interfaces are completely replaced. The default physics interfaces of the Unity engine are not applicable to newly created physics scenes. Therefore, the physics interface calls in this embodiment need to be completely replaced with calls to the physics interfaces of the physics scene under the room.
[0110] Disable the default physics simulation switch. Turn off the default physics engine by setting Physics Auto Simulation = false (Automatic Physics Simulation = No). Simultaneously, manually control the physics simulation for each game room's Physics Scene.
[0111] Remove singletons (a configuration pattern). The original GameCore architecture had many singletons, most of which will no longer be used in the solution of managing multiple game rooms on a dedicated server. Therefore, it is necessary to transform all the original singletons into non-singleton management and consolidate them all under Room for unified management.
[0112] The system consolidates the Game Object allocation entry points. Since multiple game rooms are defined, each Game Object instantiated must specify its assigned game room. To unify code logic, various types of nodes are created within the scene, and creation entry points are constructed for each type of Game Object. Ultimately, the scene manager moves the Game Object to a specific scene and assigns it to its designated game room. These node types include, but are not limited to: Server Root, AI Root, Actor Root, Bullet Root, Level Root, Flow Root, and uLink Root.
[0113] Rooms are cached in the Mono Behaviour base class. Since singletons have been removed, MonoBehaviour scripts cannot find individual Managers through singletons. Instead, they query the DS Manager to find the Room that matches their Game Object's Scene and cache it. This application encapsulates the query and caching process in a base class, which is inherited by all Mono Behaviours in the project.
[0114] Inter-module calls. Each system module (level, physics, combat, etc.) in Game Core has its lifecycle managed by Room, and each module records its reference in the game room upon creation. Cross-module access can only be achieved through Room. For example, if the level module in Room1 wants to communicate with the physics module in Room1, the level module in Room1 must first communicate with Room1 to determine the physics module within Room1, and then communicate with the physics module in Room1.
[0115] Global events are prohibited. To prevent events sent from one game room from affecting the logic of other game rooms, sending and receiving global events (such as the game start event) is prohibited within a single game. Events should be registered and sent using the event manager within the game.
[0116] Static variable modification. All static variables used in the game room (in the code syntax) should be changed to constants or general variables as much as possible to avoid cross-influence.
[0117] Code inspection. To prevent game developers from misusing singletons, global events, and static variables, inspectors are set up in the code and inspection tools are developed.
[0118] Dedicated server public area. Apart from each game room having its own scene, the Don't Destroy OnLoad scene is designated as a dedicated server public area for storing some managers and object pools.
[0119] Network layer isolation. Using the concept of Groups in the network layer, each Group corresponds to the communication of a game room. Figure 5 The diagram shown is a schematic representation of a network layer sending and receiving messages according to game rooms, provided in an embodiment of this application. Figure 5 In the 501 error message, when a dedicated server sends a message to a game room, it adds a GroupID to the message and sends it via a Socket to the game room corresponding to the GroupID. Figure 5 In the 502 error, when a game room sends a message to a dedicated server, it adds a GroupID to the message and sends it to the dedicated server via a Socket so that the dedicated server knows which game room sent the message.
[0120] Log segmentation. Each game room keeps its own log, with the game room number marked in the log header. All game rooms on the dedicated server share a single log file, but each log entry uses a uniform format. The format is: [Time-Frame Number][Level][Game Room Number][Module]:[Content].
[0121] The client acts as a dedicated server for managing a single room. Since the client can only run one game at a time, to maintain the consistency of the Game Core code, the client is made into a dedicated server for a single room, and a ClientRoom Manager singleton is created to directly retrieve the first game room in the dedicated server for easy access by external systems.
[0122] Room updates. A dedicated server drives all room updates every tick (refresh time), with internal room genomics performing physical and logical updates. For example... Figure 6 The diagram illustrates a game room update process according to an embodiment of this application. At each refresh interval, a dedicated server sequentially refreshes each game room, and the refresh process for each game room is similar. The refresh content includes, but is not limited to: the Physics Scene, Level Process, Chunk Manager, and Bullet Manager.
[0123] Game room allocation and reclamation. After receiving instructions from the dedicated server management device, the dedicated server allocates and reclaims each game room, resetting the room status to support reuse.
[0124] Performance optimization. All resources are preloaded and objects are pre-instantiated when the dedicated server starts, avoiding runtime GC (garbage collection) and Alloc (memory allocation). Jobs are managed on the dedicated server, unnecessary threads are blocked, and system calls are reduced.
[0125] Exception handling. The overall logic of a single game room is outsourced to Try / Catch (an exception protection mechanism) to prevent an exception in a single game room from affecting the entire dedicated server. When the cumulative number of exceptions in a single game room exceeds the limit, the game room is forced offline. Frame state is recorded to support recovery from interruptions. Frame state can be recorded using shared memory or by sending it to the server. The server can be the dedicated server belonging to the game room, or it can be a dedicated server management device belonging to the dedicated server of the game room.
[0126] It should be noted that the process of determining the target dedicated server corresponding to other object groups in at least one object group is similar to the process of determining the target dedicated server corresponding to the target object group described above, and will not be described in detail in this embodiment.
[0127] In step 204, the target room corresponding to the target object group is determined among multiple game rooms.
[0128] In one possible implementation, the process of determining the target room corresponding to the target object group among multiple game rooms includes: determining the room states of multiple game rooms; selecting game rooms whose room states meet the state requirements as candidate rooms; and determining the target room corresponding to the target object group based on the candidate rooms. For example, one room is randomly selected from the candidate rooms as the target room corresponding to the target object group.
[0129] For example, the target dedicated server manages 5 game rooms. Game room 1 is occupied, game room 2 is unoccupied, game room 3 is occupied, game room 4 is unoccupied, and game room 5 is unoccupied. Therefore, the candidate rooms are determined to be game room 2, game room 4, and game room 5. Among game room 2, game room 4, and game room 5, game room 2 is determined as the target room corresponding to the target object group.
[0130] In step 205, a room identifier for the target room is sent to the terminal corresponding to the object included in the target object group. The room identifier is used by the object included in the target object group to enter the target room and play the target game by using the resources required to play the target game.
[0131] In one possible implementation, the server can send a room identifier for the target room to the terminal corresponding to the object in the target object group. This allows the terminal to receive the room identifier and thus allow the objects in the target object group to enter the target room. Once the objects in the target object group enter the target room, since the target room is a game room managed by a dedicated target server, the target room can use the resources required by the dedicated target server to play the target game.
[0132] Optionally, after sending the room identifier of the target room to the objects included in the target object group, the room status of the target room can also be adjusted. For example, the room status of the target room can be adjusted to be occupied.
[0133] Once the objects in the target object group enter the target room, they need to use the resources required to play the target game. The server can also receive resource usage requests from any object in the target room, which carry the resource identifier of the resource to be used and the initial number of resources. Based on the resource identifier and the initial number of resources, the server allocates the initial number of resources to any object.
[0134] Since the target dedicated server manages multiple game rooms, and these game rooms share the resources required for playing the target game, after receiving a resource usage request, the server needs to determine whether the current number of available resources on the target dedicated server meets the usage needs of any object, and then allocate the required resources to any object.
[0135] Optionally, a second number of resources is determined based on the resource identifier of the resource to be used. The second number of resources is the current available number of resources in the target dedicated server. If the second number of resources is not less than the first number of resources, it indicates that the current available number of resources in the target dedicated server meets the usage requirements of any object. Therefore, the first number of resources is allocated to any object.
[0136] For example, the number of second resources is 50 and the number of first resources is 30. Since the number of second resources is not less than the number of first resources, 30 resources are allocated to any object.
[0137] If the number of second resources is less than the number of first resources, it indicates that the current available number of resources on the target dedicated server does not meet the needs of any object. Therefore, the current available number of resources on the target dedicated server needs to be adjusted to meet the needs of any object. This adjustment process includes: determining a third number of resources based on the first and second resource counts, where the third number of resources is the difference between the first and second resource counts; obtaining the resource code corresponding to the required resource based on its resource identifier; and generating a third number of required resources based on the resource code and the third resource count. Finally, allocating the second number of required resources and the third number of required resources to any object.
[0138] For example, the number of second resources is 20 and the number of first resources is 30. Since the number of second resources is less than the number of first resources, that is, the current number of available resources in the target dedicated server does not meet the usage needs of any object. Therefore, based on the resource code of the resources to be used, 10 resources to be used are generated, and these 10 resources to be used and the original 20 resources to be used in the target dedicated server are allocated to any object.
[0139] In one possible implementation, after allocating a first number of required resources to any object, the current available number of required resources can be adjusted. This adjustment process involves adjusting the current available number of required resources in the target dedicated server to a fourth resource value, where the fourth resource value is the difference between the second and first resource counts.
[0140] For example, the number of second resources is 50 and the number of first resources is 30. After allocating 30 resources to any object, the current number of available resources in the target dedicated server is adjusted to 20.
[0141] Optionally, after allocating a second number of required resources and a third number of required resources to any object, the current available number of required resources in the target dedicated server is adjusted to 0.
[0142] After allocating a first number of resources to any object, once the object has finished using the resources, it can send a resource usage completion instruction to the server. The server receives the resource usage completion instruction from any object. Based on the resource usage completion instruction, the current available number of resources in the target dedicated server is adjusted to a second number of resources.
[0143] For example, after receiving a resource usage completion instruction from any object, the server adjusts the current number of available resources in the target dedicated server to 50.
[0144] In the above method, a dedicated server manages multiple game rooms, and these game rooms can share the resources required for gameplay on the dedicated server, resulting in a high resource reuse rate. Furthermore, since a single dedicated server can manage multiple game rooms simultaneously, its load capacity is increased. Moreover, because multiple rooms can share the resources required for gameplay on the dedicated server, these resources only need to be started once, eliminating the need for repeated starts and thus reducing the dedicated server's memory consumption.
[0145] Figure 7 The diagram shown is a flowchart of a game management method provided in an embodiment of this application. Figure 7In this process, multiple objects request matchmaking to start a game on their respective game clients. These requests are reported to the game server by the terminals corresponding to the objects. Upon receiving matchmaking requests from multiple objects within the same time period, the game server first groups the objects according to matching rules. Based on load balancing and other scheduling strategies, a suitable dedicated server management device (i.e., the target dedicated server management device) is assigned to each group of objects on the server. A suitable dedicated server (i.e., the target dedicated server) is then selected from among the multiple dedicated servers managed by the target dedicated server management device. Finally, a suitable game room is allocated to the group of objects from among the multiple game rooms managed by the target dedicated server. The group of objects then establishes a connection with the game room and begins playing the game.
[0146] Figure 8 The figure shown is a performance consumption curve of a dedicated server provided in an embodiment of this application. Figure 8 (1) shows the memory consumption curve and CPU consumption curve of the dedicated server when managing ten game rooms. Figure 8 (2) shows the memory consumption curve and CPU consumption curve of the dedicated server when managing a game room.
[0147] Depend on Figure 8 From (1), it can be seen that when the dedicated server manages ten game rooms, the CPU (Central Processing Unit) consumption of the dedicated server is 83.26%, and the memory consumption is 1.221-1.025=0.196GB (Gigabyte). Therefore, it can be determined that the CPU consumption of the dedicated server managing one game room is 83.26%÷10=8.326%, and the memory consumption is 0.196÷10=0.0196GB. Figure 8 From (2), we know that when a dedicated server manages one game room, its CPU consumption is 7.58%, and its memory consumption is 1.081 - 1.017 = 0.064 GB. Therefore, we can determine that when a dedicated server manages ten game rooms, the average CPU consumption per game room is close to that when managing one game room. However, when a dedicated server manages ten game rooms, the average memory consumption per game room is 30% of that when managing one game room. Therefore, when a dedicated server manages multiple game rooms, the memory consumption per game room is lower than that when managing one game room.
[0148] Figure 9 The diagram shown is a structural schematic of a game management device provided in an embodiment of this application. Figure 9 As shown, the device includes:
[0149] The acquisition module 901 is used to acquire multiple game requests sent by multiple objects. The game requests are used to request to play the target game.
[0150] Grouping module 902 is used to group multiple objects based on multiple game requests to obtain at least one object group, and an object group includes at least one object;
[0151] The determination module 903 is used to determine the target dedicated server corresponding to the target object group in at least one object group. The target dedicated server includes the resources required to play the target game. The target dedicated server manages multiple game rooms, and the multiple game rooms can share the resources required to play the target game.
[0152] The determination module 903 is also used to determine the target room corresponding to the target object group in multiple game rooms;
[0153] The sending module 904 is used to send the room identifier of the target room to the terminal corresponding to the object included in the target object group. The room identifier is used by the object included in the target object group to enter the target room and play the target game by using the resources required to play the target game.
[0154] In one possible implementation, the determining module 903 is used to determine the target dedicated server management device corresponding to the target object group in at least one object group, the target dedicated server management device managing multiple dedicated servers, each dedicated server including the resources required to perform the target game; and to determine the target dedicated server corresponding to the target object group among the multiple dedicated servers.
[0155] In one possible implementation, the determining module 903 is used to obtain device information corresponding to multiple dedicated server management devices respectively; determine the load rate corresponding to multiple dedicated server management devices respectively based on the device information corresponding to multiple dedicated server management devices respectively; and select the dedicated server management device whose load rate meets the first load requirement among the multiple dedicated server management devices as the target dedicated server management device corresponding to the target object group.
[0156] In one possible implementation, the device information includes the number of first servers and the number of second servers, wherein the number of first servers is the number of dedicated servers managed by the dedicated server management device, and the number of second servers is the number of dedicated servers that are fully occupied among the dedicated servers managed by the dedicated server management device. The dedicated servers that are fully occupied are game rooms in the game rooms managed by the dedicated server where there are no game rooms whose room status meets the status requirements.
[0157] The determination module 903 is used to determine the load rate of any dedicated server management device among multiple dedicated server management devices, by taking the quotient between the number of second servers and the number of first servers corresponding to any dedicated server management device.
[0158] In one possible implementation, the determining module 903 is used to obtain server information corresponding to multiple dedicated servers respectively; determine the load rate corresponding to multiple dedicated servers based on the server information corresponding to multiple dedicated servers respectively; and select the dedicated server whose load rate meets the second load requirement among the multiple dedicated servers as the target dedicated server corresponding to the target object group.
[0159] In one possible implementation, the server information includes the number of first rooms and the number of second rooms. The number of first rooms is the number of game rooms managed by the dedicated server, and the number of second rooms is the number of game rooms managed by the dedicated server whose room status does not meet the status requirements.
[0160] The determination module 903 is used to determine the load rate of any dedicated server among multiple dedicated servers by taking the quotient between the number of second rooms and the number of first rooms corresponding to any dedicated server.
[0161] In one possible implementation, the determining module 903 is used to determine the room status of multiple game rooms; select game rooms whose room status meets the status requirements as candidate rooms; and determine the target room corresponding to the target object group based on the candidate rooms.
[0162] In one possible implementation, the game request carries an object identifier;
[0163] Grouping module 902 is used to obtain object information of multiple objects based on the object identifiers carried in multiple game requests; and to group the multiple objects based on the object information to obtain at least one object group.
[0164] In one possible implementation, the object information includes at least one of the following: the object's game level in the target game, the region where the object is located, and the object's network latency.
[0165] The grouping module 902 is used to determine the object score corresponding to each of the multiple objects based on the object information and the information weight corresponding to the object information. The object score is used to indicate the fit between the object and the target game. The multiple objects are grouped according to the object scores corresponding to each of the multiple objects to obtain at least one object group.
[0166] In one possible implementation, the device further includes:
[0167] The receiving module is used to receive resource usage requests sent by any object in the target room. The resource usage request carries the resource identifier of the resource to be used and the first number of resources.
[0168] The allocation module is used to allocate the required resources to any object based on the resource identifier and the number of first resources.
[0169] In one possible implementation, the determining module 903 is used to determine the second number of resources based on the resource identifier of the resource to be used, wherein the second number of resources is the number of resources currently available in the target dedicated server.
[0170] The allocation module is used to allocate the required resources (number of the first resource) to any object in response to the second resource number being no less than the first resource number.
[0171] In one possible implementation, the determining module 903 is further configured to determine the third resource number based on the first resource number and the second resource number in response to the second resource number being less than the first resource number;
[0172] The acquisition module 901 is also used to obtain the resource code corresponding to the resource to be used based on the resource identifier of the resource to be used; and to generate the number of third resources to be used based on the resource code corresponding to the resource to be used and the number of third resources.
[0173] The allocation module is also used to allocate a second number of required resources and a third number of required resources to any object.
[0174] In one possible implementation, the device further includes:
[0175] The adjustment module is used to adjust the current number of available resources in the target dedicated server to the fourth resource number, which is the difference between the second resource number and the first resource number.
[0176] In one possible implementation, the receiving module is also configured to receive a resource usage completion instruction sent by any object;
[0177] The adjustment module is also used to adjust the current number of available resources in the target dedicated server to the second number of resources based on the resource usage completion instruction.
[0178] In the aforementioned device, a dedicated server manages multiple game rooms, and these game rooms can share the resources required for gameplay, resulting in a high resource reuse rate. Furthermore, since a single dedicated server can manage multiple game rooms simultaneously, its load capacity is increased. Moreover, because multiple rooms can share the resources required for gameplay, the dedicated server only needs to be started once, eliminating the need for repeated starts and thus reducing its memory consumption.
[0179] It should be understood that the above-described apparatus is only illustrated by the division of the functional modules described above when implementing its functions. In practical applications, the functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the apparatus and method embodiments provided in the above embodiments belong to the same concept, and their specific implementation process can be found in the method embodiments, which will not be repeated here.
[0180] Figure 10 A structural block diagram of a terminal 1000 provided in an exemplary embodiment of this application is shown. The terminal 1000 may be a portable mobile terminal, such as a smartphone, tablet computer, MP3 player (Moving Picture Experts Group Audio Layer III), MP4 player (Moving Picture Experts Group Audio Layer IV), laptop computer, or desktop computer. The terminal 1000 may also be referred to as a user device, portable terminal, laptop terminal, desktop terminal, or other names.
[0181] Typically, terminal 1000 includes a processor 1001 and a memory 1002.
[0182] Processor 1001 may include one or more processing cores, such as a quad-core processor, an octa-core processor, etc. Processor 1001 may be implemented using at least one hardware form selected from DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). Processor 1001 may also include a main processor and a coprocessor. The main processor, also known as a CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, processor 1001 may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content required to be displayed on the screen. In some embodiments, processor 1001 may also include an AI (Artificial Intelligence) processor, which is used to handle computational operations related to machine learning.
[0183] The memory 1002 may include one or more computer-readable storage media, which may be non-transitory. The memory 1002 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In some embodiments, the non-transitory computer-readable storage media in the memory 1002 are used to store at least one instruction, which is executed by the processor 1001 to implement the game management method provided in the method embodiments of this application.
[0184] In some embodiments, the terminal 1000 may also optionally include a peripheral device interface 1003 and at least one peripheral device. The processor 1001, memory 1002, and peripheral device interface 1003 can be connected via a bus or signal line. Each peripheral device can be connected to the peripheral device interface 1003 via a bus, signal line, or circuit board. Specifically, the peripheral device includes at least one of the following: a radio frequency circuit 1004, a display screen 1005, a camera assembly 1006, an audio circuit 1007, and a power supply 1009.
[0185] Peripheral device interface 1003 can be used to connect at least one I / O (Input / Output) related peripheral device to processor 1001 and memory 1002. In some embodiments, processor 1001, memory 1002 and peripheral device interface 1003 are integrated on the same chip or circuit board; in some other embodiments, any one or two of processor 1001, memory 1002 and peripheral device interface 1003 can be implemented on separate chips or circuit boards, which is not limited in this embodiment.
[0186] The radio frequency (RF) circuit 1004 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The RF circuit 1004 communicates with communication networks and other communication devices via electromagnetic signals. The RF circuit 1004 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals back into electrical signals. Optionally, the RF circuit 1004 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, etc. The RF circuit 1004 can communicate with other terminals via at least one wireless communication protocol. This wireless communication protocol includes, but is not limited to: the World Wide Web, metropolitan area networks, intranets, various generations of mobile communication networks (2G, 3G, 4G, and 5G), wireless local area networks, and / or WiFi (Wireless Fidelity) networks. In some embodiments, the RF circuit 1004 may also include circuitry related to NFC (Near Field Communication), which is not limited in this application.
[0187] Display screen 1005 is used to display a UI (User Interface). This UI may include graphics, text, icons, videos, and any combination thereof. When display screen 1005 is a touch display screen, it also has the ability to collect touch signals on or above its surface. These touch signals can be input as control signals to processor 1001 for processing. In this case, display screen 1005 can also be used to provide virtual buttons and / or a virtual keyboard, also known as soft buttons and / or a soft keyboard. In some embodiments, there may be one display screen 1005, disposed on the front panel of terminal 1000; in other embodiments, there may be at least two display screens, disposed on different surfaces of terminal 1000 or in a folded design; in still other embodiments, display screen 1005 may be a flexible display screen, disposed on a curved or folded surface of terminal 1000. Furthermore, display screen 1005 may be configured as a non-rectangular, irregular shape, i.e., a non-rectangular screen. The display screen 1005 can be made of materials such as LCD (Liquid Crystal Display) and OLED (Organic Light-Emitting Diode).
[0188] The camera assembly 1006 is used to acquire images or videos. Optionally, the camera assembly 1006 includes a front-facing camera and a rear-facing camera. Typically, the front-facing camera is located on the front panel of the terminal 1000, and the rear-facing camera is located on the back of the terminal 1000. In some embodiments, there are at least two rear-facing cameras, which are any one of a main camera, a depth-sensing camera, a wide-angle camera, and a telephoto camera, to achieve background blurring by fusion of the main camera and the depth-sensing camera, panoramic shooting by fusion of the main camera and the wide-angle camera, VR (Virtual Reality) shooting, or other fusion shooting functions. In some embodiments, the camera assembly 1006 may also include a flash. The flash can be a single-color temperature flash or a dual-color temperature flash. A dual-color temperature flash refers to a combination of a warm-light flash and a cool-light flash, which can be used for light compensation at different color temperatures.
[0189] The audio circuit 1007 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, converting the sound waves into electrical signals that are input to the processor 1001 for processing, or input to the radio frequency circuit 1004 for voice communication. For stereo sound acquisition or noise reduction purposes, multiple microphones may be used, each positioned at a different location on the terminal 1000. The microphone may also be an array microphone or an omnidirectional microphone. The speaker is used to convert electrical signals from the processor 1001 or the radio frequency circuit 1004 into sound waves. The speaker may be a conventional diaphragm speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can convert electrical signals not only into audible sound waves but also into inaudible sound waves for purposes such as distance measurement. In some embodiments, the audio circuit 1007 may also include a headphone jack.
[0190] Power supply 1009 is used to power the various components in terminal 1000. Power supply 1009 can be AC power, DC power, a disposable battery, or a rechargeable battery. When power supply 1009 includes a rechargeable battery, the rechargeable battery can be a wired rechargeable battery or a wireless rechargeable battery. A wired rechargeable battery is a battery that is charged via a wired line, and a wireless rechargeable battery is a battery that is charged via a wireless coil. The rechargeable battery can also be used to support fast charging technology.
[0191] In some embodiments, the terminal 1000 further includes one or more sensors 1010. The one or more sensors 1010 include, but are not limited to: an acceleration sensor 1011, a gyroscope sensor 1012, a pressure sensor 1013, an optical sensor 1015, and a proximity sensor 1016.
[0192] Accelerometer 1011 can detect the magnitude of acceleration along the three coordinate axes of a coordinate system established by terminal 1000. For example, accelerometer 1011 can be used to detect the components of gravitational acceleration along the three coordinate axes. Processor 1001 can control display screen 1005 to display the user interface in either a landscape or portrait view based on the gravitational acceleration signal acquired by accelerometer 1011. Accelerometer 1011 can also be used for games or for acquiring user motion data.
[0193] The gyroscope sensor 1012 can detect the orientation and rotation angle of the terminal 1000. The gyroscope sensor 1012, in conjunction with the accelerometer sensor 1011, can collect 3D motion data from the user on the terminal 1000. Based on the data collected by the gyroscope sensor 1012, the processor 1001 can perform the following functions: motion sensing (e.g., changing the UI based on the user's tilt), image stabilization during shooting, game control, and inertial navigation.
[0194] The pressure sensor 1013 can be disposed on the side bezel of the terminal 1000 and / or on the lower layer of the display screen 1005. When the pressure sensor 1013 is disposed on the side bezel of the terminal 1000, it can detect the user's grip signal on the terminal 1000, and the processor 1001 can perform left / right hand recognition or quick operation based on the grip signal collected by the pressure sensor 1013. When the pressure sensor 1013 is disposed on the lower layer of the display screen 1005, the processor 1001 can control the operable controls on the UI interface based on the user's pressure operation on the display screen 1005. The operable controls include at least one of button controls, scroll bar controls, icon controls, and menu controls.
[0195] An optical sensor 1015 is used to collect ambient light intensity. In one embodiment, the processor 1001 can control the display brightness of the display screen 1005 based on the ambient light intensity collected by the optical sensor 1015. Specifically, when the ambient light intensity is high, the display brightness of the display screen 1005 is increased; when the ambient light intensity is low, the display brightness of the display screen 1005 is decreased. In another embodiment, the processor 1001 can also dynamically adjust the shooting parameters of the camera assembly 1006 based on the ambient light intensity collected by the optical sensor 1015.
[0196] The proximity sensor 1016, also known as a distance sensor, is typically mounted on the front panel of the terminal 1000. The proximity sensor 1016 is used to detect the distance between the user and the front of the terminal 1000. In one embodiment, when the proximity sensor 1016 detects that the distance between the user and the front of the terminal 1000 is gradually decreasing, the processor 1001 controls the display screen 1005 to switch from a screen-on state to a screen-off state; when the proximity sensor 1016 detects that the distance between the user and the front of the terminal 1000 is gradually increasing, the processor 1001 controls the display screen 1005 to switch from a screen-off state to a screen-on state.
[0197] Those skilled in the art will understand that Figure 10 The structure shown does not constitute a limitation on terminal 1000 and may include more or fewer components than shown, or combine certain components, or use different component arrangements.
[0198] Figure 11This is a schematic diagram of the server structure provided in the embodiments of this application. The server 1100 can vary considerably due to different configurations or performance. It may include one or more Central Processing Units (CPUs) 1101 and one or more memories 1102. The one or more memories 1102 store at least one line of program code, which is loaded and executed by the one or more processors 1101 to implement the game management methods provided in the various method embodiments described above. Of course, the server 1100 may also have wired or wireless network interfaces, a keyboard, and input / output interfaces for input and output. The server 1100 may also include other components for implementing device functions, which will not be elaborated here.
[0199] In an exemplary embodiment, a computer-readable storage medium is also provided, which stores at least one piece of program code that is loaded and executed by a processor to enable a computer to implement any of the above-described game management methods.
[0200] Optionally, the aforementioned computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a compact disc read-only memory (CD-ROM), magnetic tape, floppy disk, and optical data storage device, etc.
[0201] In an exemplary embodiment, a computer program or computer program product is also provided, which stores at least one computer instruction that is loaded and executed by a processor to enable the computer to implement any of the above-described game management methods.
[0202] It should be noted that all information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.), and signals involved in this application have been authorized by the user or fully authorized by all parties, and the collection, use, and processing of related data must comply with the relevant laws, regulations, and standards of the relevant countries and regions. For example, the game requests and object information involved in this application were obtained with full authorization.
[0203] It should be understood that "multiple" as used in this article refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. The character " / " generally indicates that the preceding and following related objects have an "or" relationship.
[0204] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0205] The above description is merely an exemplary embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the principles of this application should be included within the protection scope of this application.
Claims
1. A game management method, characterized in that, The method includes: Retrieve multiple game requests sent by multiple objects, wherein the game requests are used to request to play the target game; Based on the multiple game requests, the multiple objects are grouped to obtain at least one object group, and an object group includes at least one object; Determine the target dedicated server management device corresponding to the target object group in the at least one object group. The target dedicated server management device manages multiple dedicated servers, and each dedicated server includes the resources required to perform the target game. The dedicated server whose load rate meets the second load requirement among the multiple dedicated servers is designated as the target dedicated server corresponding to the target object group; or, any one of the multiple dedicated servers is designated as the target dedicated server; or, any candidate dedicated server among the multiple dedicated servers is designated as the target dedicated server. The candidate dedicated server refers to a dedicated server in the managed game room whose room status meets the status requirement. The target dedicated server manages multiple game rooms, and the multiple game rooms share the resources required to play the target game. Determine the target room corresponding to the target object group among the plurality of game rooms; The room identifier of the target room is sent to the terminal corresponding to the object included in the target object group. The room identifier is used by the object included in the target object group to enter the target room and play the target game by using the resources required to play the target game.
2. The method according to claim 1, characterized in that, The step of determining the target dedicated server management device corresponding to the target object group in the at least one object group includes: Obtain device information corresponding to multiple dedicated server management devices; Based on the device information corresponding to the multiple dedicated server management devices, the load rate corresponding to each of the multiple dedicated server management devices is determined. The dedicated server management device whose load rate meets the first load requirement among the multiple dedicated server management devices is taken as the target dedicated server management device corresponding to the target object group.
3. The method according to claim 2, characterized in that, The device information includes a first number of servers and a second number of servers. The first number of servers is the number of dedicated servers managed by the dedicated server management device, and the second number of servers is the number of dedicated servers that are fully occupied among the dedicated servers managed by the dedicated server management device. The fully occupied dedicated servers are game rooms managed by the dedicated server that do not have a room status that meets the status requirements. The step of determining the load rate corresponding to each of the multiple dedicated server management devices based on the device information corresponding to each of the multiple dedicated server management devices includes: For any one of the plurality of dedicated server management devices, the quotient between the number of second servers and the number of first servers corresponding to the dedicated server management device is taken as the load rate corresponding to the dedicated server management device.
4. The method according to claim 1, characterized in that, The method further includes: Obtain the server information corresponding to each of the multiple dedicated servers; Based on the server information corresponding to the multiple dedicated servers, the load rate corresponding to each of the multiple dedicated servers is determined.
5. The method according to claim 4, characterized in that, The server information includes a first number of rooms and a second number of rooms. The first number of rooms is the number of game rooms managed by the dedicated server, and the second number of rooms is the number of game rooms managed by the dedicated server whose room status does not meet the status requirements. The step of determining the load rate of each of the multiple dedicated servers based on their respective server information includes: For any one of the plurality of dedicated servers, the quotient between the number of second rooms and the number of first rooms corresponding to that dedicated server is taken as the load rate corresponding to that dedicated server.
6. The method according to any one of claims 1 to 5, characterized in that, Determining the target room corresponding to the target object group among the multiple game rooms includes: Determine the room status of the multiple game rooms; The game rooms whose room status meets the status requirements are selected as candidate rooms. Based on the candidate rooms, the target room corresponding to the target object group is determined.
7. The method according to any one of claims 1 to 5, characterized in that, The game request carries an object identifier; The step of grouping the multiple objects based on the multiple game requests to obtain at least one object group includes: Based on the object identifiers carried in the multiple game requests, obtain the object information of the multiple objects; Based on the object information of the multiple objects, the multiple objects are grouped to obtain at least one object group.
8. The method according to claim 7, characterized in that, The object information includes at least one of the following: the object's game level in the target game, the object's location, and the object's network latency. The step of grouping the multiple objects based on their object information to obtain at least one object group includes: Based on the object information of the multiple objects and the information weights corresponding to the object information, the object scores corresponding to the multiple objects are determined respectively, and the object scores are used to indicate the compatibility of the objects with the target game; Based on the object scores corresponding to each of the multiple objects, the multiple objects are grouped to obtain at least one object group.
9. The method according to any one of claims 1 to 5, characterized in that, After sending the room identifier of the target room to the terminal corresponding to the object included in the target object group, the method further includes: Receive a resource usage request sent by any object in the target room, wherein the resource usage request carries the resource identifier of the resource to be used and the first number of resources; Based on the resource identifier of the resource to be used and the first resource number, allocate the first resource number of the required resources to any object.
10. The method according to claim 9, characterized in that, The step of allocating the required resources (number of resources) to any object based on the resource identifier and the first resource count includes: Based on the resource identifier of the resource to be used, a second resource number is determined, wherein the second resource number is the currently available number of the resource to be used in the target dedicated server; In response to the second number of resources being not less than the first number of resources, the first number of resources to be used are allocated to any one of the objects.
11. The method according to claim 10, characterized in that, The method further includes: In response to the fact that the number of the second resource is less than the number of the first resource, the number of the third resource is determined based on the number of the first resource and the number of the second resource; Based on the resource identifier of the resource to be used, obtain the resource code corresponding to the resource to be used; Based on the resource code corresponding to the resource to be used and the number of third resources, generate the number of third resources to be used; Allocate the second resource (number of required resources) and the third resource (number of required resources) to any of the objects.
12. The method according to claim 10, characterized in that, After allocating the first number of required resources to any of the objects, the method further includes: The number of currently available resources in the target dedicated server is adjusted to a fourth resource number, which is the difference between the second resource number and the first resource number.
13. The method according to claim 12, characterized in that, After adjusting the current available number of resources required in the target dedicated server to a fourth number of resources, the method further includes: Receive a resource usage completion instruction sent by any of the aforementioned objects; Based on the resource usage completion instruction, the current number of available resources in the target dedicated server is adjusted to the second number of resources.
14. A game management device, characterized in that, The device includes: The acquisition module is used to acquire multiple game requests sent by multiple objects, wherein the game requests are used to request to play the target game; The grouping module is used to group the multiple objects based on the multiple game requests to obtain at least one object group, and an object group includes at least one object; A determining module is configured to determine a target dedicated server management device corresponding to a target object group in the at least one object group. The target dedicated server management device manages multiple dedicated servers, each of which includes resources required for the target game. The module further defines a dedicated server among the multiple dedicated servers whose load rate meets a second load requirement as the target dedicated server corresponding to the target object group; or, any one of the multiple dedicated servers as the target dedicated server; or, any candidate dedicated server among the multiple dedicated servers as the target dedicated server. A candidate dedicated server refers to a dedicated server in a managed game room whose room status meets a status requirement. The target dedicated server manages multiple game rooms, and the multiple game rooms share the resources required for the target game. The determining module is further configured to determine the target room corresponding to the target object group among the plurality of game rooms; The sending module is used to send the room identifier of the target room to the terminal corresponding to the object included in the target object group. The room identifier is used by the object included in the target object group to enter the target room and play the target game by using the resources required to play the target game.
15. An electronic device, characterized in that, The electronic device includes a processor and a memory, the memory storing at least one piece of program code, which is loaded and executed by the processor to enable the electronic device to implement the game management method as described in any one of claims 1 to 13.
16. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores at least one piece of program code, which is loaded and executed by a processor to enable the computer to implement the game management method as described in any one of claims 1 to 13.
Citation Information
Patent Citations
Information processing program, information processing system, information processing device and information processing method
JP2021083997A