Game data interaction methods, devices and computer-readable storage media

By using data processing middleware and WebAssembly middleware to encrypt game data in H5 games, the compatibility and security issues of H5 games on multiple browsers are solved, and the compatibility and security of data interaction are achieved.

CN116688519BActive Publication Date: 2026-05-26TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
TENCENT TECHNOLOGY (SHENZHEN) CO LTD
Filing Date
2022-02-25
Publication Date
2026-05-26

AI Technical Summary

Technical Problem

When H5 games interact with servers, they cannot be compatible with multiple browsers simultaneously and cannot guarantee data security.

Method used

The game operation data is processed by the data processing middleware to generate game result data. The WebAssembly middleware is used to encrypt the result data and login credentials. The encrypted data is applicable in multiple browsers, ensuring data security.

Benefits of technology

It achieves compatibility across multiple browsers while ensuring the security of data interaction between H5 games and servers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116688519B_ABST
    Figure CN116688519B_ABST
Patent Text Reader

Abstract

This application discloses a game data interaction method, apparatus, and computer-readable storage medium. It can obtain a game user's login credentials on a web game server; obtain the game user's game operation data in the web game; invoke a data processing middleware corresponding to the web game to process the game operation data to obtain game result data, wherein the data processing middleware supports at least two browsers; encrypt the game result data and the login credentials through the data processing middleware to obtain first encrypted game data; and upload the first encrypted game data to the web game server. This solution can simultaneously ensure compatibility and security when the game server and the web game interact with each other.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of game technology, specifically to a game data interaction method, apparatus, and computer-readable storage medium. Background Technology

[0002] H5 (Hypertext Markup Language 5) games, also known as web games, are games that run on the web on electronic devices such as smartphones and tablets.

[0003] In H5 games, information interaction with servers is unavoidable, and the security of game data must be ensured during this interaction. However, the inventors of this application discovered during actual research and development that, when ensuring data security between H5 games and servers, H5 games cannot be compatible with multiple browsers, thus presenting a problem where compatibility and security cannot be guaranteed simultaneously. Summary of the Invention

[0004] This application provides a game data interaction method, apparatus, computer device, and computer-readable storage medium, which can simultaneously ensure compatibility and security when game servers and web games interact with each other.

[0005] In a first aspect, embodiments of this application provide a game data interaction method, the method comprising:

[0006] Obtain the login credentials of game users on the web game server;

[0007] Obtain the game operation data of the game user in the web game;

[0008] The data processing middleware corresponding to the web game is invoked to process the game operation data and obtain game result data. The data processing middleware supports at least two browsers.

[0009] The game result data and the login credentials are encrypted using the data processing middleware to obtain the first encrypted game data.

[0010] The first encrypted game data is uploaded to the web game server.

[0011] Secondly, embodiments of this application provide a game data interaction device, the game data interaction device comprising:

[0012] The first acquisition unit is used to acquire the login credentials of the game user on the web game server;

[0013] The second acquisition unit is used to acquire game operation data of the game user in the web game and to acquire game operation data generated based on the game user's operation in the web game.

[0014] The calling unit is used to call the data processing middleware corresponding to the web game to process the game operation data and obtain game result data. The data processing middleware supports at least two browsers.

[0015] An encryption unit is used to encrypt the game result data and the login credentials through the data processing middleware to obtain the first encrypted game data;

[0016] An interaction unit is used to upload the first encrypted game data to the web game server.

[0017] In some embodiments of this application, the interaction unit is further configured to:

[0018] In response to the login operation of the web game, a game login request is sent to the web game server;

[0019] The system receives second encrypted game data sent by the web game server in response to the game login request, wherein the second encrypted game data is obtained by encrypting the initial game data of the web game and the login credentials;

[0020] The second encrypted game data is decrypted using the data processing middleware to obtain the second decrypted game data.

[0021] Based on the second decrypted game data, the game data required for the web game is provided on the terminal device.

[0022] In some embodiments of this application, the second decrypted game data includes the game user's historical result data, and the encryption unit is further used for:

[0023] If the game result data and the historical result data meet the preset legal conditions, the game result data and the login credentials are encrypted through the data processing middleware to obtain the first encrypted game data.

[0024] In some embodiments of this application, the game data interaction device further includes a prompting unit, which, after acquiring the game user's game operation data in the web game, is specifically used for:

[0025] When the game result data is abnormal, a prompt message indicating that the game operation data is abnormal will be output.

[0026] In some embodiments of this application, after uploading the first encrypted game data to the web game server, the prompting unit is further used for:

[0027] The web game server receives a verification result for the first encrypted game data, wherein the verification result is obtained by the web game server verifying the signature information obtained after decrypting the first encrypted game data and the first decrypted game data.

[0028] If the verification result indicates that the first decrypted game data is abnormal, then a message indicating that the first decrypted game data is abnormal will be output.

[0029] In some embodiments of this application, the verification result is determined based on a first anomaly probability and a second anomaly probability of the first decrypted game data. The first anomaly probability is obtained by performing anomaly detection on the first decrypted game data using linear regression, and the second anomaly probability is obtained by performing anomaly detection on the first decrypted game data using the isolated forest algorithm.

[0030] In some embodiments of this application, the prompting unit is further configured to:

[0031] If the verification result is that the signature information is invalid, the game user is prohibited from accessing the game data stored on the web game server again.

[0032] In some embodiments of this application, the data processing middleware is WebAssembly middleware, and the encryption unit is further used for:

[0033] The WebAssembly middleware is invoked to perform JSON encoding on the signature information of the game result data generated based on the game result data and the login credentials, resulting in encoded data.

[0034] The encoded data is encrypted using a preset symmetric encryption algorithm through the WebAssembly middleware to obtain the first encrypted game data.

[0035] Thirdly, embodiments of this application also provide a computer device, the computer device including a processor and a memory, the memory storing a computer program, and the processor executing steps in any of the game data interaction methods provided in embodiments of this application when calling the computer program in the memory.

[0036] Fourthly, embodiments of this application also provide a computer-readable storage medium having a computer program stored thereon, the computer program being loaded by a processor to execute the steps in the game data interaction method.

[0037] Fifthly, embodiments of this application also provide a computer program product, including a computer program or instructions, which, when executed by a processor, implement the steps in any of the game data interaction methods provided in the embodiments of this invention.

[0038] From the above, it can be concluded that the embodiments of this application have the following beneficial effects:

[0039] This application embodiment calls a preset data processing middleware to process the game result data obtained by processing the game operation data of the game user in the web game, and encrypts the game result data with the login credentials of the game user on the web game server to obtain the first encrypted game data; then the first encrypted game data is uploaded to the web game server. On the one hand, since the game data of the game user in the web game can be encrypted before being uploaded to the web game server, the security of data interaction between the web game and the web game server can be guaranteed. On the other hand, since the data processing middleware supports at least two types of browsers, it is compatible with multiple types of browsers, avoiding the problem that some encryption methods only support IE kernel browsers, thus ensuring that the game data can be effectively encrypted and decrypted on multiple types of browsers, thereby ensuring that the web game is compatible with multiple browsers. It can be seen that this application embodiment can simultaneously ensure compatibility and security when the game server and the web game interact with each other. Attached Figure Description

[0040] 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.

[0041] Figure 1 This is a schematic diagram illustrating an application scenario of the game data interaction method provided in the embodiments of this application;

