CN113350782A - Method, device, storage medium and computer equipment for processing online game abnormity - Google Patents

Method, device, storage medium and computer equipment for processing online game abnormity Download PDF

Info

Publication number
CN113350782A
CN113350782A CN202110662856.5A CN202110662856A CN113350782A CN 113350782 A CN113350782 A CN 113350782A CN 202110662856 A CN202110662856 A CN 202110662856A CN 113350782 A CN113350782 A CN 113350782A
Authority
CN
China
Prior art keywords
frame rate
game
frame
queue
notification message
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110662856.5A
Other languages
Chinese (zh)
Inventor
张青阳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN202110662856.5A priority Critical patent/CN113350782A/en
Publication of CN113350782A publication Critical patent/CN113350782A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/30Interconnection arrangements between game servers and game devices; Interconnection arrangements between game devices; Interconnection arrangements between game servers
    • A63F13/35Details of game servers
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/30Interconnection arrangements between game servers and game devices; Interconnection arrangements between game devices; Interconnection arrangements between game servers
    • A63F13/33Interconnection arrangements between game servers and game devices; Interconnection arrangements between game devices; Interconnection arrangements between game servers using wide area network [WAN] connections
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/45Controlling the progress of the video game
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F2300/00Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
    • A63F2300/40Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game characterised by details of platform network
    • A63F2300/402Communication between platforms, i.e. physical link to protocol
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F2300/00Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
    • A63F2300/50Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game characterized by details of game servers
    • A63F2300/53Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game characterized by details of game servers details of basic data processing

Abstract

The embodiment of the application discloses a method, a device, a storage medium and computer equipment for processing online game abnormity. The method comprises the following steps: calculating the frame rate of game pictures in real time; receiving at least one state updating notification message sent by a server when the network starts to recover, and caching the state updating notification message in a queue; when the game picture is refreshed according to the frame rate of the game picture obtained by real-time calculation, executing logic corresponding to the state updating notification message in the duration of each frame; and if the logic corresponding to all the state updating notification messages in the queue is not executed within the time length of the current frame, executing the logic corresponding to the remaining state updating notification messages in the queue within the time length of the next frame of the current frame until the logic corresponding to all the state updating notification messages in the queue is executed. The technical scheme provided by the embodiment of the application can eliminate picture pause caused by more logic needing to be executed in one frame time.

Description

