Frame data sending method and device, server and storage medium
By introducing the game viewing service process into the game system to handle the reception and sending of frame data for game matches, the problem of high database query pressure is solved and the game running speed is improved.
Patent Information
- Application Number
- CN202310305268.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-20
- Publication Date
- 2024-09-20
AI Technical Summary
In the existing technology, the lobby service process needs to frequently query the database to obtain the frame data of the game, resulting in high pressure on the database and affecting the overall running speed of the game.
By introducing the spectator service process, it is responsible for receiving data acquisition requests from the lobby service process, sending registration requests to the match service process, and passing the frame data after receiving it from the match service process to the lobby service process to avoid querying data directly from the database.
It reduces the query pressure on the database and improves the query speed and overall running speed of the game.
Smart Images

Figure CN118662912A
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of program development technology, and in particular to a frame data sending method, device, server and storage medium. Background Art
[0002] Game-related application development technology has been developing and improving over the past century.
[0003] In the related art, the game service process sends all the frame data of the game to the database, and the database stores the frame data of the game; the lobby service process queries the frame data of the game from the database, and then sends the frame data of the game to the client requesting to watch the game.
[0004] In the above-mentioned related technologies, the lobby service process needs to frequently query the database to request the spectating client to send the frame data of the game, and the query pressure on the database is relatively large. Summary of the invention
[0005] The embodiments of the present application provide a frame data sending method, device, server and storage medium, which can reduce the pressure on the database. The technical solution is as follows:
[0006] According to one aspect of an embodiment of the present application, a frame data sending method is provided, the method being executed by a spectator service process, the method comprising:
[0007] receiving a data acquisition request for a first game match sent by a lobby service process, wherein the data acquisition request is used to request to acquire frame data of the first game match;
[0008] Sending a first registration request to a game service process corresponding to the first game game, where the first registration request is used to request the game service process corresponding to the first game game to send frame data of the first game game to the spectator service process;
[0009] Receiving frame data of the first game game sent by a game service process corresponding to the first game game;
[0010] The frame data of the first game match is sent to the lobby service process, and the frame data of the first game match is provided by the lobby service process to at least one first client for display.
[0011] According to one aspect of an embodiment of the present application, a frame data sending method is provided, the method being executed by a lobby service process, the method comprising:
[0012] Receiving a request for watching a first game from a first client;
[0013] Sending a data acquisition request for the first game match to the spectator service process, where the data acquisition request is used to request to acquire frame data of the first game match;
[0014] receiving frame data of the first game match sent by the spectator service process; wherein the frame data of the first game match is sent by the game service process corresponding to the first game match to the spectator service process after the spectator service process registers with the game service process corresponding to the first game match;
[0015] Send frame data of the first game match to the first client.
[0016] According to one aspect of an embodiment of the present application, a frame data sending method is provided, the method being executed by a game service process, the method comprising:
[0017] receiving a first registration request sent by a spectator service process, wherein the first registration request is used to request the game service process to send frame data of a first game game to the spectator service process; wherein the first registration request is sent by the spectator service process after receiving a data acquisition request for the first game game sent by the lobby service process;
[0018] The frame data of the first game match is sent to the spectator service process, and the frame data of the first game match is sent by the spectator service process to the lobby service process, and provided by the lobby service process to at least one first client for display.
[0019] According to one aspect of an embodiment of the present application, a frame data sending device is provided, the device comprising:
[0020] A receiving module, used to receive a data acquisition request for a first game game sent by a lobby service process, wherein the data acquisition request is used to request to acquire frame data of the first game game;
[0021] a sending module, configured to send a first registration request to a game service process corresponding to the first game game, wherein the first registration request is used to request the game service process corresponding to the first game game to send frame data of the first game game to the spectator service process;
[0022] The receiving module is further configured to receive frame data of the first game game sent by a game service process corresponding to the first game game;
[0023] The sending module is further used to send the frame data of the first game match to the lobby service process, and the frame data of the first game match is provided by the lobby service process to at least one first client for display.
[0024] According to one aspect of an embodiment of the present application, a frame data sending device is provided, the device comprising:
[0025] A receiving module, configured to receive a spectator request for a first game game sent by a first client;
[0026] A sending module, used for sending a data acquisition request for the first game match to the spectator service process, wherein the data acquisition request is used for requesting to acquire frame data of the first game match;
[0027] The receiving module is further configured to receive frame data of the first game match sent by the spectator service process; wherein the frame data of the first game match is sent by the game service process corresponding to the first game match to the spectator service process after the spectator service process registers with the game service process corresponding to the first game match;
[0028] The sending module is further used to send frame data of the first game match to the first client.
[0029] According to one aspect of an embodiment of the present application, a frame data sending device is provided, the device comprising:
[0030] a receiving module, configured to receive a first registration request sent by a spectator service process, wherein the first registration request is used to request the game service process to send frame data of a first game game to the spectator service process; wherein the first registration request is sent by the spectator service process after receiving a data acquisition request for the first game game sent by the lobby service process;
[0031] The sending module is used to send the frame data of the first game match to the spectator service process, and the frame data of the first game match is sent by the spectator service process to the lobby service process, and provided by the lobby service process to at least one first client for display.
[0032] According to one aspect of an embodiment of the present application, a server is provided, the server comprising a processor and a memory, the memory storing a computer program, the computer program being loaded and executed by the processor to implement the above-mentioned frame data sending method.
[0033] According to one aspect of an embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored. The computer program is loaded and executed by a processor to implement the above-mentioned frame data sending method.
[0034] According to one aspect of an embodiment of the present application, a computer program product is provided, the computer program product comprising a computer program, the computer program being stored in a computer-readable storage medium. A processor of a server reads the computer program from the computer-readable storage medium, and the processor executes the computer program, so that the server executes the above-mentioned frame data sending method.
[0035] The technical solution provided by the embodiments of the present application may have the following beneficial effects:
[0036] By using a spectator service process to specifically handle some processes related to game matches, for example, the spectator service process can realize the reception and transmission of frame data of game matches. The lobby service process can obtain the frame data of the game matches that need to be watched from the spectator service process without querying the database, thereby reducing the query pressure on the database.
[0037] In addition, since the query pressure on the database is reduced, the query speed of other processes that also need to query the database is improved, thereby improving the overall running speed of the game.
[0038] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 is a schematic diagram of a frame data sending system provided by an embodiment of the present application;
[0040] Figure 2 It is a schematic diagram of an implementation environment of a solution provided by an embodiment of the present application;
[0041] Figure 3 is a flowchart of a frame data sending method provided by an embodiment of the present application;
[0042] Figure 4 This is a schematic diagram of an interface provided by an embodiment of the present application;
[0043] Figure 5 is a flowchart of a frame data sending method provided by another embodiment of the present application;
[0044] Figure 6 is a flowchart of a frame data sending method provided by another embodiment of the present application;
[0045] Figure 7 is a block diagram of a frame data sending device provided by an embodiment of the present application;
[0046] Figure 8 is a block diagram of a frame data sending device provided by another embodiment of the present application;
[0047] Fig. 9 is a block diagram of a frame data sending device provided by another embodiment of the present application;
[0048] Fig.10 This is a block diagram of a server provided by an embodiment of the present application. DETAILED DESCRIPTION
[0049] Exemplary embodiments will be described in detail herein, examples of which are shown 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 implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of methods consistent with some aspects of the present application as detailed in the appended claims.
[0050] Please refer to Figure 1 , which shows a frame data sending system provided by an embodiment of the present application. Figure 1 As shown, the system 100 includes a lobby service process cluster 11, a spectator service process cluster 12, a game service process cluster 13 and a client cluster 14.
[0051] The lobby service process cluster 11 includes at least one lobby service process, the spectator service process cluster 12 includes at least one spectator service process, the game service process cluster 13 includes at least one game service process, and the client cluster 14 includes at least one client. The spectator service process cluster 12 pulls the frame data of the game from the game service process cluster 13, and then sends the frame data of the game to the lobby service process cluster 11, and the lobby service process cluster 11 sends the frame data of the game to the client requesting to spectate the game, such as the first client 141 in the client cluster 14.
[0052] In an embodiment of the present application, in a game viewing scenario, the viewing service process cluster 12 replaces the database in the frame data sending system, and the viewing service process cluster 12 specifically handles some processes related to the game match. The lobby service process can obtain the frame data of the game match to be viewed from the viewing service process without querying the database, thereby reducing the query pressure on the database.
[0053] Please refer to Figure 2 , which shows a schematic diagram of an implementation environment provided by an embodiment of the present application, and the implementation environment can be implemented as a frame data sending system. Figure 2 As shown, the system 200 may include: a first server 16 , a second server 17 , a third server 18 and a first terminal device 191 .
[0054] The first terminal device 191 has a target application installed and running, such as a client of the target application (such as Figure 1 The client 141 shown). Optionally, a user account is logged in to the client. The terminal device is an electronic device with data calculation, processing and storage capabilities. The terminal device can be a smart phone, a tablet computer, a PC (Personal Computer), a wearable device, etc., which is not limited to this embodiment of the present application. The target application can be a game application, such as a shooting game application, a multiplayer gun battle survival game application, a battle royale survival game application, an LBS (Location Based Service) game application, a MOBA (Multiplayer Online Battle Arena) game application, etc., which is not limited to this embodiment of the present application. The target application can also be a social application, a payment application, a video application, a music application, a shopping application, a news application, or any other application with a frame data sending function.
[0055] The first server 16 is used to carry the above-mentioned lobby service process, the second server 17 is used to carry the above-mentioned spectator service process, and the third server 18 is used to carry the above-mentioned game service process. In some embodiments, communication connections are established between the first terminal device 191 and the first server 16, between the first server 16 and the second server 17, and between the second server 17 and the third server 18, respectively, and the first server 16, the second server 17 and the third server 18 provide background services for the target application. In some embodiments, the server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud computing services, which is not specifically limited in the embodiments of the present application. In some embodiments, the above-mentioned first server 16 and the second server 17 can be different servers, or they can be located in the same server, which is not specifically limited in the embodiments of the present application.
[0056] The frame data sending method provided in the embodiment of the present application can be implemented by the frame data sending system 200 composed of the above-mentioned first server 16, second server 17, third server 18 and first terminal device 191.
[0057] In some embodiments, the system 200 further includes a second terminal device 192, in which a target application is installed and running, such as a client of the target application (eg, Figure 1A communication connection is established between the second terminal device 192 and the first server 16, and the client in the second terminal device 192 is used to report any irregularities in the game.
[0058] The technical solution of the present application is introduced and explained below through several embodiments.
[0059] Please refer to Figure 3 , which shows a flow chart of a method for sending frame data provided by an embodiment of the present application. In this embodiment, the method is applied to the above Figure 1 or Figure 2 The frame data transmission system introduced is used as an example to illustrate. The method may include the following steps (310-360):
[0060] Step 310: the lobby service process receives a request for watching a first game from a first client.
[0061] In some embodiments, the first client is a client of the target application, and the lobby service process is one of the multiple processes that provide background services for the target application. In some embodiments, the lobby service process can be called a Zoneserver (Zonesvr for short), or a game lobby server, which is the main communication process instance after the user successfully logs in. In some embodiments, the interface currently displayed by the first client is the interface of the game lobby, and at this time, the lobby service process corresponding to the first client can provide background services for it.
[0062] like Figure 4 As shown, a spectator control 21 for the first game game is displayed in the first client. In response to a trigger operation on the spectator control 21, a prompt message 22 is displayed, and the prompt message 22 is used to reconfirm whether the user corresponding to the first client wants to spectate the first game game; in response to a reconfirmation operation on the prompt message 22 (such as a trigger operation on the confirmation control 23 in the prompt message 22), the first client sends a spectator request for the first game game to the lobby service process corresponding to the first client; after the spectator request is accepted, the game screen 24 of the first game game can be displayed in the first client.
[0063] In some embodiments, while displaying the game screen 24 of the first game, the sound of the first game is also emitted synchronously. In some embodiments, the first game is a game played by an account associated with the account corresponding to the first client. In this case, the game screen 24 of the first game can be displayed according to the game perspective corresponding to the account associated with the account corresponding to the first client.
[0064] In some embodiments, considering that the game is generally not very intense at the beginning stage, the spectator control 21 for the first game will not be displayed in the first client within a first period of time after the start of the first game; the spectator control 21 for the first game will be displayed in the first client after the first period of time after the start of the first game, thereby preventing the user corresponding to the spectator client from seeing the game screen at the beginning of the game.
[0065] In some embodiments, Figure 4 As described above, during the process of watching the first game, the first client may also display a victory screen 25 after the first game, a data comparison screen 26 of the first game, etc., which is not specifically limited in this embodiment of the present application.
[0066] In some embodiments, the user corresponding to the first client can choose to play the first game at a multiple speed (such as 0.5x, 0.75x, 1.25x, 1.5x, 2x, 3x, etc.) during the viewing process; the user corresponding to the first client can also jump forward or backward to the first game by dragging the progress bar or clicking the position to which the progress bar wants to jump during the viewing process; of course, the user corresponding to the first client can also switch the viewing perspective and exit the viewing by clicking the exit control.
[0067] Step 320: The lobby service process sends a data acquisition request for the first game match to the spectator service process.
[0068] In some embodiments, the data acquisition request is used to request frame data of the first game match. After receiving the spectator request for the first game match sent by the first client, the lobby service process generates a data acquisition request for the first game match based on the spectator request, and sends the data acquisition request to the spectator service process.
[0069] In some embodiments, the spectator service process may be called WatchProxy, or may be called a game spectator service, which is a process instance used by users to spectate games.
[0070] In some embodiments, the frame data includes operation frame data of users in the first game match in the first game match, refresh data of random items in the first game match, and the like.
[0071] Step 330: The spectator service process sends a first registration request to the game service process corresponding to the first game game.
[0072] In some embodiments, the game service process can be called Roomserver (Room svr for short), or it can be called a game battlefield server. It is the process instance where the user plays the game, and communicates directly with the user's corresponding client through the User Datagram Protocol (UDP).
[0073] In some embodiments, the first registration request is used to request the game service process corresponding to the first game game to send frame data of the first game game to the spectator service process. After receiving the data acquisition request for the first game game sent by the lobby service process, if the spectator service process has not registered with the game service process corresponding to the first game game, the spectator service process cannot obtain the frame data of the first game game.
[0074] In some embodiments, if the spectator service process has not yet registered with the game service process corresponding to the first game match, the spectator server does not know which game service process corresponds to the first game match, so after receiving the data acquisition request for the first game match sent by the lobby service process, the server needs to first query and obtain the game service process corresponding to the first game match from the database; wherein the database records the game service process corresponding to at least one game match. In some embodiments, what the spectator server obtains from the database is the link or address of the game service process corresponding to the first game match, and the database records the link and / or address of the game service process corresponding to at least one game match.
[0075] In some embodiments, after the game service process corresponding to the first game game receives the first registration request sent by the spectator service process, a spectator flag is set, where the spectator flag is used to indicate that frame data of the first game game is sent to the spectator service process.
[0076] Step 340: The game service process sends frame data of the first game to the spectator service process.
[0077] In some embodiments, after the first registration request is accepted and the registration is successful, the game service process sends frame data of the first game game to the spectator service process.
[0078] In some embodiments, the time when the spectator request is responded to is later than the start time of the first game game, and the frame data of the first game game generated between these two time points can be referred to as the historical frame data of the first game game; the frame data of the first game game generated when the spectator request is responded to (i.e., the spectator request is accepted) can be referred to as the latest frame data of the first game game.
[0079] In some embodiments, the game service process pushes the frame data of the first game match generated before the spectator request is responded to to the spectator service process in a single thread.
[0080] For the frame data of the first game match generated after the spectator request is responded to, the game service process broadcasts it to at least one spectator service process including the spectator service process. Optionally, the broadcast process may be broadcast once every first interval, and the broadcast object may be all spectator service processes, so that the spectator service process that needs to obtain the frame data of the first game match can receive the frame data of the first game match broadcasted by the game service process; the spectator service process that does not need to obtain the frame data of the first game match refuses to receive or cannot receive the frame data of the first game match broadcasted by the game service process. Optionally, the broadcast object may be all spectator service processes that need to obtain the frame data of the first game match.
[0081] In the above embodiment, since other spectator service processes that have previously registered on the game service process corresponding to the first game have already obtained the frame data of the first game generated before the above spectator request is responded to (i.e., the historical frame data of the first game), there is no need to obtain it again. Therefore, the game service process only needs to push the frame data of the first game generated before the spectator request is responded to directly to the newly registered spectator service process. The frame data of the first game generated after the above spectator request is responded to (i.e., the latest frame data of the first game) is new data for all spectator service processes and has not been obtained. Therefore, the game service process can broadcast the latest frame data of the first game to all spectator service processes that need to obtain the frame data of the first game at one time without sending them one by one, thereby improving the data transmission efficiency of the game service process.
[0082] In some embodiments, for the game service process, pushing the historical frame data of the first game game and broadcasting the latest frame data of the first game game can be performed simultaneously.
[0083] In some embodiments, if the game service process crashes, a new game service process can be selected to restore the frame data of the first game from the cache to continue to provide background services for the first game.
[0084] Step 350: The spectator service process sends frame data of the first game to the lobby service process.
[0085] In some embodiments, after receiving the frame data of the first game game sent by the game service process, the spectator service process sends the frame data of the first game game to the lobby service process registered on the spectator service process.
[0086] Step 360: The lobby service process sends frame data of the first game match to the first client.
[0087] In some embodiments, after the lobby service process receives the frame data of the first game game sent by the spectator service process, the lobby service process sends the frame data of the first game game to the first client according to the identifier of the first client carried in the spectator request.
[0088] In some embodiments, the frame data of the first game match is provided by the lobby service process to at least one first client for display. There may be multiple clients that have sent spectator requests for the first game match to the lobby service process. After receiving the frame data of the first game match sent by the spectator service process, the lobby service process sends the frame data of the first game match to the multiple clients.
[0089] In some embodiments, the client that receives the frame data of the first game game can display the game screen of the first game game and synchronously emit the sound of the first game game.
[0090] In summary, the technical solution provided by the embodiment of the present application adopts a spectator service process to specifically handle some processes related to game matches. For example, the spectator service process is used to receive and send frame data of game matches. The lobby service process can obtain the frame data of the game matches that need to be watched from the spectator service process without querying the database, thereby reducing the query pressure on the database.
[0091] In addition, since the query pressure on the database is reduced, the query speed of other processes that also need to query the database is improved, thereby improving the overall running speed of the game.
[0092] In some possible implementations, after receiving the data acquisition request for the first game game sent by the lobby service process (i.e., after the above step 320), it also includes: when there is frame data of the first game game in the cache corresponding to the spectator service process, the spectator service process obtains the frame data of the first game game from the cache; when there is no frame data of the first game game in the cache corresponding to the spectator service process, the spectator service process starts from the step of sending a first registration request to the game service process corresponding to the first game game.
[0093] In this implementation, after receiving the data acquisition request for the first game match sent by the lobby service process, if the frame data of the first game match exists in the cache corresponding to the spectator service process, it means that the spectator service process has been registered with the corresponding game service process, and the spectator service process can continuously obtain the frame data of the first game match sent by the corresponding game service process. The spectator service process does not need to register with the game service process again, and can directly send the frame data of the first game match in the cache to the lobby service process, thereby avoiding unnecessary signaling interaction between the spectator service process and the game service process, and saving the signaling overhead of the spectator service process and the game service process.
[0094] In some possible implementations, after the lobby service process receives a spectator request for the first game game sent by the first client, if the lobby service process has not yet registered on the spectator service process, the lobby service process sends a second registration request to the spectator service process, and the second registration request is used to request the spectator service process to record the spectator room created by the lobby service process for the first game game; wherein the spectator service process is used to send frame data of the first game game to at least one lobby service process that has created a spectator room for the first game game.
[0095] In this implementation, after the lobby service process creates a viewing room for watching the first game game, a second registration request is sent to the viewing service process so that the viewing service process obtains the frame data of the first game game, and then the frame data of the first game game is sent to the lobby service process, so that the lobby service process obtains the frame data of the first game game.
[0096] In some embodiments, the spectator service process receives a de-registration request sent by the lobby service process, where the de-registration request is used to request the spectator service process to cancel the record of the spectator room created by the lobby service process for the first game match; wherein the de-registration request is sent by the lobby service process when the number of spectators in the spectator room created by itself for the first game match is 0.
[0097] In some possible implementations, when the number of spectators in the viewing room for the first game game created by the lobby service process is 0, it means that there are currently no users watching the first game game through the viewing room, and the viewing room is currently empty. Therefore, the viewing service process does not need to send frame data of the first game game to the lobby service process, thereby saving transmission resources.
[0098] In some possible implementations, when the number of viewing rooms created for the first game match recorded by the viewing service process is 0, a first timer is started; when a first duration corresponding to the first timer is reached, frame data of the first game match stored in a cache corresponding to the viewing service process is cleared.
[0099] In this implementation, after receiving the anti-registration request sent by the lobby service process or at every second interval, the spectator service process determines whether the number of spectator rooms created for the first game match recorded on the spectator service process is 0. If so, the first timer is started; if not, the first timer is not started. If the first duration (such as 3 minutes, 5 minutes, 8 minutes, 10 minutes, etc.) corresponding to the first timer is reached, it means that no client (i.e., the user corresponding to the client) has requested to spectate the first game match for a long time, then the frame data of the first game match stored in the cache corresponding to the spectator service process can be cleared (or released), thereby clearing useless cache occupancy, freeing up cache space for users to cache other data, and improving cache utilization.
[0100] In some possible implementations, the spectator service process receives a game end notification sent by a game service process corresponding to the first game game, where the game end notification is used to indicate the end of the first game game; the spectator service process records an end flag corresponding to the first game game, and starts a second timer; when a second duration corresponding to the second timer arrives, the spectator service process clears the data maintained by the spectator service process for the first game game.
[0101] In this implementation, after the first game game ends, the game service process corresponding to the first game game sends a game end notification to the spectator service process. If the lobby service process wants to know the status of the first game game, the spectator service process can send a notification that the first game game has ended to the lobby service process; the game service process corresponding to the first game game can immediately release the first game game (i.e., delete the data about the first game game in the process) after the first game game ends, without having to handle other matters, thereby improving the utilization rate of the game service process.
[0102] In this implementation, after the first game game ends, the spectator service process does not immediately clear the data maintained by the spectator service process for the first game game, but instead starts a second timer and waits for a period of time (i.e., a second time length) before clearing the data maintained by the spectator service process for the first game game, thereby giving the user corresponding to the spectator client a certain amount of time to calm down and review the first game game, such as reviewing the exciting moments or key operations in the first game game, thereby maintaining the user's viewing experience as much as possible.
[0103] In some possible implementations, such as Figure 1 As shown, the method also includes the following steps:
[0104] 1. The game service process 13 sends the frame data of the first game game to the replay file management process 15.
[0105] The replay file management process 15 is used to generate a corresponding replay file according to the frame data of the game match. For example, the replay file management process 15 generates a replay file of the first game match according to the frame data of the first game match.
[0106] 2. In response to receiving the report information from the second client 142 , the lobby service process 11 sends a file acquisition request to the replay file management process 15 .
[0107] Among them, the reporting information is used to report the existence of violations in the first game game, and the file acquisition request is used to request to obtain the replay file of the first game game, and the replay file of the first game game is generated based on the frame data of the first game game.
[0108] 3. The lobby service process 11 receives the replay file of the first game game sent by the replay file management process 15.
[0109] 4. The lobby service process 11 replays the replay file of the first game to determine whether the reported information is true.
[0110] In some embodiments, the replay file may be referred to as a relay file.
[0111] In this implementation, through the replay file management process, the reported game games can be replayed and the relevant evidence can be saved, which is conducive to maintaining the fairness of the game games.
[0112] In some embodiments, Figure 5 As shown, the method for sending frame data may further include the following steps:
[0113] Step 501: A first client sends a spectator request for a first game match to a lobby service process.
[0114] Step 502: The lobby service process creates a spectator room for the first game match.
[0115] Step 503: the lobby service process sends a data acquisition request to the spectator service process.
[0116] Step 504: The spectator service process queries the database to obtain the game service process corresponding to the first game.
[0117] Step 505: The spectator service process checks the status of the spectator room for the first game match created by the lobby service process.
[0118] Step 506: The spectator service process sends a first registration request to the opponent service process.
[0119] Step 507: The game service process sets a spectator flag for the spectator service process.
[0120] Step 508: The game service process pushes the historical frame data of the first game to the spectator service process.
[0121] Step 509: the game service process broadcasts the latest frame data of the first game to the spectator service process.
[0122] Step 510: The spectator service process sends frame data of the first game to the lobby service process.
[0123] Step 511: The lobby service process sends frame data of the first game match to the first client.
[0124] In some embodiments, Figure 6 As shown, the method for sending frame data may further include the following steps:
[0125] Step 601: The first client sends a spectator request for a first game match to the lobby service process.
[0126] Step 602: The lobby service process creates a spectator room for the first game match.
[0127] Step 603: The lobby service process sends a second registration request to the spectator service process.
[0128] Step 604: The first client sends a request to the lobby service process to exit the viewing room of the first game match.
[0129] Step 605: The lobby service process checks the remaining number of people in the spectator room of the first game match created by itself.
[0130] Step 606: When the number of remaining people in the spectator room of the first game match created by the lobby service process itself is less than 0, the lobby service process sends a de-registration request to the spectator service process.
[0131] Step 607, the spectator service process determines whether the number of spectator rooms for the first game match registered in its own process is 0, and if so, executes step 608;
[0132] Step 608: The spectator service process releases the frame data of the first game with a delayed release.
[0133] In some embodiments, delayed release of frame data of the first game game includes: when the number of viewing rooms created for the first game game recorded by the viewing service process is 0, starting a first timer; when a first duration corresponding to the first timer is reached, clearing the frame data of the first game game stored in the cache corresponding to the viewing service process.
[0134] Step 609: The game service process corresponding to the first game game sends a game end notification to the spectator service process.
[0135] Step 610: The spectator service process records an end flag corresponding to the first game match.
[0136] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.
[0137] Please refer to Figure 7 , which shows a block diagram of a frame data sending device provided by an embodiment of the present application. The device has the function of implementing the above-mentioned frame data sending method example, and the function can be implemented by hardware, or by hardware executing corresponding software. The device 700 may include: a receiving module 710 and a sending module 720.
[0138] The receiving module 710 is used to receive a data acquisition request for a first game game sent by the lobby service process, where the data acquisition request is used to request to acquire frame data of the first game game;
[0139] A sending module 720 is used to send a first registration request to the game service process corresponding to the first game game, where the first registration request is used to request the game service process corresponding to the first game game to send frame data of the first game game to the spectator service process;
[0140] The receiving module 710 is further configured to receive frame data of the first game game sent by a game service process corresponding to the first game game;
[0141] The sending module 720 is further used to send the frame data of the first game match to the lobby service process, and the frame data of the first game match is provided by the lobby service process to at least one first client for display.
[0142] In some embodiments, the apparatus 700 is further configured to:
[0143] If frame data of the first game match exists in the cache corresponding to the spectator service process, acquiring the frame data of the first game match from the cache;
[0144] When there is no frame data of the first game match in the cache corresponding to the spectator service process, execution starts from the step of sending a first registration request to the match service process corresponding to the first game match.
[0145] In some embodiments, the sending module 720 is used to query and obtain the game service process corresponding to the first game game from a database; wherein the database records at least one game service process corresponding to each game game.
[0146] In some embodiments, the apparatus 700 is further configured to:
[0147] receiving a second registration request sent by the lobby service process, where the second registration request is used to request the spectator service process to record a spectator room created by the lobby service process for the first game match;
[0148] The spectator service process is used to send frame data of the first game game to at least one lobby service process that has created the spectator room for the first game game.
[0149] In some embodiments, the apparatus 700 is further configured to:
[0150] receiving a deregistration request sent by the lobby service process, wherein the deregistration request is used to request the spectator service process to cancel recording of the spectator room created by the lobby service process for the first game match;
[0151] The anti-registration request is sent by the lobby service process when the number of spectators in the spectator room created by itself for the first game match is 0.
[0152] In some embodiments, the apparatus 700 is further configured to:
[0153] When the number of spectator rooms created for the first game match recorded by the spectator service process is 0, starting a first timer;
[0154] When a first duration corresponding to the first timer is reached, the frame data of the first game match stored in the cache corresponding to the spectator service process is cleared.
[0155] In some embodiments, the apparatus 700 is further configured to:
[0156] Receiving a game end notification sent by a game service process corresponding to the first game game, wherein the game end notification is used to indicate that the first game game is ended;
[0157] Recording the end mark corresponding to the first game match, and starting a second timer;
[0158] When the second duration corresponding to the second timer is reached, the data maintained by the spectator service process for the first game match is cleared.
[0159] In summary, the technical solution provided by the embodiment of the present application adopts a spectator service process to specifically handle some processes related to game matches. For example, the spectator service process is used to receive and send frame data of game matches. The lobby service process can obtain the frame data of the game matches that need to be watched from the spectator service process without querying the database, thereby reducing the query pressure on the database.
[0160] Please refer to Figure 8 , which shows a block diagram of a frame data sending device provided by an embodiment of the present application. The device has the function of implementing the above-mentioned frame data sending method example, and the function can be implemented by hardware, or by hardware executing corresponding software. The device 800 may include: a receiving module 810 and a sending module 820.
[0161] The receiving module 810 is configured to receive a spectator request for a first game game sent by a first client;
[0162] A sending module 820 is used to send a data acquisition request for the first game match to the spectator service process, where the data acquisition request is used to request to acquire frame data of the first game match;
[0163] The receiving module 810 is further configured to receive frame data of the first game match sent by the spectator service process; wherein the frame data of the first game match is sent by the game service process corresponding to the first game match to the spectator service process after the spectator service process registers with the game service process corresponding to the first game match;
[0164] The sending module 820 is further configured to send frame data of the first game match to the first client.
[0165] In some embodiments, the apparatus 800 is further configured to:
[0166] Creating a spectator room for the first game;
[0167] Sending a second registration request to the spectator service process, where the second registration request is used to request the spectator service process to record a spectator room created by the lobby service process for the first game match;
[0168] The spectator service process is used to send frame data of the first game game to at least one lobby service process that has created the spectator room for the first game game.
[0169] In some embodiments, the apparatus 800 is further configured to:
[0170] Sending a deregistration request to the spectator service process, wherein the deregistration request is used to request the spectator service process to cancel recording of the spectator room created by the lobby service process for the first game match;
[0171] The anti-registration request is sent by the lobby service process when the number of spectators in the spectator room created by itself for the first game match is 0.
[0172] In some embodiments, the apparatus 800 is further configured to:
[0173] In response to receiving the report information from the second client, sending a file acquisition request to the replay file management process, wherein the report information is used to report the existence of illegal behavior in the first game game, and the file acquisition request is used to request to obtain a replay file of the first game game, where the replay file of the first game game is generated according to the frame data of the first game game;
[0174] receiving a replay file of the first game game sent by the replay file management process;
[0175] Replay the replay file of the first game game to determine whether the reported information is true.
[0176] In summary, the technical solution provided by the embodiment of the present application adopts a spectator service process to specifically handle some processes related to game matches. For example, the spectator service process is used to receive and send frame data of game matches. The lobby service process can obtain the frame data of the game matches that need to be watched from the spectator service process without querying the database, thereby reducing the query pressure on the database.
[0177] Please refer to Fig. 9 , which shows a block diagram of a frame data sending device provided by an embodiment of the present application. The device has the function of implementing the above-mentioned frame data sending method example, and the function can be implemented by hardware or by hardware executing corresponding software. The device 900 may include: a receiving module 910 and a sending module 920.
[0178] The receiving module 910 is used to receive a first registration request sent by the spectator service process, where the first registration request is used to request the game service process to send frame data of a first game game to the spectator service process; wherein the first registration request is sent by the spectator service process after receiving a data acquisition request for the first game game sent by the lobby service process;
[0179] The sending module 920 is used to send the frame data of the first game match to the spectator service process. The frame data of the first game match is sent by the spectator service process to the lobby service process, and provided by the lobby service process to at least one first client for display.
[0180] In some embodiments, the apparatus 900 is further configured to:
[0181] When the first game is over, sending a game end notification to the spectator service process, where the game end notification is used to indicate that the first game is over;
[0182] Release the game service process.
[0183] In some embodiments, the apparatus 900 is further configured to:
[0184] Sending frame data of the first game to the replay file management process;
[0185] The replay file management process is used to generate corresponding replay files based on the frame data of the game.
[0186] In summary, the technical solution provided by the embodiment of the present application adopts a spectator service process to specifically handle some processes related to game matches. For example, the spectator service process is used to receive and send frame data of game matches. The lobby service process can obtain the frame data of the game matches that need to be watched from the spectator service process without querying the database, thereby reducing the query pressure on the database.
[0187] It should be noted that the device provided in the above embodiment, when implementing its functions, is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device and method embodiments provided in the above embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.
[0188] Please refer to Fig.10 , which shows a structural block diagram of a server provided in an embodiment of the present application. The computer device is used to implement the frame data sending method provided in the above embodiment. Specifically:
[0189] The server 1000 includes a CPU (Central Processing Unit) 1001, a system memory 1004 including a RAM (Random Access Memory) 1002 and a ROM (Read-Only Memory) 1003, and a system bus 1005 connecting the system memory 1004 and the central processing unit 1001. The server 1000 also includes a basic I / O (Input / Output) system 1006 for facilitating information transmission between various components in the computer, and a large-capacity storage device 1007 for storing an operating system 1013, application programs 1014, and other program modules 1015.
[0190] The basic input / output system 1006 includes a display 1008 for displaying information and an input device 1009 such as a mouse and a keyboard for user inputting information. The display 1008 and the input device 1009 are connected to the central processing unit 1001 through an input / output controller 1010 connected to the system bus 1005. The basic input / output system 1006 may also include an input / output controller 1010 for receiving and processing inputs from a plurality of other devices such as a keyboard, a mouse, or an electronic stylus. Similarly, the input / output controller 1010 also provides output to a display screen, a printer, or other types of output devices.
[0191] The mass storage device 1007 is connected to the central processing unit 1001 via a mass storage controller (not shown) connected to the system bus 1005. The mass storage device 1007 and its associated computer-readable medium provide non-volatile storage for the server 1000. That is, the mass storage device 1007 may include a computer-readable medium (not shown) such as a hard disk or a CD-ROM (Compact Disc Read-Only Memory) drive.
[0192] Without loss of generality, the computer-readable medium may include computer storage media and communication media. Computer storage media include volatile and non-volatile, removable and non-removable media implemented by any method or technology for storing information such as computer-readable instructions, data structures, program modules or other data. Computer storage media include RAM, ROM, EPROM (Erasable Programmable Read Only Memory), EEPROM (Electrically Erasable Programmable Read Only Memory), flash memory or other solid-state memory, CD-ROM, DVD (Digital Video Disc) or other optical storage, cassette, tape, disk storage or other magnetic storage devices. Of course, those skilled in the art will know that the computer storage medium is not limited to the above. The above-mentioned system memory 1004 and mass storage device 1007 can be collectively referred to as memory.
[0193] According to various embodiments of the present application, the server 1000 can also be connected to a remote computer on the network through a network such as the Internet. That is, the server 1000 can be connected to the network 1012 through the network interface unit 1011 connected to the system bus 1005, or the network interface unit 1011 can be used to connect to other types of networks or remote computer systems (not shown).
[0194] In an exemplary embodiment, a computer-readable storage medium is further provided, wherein a computer program is stored in the storage medium, and when the computer program is executed by a processor, the above-mentioned frame data sending method is implemented.
[0195] Optionally, the computer readable storage medium may include: ROM (Read-Only Memory), RAM (Random-Access Memory), SSD (Solid State Drives) or optical disks, etc. Among them, the random access memory may include ReRAM (Resistance Random Access Memory) and DRAM (Dynamic Random Access Memory).
[0196] In an exemplary embodiment, a computer program product is also provided, the computer program product includes a computer program, the computer program is stored in a computer readable storage medium. A processor of a computer device reads the computer program from the computer readable storage medium, and the processor executes the computer program, so that the computer device executes the above frame data sending method.
[0197] It should be noted that before collecting relevant data of users and during the process of collecting relevant data of users, this application can display a prompt interface, pop-up window or output voice prompt information, and the prompt interface, pop-up window or voice prompt information is used to prompt the user that its relevant data is currently being collected, so that this application only starts to execute the relevant steps of obtaining relevant data of users after obtaining the confirmation operation issued by the user to the prompt interface or pop-up window, otherwise (that is, when the confirmation operation issued by the user to the prompt interface or pop-up window is not obtained), the relevant steps of obtaining relevant data of users are terminated, that is, the relevant data of users are not obtained. In other words, all user data collected by this application are collected with the consent and authorization of the user, and the collection, use and processing of relevant user data need to comply with the relevant laws, regulations and standards of relevant countries and regions.
[0198] It should be understood that the "plurality" mentioned in this article refers to two or more. "And / or" describes the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects are in an "or" relationship.
[0199] The above description is only an exemplary embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A frame data sending method, It is characterized in that The method is executed by a spectator service process, and the method includes: receiving a data acquisition request for a first game match sent by a lobby service process, wherein the data acquisition request is used to request to acquire frame data of the first game match; Sending a first registration request to a game service process corresponding to the first game game, where the first registration request is used to request the game service process corresponding to the first game game to send frame data of the first game game to the spectator service process; Receiving frame data of the first game game sent by a game service process corresponding to the first game game; The frame data of the first game match is sent to the lobby service process, and the frame data of the first game match is provided by the lobby service process to at least one first client for display.
2. The method according to claim 1, It is characterized in that After receiving the data acquisition request for the first game game sent by the lobby service process, the method further includes: If frame data of the first game match exists in the cache corresponding to the spectator service process, acquiring the frame data of the first game match from the cache; When there is no frame data of the first game match in the cache corresponding to the spectator service process, execution starts from the step of sending a first registration request to the match service process corresponding to the first game match.
3. The method according to claim 1, It is characterized in that The sending a first registration request to a game service process corresponding to the first game game includes: The game service process corresponding to the first game game is obtained by querying from a database; wherein the database records a game service process corresponding to at least one game game.
4. The method according to claim 1, It is characterized in that The method further comprises: receiving a second registration request sent by the lobby service process, where the second registration request is used to request the spectator service process to record a spectator room created by the lobby service process for the first game match; The spectator service process is used to send frame data of the first game game to at least one lobby service process that has created the spectator room for the first game game.
5. The method according to claim 4, It is characterized in that The method further comprises: receiving a deregistration request sent by the lobby service process, wherein the deregistration request is used to request the spectator service process to cancel recording of a spectator room created by the lobby service process for the first game match; The anti-registration request is sent by the lobby service process when the number of spectators in the spectator room created by itself for the first game match is 0.
6. The method according to claim 1, It is characterized in that The method further comprises: When the number of spectator rooms created for the first game match recorded by the spectator service process is 0, starting a first timer; When a first duration corresponding to the first timer is reached, the frame data of the first game match stored in the cache corresponding to the spectator service process is cleared.
7. The method according to claim 1, It is characterized in that The method further comprises: Receiving a game end notification sent by a game service process corresponding to the first game game, wherein the game end notification is used to indicate that the first game game is ended; Recording the end mark corresponding to the first game match, and starting a second timer; When the second duration corresponding to the second timer is reached, the data maintained by the spectator service process for the first game match is cleared.
8. A frame data sending method, It is characterized in that The method is executed by a lobby service process, and the method includes: Receiving a request for watching a first game from a first client; Sending a data acquisition request for the first game match to the spectator service process, where the data acquisition request is used to request to acquire frame data of the first game match; receiving frame data of the first game match sent by the spectator service process; wherein the frame data of the first game match is sent by the game service process corresponding to the first game match to the spectator service process after the spectator service process registers with the game service process corresponding to the first game match; Send frame data of the first game match to the first client.
9. The method according to claim 8, It is characterized in that The method further comprises: Creating a spectator room for the first game; Sending a second registration request to the spectator service process, where the second registration request is used to request the spectator service process to record a spectator room created by the lobby service process for the first game match; The spectator service process is used to send frame data of the first game game to at least one lobby service process that has created the spectator room for the first game game.
10. The method according to claim 9, It is characterized in that The method further comprises: Sending a deregistration request to the spectator service process, wherein the deregistration request is used to request the spectator service process to cancel recording of the spectator room created by the lobby service process for the first game match; The anti-registration request is sent by the lobby service process when the number of spectators in the spectator room created by itself for the first game match is 0.
11. The method according to claim 8, It is characterized in that The method further comprises: In response to receiving the report information from the second client, sending a file acquisition request to the replay file management process, wherein the report information is used to report the existence of illegal behavior in the first game game, and the file acquisition request is used to request to obtain a replay file of the first game game, where the replay file of the first game game is generated according to the frame data of the first game game; receiving a replay file of the first game game sent by the replay file management process; Replay the replay file of the first game game to determine whether the reported information is true.
12. A frame data sending method, It is characterized in that The method is executed by a game service process, and the method includes: receiving a first registration request sent by a spectator service process, wherein the first registration request is used to request the game service process to send frame data of a first game game to the spectator service process; wherein the first registration request is sent by the spectator service process after receiving a data acquisition request for the first game game sent by the lobby service process; The frame data of the first game match is sent to the spectator service process, and the frame data of the first game match is sent by the spectator service process to the lobby service process, and provided by the lobby service process to at least one first client for display.
13. The method according to claim 12, It is characterized in that After sending the frame data of the first game match to the match service process, the method further includes: When the first game is over, sending a game end notification to the spectator service process, where the game end notification is used to indicate that the first game is over; Release the game service process.
14. The method according to claim 12, It is characterized in that The method further comprises: Sending frame data of the first game to the replay file management process; The replay file management process is used to generate corresponding replay files based on the frame data of the game.
15. A frame data sending device, It is characterized in that The device comprises: A receiving module, used to receive a data acquisition request for a first game game sent by a lobby service process, wherein the data acquisition request is used to request to acquire frame data of the first game game; a sending module, configured to send a first registration request to a game service process corresponding to the first game game, wherein the first registration request is used to request the game service process corresponding to the first game game to send frame data of the first game game to the spectator service process; The receiving module is further configured to receive frame data of the first game game sent by a game service process corresponding to the first game game; The sending module is further used to send the frame data of the first game match to the lobby service process, and the frame data of the first game match is provided by the lobby service process to at least one first client for display.
16. A frame data sending device, It is characterized in that The device comprises: A receiving module, configured to receive a request for watching a first game sent by a first client; A sending module, used for sending a data acquisition request for the first game match to the spectator service process, wherein the data acquisition request is used for requesting to acquire frame data of the first game match; The receiving module is further configured to receive frame data of the first game match sent by the spectator service process; wherein the frame data of the first game match is sent by the game service process corresponding to the first game match to the spectator service process after the spectator service process registers with the game service process corresponding to the first game match; The sending module is further used to send frame data of the first game match to the first client.
17. A frame data sending device, It is characterized in that The device comprises: a receiving module, configured to receive a first registration request sent by a spectator service process, wherein the first registration request is used to request the game service process to send frame data of a first game game to the spectator service process; wherein the first registration request is sent by the spectator service process after receiving a data acquisition request for the first game game sent by the lobby service process; The sending module is used to send the frame data of the first game match to the spectator service process, and the frame data of the first game match is sent by the spectator service process to the lobby service process, and provided by the lobby service process to at least one first client for display.
18. A server, It is characterized in that The server includes a processor and a memory, wherein a computer program is stored in the memory, and the computer program is loaded and executed by the processor to implement the frame data sending method as described in any one of claims 1 to 7, or to implement the frame data sending method as described in any one of claims 8 to 11, or to implement the frame data sending method as described in any one of claims 12 to 14.
19. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, which is loaded and executed by a processor to implement the frame data sending method as described in any one of claims 1 to 7, or to implement the frame data sending method as described in any one of claims 8 to 11, or to implement the frame data sending method as described in any one of claims 12 to 14.
20. A computer program product, It is characterized in that The computer program product includes a computer program, which is stored in a computer-readable storage medium. The processor reads and executes the computer program from the computer-readable storage medium to implement the frame data sending method as described in any one of claims 1 to 7, or implements the frame data sending method as described in any one of claims 8 to 11, or implements the frame data sending method as described in any one of claims 12 to 14.
