Game service fault processing method, device, server and medium

文档序号:866377 发布日期:2021-03-19 浏览:13次 中文

阅读说明:本技术 游戏服务故障的处理方法、装置、服务器及介质 (Game service fault processing method, device, server and medium ) 是由 梁攀攀 于 2020-11-20 设计创作,主要内容包括:本发明提供一种游戏服务故障的处理方法、装置、服务器及介质,涉及游戏技术领域。该方法包括:响应服务故障重启,根据参与虚拟战斗的多个游戏单位的开战时间,从逻辑帧中分别确定多个游戏单位的战斗起始帧;根据多个游戏单位的战斗起始帧,采用第一频率运行逻辑帧,以恢复游戏战斗状态;响应运行的当前逻辑帧对应的时间与当前时间的时间差小于或等于预设时间差,采用第二频率运行逻辑帧;其中,第一频率大于第二频率。基于确定的多个游戏单位的战斗起始帧,采用第一频率进行运行逻辑帧,实现快速恢复游戏战斗状态;继而采用第二频率运行逻辑帧,正常运行游戏战斗状态。可以实现快速、高效的恢复游戏战斗状态,节约了玩家时间,提高了玩家体验。(The invention provides a method, a device, a server and a medium for processing game service faults, and relates to the technical field of games. The method comprises the following steps: responding to the service fault restart, and respectively determining fighting initial frames of a plurality of game units from the logic frames according to the fighting time of the plurality of game units participating in the virtual fighting; according to the fighting initial frames of a plurality of game units, adopting a first frequency to run a logic frame to recover the game fighting state; responding that the time difference between the time corresponding to the current logical frame and the current time is smaller than or equal to the preset time difference, and operating the logical frame by adopting a second frequency; wherein the first frequency is greater than the second frequency. Based on the determined fighting initial frames of a plurality of game units, a logic frame is operated by adopting a first frequency, so that the rapid recovery of the fighting state of the game is realized; and then, the logic frame is operated at the second frequency, and the game fighting state is normally operated. The method can realize quick and efficient recovery of the fighting state of the game, save the time of the player and improve the experience of the player.)

1. A method for processing game service faults is characterized by comprising the following steps:

responding to the service fault restart, and respectively determining fighting initial frames of a plurality of game units from the logic frames according to the fighting time of the plurality of game units participating in the virtual fighting;

according to the fighting initial frames of the plurality of game units, operating the logic frame by adopting a first frequency to recover the game fighting state;

responding that the time difference between the time corresponding to the current logical frame and the current time is smaller than or equal to the preset time difference, and operating the logical frame by adopting a second frequency; wherein the first frequency is greater than the second frequency.

2. The method of claim 1, wherein said operating the logical frame at a first frequency based on the combat start frames of the plurality of game units comprises:

running a logical frame of a virtual battle with the first frequency;

when the current running logical frame is the fighting initial frame of the game unit, starting to generate a fighting event corresponding to the logical frame;

after running the logical frame at a second frequency, the method comprises:

and returning the combat event corresponding to the logic frame running at the second frequency to the game client so as to enable the game client to present the virtual combat corresponding to the combat event.

3. The method as claimed in claim 1, wherein the determining the fighting start frames of the plurality of game units from the logical frames according to the fighting time of the plurality of game units participating in the virtual fighting comprises:

determining the fighting time of the earliest fighting game unit as the logic frame starting time of the server according to the fighting times of the plurality of game units;

and respectively determining the fighting initial frames of the plurality of game units from the logical frames according to the logical frame initial time of the server and the fighting time of the plurality of game units.

4. The method of claim 3, wherein determining the fighting start frames of the plurality of game units from the logical frames according to the logical frame start time of the server and the fighting time of the plurality of game units, respectively, comprises:

calculating the difference value between the fighting time of the game unit and the logic frame starting time of the server in the fighting time of the plurality of game units;

dividing each difference value by the single-frame time length of the logic frame to respectively determine the fighting initial frames of the plurality of game units.

5. The method of claim 1, further comprising:

responding to the service fault restart, and judging whether a game unit in battle exists or not;

if the game unit in the battle exists, setting a fast forward mark;

the operating the logic frame with the first frequency according to the fighting start frames of the plurality of game units to recover the game fighting state comprises the following steps:

if the fast forward mark exists, the logic frame is operated by adopting the first frequency according to the fighting initial frames of the plurality of game units so as to recover the game fighting state.

6. The method of claim 5, wherein the operating the logical frame at the second frequency in response to the time difference between the time corresponding to the current logical frame of operation and the current time being less than or equal to the preset time difference comprises:

and if the time difference is less than or equal to the preset time difference, canceling the fast forward mark, and operating the logic frame by adopting the second frequency.

7. The method of claim 1, wherein prior to the running the logical frame at the first frequency according to the combat start frames of the plurality of game units to restore a game combat state, the method further comprises:

initializing the combat states of the plurality of game units;

the operating the logic frame at the first frequency according to the fighting start frames of the plurality of game units to recover the game fighting state comprises the following steps:

and operating the logic frame by adopting the first frequency according to the fighting initial frames of the plurality of game units and the initialized fighting state so as to recover the game fighting state.

8. The method of any of claims 1-7, wherein the initializing a combat state for the plurality of gaming units comprises:

and sequencing the fighting time of the plurality of game units to obtain the sequenced plurality of game units.

