Game scene recognition method and device, electronic equipment and storage medium

By obtaining and matching the rendering resource names and logos of the game application, and determining the game scene in real time, the problems of large computing resources and limited use scenarios in the prior art are solved, and efficient game scene recognition is achieved.

CN119445162APending Publication Date: 2025-02-14ZTE CORP
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202310989366.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-08-07
Publication Date
2025-02-14

AI Technical Summary

Technical Problem

The existing game scene recognition method requires consuming a large amount of computing resources at the terminal and the usage scenarios are limited.

Method used

By obtaining the rendering resource name and identity of the target game application when rendering the game scene, matching it with the preset correspondence, forming a new correspondence, and intercepting the rendering resource identity in real time to determine the game scene.

Benefits of technology

No need to consume a lot of computing resources for image recognition, which expands the usage scenarios of game scene recognition and reduces the performance impact on game operation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119445162A_ABST
    Figure CN119445162A_ABST
Patent Text Reader

Abstract

The invention relates to a game scene recognition method and device, electronic equipment and a storage medium. The method comprises the following steps: acquiring a rendering resource name and a rendering resource identifier required when a target game application renders a game picture corresponding to at least one game scene; matching the rendering resource name with a rendering resource name in a preset first corresponding relation; under the condition that the rendering resource name is successfully matched with the rendering resource name in the first corresponding relation, adding the rendering resource identifier into the first corresponding relation to form a second corresponding relation; and intercepting a corresponding target rendering resource identifier when the target game application renders each frame of game picture in the running process in real time, and determining a target game scene matched with the target rendering resource identifier based on the second corresponding relationship. In this way, it is not needed to consume a large number of computing resources to conduct image recognition on the game picture, therefore, the performance influence on game operation is reduced, and meanwhile the use scene of game scene recognition can be expanded.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of software development technology, and in particular to a game scene recognition method, device, electronic device and storage medium. Background Art

[0002] With the development of the game market, terminal manufacturers often make performance adjustments for different game scenarios in order to improve user experience. For example, the performance requirements of battle scenes in games are often higher than those of dialogue scenes, so it is necessary to identify different scenes in the game.

[0003] The current game scene recognition method is usually implemented based on image recognition technology. Before game scene recognition, it is necessary to pre-train based on multiple game screens in the game scene to establish the correspondence between the game image and the game scene. Then, based on image recognition technology, the real-time image captured when the game is running is recognized, and the recognized image is matched with the preset game image. If the match is successful, the scene corresponding to the preset game image is used as the current game scene. However, this method has the following defects:

[0004] 1. Image recognition technology is required, which will consume a large amount of terminal computing resources during the game operation, affecting the performance of the game operation;

[0005] 2. Image recognition technology has high requirements on the display position and feature level of the image, so there are some usage scenarios that cannot be recognized by image recognition technology.

[0006] Therefore, how to better realize game scene recognition has become a technical problem that needs to be solved urgently. Summary of the invention

[0007] The present application provides a game scene recognition method, device, electronic device and storage medium to solve the technical problem that the game scene recognition method in the prior art consumes a large amount of terminal computing resources and has limited usage scenarios.

[0008] In a first aspect, the present application provides a game scene recognition method, comprising:

[0009] Obtaining a rendering resource name and a rendering resource identifier required by a target game application when rendering a game screen corresponding to at least one game scene;

[0010] Matching the rendering resource name with a rendering resource name in a preset first correspondence relationship, wherein the first correspondence relationship is used to represent a correspondence between a rendering resource name and a game scene;

[0011] When the rendering resource name successfully matches the rendering resource name in the first corresponding relationship, the rendering resource identifier is added to the first corresponding relationship to form a second corresponding relationship, wherein the second corresponding relationship is used to represent the corresponding relationship between the rendering resource name, the rendering resource identifier and the game scene;

[0012] The target rendering resource identifier corresponding to each frame of the game screen rendered by the target game application during operation is intercepted in real time, and based on the second corresponding relationship, a target game scene matching the target rendering resource identifier is determined.

[0013] Optionally, the obtaining of a rendering resource name and a rendering resource identifier required by the target game application when rendering a game screen corresponding to at least one game scene includes:

[0014] In the case where it is detected that the target game application is in the startup phase, determining whether the game package name corresponding to the target game application is included in the associated data of the target file, wherein the associated data of the target file is used to represent N first corresponding relationships associated with N game package names, the N game package names correspond one-to-one to the N game applications, and N is an integer greater than or equal to 1;

[0015] In a case where the game package name corresponding to the target game application is included in the associated data of the target file, a first preset function is called, wherein the first preset function is used to obtain the rendering resource name and the rendering resource identifier.