Method, device, storage medium and computer equipment for processing online game abnormity
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method, an apparatus, a storage medium, and a computer device for processing an online game exception.
Background
In order to realize network synchronization between the server and the client during game, necessary information needs to be interacted between the server and the client. At present, network synchronization between a server and a client during game generally includes frame synchronization and state synchronization, wherein the state synchronization is that data calculation occurs at the server, the client only receives information from the server, and the client represents and updates the state when the server sends state update information.
The existing game state synchronization described above generally does not present a problem when the network is normal. When the network is abnormal, the client cannot receive the state updating information sent by the server in time and needs to wait for the network to recover. However, when the network starts to recover, the client may get stuck due to the fact that the client needs to re-execute all logic from the network exception to the network recovery, and especially under a scene with an excessive amount of calculation (for example, the special effect performance is rich), the client may get stuck almost one hundred percent.
Disclosure of Invention
The embodiment of the application provides a method, a device, a storage medium and computer equipment for processing online game abnormity, so as to eliminate the phenomenon of client end jamming in the network recovery process.
The embodiment of the application provides a method for processing online game abnormity, which comprises the following steps:
calculating the frame rate of game pictures in real time;
receiving at least one state updating notification message sent by a server when the network starts to recover, and caching the state updating notification message in a queue;
when the game picture is refreshed according to the frame rate of the game picture obtained by real-time calculation, executing the logic corresponding to the state updating notification message in the duration of each frame;
and if the logic corresponding to all the state updating notification messages in the queue is not executed within the time length of the current frame, executing the logic corresponding to the remaining state updating notification messages in the queue within the time length of the next frame of the current frame until the logic corresponding to all the state updating notification messages in the queue is executed.
Optionally, the calculating a frame rate of the game screen in real time includes: and calculating the frame rate of the game picture in real time based on a Kalman filter according to the frame rate setting value and the frame rate predicted value of the game picture.
Optionally, before calculating the frame rate of the game picture in real time based on a kalman filter according to the frame rate setting value and the frame rate predicted value of the game picture, the method further includes: iterating the parameters of the Kalman filter according to a frame rate setting value matrix and preset iteration times; calculating the likelihood values of a frame rate predicted value covariance matrix and a frame rate set value covariance matrix according to the frame rate set value matrix and the frame rate predicted value matrix corresponding to the current frame; judging whether the difference value of the current frame likelihood value of the game picture and the likelihood value of the previous frame is smaller than a preset difference value threshold value or not; if the difference value of the likelihood values of the current frame and the previous frame of the game picture is smaller than a preset difference threshold value, determining that the iteration of the parameters of the Kalman filter is finished; if the difference value of the likelihood values of the current frame and the previous frame of the game picture is not smaller than a preset difference value threshold value, updating a frame rate setting value matrix and a frame rate predicted value matrix corresponding to the current frame, continuously calculating the likelihood values of the updated frame rate setting value matrix and the updated frame rate predicted value matrix until the difference value of the likelihood values of the current frame and the previous frame of the game picture is smaller than a preset difference value threshold value or the iteration times reaches a preset iteration threshold value, and determining that the iteration is finished; and determining a frame rate predicted value covariance matrix and a frame rate setting value covariance matrix corresponding to the iteration as parameters of the Kalman filter.
Optionally, the receiving at least one state update notification message sent by the server when the network starts to recover, and buffering the state update notification message in a queue includes: receiving at least one calling request sent by a server when the network starts to recover through a remote process calling interface, and caching the calling request in a queue; when the game picture is refreshed according to the frame rate of the game picture obtained by real-time calculation, the logic corresponding to the state updating notification message is executed in the duration of each frame, and the logic comprises the following steps: and when the game picture is refreshed according to the frame rate of the game picture obtained by real-time calculation, executing the function called by the calling request, and executing the logic corresponding to the function within the duration of each frame.
Optionally, the caching the call request in a queue includes: if the at least one calling request comprises n calling requests, judging whether execution redundancy exists in the n logics during execution according to the association among the n logics corresponding to the n calling requests, wherein n is a natural number greater than or equal to 2; and if the execution redundancy exists, giving up the cache of the call request corresponding to the logic with the execution redundancy.
Optionally, when the game screen is refreshed according to the frame rate of the game screen obtained by the real-time calculation, executing a function called by the call request within the duration of each frame by executing the function called by the call request, where the logic corresponding to the function is executed within the duration of each frame, includes: performing margin adjustment on the frame rate of the game picture obtained through real-time calculation to obtain an adjusted frame rate of the game picture, wherein the adjusted frame rate is smaller than the frame rate of the game picture obtained through real-time calculation; calculating to obtain the duration of each frame after the frame rate is adjusted according to the adjusted frame rate of the game picture; and when the game picture is refreshed according to the adjusted frame rate of the game picture, executing the logic corresponding to the function within the duration of each frame after the frame rate is adjusted.
Optionally, before executing the logic corresponding to the state update notification message within the duration of each frame when refreshing the game screen according to the frame rate of the game screen obtained by the real-time calculation, the method further includes: if the at least one state updating notification message cached in the queue includes n state updating notification messages, judging whether execution redundancy exists in the n logics during execution according to the association between the n logics corresponding to the n state updating notification messages, wherein n is a natural number greater than or equal to 2; and if the execution redundancy exists, deleting the logic corresponding state updating notification message with the execution redundancy from the queue.
Optionally, the buffering the status update notification message in a queue includes: buffering the state update notification messages to at least two queues; and determining a priority processing queue from the timestamps of the at least two queues according to the timestamps of the at least two queues, marking other queues as a suspension queue, and updating the timestamps of the queues in real time according to the timestamp of the state updating notification message in the queues.
Optionally, the buffering the status update notification message in a queue includes: constructing an inner layer circular queue realized based on an array and an outer layer circular queue realized based on a linked list; setting a management pointer of the outer layer circular queue; and according to the management pointer of the outer layer circular queue, caching the state updating notification message in the inner layer circular queue realized based on the array.
The embodiment of the present application further provides a device for processing online game exception, including:
the computing module is used for computing the frame rate of the game picture in real time;
the cache module is used for receiving at least one state updating notification message sent by a server when the network starts to recover and caching the state updating notification message in a queue;
the first execution module is used for executing the logic corresponding to the state updating notification message in each frame duration when the game picture is refreshed according to the frame rate of the game picture obtained by real-time calculation;
and the second execution module is used for executing the logic corresponding to the residual state updating notification messages in the queue within the next frame time of the current frame until the logic corresponding to all the state updating notification messages in the queue is executed.
The embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored, where the computer program is suitable for a processor to execute loading so as to execute the steps in the method for processing an online game exception as described in any of the above embodiments.
The embodiment of the present application further provides a computer device, where the computer device includes a memory and a processor, where the memory stores a computer program, and the processor executes the steps in the method for processing an online game exception according to any one of the above embodiments by calling the computer program stored in the memory.
As can be seen from the technical solutions provided in the embodiments of the present application, on one hand, since the frame rate of the game screen is calculated in real time, it is possible to make the game screen smooth; on the other hand, when the game picture is refreshed according to the frame rate of the game picture obtained by real-time adjustment, when the logic corresponding to all the state updating notification messages is not executed in the duration of the current frame, the logic corresponding to the remaining state updating notification messages is executed in the duration of the next frame of the current frame, namely, the logic corresponding to all the state updating notification messages in the queue is not forcibly executed in the duration of the current frame, but the logic corresponding to the state updating notification messages is subjected to time-sharing processing when more logic is needed, so that the picture pause caused by the fact that more logic needs to be executed in the duration of the current frame can be eliminated.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a system diagram of an apparatus for handling an online game exception according to an embodiment of the present disclosure.
Fig. 2 is a flowchart illustrating a method for processing an online game exception according to an embodiment of the present application.
Fig. 3 is a schematic diagram illustrating an adjustment of a frame rate of a game screen obtained by real-time calculation according to an embodiment of the present disclosure.
Fig. 4 is a schematic diagram of logic corresponding to all status update notification messages in a framing execution queue according to an embodiment of the present application.
Fig. 5 is a schematic structural diagram of an apparatus for processing an online game exception according to an embodiment of the present application.
Fig. 6 is a schematic structural diagram of a computer device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. 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.
The embodiment of the application provides a method, a device, a storage medium and computer equipment for processing online game abnormity. Specifically, the method for processing the online game exception according to the embodiment of the present application may be executed by a computer device, where the computer device may be a terminal or a server, and the like. The terminal may be a terminal device such as a smart phone, a tablet Computer, a notebook Computer, a touch screen, a game machine, a Personal Computer (PC), a Personal Digital Assistant (PDA), and the like, and may further include a client, which may be a game application client, a browser client carrying a game program, or an instant messaging client, and the like. The server may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing basic cloud computing services such as cloud service, a cloud database, cloud computing, a cloud function, cloud storage, network service, cloud communication, middleware service, domain name service, security service, CDN, and a big data and artificial intelligence platform.
For example, when the method for processing the online game exception is operated on the terminal, the terminal device stores a game application program and is used for presenting a virtual scene in a game screen. The terminal device is used for interacting with a user through a graphical user interface, for example, downloading and installing a game application program through the terminal device and running the game application program. The manner in which the terminal device provides the graphical user interface to the user may include a variety of ways, for example, the graphical user interface may be rendered for display on a display screen of the terminal device or presented by holographic projection. For example, the terminal device may include a touch display screen for presenting a graphical user interface including a game screen and receiving operation instructions generated by a user acting on the graphical user interface, and a processor for executing the game, generating the graphical user interface, responding to the operation instructions, and controlling display of the graphical user interface on the touch display screen.
For example, when the method for processing the online game exception runs on the server, the method can be a cloud game. Cloud gaming refers to a gaming regime based on cloud computing. In the running mode of the cloud game, the running main body of the game application program and the game picture presenting main body are separated, and the storage and the running of the method for processing the network game abnormity are finished on the cloud game server. The game screen presentation is performed at a cloud game client, which is mainly used for receiving and sending game data and presenting the game screen, for example, the cloud game client may be a display device with a data transmission function near a user side, such as a mobile terminal, a television, a computer, a palm computer, a personal digital assistant, and the like, but a terminal device for performing game data processing is a cloud game server at the cloud end. When a game is played, a user operates the cloud game client to send an operation instruction to the cloud game server, the cloud game server runs the game according to the operation instruction, data such as game pictures and the like are encoded and compressed, the data are returned to the cloud game client through a network, and finally the data are decoded through the cloud game client and the game pictures are output.
Referring to fig. 1, fig. 1 is a system diagram illustrating an apparatus for handling online game exceptions according to an embodiment of the present disclosure. The system may include at least one terminal 1000, at least one server 2000, at least one database 3000, and a network 4000. The terminal 1000 held by the user can be connected to servers of different games through the network 4000. Terminal 1000 can be any device having computing hardware capable of supporting and executing a software product corresponding to a game. In addition, terminal 1000 can have one or more multi-touch sensitive screens for sensing and obtaining user input through touch or slide operations performed at multiple points on one or more touch sensitive display screens. In addition, when the system includes a plurality of terminals 1000, a plurality of servers 2000, and a plurality of networks 4000, different terminals 1000 may be connected to each other through different networks 4000 and through different servers 2000. The network 4000 may be a wireless network or a wired network, such as a Wireless Local Area Network (WLAN), a Local Area Network (LAN), a cellular network, a 2G network, a 3G network, a 4G network, a 5G network, and so on. In addition, different terminals 1000 may be connected to other terminals or a server using their own bluetooth network or hotspot network. For example, a plurality of users may be online through different terminals 1000 to be connected and synchronized with each other through a suitable network to support multiplayer games. In addition, the system may include a plurality of databases 3000, the plurality of databases 3000 being coupled to different servers 2000, and information related to the game environment may be continuously stored in the databases 3000 when different users play the multiplayer game online.
The embodiment of the application provides a method for processing online game abnormity, which can be executed by a terminal or a server. The embodiment of the present application is described by taking an example in which a method for processing an online game exception is executed by a terminal. The terminal comprises a touch display screen and a processor, wherein the touch display screen is used for presenting a graphical user interface and receiving an operation instruction generated by a user acting on the graphical user interface. When a user operates the graphical user interface through the touch display screen, the graphical user interface can control the local content of the terminal through responding to the received operation instruction, and can also control the content of the opposite-end server through responding to the received operation instruction. For example, the operation instruction generated by the user acting on the graphical user interface comprises an instruction for starting a game application, and the processor is configured to start the game application after receiving the instruction provided by the user for starting the game application. Further, the processor is configured to render and draw a graphical user interface associated with the game on the touch display screen. A touch display screen is a multi-touch sensitive screen capable of sensing a touch or slide operation performed at a plurality of points on the screen at the same time. The user uses a finger to perform touch operation on the graphical user interface, and when the graphical user interface detects the touch operation, different virtual objects in the graphical user interface of the game are controlled to perform actions corresponding to the touch operation. For example, the game may be any one of a leisure game, an action game, a role-playing game, a strategy game, a sports game, a game of chance, and the like. Wherein the game may include a virtual scene of the game drawn on a graphical user interface. Further, one or more virtual objects, such as virtual characters, controlled by the user (or player) may be included in the virtual scene of the game. Additionally, one or more obstacles, such as railings, ravines, walls, etc., may also be included in the virtual scene of the game to limit movement of the virtual objects, e.g., to limit movement of one or more objects to a particular area within the virtual scene. Optionally, the virtual scene of the game also includes one or more elements, such as skills, points, character health, energy, etc., to provide assistance to the player, provide virtual services, increase points related to player performance, etc. In addition, the graphical user interface may also present one or more indicators to provide instructional information to the player. For example, a game may include a player-controlled virtual object and one or more other virtual objects (such as enemy characters). In one embodiment, one or more other virtual objects are controlled by other players of the game. For example, one or more other virtual objects may be computer controlled, such as a robot using Artificial Intelligence (AI) algorithms, to implement a human-machine fight mode. For example, the virtual objects possess various skills or capabilities that the game player uses to achieve the goal. For example, the virtual object possesses one or more weapons, props, tools, etc. that may be used to eliminate other objects from the game. Such skills or capabilities may be activated by a player of the game using one of a plurality of preset touch operations with a touch display screen of the terminal. The processor may be configured to present a corresponding game screen in response to an operation instruction generated by a touch operation of a user.
Please refer to fig. 2, which is a flowchart illustrating a method for handling an online game exception according to an embodiment of the present application. Fig. 2 is a diagram for describing the technical solution of the present application with a first game server as an execution subject, wherein the first game server is a server that runs a first game. The method illustrated in fig. 2 mainly includes steps S201 to S204, which are explained in detail as follows:
in step S201, the frame rate of the game screen is calculated in real time.
The frame rate of the game screen may be expressed using a number of transmission Frames Per Second (FPS) of the game screen. Generally, on the premise that the frame rate is stable, the higher the frame rate is, the smoother the game screen is. However, for various reasons (e.g., processing capability of a central processing unit of the terminal device, a tension degree of a memory, a parallel number of processes, etc.), the frame rate may be in a fluctuating state, i.e., the frame rate is high or low, and the difference degree of the high or low can be expressed by using a frame rate variance. Although a higher frame rate may result in a smooth game scene, a frame rate with a too large fluctuation range may result in a player experiencing a game scene that is not smooth, as compared to a lower frame rate. For example, a game frame having an average frame rate of 50 frames and a variance of 10 frames is perceived by the player to be less fluent than a game frame having an average frame rate of 40 frames and a variance of 2 frames. Based on the facts, in the embodiment of the application, the frame rate of the game picture can be calculated in real time, so that the frame rate which enables the game picture to be smoother can be obtained. As an embodiment of the present application, the frame rate of the real-time calculation game screen may be: calculating the frame rate of the game picture in real time based on a Kalman filter according to the frame rate setting value and the frame rate predicted value of the game picture, wherein the frame rate setting value of the game picture is set by a player of the game according to the actual situation, the frame rate predicted value is a frame rate appointed during initialization, and the frame rate predicted value is obtained by prediction of the Kalman filter subsequently; the Kalman filter is used for smoothing the frame rate of the game picture, so that the variance of the game picture reaches the minimum value or a preset threshold value.
In one embodiment of the present application, the parameter of the kalman filter may be determined in advance, that is, before the frame rate of the game picture is calculated in real time based on the kalman filter according to the frame rate setting value and the frame rate prediction value of the game picture, the parameter of the kalman filter may be determined through steps S2011 to S2016 as follows:
step S2011: and iterating the parameters of the Kalman filter according to the frame rate setting value matrix and the preset iteration times.
Step S2012: and calculating the likelihood values of the frame rate predicted value covariance matrix and the frame rate set value covariance matrix according to the frame rate set value matrix and the frame rate predicted value matrix corresponding to the current frame.
The likelihood values of the covariance matrix of the predicted frame rate and the covariance matrix of the set frame rate are indicative of the similarity of the covariance matrix of the predicted frame rate and the covariance matrix of the set frame rate, and if the two are not too large, the predicted frame rate and the set frame rate are both within a reasonable range.
Step S2013: and judging whether the difference value between the current frame likelihood value of the game picture and the previous frame likelihood value is smaller than a preset difference value threshold value.
Step S2014: and if the difference value of the likelihood values of the current frame and the previous frame of the game picture is smaller than a preset difference value threshold value, determining that the iteration of the parameters of the Kalman filter is finished.
If the difference value of the likelihood values of the current frame and the previous frame of the game picture is smaller than the preset difference threshold value, the parameter of the Kalman filter at the moment is optimal, namely the variance of the frame rate calculated according to the Kalman filter model determined by the parameter is minimum, so that the iteration of the parameter of the Kalman filter can be stopped.
Step S2015: if the difference value of the likelihood values of the current frame and the previous frame of the game picture is not less than the preset difference value threshold, updating the frame rate setting value matrix and the frame rate prediction value matrix corresponding to the current frame, continuously calculating the likelihood values of the updated frame rate setting value matrix and the updated frame rate prediction value matrix, and determining that the iteration is finished until the difference value of the likelihood values of the current frame and the previous frame of the game picture is less than the preset difference value threshold or the iteration times reaches the preset iteration threshold.
Step S2016: and determining the frame rate predicted value covariance matrix and the frame rate setting value covariance matrix corresponding to the iteration as parameters of the Kalman filter.
After the parameters of the kalman filter are determined through the iteration from the step S2011 to the step S2013 to obtain the mathematical model of the kalman filter, the frame rate of the game picture can be calculated according to the frame rate setting value and the frame rate predicted value of the game picture, where the frame rate is also the frame rate at which the variance reaches the minimum or the preset threshold.
It should be noted that, since the frame rate of the game screen is calculated in real time, step S201 may be executed at any position from step S202 to step S204.
Step S202, at least one state updating notification message sent by the server when the network starts to recover is received, and the state updating notification message is cached in the queue.
In the embodiment of the application, the at least one status update notification message sent by the server is actually a message which is sent by the server but cannot be received by the game terminal due to the network failure in the period from when the network fails to recover. When the network starts to be restored, these status update notification messages are transmitted to the game terminal via the network that has been restored. As an embodiment of the present application, receiving at least one state update notification message sent by a server when a network starts to recover, and caching the state update notification message in a queue may be: and receiving at least one calling request sent by the server when the network starts to recover through a remote process calling interface, and caching the calling request in a queue.
For network games, the work to be done after network recovery is the state synchronization of the server and each client, and state synchronization does not mean that the logic corresponding to each state update notification message needs to be executed, for example, for the state update notification message 1 and the state update notification message 2, wherein the logic corresponding to the state update notification message 1 is to delete the special effect S using a certain resource R, the logic corresponding to the state update notification message 2 is to create the special effect S using the certain resource R, and the state update notification message 1 is sent to the terminal prior to the state update notification message 2, or the status update notification message 2 and the status update notification message 1 are delivered to the terminal one after another at an extremely short interval time, because the special effect S is required to be deleted before being created or almost immediately deleted after being created, the logic corresponding to the execution state updating notification message 1 and the state updating notification message 2 belongs to the execution redundancy; for another example, the logic corresponding to the status update notification message 3 is to move the character M from the current position to the position a, the logic corresponding to the status update notification message 4 is to move the character M from the current position to the position B, and the logic corresponding to the status update notification message 5 is to move the character M from the current position to the position C, i.e. the final result is to move the character M from the current position to the position C, and from the viewpoint of status synchronization, the status synchronization of each client can be realized only by moving the character M from the current position to the position C, therefore, although the status update notification message 3 and the status update notification message 4 are received, the logic corresponding to the status update notification message 3 and the status update notification message 4 is not necessary, i.e. when the status update notification message 3, the status update notification message 4 and the status update notification message 5 are received, the logic corresponding to the status update notification message 3 and the status update notification message 4 is still executed, which belongs to the execution of redundancy . Based on the above facts, after receiving at least one call request sent by the server when the network starts to recover through the remote procedure call interface, caching the call request in the queue may be: if the at least one calling request comprises n calling requests, judging whether execution redundancy exists in the n logics during execution according to the association among the n logics corresponding to the n calling requests; if the execution redundancy exists, the cache of the call request corresponding to the logic with the execution redundancy exists is abandoned, wherein n is a natural number which is greater than or equal to 2, and the logic execution redundancy comprises that in view of the existence of the association between the logic and other logic, the execution of the logic is not necessary from the aspect of state synchronization when other logic or other logics execute. Once the cache of the call request corresponding to the logic with execution redundancy is abandoned, the call request is not taken out from the queue subsequently, so that the call request calls the function to execute the corresponding logic.
In the above embodiment, the call request is cached before being cached to the queue, and the cache of the logic corresponding to the call request with execution redundancy is abandoned. In another embodiment of the present application, after the status update notification message is cached in the queue, the status update notification message corresponding to the logic with execution redundancy is removed, that is, if at least one status update notification message cached in the queue includes n status update notification messages, before step S203, it may be determined whether there is execution redundancy in the n logics during execution according to associations between the n logics corresponding to the n status update notification messages, and if there is execution redundancy, the status update notification message corresponding to the logic with execution redundancy is deleted from the queue, where n is a natural number greater than or equal to 2, and the definition of the logic execution redundancy is the same as the definition of the logic execution redundancy mentioned in the foregoing embodiment, and is not described again.
Step S203, when the game picture is refreshed according to the frame rate of the game picture obtained by real-time calculation, the logic corresponding to the state updating notification message is executed in each frame duration.
For the state update notification messages which are sent by the server but cannot be received by the game terminal due to the network failure, the processing mode in the prior art is that no matter how many state update notification messages are, the logic corresponding to all the state update notification messages is processed immediately after the state update notification messages are received. On the premise that the length of the game frame is fixed, when the state update notification message is too much, the result of the above conventional method is that the game frame is stuck. In the embodiment of the present application, the logic corresponding to the state update notification messages is not executed immediately after the state update notification messages are received, but the state update notification messages are buffered in the queue, and then, when the game screen is refreshed according to the frame rate of the game screen obtained by real-time calculation, the logic corresponding to the state update notification messages is executed within the duration of each frame. In other words, according to the technical solution of the present application, the logic corresponding to all the status update notification messages is not executed immediately after the status update notification messages are received, but the buffering and the framing processing are performed.
Buffering the state update notification messages in the queue in response to receiving at least one state update notification message sent by the server at the time the network begins to recover is: in an embodiment of the present application, when a game screen is refreshed according to a frame rate of the game screen obtained by real-time calculation, logic corresponding to executing a state update notification message within a duration of each frame may be: and when the game picture is refreshed according to the frame rate of the game picture obtained by real-time calculation, executing the function called by the calling request, and executing the logic corresponding to the function within the duration of each frame. Further, considering that, when the game screen is refreshed, not only the logic corresponding to the function called by the call request needs to be executed, but also the calculation tasks such as UI redeployment and screen redeployment need to be executed, even if the frame rate of the game screen is calculated in real time according to step S201, in an actual scene, the game screen cannot be refreshed completely according to the frame rate of the game screen obtained by real-time calculation, and the frame rate of the game screen obtained by real-time calculation needs to be adjusted so as to reserve time for the calculation tasks such as UI redeployment and screen redeployment in each frame of the game screen. Based on the above facts, in an embodiment of the present application, when the game screen is refreshed according to the frame rate of the game screen obtained by real-time calculation, by executing the function called by the call request, the logic corresponding to executing the function within each frame duration can be implemented by steps S2031 to S2033, which are described as follows:
step S2031: and adjusting the margin of the frame rate of the game picture obtained by real-time calculation to obtain the adjusted frame rate of the game picture, wherein the adjusted frame rate is less than the frame rate of the game picture obtained by real-time calculation.
In the embodiment of the present application, the frame rate margin adjustment size may be set according to an actual application scenario, and in principle, the lower the complexity of the game screen, the larger the frame rate of the game screen obtained through real-time calculation, the smaller the frame rate margin adjustment size. For example, if the frame rate of the game screen calculated in real time in step S201 is 50 frames/second, the frame rate of the game screen calculated may be reduced by 6%, that is, the frame rate of the game screen calculated may be multiplied by 94% to obtain an adjusted frame rate of the game screen of 47 frames/second, depending on the complexity of the game screen.
Step S2032: and calculating to obtain the duration of each frame after the frame rate is adjusted according to the adjusted frame rate of the game picture.
According to the definition of the frame rate, the duration of each frame after the frame rate adjustment can be calculated according to the adjusted frame rate of the game picture. For example, in step S2031, when the adjusted frame rate of the game screen is 47 frames/second, the frame rate is adjusted to 1/47 ≈ 21.3ms (milliseconds) per frame.
Step S2033: and when the game picture is refreshed according to the adjusted frame rate of the game picture, executing the logic corresponding to the function in the duration of each frame after the frame rate is adjusted.
Since the frame rate is inversely proportional to the frame length, when the adjusted frame rate is less than the frame rate of the game picture calculated in real time, the length of each frame after the frame rate adjustment will be longer, which also means that the system will allocate more CPU computing resources (e.g., allocated CPU length) to each frame after the frame rate adjustment. As shown in fig. 3, the hatched portion of the oblique line of the rectangular frame is the frame length corresponding to the frame rate of the game picture obtained by real-time calculation, the hatched portion of the grid represents the length of each frame after the frame rate adjustment, and the lengthened portion, i.e., the hatched portion of the grid, is reserved for calculation work such as UI redeployment and picture re-rendering in each frame.
Step S204, if the logic corresponding to all the state updating notification messages in the queue is not executed in the current frame time, the logic corresponding to the remaining state updating notification messages in the queue is executed in the next frame time of the current frame until the logic corresponding to all the state updating notification messages in the queue is executed.
As described above, the conventional method is to process the logic corresponding to all the status update notification messages within a frame time length, thereby causing the game picture to be stuck, and the technical solution of the present application is to buffer and then perform the frame processing on the status update notification messages, in other words, if the logic corresponding to all the status update notification messages in the queue is not executed within the current frame time length in step S203, the logic corresponding to the remaining status update notification messages in the queue is executed within the next frame time length of the current frame until the logic corresponding to all the status update notification messages in the queue is executed. As shown in fig. 4, it is assumed that 20 status update notification messages are buffered in the queue, the current frame is a frame with a frame number of 3, and only the logic corresponding to 6 status update notification messages in the 20 status update notification messages is executed within the frame duration with the frame number of 3, so that the logic corresponding to the remaining 14 status update notification messages is executed within the frame duration with the frame number of 4. If the logic corresponding to 14 state update notification messages cannot be completely executed within the frame duration with the frame number of 4, for example, only the logic corresponding to 8 state update notification messages in the 14 state update notification messages can be executed, the logic corresponding to the remaining 6 state update notification messages will continue to be executed within the frame duration with the frame number of 5, and so on until the logic corresponding to the 20 state update notification messages is completely executed.
When the frame rate of the game screen is high, the time length of each frame may be short. In the foregoing embodiment of the present application, in order to quickly retrieve the state update notification message from the queue in the subsequent refreshing of the game screen, when caching the state update notification message in the queue, the state update notification message may specifically be: the received state updating notification messages are cached to at least two queues, then, according to the time stamps of the at least two queues, a priority processing queue is determined from the time stamps of the at least two queues, other queues are marked as suspension queues, and the time stamps of the queues are updated in real time according to the time stamps of the state updating notification messages in the queues. And when the state updating notification message is subsequently retrieved from the priority processing queue, monitoring whether a suspension queue with a timestamp smaller than the timestamp of the priority processing queue is present in the suspension queue, if the suspension queue with the timestamp smaller than the timestamp of the priority processing queue is present, switching the suspension queue to a new priority processing queue, marking other queues as new suspension queues, and retrieving the state updating notification message from the new priority processing queue. Therefore, the state updating notification message in the priority processing queue with the earliest timestamp can be dynamically selected, and the timeliness and the accuracy of retrieving the state updating notification message are ensured.
In order to achieve the same purpose as the above embodiment, that is, the state update notification message can be quickly retrieved from the queue when the game screen is refreshed, in another embodiment of the present application, when the state update notification message is cached in the queue, specifically, the method may further include: the method comprises the steps of constructing an inner layer circular queue realized based on an array and an outer layer circular queue realized based on a linked list, setting a management pointer of the outer layer circular queue realized based on the linked list, and caching a state updating notification message in the inner layer circular queue realized based on the array according to the management pointer of the outer layer circular queue. As for the method for constructing the inner-layer circular queue implemented based on the array and the outer-layer circular queue implemented based on the linked list, the method specifically includes: establishing an inner-layer circular queue based on an array, distributing a continuous memory area for each inner-layer circular queue realized based on the array, using the inner-layer circular queue realized based on the array as a node, connecting each inner-layer circular queue realized based on the array in series in a linked list mode to form a circular queue, obtaining an outer-layer circular queue realized based on the linked list, and caching a state updating notification message in the inner-layer circular queue realized based on the array according to a management pointer of the outer-layer circular queue, wherein the method comprises the following steps: establishing an inner-layer circular queue realized based on an array according to a set memory region value, simultaneously pointing a head pointer and a tail pointer of an outer-layer circular queue realized based on a linked list to the inner-layer circular queue realized based on the array, and storing a state updating notification message in a memory region corresponding to the inner-layer circular queue according to a storage space state of the inner-layer circular queue of a management pointer pointing node. The embodiment makes full use of the advantages of two queue modes based on the array and the linked list, not only can improve the utilization rate of the cache, but also can improve the reading efficiency of the state updating notification message.
As can be seen from the method for processing online game exceptions illustrated in fig. 2, on one hand, since the frame rate of the game screen is calculated in real time, it is possible to make the game screen smooth; on the other hand, when the game picture is refreshed according to the frame rate of the game picture obtained by real-time adjustment, when the logic corresponding to all the state updating notification messages is not executed in the duration of the current frame, the logic corresponding to the remaining state updating notification messages is executed in the duration of the next frame of the current frame, namely, the logic corresponding to all the state updating notification messages in the queue is not forcibly executed in the duration of the current frame, but the logic corresponding to the state updating notification messages is subjected to time-sharing processing when more logic is needed, so that the picture pause caused by the fact that more logic needs to be executed in the duration of the current frame can be eliminated.
In order to better implement the method for processing the online game exception in the embodiment of the application, the embodiment of the application also provides a device for processing the online game exception. Please refer to fig. 5, which is a schematic structural diagram of an apparatus for processing an online game exception according to an embodiment of the present application. The device for processing the network game exception may be a terminal or a functional module/unit therein, and the device illustrated in fig. 5 may include a calculating module 501, a caching module 502, a first executing module 503 and a second executing module 504, where:
a calculating module 501, configured to calculate a frame rate of a game picture in real time;
a caching module 502, configured to receive at least one state update notification message sent by a server when a network starts to recover, and cache the state update notification message in a queue;
a first executing module 503, configured to execute a logic corresponding to the state update notification message within each frame duration when the game screen is refreshed according to the frame rate of the game screen obtained through real-time calculation;
the second executing module 504 is configured to, if the logic corresponding to all the status update notification messages in the queue is not executed within the time length of the current frame, execute the logic corresponding to the remaining status update notification messages in the queue within the time length of the next frame of the current frame until the logic corresponding to all the status update notification messages in the queue is executed.
Optionally, the calculating module 501 illustrated in fig. 5 may include a frame rate calculating unit, where:
and the frame rate calculation unit calculates the frame rate of the game picture in real time based on the Kalman filter according to the frame rate setting value and the frame rate predicted value of the game picture.
Optionally, the apparatus illustrated in fig. 5 may further include an iteration module, a likelihood value calculation module, a judgment module, a first determination module, an update module, and a second determination module, where:
the iteration module is used for iterating the parameters of the Kalman filter according to the frame rate setting value matrix and the preset iteration times;
the likelihood value calculation module is used for calculating the likelihood values of the frame rate predicted value covariance matrix and the frame rate set value covariance matrix according to the frame rate set value matrix and the frame rate predicted value matrix corresponding to the current frame;
the judging module is used for judging whether the difference value between the current frame likelihood value of the game picture and the likelihood value of the previous frame is smaller than a preset difference value threshold value or not;
the first determining module is used for determining that the iteration of the parameters of the Kalman filter is finished if the difference value of the likelihood values of the current frame and the previous frame of the game picture is smaller than a preset difference value threshold;
the updating module is used for updating the frame rate setting value matrix and the frame rate predicted value matrix corresponding to the current frame if the difference value of the likelihood values of the current frame and the previous frame of the game picture is not less than the preset difference value threshold value, and continuously calculating the likelihood values of the updated frame rate setting value matrix and the updated frame rate predicted value matrix until the difference value of the likelihood values of the frame rate predicted value covariance matrix and the frame rate setting value covariance matrix of the current frame and the previous frame of the game picture is less than the preset difference value threshold value or the iteration times reach the preset iteration threshold value, so that the iteration is determined to be finished;
and the second determining module is used for determining the frame rate predicted value covariance matrix and the frame rate setting value covariance matrix corresponding to the iteration completed as parameters of the Kalman filter.
Optionally, the cache module 502 illustrated in fig. 5 may include a call request cache unit, and the first execution module 503 may include a function execution unit, where:
the system comprises a calling request caching unit, a queue processing unit and a processing unit, wherein the calling request caching unit is used for receiving at least one calling request sent by a server when the network starts to recover through a remote process calling interface and caching the calling request in the queue;
and the function execution unit is used for executing the logic corresponding to the function in each frame duration by executing the function called by the calling request when the game picture is refreshed according to the frame rate of the game picture obtained by real-time calculation.
Optionally, the call request cache unit may include a first determining unit and a storage accepting and rejecting unit, where:
the first judging unit is used for judging whether execution redundancy exists in the n logics during execution according to the association among the n logics corresponding to the n calling requests if the at least one calling request comprises the n calling requests, wherein n is a natural number greater than or equal to 2;
and the storage accepting and rejecting unit is used for giving up the cache of the call request corresponding to the logic with the execution redundancy if the execution redundancy exists.
Optionally, the function execution unit may include a frame rate adjustment unit, a frame length calculation unit, and a logic execution unit, where:
the frame rate adjusting unit is used for adjusting the margin of the frame rate of the game picture obtained through real-time calculation to obtain the adjusted frame rate of the game picture, wherein the adjusted frame rate is smaller than the frame rate of the game picture obtained through real-time calculation;
the frame length calculating unit is used for calculating the length of each frame after the frame rate is adjusted according to the adjusted frame rate of the game picture;
and the logic execution unit is used for executing the logic corresponding to the function called by the calling request in each frame duration after the frame rate is adjusted when the game picture is refreshed according to the adjusted frame rate of the game picture.
Optionally, the apparatus illustrated in fig. 5 may further include a second determining module and a deleting module, where:
a second determining module, configured to determine whether execution redundancy exists in the n logics during execution according to associations between the n logics corresponding to the n state update notification messages if the at least one state update notification message cached in the queue includes the n state update notification messages, where n is a natural number greater than or equal to 2;
and the deleting module is used for deleting the logic corresponding state updating notification message with the execution redundancy from the queue if the execution redundancy exists.
Optionally, the buffering module 502 illustrated in fig. 5 may include a first data buffering unit and a queue determining unit, where:
the first data caching unit is used for caching the state updating notification message to at least two queues;
and the queue determining unit is used for determining a priority processing queue from the timestamps of the at least two queues according to the timestamps of the at least two queues, and marking other queues as suspension queues, wherein the timestamps of the queues are updated in real time according to the timestamp of the state updating notification message in the queues.
Optionally, the buffering module 502 illustrated in fig. 5 may include a queue creating unit, a setting unit, and a second data buffering unit, where:
the queue creating unit is used for constructing an inner layer circular queue realized based on an array and an outer layer circular queue realized based on a linked list;
the setting unit is used for setting a management pointer of the outer-layer circular queue;
and the second data caching unit is used for caching the state updating notification message in the inner-layer circular queue realized based on the array according to the management pointer of the outer-layer circular queue.
All the above technical solutions can be combined arbitrarily to form the optional embodiments of the present application, and are not described herein again.
As can be seen from the apparatus for processing an abnormality of a network game illustrated in fig. 5, on the one hand, since the frame rate of the game screen is calculated in real time, it is possible to smoothen the game screen; on the other hand, when the game picture is refreshed according to the frame rate of the game picture obtained by real-time adjustment, when the logic corresponding to all the state updating notification messages is not executed in the duration of the current frame, the logic corresponding to the remaining state updating notification messages is executed in the duration of the next frame of the current frame, namely, the logic corresponding to all the state updating notification messages in the queue is not forcibly executed in the duration of the current frame, but the logic corresponding to the state updating notification messages is subjected to time-sharing processing when more logic is needed, so that the picture pause caused by the fact that more logic needs to be executed in the duration of the current frame can be eliminated.
Correspondingly, the embodiment of the present application further provides a Computer device, where the Computer device may be a terminal or a server, and the terminal may be a terminal device such as a smart phone, a tablet Computer, a notebook Computer, a touch screen, a game machine, a Personal Computer (PC), a Personal Digital Assistant (PDA), and the like. As shown in fig. 6, fig. 6 is a schematic structural diagram of a computer device according to an embodiment of the present application. The computer apparatus 600 includes a processor 601 having one or more processing cores, a memory 602 having one or more computer-readable storage media, and a computer program stored on the memory 602 and executable on the processor. The processor 601 is electrically connected to the memory 602. Those skilled in the art will appreciate that the computer device configurations illustrated in the figures are not meant to be limiting of computer devices and may include more or fewer components than those illustrated, or some components may be combined, or a different arrangement of components.
The processor 601 is a control center of the computer apparatus 600, connects various parts of the entire computer apparatus 600 using various interfaces and lines, performs various functions of the computer apparatus 600 and processes data by running or loading software programs and/or modules stored in the memory 602, and calling data stored in the memory 602, thereby monitoring the computer apparatus 600 as a whole.
In the embodiment of the present application, the processor 601 in the computer device 600 loads instructions corresponding to processes of one or more applications into the memory 602, and the processor 601 executes the applications stored in the memory 602 according to the following steps, so as to implement various functions:
calculating the frame rate of game pictures in real time; receiving at least one state updating notification message sent by a server when the network starts to recover, and caching the state updating notification message in a queue; when the game picture is refreshed according to the frame rate of the game picture obtained by real-time calculation, executing logic corresponding to the state updating notification message in the duration of each frame; and if the logic corresponding to all the state updating notification messages in the queue is not executed within the time length of the current frame, executing the logic corresponding to the remaining state updating notification messages in the queue within the time length of the next frame of the current frame until the logic corresponding to all the state updating notification messages in the queue is executed.
The above operations can be implemented in the foregoing embodiments, and are not described in detail herein.
Optionally, as shown in fig. 6, the computer device 600 further includes: a touch display screen 603, a radio frequency circuit 604, an audio circuit 605, an input unit 606, and a power supply 607. The processor 601 is electrically connected to the touch display screen 603, the radio frequency circuit 604, the audio circuit 605, the input unit 606, and the power supply 607. Those skilled in the art will appreciate that the computer device configuration illustrated in FIG. 6 does not constitute a limitation of computer devices, and may include more or fewer components than those illustrated, or some components may be combined, or a different arrangement of components.
The touch display screen 603 can be used for displaying a graphical user interface and receiving operation instructions generated by a user acting on the graphical user interface. The touch display screen 603 may include a display panel and a touch panel. The display panel may be used, among other things, to display information entered by or provided to a user and various graphical user interfaces of the computer device, which may be made up of graphics, text, icons, video, and any combination thereof. Alternatively, the Display panel may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like. The touch panel may be used to collect touch operations of a user on or near the touch panel (for example, operations of the user on or near the touch panel using any suitable object or accessory such as a finger, a stylus pen, and the like), and generate corresponding operation instructions, and the operation instructions execute corresponding programs. Alternatively, the touch panel may include two parts, a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 601, and can receive and execute commands sent by the processor 601. The touch panel may overlay the display panel, and when the touch panel detects a touch operation thereon or nearby, the touch panel transmits the touch operation to the processor 601 to determine the type of the touch event, and then the processor 601 provides a corresponding visual output on the display panel according to the type of the touch event. In the embodiment of the present application, the touch panel and the display panel may be integrated into the touch display screen 603 to implement input and output functions. However, in some embodiments, the touch panel and the touch panel can be implemented as two separate components to perform the input and output functions. That is, the touch display screen 603 can also be used as a part of the input unit 606 to implement an input function.
In the embodiment of the present application, a game application is executed by the processor 601 to generate a graphical user interface on the touch display screen 603, where a virtual scene on the graphical user interface includes at least one skill control area, and the skill control area includes at least one skill control. The touch display screen 603 is used for presenting a graphical user interface and receiving an operation instruction generated by a user acting on the graphical user interface.
The rf circuit 604 may be used for transceiving rf signals to establish wireless communication with a network device or other computer device via wireless communication, and for transceiving signals with the network device or other computer device.
The audio circuit 605 may be used to provide an audio interface between the user and the computer device through speakers, microphones. The audio circuit 605 may transmit the electrical signal converted from the received audio data to a speaker, and convert the electrical signal into a sound signal for output; on the other hand, the microphone converts the collected sound signal into an electrical signal, which is received by the audio circuit 605 and converted into audio data, which is then processed by the audio data output processor 601, and then transmitted to, for example, another computer device via the radio frequency circuit 604, or output to the memory 602 for further processing. The audio circuit 605 may also include an earbud jack to provide communication of peripheral headphones with the computer device.
The input unit 606 may be used to receive input numbers, character information, or user characteristic information (e.g., fingerprint, iris, facial information, etc.), and generate keyboard, mouse, joystick, optical, or trackball signal inputs related to user settings and function control.
The power supply 607 is used to power the various components of the computer device 600. Optionally, the power supply 607 may be logically connected to the processor 601 through a power management system, so as to implement functions of managing charging, discharging, and power consumption management through the power management system. The power supply 607 may also include any component including one or more dc or ac power sources, recharging systems, power failure detection circuitry, power converters or inverters, power status indicators, and the like.
Although not shown in fig. 6, the computer device 600 may further include a camera, a sensor, a wireless fidelity module, a bluetooth module, etc., which are not described in detail herein.
In the foregoing embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
As can be seen from the above, on one hand, the computer device provided in this embodiment calculates the frame rate of the game screen in real time, so that the game screen becomes smooth; on the other hand, when the game picture is refreshed according to the frame rate of the game picture obtained by real-time adjustment, when the logic corresponding to all the state updating notification messages is not executed in the duration of the current frame, the logic corresponding to the remaining state updating notification messages is executed in the duration of the next frame of the current frame, namely, the logic corresponding to all the state updating notification messages in the queue is not forcibly executed in the duration of the current frame, but the logic corresponding to the state updating notification messages is subjected to time-sharing processing when more logic is needed, so that the picture pause caused by the fact that more logic needs to be executed in the duration of the current frame can be eliminated.
It will be understood by those skilled in the art that all or part of the steps of the methods of the above embodiments may be performed by instructions or by associated hardware controlled by the instructions, which may be stored in a computer readable storage medium and loaded and executed by a processor.
To this end, the present application provides a computer-readable storage medium, in which a plurality of computer programs are stored, and the computer programs can be loaded by a processor to execute the steps in any method for processing the online game exception provided by the embodiments of the present application. For example, the computer program may perform the steps of:
calculating the frame rate of game pictures in real time; receiving at least one state updating notification message sent by a server when the network starts to recover, and caching the state updating notification message in a queue; when the game picture is refreshed according to the frame rate of the game picture obtained by real-time calculation, executing logic corresponding to the state updating notification message in the duration of each frame; and if the logic corresponding to all the state updating notification messages in the queue is not executed within the time length of the current frame, executing the logic corresponding to the remaining state updating notification messages in the queue within the time length of the next frame of the current frame until the logic corresponding to all the state updating notification messages in the queue is executed.
The above operations can be implemented in the foregoing embodiments, and are not described in detail herein.
Wherein the storage medium may include: read Only Memory (ROM), Random Access Memory (RAM), magnetic or optical disks, and the like.
Since the computer program stored in the storage medium can execute the steps in any method for processing the network game abnormality provided in the embodiment of the present application, the beneficial effects that can be achieved by any method for processing the network game abnormality provided in the embodiment of the present application can be achieved, for details, see the foregoing embodiment, and are not described herein again.
The method, the apparatus, the storage medium, and the computer device for processing online game exceptions provided by the embodiments of the present application are introduced in detail above, and specific examples are applied in the present application to explain the principles and embodiments of the present application, and the descriptions of the above embodiments are only used to help understand the method and the core ideas of the present application; meanwhile, for those skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (12)