9. The method of any one of claims 1-8, wherein before the responsive service failure restart, determining a fighting start frame of a plurality of game units participating in a virtual battle from logical frames according to fighting times of the plurality of game units, respectively, the method further comprises:

responding to the service fault restart, and checking whether a cache file of a fighting state exists or not;

and if the cache file does not exist, loading the fighting time of the plurality of game units.

10. The method according to any one of claims 1-9, further comprising:

responding to a service fault restart, and checking whether the virtual battle is finished;

if the game fighting is finished, the logic frame is operated at the first frequency according to the fighting initial frames of the plurality of game units so as to recover the game fighting state until the game fighting is finished.

11. A gaming service failure handling apparatus, comprising:

the determining module is used for responding to the restart of the service fault and respectively determining fighting initial frames of a plurality of game units from the logic frames according to the fighting time of the plurality of game units participating in the virtual fighting;

the operation module is used for operating the logic frame by adopting a first frequency according to the fighting initial frames of the plurality of game units so as to recover the game fighting state; responding that the time difference between the time corresponding to the current logical frame and the current time is smaller than or equal to the preset time difference, and operating the logical frame by adopting a second frequency; wherein the first frequency is greater than the second frequency.

12. A server, comprising: a memory storing a computer program executable by the processor, and a processor implementing the method for processing a game service failure according to any one of claims 1 to 10 when the processor executes the computer program.

13. A storage medium having stored thereon a computer program which, when read and executed, implements the method of processing a game service failure according to any one of claims 1 to 10.

Technical Field

The invention relates to the technical field of games, in particular to a method, a device, a server and a medium for processing game service faults.

Background

The online game usually involves game fighting, team fighting usually calculates in real time in a server, the game fighting state is stored in a server memory, the fighting state cannot be stored in real time, and different from the situation that after the game is disconnected, a player can quickly recover the game fighting state before the disconnection through the record of the server after logging in the game again, and once the server is abnormally collapsed, the real-time fighting state is lost and cannot be quickly recovered.

In the related art, after the server is abnormally crashed, the server is restarted, and after the server is restarted successfully, the game battle needs to be restarted to recover the game battle state.

However, in the related art, after the server is abnormally rushed to restart, the team battle needs to be restarted to recover the game fighting state, so that the efficiency of recovering the game fighting state is reduced, the time of the player is wasted, and the experience of the player is reduced.

Disclosure of Invention

The present invention is directed to provide a method, an apparatus, a server, and a medium for processing a game service failure, so as to solve the problems in the related art that, after a server is abnormally rushed to restart, a team battle needs to be restarted to recover a game fighting state, efficiency of recovering the game fighting state is reduced, time of a player is wasted, and experience of the player is reduced.

In order to achieve the above purpose, the embodiment of the present invention adopts the following technical solutions:

in a first aspect, an embodiment of the present invention provides a method for processing a game service failure, including:

responding to the service fault restart, and respectively determining fighting initial frames of a plurality of game units from the logic frames according to the fighting time of the plurality of game units participating in the virtual fighting;

according to the fighting initial frames of the plurality of game units, operating the logic frame by adopting a first frequency to recover the game fighting state;

responding that the time difference between the time corresponding to the current logical frame and the current time is smaller than or equal to the preset time difference, and operating the logical frame by adopting a second frequency; wherein the first frequency is greater than the second frequency.

Optionally, the operating the logical frame at a first frequency according to the combat starting frames of the plurality of game units includes:

running a logical frame of a virtual battle with the first frequency;

when the current running logical frame is the fighting initial frame of the game unit, starting to generate a fighting event corresponding to the logical frame;

after running the logical frame at a second frequency, the method comprises:

and returning the combat event corresponding to the logic frame running at the second frequency to the game client so as to enable the game client to present the virtual combat corresponding to the combat event.

Optionally, the determining, from the logical frames, the fighting start frames of the plurality of game units according to the fighting time of the plurality of game units participating in the virtual fighting includes:

determining the fighting time of the earliest fighting game unit as the logic frame starting time of the server according to the fighting times of the plurality of game units;

and respectively determining the fighting initial frames of the plurality of game units from the logical frames according to the logical frame initial time of the server and the fighting time of the plurality of game units.

Optionally, the determining, from the logical frames according to the starting time of the logical frame of the server and the fighting time of the plurality of game units, the fighting starting frames of the plurality of game units respectively includes:

calculating the difference value between the fighting time of each game unit and the logic frame starting time of the server in the fighting time of the plurality of game units;

dividing each difference value by the single-frame time length of the logic frame to respectively determine the fighting initial frames of the plurality of game units.

Optionally, the method further includes:

responding to the service fault restart, and judging whether a game unit in battle exists or not;

if the game unit in the battle exists, setting a fast forward mark;

the operating the logic frame with the first frequency according to the fighting start frames of the plurality of game units to recover the game fighting state comprises the following steps:

if the fast forward mark exists, the logic frame is operated by adopting the first frequency according to the fighting initial frames of the plurality of game units so as to recover the game fighting state;

optionally, the responding that the time difference between the time corresponding to the current logical frame in operation and the current time is less than or equal to a preset time difference, and operating the logical frame at a second frequency includes:

and if the time difference is less than or equal to the preset time difference, canceling the fast forward mark, and operating the logic frame by adopting the second frequency.

Optionally, before the running the logical frame at the first frequency according to the combat start frames of the plurality of game units to recover the game combat state, the method further includes:

initializing the combat states of the plurality of game units;

the operating the logic frame at the first frequency according to the fighting start frames of the plurality of game units to recover the game fighting state comprises the following steps:

and operating the logic frame by adopting the first frequency according to the fighting initial frames of the plurality of game units and the initialized fighting state so as to recover the game fighting state.

Optionally, the initializing the combat states of the plurality of game units includes:

and sequencing the fighting time of the plurality of game units to obtain the sequenced plurality of game units.

Optionally, before restarting the response service failure and determining the fighting start frames of the plurality of game units from the logical frames according to the fighting time of the plurality of game units participating in the virtual fighting, the method further includes:

responding to the service fault restart, and checking whether a cache file of a fighting state exists or not;

and if the cache file does not exist, loading the fighting time of the plurality of game units.

Optionally, the method further includes:

responding to a service fault restart, and checking whether the virtual battle is finished;

if the game fighting is finished, the logic frame is operated at the first frequency according to the fighting initial frames of the plurality of game units so as to recover the game fighting state until the game fighting is finished.

In a second aspect, an embodiment of the present invention further provides a device for processing a game service failure, including:

the determining module is used for responding to the restart of the service fault and respectively determining fighting initial frames of a plurality of game units from the logic frames according to the fighting time of the plurality of game units participating in the virtual fighting;

the operation module is used for operating the logic frame by adopting a first frequency according to the fighting initial frames of the plurality of game units so as to recover the game fighting state; responding that the time difference between the time corresponding to the current logical frame and the current time is smaller than or equal to the preset time difference, and operating the logical frame by adopting a second frequency; wherein the first frequency is greater than the second frequency.

Optionally, the running module is further configured to run a logical frame of a virtual battle with the first frequency; when the current running logical frame is the fighting initial frame of the game unit, starting to generate a fighting event corresponding to the logical frame;

the device further comprises:

and the return module is used for returning the combat event corresponding to the logic frame operated at the second frequency to the game client so as to enable the game client to present the virtual combat corresponding to the combat event.

Optionally, the determining module is further configured to determine, according to the fighting time of the plurality of game units, the fighting time of the game unit with the earliest fighting as the logical frame start time of the server; and respectively determining the fighting initial frames of the plurality of game units from the logical frames according to the logical frame initial time of the server and the fighting time of the plurality of game units.

Optionally, the determining module is further configured to calculate a difference between the fighting time of each game unit and the logic frame start time of the server in the fighting time of the plurality of game units; dividing each difference value by the single-frame time length of the logic frame to respectively determine the fighting initial frames of the plurality of game units.

Optionally, the apparatus further comprises:

the judging module is used for responding to the service fault restart and judging whether a game unit in battle exists or not;

the setting module is used for setting a fast forward mark if a game unit in battle exists;

the operation module is also used for operating the logic frame by adopting the first frequency according to the fighting start frames of the plurality of game units to recover the game fighting state if the fast forward mark exists;

optionally, the running module is further configured to cancel the fast forward flag and run the logical frame at the second frequency if the time difference is smaller than or equal to the preset time difference.

Optionally, the apparatus further comprises:

the initialization module is used for initializing the fighting states of the plurality of game units;

the operation module is further configured to operate the logic frame at the first frequency according to the fighting start frames of the plurality of game units and the initialized fighting state, so as to recover the game fighting state.

Optionally, the initialization module is further configured to sequence the fighting time of the plurality of game units to obtain the sequenced plurality of game units.

Optionally, the apparatus further comprises:

the first checking module is used for responding to the service fault restart and checking whether a cache file in a fighting state exists or not;

and the loading module is used for loading the fighting time of the plurality of game units if the cache file does not exist.

Optionally, the apparatus further comprises:

the second checking module is used for responding to the service failure restart and checking whether the virtual battle is finished or not;

and the operation module is also used for adopting the first frequency to operate the logic frame according to the fighting initial frames of the plurality of game units to recover the game fighting state until the game fighting is finished.

In a third aspect, an embodiment of the present invention provides a server, including: a memory and a processor, wherein the memory stores a computer program executable by the processor, and the processor implements the method for processing a game service failure according to any one of the first aspect.

In a fourth aspect, an embodiment of the present invention provides a storage medium, where a computer program is stored, and when the computer program is read and executed, the method for processing a game service failure according to any one of the above first aspects is implemented.

The invention has the beneficial effects that: the embodiment of the application provides a method for processing game service faults, which comprises the following steps: responding to the service fault restart, and respectively determining fighting initial frames of a plurality of game units from the logic frames according to the fighting time of the plurality of game units participating in the virtual fighting; according to the fighting initial frames of a plurality of game units, adopting a first frequency to run a logic frame to recover the game fighting state; responding that the time difference between the time corresponding to the current logical frame and the current time is smaller than or equal to the preset time difference, and operating the logical frame by adopting a second frequency; wherein the first frequency is greater than the second frequency. Based on the determined fighting initial frames of a plurality of game units, a logic frame is operated by adopting a first frequency, so that the rapid recovery of the fighting state of the game is realized; and then, the logic frame is operated at the second frequency, and the game fighting state is normally operated. The method can realize quick and efficient recovery of the fighting state of the game, save the time of the player and improve the experience of the player.

Drawings

In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained according to the drawings without inventive efforts.

FIG. 1 is a flow chart illustrating a method for processing a game service failure according to an embodiment of the present invention;