[0016] Optionally, before determining whether the game package name corresponding to the target game application is included in the associated data of the target file, the method further includes:

[0017] Obtaining a name of a rendering resource required by each of the N game applications when rendering a game screen corresponding to at least one game scene, and obtaining N first corresponding relationships corresponding to the N game applications;

[0018] Obtain N game package names corresponding to the N game applications;

[0019] A correspondence between the N first correspondences and the N game package names is established to obtain associated data of the target file.

[0020] Optionally, the real-time interception of the target rendering resource identifier corresponding to each frame of the game screen rendered by the target game application during operation includes:

[0021] When it is detected that the target game application is in the game screen rendering stage, a second preset function is called, wherein the second preset function is used to intercept in real time the target rendering resource identifier corresponding to the target game application when rendering each frame of the game screen.

[0022] Optionally, after determining the target game scene matching the target rendering resource identifier based on the second corresponding relationship, the method further includes:

[0023] According to the target game scenario, the operating parameters of the terminal device running the target game application and / or the display content of the user interface are adjusted.

[0024] Optionally, adjusting the operating parameters of a terminal device running the target game application and / or the display content of a user interface according to the target game scenario includes:

[0025] When the target game scene is a combat scene, the frequencies of the central processing unit and the graphics processing unit in the terminal device are increased; when the target game scene is a non-combat scene, the frequencies of the central processing unit and the graphics processing unit in the terminal device are decreased; or

[0026] When the target game scene is a battle scene or a vehicle drifting scene, controlling the terminal device to vibrate; or,

[0027] In the case where the target game scene is a character selection scene, displaying recommendation information on the user interface of the terminal device, wherein the recommendation information is related information of a recommended character in the target game application; or

[0028] When the target game scene is a key information broadcasting scene, the terminal device is controlled to broadcast the key information.

[0029] Optionally, the rendering resource names are classified according to rendering resource types, and the rendering resource types include at least one of texture, project, shader and frame buffer.

[0030] In a second aspect, the present application provides a game scene recognition device, comprising:

[0031] An acquisition module, used to acquire the rendering resource name and rendering resource identifier required by the target game application when rendering the game screen corresponding to different game scenes;

[0032] A matching module, used to match the rendering resource name with a rendering resource name in a preset first corresponding relationship, wherein the first corresponding relationship is used to represent a corresponding relationship between the rendering resource name and the game scene;

[0033] an adding module, configured to add the rendering resource identifier to the first corresponding relationship to form a second corresponding relationship when the rendering resource name successfully matches the rendering resource name in the first corresponding relationship, wherein the second corresponding relationship is used to characterize the corresponding relationship between the rendering resource name, the rendering resource identifier and the game scene;

[0034] The determination module is used to capture in real time the target rendering resource identifier corresponding to each frame of the game screen rendered by the target game application during operation, and based on the second corresponding relationship, determine the target game scene that matches the target rendering resource identifier.

[0035] In a third aspect, an electronic device includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus;

[0036] Memory, used to store computer programs;

[0037] The processor is used to implement the steps of the game scene recognition method described in the first aspect when executing the program stored in the memory.

[0038] In a fourth aspect, a computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the game scene recognition method described in the first aspect.

[0039] The above-mentioned technical scheme provided by the embodiment of the present application has the following advantages over the prior art: the method provided by the embodiment of the present application obtains the rendering resource name and rendering resource identifier required by the target game application when rendering the game screen corresponding to at least one game scene; matches the rendering resource name with the rendering resource name in a preset first correspondence relationship, wherein the first correspondence relationship is used to characterize the correspondence between the rendering resource name and the game scene; when the rendering resource name successfully matches the rendering resource name in the first correspondence relationship, the rendering resource identifier is added to the first correspondence relationship to form a second correspondence relationship, wherein the second correspondence relationship is used to characterize the correspondence between the rendering resource name, the rendering resource identifier and the game scene; intercepts the target rendering resource identifier corresponding to each frame of the game screen rendered by the target game application during operation in real time, and determines the target game scene matching the target rendering resource identifier based on the second correspondence relationship. Through the above method, the target rendering resource identifier and the second corresponding relationship corresponding to each frame of the game screen rendered by the target game application during operation can be used to accurately determine the target game scene corresponding to each frame of the game screen, without consuming a large amount of terminal computing resources to perform image recognition on the game screen, thereby reducing the performance impact on the game operation; at the same time, since there is no need to rely on image recognition technology to perform image recognition on the game screen, there is no need to be restricted by the display position, feature degree and other requirements of the image, which expands the use scenarios of game scene recognition. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0041] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0042] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.