1. A method for handling online game exceptions, comprising:
calculating the frame rate of game pictures in real time;
receiving at least one state updating notification message sent by a server when the network starts to recover, and caching the state updating notification message in a queue;
when the game picture is refreshed according to the frame rate of the game picture obtained by real-time calculation, executing the logic corresponding to the state updating notification message in the duration of each frame;
and if the logic corresponding to all the state updating notification messages in the queue is not executed within the time length of the current frame, executing the logic corresponding to the remaining state updating notification messages in the queue within the time length of the next frame of the current frame until the logic corresponding to all the state updating notification messages in the queue is executed.
2. The method for processing online game exceptions as recited in claim 1, wherein the calculating a frame rate of the game screen in real time comprises:
and calculating the frame rate of the game picture in real time based on a Kalman filter according to the frame rate setting value and the frame rate predicted value of the game picture.
3. The method for processing online game anomalies according to claim 2, wherein before calculating the frame rate of the game picture based on the kalman filter in real time according to the frame rate setting value and the frame rate prediction value of the game picture, the method further comprises:
iterating the parameters of the Kalman filter according to a frame rate setting value matrix and preset iteration times;
calculating the likelihood values of a frame rate predicted value covariance matrix and a frame rate set value covariance matrix according to the frame rate set value matrix and the frame rate predicted value matrix corresponding to the current frame;
judging whether the difference value of the current frame likelihood value of the game picture and the likelihood value of the previous frame is smaller than a preset difference value threshold value or not;
if the difference value of the likelihood values of the current frame and the previous frame of the game picture is smaller than a preset difference threshold value, determining that the iteration of the parameters of the Kalman filter is finished;
if the difference value of the likelihood values of the current frame and the previous frame of the game picture is not smaller than a preset difference value threshold value, updating a frame rate setting value matrix and a frame rate predicted value matrix corresponding to the current frame, continuously calculating the likelihood values of the updated frame rate setting value matrix and the updated frame rate predicted value matrix until the difference value of the likelihood values of the current frame and the previous frame of the game picture is smaller than a preset difference value threshold value or the iteration times reaches a preset iteration threshold value, and determining that the iteration is finished;
and determining a frame rate predicted value covariance matrix and a frame rate setting value covariance matrix corresponding to the iteration as parameters of the Kalman filter.
4. The method for handling online game exceptions according to claim 1, wherein the receiving at least one status update notification message sent by the server when the network starts to recover and buffering the status update notification message in a queue comprises: receiving at least one calling request sent by a server when the network starts to recover through a remote process calling interface, and caching the calling request in a queue;
when the game picture is refreshed according to the frame rate of the game picture obtained by real-time calculation, the logic corresponding to the state updating notification message is executed in the duration of each frame, and the logic comprises the following steps: and when the game picture is refreshed according to the frame rate of the game picture obtained by real-time calculation, executing the function called by the calling request, and executing the logic corresponding to the function within the duration of each frame.
5. The method of handling online game exceptions according to claim 4, wherein the caching of the invocation request in a queue comprises:
if the at least one calling request comprises n calling requests, judging whether execution redundancy exists in the n logics during execution according to the association among the n logics corresponding to the n calling requests, wherein n is a natural number greater than or equal to 2;
and if the execution redundancy exists, giving up the cache of the call request corresponding to the logic with the execution redundancy.
6. The method for processing online game exceptions according to claim 4, wherein the executing a function called by the call request within each frame duration when refreshing the game screen according to the frame rate of the game screen obtained by the real-time calculation comprises:
performing margin adjustment on the frame rate of the game picture obtained through real-time calculation to obtain an adjusted frame rate of the game picture, wherein the adjusted frame rate is smaller than the frame rate of the game picture obtained through real-time calculation;
calculating to obtain the duration of each frame after the frame rate is adjusted according to the adjusted frame rate of the game picture;
and when the game picture is refreshed according to the adjusted frame rate of the game picture, executing the logic corresponding to the function within the duration of each frame after the frame rate is adjusted.
7. The method for handling online game exception as claimed in claim 1, wherein before executing the logic corresponding to the status update notification message within each frame duration when refreshing the game screen according to the frame rate of the game screen obtained by the real-time calculation, further comprising:
if the at least one state updating notification message cached in the queue includes n state updating notification messages, judging whether execution redundancy exists in the n logics during execution according to the association between the n logics corresponding to the n state updating notification messages, wherein n is a natural number greater than or equal to 2;
and if the execution redundancy exists, deleting the logic corresponding state updating notification message with the execution redundancy from the queue.
8. The method of handling online gaming exceptions of claim 1 wherein the caching of the status update notification message in a queue comprises:
buffering the state update notification messages to at least two queues;
and determining a priority processing queue from the timestamps of the at least two queues according to the timestamps of the at least two queues, marking other queues as a suspension queue, and updating the timestamps of the queues in real time according to the timestamp of the state updating notification message in the queues.
9. The method of handling online gaming exceptions of claim 1 wherein the caching of the status update notification message in a queue comprises:
constructing an inner layer circular queue realized based on an array and an outer layer circular queue realized based on a linked list;
setting a management pointer of the outer layer circular queue;
and according to the management pointer of the outer layer circular queue, caching the state updating notification message in the inner layer circular queue realized based on the array.
10. An apparatus for handling online game exceptions, comprising:
the computing module is used for computing the frame rate of the game picture in real time;
the cache module is used for receiving at least one state updating notification message sent by a server when the network starts to recover and caching the state updating notification message in a queue;
the first execution module is used for executing the logic corresponding to the state updating notification message in each frame duration when the game picture is refreshed according to the frame rate of the game picture obtained by real-time calculation;
and the second execution module is used for executing the logic corresponding to the residual state updating notification messages in the queue within the next frame time of the current frame until the logic corresponding to all the state updating notification messages in the queue is executed.
11. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program adapted to be loaded by a processor to execute the steps of the method for handling online game exceptions of any one of claims 1 to 9.
12. A computer device, characterized in that the computer device comprises a memory and a processor, the memory stores a computer program, the processor executes the steps of the method for processing the network game exception according to any one of claims 1 to 9 by calling the computer program stored in the memory.
CN202110662856.5A 2021-06-15 2021-06-15 Method, device, storage medium and computer equipment for processing online game abnormity Pending CN113350782A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110662856.5A CN113350782A (en) 2021-06-15 2021-06-15 Method, device, storage medium and computer equipment for processing online game abnormity

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110662856.5A CN113350782A (en) 2021-06-15 2021-06-15 Method, device, storage medium and computer equipment for processing online game abnormity