FIG. 2 is a flowchart illustrating a method for processing a game service failure according to an embodiment of the present invention;

FIG. 3 is a flowchart illustrating a method for processing a game service failure according to an embodiment of the present invention;

FIG. 4 is a flowchart illustrating a method for processing a game service failure according to an embodiment of the present invention;

FIG. 5 is a flowchart illustrating a method for processing a game service failure according to an embodiment of the present invention;

FIG. 6 is a flowchart illustrating a method for processing a game service failure according to an embodiment of the present invention;

FIG. 7 is a flowchart illustrating a method for processing a game service failure according to an embodiment of the present invention;

FIG. 8 is a schematic structural diagram of a game service failure processing apparatus according to an embodiment of the present invention;

fig. 9 is a schematic structural diagram of a server according to an embodiment of the present invention.

Detailed Description

In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention.

Thus, the following detailed description of the embodiments of the present application, presented in the accompanying drawings, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.

In the description of the present application, it should be noted that if the terms "upper", "lower", etc. are used for indicating the orientation or positional relationship based on the orientation or positional relationship shown in the drawings or the orientation or positional relationship which is usually arranged when the product of the application is used, the description is only for convenience of describing the application and simplifying the description, but the indication or suggestion that the referred device or element must have a specific orientation, be constructed in a specific orientation and operation, and thus, cannot be understood as the limitation of the application.

Furthermore, the terms "first," "second," and the like in the description and in the claims, as well as in the drawings, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.

It should be noted that the features of the embodiments of the present application may be combined with each other without conflict.

In the related art, after the server is abnormally crashed, the server is restarted, and after the server is restarted successfully, the game battle needs to be restarted to recover the game battle state. However, in the related art, when the game fighting state is restored, the game fighting needs to be restarted, which wastes player time and reduces player experience.

The embodiment of the application provides a method for processing game service faults, which is characterized in that a response service fault is restarted, and fighting initial frames of a plurality of game units are respectively determined from logic frames according to the fighting time of the plurality of game units participating in virtual fighting; according to the fighting initial frames of a plurality of game units, adopting a first frequency to run a logic frame to recover the game fighting state; responding that the time difference between the time corresponding to the current logical frame and the current time is smaller than or equal to the preset time difference, and operating the logical frame by adopting a second frequency; wherein the first frequency is greater than the second frequency. Based on the determined fighting initial frames of a plurality of game units, a logic frame is operated by adopting a first frequency, so that the rapid recovery of the fighting state of the game is realized; and then, the logic frame is operated at the second frequency, and the game fighting state is normally operated. The method can realize quick and efficient recovery of the fighting state of the game, save the time of the player and improve the experience of the player.

In the method for processing a game service fault provided in the embodiment of the present application, the execution main body may be a server, and the server may be a game battle server or a game server, or may be other types of servers, which is not limited in the embodiment of the present application. The following describes a method for processing a game service failure according to an embodiment of the present application, with a server as an execution subject.

Fig. 1 is a schematic flowchart of a method for processing a game service failure according to an embodiment of the present invention, and as shown in fig. 1, the method may include:

s101, responding to the service fault and restarting, and respectively determining fighting initial frames of a plurality of game units from the logic frames according to the fighting time of the plurality of game units participating in the virtual fighting.

The server can be restarted after a service fault occurs, the game server application arranged on the server is controlled to be restarted, and then the server can be restarted in response to the service fault. It should be noted that the service failure refers to a service failure of the server, such as a server crash, and is different from a game disconnection condition caused by a network reason or other reasons in a game process, where the service failure is that the server fails to start to operate, and the service failure is that the game is disconnected due to a connection failure between the server and the game client, and the server itself is in a start state and can operate normally.

In addition, the combat start frame of the game unit can be used to indicate that the game unit starts to join the virtual combat at the combat start frame. The fighting time of each gaming unit may be a time at which each gaming unit starts to participate in the virtual battle.

In a possible implementation manner, the server may determine the fighting start frame of each game unit by using a preset fighting start frame determination rule according to the fighting time of a plurality of game units participating in the virtual fighting; or a preset combat initial frame determining algorithm can be adopted to determine the combat initial frame of each game unit; the preset fighting initial frame determining model may also be adopted to determine the fighting initial frame of each game unit, which is not specifically limited in the embodiments of the present application.

It should be noted that the server may obtain game fighting initial information, and then determine, from the game fighting initial information, a fighting time for loading a plurality of game units participating in the virtual fighting. The game fighting initiation information may also indicate the state of each game unit before the start of the game fighting and at the start time. The server may load the game fighting initial information by itself, may also load the game fighting initial information from other devices, and may also load the game fighting initial information in other manners, which is not specifically limited in the embodiments of the present application.

S102, according to the fighting initial frames of a plurality of game units, the logic frame is operated at the first frequency to recover the game fighting state.

In this embodiment of the present application, strategies of a logic layer and a presentation layer may be adopted during game development, and a logic frame may drive the logic layer to drive data processing, logic operation, and the like of the logic layer to enter a game fighting state, where a fighting event corresponding to a virtual fighting may be generated, where the game fighting state is a game logic state. The expression layer calculates game expression states according to the game fighting states and renders based on the game expression states to provide expressions of the game fighting states.