[0043] Figure 1 A flowchart of a method for identifying a game scene provided in an embodiment of the present application;

[0044] Figure 2A schematic diagram of a process for configuring associated data of a target file provided in an embodiment of the present application;

[0045] Figure 3 A schematic diagram of a system architecture provided in an embodiment of the present application;

[0046] Figure 4 A schematic diagram of a process for establishing a second corresponding relationship provided in an embodiment of the present application;

[0047] Figure 5 A flowchart of a game scene recognition method provided in an embodiment of the present application;

[0048] Figure 6 A schematic diagram of the structure of a game scene recognition device provided in an embodiment of the present application;

[0049] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0050] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0051] The disclosure below provides many different embodiments or examples to implement different structures of the present invention. In order to simplify the disclosure of the present invention, the parts and settings of specific examples are described below. Of course, they are only examples, and the purpose is not to limit the present invention. In addition, the present invention can repeat reference numbers and / or letters in different examples. This repetition is for the purpose of simplification and clarity, and does not itself indicate the relationship between the various embodiments and / or settings discussed.

[0052] In order to solve the technical problem that the game scene recognition method in the prior art consumes a large amount of terminal computing resources and has limited usage scenarios, the present application provides a game scene recognition method, device, electronic device and storage medium, which can reduce the consumption of terminal computing resources and expand the usage scenarios of game scene recognition.

[0053] See also Figure 1 , Figure 1 A flowchart of a method for identifying a game scene provided in an embodiment of the present application is shown below. Figure 1 As shown, the game scene recognition method may include the following steps:

[0054] Step 101: Obtain a rendering resource name and a rendering resource identifier required by a target game application when rendering a game screen corresponding to at least one game scene.

[0055] Specifically, the target game application can be any game application installed on an electronic device, and the electronic device here can be any terminal device such as a smart phone, a personal computer, a tablet, a laptop, etc. The rendering resource name refers to the specific texture (i.e., Texture) name, project (i.e., Program) name, shader (i.e., Shader) name, frame buffer (i.e., FrameBuffer) name, etc. used by the target game application when rendering different game screens. The rendering resource identifier refers to the unique identifier corresponding to each rendering resource name.

[0056] Step 102: Match the rendering resource name with the rendering resource name in a preset first corresponding relationship, wherein the first corresponding relationship is used to represent the corresponding relationship between the rendering resource name and the game scene.

[0057] It should be noted that each game application includes one or more game scenes, and in each game scene, there will be specific object models, for example, in a battle scene, there will be object models such as weapons and game results, and in a character selection scene, there will be object models such as selection buttons, etc. Drawing the object model requires the use of the corresponding rendering resource name, so the correspondence between the rendering resource name and the game scene can be established in advance to obtain the above-mentioned first correspondence.

[0058] When matching the rendering resource name with the rendering resource name in the preset first correspondence relationship, if the rendering resource name is included in the rendering resource name in the first correspondence relationship, or the rendering resource name is consistent with the rendering resource name in the first correspondence relationship, it can be considered that the rendering resource name matches the rendering resource name in the first correspondence relationship successfully; otherwise, the rendering resource name fails to match the rendering resource name in the first correspondence relationship.

[0059] Step 103: When the rendering resource name successfully matches the rendering resource name in the first correspondence, the rendering resource identifier is added to the first correspondence to form a second correspondence, wherein the second correspondence is used to characterize the correspondence between the rendering resource name, the rendering resource identifier and the game scene.

[0060] After matching the rendering resource name with the rendering resource name in the preset first correspondence relationship, if the rendering resource name matches the rendering resource name in the first correspondence relationship successfully, it means that the game scene of the target game application belongs to the game scene in the first correspondence relationship, and the rendering resource identifier can be added to the first correspondence relationship to form a second correspondence relationship; if the rendering resource name fails to match the rendering resource name in the first correspondence relationship, it means that the game scene of the target game application does not belong to the game scene in the first correspondence relationship, and the identification of the game scene of the target game application is stopped.

[0061] Step 104: intercept in real time the target rendering resource identifier corresponding to each frame of the game screen rendered by the target game application during operation, and determine the target game scene that matches the target rendering resource identifier based on the second corresponding relationship.

[0062] After establishing the second corresponding relationship, the target rendering resource identifier corresponding to the target game application when rendering each frame of the game screen can be intercepted in real time during the running of the target game application, and then the intercepted target rendering resource identifier can be matched with the rendering resource identifier in the second corresponding relationship. If the match is successful, the target game scene that matches the target rendering resource identifier can be determined.