[0042] Figure 2 This is a schematic flowchart of an embodiment of the game data interaction method provided in this application.

[0043] Figure 3 This is an illustrative diagram illustrating a linear regression method provided in the embodiments of this application;

[0044] Figure 4 This is an illustrative diagram illustrating the isolated forest algorithm provided in the embodiments of this application;

[0045] Figure 5 This is a schematic diagram of another step in the game data interaction method provided in the embodiments of this application;

[0046] Figure 6 This is a schematic diagram of a scenario illustrating the game data interaction method provided in an embodiment of this application;

[0047] Figure 7 A schematic diagram of an embodiment of the game data interaction device in this application;

[0048] Figure 8 A schematic diagram of the structure of the computer device involved in the embodiments of this application;

[0049] Figure 9 This is an optional structural diagram of the distributed system 100 provided in this embodiment of the invention applied to a blockchain system;

[0050] Figure 10 This is an optional schematic diagram of the block structure provided in an embodiment of the present invention. Detailed Implementation

[0051] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0052] In the description of the embodiments of this application, it should be understood that the terms "first" and "second" are used to distinguish different objects and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Features defined with "first" and "second" may explicitly or implicitly include one or more of the stated features, rather than being used to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion.

[0053] This application provides a game data interaction method, apparatus, computer device, and computer-readable storage medium. The game data interaction apparatus can be integrated into a computer device, which may be a server or a terminal, etc.

[0054] It is understood that in the specific implementation of this application, user information such as game operation data and game result data are involved. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.

[0055] This embodiment will be described from the perspective of a game data interaction device, which can be integrated into a computer device. This computer device can be a server or a user terminal, among other devices. The user terminal includes, but is not limited to, mobile phones, computers, smart voice interaction devices, smart home appliances, vehicle terminals, and aircraft. The computer device can also be a server, which can be a single server or a server cluster composed of multiple servers. Specifically, this computer device can be the terminal device used to run web games in this embodiment. In this embodiment, the game data interaction method will use the computer device as a terminal device for running web games as an example.

[0056] For example, see Figure 1 This game data interaction method can be applied to, for example... Figure 1 Taking the interactive system and game data interaction device integrated into a terminal device running a web game as an example, the interactive system includes a terminal device 10 for running the web game and a web game server 20. The terminal device 10 and the game server 20 are connected via a network, such as a wired or wireless network. The game data interaction device is integrated into the terminal device 10. The terminal device 10 can obtain the login credentials of the game user on the web game server; obtain the game operation data of the game user in the web game; call the corresponding data processing middleware of the web game to process the game operation data to obtain game result data. The data processing middleware supports at least two browsers; encrypt the game result data and login credentials through the data processing middleware to obtain the first encrypted game data; and upload the first encrypted game data to the web game server.

[0057] The following is a detailed description in conjunction with the accompanying drawings. It should be noted that the order of description of the following embodiments is not intended to limit the preferred order of the embodiments. Although a logical order is shown in the flowcharts, in some cases, the steps shown or described may be performed in a different order than that shown in the drawings.

[0058] like Figure 2 As shown, the specific process of this game data interaction method can be summarized in steps 201 to 205, where:

[0059] 201. Obtain the login credentials of game users on the web game server.

[0060] Among them, the web game server is the backend server for web games.

[0061] The login credential (denoted as Token) is a credential that indicates a game user has logged into the web game server.

[0062] For example, the login credentials are obtained after the game user logs in to the web game server. For instance, the game user opens the web game on a terminal device and initiates a login request to the web game server through the terminal device running the web game. The web game server generates the game user's login credentials based on the login request, and the web game server encrypts the initial game data and token of the web game into an encrypted string and returns it to the terminal device. The data processing middleware is called to decrypt the encrypted string, thereby obtaining the game user's login credentials.

[0063] 202. Obtain game operation data of game users in web games.

[0064] Among them, game operation data refers to game data generated by game users' actions in web games, such as game user behavior data such as clicking to accept tasks, participating in game tasks, and purchasing game items in web games.

[0065] There are several ways to obtain game operation data in step 202, including, for example:

[0066] (1) Real-time acquisition of game operation data. For example, whenever a game user is detected to click to accept a task, participate in a game task, or purchase game items in a web game, the game user's game operation data is acquired in real time.

[0067] (2) The game operation data of the game user during the entire web game process is collected only after the web game ends.

[0068] 203. Call the data processing middleware corresponding to the web game to process the game operation data and obtain the game result data.

[0069] Among them, game result data refers to the game achievements of users in web games, such as game points, levels, etc.

[0070] The data processing middleware supports at least two browsers. It can be used to encrypt game data to be transmitted from the terminal device running the web game to the web game server, decrypt game data transmitted from the web game server to the terminal device running the web game, and process game operation data to form game result data.

[0071] For example, the data processing middleware can be a data processing middleware based on the WebAssembly encoding format (hereinafter referred to as "WebAssembly middleware" in this embodiment). WebAssembly (abbreviated as wasm) is a new encoding method, a portable, small, fast-loading, and web-compatible format that can run in various types of web browsers (such as Chrome, Firefox, Safari, etc.). In this embodiment, the data processing middleware is taken as a WebAssembly middleware.

[0072] WebAssembly middleware is written in a programming language (such as Golong) and compiled into a wasm format binary file.

[0073] Among them, terminal devices are devices used to run web games, such as mobile phones, tablets, laptops, personal computers, etc. Terminal devices have network connectivity to ensure game data interaction between web games and web game servers.

[0074] Specifically, after obtaining game operation data, the terminal device calls a predefined web game data transfer function (such as the predefined JavaScript function "wasm_getTransferData") to pass the user's game operation data (e.g., clicking to accept tasks, participating in game tasks, purchasing items, etc.) to the WebAssembly middleware. Then, the WebAssembly middleware processes the game operation data to determine the user's game result data (e.g., game score, level, etc.).

[0075] 204. The game result data and login credentials are encrypted using the data processing middleware to obtain the first encrypted game data.

[0076] The first type of encrypted game data refers to data obtained by encrypting game result data generated by the user's actions in the web game. For example, it could be data obtained by encrypting game result data such as game level and game score in the web game.

[0077] In some implementations, the data processing middleware is a WebAssembly middleware. The game result data is first JSON encoded and then encrypted using a symmetric encryption algorithm by the WebAssembly middleware to obtain the first encrypted game data. Therefore, step 204, "encrypting the game result data and login credentials using the data processing middleware to obtain the first encrypted game data," can specifically include the following steps A1 to A2, wherein:

[0078] A1. Call the WebAssembly middleware to JSON encode the signature information of the game result data generated based on the game result data and login credentials, and obtain the encoded data.

[0079] The encoded data refers to the data obtained by encoding the game results generated by the user's actions in the web game. For example, it can be the data obtained by JSON encoding game results such as game level and game score in a web game.

[0080] The signature information for the game result data can be generated using MD5 (Message-Digest Algorithm 5). MD5 is a widely used cryptographic hash function that produces a 128-bit (16-byte) hash value to ensure the integrity and consistency of transmitted information. The purpose of MD5 is to "compress" large amounts of information into a secure format (transforming an arbitrary-length byte string into a fixed-length hexadecimal string) before signing it with a private key using digital signature software, thus ensuring the integrity and consistency of transmitted information.