In one possible implementation mode, the server accelerates the running of the logic frame by adopting a first frequency according to the fighting starting frames of a plurality of game units so as to accelerate the recovery of the game fighting state. In this process, each time a frame of logical frame is run, the time corresponding to the current logical frame can be updated. For example, the duration of a single frame may be increased every time a logical frame is run to obtain the time corresponding to the current logical frame, where the duration of the single frame may be a standard duration required for running a logical frame.

S103, responding that the time difference between the time corresponding to the current logic frame and the current time is smaller than or equal to the preset time difference, and adopting a second frequency to operate the logic frame.

Wherein the first frequency is greater than the second frequency. The current time may also be referred to as an actual time or a standard time, and may be, for example, Beijing time.

In the embodiment of the present application, when the time difference between the time corresponding to the current logical frame and the current time is less than or equal to the preset time difference, it indicates that the recovery of the historical game fighting state is to be completed, and the game fighting state can be started to be normally operated, so that the logical frame can be operated at the second frequency. Alternatively, the second frequency may be a standard frequency at which the server runs logical frames, and the first frequency is another frequency greater than the standard frequency.

Optionally, when the server runs the logical frame using the first frequency, the server may run at the maximum efficiency of the processor of the server.

In summary, the embodiment of the present application provides a method for processing a game service failure, which, in response to a restart of the service failure, determines, from a logical frame, combat start frames of a plurality of game units according to combat time of the plurality of game units participating in virtual combat; according to the fighting initial frames of a plurality of game units, adopting a first frequency to run a logic frame to recover the game fighting state; responding that the time difference between the time corresponding to the current logical frame and the current time is smaller than or equal to the preset time difference, and operating the logical frame by adopting a second frequency; wherein the first frequency is greater than the second frequency. Based on the determined fighting initial frames of a plurality of game units, a logic frame is operated by adopting a first frequency, so that the rapid recovery of the fighting state of the game is realized; and then, the logic frame is operated at the second frequency, and the game fighting state is normally operated. The method can realize quick and efficient recovery of the fighting state of the game, save the time of the player and improve the experience of the player.

Fig. 2 is a flowchart illustrating a method for processing a game service failure according to an embodiment of the present invention, and as shown in fig. 2, the process of operating a logical frame at a first frequency according to a fighting start frame of a plurality of game units in S102 to recover a game fighting state may include:

s201, operating the logic frame of the virtual battle by adopting the first frequency.

S202, when the current running logic frame is a fighting initial frame of a game unit, starting to generate a fighting event corresponding to the logic frame.

Wherein, each time the server runs a frame of logical frame, the server can update the number of the logical frames run by the server, for example, 1 can be added; the time corresponding to the running logical frame may also be updated, for example, a single frame duration process of adding the logical frame may be performed. For example, the single frame duration of a logical frame may be 100 milliseconds, i.e., 0.1 seconds. The starting logical frame of the server may be 0.

In some embodiments, the server may detect in units of game units, when detecting that the current logical frame of operation is a combat start frame of a game unit; or when detecting that the current running logic frame is larger than the fighting initial frame of the game unit, starting to generate a fighting event corresponding to the logic frame, and then starting to execute the game fighting logic of the game unit.

For example, a gaming unit participating in a game battle may include: gaming unit A, gaming unit B. The fighting start frame of the game unit a may be 10, the fighting start frame of the game unit B may be 60, and when the number of currently-operated logical frames is 10, the server may determine that the number of currently-operated logical frames is equal to the number of currently-operated fighting start frames of the game unit a, and may start generating a corresponding fighting event.

It should be noted that, according to the start frames of the battles of a plurality of game units, the logic frames of the virtual battles are operated at the first frequency, so that the battle state of the game can be simulated rapidly, and the recovery time can be close to the current time rapidly. The frame pushing speed is extremely fast when no game battle can be executed.

In addition, the time corresponding to the current logical frame may also be referred to as the current server frame time, and the current game unit frame time is equal to the current server frame time minus the starting frame time of the game unit.

In the embodiment of the present application, the random number in the game battle may use team Id (Identity document) to ensure that the same random number is used after recovery. Because the random numbers are consistent, the current frame time of the game unit is consistent, and the real-time game fighting states obtained by fast forwarding to the current moment are also consistent. Thus, the recovered game state is consistent compared to before the server is restarted.

Optionally, after the logic frame is operated at the second frequency in S103, the method may further include:

and returning the combat event corresponding to the logic frame running at the second frequency to the game client so that the game client presents the virtual combat corresponding to the combat event.

In some embodiments, the server may send, to the client, a combat event corresponding to the logic frame running at the second frequency, and the client may receive the combat event corresponding to the logic frame running at the second frequency, render a virtual combat corresponding to the combat event, and then present the virtual combat corresponding to the combat event.

When the server runs the logical frame at the second frequency, the fighting state before the service failure is recovered, and at this time, the server can send a fighting event corresponding to the logical frame running at the second frequency to the client.

In the embodiment of the application, the operation of at least one logical frame may correspond to one combat event, and a plurality of combat events may form a complete virtual combat. For example, when a frame of logical frame is run, the corresponding first fighting event can be that the game unit a attacks the game unit B; running a plurality of frames of logic frames, wherein the corresponding second fighting event can be that the game unit B attacks the game unit A; wherein the first and second combat events may constitute a complete virtual combat.

It should be noted that, when the server runs the logical frame at the standard frequency, the server may send corresponding notification information to the game client, and the game client may receive the notification information and simulate and present a picture of the virtual battle according to the notification information. The player can perform game operation at the game client, the game client can respond to the input game operation and send operation information to the server, and the server can receive the operation information and execute the slave operation information in a corresponding logical frame.

Wherein the server may run logical frames to implement logic to execute the virtual battle. In the process of operating the logic frame, the single-frame duration of the logic frame can be separated to realize the logic of real-time operation of the virtual battle, and only partial resources of a processor of the server are occupied.

In addition, the game client may be operated on a terminal device, which may be a mobile phone, a computer, or other devices with processing and displaying functions, and this is not limited in this embodiment of the present application.

Optionally, fig. 3 is a schematic flow chart of a method for processing a game service fault according to an embodiment of the present invention, as shown in fig. 3, the determining, in S101, combat start frames of a plurality of game units from logical frames according to the fighting time of the plurality of game units participating in virtual combat respectively may include:

s301, according to the fighting time of a plurality of game units, the fighting time of the game unit with the earliest fighting is determined as the logic frame starting time of the server.

Wherein, the game units participating in the game battle can have corresponding fighting time, namely the time for starting to participate in the game battle.

In one possible embodiment, the server may rank the time of engagement for a plurality of gaming units to obtain a ranking result. Then, the fighting time of the earliest gaming unit can be determined based on the sorting result, and the start time can be used as the logical frame start time of the server.

For example, the server may sort the fighting time of a plurality of game units in the order from front to back, and the first fighting time in the sorting result is the logical frame starting time of the server; alternatively, the server may sort the fighting time of the plurality of game units in order from back to front, and the last fighting time in the sorting result is the logical frame start time of the server.

S302, determining fighting initial frames of a plurality of game units from the logic frames according to the logic frame initial time of the server and the fighting time of the plurality of game units.

In some embodiments, the server determines the fighting start frames of the plurality of game units according to the logic frame start time of the server and the fighting time of the plurality of game units by using a preset fighting start frame determination algorithm.

Optionally, the server may further determine the combat starting frames of the plurality of game units from the logical frame according to the logical frame starting time of the server, the fighting time of the plurality of game units, and the single frame duration of the logical frame.

In conclusion, according to the fighting time of a plurality of game units, the fighting time of the game unit with the earliest fighting is determined as the logic frame starting time of the server; and determining the fighting initial frames of the plurality of game units from the logic frames according to the logic frame initial time of the server and the fighting time of the plurality of game units. The method can realize quick and efficient determination of the fighting initial frame and is convenient for subsequent accelerated recovery of the game fighting state.

Optionally, fig. 4 is a flowchart illustrating a method for processing a game service failure according to an embodiment of the present invention, and as shown in fig. 4, the process of determining the fighting start frames of a plurality of game units from the logical frame according to the start time of the logical frame of the server and the fighting time of the plurality of game units in S302 may include:

s401, calculating the difference value between the fighting time of each game unit and the logic frame starting time of the server in the fighting time of a plurality of game units.

The fighting time of each game unit is subtracted by the logic frame starting time of the server to obtain the corresponding difference value of each game unit.

The server may calculate the difference between the fighting time of each game unit and the logical frame start time of the server in sequence, or may calculate the difference between the fighting time of each game unit and the logical frame start time of the server at the same time, which is not particularly limited in the embodiment of the present application.

S402, dividing each difference value by the single-frame duration of the logic frame to respectively determine the fighting initial frames of a plurality of game units.

The server may sequentially divide each difference by the single-frame duration of the logical frame, or may simultaneously divide each difference by the single-frame duration of the logical frame, which is not specifically limited in the embodiment of the present application.

For example, a gaming unit may include: game unit A, game unit B, and game unit C. Wherein, the fighting time of the game unit A can be 15: 00. the time of engagement for gaming unit B may be 15: 02. the time of engagement for gaming Unit C may be 15: 10. determining the logical frame start time of the server as 15: 00, the duration of a single frame of a logical frame may be 0.1 second, the fighting start frame of game unit a may be frame 0, the fighting start frame of game unit B may be frame 1200, and the fighting start frame of game unit C may be frame 6000.

Optionally, fig. 5 is a schematic flowchart of a method for processing a game service failure according to an embodiment of the present invention, and as shown in fig. 5, the method may further include:

s501, responding to the service failure restart, and judging whether a game unit in battle exists or not.

In some embodiments, the server may perform a restart operation after a service failure occurs, and control a game server application set on the server to also perform a restart operation, so that the server may restart in response to the service failure; then the server can judge whether the game units in battle exist when the service fails; if so, the server needs to recover the gaming units.

S502, if the game unit in battle exists, a fast forward mark is set.

In the embodiment of the present application, if there is a game unit in battle, it is described that there is a game battle that needs to be recovered. Thus, the server may set a fast forward flag so that subsequent game plays requiring resumption may be expedited based on the fast forward flag.

Alternatively, the fast forward mark may be a preset character, and the embodiment of the present application does not specifically limit the form of the fast forward mark.

In the step S102, the operating the logic frame at the first frequency according to the fighting start frames of the plurality of game units to recover the fighting state of the game includes:

if the fast forward mark exists, the logic frame is operated by adopting the first frequency according to the fighting initial frames of a plurality of game units so as to recover the game fighting state.

In the above step S103, if the time difference between the time corresponding to the current logical frame and the current time in response to the operation is smaller than or equal to the preset time difference, the process of operating the logical frame at the second frequency may include:

and if the time difference is less than or equal to the preset time difference, canceling the fast forward mark and operating the logic frame by adopting a second frequency.