[0063] In this embodiment, the target rendering resource identifier and the second corresponding relationship corresponding to each frame of the game screen rendered by the target game application during operation can be used to accurately determine the target game scene corresponding to each frame of the game screen, without consuming a large amount of terminal computing resources to perform image recognition on the game screen, thereby reducing the performance impact on the game operation; at the same time, since there is no need to rely on image recognition technology to perform image recognition on the game screen, there is no need to be restricted by the display position, feature degree and other requirements of the image, thereby expanding the use scenarios of game scene recognition.

[0064] Furthermore, the above step 101, obtaining the rendering resource name and rendering resource identifier required by the target game application when rendering the game screen corresponding to at least one game scene, specifically includes:

[0065] When it is detected that the target game application is in the startup phase, determine whether the game package name corresponding to the target game application is included in the associated data of the target file, wherein the associated data of the target file is used to represent N first corresponding relationships associated with N game package names, the N game package names correspond one-to-one to the N game applications, and N is an integer greater than or equal to 1;

[0066] In the case where the game package name corresponding to the target game application is included in the associated data of the target file, a first preset function is called, wherein the first preset function is used to obtain a rendering resource name and a rendering resource identifier.

[0067] Specifically, the first preset function may be a function such as a glLabelObjectEXT function, and the first preset function may obtain a rendering resource name and a rendering resource identifier for a user when a game application is started.

[0068] In one embodiment, when it is detected that the target game application is in the startup phase, the game package name corresponding to the target game application and the associated data of the target file can be obtained, and the game package name corresponding to the target game application and the associated data of the target file can be compared. If the game package name corresponding to the target game application is included in the associated data of the target file, it means that the target file is pre-configured with a first corresponding relationship associated with the target game application, and at this time, the first preset function can be called to obtain the rendering resource name and rendering resource identifier corresponding to the target game application. If the game package name corresponding to the target game application is not included in the associated data of the target file, it means that the target file is not pre-configured with a first corresponding relationship associated with the target game application, and the game scene recognition process can be terminated at this time.

[0069] In this embodiment, when the target game application is in the startup phase, the rendering resource name and rendering resource identifier required by the target game application when rendering the game screen can be obtained by calling the first preset function, so as to facilitate the subsequent acquisition of the second corresponding relationship based on the corresponding relationship between the rendering resource name and the rendering resource identifier.

[0070] Furthermore, before the above step of determining whether the game package name corresponding to the target game application is included in the associated data of the target file, the method further includes:

[0071] Obtaining a name of a rendering resource required by each of the N game applications when rendering a game screen corresponding to at least one game scene, and obtaining N first corresponding relationships corresponding to the N game applications;

[0072] Get N game package names corresponding to N game applications;

[0073] A correspondence between the N first correspondences and the N game package names is established to obtain associated data of the target file.

[0074] In one embodiment, before determining whether the game package name corresponding to the target game application is included in the associated data of the target file, the associated data of the target file needs to be pre-configured. When configuring the associated data of the target file, it is necessary to obtain the name of the rendering resource required by each game application in the N game applications when rendering the game screen corresponding to at least one game scene, obtain the N first corresponding relationships corresponding to the N game applications, and obtain the N game package names corresponding to the N game applications. Then, based on the obtained N first corresponding relationships and the N game package names, a corresponding relationship between the N first corresponding relationships and the N game package names is established to obtain the associated data of the target file.

[0075] Specifically, the name of the rendering resource required by each of the N game applications when rendering the game screen corresponding to at least one game scene can be obtained by using image analysis tools or by using the glLabelObjectEXT function in the GLES lib library to print parameters. Taking the method of printing parameters in the glLabelObjectEXT function as an example, the function parameters are as follows:

[0076] glLabelObjectEXT(GLenum type,GLuint object,GLsizei length,constGLchar*label);

[0077] Among them, parameter 1type indicates the type of rendering resource assigned, such as GL_TEXTURE2D, GL_PROGRAM, etc., and parameter 4 indicates the name character assigned to the resource (i.e., the rendering resource name). Print these two parameters to the log, then run the game, find the rendering resources with characteristic names in each game scene, and configure them to the target file (such as an XML file, etc.):

[0078] <game

[0079] Name = "Game 1"

[0080] Type = "texture"

[0081] Res = "Name 1"

[0082] Scene = "Scene A" / >

[0083] This method can be used to find the names of rendering resources in other games and configure them into the target file according to the game package name. The configuration process of the associated data of the target file is as follows: Figure 2 As shown:

[0084] Step 201: Analyze and find out the characteristic rendering resource names of a certain game application in different scenarios.

[0085] Step 202: configure the correspondence between the rendering resource type, rendering resource name, game scene and game package name of the game application into the target file.

