Game server code hot update method and device, storage medium

By using two process mechanisms to realize the thermal update of static languages ​​in the game server, the problems of low efficiency and high complexity of hot update of game server code in the existing technology are solved, the development and maintenance efficiency is improved, and the rapid operation of modern game operations is met. Iterative requirements.

CN112426721BActive Publication Date: 2025-01-10CHENGDU PERFECT TIANZHIYOU BUSINESS CONSULTING CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202011419530.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-07
Publication Date
2025-01-10
Estimated Expiration
2040-12-07

AI Technical Summary

Technical Problem

The existing game server code is inefficient in hot update efficiency and high complexity. The lack of static inspection of dynamic languages ​​leads to low development and maintenance efficiency, which cannot meet the rapid iteration needs of modern game operations.

Method used

By introducing two process mechanisms in the game server, disconnecting the old process from the client, the old process passes the processing progress and cached data packets to the new process, and the new process re-establishes the connection with the client, realizing the hot update of the static language, reducing the System complexity and improve development and maintenance efficiency.

Benefits of technology

It realizes rapid updates to game servers without interrupting game services, improves the efficiency and reliability of hot updates, reduces system complexity, and improves development and maintenance efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112426721B_ABST
    Figure CN112426721B_ABST
Patent Text Reader

Abstract

The present application discloses a method and device for hot updating of game server code, a storage medium, and a computer device, the method comprising: in response to a hot update instruction, determining a first process and a second process corresponding to the hot update instruction, and disconnecting the connection between the first process and the client, wherein the first process is used to store the processing progress and process cache data packets corresponding to the first client data packet; connecting the first process through the second process, sending the processing progress and the process cache data packets corresponding to the first client data packet to the second process through the first process, and exiting the first process; establishing a connection between the second process and the client, and sending the process cache data packet to the client through the second process. The present application helps to reduce the complexity of hot updating of game servers and improve the development efficiency and maintenance efficiency of hot updating of game servers.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method and device for hot updating game server codes, a storage medium, and a computer device. Background Art

[0002] An important feature of the game business is that the requirements are changeable and complex, which leads to a large number of bugs in game applications. Although there are internal tests, the diversity of online environments far exceeds that of internal test environments. No one can guarantee that there will be no major bugs after the game is launched, and no one can guarantee that there are no major loopholes in the gameplay. How to quickly handle bugs and player feedback after the game is launched and limit the problems to a controllable range has become the key to the successful operation of a game. In addition, some gameplay problems and requirements can only be discovered during the online interaction with players, and game planners are also in urgent need of a method to quickly update the game online. In this situation, traditional server maintenance and restart strategies are no longer suitable for the needs of modern game operations. Major game service providers are in urgent need of a method to update game servers without interrupting game services, that is, a hot update method for servers, to meet the needs of online rapid iteration of games.

[0003] According to the scope of hot update content, it can be roughly divided into two categories: data hot update and code hot update. Among them, the update scope of data hot update is limited, and it often cannot meet the update requirements of game servers. At present, the industry generally uses the characteristics of dynamic language to load and execute new code at runtime to achieve hot update of code. In the prior art, the main defect of code hot update using dynamic language characteristics is low operating efficiency. Generally speaking, the operating efficiency of dynamic languages ​​is generally more than 10 times slower than that of static languages. This leads to relatively low server load using dynamic language hot update. If you want to improve its performance, you need to provide some high-frequency codes in the form of C / C++ external libraries, which increases the complexity of the system and causes this part of the code to be unable to be hot updated. In addition, due to the lack of static checking, dynamic languages ​​have low development efficiency and maintenance efficiency. Therefore, how to improve the hot update efficiency and reliability of game servers has become a hot issue in the industry. Summary of the invention

[0004] In view of this, the present application provides a game server code hot update method and device, storage medium, and computer equipment, which help reduce the complexity of game server hot update and improve the development efficiency and maintenance efficiency of game server hot update.

[0005] According to one aspect of the present application, a game server code hot update method is provided, comprising:

[0006] In response to a hot update instruction, determining a first process and a second process corresponding to the hot update instruction, and disconnecting the first process from the client, wherein the first process is used to store a processing progress corresponding to a first client data packet and a process cache data packet;

