A mini-game delay control management method and system
By obtaining network status coefficients, differential compression operation data and building operation rehearsal models, the operation delay and screen lag of mini games in the case of network delay are solved, high-quality delay control and management are achieved, and user experience is improved.
Patent Information
- Application Number
- CN202411942316.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-27
- Publication Date
- 2025-05-06
- Estimated Expiration
- 2044-12-27
AI Technical Summary
Poor network conditions will lead to problems such as operation delays and screen stuttering in multiplayer online mode, reducing the playability of the game and causing player loss.
By obtaining the current network state coefficient for delay judgment, differential compression and short-term storage of player operation data using time windows, building and training an LSTM-based operation rehearsal model, predicting player operations in a delayed state, and smoothly correcting through tween technology.
It realizes high-quality control and management of mini games under network delays, avoids operational lags and screen jumps, and improves the smoothness and consistency of the user experience.
Smart Images

Figure CN119367748B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of mini-game delay management, and more specifically, to a mini-game delay regulation and management method and system. Background Art
[0002] Mini games are lightweight games that typically load and run quickly on mobile devices or web pages. They are designed to provide simple entertainment that players can easily start playing without complicated installation processes.
[0003] Therefore, given the lightweight and accessible nature of mini-games, poor network conditions can directly impact data transmission between players and the server, especially in multiplayer online modes, which often rely on low latency to ensure a smooth gaming experience. If the network connection is unstable, data packets may be lost, delayed, or misplaced during transmission, leading to in-game operational delays, screen freezes, and even the need for frequent disconnections and reconnections. This reduces the mini-game's playability and can even lead to a loss of both traffic and players.
[0004] Therefore, based on the above problems, it is necessary to design delay control management for mini-games. Summary of the Invention
[0005] In view of the problems existing in the prior art, the purpose of the present invention is to provide a method and system for mini-game delay regulation and management to achieve high-quality regulation and management of mini-game delay.
[0006] To achieve the above objectives, the present invention provides the following technical solutions: The mini-game delay control and management method includes:
[0007] Step S1: Obtain the network state coefficient at the current time t, perform delay judgment, and generate a delay state and a non-delay state;
[0008] Step S2: Using the time window, perform differential compression on the player's operation data and store it for a short period of time to form a temporary data packet;
[0009] Step S3: Construct and train an operation preview model. Under the delay state, input the network state coefficient and temporary data packet at the current time t into the trained operation preview model to predict the player's preview operation at the future time T1;
[0010] Step S4: Connecting the preview operation with the operation data at time t+BL so that the game continues on the client;
[0011] Step S5: collecting the real-time operation data after the delay recovery, using the interpolation technology to smoothly correct the preview operation according to the real-time operation data, and arranging it on the client.
[0012] Preferably, the method of obtaining the network status coefficient at the current time t and performing delay judgment includes:
[0013] Collect the client network's Ping time, jitter frequency, packet loss rate, bandwidth, and transmission flow at the current time t, and calculate the network status coefficient
[0014] ;
[0015] Set the state threshold Yz. If WL(t)≤Yz, the network state is considered good and in a non-delayed state. If WL(t)>Yz, the network state is considered abnormal and in a delayed state.
[0016] Among them, WL(t) represents the network status coefficient at the current time t, Ping t Indicates the ping time at the current time t, Dh t Indicates the jitter frequency at the current time t, Db t Indicates the packet loss rate at the current time t, Cs t Indicates the bandwidth at the current time t, Dk t represents the transmission flow at the current time t, e represents the natural base, and α1 and α2 represent the adjustment coefficients.
[0017] Preferably, the method of using a time window to perform differential compression on the player's operation data and then storing it in a short term includes:
[0018] Step A1: Calculate the time window length based on the network status coefficient at the current time t: , collect the player's operation data within the time window, and form a temporary data packet at the current time t after differential compression;
[0019] Step A2: Collect the network status coefficient at time t+BL, calculate the time window length, set the time window length at time t+BL to the TTL expiration cleanup time, and then make Memcached delete the temporary data packet at the current time t according to the expiration cleanup time;
[0020] Step A3: Repeat step A2 to store the player's operation data in a short term during the entire game process;
[0021] in, represents the standard window length, and β represents the extension factor.
[0022] Preferably, the differential compression method includes:
[0023] Operation data includes players’ operation behaviors and game videos;
[0024] Discretize the game video in the time window into continuous image frames in chronological order, and divide the image frames into key frames and differential frames;
[0025] The key frame setting method is as follows: use T_u segmentation points to evenly divide the time window into T_u+1 time periods, extract the start and end points of the time window and the image frames at the segmentation points, and set them as key frames. The image frames other than the key frames are set as non-key frames.
[0026] According to the size of the image frame, a blank matrix of the same size is simulated, and the pixel value of each position in the image frame is filled into the corresponding position of the blank matrix, thereby converting each image frame into a two-dimensional pixel matrix;
[0027] Calculate the difference matrix of the two-dimensional pixel matrix between each non-key frame and the key frame, and calculate the difference matrix between two adjacent difference matrices in ascending time order. Then, in the time period corresponding to the two key frames, simulate the first difference matrix and all the difference matrices into an image frame, and record the image frame at this time as the difference frame;
[0028] One-hot encoding is performed on the operation behavior corresponding to each image frame, so that each image frame obtains a one-hot vector. The key frame and differential frame are mapped and marked according to the timestamp of the one-hot vector.
[0029] Key frames and differential frames are compressed using entropy coding.
[0030] Preferably, the method of constructing and training the operation preview model includes:
[0031] The operation preview model is based on a long short-term memory network and includes an input layer, an LSTM layer, a fully connected layer, and an output layer. The input layer is set to input temporary data packets and network state coefficients, and the output layer includes a time prediction header and a preview operation header. The time prediction header is used to output the predicted time to preview operation data, and the preview operation header is used to output the preview operation data.
[0032] Set the constraints of the operation preview model as
[0033] ;
[0034] Among them, RE_b is the cutoff threshold, g is the sample index, G is the number of samples, and is the weight coefficient, T_t g is the actual time in the g-th sample, is the predicted time in the g-th sample, Y_t g is the actual operation data in the g-th sample, is the operation data previewed in the g-th sample;
[0035] Build a sample set, which includes S_D group samples. Each sample includes historical temporary data packets and network status coefficients, as well as the actual corresponding time and operation data in the next time period;
[0036] Use the sample set to train the operation preview model until the constraints are met, and then obtain the trained operation preview model;
[0037] The network status coefficient and temporary data packet at the current time t are input into the trained operation preview model to obtain the predicted time and operation data, which are then recorded as the player's preview operation in the future time T1.
[0038] Preferably, the method of linking the preview operation with the operation data at the time includes:
[0039] Extract the game video of the operation data at time t+BL and the game video of the preview operation, which are recorded as the first image and the second image respectively;
[0040] Calculate the absolute difference between each pixel value on the first image and the second image. If the absolute difference is greater than a judgment threshold, determine that the game video of the operation data and the game video of the preview operation are discontinuous and perform concatenation processing. If the absolute difference is less than or equal to the judgment threshold, determine that the game video of the operation data and the game video of the preview operation are continuous and use them directly.
[0041] The connection processing method is: add interval images, and on each interval image, the pixel values whose absolute difference is less than or equal to the judgment threshold remain unchanged, and the pixel values whose absolute difference is greater than the judgment threshold are filled with the interval value. The interval value is calculated by the formula ,in, represents the interval value on the rth interval image, xs(min) represents the minimum pixel value in the first image and the second image, Pd_yz represents the judgment threshold, and r represents the number of interval images.
[0042] Preferably, the method of using interpolation technology to smoothly correct the preview operation according to the real-time operation data includes:
[0043] Extract the timestamp of the real-time operation data and the local timestamp of the client at the end of the preview operation, record them as the first time stamp and the second time stamp respectively, and calculate the offset between the second time stamp and the first time stamp based on the first time stamp. If the offset is greater than 0 or less than 0, perform time synchronization correction; otherwise, do not correct the time.
[0044] The images corresponding to the first time stamp and the second time stamp are collected and recorded as image TS and image SM. If time synchronization correction is performed, image TS and image SM are smoothly interpolated. If time correction is not performed, the timestamp corresponding to the image with the smallest difference from image TS in the preview operation is extracted, and the image after the timestamp is deleted, so that the image with the smallest difference is directly connected to image TS.
[0045] Preferably, the time synchronization correction method includes:
[0046] If the offset is greater than 0, add Mn timestamps between the first and second timestamps, and ,in, represents the time of preview operation, F_d represents the number of image frames in the preview operation;
[0047] If the offset is less than 0, then delete Df timestamps between the first and second timestamps, collect the local timestamp of the client when the preview operation starts, record it as the third timestamp, and evenly arrange all remaining timestamps in the preview operation between the third timestamp and the first timestamp in chronological order;
[0048] And Df=Sc SM -CY min , among which Sc SM Indicates the second time scale, CY min Indicates the timestamp corresponding to the time when the difference between the image and the image TS is the smallest during the preview operation.
[0049] Preferably, the method for smoothly interpolating the image TS and the image SM includes:
[0050] Set the added Mn timestamps to correspond to one image each;
[0051] Extract each image in the preview operation and arrange them in chronological order. For each image, separate the pixel value of each pixel point and arrange the pixel value of each pixel point in chronological order to form a pixel data set.
[0052] For each pixel data set, a curve is fitted, and the independent variable of the curve is set to the timestamp and the dependent variable is set to the pixel value;
[0053] Substitute Mn timestamps into the curve corresponding to each pixel data set in turn to obtain the pixel value corresponding to each timestamp;
[0054] Collect all pixel values on the curve at each timestamp, construct Mn initial images, and fill the pixel values at the same timestamp into the blank image to form the image at the timestamp;
[0055] The images at Mn timestamps are respectively filled between the image TS and the image SM for smooth interpolation.
[0056] A mini-game delay control and management system, comprising:
[0057] Network judgment module: obtains the network status coefficient at the current time t and performs delay judgment;
[0058] Data collection and processing module: collects player operation data, performs differential compression using a time window, and forms a temporary data packet after short-term storage;
[0059] Model prediction module: Build and train an operation preview model. Under a delayed state, the network state coefficient and temporary data packet at the current time t are input into the trained operation preview model to predict the player's preview operation in the future.
[0060] Delay control management module: connects the preview operation with the operation data at time t+BL, collects the real-time operation data after delay recovery, uses interpolation technology to smoothly correct the preview operation based on the real-time operation data, and deploys it on the client.
[0061] Compared with the prior art, the present invention has the following beneficial effects:
[0062] Based on real-time fluctuations in network status coefficients, the time window length is dynamically adjusted, enabling the system to flexibly adapt to varying network environments and ensuring efficient data collection and processing. This avoids over-reliance on real-time data when network latency is high, and instead makes predictions within a longer time window, improving the intelligence of data processing.
[0063] Differential compression technology significantly reduces the storage and transmission burden of redundant data by storing only the differences between adjacent frames, rather than the complete data of each frame. This reduces the latency associated with transmitting large amounts of data when networks are unstable. This allows for the rapid transmission of critical operational data, especially in high-latency environments.
[0064] The LSTM-based operation preview model can predict the player's operation behavior under delayed conditions, allowing the client to run smoothly during network delays and avoid operation freezes caused by delays. The client can continue to render the game screen through preview data during network delays, greatly improving the smoothness of the user experience.
[0065] By comparing preview and actual operation frames at the pixel level, the continuity of the operation data is determined, and an interpolation algorithm is used to achieve a smooth transition, ensuring no noticeable jumps in the image. The use of pixel-level image difference calculation and interpolation technology ensures a smooth transition of image connections, reducing image freezes or sudden jumps after delayed recovery. Effective processing of the difference image ensures that the game screen remains smooth even when switching between network states, enhancing the user's visual experience.
[0066] A smooth correction mechanism eliminates inconsistencies between gameplay and the visuals after delay recovery. Time synchronization correction technology adjusts timestamps to ensure that preview data aligns with actual data, reducing discontinuities or frame skipping caused by time misalignment. Interpolation technology ensures a smooth transition between preview and actual gameplay after delay recovery, avoiding the disconnected feeling caused by out-of-sync operations. Synchronous timestamp correction and interpolation of interframe data further optimize the smooth transition after delay recovery, enhancing the consistency and fluidity of the gaming experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0067] Figure 1 This is a structural diagram of a mini-game delay control and management system proposed by the present invention;
[0068] Figure 2 Schematic diagram of the method applied to the mini-game delay control and management system in the present invention. DETAILED DESCRIPTION
[0069] Below, the exemplary embodiments according to the present application will be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments of the present application, and it should be understood that the present application is not limited to the exemplary embodiments described herein.
[0070] Example 1
[0071] Reference Figure 1 and Figure 2 , Example 1 further illustrates a mini-game delay control and management system proposed by the present invention.
[0072] Mini games are lightweight games that typically load and run quickly on mobile devices or web pages. They are designed to provide simple entertainment, allowing players to easily start playing without a complex installation process. Mini games are characterized by ease of access (most can be played directly in a browser or as a smaller app downloaded from an app store), small size (due to their relatively small file size, they download quickly and take up less storage space), and casual entertainment (primarily targeting users seeking short bursts of leisure and entertainment, suitable for playing during fragmented moments such as waiting or resting).
[0073] Mini games are incredibly diverse, encompassing nearly every genre, from puzzles to action-adventures, role-playing games to strategy battles. Furthermore, with technological advancements, the quality of mini games is constantly improving. With the rise of platforms like WeChat Mini Programs and Alipay Mini Programs, mini games have become a highly popular form of content on these platforms.
[0074] Therefore, given the lightweight and accessible nature of mini-games, poor network conditions can directly impact data transmission between players and the server, especially in multiplayer online modes, which often rely on low latency to ensure a smooth gaming experience. If the network connection is unstable, data packets may be lost, delayed, or misplaced during transmission, leading to in-game operational delays, screen freezes (due to poor network conditions, the game screen may suddenly freeze, or rapidly skip frames, severely affecting the gaming experience), and even requiring frequent disconnections and reconnections. This reduces the mini-game's playability and can even lead to a loss of traffic and players.
[0075] To address the delays in mini-games, we first predict the player's operations on the client and present an estimated result. The estimated result is then generated and compressed in advance. When a delay occurs, we use compressed estimated result interpolation or tween animation techniques to smoothly transition to the next state, avoiding sudden screen jumps or freezes. We also dynamically adjust the game frame rate based on network conditions and device performance. When the delay is resolved and the server returns the actual result, if there is a difference from the prediction, we correct the difference.
[0076] Network requests and game rendering logic can be separated, and the reception and processing of network data can be performed through separate threads or asynchronous operations, avoiding the impact of network waiting or delays on game frame rate and rendering.
[0077] Step S1: Obtain the network state coefficient at the current time t, perform delay judgment, and generate a delay state and a non-delay state;
[0078] The method of obtaining the network status coefficient at the current time t and performing delay judgment includes:
[0079] Collect the client network's Ping time, jitter frequency, packet loss rate, bandwidth, and transmission flow at the current time t, and calculate the network status coefficient
[0080] ;
[0081] Set the state threshold Yz. If WL(t)≤Yz, the network state is considered good and in a non-delayed state. If WL(t)>Yz, the network state is considered abnormal and in a delayed state.
[0082] The state threshold Yz can be set by analyzing historical data or experience. The delay state can be used to indicate that the network may experience a jam delay in the next period of time.
[0083] Among them, WL(t) represents the network status coefficient at the current time t, Ping t Indicates the ping time at the current time t, Dh t Indicates the jitter frequency at the current time t, Db t Indicates the packet loss rate at the current time t, Cs t Denotes the bandwidth at the current time t, Dk t represents the transmission flow at the current time t, e represents the natural base, and α1 and α2 represent the adjustment coefficients;
[0084] Ping time is the time required to send a data packet and receive a return data packet, that is, the round-trip time (RTT). It is collected using the system's built-in ping command. For example, the delay (in milliseconds) of each ping time is displayed on Linux or macOS.
[0085] Jitter frequency refers to the variation in delay between consecutive data packets and can be collected using the ping or iperf tool.
[0086] Packet loss rate refers to the percentage of packets lost during network transmission. A high packet loss rate usually indicates poor network quality and can be measured using ping or iperf.
[0087] Bandwidth refers to the amount of data a network can transmit per unit of time. While bandwidth and latency are not directly related, bandwidth bottlenecks can lead to high latency, especially under congestion. Bandwidth can be measured using the iperf tool.
[0088] Transmission traffic is used to describe the amount of transmitted data. Use tools such as netstat, iftop, or nload to monitor the traffic of the current network interface.
[0089] Step S2: Using the time window, perform differential compression on the player's operation data and store it for a short period of time to form a temporary data packet;
[0090] Methods for short-term storage of player operation data using time windows for differential compression include:
[0091] Step A1: Calculate the time window length based on the network status coefficient at the current time t: , collect the player's operation data within the time window, and form a temporary data packet at the current time t after differential compression;
[0092] Step A2: Collect the network status coefficient at time t+BL, calculate the time window length, set the time window length at time t+BL to the TTL expiration cleanup time, and then make Memcached delete the temporary data packet at the current time t according to the expiration cleanup time;
[0093] Step A3: Repeat step A2 to store the player's operation data in a short term during the entire game process.
[0094] Generally, a larger network status coefficient WL(t) indicates a worse network condition, and a smaller network status coefficient WL(t) indicates a better network condition. The worse the network condition, the more likely delays are and the longer the delays are. Therefore, a longer time window is required to collect sufficient data for rehearsal.
[0095] in, represents the standard window length, and β represents the extension coefficient; the standard window length can be set through historical data analysis or experience.
[0096] Inter-frame differential compression achieves compression by reducing redundant information by storing only the differences between adjacent frames rather than the complete data of each frame.
[0097] Differential compression methods include:
[0098] Operation data includes the player's operation behavior (such as the character's movement direction, attack mode, etc.) and game video (for example, the original rendering video of the game, and the video generated in association with the player's operation or the screen video generated during the player's game).
[0099] Discretize the game video in the time window into continuous image frames in chronological order, and divide the image frames into key frames and differential frames;
[0100] The key frame setting method is as follows: use T_u segmentation points to evenly divide the time window into T_u+1 time periods, extract the start and end points of the time window and the image frames at the segmentation points, and set them as key frames. The image frames other than the key frames are set as non-key frames.
[0101] The start point and end point of the time window have the following meanings. For example, if the time window is the time period from time point QI to time point Q2, then time point QI is the start point of the time window and time point Q2 is the end point of the time window.
[0102] According to the size of the image frame, a blank matrix of the same size is simulated, and the pixel value of each position in the image frame is filled into the corresponding position of the blank matrix, thereby converting each image frame into a two-dimensional pixel matrix;
[0103] For example, the image frame size is , then the size of the blank matrix is also , fill the pixel value of each position in the image frame into the matrix to form a two-dimensional pixel matrix. The pixel value of each position in the image frame is represented by the color value of the pixel point at each position.
[0104] Calculate the difference matrix of the two-dimensional pixel matrix between each non-key frame and the key frame, and calculate the difference matrix between two adjacent difference matrices in ascending time order. Then, in the time period corresponding to the two key frames, simulate the first difference matrix and all the difference matrices into an image frame, and record the image frame at this time as the difference frame;
[0105] The method of converting the first difference matrix and all difference matrices into an image frame is the same as the method of converting an image frame into a two-dimensional pixel matrix, except that the conversion process is reversed.
[0106] One-hot encoding is performed on the operation behavior corresponding to each image frame, so that each image frame obtains a one-hot vector. The key frame and differential frame are mapped and marked according to the timestamp of the one-hot vector.
[0107] Use entropy coding (such as Huffman coding, arithmetic coding) to compress key frames and differential frames.
[0108] The difference matrix often contains many zero or repeated values. Therefore, a lossless compression algorithm such as entropy coding can be used to encode the quantized difference data to achieve further compression. Inter-frame difference compression stores only the differences between adjacent frames, rather than the complete frame data, reducing duplicate information.
[0109] Step S3: Construct and train an operation preview model. Under the delay state, input the network state coefficient and temporary data packet at the current time t into the trained operation preview model to predict the player's preview operation at the future time T1;
[0110] Methods for building and training operational rehearsal models include:
[0111] The operation preview model is based on a long short-term memory network and includes an input layer, an LSTM layer, a fully connected layer, and an output layer. The input layer is set to input temporary data packets and network state coefficients, and the output layer includes a time prediction header and a preview operation header. The time prediction header is used to output the predicted time to preview operation data, and the preview operation header is used to output the preview operation data.
[0112] LSTM is a type of recurrent neural network (RNN) that is particularly well-suited for processing time series data. Multiple layers of LSTM can be stacked to increase the model's representational power. The LSTM output typically passes through one or more fully connected layers, which map the LSTM's hidden state to a target prediction (i.e., the player's next move).
[0113] Set the constraints of the operation preview model as
[0114] ;
[0115] Among them, RE_b is the cutoff threshold, g is the sample index, G is the number of samples, and is the weight coefficient, T_t g is the actual time in the g-th sample, is the predicted time in the g-th sample, Y_t g is the actual operation data in the g-th sample, is the operation data previewed in the g-th sample;
[0116] The cutoff threshold can be set based on experimental data analysis or historical data analysis.
[0117] Among them, the weight coefficient and The values of α, α, and α2, such as the extension factor β, need to be determined on a case-by-case basis and may require periodic review and adjustment to adapt to changing circumstances and needs. In the absence of specific guidance, these values may be determined collaboratively between security experts and business leaders within the organization, or through analysis of historical or experimental data.
[0118] The extension coefficient β specifically refers to the unit adjustment length of the time window. If the network status provided by the current network infrastructure is good, then the value of the extension coefficient β can be assigned a smaller value. For example, when the relevant staff believes that the network status is good based on the network status supported by the current device, they should assign it a smaller value, which can be 0.1, 0.5 or 1. The specific value assignment can be set in combination with historical data. Generally speaking, the value range for better situations is 0 to 1, and the value for worse situations is greater than 1.
[0119] Meaning of adjustment coefficients α1 and α2 and weight coefficients and Similarly, it also means a percentage. Specifically, it is used to indicate the percentage of jitter frequency and packet loss rate in the network status coefficient, and the value range is between 0 and 1.
[0120] Build a sample set, which includes S_D group samples. Each sample includes historical temporary data packets and network status coefficients, as well as the actual corresponding time and operation data in the next time period;
[0121] The S_D group samples in the sample set are all based on real data in historical time. The actual time and operation data corresponding to the next time period refer to the historical temporary data packets and network status coefficients in the actual corresponding lag delay time and lag delay time of the next time period. The preview generates the player's operation data.
[0122] Use the sample set to train the operation preview model until the constraints are met, and then obtain the trained operation preview model;
[0123] The network status coefficient and temporary data packet at the current time t are input into the trained operation preview model to obtain the predicted time and operation data, which are then recorded as the player's preview operation in the future time T1.
[0124] Step S4: Connecting the preview operation with the operation data at time t+BL so that the game continues on the client;
[0125] Methods for linking preview operations with operational data at the time include:
[0126] Extract the game video of the operation data at time t+BL and the game video of the preview operation, which are recorded as the first image and the second image respectively;
[0127] Among them, the game video at a time point is regarded as an image frame, so the next step is to compare the two image frames.
[0128] Calculate the absolute difference between the first and second image values for each pixel, i.e., the absolute difference ,in, Represents the absolute difference between the o-th pixel value xs_o and the p-th pixel value xs_p. If the absolute difference is greater than the judgment threshold, the game video of the operation data and the game video of the preview operation are determined to be discontinuous and are connected. If the absolute difference is less than or equal to the judgment threshold, the game video of the operation data and the game video of the preview operation are determined to be continuous and are used directly.
[0129] The connection processing method is: add interval images, and on each interval image, the pixel values whose absolute difference is less than or equal to the judgment threshold remain unchanged, and the pixel values whose absolute difference is greater than the judgment threshold are filled with the interval value. The interval value is calculated by the formula ,in, represents the interval value on the rth interval image, xs(min) represents the minimum pixel value in the first image and the second image, Pd_yz represents the judgment threshold, and r represents the number of interval images.
[0130] The judgment threshold can be set based on experimental data analysis or historical data analysis.
[0131] When network latency is restored, the actual game state returned by the server may differ from the client's prediction. To ensure game state consistency, the client compares the server-returned state with the locally estimated state, detecting any discrepancies. The client then applies smooth corrections to avoid sudden screen jumps or freezes.
[0132] Step S5: collecting real-time operation data after delayed recovery, using interpolation technology to smoothly correct the preview operation based on the real-time operation data, and arranging it on the client;
[0133] Methods for using interpolation technology to smoothly correct preview operations based on real-time operation data include:
[0134] Extract the timestamp of the real-time operation data and the local timestamp of the client at the end of the preview operation, record them as the first time stamp and the second time stamp respectively, and calculate the offset between the second time stamp and the first time stamp based on the first time stamp. If the offset is greater than 0 or less than 0, perform time synchronization correction; otherwise, do not correct the time.
[0135] The images corresponding to the first time stamp and the second time stamp are collected and recorded as image TS and image SM. If time synchronization correction is performed, image TS and image SM are smoothly interpolated. If time correction is not performed, the timestamp corresponding to the image with the smallest difference from image TS in the preview operation is extracted, and the image after the timestamp is deleted, so that the image with the smallest difference is directly connected to image TS.
[0136] For example, there are 10 images in the preview operation, which are arranged in chronological order. The difference between the fifth image and the image TS is the smallest. Then the images after the fifth image are directly deleted, and the image TS is arranged as the sixth image directly after the fifth image, so that the preview operation is smoothly connected with the game video in the real-time operation data.
[0137] Among them, the smallest difference is judged as the smallest change or the smallest offset of the pixel value in the image, and the offset refers to the difference between two data.
[0138] Time synchronization correction methods include:
[0139] If the offset is greater than 0, add Mn timestamps between the first and second timestamps, and ,in, represents the time of preview operation, F_d represents the number of image frames in the preview operation;
[0140] If the offset is less than 0, then delete Df timestamps between the first and second timestamps, collect the local timestamp of the client when the preview operation starts, record it as the third timestamp, and evenly arrange all remaining timestamps in the preview operation between the third timestamp and the first timestamp in chronological order;
[0141] And Df=Sc SM -CY min , among which Sc SM Indicates the second time scale, CY min Indicates the timestamp corresponding to the time when the difference between the image and the image TS is the smallest during the preview operation.
[0142] For example, if the offset is less than 0, and Df=3, and there are 5 remaining time stamps in the preview operation, excluding the third time stamp, then the 5 time stamps are evenly arranged between the third time stamp and the first time stamp in chronological order.
[0143] The method for smoothly interpolating the image TS and the image SM includes:
[0144] Set the added Mn timestamps to correspond to one image each;
[0145] Extract each image in the preview operation and arrange them in chronological order. For each image, separate the pixel value of each pixel point and arrange the pixel value of each pixel point in chronological order to form a pixel data set.
[0146] For each pixel data set, a curve is fitted, and the independent variable of the curve is set to the timestamp and the dependent variable is set to the pixel value;
[0147] The specific method of using the curve to fit each pixel data set is, for example, the curve fitted for the third pixel data set is y=a+bx, and the pixel values at Mn timestamps are calculated according to the curve formula.
[0148] Substitute Mn timestamps into the curve corresponding to each pixel data set in turn to obtain the pixel value corresponding to each timestamp;
[0149] Collect all pixel values on the curve at each timestamp, construct Mn initial images, and fill the pixel values at the same timestamp into the blank image to form the image at the timestamp;
[0150] The initial image is a blank image by default and has the same size as each image in the preview operation. During the pixel value filling process, the pixel value must correspond to the pixel point.
[0151] The images at Mn timestamps are respectively filled between the image TS and the image SM for smooth interpolation.
[0152] When high network latency is detected, the client can also reduce the game's rendering frame rate to reduce pressure on network bandwidth and computing resources. For example, it can reduce the game from 60fps to 30fps.
[0153] The game of the present invention uses the UDP protocol for data transmission, and through the QoS technology (Quality of Service), the network data flow can be prioritized to ensure that the real-time data packets of the game can be transmitted first, reducing the impact of delay and packet loss.
[0154] In future optimizations, client-side action predictions can be enhanced using machine learning technology. By training models to learn players' operating habits and behavioral patterns, the client can more accurately predict players' actions in different scenarios, improving the accuracy of prediction results.
[0155] Example 2
[0156] Reference Figure 1 and Figure 2 , Example 2 further illustrates a mini-game delay control and management system proposed by the present invention.
[0157] The mini-game delay control and management method comprises the following steps:
[0158] Step S1: Obtain the network state coefficient at the current time t, perform delay judgment, and generate a delay state and a non-delay state;
[0159] Step S2: Using the time window, perform differential compression on the player's operation data and store it for a short period of time to form a temporary data packet;
[0160] Step S3: Construct and train an operation preview model. Under the delay state, input the network state coefficient and temporary data packet at the current time t into the trained operation preview model to predict the player's preview operation at the future time T1;
[0161] Step S4: Connecting the preview operation with the operation data at time t+BL so that the game continues on the client;
[0162] Step S5: collecting the real-time operation data after the delay recovery, using the interpolation technology to smoothly correct the preview operation according to the real-time operation data, and arranging it on the client.
[0163] The mini-game delay control and management system, applied to a mini-game delay control and management method, includes:
[0164] Network judgment module: obtains the network status coefficient at the current time t and performs delay judgment;
[0165] Data collection and processing module: collects player operation data, performs differential compression using a time window, and forms a temporary data packet after short-term storage;
[0166] Model prediction module: Build and train an operation preview model. Under a delayed state, the network state coefficient and temporary data packet at the current time t are input into the trained operation preview model to predict the player's preview operation in the future.
[0167] Delay control management module: This module connects the preview operation with the operation data at time t+BL, collects the real-time operation data after delay recovery, uses interpolation technology to smoothly correct the preview operation based on the real-time operation data, and deploys it on the client.
[0168] The modules are connected to each other via wired and / or wireless means.
[0169] In addition, according to the embodiments of the present application, the process described in the accompanying drawings of a mini-game delay control and management system can be implemented as a computer software program. For example, the present application provides a non-transitory machine-readable storage medium that stores machine-readable instructions, which can be executed by a processor to execute instructions corresponding to the method steps provided in the present application. Of course, the architecture shown in the accompanying drawings of a mini-game delay control and management system is only exemplary, and when implementing different devices, adaptive selection or adjustment can be made according to actual needs.
[0170] The above formulas are all dimensionless and numerical calculations. The formulas are obtained by collecting a large amount of data and performing software simulation to obtain the most recent real situation. The preset parameters and thresholds in the formulas are set by technicians in this field according to actual conditions.
[0171] The above description is merely a preferred embodiment of the present invention. The scope of protection of the present invention is not limited to the above embodiment. All technical solutions based on the principles of the present invention are within the scope of protection of the present invention. It should be noted that for users of ordinary skill in the art, various improvements and modifications that do not depart from the principles of the present invention should also be considered within the scope of protection of the present invention.
Claims
1. A method for delay control and management of mini-games, characterized in that: The mini-game delay control management method includes: Step S1: Obtain the network state coefficient at the current time t, perform delay judgment, and generate a delay state and a non-delay state; Step S2: Use the time window to perform differential compression on the player's operation data and store it for a short period of time to form a temporary data packet; Step S3: construct and train an operation preview model. Under the delay state, input the network state coefficient and temporary data packet at the current time t into the trained operation preview model to predict the player's preview operation at the future time T1; Step S4: Combine preview operation with time The operation data at the client is connected so that the game can be continued on the client; The preview operation and time Methods for connecting the operation data at the same time include: Extraction time The game video of the operation data and the game video of the preview operation are recorded as the first image and the second image respectively; Calculate the absolute difference of each pixel value on the first image and the second image. If the absolute difference is greater than a judgment threshold, it is determined that the game video of the operation data and the game video of the preview operation are discontinuous and a connection process is performed. If the absolute difference is less than or equal to the judgment threshold, it is determined that the game video of the operation data and the game video of the preview operation are continuous and are used directly. The connection processing method is: add interval images, and on each interval image, the pixel values whose absolute difference is less than or equal to the judgment threshold remain unchanged, and the pixel values whose absolute difference is greater than the judgment threshold are filled with the interval value. The interval value is calculated by the formula ,in, Indicates The interval value on the interval image, represents the minimum pixel value in the first image and the second image, represents the judgment threshold, Indicates the number of interval images; Step S5: collecting the real-time operation data after delayed recovery, using interpolation technology to smoothly correct the preview operation according to the real-time operation data, and arranging it on the client; The method for smoothly correcting the preview operation using the interpolation technology according to the real-time operation data comprises: The timestamp of the real-time operation data and the local timestamp of the client at the end of the preview operation are extracted and recorded as the first time stamp and the second time stamp respectively. The offset between the second time stamp and the benchmark is calculated based on the first time stamp. If the offset is greater than 0 or less than 0, time synchronization correction is performed, otherwise, the time is not corrected; The images corresponding to the first time stamp and the second time stamp are collected and recorded as image TS and image SM. If the time is corrected synchronously, the image TS and the image SM are smoothly interpolated. If the time is not corrected, the timestamp corresponding to the image when the difference with the image TS is the smallest in the preview operation is extracted, and the image after the timestamp is deleted, so that the image when the difference is the smallest is directly connected with the image TS.
2. The mini-game delay control management method according to claim 1, characterized in that: The method for obtaining the network status coefficient at the current time t and performing delay judgment includes: Collect the client network's Ping time, jitter frequency, packet loss rate, bandwidth, and transmission flow at the current time t, and calculate the network status coefficient ; Setting Status Thresholds ,like , then the network status is good and in a non-delayed state; if , then the network status is determined to be abnormal and in a delayed state; in, represents the network status coefficient at the current time t, Indicates the Ping time at the current time t, Indicates the jitter frequency at the current time t, represents the packet loss rate at the current time t, represents the bandwidth at the current time t, represents the transmission flow at the current time t, represents the natural base, and Represents the adjustment factor.
3. The mini-game delay control management method according to claim 2 is characterized in that: The method of using a time window to perform differential compression on the player's operation data for short-term storage comprises: Step A1: According to the network status coefficient at the current time t, calculate the time window length as , collect the player's operation data within the time window, and form a temporary data packet at the current time t after differential compression; Step A2: Collection time The network status coefficient at the location and calculate the time window length, set the time The time window length at is the expiration cleanup time of TTL, so that Memcached deletes the temporary data packet at the current time t according to the expiration cleanup time; Step A3: Repeat step A2 to store the player's operation data for a short period of time during the entire game process; in, represents the standard window length, Indicates the elongation factor.
4. The mini-game delay control management method according to claim 3 is characterized in that: The differential compression method comprises: Operation data includes players’ operation behaviors and game videos; Discretize the game video in the time window into continuous image frames in time order, and divide the image frames into key frames and differential frames; The key frame setting method is as follows: use T_u segmentation points to evenly divide the time window into T_u+1 time periods, extract the start and end points of the time window and the image frames on the segmentation points, and set them as key frames, and then set the image frames other than the key frames as non-key frames; According to the size of the image frame, a blank matrix of the same size is simulated, and the pixel value of each position in the image frame is filled into the corresponding position of the blank matrix, thereby converting each image frame into a two-dimensional pixel matrix; Calculate the difference matrix of the two-dimensional pixel matrix between each non-key frame and the key frame, and calculate the difference matrix between two adjacent difference matrices in ascending time order. Then, in the time period corresponding to the two key frames, simulate the first difference matrix and all the difference matrices into an image frame, and record the image frame at this time as a difference frame; One-Hot encoding is performed on the operation behavior corresponding to each image frame, so that each image frame obtains a One-Hot vector, and the timestamp of the One-Hot vector is corresponded to the key frame and the differential frame and marked; Key frames and differential frames are compressed using entropy coding.
5. The mini-game delay control management method according to claim 4 is characterized in that: The method for constructing and training an operation preview model includes: The operation preview model is based on a long short-term memory network, including an input layer, an LSTM layer, a fully connected layer and an output layer. The input of the input layer is set to be a temporary data packet and a network state coefficient, and the output layer includes a time prediction header and a preview operation header. The time prediction header is used to output the predicted time of the preview operation data, and the preview operation header is used to output the preview operation data. Set the constraints of the operation preview model as ; in, is the cutoff threshold, is the sample index, is the sample size, and is the weight coefficient, For the The actual time in the sample, For the The predicted time in samples, For the The actual operation data in the samples, For the Operational data previewed in samples; A sample set is formed, the sample set includes S_D group samples, each sample includes a historical temporary data packet and network status coefficient, and the actual corresponding time and operation data in the next time period; Use the sample set to train the operation preview model until the constraint conditions are met, and then obtain the trained operation preview model; The network status coefficient and temporary data packet at the current time t are input into the trained operation preview model to obtain the predicted time and operation data, which are then recorded as the player's preview operation at the future time T1.
6. The mini-game delay control management method according to claim 5, characterized in that: The time synchronization correction method comprises: If the offset is greater than 0, add Mn timestamps between the first timestamp and the second timestamp, and ,in, Indicates the time of the preview operation. Indicates the number of image frames in the preview operation; If the offset is less than 0, then delete Df timestamps between the first time stamp and the second time stamp, collect the local timestamp of the client when the preview operation starts, record it as the third time stamp, and evenly arrange all remaining timestamps in the preview operation between the third time stamp and the first time stamp in chronological order; and ,in, Indicates the second time scale, Indicates the timestamp corresponding to the time when the difference between the image and the image TS in the preview operation is the smallest.
7. The mini-game delay control management method according to claim 6, characterized in that: The method for smoothly interpolating the image TS and the image SM comprises: Set each of the added Mn timestamps to correspond to an image; Extract each image in the preview operation and arrange them in chronological order. For each image, separate the pixel value on each pixel point and arrange the pixel value on each pixel point in chronological order to form a pixel data set. For each pixel data set, a curve is used for fitting, and the independent variable of the curve is set to the timestamp, and the dependent variable is set to the pixel value; Submit Mn timestamps to the curve corresponding to each pixel data set in turn to obtain the pixel value corresponding to each timestamp; Collect all pixel values on the curve at each timestamp, construct Mn initial images, and fill the pixel values at the same timestamp into the blank image to form the image at the timestamp; The images at Mn timestamps are respectively filled between the image TS and the image SM for smooth interpolation.
8. A mini-game delay control and management system, applied to a mini-game delay control and management method according to any one of claims 1 to 7, characterized in that: The mini-game delay control and management system includes: Network judgment module: obtains the network status coefficient at the current time t and makes delay judgment; Data collection and processing module: collects players' operation data, and uses time windows for differential compression, forming temporary data packets after short-term storage; Model prediction module: Build and train the operation preview model. Under the delay state, input the network state coefficient and temporary data packet at the current time t into the trained operation preview model to predict the player's preview operation in the future. Delay control management module: combine preview operation with time The operation data at the destination is connected, the real-time operation data after delayed recovery is collected, and the preview operation is smoothly corrected using interpolation technology based on the real-time operation data, and then arranged on the client.
Citation Information
Patent Citations
Cloud game video transmission method based on tail delay detection and frame generation
CN118175393A