[0086] Step 203: Analyze and obtain the corresponding relationships of other game applications in different game scenarios in this way.

[0087] Step 204: configure and obtain the associated data of the target file.

[0088] In this embodiment, the associated data of the target file can be pre-configured according to actual needs to obtain the first corresponding relationship associated with different game applications. In addition, the developer can subsequently optimize and adjust the associated data of the target file to realize game scene recognition for different game applications.

[0089] Furthermore, the above step 104, real-time interception of the target rendering resource identifier corresponding to each frame of the game screen rendered by the target game application during operation, includes:

[0090] When it is detected that the target game application is in the game screen rendering stage, the second preset function is called, wherein the second preset function is used to capture in real time the target rendering resource identifier corresponding to the target game application when rendering each frame of the game screen.

[0091] Specifically, the second preset function may be functions such as glUseProgram, glBindTexture, and glBindFramebuffer. The second preset function may capture the target rendering resource identifier in real time when the game application is in the game screen rendering stage.

[0092] In one embodiment, when it is detected that the target game application is in the game screen rendering stage, the second preset function can be called to intercept the target rendering resource identifier corresponding to each frame of the game screen rendered by the target game application in real time through the second preset function. In this way, it is convenient to determine the target game scene that matches the target rendering resource identifier based on the second corresponding relationship, and realize the game scene recognition function.

[0093] Furthermore, after determining the target game scene matching the target rendering resource identifier based on the second corresponding relationship in the above step 104, the method further includes:

[0094] According to the target game scenario, the operating parameters of the terminal device running the target game application and / or the display content of the user interface are adjusted.

[0095] In one embodiment, after determining the target game scene that matches the target rendering resource identifier, the operating parameters of the terminal device running the target game application can be adjusted according to the target game scene to achieve performance optimization of the target game application on the terminal device, and / or the display content of the user interface of the terminal device running the target game application can be adjusted to achieve different game auxiliary functions.

[0096] Furthermore, the above steps, according to the target game scene, adjust the operating parameters of the terminal device running the target game application and / or the display content of the user interface, including:

[0097] When the target game scene is a combat scene, the frequencies of the central processing unit and the graphics processing unit in the terminal device are increased; when the target game scene is a non-combat scene, the frequencies of the central processing unit and the graphics processing unit in the terminal device are reduced; or

[0098] When the target game scene is a battle scene or a vehicle drifting scene, controlling the terminal device to vibrate; or,

[0099] In the case where the target game scene is a character selection scene, recommendation information is displayed on the user interface of the terminal device, wherein the recommendation information is related information of a recommended character in the target game application; or

[0100] When the target game scene is a key information broadcasting scene, the terminal device is controlled to broadcast the key information.

[0101] Specifically, as an optional implementation, when the target game scene is a combat scene, the frequencies of the central processing unit and the graphics processing unit in the terminal device can be increased; when the target game scene is a non-combat scene, the frequencies of the central processing unit and the graphics processing unit in the terminal device can be reduced, thereby adjusting the frequencies of the central processing unit and the graphics processing unit for combat scenes and non-combat scenes, and improving the performance of the target game application at runtime.

[0102] As another optional implementation, when the target game scene is a battle scene or a vehicle drifting scene, the terminal device can be controlled to vibrate. For example, during the running of the XX game, if the damage number pops up when hitting a monster, the vibration effect can be increased to improve the user's hitting feel; or during the running of the XX game, if the drift tire tracks are identified, the vibration effect can be increased to improve the user's feel.

[0103] As another optional implementation, when the target game scene is a character selection scene, recommendation information can be displayed on the user interface of the terminal device. For example, during the running of XX game, if it is identified which hero the player has selected, a hero guide can be pushed; or during the running of XX game, if it is identified that the current scene is a hero selection scene, a ranking of strong heroes in the current version of the target game application can be displayed.

[0104] As another optional implementation, when the target game scene is a key information broadcast scene, the terminal device can be controlled to broadcast the key information. For example, during the running of the XX game, if key broadcast information such as Five Consecutive Worlds, Storm Dragon King, and game match results are identified, the specific broadcast content can be identified by combining image recognition technology and then voice broadcasted.

[0105] Furthermore, the rendering resource names are classified according to rendering resource types, and the rendering resource types include at least one of texture, project, shader, and frame buffer.

[0106] In one embodiment, the rendering resource type may be a combination of one or more of texture, engineering, shader, and frame buffer, which is not specifically limited in this embodiment. The rendering resource names of each game application may be first classified according to the rendering resource type, and then subdivided according to the type to determine the rendering resource name. For example, when the rendering resource type is texture, the rendering resource name may be texture 1, texture 2, texture 3, and so on.