Publications (1)

Publication Number Publication Date
CN113350782A true CN113350782A (en) 2021-09-07

Family

ID=77534332

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110662856.5A Pending CN113350782A (en) 2021-06-15 2021-06-15 Method, device, storage medium and computer equipment for processing online game abnormity

Country Status (1)

Country Link
CN (1) CN113350782A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114979091A (en) * 2022-07-28 2022-08-30 腾讯科技(深圳)有限公司 Data transmission method, related device, equipment and storage medium
CN115878065A (en) * 2023-02-16 2023-03-31 青岛意想意创技术发展有限公司 Control method and device for interactive system composed of interactive display units
CN115944921A (en) * 2023-03-13 2023-04-11 腾讯科技(深圳)有限公司 Game data processing method, device, equipment and medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120004042A1 (en) * 2008-12-15 2012-01-05 David Perry Intelligent Game Loading
CN107196794A (en) * 2017-05-18 2017-09-22 腾讯科技(深圳)有限公司 A kind of abnormal analysis method of interim card and device
CN108144298A (en) * 2017-12-18 2018-06-12 福建省天奕网络科技有限公司 A kind of optimization method rendered and terminal of playing
CN108984293A (en) * 2017-06-01 2018-12-11 网易(杭州)网络有限公司 The display methods and device of game content, storage medium, processor and terminal
CN111078172A (en) * 2019-12-04 2020-04-28 在线途游(北京)科技有限公司 Display fluency adjusting method and device, electronic equipment and storage medium
CN111744177A (en) * 2020-07-28 2020-10-09 腾讯科技(深圳)有限公司 Game data processing method and device, storage medium and electronic equipment
US10967274B1 (en) * 2019-03-13 2021-04-06 Amazon Technologies, Inc. Dynamic management of processes executing on computing instances

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120004042A1 (en) * 2008-12-15 2012-01-05 David Perry Intelligent Game Loading
CN107196794A (en) * 2017-05-18 2017-09-22 腾讯科技(深圳)有限公司 A kind of abnormal analysis method of interim card and device
CN108984293A (en) * 2017-06-01 2018-12-11 网易(杭州)网络有限公司 The display methods and device of game content, storage medium, processor and terminal
CN108144298A (en) * 2017-12-18 2018-06-12 福建省天奕网络科技有限公司 A kind of optimization method rendered and terminal of playing
US10967274B1 (en) * 2019-03-13 2021-04-06 Amazon Technologies, Inc. Dynamic management of processes executing on computing instances
CN111078172A (en) * 2019-12-04 2020-04-28 在线途游(北京)科技有限公司 Display fluency adjusting method and device, electronic equipment and storage medium
CN111744177A (en) * 2020-07-28 2020-10-09 腾讯科技(深圳)有限公司 Game data processing method and device, storage medium and electronic equipment

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114979091A (en) * 2022-07-28 2022-08-30 腾讯科技(深圳)有限公司 Data transmission method, related device, equipment and storage medium
CN114979091B (en) * 2022-07-28 2022-11-11 腾讯科技(深圳)有限公司 Data transmission method, related device, equipment and storage medium
CN115878065A (en) * 2023-02-16 2023-03-31 青岛意想意创技术发展有限公司 Control method and device for interactive system composed of interactive display units
CN115878065B (en) * 2023-02-16 2023-05-23 青岛意想意创技术发展有限公司 Control method and device for interactive system formed by interactive display units
CN115944921A (en) * 2023-03-13 2023-04-11 腾讯科技(深圳)有限公司 Game data processing method, device, equipment and medium
CN115944921B (en) * 2023-03-13 2023-05-23 腾讯科技(深圳)有限公司 Game data processing method, device, equipment and medium

