Virtual map partitioning method and apparatus, storage medium, and server
By obtaining the basic load score and location of virtual objects in the virtual map, the load weight coefficient is determined, which solves the problem of unbalanced process load, realizes load-balanced virtual map partitioning, and reduces process running pressure.
Patent Information
- Application Number
- CN202211735186.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-30
- Publication Date
- 2026-01-23
- Estimated Expiration
- 2042-12-30
AI Technical Summary
In existing technologies, due to the vast size of the game world, a single process cannot handle the entire scene, resulting in an unbalanced process load, causing the process with a larger load to experience greater operational pressure.
By obtaining the basic load score and location of each preset virtual object in the virtual map, its load weight coefficient is determined, and the virtual map is divided based on these scores and coefficients to achieve load balancing.
This avoids the problem of load imbalance between multiple processes, reduces the running pressure of processes with heavy loads, and achieves load-balanced virtual map partitioning.
Smart Images

Figure CN116474357B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computers, and specifically to a method, apparatus, computer-readable storage medium, and server for dividing a virtual map. Background Technology
[0002] In recent years, with the development and popularization of computer equipment technology, more and more large-scale games have emerged.
[0003] In existing technologies, due to the vast size of the game world, a single process cannot handle the entire scene. A single large game map is divided into multiple parts based on physical location and distributed among multiple processes to carry out its business logic. When players move in the game scene, it involves switching between server processes, which is imperceptible to client players, achieving a seamless experience.
[0004] In the process of researching and practicing the prior art, the inventors of this application discovered that when a process runs a large map portion of the prior art, the process load of each process is different, which will result in the process with a larger load running under greater pressure. Summary of the Invention
[0005] This application provides a method and apparatus for dividing a virtual map, which can avoid the problem of unbalanced load among multiple processes, thereby avoiding the situation where a process with a large load experiences high operating pressure.
[0006] To address the aforementioned technical problems, the embodiments of this application provide the following technical solutions:
[0007] A method for dividing a virtual map, comprising:
[0008] Obtain the basic load score of each preset virtual object in the virtual map and the virtual object position of each preset virtual object in the virtual map;
[0009] The load weight coefficient corresponding to each preset virtual object is determined based on the location of the virtual object.
[0010] The virtual map is divided based on the basic load score of each preset virtual object and the corresponding load weight coefficient.
[0011] A virtual map partitioning device, characterized in that it comprises:
[0012] The acquisition module is used to acquire the basic load score of each preset virtual object in the virtual map and the virtual object position of each preset virtual object in the virtual map;
[0013] The first determining module is used to determine the load weight coefficient corresponding to each preset virtual object based on the position of the virtual object.
[0014] The segmentation module is used to segment the virtual map based on the basic load score of each preset virtual object and the corresponding load weight coefficient.
[0015] A computer-readable storage medium storing a plurality of instructions adapted for loading by a processor to perform the steps in the virtual map partitioning method described above.
[0016] A server includes a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that the processor executes the program to implement the steps in the virtual map partitioning method described above.
[0017] This application embodiment obtains the basic load score and the virtual object position of each preset virtual object in the virtual map; determines the load weight coefficient corresponding to each preset virtual object based on the virtual object position; and divides the virtual map based on the basic load score and the corresponding load weight coefficient of each preset virtual object. In this way, by estimating the basic load score and corresponding load weight coefficient of each preset virtual object, the load of each location in the virtual map is determined, thereby performing load-balanced division of the virtual map. This avoids the problem of load imbalance among multiple processes, and thus prevents processes with high loads from experiencing excessive operating pressure. Attached Figure Description
[0018] 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.
[0019] Figure 1a This is a system schematic diagram of the virtual map division method provided in the embodiments of this application.
[0020] Figure 1b This is a flowchart illustrating the method for dividing a virtual map according to an embodiment of this application.
[0021] Figure 2 A schematic diagram of the structure of the virtual map segmentation device provided in the embodiments of this application;
[0022] Figure 3 This is a schematic diagram of the server structure provided in an embodiment of this application. Detailed Implementation
[0023] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.
[0024] Please see Figure 1a , Figure 1a This is a system schematic diagram of the virtual map division method provided in this application embodiment. The system may include at least one terminal device 1000, at least one server 2000, at least one database 3000, and a network 4000. The terminal device 1000 can be a computer device such as a mobile phone, computer, or personal digital assistant. The server 2000 and the terminal device 1000 can establish a connection through the network 4000. The server 2000 is used to synchronize other virtual players and virtual scene images in the game to the terminal device 1000 in real time. The network 4000 can be a wireless network or a wired network, such as a wireless local area network (WLAN), local area network (LAN), cellular network, 2G network, 3G network, 4G network, 5G network, etc. Additionally, the system may include the database 3000, which can be used to store game player account information and virtual character information under the account.
[0025] This application provides a method for dividing a virtual map, which can be executed by a server. For example... Figure 1a As shown, server 2000 obtains the basic load score of each preset virtual object in the virtual map and the virtual object position of each preset virtual object in the virtual map; determines the load weight coefficient corresponding to each preset virtual object according to the virtual object position; and divides the virtual map based on the basic load score of each preset virtual object and the corresponding load weight coefficient.
[0026] It should be noted that, Figure 1a The schematic diagram of the virtual map division system shown is merely an example. The virtual map division system and scenarios described in this application embodiment are for the purpose of more clearly illustrating the technical solutions of this application embodiment and do not constitute a limitation on the technical solutions provided in this application embodiment. As those skilled in the art will know, with the evolution of the virtual map division system and the emergence of new business scenarios, the technical solutions provided in this application embodiment are also applicable to similar technical problems.
[0027] In this embodiment, the description will be from the perspective of a virtual map partitioning device, which can be integrated into a server that has storage units and is equipped with a microprocessor and has computing capabilities.
[0028] Please see Figure 1b , Figure 1b A flowchart illustrating the virtual map partitioning method provided in this application embodiment. The virtual map partitioning method includes:
[0029] In step 101, the basic load score of each preset virtual object in the virtual map and the virtual object position of each preset virtual object in the virtual map are obtained.
[0030] The preset virtual objects are virtual AI objects pre-placed in the virtual map, such as virtual AI monsters and virtual NPCs at the spawn point. Each preset virtual object has a pre-defined location in the virtual map; this location is the virtual object's position. The basic load score refers to the load score of a single preset virtual object under single-process conditions.
[0031] In some implementations, the preset virtual object includes a first preset virtual object located within a designated area of the virtual map, and a variety of second preset virtual objects located in the virtual map outside the designated area;
[0032] Before the step of obtaining the basic load score of each preset virtual object in the virtual map, the method further includes:
[0033] (1) Determine the first maximum number of runs that the first preset virtual object can run in a single process, and determine the minimum number of game players required to activate the first preset virtual object with the first maximum number of runs.
[0034] (2) Determine the basic load score of the first preset virtual object based on the first maximum number of running objects and the minimum number of game players;
[0035] (3) Determine the second maximum number of times each of the second preset virtual objects can run in a single process;
[0036] (4) Based on the second maximum number of runs, determine the load weight coefficient of each of the second preset virtual objects to obtain the basic load score of each preset virtual object.
[0037] Since the preset virtual objects include virtual NPCs (first preset virtual objects) located at the spawn point and virtual AI monsters (second preset virtual objects), different load assessment methods need to be adopted for different preset virtual objects.
[0038] Specifically, for virtual NPCs (the first preset virtual object), it is necessary to estimate the maximum number of virtual NPCs that a single process can support and the minimum number of players required to activate an NPC as a reference, assigning a basic load score to each NPC object. For example: if the full load is 1.0, one process can support 200 NPCs, and activating 200 NPCs requires a minimum of 5 players, then the first maximum running number is 200, and the minimum number of players is 5. Based on the first maximum running number and the minimum number of players, the basic load score of the first preset virtual object is determined.
[0039] For virtual AI monsters (the second preset virtual objects), since there are different types of virtual AI monsters, a load assessment needs to be performed for each type. For each type of virtual AI monster, the maximum number of virtual AI monsters that a single process can support needs to be estimated as a reference to assign a basic load score to each virtual AI monster. For example, if the full load is 1.0, and one process can support 200 virtual AI monsters, then the second maximum number of running virtual AI monsters is 200. Based on the second maximum number of running virtual AI monsters, the basic load score for each type of the second preset virtual object is determined, thus obtaining the basic load score for each preset virtual object.
[0040] In some implementations, the step of determining the basic load score of the first preset virtual object based on the first maximum number of runs and the minimum number of game players includes:
[0041] (1.1) Calculate the product of the first maximum number of runs and the minimum number of game players to obtain the first calculation result;
[0042] (1.2) Calculate the ratio of the full load value of a single process to the first calculation result to obtain the basic load score of the first preset virtual object;
[0043] The step of determining the load weight coefficient for each of the second preset virtual objects based on the second maximum number of runs includes:
[0044] Calculate the ratio of the full load value of a single process to the second maximum number of running processes to obtain the basic load score for each of the second preset virtual objects.
[0045] The method for evaluating the basic load score of the first preset virtual object can be as follows: calculate the product of the first maximum number of running virtual objects and the minimum number of game players to obtain a first calculation result; calculate the ratio of the full load value of a single process to the first calculation result to obtain the basic load score of the first preset virtual object. For example: if the full load of a single process is 1.0, one process can support 200 virtual NPCs, and activating 200 virtual NPCs requires a minimum of 5 players, then the basic load score of each virtual NPC can be considered as: 1.0 / (200*5) = 0.001.
[0046] The basic load score of the second preset virtual object can be evaluated by calculating the ratio of the full load value of a single process to the second maximum number of running virtual objects, thus obtaining the basic load score of each type of the second preset virtual object. For example, if the full load of a process is 1.0, and a certain type of virtual AI monster can run a maximum of 200 processes, then the basic load score of that type of virtual AI monster is 1 / 200 = 0.005.
[0047] In step 102, the load weight coefficient corresponding to each preset virtual object is determined based on the location of the virtual object.
[0048] In this regard, considering that game players may activate virtual AI monsters when controlling the corresponding virtual characters to move, which may increase the process load, the load weight coefficient corresponding to each preset virtual object will be determined according to the position of the virtual object.
[0049] In some implementations, the step of determining the load weight coefficient corresponding to each preset virtual object based on the virtual object's location includes:
[0050] (1) Obtain the location of game players within a historical time period;
[0051] (2) Determine the influence range of each player with the position of each player as the center and the first preset distance as the radius;
[0052] (3) Determine the first target virtual object whose virtual object location is within the influence range of the game player;
[0053] (4) Obtain the first influence distance from each of the first target virtual objects to its corresponding game player position;
[0054] (5) Calculate the ratio of the specified distance value to the first influence distance to obtain the second calculation result;
[0055] (6) Calculate the sum of the second calculation result and 1 to obtain the load weight coefficient corresponding to each of the first target virtual objects.
[0056] Among them, obtaining the location of game players within a historical time period can be divided into two types depending on the game's operational status: for games in a newly launched state, the historical time period can be the time period during which the game is in the testing phase; for games in an old state, the historical time period can be the time period during which the game is in the previous operating cycle (from the last maintenance downtime to the current maintenance downtime).
[0057] Specifically, regarding the location of virtual AI monsters, they can be divided into virtual AI monsters close to the spawn point and other virtual AI monsters. The load weight coefficient of virtual AI monsters close to the spawn point is related to their distance from the spawn point, while the load weight coefficient of other virtual AI monsters is related to their distance from the virtual characters controlled by surrounding players. To filter out other virtual AI monsters, the influence range of each player can be defined with the player's position as the center and a first preset distance as the radius; the first target virtual object (other virtual AI monster) whose position is within the influence range of the players can be determined.
[0058] The method for calculating the load weight coefficient of the first target virtual object can be as follows: obtain the first influence distance from each first target virtual object to its corresponding game player position; calculate the ratio of the specified distance value to the first influence distance to obtain a second calculation result; calculate the sum of the first calculation result and 1 to obtain the load weight coefficient corresponding to each first target virtual object. For example, if the first influence distance from a certain first target virtual object to its corresponding game player position is 2m and the specified distance value is 10m, then the second calculation result is 0.5, and its corresponding load weight coefficient is 1 + 0.5 = 1.5.
[0059] In some embodiments, the method further includes:
[0060] (1) Determine a second target virtual object whose virtual object location is within a second preset distance from the specified area;
[0061] (2) Obtain the second influence distance from each of the second target virtual objects to the specified area;
[0062] (3) Calculate the ratio of the specified distance value to the second influence distance to obtain the third calculation result;
[0063] (4) Calculate the sum of the third calculation result and 1 to obtain the load weight coefficient corresponding to each second target virtual object.
[0064] Specifically, for virtual AI monsters that are close to the spawn point (designated area), the filtering method can be to define a second target virtual object whose position is within a second preset distance from the designated area. The corresponding load weight coefficient is calculated as follows: obtain the second influence distance from each second target virtual object to the designated area; calculate the ratio of the specified distance value to the second influence distance to obtain a third calculation result; calculate the sum of the third calculation result and 1 to obtain the load weight coefficient corresponding to each second target virtual object.
[0065] For example, if the distance between the second target virtual object and the spawn point is 4m and the specified distance value is 20m, then the third calculation result is 0.2, and the corresponding load weight coefficient is 1+0.2=1.2.
[0066] In step 103, the virtual map is divided based on the basic load score of each preset virtual object and the corresponding load weight coefficient.
[0067] In this process, after determining the basic load score and corresponding load weight coefficient of each preset virtual object on the virtual map, the virtual map is divided.
[0068] In some implementations, the step of dividing the virtual map based on the basic load score of each preset virtual object and the corresponding load weight coefficient includes:
[0069] (1) Calculate the product of the basic load score of each preset virtual object and the corresponding load weight coefficient to obtain the actual load score of each preset virtual object;
[0070] (2) Divide the virtual map according to the actual load score.
[0071] The method for dividing the virtual map is to calculate the product of the basic load score of each preset virtual object in the virtual map and its corresponding load weight coefficient, so as to obtain the actual load score of each preset virtual object, and then divide the virtual map according to the actual load score.
[0072] In some implementations, the step of dividing the virtual map according to the actual load score includes:
[0073] (1.1) Calculate the sum of the actual load scores of the preset virtual objects to obtain the actual load value of the virtual map;
[0074] (1.2) Divide the virtual map so that the actual load values of the two divided virtual maps are the same;
[0075] (1.3) Determine whether the actual load value of the divided virtual map is within the preset load value range;
[0076] (1.4) If the actual load value of the divided virtual map is not within the preset load value range, then return to the step of dividing the virtual map until the actual load value of the divided virtual map is within the preset load value range.
[0077] The method for dividing the virtual map according to the actual load score is as follows: calculate the sum of the actual load scores of all virtual objects to obtain the actual load score of the entire virtual map. In the specific division, it is necessary to ensure that the actual load values of the multiple virtual map parts obtained in each division are the same, and after each division, it is necessary to determine whether the actual load value of the divided virtual map is within the preset load value range. If the actual load value of the divided virtual map is not within the preset load value range, the process of dividing the virtual map is returned until the actual load value of the divided virtual map is within the preset load value range.
[0078] Specifically, the preset load value range is the range of load values for the optimal operation of a single process, such as (0.5, 1.1). If the actual load value of the virtual map is 4, it is divided for the first time, so that the actual load values of the two parts of the virtual map are both 2. Since 2 is not in (0.5, 1.1), the virtual map is divided again. After this division, four parts of the virtual map are obtained. At this time, the actual load value of each part of the virtual map is 1, which is in the range of (0.5, 1.1). Then the division ends, and four parts of the virtual map with an actual load value of 1 are obtained.
[0079] In some implementations, after the step of the actual load value of the divided virtual map being within a preset load value range, the method further includes:
[0080] (1.1) Obtain the number of targets in the divided virtual map;
[0081] (1.2) Create the target number of processes and assign a partitioned virtual map to a process.
[0082] After the partitioning is completed, the target number of the partitioned virtual map is obtained, a process with the same number of targets is created, and a partitioned virtual map is assigned to a process.
[0083] For example, if the number of targets in the divided virtual map is 4, then 4 processes are created accordingly, and one divided virtual map is assigned to one process to achieve single-process operation but with divided virtual maps, and to ensure that the load pressure of each process is the same or similar.
[0084] As described above, this embodiment of the application obtains the basic load score of each preset virtual object in the virtual map and the virtual object position of each preset virtual object in the virtual map; determines the load weight coefficient corresponding to each preset virtual object based on the virtual object position; and divides the virtual map based on the basic load score of each preset virtual object and the corresponding load weight coefficient. In this way, by estimating the basic load score and corresponding load weight coefficient of each preset virtual object, the load of each location in the virtual map is determined, thereby performing load-balanced division of the virtual map. This avoids the problem of load imbalance among multiple processes, and thus avoids the situation where a process with a large load experiences high operating pressure.
[0085] To facilitate better implementation of the virtual map partitioning method provided in this application, this application also provides an apparatus based on the aforementioned virtual map partitioning method. The meanings of the terms used are the same as in the virtual map partitioning method described above, and specific implementation details can be found in the descriptions within the method embodiments.
[0086] Please see Figure 2 , Figure 2 This is a schematic diagram of the structure of a virtual map division device provided in an embodiment of this application. The virtual map division device may include an acquisition module 301, a first determination module 302, and a division module 303, etc.
[0087] The acquisition module 301 is used to acquire the basic load score of each preset virtual object in the virtual map and the virtual object position of each preset virtual object in the virtual map;
[0088] The first determining module 302 is used to determine the load weight coefficient corresponding to each preset virtual object based on the position of the virtual object.
[0089] The segmentation module 303 is used to segment the virtual map based on the basic load score of each preset virtual object and the corresponding load weight coefficient.
[0090] In some implementations, the preset virtual object includes a first preset virtual object located within a designated area of the virtual map, and a variety of second preset virtual objects located in the virtual map outside the designated area;
[0091] The device further includes:
[0092] The second determining module is used to determine the first maximum number of runs of the first preset virtual object in a single process, and to determine the minimum number of game players required to activate the first preset virtual object with the first maximum number of runs.
[0093] The third determining module is used to determine the basic load score of the first preset virtual object based on the first maximum number of running objects and the minimum number of game players.
[0094] The fourth determining module is used to determine the second maximum number of times each of the second preset virtual objects can run in a single process;
[0095] The fifth determining module is used to determine the load weight coefficient of each of the second preset virtual objects based on the second maximum number of runs, and to obtain the basic load score of each preset virtual object.
[0096] In some implementations, the third determining module includes:
[0097] The first calculation submodule is used to calculate the product of the first maximum number of runs and the minimum number of game players to obtain a first calculation result;
[0098] Calculate the ratio of the single-process full load value to the first calculation result to obtain the basic load score of the first preset virtual object;
[0099] The fifth determining module includes:
[0100] The second calculation submodule is used to calculate the ratio of the full load value of a single process to the second maximum number of running processes, so as to obtain the basic load score of each of the second preset virtual objects.
[0101] In some implementations, the first determining module 302 includes:
[0102] The first acquisition submodule is used to acquire the location of game players within a historical time period;
[0103] The first determining submodule is used to determine the influence range of each player, with each player's position as the center and a first preset distance as the radius.
[0104] The second determination submodule is used to determine the first target virtual object whose virtual object location is within the influence range of the game player;
[0105] The second acquisition submodule is used to acquire the first influence distance from each of the first target virtual objects to its corresponding game player position;
[0106] The third calculation submodule is used to calculate the ratio of the specified distance value to the first influence distance to obtain the second calculation result;
[0107] The fourth calculation submodule is used to calculate the sum of the second calculation result and 1 to obtain the load weight coefficient corresponding to each of the first target virtual objects.
[0108] In some embodiments, the first determining module 302 further includes:
[0109] The third determination submodule is used to determine the second target virtual object whose virtual object position is within a second preset distance from the specified area;
[0110] The third acquisition submodule is used to acquire the second influence distance from each of the second target virtual objects to the specified area;
[0111] The fifth calculation submodule is used to calculate the ratio of the specified distance value to the second influence distance to obtain the third calculation result;
[0112] The sixth calculation submodule is used to calculate the sum of the third calculation result and 1 to obtain the load weight coefficient corresponding to each second target virtual object.
[0113] In some embodiments, the partitioning module 303 includes:
[0114] The seventh calculation submodule is used to calculate the product of the basic load score of each preset virtual object and the corresponding load weight coefficient to obtain the actual load score of each preset virtual object.
[0115] The segmentation submodule is used to segment the virtual map according to the actual load score.
[0116] In some implementations, the partitioning submodule is used for:
[0117] The actual load value of the virtual map is obtained by summing the actual load scores of the preset virtual objects.
[0118] The virtual map is divided so that the actual load values of the two resulting virtual maps are the same;
[0119] Determine whether the actual load value of the divided virtual map is within the preset load value range;
[0120] If the actual load value of the divided virtual map is not within the preset load value range, then return to the step of dividing the virtual map until the actual load value of the divided virtual map is within the preset load value range.
[0121] In some implementations, the partitioning submodule is further used for:
[0122] Obtain the number of targets in the divided virtual map;
[0123] Create the target number of processes and assign a partitioned virtual map to a process.
[0124] As described above, this embodiment of the application obtains the basic load score of each preset virtual object in the virtual map and the virtual object position of each preset virtual object in the virtual map through the acquisition module 301; the first determination module 302 determines the load weight coefficient corresponding to each preset virtual object based on the virtual object position; and the division module 303 divides the virtual map based on the basic load score of each preset virtual object and the corresponding load weight coefficient. In this way, by estimating the basic load score of each preset virtual object and the corresponding load weight coefficient, the load of each location in the virtual map is determined, thereby performing load-balanced division of the virtual map. This avoids the problem of load imbalance among multiple processes, and thus avoids the situation where a process with a large load experiences high operating pressure.
[0125] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.
[0126] Accordingly, embodiments of this application also provide a server, such as Figure 3 As shown, Figure 3 This is a schematic diagram of the structure of a server provided in an embodiment of this application. The server 2000 includes a processor 401 with one or more processing cores, a memory 402 with one or more computer-readable storage media, and a computer program stored on the memory 402 and executable on the processor. The processor 401 and the memory 402 are electrically connected. Those skilled in the art will understand that the server structure shown in the figure does not constitute a limitation on the server, and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0127] The processor 401 is the control center of the server 2000. It connects various parts of the server 2000 through various interfaces and lines. By running or loading software programs and / or modules stored in the memory 402, and calling data stored in the memory 402, it performs various functions of the server 2000 and processes data, thereby monitoring the server 2000 as a whole.
[0128] In this embodiment, the processor 401 in the server 2000 loads the instructions corresponding to the processes of one or more applications into the memory 402 according to the following steps, and the processor 401 runs the applications stored in the memory 402 to achieve various functions:
[0129] Obtain the basic load score of each preset virtual object in the virtual map and the virtual object position of each preset virtual object in the virtual map; determine the load weight coefficient corresponding to each preset virtual object based on the virtual object position; divide the virtual map based on the basic load score of each preset virtual object and the corresponding load weight coefficient.
[0130] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.
[0131] Optional, such as Figure 3 As shown, the server 2000 also includes an input unit 403 and a power supply 404. The processor 401 is electrically connected to both the input unit 403 and the power supply 404. Those skilled in the art will understand that... Figure 3 The server structure shown does not constitute a limitation on the server and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0132] The input unit 403 can be used to receive input numbers, characters, or user characteristic information (such as fingerprints, iris, facial information, etc.), and to generate keyboard, mouse, joystick, optical, or trackball signal inputs related to user settings and function control.
[0133] Power supply 404 is used to power the various components of server 2000. Optionally, power supply 404 can be logically connected to processor 401 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. Power supply 404 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.
[0134] although Figure 3 As not shown in the diagram, the server 2000 may also include a camera, sensors, a wireless fidelity module, a Bluetooth module, etc., which will not be described in detail here.
[0135] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.
[0136] As can be seen from the above, the server provided in this embodiment can obtain the basic load score of each preset virtual object in the virtual map and the virtual object position of each preset virtual object in the virtual map; determine the load weight coefficient corresponding to each preset virtual object based on the virtual object position; and divide the virtual map based on the basic load score of each preset virtual object and the corresponding load weight coefficient. In this way, by estimating the basic load score and corresponding load weight coefficient of each preset virtual object, the load of each location in the virtual map is determined, thereby performing load-balanced division of the virtual map. This avoids the problem of load imbalance among multiple processes, and thus avoids the situation where a process with a large load experiences high operating pressure.
[0137] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by instructions, or by instructions controlling related hardware. These instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.
[0138] Therefore, embodiments of this application provide a computer-readable storage medium storing a plurality of computer programs that can be loaded by a processor to execute steps in any of the data analysis methods provided in embodiments of this application. For example, the computer program can execute the following steps:
[0139] Obtain the basic load score of each preset virtual object in the virtual map and the virtual object position of each preset virtual object in the virtual map; determine the load weight coefficient corresponding to each preset virtual object based on the virtual object position; divide the virtual map based on the basic load score of each preset virtual object and the corresponding load weight coefficient.
[0140] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.
[0141] The storage medium may include: read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
[0142] Since the computer program stored in the storage medium can execute the steps in any of the virtual map division methods provided in the embodiments of this application, it can achieve the beneficial effects that any of the data analysis methods provided in the embodiments of this application can achieve, as detailed in the preceding embodiments, and will not be repeated here.
[0143] The foregoing has provided a detailed description of a virtual map partitioning method, apparatus, storage medium, and server provided in the embodiments of this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A method for dividing a virtual map, characterized in that, include: Determine the first maximum number of pre-defined virtual objects that can run in a single process, and determine the minimum number of game players required to activate the first maximum number of pre-defined virtual objects. Based on the first maximum number of running instances and the minimum number of game players, determine the basic load score of the first preset virtual object; Determine the second maximum number of times each second preset virtual object can run in a single process; Based on the second maximum number of runs, determine the basic load score for each of the second preset virtual objects, and obtain the basic load score for each preset virtual object; Obtain the basic load score of each preset virtual object in the virtual map and the virtual object position of each preset virtual object in the virtual map. The preset virtual objects include a first preset virtual object located in a specified area of the virtual map, and a variety of second preset virtual objects located in the virtual map other than the specified area. Get the location of players within a historical time period; Determine the player's influence range with each player's position as the center and a first preset distance as the radius; Identify the first target virtual object whose location is within the influence range of the game player; Obtain the first influence distance from each of the first target virtual objects to its corresponding game player position; Calculate the ratio of the specified distance value to the first influence distance to obtain a second calculation result; The sum of the second calculation result and 1 is calculated to obtain the load weight coefficient corresponding to each of the first target virtual objects; Determine a second target virtual object whose location is within a second preset distance from the specified area; Obtain the second influence distance from each of the second target virtual objects to the specified region; Calculate the ratio of the specified distance value to the second influence distance to obtain a third calculation result; The sum of the third calculation result and 1 is calculated to obtain the load weight coefficient corresponding to each second target virtual object; The virtual map is divided based on the basic load score of each preset virtual object and the corresponding load weight coefficient.
2. The method for dividing a virtual map according to claim 1, characterized in that, The step of determining the basic load score of the first preset virtual object based on the first maximum number of running instances and the minimum number of game players includes: Calculate the product of the first maximum number of runs and the minimum number of game players to obtain the first calculation result; Calculate the ratio of the single-process full load value to the first calculation result to obtain the basic load score of the first preset virtual object; The step of determining the basic load score for each of the second preset virtual objects based on the second maximum number of runs includes: Calculate the ratio of the full load value of a single process to the second maximum number of running processes to obtain the basic load score for each of the second preset virtual objects.
3. The method for dividing a virtual map according to claim 1, characterized in that, The step of dividing the virtual map based on the basic load score of each preset virtual object and the corresponding load weight coefficient includes: The actual load score of each preset virtual object is obtained by multiplying its base load score by the corresponding load weight coefficient. The virtual map is divided according to the actual load score.
4. The method for dividing a virtual map according to claim 3, characterized in that, The step of dividing the virtual map according to the actual load score includes: The actual load value of the virtual map is obtained by summing the actual load scores of the preset virtual objects. The virtual map is divided so that the actual load values of the two resulting virtual maps are the same; Determine whether the actual load value of the divided virtual map is within the preset load value range; If the actual load value of the divided virtual map is not within the preset load value range, then return to the step of dividing the virtual map until the actual load value of the divided virtual map is within the preset load value range.
5. The method for dividing a virtual map according to claim 4, characterized in that, After the step where the actual load value of the divided virtual map is within a preset load value range, the method further includes: Obtain the number of targets in the divided virtual map; Create the target number of processes and assign a partitioned virtual map to a process.
6. A device for dividing a virtual map, characterized in that, include: The acquisition module is used to acquire the basic load score of each preset virtual object in the virtual map and the virtual object position of each preset virtual object in the virtual map. The preset virtual objects include a first preset virtual object located in a specified area of the virtual map, and a variety of second preset virtual objects located in the virtual map other than the specified area. The first determining module is used to obtain the player positions of game players within a historical time period, determine the player influence range with each player position as the center and a first preset distance as the radius, determine the first target virtual object whose virtual object position is within the player influence range, obtain the first influence distance from each first target virtual object to its corresponding player position, calculate the ratio of a specified distance value to the first influence distance to obtain a second calculation result, calculate the sum of the second calculation result and 1 to obtain the load weight coefficient corresponding to each first target virtual object, determine the second target virtual object whose virtual object position is within a second preset distance from the specified area, obtain the second influence distance from each second target virtual object to the specified area, calculate the ratio of the specified distance value to the second influence distance to obtain a third calculation result, calculate the sum of the third calculation result and 1 to obtain the load weight coefficient corresponding to each second target virtual object; The segmentation module is used to segment the virtual map based on the basic load score of each preset virtual object and the corresponding load weight coefficient; The device is further configured to: determine a first maximum number of runs of a first preset virtual object in a single process, and determine a minimum number of game players required to activate the first preset virtual object with the first maximum number of runs; determine a basic load score for the first preset virtual object based on the first maximum number of runs and the minimum number of game players; determine a second maximum number of runs of each second preset virtual object in a single process; determine a basic load score for each second preset virtual object based on the second maximum number of runs; and obtain a basic load score for each preset virtual object.
7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a plurality of instructions adapted for loading by a processor to perform the steps in the method for dividing a virtual map according to any one of claims 1 to 5.
8. A server, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps in the virtual map partitioning method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Map load balancing method and device, equipment and computer readable storage medium
CN112206518A
Virtual map generation method and device, electronic equipment and readable storage medium
CN112562037A