[0107] As an optional implementation, the game scene recognition method provided in the embodiment of the present application can be applied to Figure 3The system architecture shown in the figure may include a hardware device layer, a kernel layer, an application framework layer and an application layer. Among them, the hardware device layer includes a central processing unit (CPU), a graphics processing unit (GPU), a random access memory (RAM) and a storage device. The central processing unit is the core device of the electronic device, which is used to execute program code and generally consists of a logic operation unit, a control unit and a storage unit. The graphics processor is a microprocessor that specializes in processing image and graphics related operations. The graphics processor can reduce the graphics card's dependence on the central processing unit and perform some of the original central processing unit's work, especially faster than the central processing unit in graphics processing. The kernel layer includes a process monitor (i.e., ProcessManager), a storage manager (i.e., MemoryManager), a file system (i.e., File System) and a Binder driver (i.e., Binder Driver). Binder here is an advanced inter-process communication (IPC) mechanism provided by the Android system. It uses proxy objects, shared memory, serialization and other technologies to implement inter-process communication and remote call functions. It allows data transmission and method calls between different processes, and realizes the decoupling between processes. The application framework layer includes Activity Manager Service (AMS), Package Manager Service (PMS), OpenGLE graphics library and game scene recognition module. OpenGL is the abbreviation of Open Graphics Library. OpenGL is a powerful and easy-to-call underlying graphics library. It defines a professional graphics program interface across programming languages ​​and platforms, which can be used for processing and rendering two-dimensional or three-dimensional images. OpenGLES is the abbreviation of OpenGL for Embedded Systems. OpenGLES is a subset of the three-dimensional graphics API OpenGL, designed for embedded devices. The game scene recognition module can run in the system service process of the Android system. It mainly loads preset associated data and calls the application programming interface (Application Programming Interface) when receiving game application rendering. The application layer can include multiple game applications, such as game application 1, game application 2, etc.

[0108] After the Android system is turned on, the game scene recognition module can read the preset associated data in the xml file (i.e., the target file) under a fixed path and load the associated data into the memory. During the startup phase of the target game application, you can first determine whether the associated data contains the game package name based on the game package name corresponding to the target game application. If the associated data contains the game package name, then when the target game application calls the glLabelObjectEXT function, the game package name, rendering resource type, and rendering resource name can be passed to the scene recognition module across processes through Binder communication and pushed into the cache queue. The rendering resource name in the queue is then compared with the rendering resource name in the associated data. If the two have an inclusion relationship or an equality relationship, it means that the rendering resource name matches successfully, and the rendering resource identifier corresponding to the rendering resource name can be merged into the associated data, thereby establishing a corresponding relationship between the rendering resource type, rendering resource name, rendering resource identifier, and game scene. The specific process is as follows: Figure 4 shown.

[0109] When the target game application is in the rendering process, the target game application will call functions such as glBindTexture and glUseProgram to switch game resources. At this time, the rendering resource identifiers in these functions can be passed to the game scene recognition module through Binder communication, and the rendering resource identifier is compared with the rendering resource identifier in the associated data. If the two are the same, it means that the target game application is currently drawing the corresponding game scene. Then the scene recognition module can pass the current game scene to the demand module, and a game scene recognition is completed. The specific process is as follows: Figure 5 shown.

[0110] Through the above method, during the operation of the target game application, the game scene can be identified only by judging the rendering resource name and rendering resource identifier, without consuming additional computing resources. It has better performance advantages, and also expands the scope and accuracy of scene recognition. On this basis, more detailed scene optimization and game auxiliary functions can be developed.

[0111] See also Figure 6 , Figure 6 This is a schematic diagram of the structure of a game scene recognition device provided in an embodiment of the present application. Figure 6 As shown, the game scene recognition device 600 includes:

[0112] An acquisition module 601 is used to acquire the rendering resource name and rendering resource identifier required by the target game application when rendering game screens corresponding to different game scenes;

[0113] A matching module 602, used to match the rendering resource name with a rendering resource name in a preset first correspondence relationship, wherein the first correspondence relationship is used to represent the correspondence between the rendering resource name and the game scene;

[0114] Adding module 603, used for adding the rendering resource identifier to the first corresponding relationship to form a second corresponding relationship when the rendering resource name successfully matches the rendering resource name in the first corresponding relationship, wherein the second corresponding relationship is used to represent the corresponding relationship between the rendering resource name, the rendering resource identifier and the game scene;

[0115] The determination module 604 is used to capture in real time the target rendering resource identifier corresponding to each frame of the game screen rendered by the target game application during operation, and determine the target game scene matching the target rendering resource identifier based on the second corresponding relationship.