Similar Documents

Publication Publication Date Title
US11135515B2 (en) Information processing method and apparatus and server
CN113350782A (en) Method, device, storage medium and computer equipment for processing online game abnormity
US11541309B2 (en) Quickly suspending and resuming applications running on a cloud server
CN112245904B (en) Method, system, storage medium and computer device for supporting cross-service game
CN111078172B (en) Display fluency adjusting method and device, electronic equipment and storage medium
CN112169311A (en) Method, system, storage medium and computer device for training AI (Artificial Intelligence)
CN112206517A (en) Rendering method, device, storage medium and computer equipment
CN115040873A (en) Game grouping processing method and device, computer equipment and storage medium
CN115193049A (en) Virtual role control method, device, storage medium and computer equipment
CN113181632A (en) Information prompting method and device, storage medium and computer equipment
CN115888101A (en) Virtual role state switching method and device, storage medium and electronic equipment
CN112799754B (en) Information processing method, information processing device, storage medium and computer equipment
CN115501581A (en) Game control method and device, computer equipment and storage medium
CN113350801A (en) Model processing method and device, storage medium and computer equipment
CN114146406A (en) Method and device for allocating operation resources, electronic equipment and storage medium
CN113426115A (en) Game role display method and device and terminal
CN113413600A (en) Information processing method, information processing device, computer equipment and storage medium
CN113867873A (en) Page display method and device, computer equipment and storage medium
CN113360343B (en) Method and device for analyzing memory occupation condition, storage medium and computer equipment
CN115531876A (en) Picture rendering method and device, storage medium and electronic equipment
CN112783860B (en) Method, device, storage medium and computer equipment for constructing mirror image database
CN113426121A (en) Game control method, game control device, storage medium and computer equipment
CN114632328A (en) Method, device, terminal and storage medium for displaying special effects in game
CN115869627A (en) Game state restoration method and device, computer equipment and storage medium
CN115518375A (en) Game word skipping display method and device, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination