Game data processing method, device, storage medium and electronic device
By building a computing server in the game server and transferring the combat calculation tasks to the computing server, the problem of limiting the number of users caused by high CPU consumption is solved, the number of people online at the same time on the server is increased, and the development process is simplified.
Patent Information
- Application Number
- CN202011249842.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-10
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2040-11-10
AI Technical Summary
Existing game servers consume a lot of CPU when performing battle calculations, which makes them unable to host too many users. Especially when idle battles are frequent, it affects the number of people online at the same time on the server.
Build a computing server through a logical server, and transfer combat calculations with high CPU consumption to the computing server to avoid cross-server communication and engine modifications, and reduce the CPU load of the logical server.
It increases the number of people online at the same time on the server, reduces the CPU consumption of the logical server, simplifies game development, and avoids cross-server communication problems.
Smart Images

Figure CN112245905B
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of game technology, and in particular to a game data processing method, a game data processing device, a computer-readable storage medium, and an electronic device. Background Art
[0002] The game server design can adopt a single-process structure. Although the development efficiency is high, the CPU consumption is large when performing battle calculations, which is not enough to support too many users. Especially in idle battles, the battle calculations are triggered more frequently, further affecting the number of people online at the same time.
[0003] In the prior art, the battle can be engine-based, using the high efficiency of the engine to reduce the CPU consumption of the battle. However, the disadvantage of this method is that the game engine and gameplay need to be modified, and cross-server communication is required, which reduces the stability of the game operation and increases the difficulty of game development.
[0004] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention
[0005] The purpose of the present disclosure is to provide a game data processing method, a game data processing device, a computer-readable storage medium and an electronic device, aiming to reduce the CPU consumption of a server and increase the number of simultaneous online users of the server.
[0006] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by the practice of the present disclosure.
[0007] According to one aspect of an embodiment of the present disclosure, a game data processing method is provided, including: a logic server responds to a battle request sent by a terminal, calculates battle parameters based on the battle request and game data corresponding to the terminal; sends the battle parameters to a computing server to obtain a battle result generated by the computing server through battle calculation based on the game data and the battle parameters; the logic server responds to a settlement request sent by the terminal, settles the battle result and generates settlement information, and returns the settlement information to the terminal for display.
[0008] According to some embodiments of the present disclosure, based on the aforementioned solution, the method further includes: constructing an operation server according to the logical server, including: creating a server instance identical to the logical server; and modifying operating parameters of the server instance to construct the operation server.
[0009] According to some embodiments of the present disclosure, based on the aforementioned scheme, before the logic server calculates the combat parameters, the method also includes: the logic server checks whether the game data needs to be updated, including: the logic server checks locally whether there is game data corresponding to the terminal; when the game data exists, checks whether the game data has changed; when the game data does not exist or has changed, determines that the game data needs to be updated, otherwise determines that it does not need to be updated.
[0010] According to some embodiments of the present disclosure, based on the aforementioned scheme, when the game data needs to be updated, the method further includes: the logic server locally filters the game data to be updated; packages the game data to be updated, stores it locally, and transmits the packaged game data to the operation server.
[0011] According to some embodiments of the present disclosure, based on the aforementioned scheme, the method further includes: the operation server unpacks the received encapsulated game data to obtain the game data to be updated; overwrites the original game data with the game data to be updated, and feeds back update completion information to the logic server.
[0012] According to some embodiments of the present disclosure, based on the aforementioned scheme, the transmission is an asynchronous transmission mode.
[0013] According to some embodiments of the present disclosure, based on the aforementioned scheme, the battle parameters are calculated according to the battle request and the game data, including: the logic server retrieves the corresponding initialization parameters according to the battle request; and the battle parameters are calculated according to the initialization parameters and the game data.
[0014] According to some embodiments of the present disclosure, based on the aforementioned scheme, the operation server performs combat calculations according to the game data and the combat parameters, including: the operation server performs combat initialization according to the received combat parameters and game data; and performs combat drills based on the results of the combat initialization to obtain combat results and combat recordings.
[0015] According to some embodiments of the present disclosure, based on the aforementioned solution, the method further includes: the computing server configuring a corresponding logical server identifier for the battle video, and sending the battle video with the identifier to the terminal.
[0016] According to some embodiments of the present disclosure, based on the aforementioned scheme, when the logic server sends the battle parameters to the operation server, the method further includes: the logic server configures a battle processing identifier for the battle request to avoid the operation server processing repeated battle requests.
[0017] According to some embodiments of the present disclosure, based on the aforementioned solution, the method further includes: after the logic server receives the battle result, deleting the battle processing identifier.
[0018] According to some embodiments of the present disclosure, based on the aforementioned scheme, before the computing server performs combat calculations, the method further includes: the computing server verifies whether combat is allowed, and performs combat calculations when combat is allowed.
[0019] According to some embodiments of the present disclosure, based on the aforementioned solution, the settlement request sent by the terminal includes a server identifier, and before the logical server performs settlement, the method further includes: the logical server verifies the server identifier, and performs settlement when the verification passes.
[0020] According to a second aspect of an embodiment of the present disclosure, a game data processing device is provided, including: a battle parameter calculation module, for a logical server to respond to a battle request sent by a terminal, and to calculate battle parameters based on the battle request and game data corresponding to the terminal; a battle result acquisition module, for sending the battle parameters to a computing server to obtain a battle result generated by the computing server through battle calculation based on the game data and the battle parameters; a battle settlement module, for a logical server to respond to a settlement request sent by the terminal, to settle the battle result and generate settlement information, and to return the settlement information to the terminal for display.
[0021] According to a third aspect of an embodiment of the present disclosure, there is provided a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the game data processing method in the above embodiment is implemented.
[0022] According to a fourth aspect of an embodiment of the present disclosure, an electronic device is provided, characterized in that it includes: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, the one or more processors implement the game data processing method as in the above-mentioned embodiment.
[0023] The exemplary embodiments of the present disclosure may have some or all of the following beneficial effects:
[0024] In the technical solutions provided in some embodiments of the present disclosure, the logic server responds to the battle request sent by the terminal, calculates the battle parameters based on the battle request and the game data corresponding to the terminal; sends the battle parameters to the operation server to obtain the battle result generated by the operation server according to the game data and the battle parameters; the logic server responds to the settlement request sent by the terminal, settles the battle result to generate settlement information, and returns the settlement information to the terminal for display. This game data processing method can transfer the battle calculation with high CPU consumption to the operation server for completion, so that the logic server does not have to wait for the battle calculation to end before performing the next battle calculation, and can process multiple battle requests at the same time, reducing the CPU consumption of the logic server, thereby increasing the number of people online at the same time on the logic server.
[0025] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present disclosure, and together with the specification, are used to explain the principles of the present disclosure. Obviously, the drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:
[0027] Figure 1 A flowchart schematically illustrates a method for processing game data in an exemplary embodiment of the present disclosure;
[0028] Figure 2 A schematic diagram of a system structure in an exemplary embodiment of the present disclosure is schematically shown;
[0029] Figure 3 A schematic diagram of a process of checking game data update in an exemplary embodiment of the present disclosure is schematically shown;
[0030] Figure 4 A data interaction diagram schematically illustrates a method for processing game data in an exemplary embodiment of the present disclosure;
[0031] Figure 5 A schematic diagram schematically shows the composition of a game data processing device in an exemplary embodiment of the present disclosure;
[0032] Figure 6 A schematic diagram schematically illustrates a computer-readable storage medium in an exemplary embodiment of the present disclosure;
[0033] Figure 7The structure diagram of a computer system of an electronic device in an exemplary embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION
[0034] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be more comprehensive and complete and will fully convey the concept of the example embodiments to those skilled in the art.
[0035] In addition, the described features, structures or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced without one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known methods, devices, implementations or operations are not shown or described in detail to avoid blurring the various aspects of the present disclosure.
[0036] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0037] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.
[0038] The game server can be designed with a single-process structure, which allows memory and variables to be shared within the same process, making the game development more efficient. However, due to the high CPU consumption during combat calculations, the single-process structure means that the game server can only execute combat calculations in sequence, so it is not enough to support too many users. In addition, if the game supports an idle module, combat calculations are triggered more frequently, further affecting the number of people online at the same time on the game server.
[0039] In the existing technology, the battle engine can be used to process the battle calculation process. The high efficiency of the engine can reduce the CPU consumption of the battle. However, the disadvantage of this method is that the battle engine needs to be rebuilt, the gameplay needs to be modified, and the problem of cross-server communication needs to be solved, which reduces the stability of the game operation and increases the difficulty of game development.
[0040] In view of the problems existing in the related technology, the present invention provides a game data processing method, which constructs another operation server with the same configuration through a logical server, and transfers the combat calculations with high CPU consumption to the operation server. Under the premise of avoiding cross-server communication and not modifying the engine and gameplay, the CPU consumption of the game server is reduced and the upper limit of the number of people online at the same time on the server is increased.
[0041] The implementation details of the technical solution of the embodiment of the present disclosure are elaborated in detail below.
[0042] Figure 1 The following is a schematic diagram showing a flow chart of a method for processing game data in an exemplary embodiment of the present disclosure. Figure 1 As shown, the game data processing method includes steps S1 to S3:
[0043] S1, the logic server responds to a battle request sent by a terminal, and calculates a battle parameter based on the battle request and game data corresponding to the terminal;
[0044] S2, sending the battle parameters to a computing server to obtain a battle result generated by the computing server through a battle calculation based on the game data and the battle parameters;
[0045] S3, the logic server settles the battle result in response to the settlement request sent by the terminal to generate settlement information, and returns the settlement information to the terminal for display.
[0046] In the technical solutions provided by some embodiments of the present disclosure, the logic server responds to the battle request sent by the terminal, sends the calculated battle parameters to the operation server, and after the operation server performs battle calculations based on the game data and the battle parameters to generate a battle result, the logic server settles the battle result to generate settlement information, and returns the settlement information to the terminal for display. This game data processing method can transfer the battle calculation with high CPU consumption to the operation server for completion, so that the logic server does not have to wait for the battle calculation to end before performing the next battle calculation, and can process multiple battle requests at the same time, thereby reducing the CPU consumption of the logic server and increasing the upper limit of the number of people online at the same time on the server.
[0047] Below, each step of the game data processing method in this example implementation will be described in more detail with reference to the accompanying drawings and embodiments.
[0048] refer to Figure 2 The system architecture shown in FIG. 1 is shown in FIG. 1 , and the above method can be applied between the user-side terminal, the logic server, and the computing server. Figure 2 As shown, the system architecture may include a user-side terminal device (such as Figure 2 The network 203 may be a smart phone 201, a portable computer 202, or one or more of them, and may also be a smart terminal device such as a tablet computer, a network 203, a logic server 204, and an operation server 205. The network 203 may be used as a medium for providing a communication link between the terminal device, the logic server 204, and the operation server 205. Figure 2 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to the implementation requirements. For example, the logic server 204 and the computing server 205 may be a server cluster composed of multiple servers.
[0049] In step S0, a computing server is constructed according to the logic server.
[0050] In one embodiment of the present disclosure, a computing server needs to be pre-built according to the logical server, and the specific process includes: creating a server instance that is the same as the logical server; and modifying the operating parameters of the server instance to build the computing server.
[0051] Among them, creating a server instance identical to the logical server may be to create another server with the same code as the logical server; then, modifying the running parameters of the server instance, for example, the hostnum (host parameter) of the server running configuration may be modified to form a computing server, then both the logical server and the computing server run in a virtual machine environment of a UNIX operating system, for example, the UNIX operating system may be freebsd, the virtual machine may be jails, and the two servers differ only in hostnum, and during the execution of the server, different functional codes are run according to different hostnums.
[0052] Based on the above method, there is no need to design codes separately when building a computing server, which avoids modifying the engine and reduces the difficulty of game development. In addition, the configurations of the logic server and the computing server are the same. Firstly, it can avoid cross-server communication problems caused by different servers. Secondly, it does not need to modify the gameplay and does not reduce the stability of the game operation. Thirdly, it can avoid increasing the maintenance cost of the server.
[0053] In step S1, the logic server responds to a battle request sent by a terminal and calculates battle parameters based on the battle request and game data corresponding to the terminal.
[0054] In one embodiment of the present disclosure, the terminal needs to send a combat request to the logic server. The combat request is used to control a virtual object in a virtual environment. The controlled object may be a player character (PC) or a non-player character (NPC). The object may be one or more. When controlling multiple virtual objects, multiple threads may be opened for parallel operation.
[0055] The battle request may be a battle request generated by a user through a terminal operation, or may be a battle request initiated autonomously by the terminal when the user is in an idle mode. Specifically, the battle request may include player information, enemy information, and battle information, such as battle information that may be information generated by a player switching equipment in the current battle, etc. The present disclosure does not specifically limit the content of the battle request.
[0056] In one embodiment of the present disclosure, after the logic server receives a battle request, the method further includes: the logic server checks whether the game data needs to be updated, including: the logic server checks locally whether there is game data corresponding to the terminal; when the game data exists, checks whether the game data has changed; when the game data does not exist or has changed, determines that the game data needs to be updated, otherwise determines that it does not need to be updated.
[0057] Figure 3 A schematic diagram of a process of checking game data update in an exemplary embodiment of the present disclosure is shown schematically. Figure 3 The specific steps are described in detail as follows:
[0058] Step S301, check whether there is game data locally, if yes, execute S302, if not, execute step S303.
[0059] In one embodiment of the present disclosure, the game data corresponds to the terminal. After the user sends a battle request through the terminal, the logic server receives the battle request, which includes the player character ID corresponding to the user. The logic server checks whether there is corresponding game data locally based on the player character ID.
[0060] Among them, game data may include character data, equipment data, combat data, etc. For example, character data may include the player's character ID, level, name, gender, appearance, and achievements; equipment data may include weapons and mounts; combat data may include attack power, defense power, speed, combat power, skills, qi and blood, five elements, partners, etc. The present disclosure does not specifically limit the content of game data.
[0061] Game data is stored in the logic server. Each player has initial data. The logic server records the player's various behaviors. After verification by the server, the player's current data is accumulated and calculated based on the initial data. Distributed storage (key-value) is used for storage. Different objects are divided according to the key (keyword). Each object is stored in a different location, with fast query speed and large data storage capacity.
[0062] Step S302, check whether the game data has changed, if it has changed, execute step S303, if it has not changed, execute step S306.
[0063] In one embodiment of the present disclosure, the logic server verifies the game data. For example, if the terminal sends a request to claim a reward containing a character ID, the logic server will check whether the character ID has claimed the reward. Or, if the player consumes an item to upgrade, the logic server will check whether the item is still in the game data, and determine whether the game data needs to be updated based on the verification result.
[0064] Step S303, updating the game data; if the logic server determines that the game data needs to be updated, the next step S304 is executed.
[0065] Step S304: the logic server sends the game data.
[0066] In one embodiment of the present disclosure, the specific process of the logic server sending game data includes: the logic server locally screens the game data to be updated; packages the game data to be updated, stores it locally, and transmits the packaged game data to the operation server.
[0067] First, the logic server locally filters the game data to be updated. Since the game data is directly stored in the server, the object can be directly read by key for filtering, avoiding the traditional method of reading saved files or interacting with the database, reducing the data interaction process, and reducing the delay in updating data.
[0068] During the screening process, data that is not used for combat calculations can be eliminated, such as the player's achievements, which have a large amount of data but are invalid data for combat calculations. This can avoid the transmission of redundant data and improve operating efficiency.
[0069] Then, read the content of the game data object to obtain a large data dictionary, put all the object content into a large dictionary, package and store it in memory, and then serialize this large dictionary into a string for encapsulation, and transmit it to the computing server through the RPC interface.
[0070] It should be noted that the transmission process uses asynchronous transmission, so the logic server does not need to obtain confirmation of successful transmission before processing other operations. Instead, it can process other operations first, and then notify the operation server to perform combat calculations when it receives information about successful transmission.
[0071] Step S305: the operation server overwrites the game data.
[0072] In one embodiment of the present disclosure, the specific process of the operation server overwriting the game data includes: the operation server unpacks the received encapsulated game data to obtain the game data to be updated; the game data to be updated overwrites the original game data, and feeds back the update completion information to the logic server.
[0073] Specifically, after receiving the encapsulated game data, the computing server deserializes it, restores it from a string to a dictionary, unpacks it, obtains the game data to be updated, and then overwrites the data in the corresponding object according to the key of the dictionary. After completion, it returns a message of successful transmission to the logic server.
[0074] Step S306: Do not update the game data; the logic server determines that the game data does not need to be updated.
[0075] When the game data does not need to be updated, the game data stored in the logic server and the computing server is the latest data and can be directly used for combat calculations, so there is no need to transmit new game data.
[0076] By checking whether the game data needs to be updated through the logic server, it can be ensured that the game data used for the current battle calculation is the latest data, avoiding calculation errors in the battle results or additional CPU consumption caused by secondary calculations. In addition, when it is detected that the game data does not need to be updated, the data will not be transmitted, thereby reducing the bandwidth consumption caused by transmitting data, avoiding user game lags, and further improving the user experience.
[0077] In one embodiment of the present disclosure, the step S1 of calculating the battle parameters according to the battle request and the game data includes: the logic server retrieves the corresponding initialization parameters according to the battle request; and calculates the battle parameters according to the initialization parameters and the game data.
[0078] For example, the battle parameter can be the amount of blood consumed by both sides in this battle. According to the battle request, the player's attack power, defense power and the difficulty of the monster can be obtained, which is the process of retrieving the initialization parameters. After that, the logic server can calculate the blood consumption of both sides in the game in advance through the initialization parameters as a battle parameter.
[0079] After calculating the battle parameters, the logic server calls the computing server interface to make the computing server conduct a battle drill. Since the configuration of the logic server and the additional computing server is the same, it is only necessary to modify the start_fight function of the original logic server to start the battle to the remote_start_fight function. The parameters used by the function are exactly the same. Therefore, only the function that calls the battle module can be modified to achieve the transfer of battle calculations, avoiding the modification of gameplay and reducing additional game development.
[0080] In step S2, the battle parameters are sent to a computing server to obtain a battle result generated by the computing server through combat calculation based on the game data and the battle parameters.
[0081] In one embodiment of the present disclosure, when the logic server sends the battle parameter to the computing server, the method further includes: the logic server configures a battle processing identifier for the battle request to avoid processing repeated battle requests. After the logic server receives the battle result, the battle processing identifier is deleted.
[0082] The battle processing flag is valid only within a specified time. The time starts when the logic server sends the battle to the computing server to start the battle calculation, and ends when the computing server returns the battle result to the logic server.
[0083] When the battle processing identifier is within the validity period, the operation server can ignore repeated battle requests to avoid users re-entering the battle due to user errors, and can also prevent the operation server from starting more than one battle calculation at the same time; when the validity period expires, the battle processing identifier is deleted, and the operation server continues to perform battle calculations.
[0084] For example, the battle processing identifier can be a temporary lock with a time limit. When the logic server sends the battle parameters to the computing server, a temporary lock is set for the battle request. During the lock period, the computing server does not open the same battle calculation. When the time limit is lifted, the temporary lock is unlocked and the original state is restored.
[0085] Temporary locks can be executed by opening a listening task on the logical server. By monitoring the battle calculation process in the battle server, real-time information of the battle calculation can be obtained, so that the battle processing identifier can be deleted at the end node of the battle calculation.
[0086] In addition, the battle processing identifier can also be used for terminal display. When the battle processing identifier is valid, if the user sends repeated battle requests in the terminal, the terminal will prompt, for example, the words "Battle in progress, please try again later" will be displayed on the game screen. When the validity period expires, the battle processing identifier is deleted, and the user can resend the battle request through the terminal.
[0087] In one embodiment of the present disclosure, before the operation server performs combat calculations, the method further includes: the operation server verifies whether combat is allowed, and performs combat calculations when combat is allowed.
[0088] Specifically, the operation server can verify whether it contains the same battle processing identifier as the current battle calculation. If the identifier is the same, it is a repeated battle request, and the operation server will not respond to the battle request. It can also verify the game data. If the terminal protocol is cracked and garbled game data is sent to request a battle, the operation server will verify the received data and determine that the battle is not allowed, so the battle drill will not be started. It can also, for example, check the player's level to see if it meets the requirements for fighting the enemy in the battle request.
[0089] In one embodiment of the present disclosure, the operation server performs combat calculations according to the game data and the combat parameters, including: the operation server performs combat initialization according to the received combat parameters and game data; and performs combat drills based on the results of the combat initialization to obtain combat results and combat videos.
[0090] The computing server also stores game data. When using the game data for combat calculation, if the game data is not updated, the computing server can perform combat calculation based on the local game data. If the game data is updated, the computing server performs combat calculation based on the combat parameters covered after the data update.
[0091] Among them, the operation server performs battle initialization according to the received battle parameters and game data. Specifically, the operation server obtains the battle environment and the parameter variables of both parties according to the received battle parameters, and generates the lineup and initializes the skills based on these parameters and game data. Specifically, the battle environment id and the monster parameter variables are obtained according to the parameters in the received remote_start_fight function, and then the battle preparation is carried out in combination with the player's battle information; the player obtains the pet data and partner data, generates the combat unit, initializes the skills, and places it in the designated position according to the predetermined rules; the enemy obtains the monster's appearance according to the battle environment id, initializes the skills, and determines the position.
[0092] Based on the above method, the battle calculation with high CPU consumption is transferred to the computing server to complete, which can reduce the CPU consumption of the logic server and thus increase the upper limit of the number of people online at the same time on the logic server. When the user chooses the idle mode, the probability of automatically triggering the battle is higher. This method can further reduce the CPU consumption of the logic server during the idle battle.
[0093] Then, the computing server performs a battle drill based on the result of the battle initialization to obtain the battle result and battle video. Specifically, based on the result of the battle initialization, at the beginning of each round, the order of attack is determined according to the speed of the player. When it is the turn of each unit to attack, different enemy units are selected according to different skills. According to the defense of the enemy unit and its own attack, it is calculated whether it hits the opponent. If it hits the opponent, how much blood is consumed. All actions will be recorded, and a battle video is generated in this process. Finally, according to the battle settlement rules, the battle result of this battle is determined. The battle result can be a player victory, defeat or a draw. For example, when the battle rounds exceed the preset number of rounds, it is determined to be a draw.
[0094] After the battle drill of the computing server is completed, the battle result and battle video corresponding to the battle request are obtained, and then the battle result is sent to the logic server for settlement, and the battle video is sent to the terminal for display.
[0095] In one embodiment of the present disclosure, the operation server configures a corresponding logical server identifier for the battle video, and sends the battle video with the identifier to the terminal. That is to say, although the operation server sends the battle video to the terminal, the source of the battle video is specified as the logical server. After the terminal plays the battle video, it can obtain settlement information from the logical server corresponding to the identifier. The logical server identifier can be the server ID corresponding to the logical server.
[0096] In addition, relevant information about playing the battle video will also be sent, such as the minimum time for playing the battle video, that is, how long the player can watch the battle video at least.
[0097] In step S3, the logic server settles the battle result to generate settlement information in response to the settlement request sent by the terminal, and returns the settlement information to the terminal for display.
[0098] In one embodiment of the present disclosure, the terminal displays the received battle video, and after the display is completed, sends a settlement request to the logic server, wherein the settlement request includes a server identifier.
[0099] The logical server receives the settlement request sent by the terminal, and verifies the server identifier in the settlement request. Specifically, the server identifier can be verified. If the server identifier is a valid server ID, the logical server can perform settlement. If the server ID is invalid, no settlement is performed.
[0100] In one embodiment of the present disclosure, the logic server settles the battle result to generate settlement information. Specifically, the callback function cb_fight_end_done is called according to the server identifier to calculate and obtain the settlement information.
[0101] Specifically, the settlement information can be the experience points issued at the end of the battle, and if the battle is won, it can include the rewards that can be received, such as gold coins, equipment, and mounts. Experience points or rewards can be accumulated, and when they exceed the preset threshold, more rewards can be obtained, such as character upgrades, opening gifts for level clearance, or opening new levels.
[0102] After the logic server obtains the settlement information, it returns the settlement information to the terminal for displaying the settlement result.
[0103] Figure 4 A data interaction diagram schematically illustrates a method for processing game data in an exemplary embodiment of the present disclosure, such as Figure 4 As shown, in step S401, the terminal sends a player's battle request; in step S402, the logic server checks whether the game data needs to be updated; in step S403, the logic server screens the data to be updated and encapsulates it; in step S404, the logic server calls the RPC interface to send the encapsulated game data; in step S405, the operation server unseals the game data and overwrites it; in step S406, the operation server feeds back the transmission end information; in step S407, the logic server calculates the battle parameters; in step S408, the logic server sends the battle parameters; in step S409, the operation server performs battle calculations based on the game data and the battle parameters; in step S410, the operation server returns the battle video and server ID; in step S411, the operation server returns the battle result; in step S412, the terminal plays the battle video; in step S413, the terminal sends a settlement request and server ID; in step S414, the logic server verifies the server ID and settles according to the battle result callback function; in step S415, the logic server returns the settlement result; in step S416, the terminal displays the settlement result.
[0104] The present disclosure provides a method for constructing another computing server with the same configuration through a logic server, so that the battle calculation with high CPU consumption can be transferred to the computing server for completion, thereby increasing the upper limit of the number of people online at the same time on the server, especially when the battle is frequently triggered when the machine is idle, and the number of people is increased more significantly. In addition, by only modifying the battle calculation function called in the logic server, it is avoided to modify the game engine and gameplay, avoid cross-server communication, facilitate development, and reduce maintenance costs.
[0105] It should be noted that although the steps of the method in the present disclosure are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.
[0106] Figure 5 The following is a schematic diagram showing the composition of a game data processing device in an exemplary embodiment of the present disclosure. Figure 5 As shown, the game data processing device 500 may include a battle parameter calculation module 501, a battle result acquisition module 502, and a battle settlement module 503. Among them:
[0107] A battle parameter calculation module 501 is used for the logic server to respond to a battle request sent by a terminal and calculate battle parameters based on the battle request and game data corresponding to the terminal;
[0108] A battle result acquisition module 502, used to send the battle parameters to a computing server to obtain a battle result generated by the computing server through battle calculation based on game data and the battle parameters;
[0109] The battle settlement module 503 is used for the logic server to settle the battle results in response to the settlement request sent by the terminal, generate settlement information, and return the settlement information to the terminal for display.
[0110] According to an exemplary embodiment of the present disclosure, the method further includes: constructing an operation server according to the logical server, including: creating a server instance identical to the logical server; and modifying operating parameters of the server instance to construct the operation server.
[0111] According to an exemplary embodiment of the present disclosure, the combat parameter calculation module 501 also includes: a checking and updating unit (not shown in the figure), wherein the logic server locally checks whether there is game data corresponding to the terminal; when the game data exists, checks whether the game data has changed; when the game data does not exist or has changed, determines that the game data needs to be updated, otherwise determines that it does not need to be updated.
[0112] According to an exemplary embodiment of the present disclosure, the combat parameter calculation module 501 also includes: a data transmission unit (not shown in the figure), which is used for the logic server to locally screen the game data to be updated; package the game data to be updated, store it locally, and transmit the packaged game data to the operation server.
[0113] According to an exemplary embodiment of the present disclosure, the combat parameter calculation module 501 also includes: a data update unit (not shown in the figure), which is used for the operation server to unpack the received encapsulated game data to obtain the game data to be updated; overwrite the original game data with the game data to be updated, and feedback the update completion information to the logic server.
[0114] According to an exemplary embodiment of the present disclosure, the transmission is an asynchronous transmission mode.
[0115] According to an exemplary embodiment of the present disclosure, the combat parameter calculation module 501 also includes: a parameter calculation unit (not shown in the figure), which is used for the logic server to retrieve the corresponding initialization parameters according to the combat request; and calculate the combat parameters according to the initialization parameters and the game data.
[0116] According to an exemplary embodiment of the present disclosure, the battle result acquisition module 502 also includes: a battle calculation unit (not shown in the figure), which is used for the operation server to initialize the battle according to the received battle parameters and game data; and to perform battle drills based on the results of the battle initialization to obtain battle results and battle videos.
[0117] According to an exemplary embodiment of the present disclosure, the battle result acquisition module 502 also includes: a video identification unit (not shown in the figure), which is used by the operation server to configure a corresponding logical server identification for the battle video and send the battle video with the identification to the terminal.
[0118] According to an exemplary embodiment of the present disclosure, the battle result acquisition module 502 also includes: a battle identification unit (not shown in the figure), which is used by the logic server to configure a battle processing identifier for the battle request to avoid the computing server processing repeated battle requests.
[0119] According to an exemplary embodiment of the present disclosure, the battle result acquisition module 502 also includes: a battle calculation verification unit (not shown in the figure), which is used for the operation server to verify whether the battle is allowed, and then perform battle calculation when the battle is allowed.
[0120] According to an exemplary embodiment of the present disclosure, the battle settlement module 503 further includes: a battle identification deletion unit (not shown in the figure), which is used to delete the battle processing identification after the logic server receives the battle result.
[0121] According to an exemplary embodiment of the present disclosure, the battle settlement module 503 further includes: a settlement verification unit (not shown in the figure), which is used for the logic server to verify the server identifier and perform settlement when the verification passes.
[0122] The specific details of each module in the above-mentioned game data processing device 500 have been described in detail in the corresponding game data processing method, so they will not be repeated here.
[0123] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.
[0124] In an exemplary embodiment of the present disclosure, a storage medium capable of implementing the above method is also provided. Figure 6 A schematic diagram schematically illustrates a computer-readable storage medium in an exemplary embodiment of the present disclosure, such as Figure 6 As shown, a program product 600 for implementing the above method according to an embodiment of the present disclosure is described, which can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a mobile phone. However, the program product of the present disclosure is not limited thereto. In this document, a readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, an apparatus or a device.
[0125] In an exemplary embodiment of the present disclosure, an electronic device capable of implementing the above method is also provided. Figure 7 The structure diagram of a computer system of an electronic device in an exemplary embodiment of the present disclosure is schematically shown.
[0126] It should be noted that Figure 7The computer system 700 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0127] like Figure 7 As shown, the computer system 700 includes a central processing unit (CPU) 701, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 702 or the program loaded from the storage part 708 to the random access memory (RAM) 703. In the RAM 703, various programs and data required for system operation are also stored. The CPU 701, the ROM 702 and the RAM 703 are connected to each other through a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.
[0128] The following components are connected to the I / O interface 705: an input section 706 including a keyboard, a mouse, etc.; an output section 707 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the I / O interface 705 as needed. A removable medium 711, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 710 as needed so that a computer program read therefrom is installed into the storage section 708 as needed.
[0129] In particular, according to an embodiment of the present disclosure, the process described below with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication section 709, and / or installed from a removable medium 711. When the computer program is executed by a central processing unit (CPU) 701, various functions defined in the system of the present disclosure are executed.
[0130] It should be noted that the computer-readable medium shown in the embodiment of the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by an instruction execution system, device or device or used in combination with it. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a computer-readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate, or transmit programs for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0131] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0132] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware, and the units described may also be arranged in a processor. The names of these units do not, in some cases, constitute limitations on the units themselves.
[0133] As another aspect, the present disclosure further provides a computer-readable medium, which may be included in the electronic device described in the above embodiment; or may exist independently without being assembled into the electronic device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by an electronic device, the electronic device implements the method described in the above embodiment.
[0134] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.
[0135] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the implementation of the present disclosure.
[0136] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure.
[0137] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A method for processing game data, It is characterized in that include: Create a server instance identical to the logical server; Modifying the operating parameters of the server instance to construct a computing server; The logic server responds to the battle request sent by the terminal and calculates the battle parameters based on the battle request and the game data corresponding to the terminal; Sending the battle parameters to the operation server to obtain a battle result generated by the operation server through battle calculation according to the game data and the battle parameters; wherein the operation server is constructed according to the logic server; The logic server settles the battle result in response to the settlement request sent by the terminal to generate settlement information, and returns the settlement information to the terminal for display; Before the logic server calculates the combat parameters, the logic server checks locally whether there is game data corresponding to the terminal; when the game data exists, it checks whether the game data has changed; when the game data does not exist or has changed, it is determined that the game data needs to be updated, otherwise it is determined that the game data does not need to be updated.
2. The game data processing method according to claim 1, It is characterized in that When the game data needs to be updated, the method further includes: The logic server locally screens the game data to be updated; The game data to be updated is packaged and stored locally, and the packaged game data is transmitted to the computing server.
3. The game data processing method according to claim 2, It is characterized in that The method further comprises: The computing server decapsulates the received encapsulated game data to obtain the game data to be updated; The game data to be updated overwrites the original game data, and update completion information is fed back to the logic server.
4. The game data processing method according to claim 2, It is characterized in that The transmission is in asynchronous transmission mode.
5. The game data processing method according to claim 1, It is characterized in that The step of calculating the battle parameters according to the battle request and the game data includes: The logic server retrieves corresponding initialization parameters according to the battle request; The combat parameters are calculated based on the initialization parameters and the game data.
6. The game data processing method according to claim 1, It is characterized in that The computing server performs combat calculations according to the game data and the combat parameters, including: The computing server performs combat initialization according to the received combat parameters and game data; A battle drill is performed based on the result of the battle initialization to obtain a battle result and a battle video.
7. The game data processing method according to claim 6, It is characterized in that The method further includes: the computing server configuring a corresponding logical server identifier for the battle video, and sending the battle video with the identifier to the terminal.
8. The game data processing method according to claim 1, It is characterized in that When the logic server sends the battle parameter to the operation server, the method further includes: the logic server configuring a battle processing identifier for the battle request to prevent the operation server from processing repeated battle requests.
9. The game data processing method according to claim 8, It is characterized in that The method further includes: after the logic server receives the battle result, deleting the battle processing identifier.
10. The game data processing method according to claim 1, It is characterized in that Before the operation server performs combat calculation, the method further includes: the operation server verifies whether combat is allowed, and performs combat calculation when combat is allowed.
11. The game data processing method according to claim 1, It is characterized in that The settlement request sent by the terminal includes a server identifier. Before the logical server performs settlement, the method further includes: the logical server verifies the server identifier, and performs settlement when the verification passes.
12. A game data processing device, It is characterized in that include: Battle parameter calculation module, used to create server instances identical to the logical server; Modifying the operating parameters of the server instance to construct a computing server; The logic server responds to the battle request sent by the terminal and calculates the battle parameters based on the battle request and the game data corresponding to the terminal; A battle result acquisition module, used for sending the battle parameters to the operation server to obtain the battle result generated by the operation server through battle calculation according to the game data and the battle parameters; wherein the operation server is constructed according to the logic server; A battle settlement module, for the logic server to respond to the settlement request sent by the terminal, settle the battle result to generate settlement information, and return the settlement information to the terminal for display; The combat parameter calculation module also includes a checking and updating unit, which is used for the logic server to check locally whether there is game data corresponding to the terminal before the logic server calculates the combat parameters; when the game data exists, check whether the game data has changed; when the game data does not exist or has changed, determine that the game data needs to be updated, otherwise determine that it does not need to be updated.
13. A computer-readable storage medium having a computer program stored thereon, wherein when the program is executed by a processor, the game data processing method according to any one of claims 1 to 11 is implemented.
14. An electronic device, It is characterized in that include: one or more processors; A storage device for storing one or more programs, which, when executed by the one or more processors, enables the one or more processors to implement the game data processing method as described in any one of claims 1 to 11.