[0081] A2. Using the WebAssembly middleware, the encoded data is encrypted using a preset symmetric encryption algorithm to obtain the first encrypted game data.

[0082] Symmetric encryption is a single-key cryptosystem encryption method where the same key can be used for both encryption and decryption of information.

[0083] The preset symmetric encryption algorithm is a symmetric encryption algorithm used to encrypt game result data, such as the AES encryption algorithm.

[0084] Specifically, using the WebAssembly middleware, the game result data is first combined with login credentials, and then MD5 is used to generate a signature for the game result data. Next, the game result data and the signature information are JSON encoded to obtain the encoded data. Finally, using the WebAssembly middleware, the encoded data is encrypted using a preset symmetric encryption algorithm (such as AES) to obtain the first encrypted game data.

[0085] For example, game result data includes a user's game performance in a web game, such as game level and score. Using the WebAssembly middleware, the user's game result data (e.g., game level, score) is first combined with login credentials, and then MD5 is used to generate a signature for the game result data. Next, the game result data and the signature information are JSON encoded to obtain the encoded data. Finally, a preset symmetric encryption algorithm (such as AES) is used to encrypt the encoded data to obtain the first encrypted game data.

[0086] Firstly, since the WebAssembly middleware is a data processing middleware based on the WebAssembly encoding format, it can run in various types of web browsers (such as Chrome, Firefox, and Safari). By calling the WebAssembly middleware to first JSON encode the signature information generated based on the game result data and login credentials to obtain encoded data, and then encrypting the encoded data using a preset symmetric encryption algorithm to obtain the first encrypted game data, it is possible to ensure that the first encrypted game data is applicable in various types of browsers. This improves the security of game interaction data while ensuring that H5 games are compatible with multiple browsers. Secondly, since the generated signature information can confirm the source user of the game data, and the symmetric encryption algorithm can prevent the game data from being hijacked and cracked, by first JSON encoding the generated signature information and then encrypting it, the accuracy and security of the game data can be effectively guaranteed.

[0087] Furthermore, to enhance the legitimacy of game result data such as game levels and game scores, and to prevent cheating in web games, the legitimacy of the game result data can be further checked. Only when the game result data is legitimate is it encrypted and uploaded to the web game server. At this point, before step 204, "encrypting the game result data and login credentials through data processing middleware to obtain the first encrypted game data," the following can be further included:

[0088] 1) Check whether the game result data meets the preset legal conditions.

[0089] 2) If the game result data meets the preset legal conditions, proceed to step 204: "encrypt the game result data and login credentials through the data processing middleware to obtain the first encrypted game data."

[0090] 3) Otherwise, if the game result data does not meet the preset legal conditions, the game result data will not be uploaded to the web game server, or the process will not proceed to step 204, "encrypt the game result data and login credentials through the data processing middleware to obtain the first encrypted game data".

[0091] Among them, the preset legal conditions are used to indicate the legality of game result data. For example, the increase in game level or score is less than the preset increase value.

[0092] In some implementations, the second decrypted game data includes the game user's historical result data. It is assumed that the preset validity condition is that the increase in the game result data relative to the historical result data is less than or equal to a preset increase value. In this case, the validity of the game user's game result data can be determined by detecting the increase in the game result data relative to the historical result data. If the increase in the game result data relative to the historical result data is greater than the preset increase value, then the game user's game result data is determined to be invalid (i.e., the game result data does not meet the preset validity condition), and the game result data is not uploaded to the web game server, or the execution of step 204 is not proceeded. If the increase in the game result data relative to the historical result data is less than or equal to the preset increase value, then the game user's game result data is determined to be valid (i.e., the game result data meets the preset validity condition), and the process proceeds to step 204: "encrypt the game result data and login credentials through data processing middleware to obtain the first encrypted game data."

[0093] Historical results data refers to the game results data of game users that have been recorded in the web game server. For example, the points and levels that game users have achieved in the web game's history.

[0094] For example, the game result data specifically refers to the user's current game score after completing the game, and the second decrypted game data includes the user's historical game score. If the increase in the current game score relative to the historical game score is greater than a preset increase value, the user's current game score is determined to be invalid (i.e., the game result data does not meet the preset valid conditions), and the current game score is not uploaded to the web game server, or the execution of step 204 is not proceeded. If the increase in the current game score relative to the historical game score is less than or equal to the preset increase value, the user's current game score is determined to be valid (i.e., the game result data meets the preset valid conditions), and the process proceeds to step 204, "encrypting the game result data and login credentials through data processing middleware to obtain the first encrypted game data."

[0095] For example, the game result data specifically refers to the user's current game level after completing the game, while the second decrypted game data includes the user's historical game level. If the increase in the current game level relative to the historical game level is greater than a preset increase value, then the user's current game level is determined to be invalid (i.e., the game result data does not meet the preset valid conditions), and the current game level is not uploaded to the web game server, or the execution of step 204 is not proceeded. If the increase in the current game level relative to the historical game level is less than or equal to the preset increase value, then the user's current game level is determined to be valid (i.e., the game result data meets the preset valid conditions), and the process proceeds to step 204, "encrypting the game result data and login credentials through data processing middleware to obtain the first encrypted game data."

[0096] 205. Upload the first encrypted game data to the web game server.

[0097] Specifically, in step 205, firstly, the terminal device running the web game can submit the first encrypted game data to the web game server. Then, the web game server decrypts the first encrypted game data to obtain the first decrypted game data, and stores the first decrypted game data in the web game server.

[0098] Alternatively, the first decrypted game data can be stored in a specific storage space on the web game server. Or, based on blockchain technology, the first decrypted game data can be stored in the blockchain belonging to the web game server; specifically, it can be stored in the blockchain's shared ledger.

[0099] For web games to function properly, the necessary game data, such as card data, screen data, and the user's historical game data, needs to be read from the web game server. Furthermore, the web game server also transmits game data to the web game in an encrypted manner. For example, after a user logs into the web game server, the server first returns an encrypted string (this encrypted string is obtained by first JSON encoding the web game's initialization game data and then encrypting it using a symmetric encryption algorithm with the user's login credentials) to the user's terminal device. Then, the terminal device calls a data processing middleware to decrypt the encrypted string to obtain the initialization game data required by the web game. That is, this game data interaction method can further include the following steps B1 to B4, where:

[0100] B1. In response to the login operation of the web game, send a game login request to the web game server.

[0101] B2. Receive the second encrypted game data sent by the web game server in response to the game login request.

[0102] The second encrypted game data is obtained by encrypting the initial game data and login credentials of the web game. Specifically, the second encrypted game data is the game data obtained by the web game server encrypting the initial game data of the web game and the login credentials of the game user.

[0103] Initializing game data can include necessary game data for web games, such as optical card data, screen data, and historical game data of game users.

[0104] For example, firstly, the initial game data and login credentials of the web game can be JSON-encoded by the web game server to obtain encoded data. Then, the encoded data is encrypted using a preset symmetric encryption algorithm (such as AES encryption algorithm) to obtain the second encrypted game data. Finally, the second encrypted game data is transmitted to the terminal device used to run the web game through the web game server.

[0105] The method of encrypting the initial game data of the web game in step B2 is similar to the method of encrypting the game operation data in step 204 above. For details, please refer to the relevant description in step 204 above. The difference is that step B2 encrypts the initial game data in the web game server, while step 204 encrypts the game operation data in the data processing middleware.

