Game server stress testing method and device, electronic equipment and storage medium
By obtaining the IP address group of the client and access server, determining the robot account based on preset parameters, and modifying the stress test configuration file, rapid stress testing of the game server is realized, solving the problems of long development time and high debugging cost in existing technologies, and meeting the needs of rapid game launch.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-24
- Publication Date
- 2026-03-27
AI Technical Summary
In existing technologies, stress testing of game servers requires the development of robot scripts that support distributed startup, which results in long development time and high debugging costs, making it impossible to quickly implement stress testing and meet the needs of rapid game launch.
By obtaining the IP address group of the client and access server, and based on the preset total number of processes and the maximum number of robots that a single process can support, the robot account corresponding to each process is determined, and the stress test configuration file is modified to achieve distributed robot startup, thus avoiding the step of developing a distributed startup script.
This significantly reduced the development time and debugging costs of distributed robot scripts, enabled rapid stress testing of game servers, and met the need for quick game launch.
Smart Images

Figure CN116846799B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and in particular to a method, apparatus, electronic device, and storage medium for stress testing game servers. Background Technology
[0002] Online games generally adopt a client / server architecture, especially products aimed at a massive number of players. Thousands of players may access the game server at the same time. In order to ensure the player's gaming experience, it is essential to understand the game server's capacity before the game goes live. Therefore, stress testing is usually introduced at the end of the game development process.
[0003] Currently, stress testing of game servers typically employs bot stress testing. This involves using stress testing tools to simulate player actions in-game, creating a large number of bots through scripts to put pressure on the game server. Game server stress testing usually includes stress assessment of the game server itself, as well as the corresponding public servers and database servers. To meet these stress testing requirements, pre-launch stress testing needs to target all game partitions. Therefore, bots need to support distributed startup. Related technologies involve developing bot scripts that support distributed startup to achieve this. However, this approach suffers from long script development times, high debugging costs, and consequently, the inability to quickly implement stress testing, thus failing to meet the demands of rapid game launches. Summary of the Invention
[0004] To address the problems of existing technologies, embodiments of the present invention provide a method, apparatus, electronic device, and storage medium for stress testing of game servers. The technical solution is as follows:
[0005] On the one hand, a method for stress testing a game server is provided, the method comprising:
[0006] Obtain a first group list and a second group list; the first group list includes a first number of client IP address groups, and the second group list includes the first number of access server IP address groups, where the first number is the number of game partitions;
[0007] When the current client IP address is included in the first group list, the group identifier corresponding to the current client IP address in the first group list is determined, and the target access server IP address group corresponding to the group identifier in the second group list is determined;
[0008] The robot account corresponding to each process is determined based on the preset total number of processes and the maximum number of robots that a single process can support;
[0009] modify process information in the stress test configuration file according to the robot account corresponding to each process and the access server IP address in the target access server IP address group;
[0010] perform stress testing on the game server according to the modified stress test configuration file.
[0011] In another aspect, a game server stress testing apparatus is provided, the apparatus comprising:
[0012] a list obtaining module configured to obtain a first grouping list and a second grouping list, the first grouping list comprising a first number of client IP address groups, the second grouping list comprising a first number of access server IP address groups, the first number being a number of game partitions;
[0013] an access address determining module configured to, when a current client IP address is included in the first grouping list, determine a grouping identifier corresponding to the current client IP address in the first grouping list, and determine a target access server IP address group corresponding to the grouping identifier in the second grouping list;
[0014] a robot account determining module configured to determine a robot account corresponding to each process according to a total number of processes and a maximum number of robots supported by a single process;
[0015] a process configuration modifying module configured to modify process information in a stress test configuration file according to the robot account corresponding to each process and the access server IP address in the target access server IP address group;
[0016] a stress testing module configured to perform stress testing on the game server according to the modified stress test configuration file.
[0017] In an exemplary embodiment, the list obtaining module comprises:
[0018] an initial parameter obtaining module configured to obtain a plurality of client IP addresses, a plurality of access server IP addresses, and a number of game partitions;
[0019] a serializing module configured to serialize the plurality of client IP addresses and the plurality of access server IP addresses respectively to obtain a client IP address sequence and an access server IP address sequence;
[0020] a grouping module configured to group client IP addresses in the client IP address sequence and group access server IP addresses in the access server IP address sequence according to the number of game partitions to obtain the first grouping list and the second grouping list.
[0021] In an example implementation, the robot account determining module comprises:
[0022] a sequence position determining module configured to determine a sequence position of the current client IP address in the sequence of client IP addresses;
[0023] a general account determining module configured to determine a general robot account according to the sequence position;
[0024] a step determining module configured to determine a step corresponding to each process according to a preset total number of processes and a maximum number of robots supported by a single process;
[0025] a robot account determining sub-module configured to take the sum of the step corresponding to each process and the general robot account as a robot account corresponding to each process.
[0026] In an example implementation, the step determining module comprises:
[0027] a step coefficient determining module configured to obtain a number of current cycles, and obtain a step coefficient according to a difference between the number of current cycles and one when the number of current cycles does not exceed the preset total number of processes;
[0028] a step determining sub-module configured to obtain a step of a process corresponding to the current cycle according to a product of the maximum number of robots supported by a single process and the step coefficient;
[0029] a cycle number updating module configured to update the number of current cycles.
[0030] In an example implementation, the serialization module comprises:
[0031] a first string representation module configured to represent each client IP address in the plurality of client IP addresses as a string, and separate two adjacent client IP addresses by a specified character to obtain a first string;
[0032] a second string representation module configured to represent each access server IP address in the plurality of access server IP addresses as a string, and separate two adjacent access server IP addresses by the specified character to obtain a second string;
[0033] a string segmentation module configured to segment the first string and the second string based on a string segmentation function by taking the specified character as a segmentation identifier to obtain a first string list and a second string list; the first string list represents a sequence of client IP addresses, and the second string list represents a sequence of access server IP addresses.
[0034] In an example implementation, the grouping module comprises:
[0035] an iterator object creating module configured to create iterator objects with a total length of the number of game partitions according to the first string list and the second string list, respectively, to obtain a first iterator object and a second iterator object;
[0036] a group list generating module configured to sequentially take out tuples in the first iterator object and convert the taken-out tuples into a list form to obtain a first group list, and sequentially take out tuples in the second iterator object and convert the taken-out tuples into a list form to obtain a second group list.
[0037] In another aspect, an electronic device is provided, including a processor and a memory, the memory storing at least one instruction or at least one program, the at least one instruction or the at least one program being loaded and executed by the processor to implement the game server stress testing method described above.
[0038] In another aspect, a computer readable storage medium is provided, the computer readable storage medium storing at least one instruction or at least one program, the at least one instruction or the at least one program being loaded and executed by a processor to implement the game server stress testing method as described above.
[0039] In another aspect, a computer program product or computer program is provided, the computer program product or computer program including computer instructions stored in a computer readable storage medium. A processor of a computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions to cause the computer device to perform the game server stress testing method described above.
[0040] The embodiment of the application determines the group identifier corresponding to the current client IP address based on the group list corresponding to the client IP address in the case of current client IP address hit, determines the target access server IP address group corresponding to the group identifier from the group list corresponding to the access server IP address, and determines the robot account corresponding to each process according to the preset total number of processes and the maximum number of robots carried by a single process, and then modifies the process information in the stress test configuration file according to the robot account corresponding to each process and the access server IP address in the target access server IP address group, and performs stress test on the game server based on the modified stress test configuration file, so that the distributed robot script does not need to be developed in the stress test stage, and only different parameters (game partition number, preset total number of processes, maximum number of robots carried by a single process, client IP address and access server IP address) need to be given according to different games to achieve the effect of distributed robot start, greatly reducing the time-consuming of developing distributed robot script, reducing the debugging cost, quickly realizing stress test, and meeting the demand of game rapid online. BRIEF DESCRIPTION OF DRAWINGS
[0041] In order to more clearly illustrate the technical solutions in the embodiments of the application, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the application, and other drawings can be obtained by those skilled in the art without creative labor.
[0042] Figure 1 is a stress demand schematic diagram of stress test in formal environment before game online;
[0043] Figure 2 is a flowchart of a game server stress test method provided by the embodiment of the application;
[0044] Figure 3 is a flowchart of another game server stress test method provided by the embodiment of the application;
[0045] Figure 4 is a structural block diagram of a game server stress test device provided by the embodiment of the application;
[0046] Figure 5 is a structural block diagram of an electronic device provided by the embodiment of the application. DETAILED DESCRIPTION
[0047] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0048] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or server that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or devices.
[0049] Please see Figure 1 The diagram illustrates the stress requirements for stress testing in a production environment before a game's release. Figure 1 As shown, before the game's official launch, the deployed environment included local game servers, public servers, and database servers across all regions. To assess the stress on the game servers and the corresponding public and database servers, during stress testing of the game servers, the stress-applying client (i.e., the stress source) needed to connect to the corresponding game partition as expected and launch a preset number of bots. The stress-applying client was the client that generated stress on the game servers, on which bots were deployed to simulate player actions. In other words, during the stress testing before the game's official launch, the bots needed to be deployed in a distributed manner to assess the stress on the public and database servers through stress testing of all game partitions.
[0050] In related technologies, the distributed startup of robots is achieved by developing robot scripts that support distributed startup. Obviously, this method of achieving distributed startup of robots requires a long time to develop robot scripts, and the developed robot scripts also need further debugging, which is costly. As a result, it is impossible to quickly achieve stress testing and cannot meet the needs of rapid game launch.
[0051] Based on this, the embodiment of the present application provides a game server stress test method, which does not need to develop a distributed starting robot script, and only needs to give different parameters (game partition number, preset process total number, single process maximum bearing robot number, client IP address and access server IP address) according to different games, so as to achieve the effect of distributed starting robots, greatly reduce the time-consuming of developing a distributed robot script, reduce the debugging cost, quickly realize stress test, and meet the game online requirement.
[0052] It should be noted that the client in the embodiment of the present application can include entity devices such as mobile phones, computers, smart voice interaction devices, smart home appliances, vehicle-mounted terminals and aircraft, and can also include software running in the entity devices, for example, web pages provided by service providers to users, and applications provided by the service providers to the users.
[0053] In addition, the server in the embodiment of the present application can be a stand-alone physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and basic cloud computing services such as big data and artificial intelligence platforms.
[0054] The technical solutions of the embodiments of the present application will be described in detail below to quickly achieve the effect of distributed starting of a large number of robots, meet the requirements of the pressure source. Figure 2 Figure 1 The technical solutions of the embodiments of the present application will be described in detail below to quickly achieve the effect of distributed starting of a large number of robots, meet the requirements of the pressure source.
[0055] Please refer to Figure 2 It is shown that the embodiment of the present application provides a game server stress test method, which can be applied to an electronic device, and the electronic device can be a client device or a client device and a server.
[0056] It should be noted that the present specification provides method operation steps as described in the embodiments or flowcharts, but more or fewer operation steps can be included based on conventional or non-creative labor. The order of steps listed in the embodiments is only one of the many step execution orders, and does not represent the only execution order. In actual system or product execution, the method order shown in the embodiments or the drawings can be executed in sequence or in parallel (for example, in a parallel processor or multi-threaded processing environment). Specifically, as shown in Figure 2 The method can include:
[0057] S201, acquiring a first grouping list and a second grouping list.
[0058] The first grouping list includes a first number of client IP address groups, and the second grouping list includes the first number of access server IP address groups. The first number is a number of game partitions.
[0059] Each client IP address group includes at least one client IP address, and the client corresponding to the client IP address is a client that deploys a robot to apply pressure on a game server (also referred to as a pressure applying client), wherein the robot is used to simulate the operation of a player in a game.
[0060] The number of game partitions refers to a number of game cells included in each game region corresponding to a game, and the game region is a region in which a game is played. Figure 1 For example, the game includes two game regions, and each game region includes 250 game cells (10001 region-19999 region, 20001 region-29999 region). Therefore, the number of game partitions is 500 (250+250), that is, the game partition in the embodiment of the present application refers to the smallest granularity partition unit of the game, such as Figure 1 In the embodiment, the game cell is a game cell under a game region.
[0061] The game server in each game partition interacts with the client through the corresponding access server. Each access server IP address group includes at least one access server IP address, and the access server corresponding to the access server IP address is responsible for the interaction between the game server in the corresponding game partition and the client.
[0062] For example, the number of client IP addresses in each client IP address group is the same. Assuming that the number of client IP addresses to be grouped is K, and the number of game partitions is N, then the number of client IP addresses included in each group in the first grouping list is K / N. Correspondingly, the number of access server IP addresses in each access server IP address group is also K / N.
[0063] In an exemplary embodiment, the above step S201 can include:
[0064] obtaining a plurality of client IP addresses, a plurality of access server IP addresses, and a number of game partitions;
[0065] serializing the plurality of client IP addresses and the plurality of access server IP addresses respectively to obtain a client IP address sequence and an access server IP address sequence;
[0066] According to the game partition number, the client IP addresses in the client IP address sequence are grouped, and the access server IP addresses in the access server IP address sequence are grouped, to obtain the first grouping list and the second grouping list.
[0067] In a specific implementation, the plurality of client IP addresses, the plurality of access server IP addresses, and the game partition number can be set as initialization parameters by a user according to an actual game situation, and the initialization parameters are different for different games.
[0068] In the above embodiment, by respectively serializing the plurality of client IP addresses and the plurality of access server IP addresses, each IP address can be corresponded to a sequence position, and the accuracy of subsequent distributed starting is ensured.
[0069] In an exemplary embodiment, in order to improve the speed of serialization to improve the efficiency of stress testing, when serializing the plurality of client IP addresses and the plurality of access server IP addresses, the following can be included:
[0070] Each client IP address in the plurality of client IP addresses is represented as a string, and adjacent two client IP addresses are separated by a specified character to obtain a first string;
[0071] Each access server IP address in the plurality of access server IP addresses is represented as a string, and adjacent two access server IP addresses are separated by the specified character to obtain a second string;
[0072] The first string and the second string are respectively split based on a string split function with the specified character as a split identifier to obtain a first string list and a second string list.
[0073] It can be understood that the first string list represents the client IP address sequence, and the second string list represents the access server IP address sequence.
[0074] For example, the specified character can be a comma or a space, and the string split function can be a split() function, which is used to separate a string into a string group.
[0075] In an exemplary embodiment, when the client IP addresses in the client IP address sequence are grouped according to the game partition number, and the access server IP addresses in the access server IP address sequence are grouped according to the game partition number, the first grouping list and the second grouping list are obtained, which can include:
[0076] According to the first string list and the second string list, iterator objects with a total length of the number of game partitions are created respectively to obtain a first iterator object and a second iterator object;
[0077] The tuples in the first iterator object are taken out in sequence, and the taken-out tuples are converted into a list form to obtain a first grouping list; and the tuples in the second iterator object are taken out in sequence, and the taken-out tuples are converted into a list form to obtain a second grouping list.
[0078] In a specific implementation, the iter() function can be used to create the iterator object, and the iter() function can be used to generate the iterator object, wherein the iterator object contains a countable number of values that can be iterated on the iteration object. When the tuples in the iterator object are taken out and converted into a list form, the zip() function can be used in combination with the for loop to achieve this, and the zip() function is used to pack the corresponding elements in the iterable object into tuples, and then return a list composed of these tuples.
[0079] For example, assuming that there are 10 client IP addresses, the game has 5 partitions, and the test pressure is to be evenly distributed to the 5 partitions, the first string list needs to be divided into 5 groups, and each group has 2 client IP addresses to achieve the effect of pressure averaging. Taking the first string list list_c = ['11.21.2.1', '11.21.2.2', '11.21.2.3', '11.21.2.4', '11.21.2.5', '11.21.2.6', '11.21.2.7', '11.21.2.8', '11.21.2.9', '11.21.2.10'] as an example, the iter() method provided by python can be used to generate an iterator object from the above list_c list, and the elements of the iterator object are tuples, and the total length is 5; then, the zip() method is used in combination with the for loop to take out the tuples in the iterator object in sequence, and a new list is generated, and finally a new list with a length of 5 is obtained, such as gc = [['11.21.2.1', '11.21.2.2'], ['11.21.2.3', '11.21.2.4'], ['11.21.2.5', '11.21.2.6'], ['11.21.2.7', '11.21.2.8'], ['11.21.2.9', '11.21.2.10']], the elements in the new list are also lists and the length is 2.
[0080] The above embodiment improves the grouping speed and grouping accuracy by grouping based on the iterator object, which is conducive to ensuring the accuracy of the distributed startup robot during the pressure test.
[0081] S203, when the current client IP address is included in the first grouping list, determining the corresponding grouping identifier of the current client IP address in the first grouping list, and determining the target access server IP address group corresponding to the grouping identifier in the second grouping list.
[0082] Wherein, the current client IP address is the IP address corresponding to the current client, each client IP address in the first grouping list can be traversed, if the current client IP address is traversed, it indicates that the first grouping list includes the current client IP address, at this time, the grouping identifier corresponding to the current client IP address in the first grouping list is recorded, which can be a grouping sequence number, such as grouping sequence number x.
[0083] After obtaining the grouping sequence number x, the target grouping corresponding to the grouping sequence number x is found from the second grouping list, and the access server IP address in the target grouping is used as the access layer address of the current client IP address to establish connection, so that the test pressure of the current client can be distributed to the game partition responsible by the access server in the target grouping.
[0084] S205, according to the preset total number of processes and the maximum number of robots carried by single process, determining the robot account number corresponding to each process.
[0085] Wherein, the preset total number of processes and the maximum number of robots carried by single process can be set by initialization parameters, which can be set according to the actual situation of the game, and different games can set different parameters. The preset total number of processes refers to the total number of processes that need to be started by a single pressure client.
[0086] In an exemplary embodiment, the above step S205 can include the following steps when implemented:
[0087] Determining the sequence position of the current client IP address in the sequence of client IP addresses;
[0088] Determining the general robot account number according to the sequence position;
[0089] According to the preset total number of processes and the maximum number of robots carried by single process, determining the step length corresponding to each process;
[0090] The sum of the step length corresponding to each process and the general robot account number is used as the robot account number corresponding to each process.
[0091] The current client IP address corresponds to a general robot account, which is the basis for determining the robot account corresponding to each process. Each process on the current client adds a corresponding step to the general robot account to obtain the robot account corresponding to each process. It should be noted that the steps corresponding to each process on the current client are different, so that the robot accounts corresponding to each process on the current client are different, thereby avoiding test errors caused by different robots corresponding to the same robot account during pressure testing.
[0092] In actual applications, in order to meet different requirements of the background on the starting of the robot account, the corresponding general robot account can be determined based on the sequence position and the preset starting robot account when determining the general robot account corresponding to the current client. For example, assuming that the sequence position of the current client IP address in the client IP address sequence is represented as index, and the robot account starting required by the background is 10000, then the general robot account start_uin_com of the current client can be determined as int(index)*10000+10000. If step represents the step, then the robot accounts corresponding to each process on the current client are uin=start_uin_com+step.
[0093] In an exemplary embodiment, in order to quickly determine the robot accounts corresponding to each process to quickly implement pressure testing, a loop can be performed based on the preset total number of processes, and a robot account corresponding to a process can be determined based on the single-process maximum bearing robot number and the current number of loops each time the loop is performed. When the number of loops reaches the preset total number of processes, the robot accounts corresponding to each process to be started can be determined and the robot accounts corresponding to each process will not be repeated. Specifically, when determining the step corresponding to each process based on the preset total number of processes and the single-process maximum bearing robot number, the following steps can be included:
[0094] Obtaining the number of current loops, and when the number of current loops does not exceed the preset total number of processes, obtaining a step coefficient based on the difference between the number and one;
[0095] Obtaining the step corresponding to the process of the current loop based on the product of the single-process maximum bearing robot number and the step coefficient;
[0096] Updating the number of current loops.
[0097] In a specific implementation, i represents the number of current loops, and the total number of loops is the preset total number of processes, so the step coefficient is (i-1). Then the step corresponding to the process of the current loop can be represented as step=(Maxnum+y)*(i-1), where Maxnum is the single-process maximum bearing robot number, and y is a preset value for preventing the repetition of robot accounts, for example, the y can be 100.
[0098] S207, modifying process information in the stress test configuration file according to the robot account corresponding to each process and the access server IP address in the target access server IP address group.
[0099] S209, performing stress test on the game server according to the modified stress test configuration file.
[0100] It can be understood that through the foregoing steps S201 to S207, the process information in the stress test configuration file on each client corresponding to each client IP address can be modified, and then in step S209, the robots can be distributedly started on the corresponding clients according to the modified stress test configuration file to perform stress test on the game server. During the stress test, the client starts the process according to the process information in the modified stress test configuration file and configures the robot based on the robot account of each process, and then interacts with the access server of the corresponding access server IP address.
[0101] In an exemplary embodiment, the control server can be connected to each pressure client for communication, and the user can input the initial parameters based on the terminal connected to the control server, the initial parameters including a plurality of client IP addresses, a plurality of access server IP addresses, a game partition number, a total number of preset processes started on each pressure client, and a maximum number of robots carried by a single process. After obtaining the initial parameters, the control server can initiate a stress test instruction to each pressure client based on the initial parameters, and the stress test instruction carries the initial parameters, so that each pressure client modifies the process information in the corresponding stress test configuration file based on the foregoing method of the embodiment of the application, and performs stress test on the game server based on the modified stress test configuration file. Figure 2
[0102] In another exemplary embodiment, in order to quickly implement the stress test, after obtaining the initial parameters, the control server can first process the plurality of client IP addresses and the plurality of access server IP addresses in the initial parameters to obtain a first grouping list and a second grouping list, then generate initial information based on the first grouping list, the second grouping list and the initial parameters, and then issue a stress test instruction to each pressure client based on the initial information.
[0103] From the technical solutions of the embodiments of the present application, it can be seen that the embodiments of the present application only need to give different parameters (game partition number, preset process total number, single process maximum carrying robot number, client IP address and access server IP address) according to different games, so as to achieve the effect of distributed starting robots, greatly reduce the time-consuming of developing distributed robot scripts, reduce the debugging cost, quickly realize the stress test, and meet the demand of rapid online of games.
[0104] In order to better understand the technical solutions of the embodiments of the present application, the following will be combined with specific examples. Figure 3 A specific example is described.
[0105] As shown in the figure, the game server stress test method provided by the embodiments of the present application includes the following steps. Figure 3 As shown in the figure, another flowchart of a game server stress test method provided by the embodiments of the present application is shown, wherein the initialization parameters include: K pressure client IP addresses, game access server IP address, preset process total number M of the pressure client, single process maximum carrying robot number Maxnum, game partition number N.
[0106] Firstly, the pressure client IP addresses and the access server IP addresses are serialized to obtain corresponding lists list_c and list_s; then, the elements in list_c are divided into N groups to obtain a first grouping list gc, and the elements in list_s are divided into N groups to obtain a second grouping list gs; when the current client IP address is contained in the first grouping list, record its grouping sequence number x in the first grouping list, and obtain the access server IP address gs[x] in the corresponding grouping; further, based on the sequence position of the current client IP address in list_c, the general robot account start_uin_com=int(index)*10000+10000 is calculated, wherein index represents the sequence position; further, according to the preset process total number, the loop is performed M times, and the step of the current loop corresponding process is calculated step=(Maxnum+100)*(i-1), wherein i represents the number of each loop, and the robot account uin of the current loop corresponding process is calculated uin=start_uin_com+step; further, the uin and the access server IP corresponding to the process information in the stress test configuration file are modified to gs[x], and the game server is tested based on the modified stress test configuration file.
[0107] Corresponding to the game server stress testing method provided by the above-mentioned embodiments, the embodiment of the application further provides a game server stress testing device. Since the game server stress testing device provided by the embodiment of the application corresponds to the game server stress testing method provided by the above-mentioned embodiments, the implementation of the foregoing game server stress testing method is also applicable to the game server stress testing device provided by the embodiment of the application, and the foregoing game server stress testing method will not be described in detail in the embodiment.
[0108] Please refer to Figure 4 , which is a structural schematic diagram of a game server stress testing device provided by an embodiment of the application. The game server stress testing device 400 has the function of implementing the game server stress testing method in the above-mentioned method embodiments. The function can be implemented by hardware or corresponding software executed by hardware. As Figure 4 indicated, the game server stress testing device 400 can include:
[0109] A list obtaining module 410 is configured to obtain a first grouping list and a second grouping list. The first grouping list includes a first number of client IP address groups, and the second grouping list includes a first number of access server IP address groups. The first number is the number of game partitions.
[0110] An access address determining module 420 is configured to, when a current client IP address is included in the first grouping list, determine the group identifier corresponding to the current client IP address in the first grouping list, and determine the target access server IP address group corresponding to the group identifier in the second grouping list.
[0111] A robot account determining module 430 is configured to determine the robot account corresponding to each process according to a preset total number of processes and a maximum number of robots supported by a single process.
[0112] A process configuration modifying module 440 is configured to modify the process information in a stress testing configuration file according to the robot account corresponding to each process and the access server IP address in the target access server IP address group.
[0113] A stress testing module 450 is configured to perform stress testing on a game server according to the modified stress testing configuration file.
[0114] In an exemplary embodiment, the list obtaining module 410 includes:
[0115] An initial parameter obtaining module is configured to obtain a plurality of client IP addresses, a plurality of access server IP addresses, and the number of game partitions.
[0116] a serialization module, configured to serialize the plurality of client IP addresses and the plurality of access server IP addresses respectively to obtain a client IP address sequence and an access server IP address sequence;
[0117] a grouping module, configured to group the client IP addresses in the client IP address sequence and the access server IP addresses in the access server IP address sequence according to the number of game partitions to obtain the first grouping list and the second grouping list.
[0118] In an exemplary embodiment, the robot account determination module 430 comprises:
[0119] a sequence position determination module, configured to determine a sequence position of the current client IP address in the client IP address sequence;
[0120] a general account determination module, configured to determine a general robot account according to the sequence position;
[0121] a step determination module, configured to determine a step corresponding to each process according to a preset total number of processes and a maximum number of robots borne by a single process;
[0122] a robot account determination submodule, configured to take the sum of the step corresponding to each process and the general robot account as a robot account corresponding to each process.
[0123] In an exemplary embodiment, the step determination module comprises:
[0124] a step coefficient determination module, configured to obtain a number of current cycles, and obtain a step coefficient according to a difference between the number of current cycles and one when the number of current cycles does not exceed the preset total number of processes;
[0125] a step determination submodule, configured to obtain a step of a process corresponding to the current cycle according to a product of the maximum number of robots borne by a single process and the step coefficient;
[0126] a cycle number updating module, configured to update the number of current cycles.
[0127] In an exemplary embodiment, the serialization module comprises:
[0128] a first string representation module, configured to represent each client IP address in the plurality of client IP addresses as a string, and separate two adjacent client IP addresses by a specified character to obtain a first string;
[0129] A second string representation module is configured to represent each of the plurality of access server IP addresses as a string, and adjacent two of the access server IP addresses are separated by the specified character, to obtain a second string.
[0130] A string segmentation module is configured to segment the first string and the second string based on a string segmentation function, and the specified character is used as a segmentation identifier, to obtain a first string list and a second string list; the first string list represents a client IP address sequence, and the second string list represents an access server IP address sequence.
[0131] In an exemplary embodiment, the grouping module comprises:
[0132] An iterator object creation module is configured to create an iterator object with a total length of the number of game partitions based on the first string list and the second string list, to obtain a first iterator object and a second iterator object.
[0133] A grouping list generation module is configured to sequentially take out tuples in the first iterator object, and convert the taken tuples into a list form, to obtain a first grouping list; and sequentially take out tuples in the second iterator object, and convert the taken tuples into a list form, to obtain a second grouping list.
[0134] It should be noted that the device provided in the above embodiments, in realizing its functions, only divides the above-mentioned various functional modules by way of example, and in actual application, the above-mentioned functions can be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the above-described functions. In addition, the device and method embodiments provided in the above embodiments belong to the same concept, and the specific implementation process is described in detail in the method embodiments, which will not be repeated here.
[0135] The electronic device provided in the embodiments of the present application comprises a processor and a memory, and the memory stores at least one instruction or at least one program, which is loaded and executed by the processor to implement the game server stress testing method provided in the above method embodiments.
[0136] The memory can be used to store software programs and modules, and the processor performs various function applications and data processing by running the software programs and modules stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, application programs required for functions, etc.; and the data storage area can store data created according to the use of the device, etc. In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other volatile solid-state memory device. Accordingly, the memory can also include a memory controller to provide access of the processor to the memory.
[0137] Figure 5 is a hardware structure block diagram of an electronic device running a game server stress testing method provided by an embodiment of the application, as shown in the figure, the internal structure of the electronic device can include but is not limited to: processor, network interface and memory. Among them, the processor, network interface and memory in the electronic device can be connected through a bus or other ways, in the embodiment of the present application shown in the figure, taking the connection through the bus as an example. Figure 5 Figure 5
[0138] Among them, the processor (or CPU (Central Processing Unit, Central Processing Unit)) is the computing core and control core of the electronic device. The network interface can optionally include a standard wired interface, a wireless interface (such as WI-FI, a mobile communication interface, etc.). The memory (Memory) is a memory device in the electronic device, used for storing programs and data. It can be understood that the memory here can be a high-speed RAM storage device, or a non-volatile storage device (non-volatile memory), such as at least one magnetic disk storage device; optionally, it can also be at least one storage device located away from the aforementioned processor. The memory provides a storage space that stores the operating system of the electronic device, which can include but is not limited to: Windows system (an operating system), Linux (an operating system), Android (a mobile operating system) system, IOS (a mobile operating system) system, etc., and the present application does not limit this; and in the storage space, one or more instructions suitable for being loaded and executed by the processor are also stored, which can be one or more computer programs (including program codes). In the embodiment of the present application, the processor loads and executes one or more instructions stored in the memory to implement the game server stress testing method provided by the method embodiment.
[0139] The embodiment of the present application further provides a computer readable storage medium, which can be arranged in an electronic device to store at least one instruction or at least one program for implementing a game server stress testing method, and the at least one instruction or the at least one program is loaded and executed by the processor to implement the game server stress testing method provided by the method embodiment.
[0140] Optionally, in the embodiment, the storage medium can include but is not limited to a U disk, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and various storage program code media.
[0141] It should be noted that the above-mentioned sequence of the embodiments of the present application is only for description, not representing the advantages and disadvantages of the embodiments. The above-mentioned embodiments of the present application are described. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be executed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multi-task processing and parallel processing are possible or can be advantageous.
[0142] Each of the embodiments in the present specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other. Each embodiment focuses on the difference from other embodiments. Especially, the device embodiment is described simply because it is basically similar to the method embodiment, and the relevant part can be referred to the part of the method embodiment.
[0143] Those skilled in the art can understand that all or part of the steps of the above-mentioned embodiments can be completed by hardware, or by program instructing relevant hardware to complete, and the program can be stored in a computer readable storage medium. The storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk.
[0144] The above-mentioned is only the preferred embodiment of the present application, and is not used to limit the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A method of stress testing a game server, the method comprising: The method comprises: obtaining a first grouping list and a second grouping list; the first grouping list comprises a first number of client IP address groups, and the second grouping list comprises a first number of access server IP address groups; the first number is the number of game partitions; when a current client IP address is included in the first grouping list, determining a grouping identifier corresponding to the current client IP address in the first grouping list, and determining a target access server IP address group corresponding to the grouping identifier in the second grouping list; determining a robot account corresponding to each process according to a preset total number of processes and a maximum number of robots supported by a single process; modifying process information in a stress test configuration file according to the robot account corresponding to each process and an access server IP address in the target access server IP address group; performing stress testing on a game server according to the modified stress test configuration file.
2. The game server stress testing method of claim 1, wherein, The method comprises: obtaining a plurality of client IP addresses, a plurality of access server IP addresses, and the number of game partitions; serializing the plurality of client IP addresses and the plurality of access server IP addresses respectively to obtain a client IP address sequence and an access server IP address sequence; grouping the client IP addresses in the client IP address sequence and the access server IP addresses in the access server IP address sequence according to the number of game partitions to obtain the first grouping list and the second grouping list.
3. The game server stress testing method of claim 2, wherein, The method comprises: determining a sequence position of the current client IP address in the client IP address sequence; determining a general robot account according to the sequence position; determining a step corresponding to each process according to a preset total number of processes and a maximum number of robots supported by a single process; taking the sum of the step corresponding to each process and the general robot account as the robot account corresponding to each process.
4. The game server stress testing method of claim 3, wherein, The method comprises: obtaining a number of current cycles, and when the number of current cycles does not exceed the preset total number of processes, obtaining a step coefficient according to the difference between the number and one; obtaining a step corresponding to a process in the current cycle according to the product of the maximum number of robots supported by a single process and the step coefficient; updating the number of current cycles.
5. The game server stress testing method of claim 2, wherein, The method comprises: representing each client IP address in the plurality of client IP addresses as a string, and separating adjacent two client IP addresses by a specified character to obtain a first string; representing each access server IP address in the plurality of access server IP addresses as a string, and separating adjacent two access server IP addresses by the specified character to obtain a second string; The first string list represents a client IP address sequence, and the second string list represents an access server IP address sequence.
6. The game server stress testing method of claim 5, wherein, The grouping of the client IP addresses in the client IP address sequence and the grouping of the access server IP addresses in the access server IP address sequence according to the game partition number includes: According to the first string list and the second string list, an iterator object with a total length of the game partition number is created respectively, to obtain a first iterator object and a second iterator object; The tuples in the first iterator object are taken out in sequence, and the taken-out tuples are converted into a list form to obtain a first grouping list; and the tuples in the second iterator object are taken out in sequence, and the taken-out tuples are converted into a list form to obtain a second grouping list.
7. A game server stress testing apparatus, characterized by, The device includes: The list obtaining module is configured to obtain a first grouping list and a second grouping list; the first grouping list includes a first number of client IP address groups, the second grouping list includes the first number of access server IP address groups, and the first number is a game partition number; The access address determining module is configured to, when the current client IP address is included in the first grouping list, determine a grouping identifier corresponding to the current client IP address in the first grouping list, and determine a target access server IP address group corresponding to the grouping identifier in the second grouping list; The robot account determining module is configured to determine a robot account corresponding to each process according to a preset total number of processes and a maximum number of robots borne by a single process; The process configuration modifying module is configured to modify process information in a stress test configuration file according to the robot account corresponding to each process and an access server IP address in the target access server IP address group. The stress test module is configured to perform stress testing on a game server according to the modified stress test configuration file.
8. An electronic device, comprising: The computer readable storage medium stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by the processor to implement the game server stress testing method in any one of claims 1-6.
9. A computer-readable storage medium, characterized in that, The computer program is executed by the processor to implement the game server stress testing method in any one of claims 1-6.
10. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to implement the game server stress testing method in any one of claims 1-6.
Citation Information
Patent Citations
A game server pressure testing method and device
CN109698771A
Game server testing method, device and system and computer storage medium
CN113535535A