[0116] Furthermore, the acquisition module 601 includes:

[0117] A judgment submodule, for judging whether the game package name corresponding to the target game application is included in the associated data of the target file when it is detected that the target game application is in the startup phase, wherein the associated data of the target file is used to represent N first corresponding relationships associated with N game package names, the N game package names correspond one-to-one to the N game applications, and N is an integer greater than or equal to 1;

[0118] The first calling submodule is used to call a first preset function when the game package name corresponding to the target game application is included in the associated data of the target file, wherein the first preset function is used to obtain the rendering resource name and the rendering resource identifier.

[0119] Furthermore, the acquisition module 601 further includes:

[0120] A first acquisition submodule is used to acquire a name of a rendering resource required by each of the N game applications when rendering a game screen corresponding to at least one game scene, and obtain N first corresponding relationships corresponding to the N game applications;

[0121] The second acquisition submodule is used to obtain N game package names corresponding to N game applications;

[0122] A submodule is established to establish a correspondence between N first correspondences and N game package names to obtain associated data of the target file.

[0123] Further, the determination module 604 includes:

[0124] The second calling submodule is used to call a second preset function when it is detected that the target game application is in the game screen rendering stage, wherein the second preset function is used to intercept in real time the target rendering resource identifier corresponding to the target game application when rendering each frame of the game screen.

[0125] Furthermore, the device 600 further includes:

[0126] The adjustment module is used to adjust the operating parameters of the terminal device running the target game application and / or the display content of the user interface according to the target game scene.

[0127] Furthermore, the adjustment module is specifically used for:

[0128] When the target game scene is a combat scene, the frequencies of the central processing unit and the graphics processing unit in the terminal device are increased; when the target game scene is a non-combat scene, the frequencies of the central processing unit and the graphics processing unit in the terminal device are reduced; or

[0129] When the target game scene is a battle scene or a vehicle drifting scene, controlling the terminal device to vibrate; or,

[0130] In the case where the target game scene is a character selection scene, recommendation information is displayed on the user interface of the terminal device, wherein the recommendation information is related information of a recommended character in the target game application; or

[0131] When the target game scene is a key information broadcasting scene, the terminal device is controlled to broadcast the key information.

[0132] Furthermore, the rendering resource names are classified according to rendering resource types, and the rendering resource types include at least one of texture, project, shader, and frame buffer.

[0133] It should be noted that the device 600 can implement the steps of the game scene recognition method provided by any of the aforementioned method embodiments and can achieve the same technical effects, which will not be described in detail here.

[0134] like Figure 7 As shown, the embodiment of the present application further provides an electronic device, including a processor 711, a communication interface 712, a memory 713 and a communication bus 714, wherein the processor 711, the communication interface 712, and the memory 713 communicate with each other through the communication bus 714.

[0135] Memory 713, used for storing computer programs;

[0136] In one embodiment of the present application, the processor 711 is used to execute the program stored in the memory 713 to implement the game scene recognition method provided by any of the above method embodiments, including:

[0137] Obtaining a rendering resource name and a rendering resource identifier required by a target game application when rendering a game screen corresponding to at least one game scene;

[0138] Matching the rendering resource name with a rendering resource name in a preset first correspondence relationship, wherein the first correspondence relationship is used to represent a correspondence relationship between the rendering resource name and the game scene;

[0139] When the rendering resource name successfully matches the rendering resource name in the first correspondence, the rendering resource identifier is added to the first correspondence to form a second correspondence, wherein the second correspondence is used to represent the correspondence between the rendering resource name, the rendering resource identifier and the game scene;

[0140] The target rendering resource identifier corresponding to each frame of the game screen rendered by the target game application during operation is intercepted in real time, and based on the second corresponding relationship, a target game scene matching the target rendering resource identifier is determined.

[0141] An embodiment of the present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the game scene recognition method provided in any of the aforementioned method embodiments are implemented.

[0142] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0143] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a general hardware platform, and of course, by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0144] It should be understood that the terms used herein are only for the purpose of describing specific example embodiments and are not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms "one", "an" and "said" as used herein may also be meant to include plural forms. The terms "include", "comprise", "contain", and "have" are inclusive, and therefore specify the existence of stated features, steps, operations, elements and / or parts, but do not exclude the existence or addition of one or more other features, steps, operations, elements, parts, and / or combinations thereof. The method steps, processes, and operations described herein are not interpreted as necessarily requiring them to be performed in the specific order described or illustrated, unless the execution order is clearly indicated. It should also be understood that additional or alternative steps may be used.

[0145] The foregoing is merely a specific embodiment of the present invention, which enables those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features claimed herein.