[0106] For example, a game user opens a web game on a terminal device and initiates a login request to the web game server through the terminal device running the web game. Then, the web game server generates login credentials for the game user based on the login request, and the web game server returns an encrypted string (i.e., the second encrypted game data) formed by encrypting the initial game data and the token to the terminal device. The terminal device receives the second encrypted game data sent by the web game server in response to the game login request.

[0107] B3. Decrypt the second encrypted game data using data processing middleware to obtain the second decrypted game data.

[0108] The second decrypted game data is obtained by decrypting the second encrypted game data.

[0109] For example, taking WebAssembly middleware as the data processing middleware, after the web game server transmits the second encrypted game data to the terminal device used to run the web game, it calls the predefined server game data transmission function in the web game (such as the "wasm_initResetData function" agreed upon with the WebAssembly middleware) to pass the second encrypted game data to the WebAssembly middleware. Then, the WebAssembly middleware decrypts the second encrypted game data to obtain the second decrypted game data (such as the initial game data required by the web game) and the game user's login credentials, which are stored in the corresponding function variables of the WebAssembly middleware.

[0110] B4. Based on the second decrypted game data, provide the game data required for the web game on the terminal device.

[0111] For example, continuing with the example of WebAssembly middleware as the data processing middleware, the second encrypted game data is decrypted through WebAssembly middleware to obtain the second decrypted game data. After being stored in the function variable corresponding to WebAssembly middleware, the game data usage function predefined in the web game (such as the "gameStart function" predefined in JavaScript) can be called through WebAssembly middleware, thereby enabling a portion of the game data in the second decrypted game data to be passed to the web game for use.

[0112] The second encrypted game data is obtained by encrypting the data on the web game server, and the second decrypted game data is obtained by decryption by the data processing middleware and then provided to the web game. On the one hand, this ensures the security of the game data transmitted from the web game server; on the other hand, since the data processing middleware (such as WebAssembly middleware) supports at least two types of browsers, it is compatible with multiple types of browsers, thus ensuring that the H5 game is compatible with multiple browsers. Therefore, when the web game server and the web game interact with each other, both compatibility and security can be guaranteed.

[0113] Furthermore, it can also detect and report game data with abnormal interactions. For example, it can detect and report whether game data uploaded to the web game server is abnormal. There are several ways to detect and report whether game data uploaded to the web game server is abnormal, including, for example:

[0114] (1) In some embodiments, after the game result data is uploaded to the web game server, anomaly detection is performed and reported. That is, after step 205 "upload the first encrypted game data to the web game server", the following may be further included:

[0115] 1) Receive the verification result of the first encrypted game data sent by the web game server.

[0116] The verification result is obtained by the web game server verifying the signature information obtained after decrypting the first encrypted game data and the first decrypted game data. Specifically, the verification result is obtained by the web game server verifying the game result data; please refer to the relevant explanations of steps C1 to C2 below.

[0117] 2) If the verification result is that the game data after the first decryption is abnormal, output the prompt message that the game data after the first decryption is abnormal.

[0118] The prompts can take many forms, such as voice, text, and video. Here, we do not restrict the specific form of the prompts for abnormal game data after the first decryption.

[0119] For example, it can output a prompt message indicating that the game data is abnormal after the first decryption to servers or devices such as web game servers or game backend management devices.

[0120] Specifically, the verification result is obtained by performing anomaly detection on the game result data through the web game server. For example, in the anomaly detection process of the web game server, the web game server will execute steps C1 to C3, wherein:

[0121] C1. Obtain the signature information and the first decrypted game data obtained by the web game server after decrypting the first encrypted game data.

[0122] The first decrypted game data is obtained by decrypting the first encrypted game data.

[0123] C2. Perform anomaly detection on the game data after the first decryption.

[0124] There are several ways to perform anomaly detection on the first decrypted game data in step C2. For example, these include:

[0125] ① Anomaly detection is performed on the first decrypted game data using a pre-defined anomaly detection method to determine whether the first decrypted game data is abnormal. For example, anomaly detection methods such as linear regression and the isolated forest algorithm can be used to detect anomalies in the first decrypted game data to determine whether the first decrypted game data is abnormal. The following uses linear regression and the isolated forest algorithm as examples to illustrate step C2, "Anomaly detection is performed on the first decrypted game data".

[0126] Method 1: Linear regression.

[0127] Please refer to Figure 3 , Figure 3 This is an illustrative diagram illustrating a linear regression method provided in this application embodiment. Taking the game result data uploaded to the web game server as the number of game task operations and the game score obtained, i.e., the first decrypted game data as the number of game task operations (denoted as X) and the game score obtained (denoted as Y), for example, firstly, a linear regression equation Y = a*X + b can be fitted. Combining historical game result data, the values ​​of coefficients a and b are calculated using the least squares method, thereby obtaining a linear regression equation for predicting the game score (e.g., the linear regression equation Y = 12.50*X - 234.20 can be obtained). Then, the number of game task operations uploaded to the web game server each time is substituted into the linear regression equation for predicting the game score to obtain the predicted score. Finally, the difference between the predicted score and the game score obtained uploaded to the web game server is obtained; if the difference is less than a preset difference, the first decrypted game data (i.e., the number of game task operations and the game score obtained) is determined to be normal; otherwise, if the difference is greater than or equal to the preset difference, the first decrypted game data (i.e., the number of game task operations and the game score obtained) is determined to be abnormal. The larger the score difference, the greater the probability of anomalies in the game data after the first decryption; conversely, the smaller the score difference, the lower the probability of anomalies in the game data after the first decryption.

[0128] Method 2: Isolation Forest Algorithm.

[0129] Please refer to Figure 4 , Figure 4This is an illustrative diagram illustrating the Isolation Forest algorithm provided in this application embodiment. In Isolation Forest (iForest), anomalies are defined as "outliers that are more likely to be separated," which can be understood as sparsely distributed points that are far from denser groups. In the feature space, sparsely distributed regions indicate that the probability of an event occurring in that region is very low, and therefore, data falling into these regions can be considered anomalous. Isolation Forest is an unsupervised anomaly detection method suitable for continuous data, meaning it does not require labeled samples for training, but the features need to be continuous. In Isolation Forest, the dataset is recursively and randomly partitioned until all sample points are isolated. Under this random partitioning strategy, outliers typically have shorter paths.

[0130] Taking the game result data uploaded to the web game server as the distance between synthesized items and the position of synthesized elements—that is, the first decrypted game data consisting of the distance between synthesized items (denoted as A) and the position of synthesized elements (denoted as B)—as an example, exemplarily, firstly, the Isolation Forest algorithm can be trained using historical game result data (using the distance between synthesized items A and the position of synthesized elements B as feature input data to identify anomalous game result data), resulting in a trained Isolation Forest. Then, the distance between synthesized items A and the position of synthesized elements B from each upload to the web game server are input into the trained Isolation Forest to obtain the tree path of the first decrypted game data, thereby estimating the probability of the first decrypted game data being anomalous, and thus determining whether the first decrypted game data is anomalous. For example, if the probability of the first decrypted game data being abnormal is less than a preset probability threshold, then the first decrypted game data (i.e., the distance interval A between synthesized items and the position B of synthesized elements) is determined to be normal; otherwise, if the estimated probability of the first decrypted game data being abnormal is greater than or equal to the preset probability threshold, then the first decrypted game data (i.e., the distance interval A between synthesized items and the position B of synthesized elements) is determined to be abnormal. The shorter the tree path of the first decrypted game data, the higher the probability of the first decrypted game data being abnormal; conversely, the longer the tree path of the first decrypted game data, the lower the probability of the first decrypted game data being abnormal.