[0007] Connecting the first process through the second process, sending the processing progress corresponding to the first client data packet and the process cache data packet to the second process through the first process, and exiting the first process;

[0008] A connection is established between the second process and the client, and the process cache data packet is sent to the client through the second process.

[0009] Optionally, the first process, the second process and the client act as data receivers to receive and process data packets carrying numbers, and send corresponding response numbers based on the processed data packets; the first process, the second process and the client act as data senders to send data packets carrying numbers and save data packets for which corresponding response numbers have not been received as cached data packets.

[0010] Optionally, the first process is specifically used to receive and process a first client data packet sent by the client, and send a corresponding first process response number based on the processed first client data packet, and send a first process data packet to the client, and save the first process data packet not responded by the client as a process cache data packet;

[0011] The sending, through the first process, the processing progress corresponding to the first client data packet and the process cache data packet to the second process specifically includes:

[0012] Serializing the player status data of the first process to generate a player status data packet;

[0013] The player status data packet, the first process response number, and the process cache data packet are sent to the second process through the first process.

[0014] Optionally, after establishing the connection between the second process and the client, the method further includes:

[0015] The player status data packet is deserialized by the second process to obtain player status data.

[0016] Optionally, sending the process cache data packet to the client through the second process specifically includes:

[0017] sending the first process response number to the client through the second process, controlling the client to send a corresponding second client data packet to the second process based on the first process response number, receiving and processing the second client data packet through the second process, and sending a corresponding second process response number based on the processed second client data packet; and

[0018] The client response number sent by the client is received through the second process, and a second process data packet is sent to the client based on the client response number and the process cache data packet.

[0019] Optionally, the method further comprises:

[0020] A first client data packet is sent to the first process through the client, and first client data for which no response is received is saved as a client cache data packet, wherein the client cache data packet is used to be sent to the second process as a second client data packet after the client establishes a connection with the second process.

[0021] According to another aspect of the present application, a game server code hot update device is provided, comprising:

[0022] An update instruction response module, used to respond to a hot update instruction, determine a first process and a second process corresponding to the hot update instruction, and disconnect the first process from the client, wherein the first process is used to store a processing progress corresponding to a first client data packet and a process cache data packet;

[0023] A first connection module, configured to connect to the first process through the second process, send the processing progress corresponding to the first client data packet and the process cache data packet to the second process through the first process, and exit the first process;

[0024] The second connection module is used to establish a connection between the second process and the client, and send the process cache data packet to the client through the second process.

[0025] Optionally, the first process, the second process and the client act as data receivers to receive and process data packets carrying numbers, and send corresponding response numbers based on the processed data packets; the first process, the second process and the client act as data senders to send data packets carrying numbers and save data packets for which corresponding response numbers have not been received as cached data packets.

[0026] Optionally, the first process is specifically used to receive and process a first client data packet sent by the client, and send a corresponding first process response number based on the processed first client data packet, and send a first process data packet to the client, and save the first process data packet not responded by the client as a process cache data packet;

[0027] The first connection module specifically includes:

[0028] A state data generating unit, used for serializing the player state data of the first process to generate a player state data packet;

[0029] A status data sending unit is used to send the player status data packet, the first process response number and the process cache data packet to the second process through the first process.

[0030] Optionally, the device further comprises:

[0031] The status data processing module is used to, after establishing a connection between the second process and the client, deserialize the player status data packet through the second process to obtain the player status data.

[0032] Optionally, the second connection module specifically includes:

[0033] a client data sending unit, configured to send the first process response number to the client through the second process, control the client to send a corresponding second client data packet to the second process based on the first process response number, receive and process the second client data packet through the second process, and send a corresponding second process response number based on the processed second client data packet;

[0034] The process data sending unit is used to receive the client response number sent by the client through the second process, and send a second process data packet to the client based on the client response number and the process cache data packet.

[0035] Optionally, the device further comprises:

[0036] A client data sending module is used to send a first client data packet to the first process through the client, and save the first client data for which no response is received as a client cache data packet, wherein the client cache data packet is used to send to the second process as a second client data packet after the client establishes a connection with the second process.

[0037] According to another aspect of the present application, a storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the above-mentioned game server code hot update method is implemented.

[0038] According to another aspect of the present application, a computer device is provided, including a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, wherein the processor implements the above-mentioned game server code hot update method when executing the program.

[0039] By means of the above technical scheme, the present application provides a game server code hot update method and device, storage medium, and computer equipment, which determine the old process corresponding to the hot update instruction, namely the first process, and the new process, namely the second process, disconnect the first process from the client, and connect the second process to the first process, send the processing progress corresponding to the first client data packet in the first process and the process cache data packet to the second process, then exit the first process, and then establish a connection between the second process and the client, and use the second process to continue to receive the client's data packets and send cached data packets to the client, so as to realize the update of the first process by the second process. The embodiment of the present application realizes the use of static language to update the game, and inherits the processing progress and process cache data packet corresponding to the first client data packet in the first process through the second process, so as to use the second process to replace the first process to realize the hot update of the game server, which solves the problem of high complexity of the update process caused by relying on C / C++ external library to provide high-frequency code in the prior art, abandons the original complex code editing method, reduces the complexity of hot update of the game server, and uses static language for update, which solves the problem of low development efficiency and maintenance efficiency due to the lack of static checking of dynamic language in the prior art, and can perform static checking on the second process, thereby improving the development efficiency and maintenance efficiency of hot update of the game server.

[0040] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0042] Figure 1 A schematic diagram of a process of a game server code hot update method provided in an embodiment of the present application is shown;

[0043] Figure 2 A schematic diagram showing a process flow of another method for hot updating game server codes provided in an embodiment of the present application is shown;

[0044] Figure 3 A schematic diagram of the structure of a game server code hot update device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION

[0045] The present application will be described in detail below with reference to the accompanying drawings and in combination with embodiments. It should be noted that the embodiments and features in the embodiments of the present application can be combined with each other without conflict.

[0046] In this embodiment, a game server code hot update method is provided, such as Figure 1 As shown, the method includes:

[0047] Step 101, in response to a hot update instruction, determining a first process and a second process corresponding to the hot update instruction, and disconnecting the first process from the client, wherein the first process is used to store a processing progress corresponding to a first client data packet and a process cache data packet;

[0048] Step 102, connecting the first process through the second process, sending the processing progress corresponding to the first client data packet and the process cache data packet to the second process through the first process, and exiting the first process;

[0049] Step 103: Establish a connection between the second process and the client, and send the process cache data packet to the client through the second process.

[0050] The embodiment of the present application can be applied to a hot update device for game server code, which can be integrated into the game server. The method provided in the embodiment is applicable to the data inheritance and data transmission of new and old processes and clients when the game server is hot updated, so as to update the old process in the game server to a new process without disconnecting the game on the client side, that is, to implement the hot update of the game server, thereby updating the game content or repairing game vulnerabilities, etc. Among them, the hot update instruction can be initiated by the game server, for example, the server forces the game to be updated during the player's experience of the game, and the hot update instruction can also be initiated by the player, for example, during the player's experience of the game, the player is asked whether to update through a pop-up window interface in the game, and the game is updated after the user confirms.

[0051] In the embodiment of the present application, according to the hot update instruction, the first process and the second process corresponding to the hot update instruction are determined. The process refers to a running activity on a data set in a computer program. It is the basic unit of resource allocation and scheduling of the system and the basis of the operating system structure. Among them, the first process is the old process that needs to be replaced in this game server update, or the old process generated by the old code, and the second process is a new process used to replace the first process, or the new process generated by the new code that replaces the original old code. When the game is running normally and no hot update is performed, based on the data transmission between the first process and the client, the game character realizes the activity in the game world. For example, the client sends a message to the first process of the game server to control the walking of the game character, and the first process processes the message process to generate the walking data of the game character in the game world and sends it to the client. The first process stores the first client data packet sent by the client, such as the message to control the walking of the game character, and the first process also stores the process cache data packet, such as the walking data of the game character in the game world that has not been sent or failed to be sent. When the game server starts to perform hot update, the connection between the first process and the client is disconnected, and the first process no longer receives data packets sent by the client. Then, a connection is established between the first process and the second process, and the second process is used to inherit the data packets stored in the first process. Specifically, the first process can be controlled to send the processing progress and process cache data packets corresponding to the first client data packets to the second process, so that the second process inherits the data in the first process. Based on the inherited process cache data packets and the processing progress of the first client data packets, the second process can continue to interact with the client through the second process after the game is updated. After the data in the first process is inherited by the second process, the first process exits.

[0052] Furthermore, a connection is established between the second process and the client to implement hot update of the game server. The second process continues to send to the client the above-mentioned process cache data packets that have been processed by the first process but have not yet sent the processing results to the client or the sending fails. This ultimately enables the second process to inherit the data in the first process, and the second process continues to receive data packets sent by the client instead of the original first process, so as to implement the corresponding game functions through the second process, and implement the update of the game without disconnecting the game, that is, to achieve hot update of the game.

[0053] By applying the technical solution of this embodiment, the old process corresponding to the hot update instruction, i.e., the first process, and the new process, i.e., the second process, are determined, the connection between the first process and the client is disconnected, and the second process is connected to the first process, and the processing progress corresponding to the first client data packet in the first process and the process cache data packet are sent to the second process, and then the first process is exited, and then the connection between the second process and the client is established, and the second process is used to continue to receive the data packet of the client and send the cache data packet to the client, so as to realize the update of the first process by the second process. The embodiment of the present application realizes the use of static language for game update, and the second process inherits the processing progress and process cache data packet corresponding to the first client data packet in the first process, so as to realize the hot update of the game server by using the second process instead of the first process, solves the problem of high complexity of the update process caused by relying on the C / C++ external library to provide high-frequency code in the prior art, abandons the original complex code editing method, reduces the complexity of the hot update of the game server, and adopts static language for update, solves the problem of low development efficiency and maintenance efficiency due to the lack of static inspection in the dynamic language in the prior art, and can perform static inspection on the second process, thereby improving the development efficiency and maintenance efficiency of the hot update of the game server.

[0054] Further, as a refinement and extension of the specific implementation of the above embodiment, in order to fully illustrate the specific implementation process of this embodiment, another game server code hot update method is provided, which includes:

[0055] Step 201, in response to a hot update instruction, determining a first process and a second process corresponding to the hot update instruction, and disconnecting the first process from the client;

[0056] In an embodiment of the present application, specifically, the first process, the second process and the client act as data receivers for receiving and processing data packets carrying numbers, and sending corresponding response numbers based on the processed data packets; the first process, the second process and the client act as data senders for sending data packets carrying numbers and saving data packets for which corresponding response numbers have not been received as cached data packets.

[0057] In the above embodiment, the first process, the second process and the client all serve as data receivers and data senders. After receiving and processing the data, the receiver will respond to the sender, indicating that a certain data packet has been processed. For the data packets that have not received a response, the sender will cache them. In this way, the two connected parties form an unanswered sliding window data packet cache. In this embodiment, when the first process, the second process and the client serve as data receivers, they are used to receive and process data packets carrying numbers, process the data packets, and send corresponding response numbers to the sender for the processed data packets. In order to distinguish each data packet, the sender will send the number of the data packet at the same time when sending the data packet, that is, send the data packet carrying the number. In addition, for the response number sent by the receiver, as long as the receiver processes the data packet, it will generate and send the response number of the corresponding data packet. For example, the receiver calls the corresponding processing function based on the received data packet. As long as the processing function is called, the response number corresponding to the data packet can be sent. In addition, when the first process, the second process and the client act as data senders, they are used to send data packets carrying numbers and receive response numbers for the data packets returned by the data receiver, and save data packets that are not responded to as cached data packets.

[0058] In a specific application scenario, the first process is specifically used to receive and process a first client data packet sent by the client, and send a corresponding first process response number based on the processed first client data packet, and send a first process data packet to the client, and save the first process data packet that the client has not responded to as a process cache data packet.

[0059] Step 202, serializing the player status data of the first process to generate a player status data packet;

[0060] Step 203, sending the player status data packet, the first process response number, and the process cache data packet to the second process through the first process;

[0061] Step 204, establishing a connection between the second process and the client, and deserializing the player status data packet through the second process to obtain player status data;

[0062] In step 202 and step 204, if Figure 2As shown, when the first process sends data to the second process, it can specifically send the first process response number, process cache data packet and player status data packet to the second process. The player status data packet is generated based on the player status data inherent in the first process and is serialized. The first process sends the player status data packet to the second process. During the hot update process of the game server, the player status data is serialized by the first process, and the serialized player status data packet is sent to the second process. The serialized player status data packet is deserialized by the second process to restore the player status data, thereby realizing the synchronous inheritance of the player status information during the hot update process of the game server.

[0063] Step 205: sending the first process response number to the client through the second process, controlling the client to send a corresponding second client data packet to the second process based on the first process response number, receiving and processing the second client data packet through the second process, and sending a corresponding second process response number based on the processed second client data packet;

[0064] Step 206: Receive the client response number sent by the client through the second process, and send a second process data packet to the client based on the client response number and the process cache data packet.

[0065] In step 205 to step 206, after the connection between the second process and the client is established, the second process can replace the original first process to exchange data with the client, the second process can continue to send the process cache data that the first process has not sent or failed to send to the client, and can also receive the client data packet sent by the client. Specifically, the first process response number can indicate the processing progress of the data packet sent by the client by the first process. In this embodiment, the second process sends the first process response number to the client. After receiving the first process response number, the client sends the second client data packet corresponding to the first process response number to the second process according to the client cache data packet stored by itself. For example, the first process response number is 5, which can indicate that the first process has processed the data packet 5 and the previous data packets sent by the client, and then the second process can continue to receive and process the client data packets after data packet 5. For the second process, the second process receives the second client data packet sent by the client, processes the second client data packet (for example, calls a processing function), and sends the second process response number corresponding to the processed second client data packet to the client. For example, if the second process receives and processes the client data packet 6, the process response number corresponding to the client data packet 6 should be sent to the client to inform the client that the data packet has been received and processed by the second process.

[0066] In addition, since there may be some process cache data packets that have not been sent or failed to be sent in the original first process, in order to ensure that the client can receive all process data packets generated by the process and avoid the phenomenon of repeated data packet sending. The client sends the client response number to the second process to inform the client of the progress of the process data packets that have been received and processed. After the second process receives the client response number, it sends the second process data packet to the client based on the client response number and the process cache data packet inherited from the first process. After that, the second process and the client can exchange data based on the above-mentioned receiving and sending methods of the receiver and sender.

[0067] In any embodiment of the present application, specifically, it also includes: sending a first client data packet to the first process through the client, and saving the first client data for which no response is received as a client cache data packet, wherein the client cache data packet is used to send to the second process as a second client data packet after the client establishes a connection with the second process.

[0068] In the above embodiment, during the hot update of the game server, after the connection between the first process and the client is disconnected, the first process and the client can still send data packets to each other, but because the connection is disconnected, the receiver cannot receive and generate a response to the data packet, and the sender will save the data packet to which the response is not received as a cached data packet. In a specific application scenario, if the sender is the client, it is saved as a client cached data packet; if the sender is the first process, it is saved as a process cached data packet, wherein the cached data packet is sent after the second process establishes a connection with the client based on the method described in steps 205 to 206.

[0069] Further, as Figure 1 The specific implementation of the method, the embodiment of the present application provides a game server code hot update device, such as Figure 3 As shown, the device comprises:

[0070] An update instruction response module 31 is used to respond to a hot update instruction, determine a first process and a second process corresponding to the hot update instruction, and disconnect the first process from the client, wherein the first process is used to store a processing progress corresponding to a first client data packet and a process cache data packet;

[0071] A first connection module 32, configured to connect to the first process through the second process, send the processing progress corresponding to the first client data packet and the process cache data packet to the second process through the first process, and exit the first process;

[0072] The second connection module 33 is used to establish a connection between the second process and the client, process the first client data packet through the second process, and send the process cache data packet to the client through the second process.

[0073] Optionally, the first process, the second process and the client act as data receivers to receive and process data packets carrying numbers, and send corresponding response numbers based on the processed data packets; the first process, the second process and the client act as data senders to send data packets carrying numbers and save data packets for which corresponding response numbers have not been received as cached data packets.

[0074] Optionally, the first process is specifically used to receive and process a first client data packet sent by the client, and send a corresponding first process response number based on the processed first client data packet, and send a first process data packet to the client, and save the first process data packet not responded by the client as a process cache data packet;