Claims

1. A game scene recognition method, characterized in that: include: Obtaining a rendering resource name and a rendering resource identifier required by a target game application when rendering a game screen corresponding to at least one game scene; Matching the rendering resource name with a rendering resource name in a preset first correspondence relationship, wherein the first correspondence relationship is used to represent a correspondence between a rendering resource name and a game scene; When the rendering resource name successfully matches the rendering resource name in the first corresponding relationship, the rendering resource identifier is added to the first corresponding relationship to form a second corresponding relationship, wherein the second corresponding relationship is used to represent the corresponding relationship between the rendering resource name, the rendering resource identifier and the game scene; The target rendering resource identifier corresponding to each frame of the game screen rendered by the target game application during operation is intercepted in real time, and based on the second corresponding relationship, a target game scene matching the target rendering resource identifier is determined.

2. The method according to claim 1, characterized in that The obtaining of the rendering resource name and rendering resource identifier required by the target game application when rendering a game screen corresponding to at least one game scene includes: In the case where it is detected that the target game application is in the startup phase, determining whether the game package name corresponding to the target game application is included in the associated data of the target file, wherein the associated data of the target file is used to represent N first corresponding relationships associated with N game package names, the N game package names correspond one-to-one to the N game applications, and N is an integer greater than or equal to 1; In a case where the game package name corresponding to the target game application is included in the associated data of the target file, a first preset function is called, wherein the first preset function is used to obtain the rendering resource name and the rendering resource identifier.

3. The method according to claim 2, characterized in that Before determining whether the game package name corresponding to the target game application is included in the associated data of the target file, the method further includes: Obtaining a name of a rendering resource required by each of the N game applications when rendering a game screen corresponding to at least one game scene, and obtaining N first corresponding relationships corresponding to the N game applications; Obtain N game package names corresponding to the N game applications; A correspondence between the N first correspondences and the N game package names is established to obtain associated data of the target file.

4. The method according to claim 1, characterized in that: The real-time interception of the target rendering resource identifier corresponding to each frame of the game screen rendered by the target game application during operation includes: When it is detected that the target game application is in the game screen rendering stage, a second preset function is called, wherein the second preset function is used to intercept in real time the target rendering resource identifier corresponding to the target game application when rendering each frame of the game screen.

5. The method according to claim 1, characterized in that After determining the target game scene matching the target rendering resource identifier based on the second corresponding relationship, the method further includes: According to the target game scenario, the operating parameters of the terminal device running the target game application and / or the display content of the user interface are adjusted.

6. The method according to claim 5, characterized in that The adjusting, according to the target game scenario, operating parameters of a terminal device running the target game application and / or display content of a user interface includes: When the target game scene is a combat scene, the frequencies of the central processing unit and the graphics processing unit in the terminal device are increased; when the target game scene is a non-combat scene, the frequencies of the central processing unit and the graphics processing unit in the terminal device are decreased; or When the target game scene is a battle scene or a vehicle drifting scene, controlling the terminal device to vibrate; or, In the case where the target game scene is a character selection scene, displaying recommendation information on the user interface of the terminal device, wherein the recommendation information is related information of a recommended character in the target game application; or When the target game scene is a key information broadcasting scene, the terminal device is controlled to broadcast the key information.

7. The method according to claim 1, characterized in that The rendering resource names are classified according to rendering resource types, and the rendering resource types include at least one of texture, project, shader, and frame buffer.

8. A game scene recognition device, characterized in that: include: An acquisition module, used to acquire the rendering resource name and rendering resource identifier required by the target game application when rendering the game screen corresponding to different game scenes; A matching module, used to match the rendering resource name with a rendering resource name in a preset first corresponding relationship, wherein the first corresponding relationship is used to represent a corresponding relationship between the rendering resource name and the game scene; an adding module, configured to add the rendering resource identifier to the first corresponding relationship to form a second corresponding relationship when the rendering resource name successfully matches the rendering resource name in the first corresponding relationship, wherein the second corresponding relationship is used to characterize the corresponding relationship between the rendering resource name, the rendering resource identifier and the game scene; The determination module is used to capture in real time the target rendering resource identifier corresponding to each frame of the game screen rendered by the target game application during operation, and based on the second corresponding relationship, determine the target game scene that matches the target rendering resource identifier.

9. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; The processor is used to implement the steps of the game scene recognition method described in any one of claims 1-7 when executing the program stored in the memory.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the game scene recognition method described in any one of claims 1-7 are implemented.

Citation Information

Cited By

  • Game scene rendering method and system

    CN120502097A

  • A game scene rendering method and system

    CN120502097B