[0131] ② Combine the detection results obtained by performing anomaly detection on the first decrypted game data using two or more anomaly detection methods to determine whether the first decrypted game data is abnormal.

[0132] For example, in some implementations, anomaly detection of the first decrypted game data can be performed using linear regression and the isolated forest algorithm, respectively, to obtain the probability of anomalies detected by linear regression and the probability of anomalies detected by the isolated forest algorithm. Then, the probability of anomalies detected by linear regression and the probability of anomalies detected by the isolated forest algorithm are combined to determine whether the first decrypted game data is abnormal. At this time, when the web game server executes step C2, "perform anomaly detection on the first decrypted game data," the web game server can specifically execute steps C11 to C15.

[0133] C11. Anomaly detection is performed on the first decrypted game data using linear regression to obtain the first anomaly probability of the first decrypted game data.

[0134] In step C11, the anomaly detection process of the first decrypted game data is performed using linear regression. For details, please refer to the relevant explanation of method 1 (linear regression) above. For the sake of simplicity, it will not be repeated here.

[0135] Among them, the first anomaly probability is the probability of the game being abnormal after the first decryption, determined by linear regression.

[0136] Specifically, continuing with the example where the game result data uploaded to the web game server consists of the number of game task operations and the game score obtained (i.e., the first decrypted game data consists of the number of game task operations (X) and the game score obtained (Y), firstly, referring to the method 1 (linear regression method) mentioned above, anomaly detection is performed on the first decrypted game data using linear regression to obtain the difference between the predicted score and the game score obtained on the web game server. Then, based on the score difference and the preset relationship between the score difference and the anomaly probability, the first anomaly probability of the first decrypted game data is determined.

[0137] C12. Using the Isolation Forest algorithm, perform anomaly detection on the first decrypted game data to obtain the second anomaly probability of the first decrypted game data.

[0138] In step C12, the process of detecting anomalies in the first decrypted game data using the isolated forest algorithm can be referred to in the relevant description of method 2 (isolated forest algorithm) above. For the sake of simplicity, it will not be repeated here.

[0139] The second anomaly probability is the probability of the game being abnormal after the first decryption, determined by the isolated forest algorithm.

[0140] Specifically, continuing with the example where the game result data uploaded to the web game server consists of the distance between synthesized items and the position of synthesized elements (i.e., the first decrypted game data consists of the distance between synthesized items (A) and the position of synthesized elements (B)), firstly, referring to method 2 (Isolation Forest algorithm) mentioned above, anomaly detection is performed on the first decrypted game data using the Isolation Forest algorithm to obtain the probability that the first decrypted game data is abnormal. Then, the probability of the first decrypted game data being abnormal is used as the second anomaly probability of the first decrypted game data.

[0141] C13. Determine the final anomaly probability of the first decrypted game data based on the first anomaly probability and the second anomaly probability.

[0142] The final anomaly probability is the probability of anomalies in the first decrypted game data obtained by combining two or more anomaly detection methods to perform anomaly detection on the first decrypted game data (such as the first anomaly probability and the second anomaly probability).

[0143] For example, the first anomaly probability and the second anomaly probability can be multiplied to obtain the final anomaly probability of the first decrypted game data.

[0144] C14. If the final probability of an anomaly is greater than the preset probability threshold, then it is determined that the first decrypted game data uploaded to the web game server is abnormal.

[0145] C15. If the final anomaly probability is less than or equal to the preset probability threshold, then the first decrypted game data uploaded to the web game server is determined to be normal.

[0146] Since a single anomaly detection method may result in false positives, combining two or more anomaly detection methods to perform anomaly detection on the first decrypted game data can improve the detection accuracy of the first decrypted game data.

[0147] For example, in some implementations, anomaly detection is performed on the first decrypted game data using two or more anomaly detection methods (such as linear regression and the Isolation Forest algorithm). A joint probability assessment is established based on these two or more anomaly detection methods (e.g., the probability that more than half of the anomaly detection methods detect anomalies in the first decrypted game data) to determine the anomaly probability of the first decrypted game data. If the anomaly probability of the first decrypted game data is greater than a preset probability threshold, then the first decrypted game data is determined to be anomaly. If the anomaly probability of the first decrypted game data is less than or equal to the preset probability threshold, then the first decrypted game data is determined to be normal.

[0148] Furthermore, when there are anomalies in the game data after the first decryption, the video of the web game in progress corresponding to the game result data can be captured as auxiliary information of the abnormal game data after the first decryption. This video can be output together with the prompt information of the abnormal game data after the first decryption, so as to combine with manual judgment to determine whether the game user has actually engaged in illegal or cheating behavior in the web game.

[0149] As can be seen, after the game data is uploaded to the server, the web game server performs anomaly detection on the first decrypted game data to obtain the verification result. When the verification result is that the first decrypted game data is abnormal, it outputs an abnormal prompt message, thereby detecting and reporting abnormal game data interactions. For example, it detects whether the game data uploaded to the web game server is abnormal and reports it, thereby detecting cheating behavior in web games to a certain extent and improving the fairness of web games.

[0150] (2) In some embodiments, anomaly detection and reporting are performed on the game result data before it is uploaded to the web game server (e.g., anomaly detection and reporting are performed on the game result data via a terminal device before the game result data is encrypted). That is, before step 204 "encrypting the game result data and login credentials through data processing middleware to obtain the first encrypted game data", it may further include: performing anomaly detection on the game result data; when there is anomaly in the game result data, outputting a prompt message indicating that the game result data is abnormal.

[0151] The method of "detecting anomalies in the game result data" is similar to the method of "detecting anomalies in the first decrypted game data" in steps C1 to C2 above. For details, please refer to the relevant explanations of steps C1 to C2 above, which will not be repeated here.

[0152] As can be seen, by performing anomaly detection on the game result data before uploading the game data to the server, and outputting an error message when anomalies are found in the game result data, abnormal game data interactions can be detected and reported. For example, it can detect whether the game data of target objects in web games is abnormal and report it, thereby detecting cheating behavior in web games to a certain extent and improving the fairness of web games.

[0153] Furthermore, when game result data is abnormal, the video of the corresponding web game in progress can be captured as auxiliary information for game result data anomalies. This video can be output together with the game result data anomaly prompt information to help determine whether the game user has actually engaged in cheating behavior in the web game.

[0154] To further enhance the security of game data interaction, the signature information in the first encrypted game data can be verified through the web game server. If the signature information in the first encrypted game data is valid, the first decrypted game data is then recorded to the web game server. If the signature information in the first encrypted game data is invalid, the game user is prohibited from accessing the game data stored on the web game server again. For example, the web game server verifies the validity of the signature information in the first encrypted game data to obtain a verification result. The terminal device receives the verification result from the web game server based on the signature information in the first encrypted game data. If the verification result is that the signature information is invalid, the game user is prohibited from accessing the game data stored on the web game server again.

[0155] As can be seen from the above, the embodiments of this application can encrypt the game result data obtained by processing the game operation data of the game user in the web game and the login credentials of the game user on the web game server by calling a preset data processing middleware, thus obtaining the first encrypted game data; then the first encrypted game data is uploaded to the web game server. On the one hand, since the game data of the game user in the web game can be encrypted before being uploaded to the web game server, the security of data interaction between the web game and the game server can be guaranteed. On the other hand, since the data processing middleware supports at least two types of browsers, it is compatible with multiple types of browsers, avoiding the problem that some encryption methods only support IE kernel browsers, thus ensuring that the game data can be effectively encrypted and decrypted on multiple types of browsers, thereby ensuring that the web game is compatible with multiple browsers. It is evident that the embodiments of this application can simultaneously ensure compatibility and security when the game server and the web game interact with each other.

[0156] Based on the methods described in the preceding embodiments, the following examples will provide further detailed explanations.

[0157] See Figure 5 and Figure 6 , Figure 5 This is a flowchart illustrating another step of the game data interaction method provided in this application embodiment. Figure 6 This is a schematic diagram of a game data interaction method provided in an embodiment of this application; for ease of understanding, please refer to it in conjunction with... Figure 5 and Figure 6 The embodiments of this application will be described below.

[0158] In this embodiment, the game data interaction device will be specifically integrated into a terminal device running a web game as an example to further describe the game data interaction method provided in this application embodiment. When the terminal device running the web game executes the program corresponding to the game data interaction method, the specific flow of the game data interaction method is as follows:

[0159] 501. The terminal device obtains the second encrypted game data obtained after the web game server encrypts the initial game data and login credentials of the web game.

[0160] like Figure 6 As shown, firstly, the game user opens the web game on their terminal device and initiates a login request to the web game server. The web game server then generates login credentials for the user based on the login request. Next, the web game server first encodes the initial game data and login credentials into JSON to obtain encoded data. Then, it encrypts the encoded data using a preset symmetric encryption algorithm (such as AES) to obtain the second encrypted game data. Finally, the web game server transmits the second encrypted game data to the terminal device running the web game, thus allowing the terminal device to obtain the second encrypted game data.

[0161] The method for obtaining the second encrypted game data in step 501 is similar to that in step B2 above. For details, please refer to the relevant explanation in step B2 above. It will not be repeated here.

[0162] 502. The terminal device decrypts the second encrypted game data through the data processing middleware to obtain the second decrypted game data and the game user's login credentials.

[0163] The method for decrypting the second encrypted game data in step 502 is similar to that in step B3 above. For details, please refer to the relevant explanation in step B3 above. It will not be repeated here.

[0164] 503. The terminal device provides the game data required for the web game based on the second decrypted game data on the terminal device.

[0165] The implementation of step 503 is similar to that of step B4 above. For details, please refer to the relevant explanation in step B4 above. It will not be repeated here.

[0166] 504. Terminal devices acquire game operation data of game users in web games.

[0167] The implementation of step 504 is similar to that of step 202 above. For details, please refer to the relevant explanation of step 202 above. It will not be repeated here.

[0168] 505. The terminal device calls the preset data processing middleware to encrypt the game result data obtained from the game operation data processing and the login credentials to obtain the first encrypted game data.

[0169] The implementation of step 505 is similar to that of steps 203 and 204 above. For details, please refer to the relevant explanations of steps 203 and 204 above. It will not be repeated here.

[0170] 506. Upload the first encrypted game data to the web game server.

[0171] The implementation of step 506 is similar to that of step 205 above. For details, please refer to the relevant explanation of step 205 above. It will not be repeated here.

[0172] 507. When there is an anomaly in the game result data, the terminal device outputs a prompt message indicating that the game result data is abnormal.

[0173] Specifically, refer to the relevant instructions in step C2 above to perform anomaly detection on the game result data. When anomalies are found in the game result data, the terminal device outputs a prompt message indicating that the game result data is abnormal.

[0174] 508. When the signature information obtained by the web game server after decrypting the first encrypted game data is invalid, the terminal device shall prohibit the game user from accessing the game data stored by the web game server again.

[0175] As shown above, firstly, since game data from users on the web game is encrypted before being uploaded to the web game server, the security of data interaction between the web game and the web game server can be guaranteed. Furthermore, because the data processing middleware supports at least two types of browsers, it is compatible with multiple browsers, avoiding the problem that some encryption methods only support IE-based browsers. This ensures effective encryption and decryption of game data on multiple browsers, thus guaranteeing web game compatibility. Therefore, both compatibility and security can be guaranteed during data interaction between the web game server and the web game. Secondly, when abnormal game result data is detected, an error message is output, allowing for the detection and reporting of abnormal game data interactions. This helps to detect cheating behavior in the web game and improves its fairness. Thirdly, by verifying the signature information in the first encrypted game data, if the signature information is invalid, the user is prohibited from accessing the game data stored on the web game server again, which also improves the security of game data interaction to some extent.

[0176] To better implement the game data interaction method in this application embodiment, based on the game data interaction method, this application embodiment also provides a game data interaction device, which can be integrated into computer equipment, such as servers or terminals.

[0177] For example, such as Figure 7 The diagram shown is a schematic representation of an embodiment of the game data interaction device in this application. The game data interaction device may include a first acquisition unit 701, a second acquisition unit 702, a calling unit 703, an encryption unit 704, an interaction unit 705, etc., as follows:

[0178] The first acquisition unit 701 is used to acquire the login credentials of the game user on the web game server;

[0179] The second acquisition unit 702 is used to acquire game operation data of the game user in the web game and to acquire game operation data generated based on the game user's operation in the web game;

[0180] Calling unit 703 is used to call the data processing middleware corresponding to the web game to process the game operation data and obtain the game result data. The data processing middleware supports at least two browsers.

[0181] The encryption unit 704 is used to encrypt the game result data and login credentials through the data processing middleware to obtain the first encrypted game data;

[0182] The interaction unit 705 is used to upload the first encrypted game data to the web game server.

[0183] In some embodiments of this application, the interaction unit 705 is further configured to:

[0184] In response to the login operation of the web game, a game login request is sent to the web game server;

[0185] Receive the second encrypted game data sent by the web game server in response to the game login request, wherein the second encrypted game data is obtained by encrypting the initial game data of the web game and the login credentials;

[0186] The second encrypted game data is decrypted using data processing middleware to obtain the second decrypted game data.

[0187] Based on the second decrypted game data, the game data required for the web game is provided on the terminal device.

[0188] In some embodiments of this application, the second decrypted game data includes the game user's historical results data, and the encryption unit 704 is specifically used for:

[0189] If the game result data and historical result data meet the preset legal conditions, the game result data and login credentials are encrypted through the data processing middleware to obtain the first encrypted game data.

[0190] In some embodiments of this application, the game data interaction device further includes a prompting unit (not shown in the figure). After acquiring the game operation data of the game user in the web game, the prompting unit is specifically used for:

[0191] When there are abnormalities in the game result data, output a prompt message indicating abnormal game operation data.

[0192] In some embodiments of this application, after the first encrypted game data is uploaded to the web game server, the notification unit is further used for:

[0193] Receive the verification result of the first encrypted game data sent by the web game server. The verification result is obtained by the web game server verifying the signature information obtained after decrypting the first encrypted game data and the first decrypted game data.

[0194] If the verification result shows that the first decrypted game data is abnormal, then output the message that the first decrypted game data is abnormal.

[0195] In some embodiments of this application, the verification result is determined based on a first anomaly probability and a second anomaly probability of the first decrypted game data. The first anomaly probability is obtained by performing anomaly detection on the first decrypted game data using linear regression, and the second anomaly probability is obtained by performing anomaly detection on the first decrypted game data using the isolated forest algorithm.

[0196] In some embodiments of this application, the prompting unit is further used for:

[0197] If the verification result shows that the signature information is invalid, the game user is prohibited from accessing the game data stored on the web game server again.

[0198] In some embodiments of this application, the data processing middleware is WebAssembly middleware, and the encryption unit 704 is further used for:

[0199] The WebAssembly middleware is invoked to JSON encode the signature information of the game result data generated based on the game result data and login credentials, resulting in encoded data.

[0200] The encoded data is encrypted using a preset symmetric encryption algorithm through the WebAssembly middleware to obtain the first encrypted game data.

[0201] In practice, each of the above units can be implemented as an independent entity or can be arbitrarily combined to be implemented as the same or several entities. For the specific implementation of each of the above units, please refer to the previous method embodiments, which will not be repeated here.

[0202] As can be seen from the above, in this embodiment of the application, the first acquisition unit 701 acquires the login credentials of the game user on the web game server; the second acquisition unit 702 acquires the game operation data of the game user in the web game, and acquires the game operation data generated based on the game user's operation in the web game; the calling unit 703 calls the data processing middleware corresponding to the web game to process the game operation data to obtain game result data, and the data processing middleware supports at least two browsers; the encryption unit 704 encrypts the game result data and login credentials through the data processing middleware to obtain the first encrypted game data; and the interaction unit 705 uploads the first encrypted game data to the web game server. This solution ensures the security of data exchange between web games and web game servers by encrypting user game data before uploading it to the web game server. Furthermore, the data processing middleware supports at least two types of browsers, avoiding the limitation of some encryption methods only supporting IE-based browsers. This guarantees effective encryption and decryption of game data across multiple browsers, ensuring web games' compatibility with various browsers. Therefore, both compatibility and security are guaranteed during data exchange between the game server and the web game.

[0203] Furthermore, to better implement the game data interaction method in the embodiments of this application, based on the game data interaction method, the embodiments of this application also provide a computer device, such as... Figure 8 As shown, it illustrates a structural schematic diagram of the computer device involved in the embodiments of this application, specifically:

[0204] The computer device may include components such as a processor 801 with one or more processing cores, a memory 802 with one or more computer-readable storage media, a power supply 803, and an input unit 804. Those skilled in the art will understand that... Figure 8 The computer device structure shown does not constitute a limitation on the computer device and may include more or fewer components than shown, or combine certain components, or have different component arrangements. Wherein:

[0205] The processor 801 is the control center of the computer device. It connects various parts of the computer device via various interfaces and lines. By running or executing software programs and / or modules stored in the memory 802, and by calling data stored in the memory 802, it performs various functions of the computer device and processes data, thereby performing overall detection of the computer device. Optionally, the processor 801 may include one or more processing cores; preferably, the processor 801 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications, and the modem processor mainly handles wireless communication. It is understood that the modem processor may also not be integrated into the processor 801.

[0206] The memory 802 can be used to store software programs and modules. The processor 801 executes various functional applications and data processing by running the software programs and modules stored in the memory 802. The memory 802 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, application programs required for at least one function (such as sound playback function, video playback function, etc.), etc.; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 802 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 802 may also include a memory controller to provide the processor 801 with access to the memory 802.

[0207] The computer device also includes a power supply 803 that supplies power to the various components. Preferably, the power supply 803 can be logically connected to the processor 801 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. The power supply 803 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.

[0208] The computer device may also include an input unit 804, which can be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.

[0209] Although not shown, the computer device may also include a display unit, etc., which will not be described in detail here. Specifically, in this embodiment, the processor 801 in the computer device loads the executable files corresponding to the processes of one or more application programs into the memory 802 according to the following instructions, and the processor 801 runs the application programs stored in the memory 802 to realize various functions, as follows:

[0210] Obtain the login credentials of the game user on the web game server; obtain the game operation data of the game user in the web game; call the corresponding data processing middleware of the web game to process the game operation data to obtain game result data, the data processing middleware supports at least two browsers; encrypt the game result data and login credentials through the data processing middleware to obtain the first encrypted game data; upload the first encrypted game data to the web game server.

[0211] For details of each of the above operations, please refer to the previous embodiments, which will not be repeated here.

[0212] As can be seen from the above, the computer device in this embodiment can obtain the login credentials of the game user on the web game server; obtain the game operation data of the game user in the web game; call the data processing middleware corresponding to the web game to process the game operation data to obtain game result data, and the data processing middleware supports at least two browsers; encrypt the game result data and login credentials through the data processing middleware to obtain the first encrypted game data; and upload the first encrypted game data to the web game server. This solution ensures the security of data interaction between the web game and the game server by encrypting the game data of the game user before uploading it to the web game server. Furthermore, since the data processing middleware supports at least two types of browsers, it is compatible with multiple browser types, avoiding the problem that some encryption methods only support IE kernel browsers. This ensures effective encryption and decryption of game data on multiple browser types, thus ensuring the web game's compatibility with multiple browsers. Therefore, both compatibility and security can be guaranteed when the game server and the web game interact with each other.

[0213] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by instructions, or by instructions controlling related hardware. These instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.

[0214] Therefore, embodiments of this application provide a computer-readable storage medium storing a computer program that can be loaded by a processor to execute the steps of any of the object detection methods provided in the embodiments of this application. For example, the computer program can execute the following steps:

[0215] Obtain the login credentials of the game user on the web game server; obtain the game operation data of the game user in the web game; call the corresponding data processing middleware of the web game to process the game operation data to obtain game result data, the data processing middleware supports at least two browsers; encrypt the game result data and login credentials through the data processing middleware to obtain the first encrypted game data; upload the first encrypted game data to the web game server.

[0216] According to one aspect of this application, a computer program product or computer program is also provided, comprising computer instructions stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the electronic device to perform the methods provided in the various optional implementations of the above embodiments.

[0217] The interactive system involved in the embodiments of the present invention can be a distributed system formed by connecting a client 300 and multiple nodes 200 (any form of computer device connected to the network, such as a server or terminal used to run web games) through network communication.

[0218] Taking a distributed system as an example, see blockchain system. Figure 9 , Figure 9 This is an optional structural diagram of the distributed system 100 provided in this embodiment of the invention applied to a blockchain system. It consists of multiple nodes 200 (any form of computing device connected to the network, such as multiple servers or user terminals for running web games; user terminals include, but are not limited to, mobile phones, computers, smart voice interaction devices, smart home appliances, vehicle terminals, aircraft, etc.) and clients. The nodes 200 form a peer-to-peer (P2P) network. The P2P protocol is an application layer protocol running on top of the Transmission Control Protocol (TCP). In the distributed system, any machine, such as a server or terminal, can join and become a node 200. A node 200 includes a hardware layer, a middleware layer, an operating system layer, and an application layer. In this embodiment, login credentials, game operation data, first encrypted game data, second encrypted game data, and second decrypted game data, etc., can all be stored in the shared ledger of the blockchain system through the nodes 200 of the distributed system. Computer devices (e.g., terminals or servers) can store the first encrypted game data, game operation data, and other information based on the records stored in the shared ledger.

[0219] See Figure 9 The functions of each node 200 in the blockchain system shown include:

[0220] 1) Routing: A basic function of nodes used to support communication between nodes.