[0075] The first connection module 32 specifically includes:

[0076] A state data generating unit 321 is used to serialize the player state data of the first process to generate a player state data packet;

[0077] The status data sending unit 322 is used to send the player status data packet, the first process response number and the process cache data packet to the second process through the first process.

[0078] Optionally, the device comprises:

[0079] The status data processing module 34 is used to, after establishing a connection between the second process and the client, deserialize the player status data packet through the second process to obtain the player status data.

[0080] Optionally, the second connection module 33 specifically includes:

[0081] The client data sending unit 332 is used to send the first process response number to the client through the second process, control the client to send a corresponding second client data packet to the second process based on the first process response number, receive and process the second client data packet through the second process, and send a corresponding second process response number based on the processed second client data packet;

[0082] The process data sending unit 333 is used to receive the client response number sent by the client through the second process, and send a second process data packet to the client based on the client response number and the process cache data packet.

[0083] Optionally, the device further comprises:

[0084] The client data sending module 34 is used to send a first client data packet to the first process through the client, and save the first client data for which no response is received as a client cache data packet, wherein the client cache data packet is used to be sent to the second process as a second client data packet after the client establishes a connection with the second process.

[0085] It should be noted that for other corresponding descriptions of the functional units involved in the game server code hot update device provided in the embodiment of the present application, please refer to Figure 1 to Figure 2 The corresponding description in the method will not be repeated here.

[0086] Based on the above Figure 1 to Figure 2 The method shown in the embodiment of the present application is accordingly provided with a storage medium on which a computer program is stored, and when the computer program is executed by a processor, the above-mentioned Figure 1 to Figure 2 The game server code hot update method shown.

[0087] Based on this understanding, the technical solution of the present application 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.), and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each implementation scenario of the present application.

[0088] Based on the above Figure 1 to Figure 2 The method shown, and Figure 3 In order to achieve the above-mentioned purpose, the embodiment of the present application further provides a computer device, which can be a personal computer, a server, a network device, etc. The computer device includes a storage medium and a processor; the storage medium is used to store a computer program; the processor is used to execute the computer program to achieve the above-mentioned Figure 1 to Figure 2 The game server code hot update method shown.

[0089] Optionally, the computer device may further include a user interface, a network interface, a camera, a radio frequency (RF) circuit, a sensor, an audio circuit, a WI-FI module, etc. The user interface may include a display, an input unit such as a keyboard, etc., and the optional user interface may also include a USB interface, a card reader interface, etc. The network interface may optionally include a standard wired interface, a wireless interface (such as a Bluetooth interface, a WI-FI interface), etc.

[0090] Those skilled in the art will appreciate that the computer device structure provided in this embodiment does not limit the computer device, and may include more or fewer components, or a combination of certain components, or different component arrangements.

[0091] The storage medium may also include an operating system and a network communication module. The operating system is a program that manages and saves the hardware and software resources of the computer device, and supports the operation of information processing programs and other software and / or programs. The network communication module is used to realize communication between the components inside the storage medium, and communication with other hardware and software in the physical device.

[0092] Through the description of the above implementation methods, technical personnel in this field can clearly understand that the present application can be implemented by means of software plus a necessary general hardware platform, and can also be implemented by hardware to determine the old process corresponding to the hot update instruction, that is, the first process, and the new process, that is, the second process, disconnect the connection between the first process and the client, and connect the second process to the first process, send the processing progress corresponding to the first client data packet in the first process and the process cache data packet to the second process, then exit the first process, and then establish a connection between the second process and the client, and use the second process to continue to receive the client's data packets and send cached data packets to the client, so as to realize the update of the first process by the second process. The embodiment of the present application realizes the use of static language to update the game, and inherits the processing progress and process cache data packet corresponding to the first client data packet in the first process through the second process, so as to use the second process to replace the first process to realize the hot update of the game server, which solves the problem of high complexity of the update process caused by relying on C / C++ external library to provide high-frequency code in the prior art, abandons the original complex code editing method, reduces the complexity of hot update of the game server, and uses static language for update, which solves the problem of low development efficiency and maintenance efficiency due to the lack of static checking of dynamic language in the prior art, and can perform static checking on the second process, thereby improving the development efficiency and maintenance efficiency of hot update of the game server.

[0093] Those skilled in the art will appreciate that the accompanying drawings are only schematic diagrams of a preferred implementation scenario, and the modules or processes in the accompanying drawings are not necessarily necessary for implementing the present application. Those skilled in the art will appreciate that the modules in the devices in the implementation scenario can be distributed in the devices of the implementation scenario according to the description of the implementation scenario, or can be changed accordingly and located in one or more devices different from the present implementation scenario. The modules of the above-mentioned implementation scenario can be combined into one module, or can be further split into multiple submodules.

[0094] The above serial numbers of this application are only for description and do not represent the advantages and disadvantages of the implementation scenarios. The above disclosure is only a few specific implementation scenarios of this application, but this application is not limited to them, and any changes that can be thought of by technicians in this field should fall within the scope of protection of this application.

Claims

1. A game server code hot update method, characterized in that: include: In response to a hot update instruction, determining a first process and a second process corresponding to the hot update instruction, and disconnecting the first process from the client, wherein the first process is used to receive and process a first client data packet sent by the client, and send a corresponding first process response number based on the processed first client data packet, and send a first process data packet to the client, and save the first process data packet not responded by the client as a process cache data packet; Connecting the first process through the second process, sending a player status data packet, the first process response number, and the process cache data packet to the second process through the first process, and exiting the first process; Establishing a connection between the second process and the client, sending the first process response number to the client through the second process, controlling the client to send a corresponding second client data packet to the second process based on the first process response number, receiving and processing the second client data packet through the second process, and sending a corresponding second process response number based on the processed second client data packet; and receiving the client response number sent by the client through the second process, and sending a second process data packet to the client based on the client response number and the process cache data packet; The second process receives a client cache data packet sent by the client; Among them, the first process, the second process and the client are used as data receivers to receive and process data packets carrying numbers, and send corresponding response numbers based on the processed data packets. The first process, the second process and the client are used as data senders to send data packets carrying numbers and save data packets that have not received corresponding response numbers as cached data packets.

2. The method according to claim 1, characterized in that Before sending the player status data packet, the first process response number, and the process cache data packet to the second process through the first process, the method further includes: The player status data of the first process is serialized to generate a player status data packet.

3. The method according to claim 2, characterized in that After establishing the connection between the second process and the client, the method further includes: The player status data packet is deserialized by the second process to obtain player status data.

4. The method according to claim 1, characterized in that The method further comprises: A first client data packet is sent to the first process through the client, and first client data for which no response is received is saved as a client cache data packet, wherein the client cache data packet is used to be sent to the second process as a second client data packet after the client establishes a connection with the second process.

5. A game server code hot update device, characterized in that: include: an update instruction response module, configured to respond to a hot update instruction, determine a first process and a second process corresponding to the hot update instruction, and disconnect the first process from the client, wherein the first process is configured to receive and process a first client data packet sent by the client, and send a corresponding first process response number based on the processed first client data packet, and send a first process data packet to the client, and save the first process data packet not responded by the client as a process cache data packet; A first connection module, configured to connect to the first process through the second process, send a player status data packet, a first process response number, and the process cache data packet to the second process through the first process, and exit the first process; A second connection module is used to establish a connection between the second process and the client, send the first process response number to the client through the second process, control the client to send a corresponding second client data packet to the second process based on the first process response number, receive and process the second client data packet through the second process, and send a corresponding second process response number based on the processed second client data packet; and receive the client response number sent by the client through the second process, and send a second process data packet to the client based on the client response number and the process cache data packet; the second process receives the client cache data packet sent by the client; Among them, the first process, the second process and the client are used as data receivers to receive and process data packets carrying numbers, and send corresponding response numbers based on the processed data packets. The first process, the second process and the client are used as data senders to send data packets carrying numbers and save data packets that have not received corresponding response numbers as cached data packets.

6. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 4 is implemented.

7. A computer device comprising a storage medium, a processor, and a computer program stored in the storage medium and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 4 is implemented.

Citation Information

Patent Citations

  • Hot update method and apparatus for game server

    CN106528225A