In one possible implementation, when the server recovers the game fighting state, whether the fast forward flag exists or not can be detected; if the state exists, which indicates that the recovery of the game fighting state needs to be accelerated, the logic frame can be operated by adopting the first frequency according to the fighting initial frame of the game unit so as to recover the game fighting state.

In addition, when the time difference is less than or equal to the preset time difference, the game fighting state is about to be accelerated and recovered, namely the game fighting state is about to be operated at the normal speed, so that the fast forward mark can be cancelled, and when the server does not detect the fast forward mark, the game fighting state is about to be operated at the normal speed, the logic frame can be operated at the second frequency, so that the normal operation of the game fighting state is realized.

It should be noted that the preset time difference may be a single frame duration of a logical frame, that is, an actual time required for normally operating a frame, for example, the single frame duration may be 0.1 second or 0.5 second. Of course, the preset time difference may be set according to actual requirements, may also be set according to empirical values, and may also be set in other manners, which is not specifically limited in the embodiment of the present application.

Optionally, before the step S102 of operating the logical frame at the first frequency according to the combat start frame of the plurality of game units to recover the process of the game combat state, the method may further include:

the combat states of a plurality of gaming units are initialized.

The combat states of a plurality of game units can be initialized according to the time when each game unit starts to participate in the game combat. After initialization, the time sequence of the plurality of game units participating in the virtual battle can be obtained, and the time sequence of the plurality of game units is used for representing the sequence of the plurality of game units participating in the virtual battle so as to ensure that the game battle state is recovered correctly in the follow-up process.

The process of operating the logic frame at the first frequency according to the fighting start frames of the plurality of game units in the above S102 to recover the fighting state of the game may include:

and according to the fighting initial frames and the initialized fighting states of a plurality of game units, adopting the first frequency to run the logic frames so as to recover the game fighting states.

In one possible implementation, in the initialized fighting state, an initial game fighting state of the game unit may be set, and then the logical frame may be run at the first frequency based on the set initial game fighting state and a fighting start frame of the plurality of game units to restore the game fighting state, i.e., to restore the logic of the game fighting.

Optionally, the process of initializing the combat states of a plurality of game units may include:

and sequencing the fighting time of the plurality of game units to obtain a plurality of sequenced game units.

The server can sort the fighting time of a plurality of game units in the order from front to back, namely, the game units with early fighting time can be arranged in front of the server, and the game units with late fighting time can be arranged behind the server.

In the embodiment of the present application, since there may be a timing requirement for recovering the game fighting logic, when recovering the game unit in the process of recovering the game fighting state, the sequence also needs to be ensured. The game units are sorted according to the fighting time of the game units, and the plurality of sorted game units are obtained, so that the game fighting logic can be initialized correctly, and the same game state as that of the server before restarting is obtained.

Optionally, fig. 6 is a flowchart illustrating a method for processing a game service fault according to an embodiment of the present invention, as shown in fig. 6, a process of determining a fighting start frame of a plurality of game units from a logical frame according to fighting time of the plurality of game units participating in virtual fighting in response to restart of the service fault in S102 may include:

s601, responding to the service fault and restarting, and checking whether a cache file in a fighting state exists.

The cache file can record all combat states when the server is normally closed.

It should be noted that when the server is restarted after being crashed, the cache file of the battle state does not exist in the server; when the server is normally restarted, a cache file of a battle state exists in the server.

In some embodiments, the server may perform a restart operation, and the game server application may also perform a restart operation, and the server may detect that the game server application has restarted. The server may then check if a cache file for the battle state exists.

S602, if the cache file does not exist, loading the fighting time of a plurality of game units.

In one possible implementation, if the cache file does not exist, the server may determine that the server is restarted after the abnormal crash, and the server may load the fighting time of the plurality of game units from the database. The database may be a database in a server, or may also be a database set on other devices, which is not specifically limited in this embodiment of the present application. If the database is arranged on other equipment, the other equipment can be in communication connection with the server, so that the server can load the fighting time of a plurality of game units from the database of the other equipment.

In a possible implementation manner, if the cache file exists, the server may determine that the server belongs to the normal restart, and the server may run the game fighting state at the second frequency according to the cache file.

Optionally, fig. 7 is a schematic flowchart of a method for processing a game service failure according to an embodiment of the present invention, and as shown in fig. 7, the method may further include:

s701, responding to the service failure restart, and checking whether the virtual battle is finished.

And S702, if the game is finished, adopting the first frequency to run the logic frame according to the fighting initial frames of a plurality of game units so as to recover the game fighting state until the game fighting is finished.

It should be noted that, if it is detected that the game fighting is finished, it is indicated that the complete game fighting state needs to be restored, so that the logic frame can be run at the first frequency directly according to the fighting start frames of a plurality of game units, so as to accelerate the restoration of the game fighting state until the game fighting is finished.

In addition, if it is detected that the game battle is not finished, that is, if it is described that the partial game battle state needs to be recovered, the above-described processes of S101 to S103 may be performed.

To sum up, an embodiment of the present application provides a method for processing a game service failure, including: responding to the service fault restart, and respectively determining fighting initial frames of a plurality of game units from the logic frames according to the fighting time of the plurality of game units participating in the virtual fighting; according to the fighting initial frames of a plurality of game units, adopting a first frequency to run a logic frame to recover the game fighting state; responding that the time difference between the time corresponding to the current logical frame and the current time is smaller than or equal to the preset time difference, and operating the logical frame by adopting a second frequency; wherein the first frequency is greater than the second frequency. Based on the determined fighting initial frames of a plurality of game units, a logic frame is operated by adopting a first frequency, so that the rapid recovery of the fighting state of the game is realized; and then, the logic frame is operated at the second frequency, and the game fighting state is normally operated. The method can realize quick and efficient recovery of the fighting state of the game, save the time of the player and improve the experience of the player. Moreover, the fighting initial frames of the plurality of game units are respectively determined according to the logic frame initial time of the server and the fighting time of the plurality of game units, so that the fighting initial frames can be rapidly and efficiently determined, and the subsequent accelerated recovery of the game fighting state can be facilitated.

Fig. 8 is a schematic structural diagram of a processing apparatus for processing a game service failure according to an embodiment of the present invention, and as shown in fig. 8, the apparatus may include:

a determining module 801, configured to determine, in response to a service failure restart, combat start frames of a plurality of game units from the logical frames according to combat times of the plurality of game units participating in the virtual combat;

the operation module 802 is configured to operate the logic frame at the first frequency according to the combat initiation frames of the plurality of game units to recover the game combat state; responding that the time difference between the time corresponding to the current logical frame and the current time is smaller than or equal to the preset time difference, and operating the logical frame by adopting a second frequency; wherein the first frequency is greater than the second frequency.

Optionally, the operation module 802 is further configured to operate a logic frame of the virtual battle by using the first frequency; when the current running logic frame is a fighting initial frame of a game unit, starting to generate a fighting event corresponding to the logic frame;

the device still includes:

and the return module is used for returning the combat event corresponding to the logic frame running at the second frequency to the game client so as to enable the game client to present the virtual combat corresponding to the combat event.

Optionally, the determining module 801 is further configured to determine, according to the fighting time of the multiple game units, that the fighting time of the earliest fighting game unit is the logical frame start time of the server; and determining the fighting initial frames of the plurality of game units from the logic frames according to the logic frame initial time of the server and the fighting time of the plurality of game units.

Optionally, the determining module 801 is further configured to calculate a difference between the fighting time of each game unit and the logic frame start time of the server in the fighting times of the plurality of game units; dividing each difference value by the single-frame time length of the logic frame to respectively determine the fighting initial frames of a plurality of game units.

Optionally, the apparatus further comprises:

the judging module is used for responding to the service fault restart and judging whether a game unit in battle exists or not;

the setting module is used for setting a fast forward mark if a game unit in battle exists;

the operation module 802 is further configured to, if the fast forward flag exists, operate the logical frame at the first frequency according to a combat start frame of the plurality of game units to recover the game combat state;

optionally, the running module 802 is further configured to cancel the fast forward flag and run the logical frame at the second frequency if the time difference is smaller than or equal to the preset time difference.

Optionally, the apparatus further comprises:

the initialization module is used for initializing the fighting states of a plurality of game units;

the operation module 802 is further configured to operate the logic frame at the first frequency according to the combat start frame and the initialized combat state of the plurality of game units to recover the game combat state.

Optionally, the initialization module is further configured to sequence the fighting time of the plurality of game units; and initializing the fighting states of the plurality of game units after the sequencing.

Optionally, the apparatus further comprises:

the first checking module is used for responding to the service fault restart and checking whether a cache file in a fighting state exists or not;

and the loading module is used for loading the fighting time of a plurality of game units if the cache file does not exist.

Optionally, the apparatus further comprises:

the second checking module is used for responding to the service fault restart and checking whether the virtual battle is finished or not;

the operation module 802 is further configured to, if the game is finished, operate the logic frame at the first frequency according to the fighting start frames of the plurality of game units to recover the game fighting state until the game fighting is finished.

The above-mentioned apparatus is used for executing the method provided by the foregoing embodiment, and the implementation principle and technical effect are similar, which are not described herein again.

These above modules may be one or more integrated circuits configured to implement the above methods, such as: one or more Application Specific Integrated Circuits (ASICs), or one or more microprocessors (DSPs), or one or more Field Programmable Gate Arrays (FPGAs), among others. For another example, when one of the above modules is implemented in the form of a Processing element scheduler code, the Processing element may be a general-purpose processor, such as a Central Processing Unit (CPU) or other processor capable of calling program code. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).

Fig. 9 is a schematic structural diagram of a server according to an embodiment of the present invention, and as shown in fig. 9, the server may include: a processor 901, a memory 902.

The memory 902 is used for storing programs, and the processor 901 calls the programs stored in the memory 902 to execute any one of the method embodiments of fig. 1 to 7. The specific implementation and technical effects are similar, and are not described herein again.

Optionally, the present invention also provides a program product, such as a computer-readable storage medium, comprising a program which, when executed by a processor, is adapted to perform any of the method embodiments of fig. 1 to 7 described above.

In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.

The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.

In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.

The integrated unit implemented in the form of a software functional unit may be stored in a computer readable storage medium. The software functional unit is stored in a storage medium and includes several instructions to enable a computer device (which may be a personal computer, a server, or a network device) or a processor (processor) to execute some steps of the methods according to the embodiments of the present invention. And the aforementioned storage medium includes: a U disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.

The above is only a preferred embodiment of the present invention, and is not intended to limit the present invention, and various modifications and changes will occur to those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

19页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种新型无动力旋转秋千

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类