[0221] In addition to routing functionality, node 200 may also have the following functions:

[0222] 2) Applications are deployed in the blockchain to implement specific business needs. They record data related to the implementation of functions to form record data, carry digital signatures in the record data to indicate the source of the task data, and send the record data to other nodes in the blockchain system. When other nodes successfully verify the source and integrity of the record data, they add the record data to a temporary block.

[0223] For example, the business logic implemented by the application includes:

[0224] 2.1) A wallet is used to provide the function of conducting electronic currency transactions, including initiating transactions (i.e., sending the transaction record of the current transaction to other nodes in the blockchain system; after other nodes successfully verify the transaction, they store the transaction record data in the temporary block of the blockchain as a response to acknowledge the validity of the transaction; of course, the wallet also supports querying the remaining electronic currency in the electronic currency address;

[0225] 2.2) Shared ledger, used to provide functions such as storage, query and modification of ledger data. It sends the record data of the operation on the ledger data to other nodes in the blockchain system. After the other nodes verify the validity, as a response to acknowledge the validity of the ledger data, they store the record data in a temporary block. They can also send confirmation to the node that initiated the operation.

[0226] 2.3) Smart contracts are computerized protocols that can execute the terms of a contract. They are implemented through code deployed on a shared ledger that executes when certain conditions are met. Based on actual business needs, the code is used to complete automated transactions, such as querying the logistics status of goods purchased by a buyer and transferring the buyer's electronic money to the merchant's address after the buyer signs for the goods. Of course, smart contracts are not limited to executing contracts for transactions; they can also execute contracts for processing received information.

[0227] 3) A blockchain consists of a series of blocks that are sequentially generated. Once a new block is added to the blockchain, it will not be removed. The blocks contain the data submitted by the nodes in the blockchain system.

[0228] See Figure 10 , Figure 10This is an optional schematic diagram of the block structure provided in this embodiment of the invention. Each block includes the hash value of the transaction records stored in this block (the hash value of this block) and the hash value of the previous block. The blocks are connected through their hash values ​​to form a blockchain. Additionally, the block may include information such as a timestamp when it was generated. A blockchain is essentially a decentralized database, a chain of data blocks linked together using cryptographic methods. Each data block contains relevant information used to verify the validity of the information (anti-counterfeiting) and to generate the next block.

[0229] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the game data interaction device, computer equipment, and its corresponding units described above can be found in the following references: Figures 1 to 6 The description of the game data interaction method corresponding to any embodiment will not be repeated here.

[0230] The computer-readable storage medium may include: read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.

[0231] Because of the instructions stored in the computer-readable storage medium, the present application can be executed as described above. Figures 1 to 6 Corresponding to the steps in the game data interaction method in any embodiment, this application can be implemented as described above. Figures 1 to 6 For details on the beneficial effects that the game data interaction method can achieve in any embodiment, please refer to the preceding description, which will not be repeated here.

[0232] The foregoing has provided a detailed description of a game data interaction method, apparatus, computer device, and computer-readable storage medium provided in the embodiments of this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A game data interaction method, characterized in that, The method includes: Obtain the login credentials of game users on the web game server; Obtain the game operation data of the game user in the web game; Call the predefined web game data transmission function in the web game to transmit the game operation data to the data processing middleware corresponding to the web game; The data processing middleware corresponding to the web game is invoked to process the game operation data to obtain game result data. The data processing middleware supports at least two browsers, and the game result data is the game achievement of the game user in the web game. The game result data and the login credentials are encrypted using the data processing middleware to obtain the first encrypted game data. The first encrypted game data is uploaded to the web game server.

2. The game data interaction method according to claim 1, characterized in that, The method further includes: In response to the login operation of the web game, a game login request is sent to the web game server; The system receives second encrypted game data sent by the web game server in response to the game login request, wherein the second encrypted game data is obtained by encrypting the initial game data of the web game with the login credentials; The second encrypted game data is decrypted using the data processing middleware to obtain the second decrypted game data. Based on the second decrypted game data, the game data required for the web game is provided on the terminal device.

3. The game data interaction method according to claim 2, characterized in that, The second decrypted game data includes the game user's historical result data. The first encrypted game data, obtained by encrypting the game result data and the login credentials through the data processing middleware, includes: If the game result data and the historical result data meet the preset legal conditions, the game result data and the login credentials are encrypted through the data processing middleware to obtain the first encrypted game data.

4. The game data interaction method according to claim 1, characterized in that, After obtaining the game user's game operation data in the web game, the method further includes: When the game result data is abnormal, a prompt message indicating that the game operation data is abnormal will be output.

5. The game data interaction method according to claim 1, characterized in that, After uploading the first encrypted game data to the web game server, the process further includes: The web game server receives a verification result for the first encrypted game data, wherein the verification result is obtained by the web game server verifying the signature information obtained after decrypting the first encrypted game data and the first decrypted game data. If the verification result indicates that the first decrypted game data is abnormal, then a message indicating that the first decrypted game data is abnormal will be output.

6. The game data interaction method according to claim 5, characterized in that, The verification result is determined based on the first and second anomaly probabilities of the first decrypted game data. The first anomaly probability is obtained by performing anomaly detection on the first decrypted game data using linear regression, and the second anomaly probability is obtained by performing anomaly detection on the first decrypted game data using the isolated forest algorithm.

7. The game data interaction method according to claim 5, characterized in that, The method further includes: if the verification result is that the signature information is invalid, prohibiting the game user from accessing the game data stored on the web game server again.

8. The game data interaction method according to any one of claims 1-7, characterized in that, The data processing middleware is a WebAssembly middleware. The process of encrypting the game result data and the login credentials using the data processing middleware to obtain first encrypted game data includes: The WebAssembly middleware is invoked to perform JSON encoding on the signature information of the game result data generated based on the game result data and the login credentials, resulting in encoded data. The encoded data is encrypted using a preset symmetric encryption algorithm through the WebAssembly middleware to obtain the first encrypted game data.

9. A game data interaction device, characterized in that, The game data interaction device includes: The first acquisition unit is used to acquire the login credentials of the game user on the web game server; The second acquisition unit is used to acquire game operation data of the game user in the web game and to acquire game operation data generated based on the game user's operation in the web game. The calling unit is used to call a predefined web game data transmission function in the web game to transmit the game operation data to the data processing middleware corresponding to the web game, and call the data processing middleware corresponding to the web game to process the game operation data to obtain game result data. The data processing middleware supports at least two browsers, and the game result data is the game achievement of the game user in the web game. An encryption unit is used to encrypt the game result data and the login credentials through the data processing middleware to obtain the first encrypted game data; An interaction unit is used to upload the first encrypted game data to the web game server.

10. A computer device, characterized in that, It includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of the game data interaction method as described in any one of claims 1-8.

11. A computer-readable storage medium having a computer program stored thereon, wherein, When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1-8.

12. A computer program product, comprising a computer program or instructions, characterized in that, When the computer program or instructions are executed by the processor, they implement the steps of the game data interaction method as described in any one of claims 1 to 8.