Frame synchronization method, apparatus, device, storage medium and program product
Patent Information
- Application Number
- CN202310022150.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-06
- Publication Date
- 2026-10-16
- Estimated Expiration
- 2043-01-06
AI Technical Summary
[0004]然而,服务器与客户端之间同时连接WiFi网络和蜂窝网络会消耗双倍的网络流量,而且对客户端设备也会产生双倍的耗损
[0016] According to another aspect of this application, a computer program product is provided, comprising a computer program stored in a computer-readable storage medium; the computer program is read from and executed by a processor of a computer device from the computer-readable storage medium, causing the computer device to perform the frame synchronization method as described above.
Smart Images

Figure CN118317417B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a frame synchronization method, apparatus, device, storage medium, and program product. Background Technology
[0002] Lockstep is a technique that uses frames sent from the server to the client to synchronize the operation signals of each client to all clients.
[0003] In related technologies, to avoid network latency and packet loss, the server and client transmit data packets simultaneously through their respective network protocol channels in the WiFi network channel and cellular network channel. That is, they send and receive two data packets at the same time, so even if a network delay occurs in a single network, it will not affect the transmission of data packets.
[0004] However, simultaneously connecting the server and client to both Wi-Fi and cellular networks consumes twice the network bandwidth and puts twice the strain on the client devices. Therefore, how to avoid network latency and packet loss while reducing network bandwidth consumption is a pressing issue that needs to be addressed. Summary of the Invention
[0005] This application provides a frame synchronization method, apparatus, device, storage medium, and program product, the technical solution of which is as follows:
[0006] According to one aspect of this application, a frame synchronization method is provided, the method comprising:
[0007] Based on the network connection method between the server and each of the at least two clients, determine the primary network protocol channel and the backup network protocol channel corresponding to each client;
[0008] Receive frame synchronization data sent by at least one of the at least two clients;
[0009] The frame synchronization data is synchronized to each client based on the primary network protocol channel and the backup network protocol channel corresponding to each client.
[0010] According to one aspect of this application, a frame synchronization device is provided, the device comprising:
[0011] The determining module is used to determine the primary network protocol channel and the backup network protocol channel corresponding to each client based on the network connection method between the server and each of the at least two clients; the primary network protocol channel is used to transmit the frame synchronization data, and the backup network protocol channel is used to transmit the frame synchronization data when the primary network protocol channel does not meet the transmission conditions;
[0012] A receiving module is configured to receive frame synchronization data sent by at least one of the at least two clients;
[0013] The synchronization module is used to synchronize the frame synchronization data to each client based on the primary network protocol channel and the backup network protocol channel corresponding to each client.
[0014] According to another aspect of this application, a computer device is provided, comprising: a processor and a memory, wherein the memory stores at least one computer program, the at least one computer program being loaded and executed by the processor to implement the frame synchronization method as described above.
[0015] According to another aspect of this application, a computer storage medium is provided, wherein at least one computer program is stored in the computer-readable storage medium, and the at least one computer program is loaded and executed by a processor to implement the frame synchronization method as described above.
[0016] According to another aspect of this application, a computer program product is provided, comprising a computer program stored in a computer-readable storage medium; the computer program is read from and executed by a processor of a computer device from the computer-readable storage medium, causing the computer device to perform the frame synchronization method as described above.
[0017] The beneficial effects of the technical solution provided in this application include at least the following:
[0018] Based on the network connection method between the server and each client, a primary network protocol channel and a backup network protocol channel corresponding to each client are determined. Frame synchronization data is received from at least one of at least two clients. Based on the primary and backup network protocol channels corresponding to each client, frame synchronization data is synchronized to each client. This application determines the primary and backup network protocol channels required for frame synchronization based on the client's network connection method. When the primary network protocol channel meets the transmission conditions, frame synchronization data is transmitted only through the primary network protocol channel; when the primary network protocol channel does not meet the transmission conditions, frame synchronization data is transmitted through the backup network protocol channel. This avoids network latency and packet loss, as well as the network traffic consumption problem caused by simultaneously accessing WiFi and cellular network channels. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 This is a schematic diagram of a frame synchronization process provided in an exemplary embodiment of this application;
[0021] Figure 2 This is a schematic diagram of a frame synchronization method provided in an exemplary embodiment of this application;
[0022] Figure 3 This is a schematic diagram of the architecture of a computer system provided in an exemplary embodiment of this application;
[0023] Figure 4 This is a flowchart of a frame synchronization method provided in an exemplary embodiment of this application;
[0024] Figure 5 This is a flowchart of a frame synchronization method provided in an exemplary embodiment of this application;
[0025] Figure 6 This is a schematic diagram of a network protocol channel in a WiFi network channel provided in an exemplary embodiment of this application;
[0026] Figure 7 This is a schematic diagram of a network protocol channel in a cellular network channel provided in an exemplary embodiment of this application;
[0027] Figure 8 This is a schematic diagram of a network protocol channel in a WiFi network channel and a cellular network channel provided in an exemplary embodiment of this application;
[0028] Figure 9 This is a schematic diagram of a client-server connection provided in an exemplary embodiment of this application;
[0029] Figure 10 This is a schematic diagram of a network protocol channel in a single network channel provided in an exemplary embodiment of this application;
[0030] Figure 11 This is a schematic diagram of a network protocol channel in a dual network channel provided in an exemplary embodiment of this application;
[0031] Figure 12 This is a schematic diagram illustrating the occurrence rate of network latency in different scenarios provided by an exemplary embodiment of this application;
[0032] Figure 13This is a schematic diagram of the on / off state of a network protocol channel provided in an exemplary embodiment of this application;
[0033] Figure 14 This is a schematic diagram of the transmission state of a network protocol channel provided in an exemplary embodiment of this application;
[0034] Figure 15 This is a schematic diagram of an encapsulated network protocol channel provided in an exemplary embodiment of this application;
[0035] Figure 16 This is a block diagram of a frame synchronization apparatus provided in an exemplary embodiment of this application;
[0036] Figure 17 This is a schematic diagram of the structure of a computer device provided in an exemplary embodiment of this application. Detailed Implementation
[0037] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be further described in detail below with reference to the accompanying drawings. Exemplary embodiments will be described in detail here, examples of which are illustrated in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0038] The terminology used in this disclosure is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The singular forms “a,” “the,” and “the” as used in this disclosure and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any and all possible combinations of one or more of the associated listed items.
[0039] It should be understood that although the terms first, second, third, etc., may be used in this disclosure to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another.
[0040] First, a brief introduction to the relevant technologies involved in the embodiments of this application will be given:
[0041] In online games, such as fighting games (FTG), action games (ACT), multiplayer online battle arena (MOBA), real-time strategy games (RTS), massively multiplayer online games (MMOG), shooting games (STG), first-person shooter (FPS), third-person shooter (TPS), and arcade games, synchronization technology is usually required to ensure that multiple clients display consistent visual effects, thus providing players with a better gaming experience.
[0042] Lockstep synchronization is a common synchronization technique in online games. Its principle is that the server acquires all player actions sent to the server by clients within a unit of time on the battlefield (or in-game match, or field of view) and broadcasts them. In other words, lockstep synchronization achieves synchronization of player actions across all clients by having the server broadcast the acquired player commands to all clients at regular intervals, thus synchronizing the game state across all clients. Player actions can be understood as player commands, player instructions, or game actions.
[0043] Specifically, the frame synchronization process is as follows: Figure 1As shown, a timer is set to trigger a clock interrupt (i.e., a "tick") every 100ms, with each unit of time being 100ms. The time between two adjacent clock interrupts is called a time slice (or tick period). For ease of explanation, the data (or messages) sent from the client to the server are referred to as uplink data (or messages), and the data (or messages) sent from the server to the client are referred to as downlink data (or messages). During the time slice between the Nth clock interrupt and the N+1th clock interrupt, client 1 and client 2 respectively send the uplink Nth frame message (or Nth frame data, or Nth frame player operation command) to the server (which can also be understood as the host), as shown in steps 101 and 102. At the N+1th clock interrupt, the server broadcasts the received uplink Nth frame message to client 1 and client 2 via downlink data packets, as shown in steps 103 and 104. During the time interval between the (N+1)th and (N+2)th clock interrupts, client 1 and client 2 respectively perform logical processing on the Nth frame message in the received downlink data packets to display the corresponding visual effects, as shown in steps 105 and 106. During the time interval between the (N+1)th and (N+2)th clock interrupts, client 1 also sends the (N+1)th uplink frame message to the server, as shown in step 107. Then, during the (N+2)th clock interrupt, the server broadcasts the received (N+1)th uplink frame message to client 1 and client 2 via downlink data packets, as shown in steps 108 and 109.
[0044] In games employing frame synchronization technology (hereinafter referred to as "frame-synchronized games"), to distinguish frame data (or frame messages) from different time slices, the server adds a logical sequence number to the player actions within the battlefield (or match, or field of vision) per unit time, and broadcasts (or synchronizes) this logical sequence number along with the player actions to all clients within the battlefield (or match, or field of vision). This logical sequence number used to distinguish frame data from different time slices is also called the frame sequence number or frame index.
[0045] This can also be understood as the server logically dividing the set of player actions within a unit of time into logical frames (or game frames), or simply "frames". For example, for a game that transmits 15 frames per second (15FPS), the server caches (or collects) the player actions within the battlefield (or match, or field of vision) every 66ms and divides them into logical frames, assigning each logical frame a frame sequence number, or frame index. When the server and client perform frame synchronization, they both use logical frames as the smallest unit.
[0046] This application provides a schematic diagram of a frame synchronization method, as shown in the embodiments below. Figure 2As shown, this method should be executed by a server in the game application, with at least two clients connected to the server.
[0047] For example, server 40 receives frame synchronization data sent by at least one of at least two clients; server 40 determines the primary network protocol channel and the backup network protocol channel corresponding to each client based on the network connection method between server 40 and each of the at least two clients; server 40 synchronizes frame synchronization data to each client based on the primary network protocol channel and the backup network protocol channel corresponding to each client.
[0048] The main network protocol channel is used to transmit frame synchronization data.
[0049] The backup network protocol channel is used to transmit frame synchronization data when the primary network protocol channel does not meet the transmission conditions.
[0050] Optionally, the backup network protocol channel can be used to compensate for packet loss when the main network protocol channel meets the transmission conditions, thereby reducing the packet loss compensation delay caused by packet loss.
[0051] Optionally, the primary network protocol channel is a User Datagram Protocol (UDP) channel.
[0052] Optionally, the backup network protocol channel is either a UDP channel or a Transmission Control Protocol (TCP) channel, but is not limited thereto, and the embodiments of this application do not specifically limit this.
[0053] Frame synchronization data refers to the data that is synchronized in each client.
[0054] Optionally, the frame synchronization data may include player operation instructions, player commands, or game actions in the game application, but is not limited thereto, and the embodiments of this application do not impose specific limitations.
[0055] The network connection method refers to the connection relationship between the client and the server 40. For example, the client and the server 40 are connected via a WiFi network, or the client and the server 40 are connected via a cellular network.
[0056] Optionally, the timing of constructing the primary network protocol channel includes at least one of the following: at the start of a game, when connecting to a virtual battle, and before frame synchronization, but is not limited thereto. This application embodiment does not specifically limit this. The timing of constructing the backup network protocol channel includes at least one of the following: at the start of a game, when connecting to a virtual battle, and before frame synchronization, but is not limited thereto. This application embodiment does not specifically limit this.
[0057] For example, the network connection between server 40 and each of at least two clients includes: connection via WiFi network channel 20, and / or connection via cellular network channel 30.
[0058] For example, when the server 40 is connected to the first client 10 of at least two clients via the WiFi network channel 20, the primary network protocol channel and the backup network protocol channel corresponding to the first client 10 are determined in the WiFi network channel 20; the server 40 synchronizes data to the first client 10 by synchronizing the synchronization frame based on the primary network protocol channel and the backup network protocol channel corresponding to the first client 10 in the WiFi network channel 20.
[0059] Optionally, when the main network protocol channel corresponding to the first client 10 in the WiFi network channel 20 meets the transmission conditions, the server 40 synchronizes data to the first client 10 based on the main network protocol channel in the WiFi network channel 20, and sends a heartbeat signal to the first client 10 based on the backup network protocol channel corresponding to the first client 10 in the WiFi network channel.
[0060] The heartbeat signal is used to measure the data transmission status of the backup network protocol channel.
[0061] Optionally, the client periodically sends a heartbeat signal to the server through a backup network protocol channel. If the server can receive the heartbeat signal, it indicates that the backup network protocol channel is working and can be used for data transmission. If the server cannot receive the heartbeat signal, or if the reception times out, it indicates that the backup network protocol channel is congested and cannot be used for data transmission.
[0062] Optionally, when the main network protocol channel corresponding to the first client 10 in the WiFi network channel 20 does not meet the transmission conditions, synchronization frame data is sent to the first client 10 based on the backup network protocol channel corresponding to the first client 10 in the WiFi network channel 20.
[0063] Optionally, the transmission conditions include at least one of the following: network channel is not blocked, network channel is not jittery, and network signal strength is high, but it is not limited thereto, and the embodiments of this application do not specifically limit it.
[0064] For example, when server 40 is connected to second client 50 of at least two clients via cellular network channel 30, a primary network protocol channel and a backup network protocol channel corresponding to second client 50 are determined in cellular network channel 30; server 40 synchronizes data to second client 50 by synchronizing frames based on the primary network protocol channel and the backup network protocol channel corresponding to second client 50 in cellular network channel 30.
[0065] Optionally, when the primary network protocol channel corresponding to the second client 50 in the cellular network channel 30 meets the transmission conditions, the system synchronizes data to the second client 50 by synchronizing a synchronization frame based on the primary network protocol channel corresponding to the second client 50 in the cellular network channel 30, and sends a heartbeat signal to the second client 50 based on the backup network protocol channel corresponding to the second client 50 in the cellular network channel 30.
[0066] Optionally, when the primary network protocol channel corresponding to the second client 50 in the cellular network channel 30 does not meet the transmission conditions, synchronization data is sent to the second client 50 via a synchronization frame based on the backup network protocol channel corresponding to the second client 50 in the cellular network channel 30.
[0067] For example, when server 40 is simultaneously connected to a third client 60 among at least two clients via WiFi network channel 20 and cellular network channel 30, a primary network protocol channel corresponding to the third client 60 is determined in WiFi network channel 20, and a backup network protocol channel corresponding to the third client 60 is determined in cellular network channel 30; server 40 synchronizes data with the third client 60 by synchronizing frames based on the primary network protocol channel corresponding to the third client 60 in WiFi network channel 20 and the backup network protocol channel corresponding to the third client 60 in cellular network channel 30.
[0068] Optionally, when the primary network protocol channel in the WiFi network channel 20 meets the transmission conditions, the server 40 synchronizes data to the third client 60 based on the primary network protocol channel in the WiFi network channel 20 corresponding to the third client 60, and sends a heartbeat signal to the third client 60 based on the backup network protocol channel in the cellular network channel 30 corresponding to the third client 60.
[0069] Optionally, when the primary network protocol channel corresponding to the third client 60 in the WiFi network channel 20 does not meet the transmission conditions, the server 40 synchronizes data to the third client 60 based on the backup network protocol channel corresponding to the third client 60 in the cellular network channel 30.
[0070] In summary, the method provided in this embodiment receives frame synchronization data sent by at least one of at least two clients; determines the primary network protocol channel and backup network protocol channel corresponding to each client based on the network connection method between the server and each client; and synchronizes frame synchronization data to each client based on the primary and backup network protocol channels corresponding to each client. This application determines the primary and backup network protocol channels required for frame synchronization based on the client's network connection method. When the primary network protocol channel meets the transmission conditions, frame synchronization data is transmitted only through the primary network protocol channel; when the primary network protocol channel does not meet the transmission conditions, frame synchronization data is transmitted through the backup network protocol channel. This avoids network latency and packet loss, as well as the network traffic consumption problem caused by simultaneously accessing WiFi and cellular network channels.
[0071] Figure 3 This illustration shows a structural block diagram of a computer system provided in an exemplary embodiment of this application. The computer system 300 includes a first terminal 310, a server 320, and a second terminal 330.
[0072] The first terminal 310 has applications that support frame synchronization installed and running, such as frame-synchronized games. The first terminal 310 is the terminal used by the first player.
[0073] In some embodiments, the first terminal 310 can be considered as the first player using the first terminal 310.
[0074] The first terminal 310 is connected to the server 320 via a wireless network or a wired network.
[0075] Server 320 includes one of the following: a single server, multiple servers, a cloud computing platform, and a virtualization center. Illustratively, server 320 includes a processor 321 and a memory 322, with memory 322 further including a receiving module 3221, a display module 3222, and a control module 3223. Server 320 provides background services for applications supporting frame synchronization. Optionally, server 320 undertakes the primary computing work, while the first terminal 310 and the second terminal 330 undertake secondary computing work; or, server 320 undertakes secondary computing work, while the first terminal 310 and the second terminal 330 undertake the primary computing work; or, server 320, the first terminal 310, and the second terminal 330 collaborate in a distributed computing architecture.
[0076] The second terminal 330 has an application that supports frame synchronization installed and running. The second terminal 330 is the terminal used by the second player.
[0077] In some embodiments, the second terminal 330 can be considered as a second player using the second terminal 330.
[0078] Optionally, the first player and the second player may or may not be in the same line of sight, or they may or may not be in the same game, or they may or may not be in the same virtual scene. Optionally, the first player and the second player may belong to the same team, the same organization, have a friend relationship, or have temporary communication permissions.
[0079] Optionally, the applications installed on the first terminal 310 and the second terminal 330 are the same, or the applications installed on the two terminals are the same type of applications from different control system platforms. The first terminal 310 can refer to one of multiple terminals, and the second terminal 330 can refer to one of multiple terminals; this embodiment only uses the first terminal 310 and the second terminal 330 as examples. The device types of the first terminal 310 and the second terminal 330 may be the same or different, and these device types include, but are not limited to, at least one of: smartphones, tablets, e-book readers, laptops, desktop computers, televisions, augmented reality (AR) terminals, virtual reality (VR) terminals, mixed reality (MR) terminals, extended reality (XR) terminals, baffle reality (BR) terminals, cinematic reality (CR) terminals, and deceived reality (DR) terminals. The following embodiments use smartphones as examples.
[0080] Those skilled in the art will understand that the number of terminals or players can be more or less. For example, there may be only one terminal or player, or there may be dozens or hundreds, or even more. This application does not limit the number of terminals or players or the type of device.
[0081] It should be noted that all information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.), and signals involved in this application are authorized by the user or fully authorized by all parties, and the collection, use, and processing of related data must comply with the relevant laws, regulations, and standards of the relevant countries and regions. For example, the information involved in this application is obtained under full authorization, and the terminal and server only cache this information during program operation, and will not permanently store or reuse the related data.
[0082] Figure 4 This is a flowchart of a frame synchronization method provided in an exemplary embodiment of this application. The method can be executed by a server in a game application, and the server has at least two clients connected to it. The method includes:
[0083] Step 402: Based on the network connection method between the server and each of the at least two clients, determine the primary network protocol channel and the backup network protocol channel corresponding to each client.
[0084] The main network protocol channel is used to transmit frame synchronization data.
[0085] The backup network protocol channel is used to transmit frame synchronization data when the primary network protocol channel does not meet the transmission conditions.
[0086] For example, based on the network connection method between the server and each of the at least two clients, the server determines the primary network protocol channel and the backup network protocol channel corresponding to each client.
[0087] Optionally, the backup network protocol channel can be used to compensate for packet loss when the main network protocol channel meets the transmission conditions, thereby reducing the packet loss compensation delay caused by packet loss.
[0088] Optionally, the primary network protocol channel is a UDP channel.
[0089] Optionally, the backup network protocol channel can be either a UDP channel or a TCP channel, but is not limited thereto. This application embodiment does not specifically limit this.
[0090] Network connection method refers to the connection relationship between the client and the server. For example, the client and the server connect via WiFi network, or the client and the server connect via cellular network.
[0091] Optionally, the timing of constructing the primary network protocol channel includes at least one of the following: at the start of a game, when connecting to a virtual battle, and before frame synchronization, but is not limited thereto. This application embodiment does not specifically limit this. The timing of constructing the backup network protocol channel includes at least one of the following: at the start of a game, when connecting to a virtual battle, and before frame synchronization, but is not limited thereto. This application embodiment does not specifically limit this.
[0092] Step 404: Receive frame synchronization data sent by at least one of the at least two clients.
[0093] For example, the server is connected to at least two clients, and the server receives frame synchronization data sent by at least one of the at least two clients per unit time.
[0094] Frame synchronization data refers to the data that is synchronized in each client.
[0095] Optionally, the frame synchronization data may include player operation instructions, player commands, or game actions in the game application, but is not limited thereto, and the embodiments of this application do not impose specific limitations.
[0096] Step 406: Based on the primary network protocol channel and backup network protocol channel corresponding to each client, synchronize frame synchronization data to each client.
[0097] For example, the server synchronizes data to each client based on the primary network protocol channel and the backup network protocol channel corresponding to each client.
[0098] In summary, the method provided in this embodiment determines the primary network protocol channel and backup network protocol channel corresponding to each client based on the network connection method between the server and each client; it receives frame synchronization data sent by at least one of at least two clients; and it synchronizes frame synchronization data to each client based on the primary and backup network protocol channels corresponding to each client. This application determines the primary and backup network protocol channels required for frame synchronization based on the client's network connection method. When the primary network protocol channel meets the transmission conditions, frame synchronization data is transmitted only through the primary network protocol channel; when the primary network protocol channel does not meet the transmission conditions, frame synchronization data is transmitted through the backup network protocol channel. This avoids network latency and packet loss, as well as the network traffic consumption problem caused by simultaneously accessing WiFi and cellular network channels.
[0099] Figure 5 This is a flowchart of a frame synchronization method provided in an exemplary embodiment of this application. The method can be executed by a server in a game application, and the server has at least two clients connected to it. The method includes:
[0100] Step 502: Based on the WiFi network channel and / or cellular network channel between the server and each of the at least two clients, determine the primary network protocol channel and the backup network protocol channel corresponding to each client.
[0101] For example, based on the network connection method between the server and each of the at least two clients, the server determines the primary network protocol channel and the backup network protocol channel corresponding to each client.
[0102] Optionally, the primary network protocol channel is a UDP channel.
[0103] Optionally, the backup network protocol channel can be either a UDP channel or a TCP channel, but is not limited thereto, and the embodiments of this application do not specifically limit this. Among them, the TCP channel has better anti-latency characteristics than the UDP channel.
[0104] Optionally, the timing of constructing the primary network protocol channel includes at least one of the following: at the start of a game, when connecting to a virtual battle, and before frame synchronization, but is not limited thereto. This application embodiment does not specifically limit this. The timing of constructing the backup network protocol channel includes at least one of the following: at the start of a game, when connecting to a virtual battle, and before frame synchronization, but is not limited thereto. This application embodiment does not specifically limit this.
[0105] For example, the network connection method refers to the connection relationship between the client and the server. The network connection method between the server and each of at least two clients includes: connection via WiFi network channel and / or connection via cellular network channel.
[0106] Optionally, when the server is connected to the first client among at least two clients via a WiFi network channel, a primary network protocol channel and a backup network protocol channel corresponding to the first client are determined in the WiFi network channel.
[0107] For example, such as Figure 6 The diagram illustrates the network protocol channels within the WiFi network channel. When server 630 is connected to a first client 610 (one of at least two clients) via WiFi network channel 620, a primary network protocol channel 6201 and a backup network protocol channel 6202 corresponding to the first client 610 are defined within WiFi network channel 620. When the network protocol channel is unblocked and without delay, the primary network protocol channel 6201 is used to transmit frame synchronization data, while the backup network protocol channel 6202 is used only to transmit heartbeat signals to ensure its smooth operation. In the event of network protocol channel blockage or transmission delay, the backup network protocol channel 6202 is used to transmit frame synchronization data.
[0108] In the case where the server is connected to the second client among at least two clients via a cellular network channel, the primary network protocol channel and the backup network protocol channel corresponding to the second client are determined in the cellular network channel.
[0109] For example, such as Figure 7The diagram illustrates the network protocol channels within a cellular network channel. When server 730 is connected to a second client 710 (one of at least two clients) via cellular network channel 720, a primary network protocol channel 7201 and a backup network protocol channel 7202 corresponding to the second client 710 are defined within cellular network channel 720. When the network protocol channel is unblocked and without delay, the primary network protocol channel 7201 is used to transmit frame synchronization data, while the backup network protocol channel 7202 is used only to transmit heartbeat signals to ensure its unobstructed operation. In the event of network protocol channel blockage or transmission delay, the backup network protocol channel 7202 is used to transmit frame synchronization data.
[0110] When the server is simultaneously connected to a third client among at least two clients via both a WiFi network channel and a cellular network channel, the primary network protocol channel corresponding to the third client is determined in the WiFi network channel, and the backup network protocol channel corresponding to the third client is determined in the cellular network channel.
[0111] For example, such as Figure 8 The diagram illustrates the network protocol channels in the WiFi network channel and the cellular network channel. When server 840 and at least two clients (a third client 810) are simultaneously connected via WiFi network channel 820 and cellular network channel 830, a primary network protocol channel corresponding to the third client 810 is determined in WiFi network channel 820, and a backup network protocol channel corresponding to the third client 810 is determined in cellular network channel 830. When there is no congestion or delay in the network protocol channels, the primary network protocol channel in WiFi network channel 820 is used to transmit frame synchronization data, while the backup network protocol channel in cellular network channel 830 is only used to transmit heartbeat signals to ensure the backup network protocol channel is functioning correctly. When there is congestion or transmission delay in the network protocol channels, the backup network protocol channel in cellular network channel 830 is used to transmit frame synchronization data.
[0112] For example, such as Figure 9 The diagram shown illustrates the connection between the client and the server. Client 901 is connected to TCP channel interface 902 in server 905 via a TCP channel, and client 901 is connected to UDP channel interface 903 in server 905 via a UDP channel. TCP channel interface 902 and UDP channel interface 903 in server 905 are connected by a data connection line 904, thus enabling communication of frame synchronization data regardless of the direction of transmission.
[0113] Step 504: Receive frame synchronization data sent by at least one of the at least two clients.
[0114] For example, the server is connected to at least two clients, and the server receives frame synchronization data sent by at least one of the at least two clients per unit time.
[0115] Frame synchronization data refers to the data that is synchronized in each client.
[0116] Step 506: Based on the primary network protocol channel and backup network protocol channel corresponding to each client, synchronize frame synchronization data to each client.
[0117] For example, when the server and the first client are connected via a WiFi network channel, the server synchronizes data to the first client using the primary network protocol channel and the backup network protocol channel corresponding to the first client in the WiFi network channel.
[0118] Optionally, when the main network protocol channel corresponding to the first client in the WiFi network channel meets the transmission conditions, the server synchronizes data to the first client based on the main network protocol channel in the WiFi network channel.
[0119] Optionally, the server sends a heartbeat signal to the first client based on the backup network protocol channel corresponding to the first client in the WiFi network channel.
[0120] The heartbeat signal is used to measure the data transmission status of the backup network protocol channel.
[0121] Optionally, the client periodically sends a heartbeat signal to the server through a backup network protocol channel. If the server can receive the heartbeat signal, it indicates that the backup network protocol channel is working and can be used for data transmission. If the server cannot receive the heartbeat signal, or if the reception times out, it indicates that the backup network protocol channel is congested and cannot be used for data transmission.
[0122] Optionally, when the primary network protocol channel corresponding to the first client in the WiFi network channel does not meet the transmission conditions, synchronization frame data is transmitted to the first client based on the backup network protocol channel corresponding to the first client in the WiFi network channel.
[0123] Optionally, the transmission conditions include at least one of the following: network channel is not blocked, network channel is not jittery, and network signal strength is high, but it is not limited thereto, and the embodiments of this application do not specifically limit it.
[0124] For example, when the server and the second client are connected via a cellular network channel, the server synchronizes data to the second client using the primary network protocol channel and the backup network protocol channel corresponding to the second client in the cellular network channel.
[0125] Optionally, when the main network protocol channel corresponding to the second client in the cellular network channel meets the transmission conditions, synchronization data is transmitted to the second client based on the main network protocol channel corresponding to the second client in the cellular network channel.
[0126] Optionally, the server sends a heartbeat signal to the second client based on a backup network protocol channel in the cellular network channel corresponding to the second client.
[0127] Optionally, when the primary network protocol channel corresponding to the second client in the cellular network channel does not meet the transmission conditions, synchronization frame synchronization data is sent to the second client based on the backup network protocol channel corresponding to the second client in the cellular network channel.
[0128] For example, such as Figure 10 The diagram illustrates the network protocol channels within a single network channel. When the server and client 1001 are connected via this single network channel, the server determines the primary network protocol channel, such as the UDP channel, within this channel. The server also determines a backup network protocol channel, such as the TCP channel, within the same single network channel. Both the UDP and TCP channels are open simultaneously. When network connectivity is available, the server transmits frame synchronization data in the UDP channel via synchronizer 1003, and transmits heartbeat signals in the TCP channel via keep-alive 1004. When the UDP channel does not meet transmission requirements, it is closed, and the server transmits frame synchronization data in the TCP channel via synchronizer 1003.
[0129] For example, when the server and the third client are connected simultaneously via a WiFi network channel and a cellular network channel, the primary network protocol channel corresponding to the third client is determined in the WiFi network channel, and the backup network protocol channel corresponding to the third client is determined in the cellular network channel; the server synchronizes the data of the synchronization frame to the third client based on the primary network protocol channel corresponding to the third client in the WiFi network channel and the backup network protocol channel corresponding to the third client in the cellular network channel.
[0130] Optionally, when the primary network protocol channel in the WiFi network channel meets the transmission conditions, the server synchronizes data to the third client based on the primary network protocol channel corresponding to the third client in the WiFi network channel, and sends a heartbeat signal to the third client based on the backup network protocol channel corresponding to the third client in the cellular network channel.
[0131] Optionally, if the primary network protocol channel corresponding to the third client in the WiFi network channel does not meet the transmission conditions, the server synchronizes the data to the third client using the backup network protocol channel corresponding to the third client in the cellular network channel.
[0132] For example, such as Figure 11 The diagram illustrates the network protocol channels in a dual-network channel setup. When the server and client 1101 connect via a single network channel, the server establishes both a UDP channel and a TCP channel within that single network channel. When the server and client 1101 connect via a dual-network channel setup, the server establishes a UDP channel within the WiFi network channel and an additional UDP channel within the cellular network channel. These three channels (UDP channel, TCP channel, and additional UDP channel) are independent of each other. In the dual-network channel connection scenario, the TCP channel is established within the WiFi network channel, thus avoiding the use of cellular data.
[0133] In a dual-network channel connection scenario, the server determines the primary network protocol channel (e.g., UDP channel) in the WiFi network channel and the backup network protocol channel (e.g., an additional UDP channel) in the cellular network channel. Both the UDP channel and the additional UDP channel are open simultaneously. When network connectivity is good, the server transmits frame synchronization data in the UDP channel via synchronizer 1103, and transmits heartbeat signals in the additional UDP channel via keep-alive 1104. When the UDP channel does not meet transmission conditions, it is closed, and the server transmits frame synchronization data in the additional UDP channel via synchronizer 1103.
[0134] In one possible implementation, the server, in response to the client's usage status, predicts and switches the network protocol channel for transmitting frame synchronization data between the primary and backup network protocol channels.
[0135] For example, the server obtains the trend of motion state changes of the client; based on the trend of motion state changes of the client, the server predicts the network protocol channel for switching transmission frame synchronization data in the primary network protocol channel and the backup network protocol channel.
[0136] Among them, the state change trend is used to predict the client's motion state in the next moment.
[0137] Optionally, the client's motion state includes at least one of walking, brisk walking, running, and sprinting states, but is not limited thereto, and this application embodiment does not specifically limit this.
[0138] Optionally, based on the client's movement state switching from walking to running, the server switches the network protocol channel for transmitting frame synchronization data from the primary network protocol channel to the backup network protocol channel, thereby ensuring transmission quality.
[0139] For example, the server obtains the speed change trend in the client's motion state, and based on the client's speed change trend, the server predicts to switch to the backup network protocol channel to transmit frame synchronization data.
[0140] Optionally, the speed change trend includes at least one of the following: stable movement speed, accelerated movement speed, and slowed movement speed, but is not limited thereto, and the embodiments of this application do not specifically limit this.
[0141] Optionally, the server obtains the speed change trend in the client's motion state. If the server detects an acceleration in the client's movement speed, it switches the network protocol channel for transmitting frame synchronization data from the primary network protocol channel to the backup network protocol channel to ensure transmission quality.
[0142] For example, the server obtains the network strength change trend of the client's location; based on the client's network strength change trend, the server predicts the network protocol channel for switching the transmission frame synchronization data in the primary network protocol channel and the backup network protocol channel;
[0143] Among them, the trend of network strength change is used to predict the network strength of the client in the next moment.
[0144] Optionally, the server obtains the network strength change trend of the client's location; in response to the gradual weakening of the network strength at the client's location, the server switches the network protocol channel for transmitting frame synchronization data to a backup network protocol channel.
[0145] Optionally, the server obtains the network strength of the client's location; in response to the network strength of the client's location being lower than a threshold, the server switches the network protocol channel for transmitting frame synchronization data to a backup network protocol channel.
[0146] Among them, the transmission quality of the backup network protocol channel is better than that of the main network protocol channel.
[0147] For example, as the client moves, if the network strength at the client's current location decreases or falls below a threshold, the server switches the network protocol channel for transmitting frame synchronization data to a backup network protocol channel with better transmission performance.
[0148] For example, the server obtains the client's historical usage status; based on the client's historical usage status, the server predicts the network protocol channel for switching transmission frame synchronization data in the primary network protocol channel and the backup network protocol channel;
[0149] Among them, historical usage status is used to predict the client's usage status in the next moment.
[0150] Optionally, the server obtains the client's historical usage status, determines the usage status at the next moment based on the client's historical usage status, and switches the network protocol channel for transmitting frame synchronization data to the backup network protocol channel based on the usage status at the next moment, thereby ensuring transmission quality.
[0151] For example, if the current time is the first moment, and the client's historical usage predicts that the client will need to receive a large number of files in the second moment, then the server will switch the network protocol channel for transmitting frame synchronization data to a backup network protocol channel with better transmission quality in the first moment, thereby ensuring transmission quality.
[0152] For example, such as Figure 12 The diagram illustrates the occurrence rate of network latency in different scenarios. To verify the effect of the frame synchronization method provided in this application on improving network latency, a large amount of game data was collected and analyzed. The following results were obtained: the occurrence rate of network latency greater than 500ms in different scenarios; the occurrence rate of network latency greater than 800ms in different scenarios; and the occurrence rate of network latency greater than 1500ms in different scenarios. In the diagram, scenario A represents the situation before enabling dual network protocol channels; scenario B represents the situation where dual network protocol channels are enabled and connected via both WiFi and cellular network channels; scenario C represents the situation where dual network protocol channels are enabled and connected only via cellular network channels; scenario D represents the situation where dual network protocol channels are enabled and connected only via WiFi network channels; scenario E represents the situation where dual network protocol channels are enabled but no network protocol channel is available; and scenario F represents the situation where no network protocol channel is available. As can be seen from the diagram, enabling dual network protocol channels can effectively reduce the occurrence rate of network latency when connected via both WiFi and cellular network channels.
[0153] In summary, the method provided in this embodiment receives frame synchronization data sent by at least one of at least two clients; determines the primary network protocol channel and backup network protocol channel corresponding to each client based on the network connection method between the server and each client; and synchronizes frame synchronization data to each client based on the primary and backup network protocol channels corresponding to each client. This application determines the primary and backup network protocol channels required for frame synchronization based on the client's network connection method. When the primary network protocol channel meets the transmission conditions, frame synchronization data is transmitted only through the primary network protocol channel; when the primary network protocol channel does not meet the transmission conditions, frame synchronization data is transmitted through the backup network protocol channel. This avoids network latency and packet loss, as well as the network traffic consumption problem caused by simultaneously accessing WiFi and cellular network channels.
[0154] The method provided in this embodiment offers three scenarios for determining the primary and backup network protocol channels by identifying the primary and backup network protocol channels corresponding to the first client in the WiFi network channel, the primary and backup network protocol channels corresponding to the first client in the cellular network channel, and the primary and backup network protocol channels corresponding to the first client in both the WiFi network channel and the cellular network channel. This approach can avoid network latency and packet loss in various scenarios.
[0155] The method provided in this embodiment, when the server and client are connected through a WiFi network channel, synchronizes frame synchronization data to the client based on the primary network protocol channel in the WiFi network channel, and sends a heartbeat signal to the client based on the backup network protocol channel in the WiFi network channel. This application determines the primary and backup network protocol channels required for frame synchronization based on the client's WiFi network channel connection method. When the primary network protocol channel meets the transmission conditions, frame synchronization data is transmitted only through the primary network protocol channel; when the primary network protocol channel does not meet the transmission conditions, frame synchronization data is transmitted through the backup network protocol channel. This avoids network latency and network packet loss, as well as the network traffic consumption problem caused by simultaneously accessing WiFi and cellular network channels.
[0156] The method provided in this embodiment, when the server and client are connected through a cellular network channel, synchronizes frame synchronization data to the client based on the primary network protocol channel in the cellular network channel, and sends a heartbeat signal to the client based on the backup network protocol channel in the cellular network channel. This application determines the primary network protocol channel and backup network protocol channel required for frame synchronization based on the client's cellular network channel connection method. When the primary network protocol channel meets the transmission conditions, frame synchronization data is transmitted only through the primary network protocol channel; when the primary network protocol channel does not meet the transmission conditions, frame synchronization data is transmitted through the backup network protocol channel. This avoids network latency and network packet loss, as well as the network traffic consumption problem caused by simultaneously accessing WiFi network channels and cellular network channels.
[0157] The method provided in this embodiment, when the server and client are connected via WiFi and cellular network channels, synchronizes frame synchronization data to the client based on the primary network protocol channel in the WiFi network channel, and sends a heartbeat signal to the client based on the backup network protocol channel in the cellular network channel. This application determines the primary and backup network protocol channels required for frame synchronization based on the client's WiFi and cellular network channel connection method. When the primary network protocol channel meets the transmission conditions, frame synchronization data is transmitted only through the primary network protocol channel; when the primary network protocol channel does not meet the transmission conditions, frame synchronization data is transmitted through the backup network protocol channel. This avoids network latency and packet loss, as well as the network traffic consumption problem caused by simultaneously accessing WiFi and cellular network channels.
[0158] The method provided in this embodiment predicts the network protocol channel for switching transmission frame synchronization data based on the client's motion state change trend, network strength change trend, and historical usage status. This application provides a centralized prediction and switching scenario, thereby avoiding network latency and packet loss in various scenarios.
[0159] For example, such as Figure 13 The diagram illustrates the on / off status of network protocol channels. The server performs a health check on each network protocol channel connected to client 1301 using a heartbeat signal; that is, it detects the transmission status of each network protocol channel through the heartbeat signal. When a heartbeat signal can be transmitted between the server and client 1301, the network protocol channel remains fully open; when the heartbeat signal transmission between the server and client 1301 times out or there is no heartbeat signal, the network protocol channel remains closed.
[0160] For example, such as Figure 14 The diagram illustrates the transmission status of the network protocol channels. The server's backup network protocol channel is in a half-open state by default, meaning it does not perform frame synchronization but transmits heartbeat signals and packet loss compensation. The server performs a health check on each network protocol channel using heartbeat signals; that is, it detects the transmission status of each network protocol channel through heartbeat signals. After the server receives a fully open channel message from the client, the network protocol channel fully opens and remains open for a period of time. During this period, the network protocol channel can be used to transmit frame synchronization data. If no fully open channel message is received for a period of time, the network protocol channel returns to a half-open state. In the half-open state, the network protocol channel is only used to transmit heartbeat signals and packet loss compensation. If the network protocol channel in the half-open state does not receive a heartbeat signal or the heartbeat signal times out, the network protocol channel closes. At this time, there is neither uplink nor downlink information in the network protocol channel.
[0161] For example, such as Figure 15 The diagram illustrates the encapsulated network protocol channel. In server 1509, the switching, selection, and determination of the network protocol channel are all internally encapsulated into a network protocol channel layer 1510. When the game logic layer 1508 in the server performs data communication, it only transmits data through the receiving information interface 1506 and sending information interface 1507 in the network protocol channel layer 1510. The network protocol channel layer 1510 updates the network protocol channel status information 1505 based on the transmitted data. Through the network protocol channel status information 1505, it determines the network protocol channel connected to client 1501 from the first network protocol channel 1502, the second network protocol channel 1503, and the third network protocol channel 1504. The encapsulated network protocol channel layer 1510 hides the network channel information from the upper game logic layer 1508, while ensuring the uniformity of the multi-channel logic state core switching strategy in terms of overall availability.
[0162] Figure 16 A schematic diagram of a frame synchronization device provided in an exemplary embodiment of this application is shown. This device can be implemented as all or part of a computer device through software, hardware, or a combination of both. The device includes:
[0163] The determining module 1602 is used to determine a primary network protocol channel and a backup network protocol channel corresponding to each client based on the network connection method between the server and each of the at least two clients; the primary network protocol channel is used to transmit the frame synchronization data, and the backup network protocol channel is used to transmit the frame synchronization data when the primary network protocol channel does not meet the transmission conditions;
[0164] The receiving module 1601 is used to receive frame synchronization data sent by at least one of the at least two clients;
[0165] The synchronization module 1603 is used to synchronize the frame synchronization data to each client based on the main network protocol channel and the backup network protocol channel corresponding to each client.
[0166] In one possible implementation, the determining module 1602 is used to determine, in the WiFi network channel, the primary network protocol channel and the backup network protocol channel corresponding to the first client when the server is connected to the first client of the at least two clients through the WiFi network channel.
[0167] In one possible implementation, the determining module 1602 is used to determine, in the cellular network channel, the primary network protocol channel and the backup network protocol channel corresponding to the second client, when the server is connected to the second client among the at least two clients through the cellular network channel.
[0168] In one possible implementation, the determining module 1602 is configured to, when the server and a third client among the at least two clients are simultaneously connected via a WiFi network channel and a cellular network channel, determine the primary network protocol channel corresponding to the third client in the WiFi network channel, and determine the backup network protocol channel corresponding to the third client in the cellular network channel.
[0169] In one possible implementation, the synchronization module 1603 is used to synchronize the frame synchronization data to the first client based on the main network protocol channel and the backup network protocol channel corresponding to the first client in the WiFi network channel.
[0170] In one possible implementation, the synchronization module 1603 is used to synchronize the frame synchronization data to the first client based on the main network protocol channel corresponding to the first client in the WiFi network channel when the transmission conditions are met.
[0171] In one possible implementation, the synchronization module 1603 is used to send a heartbeat signal to the first client based on the backup network protocol channel corresponding to the first client in the WiFi network channel when the main network protocol channel corresponding to the first client in the WiFi network channel meets the transmission conditions.
[0172] The heartbeat signal is used to measure the data transmission status of the backup network protocol channel.
[0173] In one possible implementation, the synchronization module 1603 is used to synchronize the frame synchronization data to the first client based on the backup network protocol channel corresponding to the first client in the WiFi network channel when the main network protocol channel corresponding to the first client in the WiFi network channel does not meet the transmission conditions.
[0174] In one possible implementation, the synchronization module 1603 is used to synchronize the frame synchronization data to the second client based on the primary network protocol channel and the backup network protocol channel corresponding to the second client in the cellular network channel.
[0175] In one possible implementation, the synchronization module 1603 is used to synchronize the frame synchronization data to the second client based on the main network protocol channel corresponding to the second client in the cellular network channel when the transmission conditions are met.
[0176] In one possible implementation, the synchronization module 1603 is used to send a heartbeat signal to the second client based on the backup network protocol channel corresponding to the second client in the cellular network channel when the primary network protocol channel corresponding to the second client in the cellular network channel meets the transmission conditions.
[0177] In one possible implementation, the synchronization module 1603 is used to synchronize the frame synchronization data to the second client based on the backup network protocol channel corresponding to the second client in the cellular network channel when the primary network protocol channel corresponding to the second client in the cellular network channel does not meet the transmission conditions.
[0178] In one possible implementation, the synchronization module 1603 is used to synchronize the frame synchronization data to the third client based on the main network protocol channel in the WiFi network channel corresponding to the third client and the backup network protocol channel in the cellular network channel corresponding to the third client.
[0179] In one possible implementation, the synchronization module 1603 is used to synchronize the frame synchronization data to the third client based on the main network protocol channel corresponding to the third client in the WiFi network channel when the transmission conditions are met.
[0180] In one possible implementation, the synchronization module 1603 is used to send a heartbeat signal to the third client based on the backup network protocol channel corresponding to the third client in the cellular network channel when the main network protocol channel corresponding to the third client in the WiFi network channel meets the transmission conditions.
[0181] In one possible implementation, the synchronization module 1603 is used to synchronize the frame synchronization data to the third client based on the backup network protocol channel corresponding to the third client in the cellular network channel when the main network protocol channel corresponding to the third client in the WiFi network channel does not meet the transmission conditions.
[0182] In one possible implementation, the prediction module 1604 is configured to predict, in response to the usage state of the client, to switch the network protocol channel for transmitting the frame synchronization data between the primary network protocol channel and the backup network protocol channel.
[0183] In one possible implementation, the acquisition module 1605 is used to acquire the trend of motion state changes of the client.
[0184] In one possible implementation, the prediction module 1604 is used to predict the switching of the network protocol channel for transmitting the frame synchronization data in the primary network protocol channel and the backup network protocol channel based on the state change trend of the motion state of the client.
[0185] The state change trend is used to predict the client's motion state in the next moment.
[0186] In one possible implementation, the acquisition module 1605 is used to acquire the network strength change trend of the location of the client.
[0187] In one possible implementation, the prediction module 1604 is used to predict, based on the network strength change trend of the client, the network protocol channel for switching the transmission of the frame synchronization data in the primary network protocol channel and the backup network protocol channel.
[0188] The network strength change trend is used to predict the network strength of the client in the next moment.
[0189] In one possible implementation, the acquisition module 1605 is used to acquire the historical usage status of the client.
[0190] In one possible implementation, the prediction module 1604 is used to predict, based on the client's historical usage status, the network protocol channel for switching the transmission of the frame synchronization data in the primary network protocol channel and the backup network protocol channel.
[0191] The historical usage status is used to predict the client's usage status at the next moment.
[0192] Figure 17This illustration shows a structural block diagram of a computer device 1700 provided in an exemplary embodiment of this application. The computer device 1700 may be a portable mobile terminal, such as a smartphone, tablet computer, MP3 player (Moving Picture Experts Group Audio Layer III), or MP4 player (Moving Picture Experts Group Audio Layer IV). The computer device 1700 may also be referred to as a user device, portable terminal, or other names.
[0193] Typically, computer device 1700 includes a processor 1701 and a memory 1702.
[0194] Processor 1701 may include one or more processing cores, such as a quad-core processor, an octa-core processor, etc. Processor 1701 may be implemented using at least one hardware form selected from DSP (Digital Signal Processing), FPGA (Field Programmable Gate Array), and PLA (Programmable Logic Array). Processor 1701 may also include a main processor and a coprocessor. The main processor, also known as a CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, processor 1701 may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, processor 1701 may also include an AI (Artificial Intelligence) processor, which is used to handle computational operations related to machine learning.
[0195] Memory 1702 may include one or more computer-readable storage media, which may be tangible and non-transitory. Memory 1702 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In some embodiments, the non-transitory computer-readable storage media in memory 1702 is used to store at least one instruction, which is executed by processor 1701 to implement the frame synchronization method provided in the embodiments of this application.
[0196] In some embodiments, the computer device 1700 may also optionally include: a peripheral device interface 1703 and at least one peripheral device. Specifically, the peripheral device includes at least one of: a radio frequency circuit 1704, a touch display screen 1705, a camera assembly 1706, an audio circuit 1707, and a power supply 1708.
[0197] Peripheral interface 1703 can be used to connect at least one I / O (Input / Output) related peripheral device to processor 1701 and memory 1702. In some embodiments, processor 1701, memory 1702 and peripheral interface 1703 are integrated on the same chip or circuit board; in some other embodiments, any one or two of processor 1701, memory 1702 and peripheral interface 1703 can be implemented on separate chips or circuit boards, which is not limited in this embodiment.
[0198] The radio frequency (RF) circuit 1704 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The RF circuit 1704 communicates with communication networks and other communication devices via electromagnetic signals. The RF circuit 1704 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals back into electrical signals. Optionally, the RF circuit 1704 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, etc. The RF circuit 1704 can communicate with other terminals through at least one wireless communication protocol. This wireless communication protocol includes, but is not limited to: the World Wide Web, metropolitan area networks, intranets, various generations of mobile communication networks (2G, 3G, 4G, and 5G), wireless local area networks, and / or WiFi (Wireless Fidelity) networks. In some embodiments, the RF circuit 1704 may also include circuitry related to NFC (Near Field Communication), which is not limited in this application.
[0199] Touchscreen display 1705 is used to display a UI (User Interface). This UI may include graphics, text, icons, video, and any combination thereof. Touchscreen display 1705 also has the ability to collect touch signals on or above its surface. These touch signals can be input as control signals to processor 1701 for processing. Touchscreen display 1705 is used to provide virtual buttons and / or a virtual keyboard, also known as soft buttons and / or a soft keyboard. In some embodiments, touchscreen display 1705 may be a single display, located on the front panel of computer device 1700; in other embodiments, there may be at least two touchscreen displays, respectively located on different surfaces of computer device 1700 or in a folded design; in some embodiments, touchscreen display 1705 may be a flexible display, located on a curved or folded surface of computer device 1700. Furthermore, touchscreen display 1705 may be configured as a non-rectangular, irregular shape, i.e., a non-rectangular screen. Touchscreen display 1705 may be made of materials such as LCD (Liquid Crystal Display) or OLED (Organic Light-Emitting Diode).
[0200] The camera assembly 1706 is used to acquire images or videos. Optionally, the camera assembly 1706 includes a front-facing camera and a rear-facing camera. Typically, the front-facing camera is used for video calls or selfies, and the rear-facing camera is used for taking photos or videos. In some embodiments, there are at least two rear-facing cameras, which are any one of a main camera, a depth-sensing camera, and a wide-angle camera, to achieve background blurring by fusion of the main camera and the depth-sensing camera, and panoramic shooting and VR (Virtual Reality) shooting by fusion of the main camera and the wide-angle camera. In some embodiments, the camera assembly 1706 may also include a flash. The flash can be a single-color temperature flash or a dual-color temperature flash. A dual-color temperature flash is a combination of a warm light flash and a cool light flash, which can be used for light compensation at different color temperatures.
[0201] Audio circuitry 1707 provides an audio interface between the user and computer device 1700. Audio circuitry 1707 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, converting the sound waves into electrical signals that are input to processor 1701 for processing, or input to radio frequency circuitry 1704 for voice communication. For stereo sound acquisition or noise reduction purposes, multiple microphones may be used, each located at a different location within computer device 1700. The microphone may also be an array microphone or an omnidirectional microphone. The speaker is used to convert electrical signals from processor 1701 or radio frequency circuitry 1704 into sound waves. The speaker may be a conventional diaphragm speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can convert electrical signals not only into audible sound waves but also into inaudible sound waves for purposes such as distance measurement. In some embodiments, audio circuitry 1707 may also include a headphone jack.
[0202] Power supply 1708 is used to supply power to the various components in computer device 1700. Power supply 1708 can be AC power, DC power, a disposable battery, or a rechargeable battery. When power supply 1708 includes a rechargeable battery, the rechargeable battery can be a wired rechargeable battery or a wireless rechargeable battery. A wired rechargeable battery is a battery that is charged via a wired line, and a wireless rechargeable battery is a battery that is charged via a wireless coil. The rechargeable battery can also be used to support fast charging technology.
[0203] In some embodiments, the computer device 1700 further includes one or more sensors 1709. The one or more sensors 1709 include, but are not limited to, an accelerometer 1710, a gyroscope 1711, a pressure sensor 1712, an optical sensor 1713, and a proximity sensor 1714.
[0204] Accelerometer 1710 can detect the magnitude of acceleration along the three coordinate axes of a coordinate system established by computer device 1700. For example, accelerometer 1710 can be used to detect the components of gravitational acceleration along the three coordinate axes. Processor 1701 can control touchscreen display 1705 to display the user interface in landscape or portrait view based on the gravitational acceleration signal acquired by accelerometer 1710. Accelerometer 1710 can also be used for games or for acquiring user motion data.
[0205] The gyroscope sensor 1711 can detect the orientation and rotation angle of the computer device 1700. The gyroscope sensor 1711 can work in conjunction with the accelerometer sensor 1710 to acquire 3D motion data from the user on the computer device 1700. Based on the data acquired by the gyroscope sensor 1711, the processor 1701 can perform the following functions: motion sensing (e.g., changing the UI based on the user's tilt), image stabilization during shooting, game control, and inertial navigation.
[0206] The pressure sensor 1712 can be disposed on the side bezel of the computer device 1700 and / or on the lower layer of the touch display screen 1705. When the pressure sensor 1712 is disposed on the side bezel of the computer device 1700, it can detect the user's grip signal on the computer device 1700 and perform left / right hand recognition or quick operation based on the grip signal. When the pressure sensor 1712 is disposed on the lower layer of the touch display screen 1705, it can control operable controls on the UI interface based on the user's pressure operation on the touch display screen 1705. Operable controls include at least one of button controls, scroll bar controls, icon controls, and menu controls.
[0207] Optical sensor 1713 is used to collect ambient light intensity. In one embodiment, processor 1701 can control the display brightness of touch display screen 1705 based on the ambient light intensity collected by optical sensor 1713. Specifically, when the ambient light intensity is high, the display brightness of touch display screen 1705 is increased; when the ambient light intensity is low, the display brightness of touch display screen 1705 is decreased. In another embodiment, processor 1701 can also dynamically adjust the shooting parameters of camera assembly 1706 based on the ambient light intensity collected by optical sensor 1713.
[0208] The proximity sensor 1714, also known as a distance sensor, is typically located on the front of the computer device 1700. The proximity sensor 1714 is used to detect the distance between the user and the front of the computer device 1700. In one embodiment, when the proximity sensor 1714 detects that the distance between the user and the front of the computer device 1700 is gradually decreasing, the processor 1701 controls the touchscreen display 1705 to switch from a screen-on state to a screen-off state; when the proximity sensor 1714 detects that the distance between the user and the front of the computer device 1700 is gradually increasing, the processor 1701 controls the touchscreen display 1705 to switch from a screen-off state to a screen-on state.
[0209] Those skilled in the art will understand that Figure 17 The structure shown does not constitute a limitation on the computer device 1700, and may include more or fewer components than shown, or combine certain components, or use different component arrangements.
[0210] This application also provides a computer device, which includes a processor and a memory. The memory stores at least one program, which is loaded and executed by the processor to implement the frame synchronization method provided in the above-described method embodiments.
[0211] This application also provides a computer-readable storage medium storing at least one computer program, which is loaded and executed by a processor to implement the frame synchronization method provided in the above-described method embodiments.
[0212] This application also provides a computer program product, which includes a computer program stored in a computer-readable storage medium; the computer program is read from and executed by a processor of a computer device from the computer-readable storage medium, causing the computer device to execute and implement the frame synchronization method provided in the above-described method embodiments.
[0213] It is understood that, in the specific embodiments of this application, the data involved, historical data, and user data processing related to user identity or characteristics, such as profiles, require user permission or consent when applied to specific products or technologies. Furthermore, the collection, use, and processing of related data must comply with the relevant laws, regulations, and standards of the relevant countries and regions.
[0214] It should be understood that "multiple" as used in this article refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. The character " / " generally indicates that the preceding and following related objects have an "or" relationship.
[0215] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.
[0216] The above description is merely an optional embodiment of this application and is not intended to limit this application. Any modifications, equivalent switching, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A frame synchronization method, characterized in that, The method is executed by a server in a game application, the server being connected to at least two clients, the method comprising: Based on the network connection method between the server and each of the at least two clients, determine the primary network protocol channel and the backup network protocol channel corresponding to each client; Receive frame synchronization data sent by at least one of the at least two clients; Based on the primary network protocol channel and the backup network protocol channel corresponding to each client, the frame synchronization data is synchronized to each client; The network connection method includes a WiFi network channel and / or a cellular network channel; determining the primary network protocol channel and backup network protocol channel corresponding to each client based on the network connection method between the server and each of the at least two clients includes: When the server and a third client among the at least two clients are simultaneously connected via the WiFi network channel and the cellular network channel, a primary network protocol channel corresponding to the third client is determined in the WiFi network channel, and a backup network protocol channel corresponding to the third client is determined in the cellular network channel; the primary network protocol channel is used to transmit the frame synchronization data, and the backup network protocol channel is used to transmit the frame synchronization data when the primary network protocol channel does not meet the transmission conditions.
2. The method according to claim 1, characterized in that, The step of determining the primary network protocol channel and backup network protocol channel corresponding to each client based on the network connection method between the server and each of the at least two clients further includes: When the server is connected to the first client among the at least two clients via the WiFi network channel, the primary network protocol channel and the backup network protocol channel corresponding to the first client are determined in the WiFi network channel. When the server is connected to a second client among the at least two clients via the cellular network channel, the primary network protocol channel and the backup network protocol channel corresponding to the second client are determined in the cellular network channel.
3. The method according to claim 2, characterized in that, The step of synchronizing the frame synchronization data to each client based on the primary network protocol channel and the backup network protocol channel corresponding to each client includes: Based on the primary network protocol channel and the backup network protocol channel corresponding to the first client in the WiFi network channel, the frame synchronization data is synchronized to the first client.
4. The method according to claim 3, characterized in that, The step of synchronizing the frame synchronization data to the first client based on the primary network protocol channel and the backup network protocol channel corresponding to the first client in the WiFi network channel includes: When the main network protocol channel corresponding to the first client in the WiFi network channel meets the transmission conditions, the frame synchronization data is synchronized to the first client based on the main network protocol channel corresponding to the first client in the WiFi network channel.
5. The method according to claim 4, characterized in that, The method further includes: When the primary network protocol channel corresponding to the first client in the WiFi network channel meets the transmission conditions, a heartbeat signal is sent to the first client based on the backup network protocol channel corresponding to the first client in the WiFi network channel. The heartbeat signal is used to measure the data transmission status of the backup network protocol channel.
6. The method according to claim 3, characterized in that, The step of synchronizing the frame synchronization data to the first client based on the primary network protocol channel and the backup network protocol channel corresponding to the first client in the WiFi network channel includes: When the primary network protocol channel corresponding to the first client in the WiFi network channel does not meet the transmission conditions, the frame synchronization data is synchronized to the first client based on the backup network protocol channel corresponding to the first client in the WiFi network channel.
7. The method according to claim 2, characterized in that, The step of synchronizing the frame synchronization data to each client based on the primary network protocol channel and the backup network protocol channel corresponding to each client includes: Based on the primary network protocol channel and the backup network protocol channel corresponding to the second client in the cellular network channel, the frame synchronization data is synchronized to the second client.
8. The method according to claim 7, characterized in that, The step of synchronizing the frame synchronization data to the second client based on the primary network protocol channel and the backup network protocol channel corresponding to the second client in the cellular network channel includes: When the main network protocol channel corresponding to the second client in the cellular network channel meets the transmission conditions, the frame synchronization data is synchronized to the second client based on the main network protocol channel corresponding to the second client in the cellular network channel.
9. The method according to claim 8, characterized in that, The method further includes: When the primary network protocol channel corresponding to the second client in the cellular network channel meets the transmission conditions, a heartbeat signal is sent to the second client based on the backup network protocol channel corresponding to the second client in the cellular network channel.
10. The method according to claim 7, characterized in that, The step of synchronizing the frame synchronization data to the second client based on the primary network protocol channel and the backup network protocol channel corresponding to the second client in the cellular network channel includes: When the primary network protocol channel corresponding to the second client in the cellular network channel does not meet the transmission conditions, the frame synchronization data is synchronized to the second client based on the backup network protocol channel corresponding to the second client in the cellular network channel.
11. The method according to claim 1, characterized in that, The method further includes: When the primary network protocol channel corresponding to the third client in the WiFi network channel meets the transmission conditions, a heartbeat signal is sent to the third client based on the backup network protocol channel corresponding to the third client in the cellular network channel.
12. The method according to any one of claims 1 to 11, characterized in that, The method further includes: In response to the usage status of the client, a switch is predicted between the primary network protocol channel and the backup network protocol channel for transmitting the frame synchronization data.
13. The method according to claim 12, characterized in that, The step of predicting and switching the network protocol channel for transmitting the frame synchronization data in the primary network protocol channel and the backup network protocol channel in response to the usage status of the client includes: Obtain the trend of motion state changes of the client; Based on the state change trend of the client's motion state, predict the switching of the network protocol channel for transmitting the frame synchronization data in the main network protocol channel and the backup network protocol channel; The state change trend is used to predict the client's motion state in the next moment.
14. The method according to claim 12, characterized in that, The step of predicting and switching the network protocol channel for transmitting the frame synchronization data in the primary network protocol channel and the backup network protocol channel in response to the usage status of the client includes: Obtain the network strength change trend of the client's location; Based on the network strength change trend of the client, predict the switching of the network protocol channel for transmitting the frame synchronization data in the main network protocol channel and the backup network protocol channel; The network strength change trend is used to predict the network strength of the client in the next moment.
15. The method according to claim 12, characterized in that, The step of predicting and switching the network protocol channel for transmitting the frame synchronization data in the primary network protocol channel and the backup network protocol channel in response to the usage status of the client includes: Obtain the historical usage status of the client; Based on the client's historical usage status, predict the switching of the network protocol channel for transmitting the frame synchronization data in the primary network protocol channel and the backup network protocol channel; The historical usage status is used to predict the client's usage status at the next moment.
16. A frame synchronization device, characterized in that, The device is used in a server of a game application, the server being connected to at least two clients, and the device includes: The determination module is used to determine the primary network protocol channel and the backup network protocol channel corresponding to each client based on the network connection method between the server and each of the at least two clients. A receiving module is configured to receive frame synchronization data sent by at least one of the at least two clients; The synchronization module is used to synchronize the frame synchronization data to each client based on the primary network protocol channel and the backup network protocol channel corresponding to each client; The network connection method includes a WiFi network channel and / or a cellular network channel. The determining module is configured to, when the server and a third client among the at least two clients are simultaneously connected via the WiFi network channel and the cellular network channel, determine a primary network protocol channel corresponding to the third client in the WiFi network channel, and determine a backup network protocol channel corresponding to the third client in the cellular network channel. The primary network protocol channel is used to transmit the frame synchronization data, and the backup network protocol channel is used to transmit the frame synchronization data when the primary network protocol channel does not meet the transmission conditions.
17. The apparatus according to claim 16, characterized in that, The determining module is configured to, when the server is connected to the first client among the at least two clients via the WiFi network channel, determine the primary network protocol channel and the backup network protocol channel corresponding to the first client in the WiFi network channel; The determining module is configured to, when the server is connected to the second client among the at least two clients via the cellular network channel, determine the primary network protocol channel and the backup network protocol channel corresponding to the second client in the cellular network channel.
18. The apparatus according to claim 17, characterized in that, The synchronization module is used to synchronize the frame synchronization data to the first client based on the main network protocol channel and the backup network protocol channel corresponding to the first client in the WiFi network channel.
19. The apparatus according to claim 18, characterized in that, The synchronization module is used to synchronize the frame synchronization data to the first client based on the main network protocol channel corresponding to the first client in the WiFi network channel when the transmission conditions are met.
20. The apparatus according to claim 19, characterized in that, The synchronization module is used to send a heartbeat signal to the first client based on the backup network protocol channel corresponding to the first client in the WiFi network channel when the main network protocol channel corresponding to the first client in the WiFi network channel meets the transmission conditions; The heartbeat signal is used to measure the data transmission status of the backup network protocol channel.
21. The apparatus according to claim 18, characterized in that, The synchronization module is used to synchronize the frame synchronization data to the first client based on the backup network protocol channel corresponding to the first client in the WiFi network channel when the main network protocol channel corresponding to the first client in the WiFi network channel does not meet the transmission conditions.
22. The apparatus according to claim 17, characterized in that, The synchronization module is used to synchronize the frame synchronization data to the second client based on the primary network protocol channel and the backup network protocol channel corresponding to the second client in the cellular network channel.
23. The apparatus according to claim 22, characterized in that, The synchronization module is used to synchronize the frame synchronization data to the second client based on the main network protocol channel corresponding to the second client in the cellular network channel when the transmission conditions are met.
24. The apparatus according to claim 23, characterized in that, The synchronization module is used to send a heartbeat signal to the second client based on the backup network protocol channel corresponding to the second client in the cellular network channel when the primary network protocol channel corresponding to the second client in the cellular network channel meets the transmission conditions.
25. The apparatus according to claim 22, characterized in that, The synchronization module is used to synchronize the frame synchronization data to the second client based on the backup network protocol channel corresponding to the second client in the cellular network channel when the primary network protocol channel corresponding to the second client in the cellular network channel does not meet the transmission conditions.
26. The apparatus according to claim 16, characterized in that, The synchronization module is used to send a heartbeat signal to the third client based on the backup network protocol channel corresponding to the third client in the cellular network channel when the main network protocol channel corresponding to the third client in the WiFi network channel meets the transmission conditions.
27. The apparatus according to any one of claims 16 to 26, characterized in that, The prediction module is used to predict the switching of the network protocol channel for transmitting the frame synchronization data in the primary network protocol channel and the backup network protocol channel in response to the usage status of the client.
28. The apparatus according to claim 27, characterized in that, The acquisition module is used to acquire the trend of motion state changes of the client. The prediction module is used to predict the network protocol channel for switching the transmission of the frame synchronization data in the main network protocol channel and the backup network protocol channel based on the state change trend of the motion state of the client. The state change trend is used to predict the client's motion state in the next moment.
29. The apparatus according to claim 27, characterized in that, The acquisition module is used to acquire the network strength change trend of the client's location; The prediction module is used to predict, based on the network strength change trend of the client, the network protocol channel for switching the transmission of the frame synchronization data in the primary network protocol channel and the backup network protocol channel. The network strength change trend is used to predict the network strength of the client in the next moment.
30. The apparatus according to claim 27, characterized in that, The acquisition module is used to acquire the historical usage status of the client; The prediction module is used to predict, based on the client's historical usage status, the network protocol channel for switching the transmission of the frame synchronization data in the primary network protocol channel and the backup network protocol channel. The historical usage status is used to predict the client's usage status at the next moment.
31. A computer device, characterized in that, The computer device includes a processor and a memory, wherein the memory stores at least one computer program, and the at least one computer program is loaded and executed by the processor to implement the frame synchronization method as described in any one of claims 1 to 15.
32. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores at least one computer program, which is loaded and executed by a processor to implement the frame synchronization method as described in any one of claims 1 to 15.
33. A computer program product, characterized in that, The computer program product includes a computer program stored in a computer-readable storage medium; the computer program is read from and executed by a processor of a computer device, causing the computer device to perform the frame synchronization method as described in any one of claims 1 to 15.
Citation Information
Patent Citations
Online game method of mobile communication terminal
CN107438077A
Video frame synchronization method, terminal, server, electronic equipment and storage medium
CN115334322A