Data acquisition method and device, terminal and storage medium
By configuring the hook function and the filtering and processing functions provided by the game engine on the electronic game client to filter and process the operation data, the problem of inaccurate operation data in the existing technology is solved, more efficient identification of abnormal operation behaviors is achieved, and the efficiency is improved Game fairness.
Patent Information
- Application Number
- CN202310206562.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-23
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2043-02-23
AI Technical Summary
When the existing technology detects operation data to identify abnormal operation behaviors in electronic games, the operation data obtained is not accurate enough and contains redundant data, which affects the fairness of the game.
By configuring the hook function on the game client, using the filter function and processing function provided by the game engine, filter and process the original operation data, obtain the target operation data whose execution frequency is consistent with the game frame rate, and obtain the target operation data and instructions through the hook function data to ensure data accuracy.
It improves the accuracy of operating data, reduces redundant data, enhances the ability to identify abnormal operating behaviors, and improves the fairness of the game.
Smart Images

Figure CN118526798A
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computer technology, and in particular to a data acquisition method, device, terminal and storage medium. Background Art
[0002] With the rapid development of computer technology, electronic games have become an increasingly popular form of entertainment. In electronic games, users compete with each other to win the game. However, some users use plug-in programs to cheat in order to win the game, which affects the fairness of electronic games. In order to avoid this problem, it is usually possible to collect user operation data and identify abnormal operation behaviors by detecting the operation data.
[0003] In the related art, the collection function provided by the operating system detects the operation data executed in the game, and the operation data can be obtained by hooking the collection function. However, since the operation data detected by the collection function are all the operation data executed by the user, and one frame of the game screen is only affected by one operation data, there are invalid operation data in these operation data that will not produce game performance, so the operation data obtained by this method is not accurate enough. Summary of the invention
[0004] The embodiments of the present application provide a data acquisition method, device, terminal and storage medium, which can improve the accuracy of acquired operation data. The technical solution is as follows:
[0005] On the one hand, a data acquisition method is provided, which is executed by a terminal, wherein a game client on the terminal is configured with a hook function, the game client includes a filter function and a processing function provided by a game engine, and the hook function is used to hook the processing function; the method comprises:
[0006] In the process of running the game client, calling the filtering function, obtaining original operation data executed in the game client, filtering the original operation data to obtain target operation data, wherein the execution frequency of the target operation data is consistent with the game frame rate in the game client;
[0007] Calling the processing function, obtaining the target operation data output by the filtering function, and determining the instruction data triggered by the target operation data;
[0008] The hook function is called to obtain the target operation data and the instruction data obtained by the processing function.
[0009] On the other hand, a data acquisition device is provided, which is arranged in a terminal, wherein a game client on the terminal is configured with a hook function, wherein the game client includes a filter function and a processing function provided by a game engine, and the hook function is used to hook the processing function; the device includes:
[0010] A data filtering module, used to call the filtering function during the running of the game client, obtain the original operation data executed in the game client, filter the original operation data, and obtain target operation data, wherein the execution frequency of the target operation data is consistent with the game frame rate in the game client;
[0011] A data processing module, used for calling the processing function, obtaining the target operation data output by the filtering function, and determining the instruction data triggered by the target operation data;
[0012] The data acquisition module is used to call the hook function to acquire the target operation data and the instruction data obtained by the processing function.
[0013] Optionally, the hook function includes a first hook function and a second hook function, and the processing function includes a processing input function and a processing instruction function;
[0014] The first hook function is used to hook the processing input function, and the processing input function is used to obtain the target operation data;
[0015] The second hook function is used to hook the processing instruction function, and the processing instruction function is used to determine the instruction data triggered by the target operation data.
[0016] Optionally, the data acquisition module is used to:
[0017] Calling the first hook function, acquiring input data of the processing input function, and obtaining the target operation data;
[0018] The second hook function is called to obtain the output data of the processing instruction function to obtain the instruction data.
[0019] Optionally, the processing input function includes a key input function and an axis input function, and the target operation data includes key operation data and axis operation data; the data processing module is used to:
[0020] Calling the key input function to obtain the key operation data output by the filtering function, wherein the key operation data includes at least one of keyboard click operation data, mouse click operation data, handle click operation data, and virtual button click operation data;
[0021] The axis input function is called to obtain the axis operation data output by the filter function, wherein the axis operation data includes at least one of mouse dragging operation data, handle shaking operation data, or sliding operation data on the screen.
[0022] Optionally, the data processing module is used to:
[0023] The processing instruction function is called to query the instruction data corresponding to the target operation data in a first mapping relationship table, wherein the first mapping relationship table is used to store any operation data and the corresponding instruction data.
[0024] Optionally, the device further comprises:
[0025] A first storage module, used for adding the target operation data to an operation data queue;
[0026] The second storage module is used to store the target operation data and the instruction data in a second mapping relationship table corresponding to each other, and the second mapping relationship table is used to store the acquired operation data and the corresponding instruction data.
[0027] Optionally, the device further comprises:
[0028] a query module, configured to clear the number of occurrences of the target instruction data to zero and input the operation data queue into the behavior recognition model when the number of occurrences of the target instruction data reaches the target number in the second mapping relationship table, wherein the target instruction data is any instruction data in the second mapping relationship table;
[0029] The identification module is used to call the behavior identification model and identify abnormal operation behavior based on the operation data queue.
[0030] Optionally, the first storage module is used to:
[0031] The operation data with the earliest acquisition time point in the operation data queue is deleted, and the target operation data is added to the operation data queue.
[0032] Optionally, the data filtering module is used to:
[0033] Calling a collection function provided by the operating system to detect the original operation data executed in the game client;
[0034] The filtering function is called to obtain the original operation data output by the collecting function.
[0035] Optionally, the device further comprises:
[0036] The rendering module is used to call the game function provided by the game server, obtain the instruction data output by the processing function, and render the game screen based on the instruction data.
[0037] On the other hand, a terminal is provided, comprising a processor and a memory, wherein the memory stores at least one computer program, and the at least one computer program is loaded and executed by the processor to implement the operations performed by the data acquisition method described in the above aspects.
[0038] On the other hand, a computer-readable storage medium is provided, in which at least one computer program is stored. The at least one computer program is loaded and executed by a processor to implement the operations performed by the data acquisition method described in the above aspects.
[0039] On the other hand, a computer program product is provided, including a computer program, wherein the computer program is loaded and executed by a processor to implement the operations performed by the data acquisition method as described in the above aspects.
[0040] In the solution provided by the embodiment of the present application, the filtering function provided by the game engine can filter the original operation data to obtain the target operation data whose execution frequency is consistent with the game frame rate, and the processing function provided by the game engine can receive the target operation data provided by the filtering function and determine the instruction data triggered by the target operation data. Therefore, by using the hook function to hook the processing function, the filtered target operation data and the corresponding instruction data can be obtained. Since the execution frequency of the target operation data is consistent with the game frame rate, each target operation data is effective operation data that can produce game performance, so the target operation data obtained by hooking in this way is more accurate. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0042] Figure 1 It is a schematic diagram of an implementation environment provided by an embodiment of the present application;
[0043] Figure 2 is a flow chart of a data acquisition method provided in an embodiment of the present application;
[0044] Figure 3 is a flow chart of another data acquisition method provided in an embodiment of the present application;
[0045] Figure 4 is a schematic diagram of filtering operation data provided by an embodiment of the present application;
[0046] Figure 5 is a flow chart of another data acquisition method provided in an embodiment of the present application;
[0047] Figure 6 It is a system architecture diagram of a data acquisition method provided in an embodiment of the present application;
[0048] Figure 7 is a structural schematic diagram of a data acquisition device provided in an embodiment of the present application;
[0049] Figure 8 is a structural schematic diagram of another data acquisition device provided in an embodiment of the present application;
[0050] Fig. 9 It is a structural diagram of a terminal provided in an embodiment of the present application. DETAILED DESCRIPTION
[0051] In order to make the objectives, technical solutions and advantages of the embodiments of the present application clearer, the implementation methods of the present application will be further described in detail below in conjunction with the accompanying drawings.
[0052] It is understood that the terms "first", "second", etc. used in this application may be used herein to describe various concepts, but unless otherwise specified, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another. For example, without departing from the scope of this application, a first hook function may be referred to as a second hook function, and similarly, a second hook function may be referred to as a first hook function.
[0053] Among them, at least one refers to one or more than one, for example, at least one function can be one function, two functions, three functions, or any other integer number of functions greater than or equal to one. Multiple refers to two or more than two, for example, multiple functions can be two functions, three functions, or any other integer number of functions greater than or equal to two. Each refers to each of at least one, for example, each function refers to each function of multiple functions, and if the multiple functions are 3 functions, each function refers to each function of the 3 functions.
[0054] It is understandable that in the implementation of the present application, related data such as user information is involved. When the above embodiments of the present application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions.
[0055] The data acquisition method provided in the embodiment of the present application can be used in a terminal. Optionally, the terminal is a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, a smart terminal, etc., but is not limited thereto.
[0056] Figure 1 is a schematic diagram of an implementation environment provided by an embodiment of the present application, see Figure 1 , the implementation environment includes: a terminal 101 and a server 102. The terminal 101 and the server 102 are connected via a wireless or wired network.
[0057] The embodiment of the present application is applied to the field of electronic games. The server 102 sends an installation package of a game client to the terminal 101. The installation package of the game client includes a filter function and a processing function provided by the game engine. After installing the game client, the terminal 101 calls the filter function and the processing function for processing. The filter function is used to obtain the original operation data executed in the game client, filter the original operation data, and obtain the target operation data whose execution frequency is consistent with the game frame rate. The processing function is used to obtain the target operation data output by the filter function, determine the instruction data triggered by the target operation data, and subsequently render the game screen based on the instruction data.
[0058] In a possible implementation, the installation package of the game client sent by the server 102 to the terminal 101 also includes a hook function, and the hook function is configured when the game client is installed. Alternatively, after the terminal 101 installs the game client, the server 102 sends the hook function to the game client, and the terminal 101 updates the game client and configures the hook function in the game client. The hook function is used to hook the processing function to obtain the target operation data and instruction data obtained by the processing function, thereby realizing the collection of the operation data and instruction data generated during the game process.
[0059] The data acquisition method provided in the embodiment of the present application can be applied to any scenario in which operation data or instruction data needs to be collected in any electronic game.
[0060] In a possible implementation, the embodiment of the present application is applied to the scenario of anti-cheating in games, and the game may be a shooting game, a fighting game, or a strategy simulation game, etc. Taking a shooting game as an example, the solution proposed in the embodiment of the present application by hooking the processing function provided by the game engine is adopted to collect the operation data performed by the player during the game. After the player's operation data is collected, the operation data is synchronized to the behavior recognition model of the local client at a specific time point, and the behavior recognition model is called to identify the player's abnormal operation behavior based on the operation data.
[0061] For example, the abnormal operation behavior includes using mouse macros, hanging up the game, or triggering game loopholes by performing specific operations. Macro operation refers to an operation or a group of operations used to automatically execute tasks, and mouse macro refers to a macro operation implemented by the mouse.
[0062] Figure 2 is a flow chart of a data acquisition method provided in an embodiment of the present application, which is executed by a terminal, see Figure 2 , the method comprising:
[0063] 201. When the terminal is running the game client, the terminal calls a filtering function to obtain original operation data executed in the game client, filters the original operation data, and obtains target operation data. The execution frequency of the target operation data is consistent with the game frame rate in the game client.
[0064] A game client is installed on the terminal, and the game client is configured with a hook function. The game client also includes a filter function and a processing function provided by the game engine. The hook function is used to hook the processing function. Among them, the hook function is used to add new processing logic without changing the original execution effect by modifying the original code. The filter function is used to filter the collected original operation data, and the processing function is used to receive the filtered operation data and determine the instruction data triggered by the operation data.
[0065] It should be noted that the filter function and the processing function are provided by the game engine, which is applicable to a variety of games, so the filter function and the processing function are also applicable to a variety of games, and the filter function and the processing function belong to the logic function of the game engine layer. The logic function of the game engine layer is a code developed based on the game engine and is applicable to different games. That is, all games using the game engine can configure the filter function and the processing function in the game client.
[0066] In an embodiment of the present application, the terminal calls the filter function during the operation of the game client to obtain the original operation data executed in the game client. The original operation data refers to the operation data executed by the user. The user can perform multiple operations per second, and the operation data generated by multiple operations can be obtained per second. Multiple frames of game screens can be generated per second in the game client, and one frame of game screen may correspond to the operation data generated by multiple operations, resulting in the game screen and the operation data not being one-to-one corresponding. Some operation data can affect the game screen, and some operation data cannot affect the game screen, that is, there is redundant operation data. Therefore, the terminal calls the filter function to filter the original operation data, and obtains the target operation data whose execution frequency is consistent with the game frame rate of the game client, so that the target operation data is consistent with the game screen, ensuring that the target operation data are all valid operation data, and there is no redundant operation data.
[0067] 202. The terminal calls a processing function, obtains target operation data output by a filtering function, and determines instruction data triggered by the target operation data.
[0068] The output data of the filter function is used to be passed into the processing function as the input data of the processing function. The terminal calls the processing function, obtains the target operation data output by the filter function, and determines the instruction data triggered by the target operation data. For example, if the target operation data is to slide the mouse to the left, the instruction data triggered by the target operation data is to control the virtual object to move to the left.
[0069] 203. The terminal calls the hook function to obtain the target operation data and instruction data obtained by the processing function.
[0070] Since the hook function is used to hook the processing function, the target operation data and instruction data obtained by the processing function can be obtained by calling the hook function. For example, the hook function obtains the input data and output data of the processing function by hooking the processing function, the target operation data is the input data of the processing function, and the instruction data is the output data of the processing function, so the hook function can obtain the target operation data and the instruction data.
[0071] In the method provided by the embodiment of the present application, the filtering function provided by the game engine can filter the original operation data to obtain the target operation data whose execution frequency is consistent with the game frame rate, and the processing function provided by the game engine can receive the target operation data provided by the filtering function and determine the instruction data triggered by the target operation data. Therefore, by using the hook function to hook the processing function, the filtered target operation data and the corresponding instruction data can be obtained. Since the execution frequency of the target operation data is consistent with the game frame rate, each target operation data is effective operation data that can produce game performance, so the target operation data obtained by hooking in this way is more accurate.
[0072] Moreover, since the hook function is hooked to the processing function provided by the game engine, and the game engine is applicable to a variety of games, the processing function is also applicable to a variety of games. Therefore, it is only necessary to develop a hook function applicable to the processing function, and the hook function can be applicable to a variety of games, thereby improving applicability.
[0073] Above Figure 2 The embodiment shown briefly illustrates the process of obtaining operation data and instruction data. Figure 2 Based on the embodiment shown, the hook function can be divided into a first hook function and a second hook function, and the processing function can be divided into a processing input function and a processing instruction function. The detailed process of obtaining the operation data and the instruction data is as follows. Figure 3 The embodiment shown. Figure 3 is a flow chart of a data acquisition method provided in an embodiment of the present application, which is executed by a terminal, see Figure 3 , the method comprising:
[0074] 301. The terminal runs the game client.
[0075] A game client is installed on the terminal, and the game client is configured with a hook function. The game client also includes a filter function and a processing function provided by a game engine, and the hook function is used to hook the processing function. In the embodiment of the present application, the hook function includes a first hook function and a second hook function, and the processing function includes a processing input function and a processing instruction function. Among them, the first hook function is used to hook the processing input function, and the processing input function is used to obtain target operation data. The second hook function is used to hook the processing instruction function, and the processing instruction function is used to determine the instruction data triggered by the target operation data.
[0076] It should be noted that the embodiment of the present application does not limit the types of the processing input function and the processing instruction function, nor does it limit the hook positions of the first hook function and the second hook function. For example, the processing input function may be the InputAxis function in Unreal Engine, or the GetAxis function in Unity (a game engine).
[0077] In one possible implementation, the terminal downloads an installation package of the game client, which includes the hook function, the filter function and the processing function. The terminal installs the game client through the installation package, thereby configuring the filter function, the processing function and the hook function in the game client, and hooking the hook function to the processing function.
[0078] In another possible implementation, the terminal downloads an installation package of the game client, the installation package includes the filter function and the processing function, and the terminal installs the game client through the installation package, thereby configuring the filter function and the processing function in the game client. The terminal can subsequently download a hook function separately from the game server through the game client, configure the hook function in the game client, and hook the hook function to the processing function. The hook function is a dynamic code, which can be sent to the game client in real time, so as to facilitate adjustment or modification of the hook function.
[0079] 302. When the terminal is running the game client, the terminal calls a filtering function to obtain original operation data executed in the game client, filters the original operation data, and obtains target operation data. The execution frequency of the target operation data is consistent with the game frame rate in the game client.
[0080] When the terminal is running the game client, the filter function is called to obtain the original operation data executed in the game client, and the original operation data is filtered to obtain the target operation data whose execution frequency is consistent with the game frame rate of the game client, so that the target operation data is consistent with the game screen, ensuring that the target operation data are all valid operation data and there is no redundant operation data.
[0081] In a possible implementation, the operating system of the terminal provides a collection function, which belongs to the logic function of the operating system layer. The logic function of the operating system layer is the code provided by the operating system where the game client runs. When the terminal runs the game client, the collection function is called to detect the original operation data executed in the game client. The original operation data is the operation data generated by any operation performed by the user and associated with the game client. The terminal calls the filtering function to obtain the original operation data output by the collection function. The output data of the collection function is used to be passed into the filtering function as the input data of the filtering function.
[0082] The collection function is located in the operating system of the terminal, and the raw operation data collected by the collection function can be transmitted to any application running on the operating system. For example, taking Windows (an operating system) as an example, the raw operation data collected by the collection function can be transmitted to the currently selected window. In the embodiment of the present application, when the terminal is running a game client, the game window corresponding to the game client is selected, and the raw operation data collected by the collection function will be transmitted to the filtering function in the game client.
[0083] Figure 4 is a schematic diagram of filtering operation data provided by an embodiment of the present application, such as Figure 4 As shown, the collection function provided by the operating system collects the original operation data. Figure 4 Taking the original operation data including the original operation data 1-6 as an example, the filtering function provided by the game engine filters these original operation data. The filtering principle is to make the execution frequency of the remaining operation data consistent with the game frame rate. Figure 4 Taking filtering out original operation 1, original operation data 3, original operation data 4 and original operation data 6 as an example, the remaining original operation data 2 and original operation data 5 are used as target operation data, and the triggered instruction data is subsequently determined based on the target operation data, and then the game screen is rendered according to the instruction data, so that the target operation data is closer to the final game performance. For example, the original operation data 1-6 is to drag the mouse down to press the gun, and multiple operation data of dragging the mouse down will be detected within the duration corresponding to a frame of the game screen. By filtering the operation data, the original operation data 2 and original operation data 5 will finally affect the game performance.
[0084] 303. The terminal calls the processing input function to obtain the target operation data output by the filtering function.
[0085] The target operation data output by the filter function is transferred to the processing input function, and the terminal calls the processing input function to obtain the target operation data output by the filter function.
[0086] In a possible implementation, the processing input function includes a key input function and an axis input function, and the target operation data includes key operation data and axis operation data. Then the terminal calls the processing function to obtain the target operation data output by the filtering function, including the following two cases.
[0087] The first case: the terminal calls the key input function to obtain the key operation data output by the filtering function, and the key operation data includes at least one of the click operation data of the keyboard, the click operation data of the mouse, the click operation data of the handle, or the click operation data of the virtual button. The key input function is used to collect the filtered key operation data, the keyboard, the mouse and the handle are different types of input devices connected to the terminal, and the virtual button refers to the virtual button displayed on the screen of the terminal.
[0088] Optionally, the button on the mouse is regarded as an axis, and when the axis is pushed to the maximum angle (i.e., pressed to the bottom), the click operation of the mouse is performed, and the click operation of the mouse will be executed cyclically, that is, if the button on the mouse is continuously pressed to the bottom for a period of time, it will be cyclically recognized as executing multiple click operations. However, the click operation of the button on the keyboard will not be executed cyclically, that is, no matter how long the button on the keyboard is pressed, it will be recognized as executing a click operation, and when the button is released and pressed again, it will be recognized as the second click operation.
[0089] Optionally, the click operation data of the keyboard, mouse, handle and virtual button include key value and key duration, etc. Each key on the keyboard, mouse and handle and each virtual button on the terminal corresponds to a key value.
[0090] The second situation: the terminal calls the axis input function to obtain the axis operation data output by the filter function, where the axis operation data includes at least one of the dragging operation data of the mouse, the shaking operation data of the handle, or the sliding operation data on the screen.
[0091] The dragging operation data of the mouse, the shaking operation data of the handle or the sliding operation data on the screen include the moving displacement and the moving duration, etc. By detecting the axis operation data, the automatic hanging macro or the gun pressing macro, etc. can be identified.
[0092] Taking the mouse dragging operation data as an example, the mouse is simulated by the game engine as a device with two input axes, which are the X axis and the Y axis. The dragging operation data packet contains the mouse dragging operation data on the X axis and the mouse dragging operation data on the Y axis.
[0093] 304. The terminal calls the first hook function, obtains input data of the processing input function, and obtains target operation data.
[0094] Since the first hook function is used to hook the processing input function, before calling the processing input function to obtain the target operation data, the first hook function is first called to obtain the target operation data to be passed into the processing input function, and after the first hook function obtains the target operation data, the processing input function is called again to obtain the target operation data. This is equivalent to calling the first hook function to obtain the input data of the processing input function, and the input data of the processing input function is the target operation data, so that the target operation data is obtained by calling the first hook function.
[0095] 305. The terminal calls a processing instruction function to determine instruction data triggered by the target operation data.
[0096] The target operation data is also passed into the processing instruction function. The terminal calls the processing input function, processes the instruction function, and determines the instruction data triggered by the target operation data.
[0097] Among them, different operation data are used to trigger different command data, for example, the click operation data of the shooting button is used to trigger the shooting command data, the click operation data of the switching gun button is used to trigger the switching gun command data, the click operation data of the jump button is used to trigger the jump command data, the click operation data of the crouch button is used to trigger the crouch command data, the left slide operation data of the mouse is used to trigger the command data for moving the viewing angle to the left, the right slide operation data of the mouse is used to trigger the command data for moving the viewing angle to the right, the down slide operation data of the mouse is used to trigger the command data for moving the viewing angle downward, the up slide operation data of the mouse is used to trigger the command data for moving the viewing angle upward, the click operation data of the w button on the keyboard is used to trigger the command data for controlling the virtual object to move forward, etc.
[0098] In a possible implementation, a first mapping relationship table is stored in the game client, and the first mapping relationship table is used to store any operation data and corresponding instruction data. The terminal calls the processing instruction function and searches the first mapping relationship table for the instruction data corresponding to the target operation data.
[0099] 306. The terminal calls the second hook function, obtains the output data of the processing instruction function, and obtains instruction data.
[0100] Since the second hook function is used to hook the processing instruction function, after calling the processing instruction function to obtain the instruction data, the second hook function is called to obtain the output data of the processing instruction function. The output data of the processing instruction function is the instruction data, and the target instruction data is obtained by calling the second hook function.
[0101] In an embodiment of the present application, the hook function is hooked to a processing function provided by the game engine. Since the processing function obtains filtered target operation data, the execution frequency of the target operation data is consistent with the game frame rate. Therefore, the operation data obtained by hooking in this way are all effective operation data that can produce game performance, thereby improving accuracy.
[0102] Furthermore, by hooking the hook function with the processing function provided by the game engine, the instruction data determined by the game engine can be directly obtained, and the instruction data triggered by each target operation data can be clearly obtained. Since the game engine is applicable to a variety of games, the method is also applicable to a variety of games, which improves the versatility of the data acquisition method. There is no need to develop different hook functions for different games to perceive the instructions generated in the game, which further assists in confirming the actual meaning of each target operation data, effectively reducing the workload of game adaptation.
[0103] By executing the above steps 303-304, the terminal calls the processing function, obtains the target operation data output by the filtering function, determines the instruction data triggered by the target operation data, calls the hook function, and obtains the target operation data and instruction data obtained by the processing function.
[0104] In the method provided by the embodiment of the present application, the filtering function provided by the game engine can filter the original operation data to obtain the target operation data whose execution frequency is consistent with the game frame rate, and the processing function provided by the game engine can receive the target operation data provided by the filtering function and determine the instruction data triggered by the target operation data. Therefore, by using the hook function to hook the processing function, the filtered target operation data and the corresponding instruction data can be obtained. Since the execution frequency of the target operation data is consistent with the game frame rate, each target operation data is effective operation data that can produce game performance, so the target operation data obtained by hooking in this way is more accurate.
[0105] In the above Figure 2 and Figure 3 On the basis of the embodiment shown, after acquiring the target operation data and instruction data, abnormal operation behavior can also be identified based on the target operation data and instruction data. For detailed process, please refer to the embodiment shown in Figure 5 below. Figure 5 is a flowchart of another data acquisition method provided in an embodiment of the present application, which is executed by a terminal, see Figure 5 , the method comprising:
[0106] 501. The terminal runs the game client.
[0107] The game client on the terminal is configured with a hook function, and the game client includes a filter function and a processing function provided by the game engine, and the hook function is used to hook the processing function. The process of step 501 is the same as the process of step 301 above, and will not be repeated here.
[0108] 502. When the terminal is running the game client, the terminal calls a filtering function to obtain original operation data executed in the game client, filters the original operation data, and obtains target operation data. The execution frequency of the target operation data is consistent with the game frame rate in the game client.
[0109] The process of step 502 is the same as the process of steps 201 and 301 above, and will not be repeated here.
[0110] 503. The terminal calls the processing function, obtains the target operation data output by the filtering function, and determines the instruction data triggered by the target operation data.
[0111] The process of step 503 is the same as the process of steps 202, 303 and 305, and will not be described again here.
[0112] 504. The terminal calls the hook function to obtain the target operation data and instruction data obtained by the processing function.
[0113] The process of step 504 is the same as the process of steps 203, 304 and 306, and will not be described again.
[0114] 505. The terminal calls the game function provided by the game server, obtains the instruction data output by the processing function, and renders the game screen based on the instruction data.
[0115] The game client also includes a game function provided by the game server. The game function belongs to the logic function of the game layer. The logic function of the game layer is the code logic written by the game developer himself, which is different from game to game. The game function is used to render the game screen based on the instruction data. The terminal calls the game function, processes the instruction data output by the function, and then renders the game screen matching the instruction data according to the instruction of the instruction data. For example, if the instruction data indicates to control the virtual object to move to the left, the game screen rendered based on the instruction data is the game screen that controls the virtual object to move to the left.
[0116] Since the execution frequency of the target operation data is consistent with the game frame rate, redundant data is filtered out. The instruction data is triggered by the target operation data, and the game screen is rendered based on the instruction data, so that the target operation data is closer to the game performance generated based on the instruction data. Therefore, the target operation data obtained in the embodiments of the present application are all valid operation data.
[0117] 506. The terminal adds the target operation data to the operation data queue.
[0118] After the terminal calls the hook function to obtain the target operation data, it continues to call the hook function to add the target operation data to the operation data queue, and the operation data queue is used to store the obtained operation data. Optionally, the hook function includes a first hook function, and the first hook function is used to obtain the target operation data, and the terminal calls the first hook function to add the target operation data to the operation data queue.
[0119] In one possible implementation, the terminal deletes the earliest operation data in the operation data queue and adds the target operation data to the operation data queue. In the embodiment of the present application, whenever new operation data is added to the operation data queue, the old operation data in the operation data queue is deleted, so the operation data queue can be a queue of fixed length, thereby ensuring that the latest operation data is recorded with minimal memory loss.
[0120] Optionally, the operation data queue is a circular queue, and the operation data in the circular queue are arranged in the order of acquisition time points. The terminal deletes the last operation data in the operation data queue and adds the target operation data as the first operation data to the operation data queue.
[0121] Optionally, the target operation data includes key operation data and axis operation data, and the operation data queue includes a key operation data queue and an axis operation data queue. The terminal deletes the key operation data with the earliest acquisition time point in the key operation data queue, adds the currently acquired key operation data to the key operation data queue, and deletes the axis operation data with the earliest acquisition time point in the axis operation data queue, and adds the currently acquired axis operation data to the axis operation data queue.
[0122] 507. The terminal stores the target operation data and the instruction data in a second mapping relationship table in correspondence with each other. The second mapping relationship table is used to store the acquired operation data and the corresponding instruction data.
[0123] After the terminal calls the hook function to obtain the target operation data and the instruction data, it continues to call the hook function to store the target operation data and the instruction data in the second mapping relationship table. Optionally, the hook function includes a second hook function, which obtains the instruction data triggered by the target operation data, and the terminal calls the second hook function to store the target operation data and the instruction data in the second mapping relationship table.
[0124] In a possible implementation, the second mapping relationship table is a key-value hash table. Since the query logic of the hash table is relatively simple, using the hash table to store the mapping relationship can reduce the impact of the newly added logic corresponding to the hook function on the game performance. The hash table is shown in Table 1 below.
[0125] Table 1
[0126] key value Operational data 1 Instruction data 1 Operational Data 2 Instruction data 2 Operational Data 3 Instruction data 3 …… ……
[0127] As shown in Table 1, the operation data is used as the key and the instruction data is used as the value and is stored in the hash table. The operation data and the instruction data correspond to each other one by one and are stored accordingly.
[0128] 508. When the terminal finds that the number of occurrences of the target instruction data reaches the target number in the second mapping relationship table, the number of occurrences of the target instruction data is cleared and the operation data queue is input into the behavior recognition model. The target instruction data is any instruction data in the second mapping relationship table.
[0129] The terminal periodically queries the number of occurrences of each instruction data in the second mapping relationship table. When the terminal finds that the number of occurrences of the target instruction data reaches the target number, the number of occurrences of the target instruction data is cleared and the operation data queue is input into the behavior recognition model.
[0130] Among them, the target instruction data can be any instruction data in the second mapping relationship table. For example, if the target number is N (N is a positive integer), and the target instruction data is an instruction to control the virtual object to shoot, then when the number of virtual object shooting reaches N times, the operation data queue is input into the behavior recognition model. Or if the target instruction data is an instruction for the virtual object to defeat the enemy, then when the number of enemies defeated by the virtual object reaches N, the operation data queue is input into the behavior recognition model. Or if the target instruction data is for the virtual object to perform a target action, then when the number of times the virtual object performs the target action reaches N times, the operation data queue is input into the behavior recognition model.
[0131] The behavior recognition model is used to identify abnormal operation behaviors based on the operation data queue. Optionally, the behavior recognition model is stored in the game client, and the terminal directly inputs the operation data queue into the behavior recognition model. Optionally, the behavior recognition model is stored in the game server, and the terminal reports the operation data queue to the game server, and the operation data queue is input into the behavior recognition model through the game server.
[0132] In one possible implementation, the game client also includes a data reporting function, which is issued together with the hook function and configured in the game client. When the terminal calls the data reporting function and finds in the second mapping table that the number of occurrences of the target instruction data reaches the target number, the number of occurrences of the target instruction data is cleared and the operation data queue is input into the behavior recognition model.
[0133] In the embodiment of the present application, the data reporting function and the hook function are both dynamic codes sent to the game client. The data reporting function loops through the operation data queue maintained by the first hook function, and queries the number of occurrences of each instruction data according to the second mapping relationship table maintained by the second hook function. If the number of occurrences reaches the target number, the current operation data queue is sent to the behavior recognition model, and the number of occurrences of the instruction data is cleared synchronously. When the number of occurrences of the instruction data reaches the target number again, the current operation data queue is sent to the behavior recognition model again.
[0134] It should be noted that the execution logic of the above steps 506, 507 and 508 is asynchronous, that is, they are independent of each other. The embodiment of the present application does not limit the execution order between the above steps 506, 507 and 508.
[0135] 509. The terminal call behavior recognition model identifies abnormal operation behaviors based on the operation data queue.
[0136] The terminal calls the behavior recognition model to recognize the operation data in the operation data queue, thereby identifying whether the current operation data is generated by abnormal operation behavior. The abnormal operation behavior includes using mouse macros, hanging up behavior, or game loopholes triggered by executing specific operations.
[0137] In a possible implementation, the training data of the behavior recognition model is also obtained by the data acquisition method provided in the embodiment of the present application. Redundant operation data will cause differences in the characteristic distribution of the original operation data samples. Under the condition of a limited number of samples, the behavior recognition model may learn to capture the characteristic changes caused by redundant data, but this part of the characteristic changes is not caused by abnormal operation behavior, so it will cause the behavior recognition model to overfit meaningless data for classification, affecting the discrimination accuracy. However, since the operation data obtained by the embodiment of the present application are all valid operation data, they have an impact on the game performance. Therefore, the operation data obtained by the data acquisition method provided in the embodiment of the present application is used to train the behavior recognition model, which can avoid the behavior recognition model on invalid operation data, thereby improving the discrimination accuracy of the behavior recognition model. The subsequent call of the behavior recognition model to identify the valid operation data obtained by the embodiment of the present application can improve the accuracy of identifying abnormal operation behavior.
[0138] In the method provided by the embodiment of the present application, the filtering function provided by the game engine can filter the original operation data to obtain the target operation data whose execution frequency is consistent with the game frame rate, and the processing function provided by the game engine can receive the target operation data provided by the filtering function and determine the instruction data triggered by the target operation data. Therefore, by using the hook function to hook the processing function, the filtered target operation data and the corresponding instruction data can be obtained. Since the execution frequency of the target operation data is consistent with the game frame rate, each target operation data is effective operation data that can produce game performance, so the target operation data obtained by hooking in this way is more accurate.
[0139] Figure 6 is a system architecture diagram of a data acquisition method provided in an embodiment of the present application, such as Figure 6 As shown, the game server sends a dynamic code to the game client, and the dynamic code includes a first hook function, a second hook function and a data reporting function. The first hook function and the second hook function are used to hook the logic function of the game engine layer. The first hook function obtains an operation data queue, and the operation data queue is used to store the obtained operation data. The second hook function obtains a second mapping relationship table, and the second mapping relationship table is used to store the obtained operation data and the corresponding instruction data. The data reporting function periodically queries the second mapping relationship table. When the number of occurrences of the target instruction data in the second mapping relationship table reaches the target number, the operation data queue maintained by the first hook function is reported to the game server, and the game server calls the behavior recognition model to identify abnormal behavior data based on the operation data queue.
[0140] The method provided in the embodiment of the present application switches the acquisition logic of operation data from the operating system layer to the game engine layer, obtains filtered operation data, and makes the acquired operation data more suitable for game performance. Switching the acquisition logic of instruction data from the game layer to the game engine layer eliminates the need to develop different acquisition logics for different games, thereby reducing the workload of game adaptation.
[0141] Moreover, by hooking into the processing instruction function provided by the game engine, it is possible to not only perceive the instruction data generated in the game, but also perceive the operation data that triggers each instruction data, that is, perceive the correspondence between the operation data and the instruction data, which is conducive to the subsequent analysis of the user's abnormal operation behavior through the operation data and the corresponding instruction data.
[0142] In order to verify the effectiveness of the embodiments of the present application, experiments were conducted using the operation data obtained by the methods provided by the relevant technology and the method provided by the present application to identify mouse macros in shooting games. The operation data obtained by the methods of the relevant technology are operation data obtained from the operating system layer, and the execution frequency of the operation data is higher than the game frame rate. The operation data obtained by the method provided by the embodiments of the present application are operation data obtained from the game engine layer, and the execution frequency of the operation data is consistent with the game frame rate.
[0143] Among them, the recognition amount of the operation data obtained by the method of the related technology and the recognition amount of the operation data obtained by the method of the embodiment of the present application are shown in the following Table 2.
[0144] Table 2
[0145] The average daily recognition volume of the embodiment of the present application Average daily recognition volume of related technologies Mouse click macro 73 38 Gun mouse macro 147 33 Total 220 71
[0146] As shown in Table 2, the average daily recognition volume of the embodiment of the present application is significantly higher than the average daily recognition volume of the related art.
[0147] Among them, the game adaptation time of the method using the related technology and the game adaptation time of the method of the embodiment of the present application of CaiTong are shown in the following Table 3.
[0148] Table 3
[0149]
[0150] Game 1 and Game 2 are developed based on the same game engine. Therefore, by using the method provided in the embodiment of the present application, after Game 1 completes the adaptation of the game engine, only a small amount of time needs to be invested in verification when Game 2 is adapted for the first time. However, by using the method provided by the related technology, both Game 1 and Game 2 need to use a longer time to complete the first adaptation. In addition, during the game update adaptation process, since the related technology is to hook the logical function of the game layer, each update requires a long time to update the hook position, while this solution is to hook the logical function of the game engine layer. Game updates will not cause changes in the logical function of the game engine layer, so there is no need to update the hook position, and only a small amount of time is required to confirm that the solution is feasible.
[0151] Figure 7 is a structural diagram of a data acquisition device provided in an embodiment of the present application. Figure 7 The device is arranged in a terminal, a game client on the terminal is configured with a hook function, the game client includes a filter function and a processing function provided by a game engine, and the hook function is used to hook the processing function; the device includes:
[0152] The data filtering module 701 is used to call the filtering function during the running of the game client, obtain the original operation data executed in the game client, filter the original operation data, and obtain the target operation data, the execution frequency of the target operation data is consistent with the game frame rate in the game client;
[0153] The data processing module 702 is used to call the processing function, obtain the target operation data output by the filtering function, and determine the instruction data triggered by the target operation data;
[0154] The data acquisition module 703 is used to call the hook function to acquire the target operation data and the instruction data obtained by the processing function.
[0155] In the data acquisition device provided by the embodiment of the present application, the filter function provided by the game engine can filter the original operation data to obtain the target operation data whose execution frequency is consistent with the game frame rate, and the processing function provided by the game engine can receive the target operation data provided by the filter function and determine the instruction data triggered by the target operation data. Therefore, by using the hook function to hook the processing function, the filtered target operation data and the corresponding instruction data can be obtained. Since the execution frequency of the target operation data is consistent with the game frame rate, each target operation data is effective operation data that can produce game performance, so the target operation data obtained by hooking in this way is more accurate.
[0156] Alternatively, see Figure 8 , the hook function includes a first hook function and a second hook function, and the processing function includes a processing input function and a processing instruction function;
[0157] The first hook function is used to hook the processing input function, and the processing input function is used to obtain the target operation data;
[0158] The second hook function is used to hook the processing instruction function, and the processing instruction function is used to determine the instruction data triggered by the target operation data.
[0159] Alternatively, see Figure 8 , the data acquisition module 703 is used to:
[0160] Calling the first hook function, obtaining the input data of the processing input function, and obtaining the target operation data;
[0161] The second hook function is called to obtain the output data of the processing instruction function to obtain the instruction data.
[0162] Alternatively, see Figure 8, the processing input function includes a key input function and an axis input function, and the target operation data includes key operation data and axis operation data; the data processing module 702 is used to:
[0163] Calling the key input function to obtain the key operation data output by the filtering function, where the key operation data includes at least one of keyboard click operation data, mouse click operation data, handle click operation data, or virtual button click operation data;
[0164] The axis input function is called to obtain the axis operation data output by the filter function, wherein the axis operation data includes at least one of the dragging operation data of the mouse, the shaking operation data of the handle, or the sliding operation data on the screen.
[0165] Alternatively, see Figure 8 , the data processing module 702 is used to:
[0166] The processing instruction function is called to search the instruction data corresponding to the target operation data in a first mapping relationship table, where the first mapping relationship table is used to store any operation data and the corresponding instruction data.
[0167] Alternatively, see Figure 8 , the device further comprises:
[0168] A first storage module 704, configured to add the target operation data to an operation data queue;
[0169] The second storage module 705 is used to store the target operation data and the instruction data in a second mapping relationship table corresponding to each other. The second mapping relationship table is used to store the acquired operation data and the corresponding instruction data.
[0170] Alternatively, see Figure 8 , the device further comprises:
[0171] A query module 706 is used to reset the number of occurrences of the target instruction data to zero when the number of occurrences of the target instruction data in the second mapping relationship table reaches the target number of occurrences, and input the operation data queue into the behavior recognition model. The target instruction data is any instruction data in the second mapping relationship table;
[0172] The identification module 707 is used to call the behavior identification model and identify abnormal operation behavior based on the operation data queue.
[0173] Alternatively, see Figure 8 , the first storage module 704 is used to:
[0174] The operation data with the earliest acquisition time point in the operation data queue is deleted, and the target operation data is added to the operation data queue.
[0175] Alternatively, see Figure 8 The data filtering module 701 is used to:
[0176] Calling a collection function provided by the operating system to detect the original operation data executed in the game client;
[0177] The filter function is called to obtain the original operation data output by the collection function.
[0178] Alternatively, see Figure 8 , the device further comprises:
[0179] The rendering module 708 is used to call the game function provided by the game server, obtain the instruction data output by the processing function, and render the game screen based on the instruction data.
[0180] It should be noted that: the data acquisition device provided in the above embodiment 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 terminal is divided into different functional modules to complete all or part of the functions described above. In addition, the data acquisition device provided in the above embodiment and the data acquisition method embodiment belong to the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.
[0181] An embodiment of the present application further provides a terminal, which includes a processor and a memory, wherein at least one computer program is stored in the memory, and the at least one computer program is loaded and executed by the processor to implement the operations performed in the data acquisition method of the above embodiment.
[0182] Fig. 9 A schematic structural diagram of a terminal 900 provided by an exemplary embodiment of the present application is shown.
[0183] The terminal 900 includes a processor 901 and a memory 902 .
[0184] The processor 901 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and the like. The processor 901 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field Programmable Gate Array), and PLA (Programmable Logic Array). The processor 901 may also include a main processor and a coprocessor. The main processor is a processor for processing data in an awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 901 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 901 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.
[0185] The memory 902 may include one or more computer-readable storage media, which may be non-transitory. The memory 902 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 902 is used to store at least one computer program, which is used to be possessed by the processor 901 to implement the data acquisition method provided in the method embodiment of the present application.
[0186] In some embodiments, the terminal 900 may further optionally include: a peripheral device interface 903 and at least one peripheral device. The processor 901, the memory 902 and the peripheral device interface 903 may be connected via a bus or a signal line. Each peripheral device may be connected to the peripheral device interface 903 via a bus, a signal line or a circuit board. Optionally, the peripheral device includes: at least one of a radio frequency circuit 904, a display screen 905, a camera assembly 906, an audio circuit 907 and a power supply 908.
[0187] The peripheral device interface 903 may be used to connect at least one peripheral device related to I / O (Input / Output) to the processor 901 and the memory 902. In some embodiments, the processor 901, the memory 902, and the peripheral device interface 903 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 901, the memory 902, and the peripheral device interface 903 may be implemented on a separate chip or circuit board, which is not limited in this embodiment.
[0188] The radio frequency circuit 904 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuit 904 communicates with communication networks and other communication devices through electromagnetic signals. The radio frequency circuit 904 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals into electrical signals. Optionally, the radio frequency circuit 904 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, and the like. The radio frequency circuit 904 can communicate with other devices through at least one wireless communication protocol. The wireless communication protocol includes, but is not limited to: a metropolitan area network, various generations of mobile communication networks (2G, 3G, 4G and 5G), a wireless local area network and / or a WiFi (Wireless Fidelity) network. In some embodiments, the radio frequency circuit 904 may also include circuits related to NFC (Near Field Communication), which is not limited in this application.
[0189] The display screen 905 is used to display the UI (User Interface). The UI may include graphics, text, icons, videos, and any combination thereof. When the display screen 905 is a touch display screen, the display screen 905 also has the ability to collect touch signals on the surface or above the surface of the display screen 905. The touch signal can be input to the processor 901 as a control signal for processing. At this time, the display screen 905 can also be used to provide virtual buttons and / or virtual keyboards, also known as soft buttons and / or soft keyboards. In some embodiments, the display screen 905 can be one, set on the front panel of the terminal 900; in other embodiments, the display screen 905 can be at least two, respectively set on different surfaces of the terminal 900 or in a folding design; in other embodiments, the display screen 905 can be a flexible display screen, set on the curved surface or folding surface of the terminal 900. Even, the display screen 905 can also be set to a non-rectangular irregular shape, that is, a special-shaped screen. The display screen 905 can be made of materials such as LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode, organic light-emitting diode).
[0190] The camera assembly 906 is used to capture images or videos. Optionally, the camera assembly 906 includes a front camera and a rear camera. The front camera is arranged on the front panel of the terminal 900, and the rear camera is arranged on the back of the terminal 900. In some embodiments, there are at least two rear cameras, which are any one of a main camera, a depth of field camera, a wide-angle camera, and a telephoto camera, so as to realize the fusion of the main camera and the depth of field camera to realize the background blur function, the fusion of the main camera and the wide-angle camera to realize panoramic shooting and VR (Virtual Reality) shooting function or other fusion shooting functions. In some embodiments, the camera assembly 906 may also include a flash. The flash can be a monochrome temperature flash or a dual-color temperature flash. A dual-color temperature flash refers to a combination of a warm light flash and a cold light flash, which can be used for light compensation at different color temperatures.
[0191] The audio circuit 907 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, and convert the sound waves into electrical signals and input them into the processor 901 for processing, or input them into the radio frequency circuit 904 to achieve voice communication. For the purpose of stereo acquisition or noise reduction, there may be multiple microphones, which are respectively arranged at different parts of the terminal 900. The microphone may also be an array microphone or an omnidirectional acquisition microphone. The speaker is used to convert the electrical signal from the processor 901 or the radio frequency circuit 904 into sound waves. The speaker may be a traditional film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can not only convert the electrical signal into sound waves audible to humans, but also convert the electrical signal into sound waves inaudible to humans for purposes such as ranging. In some embodiments, the audio circuit 907 may also include a headphone jack.
[0192] The power supply 908 is used to power various components in the terminal 900. The power supply 908 can be an alternating current, a direct current, a disposable battery, or a rechargeable battery. When the power supply 908 includes a rechargeable battery, the rechargeable battery can support wired charging or wireless charging. The rechargeable battery can also be used to support fast charging technology.
[0193] In some embodiments, the terminal 900 further includes one or more sensors 909 . The one or more sensors 909 include, but are not limited to: an acceleration sensor 910 , a gyroscope sensor 911 , a pressure sensor 912 , an optical sensor 913 , and a proximity sensor 914 .
[0194] The acceleration sensor 910 can detect the magnitude of acceleration on the three coordinate axes of the coordinate system established by the terminal 900. For example, the acceleration sensor 910 can be used to detect the components of gravity acceleration on the three coordinate axes. The processor 901 can control the display screen 905 to display the user interface in a horizontal view or a vertical view according to the gravity acceleration signal collected by the acceleration sensor 910. The acceleration sensor 910 can also be used to collect motion data of games or users.
[0195] The gyro sensor 911 can detect the body direction and rotation angle of the terminal 900, and the gyro sensor 911 can cooperate with the acceleration sensor 910 to collect the user's 3D actions on the terminal 900. The processor 901 can implement the following functions based on the data collected by the gyro sensor 911: motion sensing (such as changing the UI according to the user's tilt operation), image stabilization during shooting, game control, and inertial navigation.
[0196] The pressure sensor 912 can be set on the side frame of the terminal 900 and / or the lower layer of the display screen 905. When the pressure sensor 912 is set on the side frame of the terminal 900, it can detect the user's holding signal of the terminal 900, and the processor 901 performs left and right hand recognition or shortcut operation according to the holding signal collected by the pressure sensor 912. When the pressure sensor 912 is set on the lower layer of the display screen 905, the processor 901 controls the operability controls on the UI interface according to the user's pressure operation on the display screen 905. The operability controls include at least one of a button control, a scroll bar control, an icon control, and a menu control.
[0197] The optical sensor 913 is used to collect the ambient light intensity. In one embodiment, the processor 901 can control the display brightness of the display screen 905 according to the ambient light intensity collected by the optical sensor 913. Optionally, when the ambient light intensity is high, the display brightness of the display screen 905 is increased; when the ambient light intensity is low, the display brightness of the display screen 905 is decreased. In another embodiment, the processor 901 can also dynamically adjust the shooting parameters of the camera assembly 906 according to the ambient light intensity collected by the optical sensor 913.
[0198] The proximity sensor 914, also called a distance sensor, is disposed on the front panel of the terminal 900. The proximity sensor 914 is used to collect the distance between the user and the front of the terminal 900. In one embodiment, when the proximity sensor 914 detects that the distance between the user and the front of the terminal 900 is gradually decreasing, the processor 901 controls the display screen 905 to switch from the screen-on state to the screen-off state; when the proximity sensor 914 detects that the distance between the user and the front of the terminal 900 is gradually increasing, the processor 901 controls the display screen 905 to switch from the screen-off state to the screen-on state.
[0199] Those skilled in the art will understand that Fig. 9 The structure shown in the figure does not constitute a limitation on the terminal 900, and the terminal 900 may include more or less components than those shown in the figure, or combine some components, or adopt a different component arrangement.
[0200] An embodiment of the present application further provides a computer-readable storage medium, in which at least one computer program is stored. The at least one computer program is loaded and executed by a processor to implement the operations performed by the data acquisition method of the above embodiment.
[0201] An embodiment of the present application further provides a computer program product, including a computer program, wherein the computer program is loaded and executed by a processor to implement the operations performed by the data acquisition method of the above embodiment.
[0202] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.
[0203] The above description is only an optional embodiment of the embodiments of the present application and is not intended to limit the embodiments of the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present application should be included in the protection scope of the present application.
Claims
1. A data acquisition method, characterized in that: Executed by a terminal, a game client on the terminal is configured with a hook function, the game client includes a filter function and a processing function provided by a game engine, and the hook function is used to hook the processing function; The method comprises: In the process of running the game client, calling the filtering function, obtaining original operation data executed in the game client, filtering the original operation data to obtain target operation data, wherein the execution frequency of the target operation data is consistent with the game frame rate in the game client; Calling the processing function, obtaining the target operation data output by the filtering function, and determining the instruction data triggered by the target operation data; The hook function is called to obtain the target operation data and the instruction data obtained by the processing function.
2. The method according to claim 1, characterized in that The hook function includes a first hook function and a second hook function, and the processing function includes a processing input function and a processing instruction function; The first hook function is used to hook the processing input function, and the processing input function is used to obtain the target operation data; The second hook function is used to hook the processing instruction function, and the processing instruction function is used to determine the instruction data triggered by the target operation data.
3. The method according to claim 2, characterized in that The calling of the hook function to obtain the target operation data and the instruction data obtained by the processing function includes: Calling the first hook function, acquiring input data of the processing input function, and obtaining the target operation data; The second hook function is called to obtain the output data of the processing instruction function to obtain the instruction data.
4. The method according to claim 2, characterized in that: The processing input function includes a key input function and an axis input function, and the target operation data includes key operation data and axis operation data; calling the processing function to obtain the target operation data output by the filtering function includes: Calling the key input function to obtain the key operation data output by the filtering function, wherein the key operation data includes at least one of keyboard click operation data, mouse click operation data, handle click operation data, and virtual button click operation data; The axis input function is called to obtain the axis operation data output by the filter function, wherein the axis operation data includes at least one of mouse dragging operation data, handle shaking operation data, or sliding operation data on the screen.
5. The method according to claim 2, characterized in that: The determining of the instruction data triggered by the target operation data includes: The processing instruction function is called to query the instruction data corresponding to the target operation data in a first mapping relationship table, wherein the first mapping relationship table is used to store any operation data and the corresponding instruction data.
6. The method according to claim 1, characterized in that After calling the hook function and acquiring the target operation data and the instruction data obtained by the processing function, the method further includes: Adding the target operation data to an operation data queue; The target operation data and the instruction data are stored in a second mapping relationship table correspondingly, and the second mapping relationship table is used to store the acquired operation data and the corresponding instruction data.
7. The method according to claim 6, characterized in that The method further comprises: When the number of occurrences of the target instruction data in the second mapping relationship table reaches the target number, the number of occurrences of the target instruction data is cleared, and the operation data queue is input into the behavior recognition model, and the target instruction data is any instruction data in the second mapping relationship table; The behavior recognition model is called to identify abnormal operation behavior based on the operation data queue.
8. The method according to claim 6, characterized in that The step of adding the target operation data to the operation data queue comprises: The operation data with the earliest acquisition time point in the operation data queue is deleted, and the target operation data is added to the operation data queue.
9. The method according to any one of claims 1 to 8, characterized in that: The calling of the filter function to obtain the original operation data executed in the game client includes: Calling a collection function provided by the operating system to detect the original operation data executed in the game client; The filtering function is called to obtain the original operation data output by the collecting function.
10. The method according to any one of claims 1 to 8, characterized in that: After calling the processing function, obtaining the target operation data output by the filtering function, and determining the instruction data triggered by the target operation data, the method further includes: Call the game function provided by the game server, obtain the instruction data output by the processing function, and render the game screen based on the instruction data.
11. A data acquisition device, characterized in that: The game client on the terminal is configured with a hook function, the game client includes a filter function and a processing function provided by the game engine, and the hook function is used to hook the processing function; The device comprises: A data filtering module, used to call the filtering function during the running of the game client, obtain the original operation data executed in the game client, filter the original operation data, and obtain target operation data, wherein the execution frequency of the target operation data is consistent with the game frame rate in the game client; A data processing module, used for calling the processing function, obtaining the target operation data output by the filtering function, and determining the instruction data triggered by the target operation data; The data acquisition module is used to call the hook function to acquire the target operation data and the instruction data obtained by the processing function.
12. A terminal, characterized in that: The terminal includes a processor and a memory, wherein at least one computer program is stored in the memory, and the at least one computer program is loaded and executed by the processor to implement the operations performed by the data acquisition method according to any one of claims 1 to 10.
13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one computer program, and the at least one computer program is loaded and executed by a processor to implement the operations performed by the data acquisition method according to any one of claims 1 to 10.
14. A computer program product comprising a computer program, characterized in that The computer program is loaded and executed by a processor to implement the operations performed by the data acquisition method according to any one of claims 1 to 10.
Citation Information
Patent Citations
Method and device for acquiring running data of application program, equipment and readable medium
CN110275736A
Game picture testing method and device
CN110334027A
Cheating detection and model training method and device for shooting game and storage medium
CN112642161A
System and method for anti-cheating detection
CN115335127A
Controller for use with communications systems for converting a voice message to a text message
US6198808B1
