Control method and electronic device
By intercepting game rendering data to identify scenarios and adjusting optimization strategies, the problem of user experience differences in game maps was solved, game performance and image quality were improved, and user needs in different scenarios were met.
Patent Information
- Application Number
- CN202311254463.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-26
- Publication Date
- 2026-01-09
- Estimated Expiration
- 2043-09-26
AI Technical Summary
In gaming applications, the large size of game maps and the numerous regions, each with its own unique style and gameplay, lead to significant differences in user experience requirements. Existing technologies struggle to effectively meet the needs of users in different scenarios.
By intercepting data from the game rendering process, the system can identify the scene in which the character is located and adjust the optimization strategies of electronic devices based on feature data and distance thresholds, such as increasing CPU/GPU frequency and frame interpolation, to adapt to the needs of different game scenarios.
It enables dynamic adjustment of electronic device parameters based on game scenarios, improving the user's experience in games in terms of performance, image quality, and power consumption, and meeting the needs of users in different scenarios.
Smart Images

Figure CN119746405B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of terminal devices, in particular to a control method and an electronic device. BACKGROUND
[0002] At present, many electronic devices support game applications. There are different scenes in some game applications. In different scenes, the needs of users are also different.
[0003] For example, the game map in many current game applications is large, and there are many areas distributed in the map, each area has its unique style and play method, accordingly, the load, picture quality, etc. of the game are also different, and the experience needs of game players are also different. SUMMARY
[0004] In order to solve the above technical problems, the present application provides a control method and an electronic device to improve the user experience in game applications.
[0005] In a first aspect, the present application provides a control method, which is applied to an electronic device, and the method comprises: intercepting first rendering data of a rendering process in a first application, identifying a first scene in which a first character is located according to feature data and the first rendering data, the first scene comprising a first landmark, the feature data being data representing landmark features of each scene in the first application stored in the electronic device, the feature data comprising first feature data corresponding to the first landmark, determining whether a first distance between the first character and the first landmark is less than a first threshold according to the first rendering data, and if so, adjusting a parameter value of a parameter related to a first optimization strategy corresponding to the first scene in the electronic device. In this way, different optimization strategies can be used to adjust the related parameters of the electronic device according to the different scenes in which the characters in the application, such as game applications, are located, the experience needs of users in different scenes can be flexibly met, and the user experience can be improved.
[0006] According to the first aspect, the first rendering data in the rendering process of the first application is intercepted, comprising: intercepting the first rendering data in the rendering process of the first application by hooking rendering instructions.
[0007] According to the first aspect, the first scene in which the first character is located is identified according to the feature data and the first rendering data, comprising: comparing the first rendering data with the feature data; and if the first rendering data matches the first feature data in the feature data, it is identified that the first character is in the first scene.
[0008] According to the first aspect, before determining whether the first distance between the first character and the first landmark is less than the first threshold value, the method further comprises: parsing the first model matrix data, the first coordinate data of the first character, and the first vertex data of the first landmark from the first rendering data; and determining the first distance between the first character and the first landmark according to the first vertex data, the first model matrix data, and the first coordinate data.
[0009] According to the first aspect, the first distance between the first character and the first landmark is determined according to the first vertex data, the first model matrix data, and the first coordinate data, comprising: obtaining first local coordinate data of a first center point according to the first vertex data, the first center point being a center point of the first landmark; converting the first local coordinate data into first world coordinate data by using the first model matrix data; and obtaining the first distance between the first character and the first landmark according to the first coordinate data and the first world coordinate data.
[0010] According to the first aspect, before adjusting the parameter value of the parameter related to the first optimization strategy in the electronic device according to the first optimization strategy corresponding to the first scene, the method further comprises: searching for the first optimization strategy corresponding to the first scene from a preset correspondence between scenes and optimization strategies.
[0011] According to the first aspect, the feature data comprises any one or more of the following data: size data of a data buffer; and target data in the data buffer.
[0012] According to the first aspect, the method further comprises: intercepting second rendering data in the first application rendering process; identifying the first scene in which the first character is located according to the feature data and the second rendering data; determining whether a second distance between the first character and the first landmark is less than the first threshold value according to the second rendering data; and if not, modifying the parameter value of the parameter related to the first optimization strategy in the electronic device to the parameter value before the adjustment.
[0013] According to the first aspect, the method further comprises: intercepting third rendering data in the first application rendering process; identifying a second scene in which the first character is located according to the feature data and the third rendering data, the second scene comprising a second landmark, and the feature data comprising second feature data corresponding to the second landmark; determining whether a third distance between the first character and the second landmark is less than a second threshold value according to the third rendering data; and if so, adjusting the parameter value of the parameter related to a second optimization strategy corresponding to the second scene in the electronic device.
[0014] According to the first aspect, the method further comprises: intercepting fourth rendering data in the first application rendering process, identifying the first scene in which the first character is located according to the feature data and the fourth rendering data, determining whether the fourth distance between the first character and the first landmark is less than the first threshold according to the fourth rendering data, and keeping the adjusted parameter value unchanged if yes.
[0015] In a second aspect, the present application provides an electronic device, comprising: a memory and a processor, the memory being coupled with the processor; the memory storing program instructions, when the program instructions are executed by the processor, causing the electronic device to execute the control method of any one of the first aspect.
[0016] In a third aspect, the present application provides a computer readable storage medium, comprising a computer program, when the computer program is running on the electronic device, causing the electronic device to execute the control method of any one of the first aspect. BRIEF DESCRIPTION OF DRAWINGS
[0017] Figure 1 Structure schematic diagram of the electronic device 100 shown for example;
[0018] Figure 2 Software structure block diagram of the electronic device 100 of the embodiment of the present application shown for example;
[0019] Figure 3 Flow example diagram of the control method in the embodiment of the present application shown for example;
[0020] Figure 4 Map example diagram in the game application shown for example;
[0021] Figure 5 Schematic diagram of the coordinate conversion flow shown for example;
[0022] Figure 6 Principle schematic diagram of a control flow of the game application shown for example;
[0023] Figure 7 Flow schematic diagram of a control method of the game application shown for example;
[0024] Figure 8 Control flow of the game application shown for example; Figure 7 Detailed flow schematic diagram of the control flow of the game application shown for example;
[0025] Figure 9(a) is an instruction sequence example diagram of the drawing model 1 corresponding to the image frame shown for example;
[0026] Figure 9(b) is a vertex coordinate data example diagram shown for example;
[0027] FIG. 9(c) is an example diagram of instruction stream corresponding to the vertex coordinate data shown in FIG. 9(b);
[0028] FIG. 9(d) is an example diagram of complete data of the vertex coordinate data in FIG. 9(b);
[0029] FIG. 9(e) is an example diagram of derived data of the vertex coordinate data in FIG. 9(d);
[0030] FIG. 10(a) is an example diagram of content in a vertex shader;
[0031] FIG. 10(b) is an example diagram of variable storage content corresponding to FIG. 10(a);
[0032] Figure 11 FIG. 11 is an example diagram of content of buffer 5634;
[0033] Figure 12 FIG. 12 is an example diagram of a marker model and a bounding box. DETAILED DESCRIPTION
[0034] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are some of the embodiments of the present application, but not all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work fall within the scope of protection of the present application.
[0035] The term “and / or” in the present application is only used to describe the association relationship of the associated objects, and can represent three relationships, for example, A and / or B can represent three cases of A alone, A and B together, and B alone.
[0036] The terms “first” and “second” and the like in the specification and claims of the embodiments of the present application are used to distinguish different objects, and are not used to describe a specific order of the objects. For example, the first target object and the second target object are used to distinguish different target objects, and are not used to describe a specific order of the target objects.
[0037] The present application optimizes the game experience based on position recognition, can recognize the position of a character in the game (i.e., which area in the map the character is currently in), match the corresponding optimization strategy for different areas, and improve the comprehensive experience of users in terms of game performance, picture quality, power consumption, heat, etc.
[0038] The present embodiment provides a control method, which can be applied to electronic devices such as mobile phones and tablets. Of course, it is not limited to these electronic devices.
[0039] In the present embodiment, the structure of the electronic device can be as followsFigure 1 The electronic device 100 is shown.
[0040] Figure 1 A structural schematic diagram of the electronic device 100 is shown by way of example. It should be understood that the electronic device 100 can have more or fewer components than shown in the drawings, can combine two or more components, or can have a different configuration of components. Figure 1 The electronic device 100 shown is only one example of an electronic device, and the electronic device 100 can have more or fewer components than shown in the drawings, can combine two or more components, or can have a different configuration of components. Figure 1 The various components shown in the electronic device 100 can be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and / or application-specific integrated circuits.
[0041] Referring to Figure 1 The electronic device 100 can include a processor 110, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headset jack 170D, a sensor module 180, an indicator 192, a camera 193, and the like.
[0042] The processor 110 can include one or more processing units. For example, the processor 110 can include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), and the like. Different processing units can be independent devices or integrated into one or more processors.
[0043] The controller can be the nerve center and command center of the electronic device 100. The controller can generate operation control signals according to instruction operation codes and timing signals, and complete the control of fetching and executing instructions.
[0044] The processor 110 can also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory.
[0045] The internal memory 121 can be used to store computer executable program codes including instructions. The processor 110 performs various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 can include a program storage area and a data storage area. The program storage area can store an operating system, at least one application program (such as a sound playing function, an image playing function, etc.) required by a function, etc. The data storage area can store data (such as audio data, a phone book, etc.) created during the use of the electronic device 100, etc. In addition, the internal memory 121 can include a high-speed random access memory, and can further include a non-volatile memory such as at least one magnetic disk storage device, a flash memory device, a universal flash storage (UFS), etc.
[0046] The electronic device 100 implements a display function through a GPU, a display screen 194, an application processor, etc. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 can include one or more GPUs that execute program instructions to generate or change display information.
[0047] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can adopt a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc. In some embodiments, the electronic device 100 can include 1 or N display screens 194, N being a positive integer greater than 1.
[0048] The electronic device 100 can implement an audio function through an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, an application processor, etc. For example, music playing, recording, etc.
[0049] The audio module 170 is used to convert digital audio information into an analog audio signal output, and is also used to convert an analog audio input into a digital audio signal. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be disposed in the processor 110, or part of the functions of the audio module 170 can be disposed in the processor 110.
[0050] The speaker 170A, also known as a "loudspeaker", is used to convert an audio electrical signal into a sound signal. The electronic device 100 can listen to music or listen to a hands-free call through the speaker 170A.
[0051] The receiver 170B, also called "earpiece", is used to convert audio electrical signals into sound signals. When the electronic device 100 answers a phone call or a voice message, the user can answer the voice by placing the receiver 170B close to the ear.
[0052] The microphone 170C, also called "microphone", "sound collector", is used to convert sound signals into electrical signals. When making a phone call or sending a voice message, the user can make a sound by placing the mouth close to the microphone 170C, and input the sound signal into the microphone 170C. The electronic device 100 can be provided with at least one microphone 170C. In other embodiments, the electronic device 100 can be provided with two microphones 170C, in addition to collecting sound signals, it can also realize the function of noise reduction. In other embodiments, the electronic device 100 can also be provided with three, four or more microphones 170C, which can realize the functions of collecting sound signals, noise reduction, identifying sound sources, realizing directional recording, etc.
[0053] The earphone interface 170D is used to connect wired earphones. The earphone interface 170D can be a USB interface 130, or a 3.5mm open mobile terminal platform (OMTP) standard interface, a cellular telecommunications industry association of the USA (CTIA) standard interface.
[0054] The sensor module 180 can include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0055] The touch sensor 180K, also called "touch panel". The touch sensor 180K can be provided on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, also called "touch screen". The touch sensor 180K is used to detect touch operations acting on or near it. The touch sensor can transmit the detected touch operation to the application processor to determine the touch event type. The visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor 180K can also be provided on the surface of the electronic device 100, which is different from the position where the display screen 194 is located.
[0056] Of course, in addition to the above components, the electronic device 100 can also include other hardware components, which are not listed one by one here.
[0057] Figure 2 A software structure block diagram of the electronic device 100 of the embodiments of the present application is shown.
[0058] The layered architecture of the electronic device 100 divides software into several layers, each of which has a clear role and division of labor. Layers communicate with each other through software interfaces. In some embodiments, the Android system can include an application layer, an application framework layer, a system library, and a kernel layer, etc.
[0059] The application layer can include a series of application packages.
[0060] As shown in Figure 2 , the application packages can include camera, gallery, map, WLAN, music, short message, call, navigation, Bluetooth, video, etc. Of course, these applications are only exemplary, in other embodiments, the application layer can include applications not shown in Figure 2 , and can not include one or more applications shown in Figure 2 .
[0061] As shown in Figure 2 , the application framework layer can include window manager, resource manager, view system, etc.
[0062] The window manager is used to manage the window program. The window manager can obtain the size of the display screen, determine whether there is a status bar, lock the screen, and intercept the screen, etc.
[0063] The resource manager provides various resources for the application, such as localized strings, icons, pictures, layout files, video files, etc.
[0064] The view system includes visual controls, such as controls for displaying text, controls for displaying pictures, etc. The view system can be used to build an application. A display interface can be composed of one or more views. For example, a display interface including a short message notification icon can include a view for displaying text and a view for displaying pictures.
[0065] As shown in Figure 2 , the application framework layer can include a control module, which is used to execute the control method of the embodiments of the present application.
[0066] The Android runtime includes a core library and a virtual machine. The Android runtime is responsible for scheduling and managing the Android system.
[0067] The core library contains two parts: one part is the function function required by the java language to call, and the other part is the core library of Android.
[0068] The application layer and application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.
[0069] System libraries can include multiple functional modules. For example: surface manager, media libraries, 3D graphics processing libraries (e.g., OpenGL ES), 2D graphics engines (e.g., SGL), etc.
[0070] The Surface Manager is used to manage the display subsystem and provides the blending of 2D and 3D layers for multiple applications.
[0071] The media library supports playback and recording of various common audio and video formats, as well as still image files. It supports multiple audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG.
[0072] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
[0073] A 2D graphics engine is a graphics engine for 2D (two-dimensional) drawing.
[0074] The kernel layer is the layer between hardware and software.
[0075] like Figure 2 As shown, the kernel layer can include display drivers, Wi-Fi drivers, audio drivers, sensor drivers, Bluetooth drivers, etc.
[0076] Understandable, Figure 2 The layers in the illustrated software structure and the components contained in each layer do not constitute a specific limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may include more or fewer layers than illustrated, and each layer may include more or fewer components; this application does not impose any limitations.
[0077] Figure 3 This is a flowchart illustrating an exemplary embodiment of the control method in this application. Please refer to... Figure 3 In this embodiment, the control method flow may include the following steps:
[0078] S301 intercepts the first rendering data during the first application rendering process.
[0079] S302, identify a first scene in which the first character is located according to the feature data and the first rendering data, the first scene including a first landmark, the feature data being data stored in the electronic device and representing features of landmarks in each scene in the first application, and the feature data including first feature data corresponding to the first landmark.
[0080] S303, determine whether a first distance between the first character and the first landmark is less than a first threshold according to the first rendering data.
[0081] S304, if yes, adjust a parameter value of a parameter related to the first optimization strategy in the electronic device according to a first optimization strategy corresponding to the first scene.
[0082] In this embodiment, the feature data can be obtained by the developer in the following manner and stored in the electronic device after being obtained:
[0083] reading an image frame from the first application;
[0084] analyzing the read image frame to obtain the feature data, the feature data including feature data corresponding to landmarks in each scene in the first application.
[0085] In this document, landmark is an abbreviation of landmark object.
[0086] Here, the concept of scene in this embodiment is described. Figure 4 The map in the game application is shown as an example. Figure 4 The overall map is divided into three areas by a dashed line, and each area corresponds to a scene, which are scene 1, scene 2 and scene 3 respectively. That is, the scenes in the map are one-to-one corresponding to the areas. Each scene has a unique landmark corresponding to the scene, for example Figure 4 In this embodiment, the landmark of scene 1 is landmark 1, the landmark of scene 2 is landmark 2, and the landmark of scene 3 is landmark 3.
[0087] Each scene (area) has a unique style and play method, and this embodiment pre-configures a corresponding optimization strategy for each scene. In this embodiment, one scene can correspond to one or more optimization strategies. For example, the correspondence between the scene and the optimization strategy can be as shown in Table 1.
[0088] Table 1
[0089] Scenario Optimization strategy Scenario 1 Optimization strategy 1, optimization strategy 2 Scenario 2 Optimization strategy 5 Scenario 3 Optimization strategy 4
[0090] This embodiment can identify the position area of the character in the game, and according to the unique style and play method of each area, match the corresponding optimization method, and improve the comprehensive experience of the user in the game performance, picture quality, power consumption and heat.
[0091] In this embodiment, the electronic device can be a mobile phone. Figure 4Taking scene 1 in the illustrated map as an example, if scene 1 has many players, heavy load, and intense battles, when it is identified that a character is in scene 1, the scheduling strategy can be adjusted (the CPU (central processing unit), GPU (graphics processing unit), and DDR (double data rate synchronous dynamic random access memory) frequency points are improved) to meet the heavy load requirements of scene 1, to ensure the performance of players at the location, and the frame insertion scheme can also be used to further improve the smooth experience in intense battles. Here, improving the CPU, GPU, and DDR frequency points and frame insertion are the optimization strategies corresponding to scene 1.
[0092] The content of the optimization strategy can be as shown in Table 2.
[0093] Table 2
[0094] Optimization strategy number Optimization strategy content Optimization strategy 1 Boost CPU / GPU / DDR frequency Optimization strategy 2 Interpolation Optimization strategy 3 Down-sampling Optimization strategy 4 Quality enhancement Optimization strategy 5 GPU load reduction …… ……
[0095] Figure 5 The schematic diagram of the coordinate conversion process is exemplarily shown. Please refer to Figure 5 In the embodiment, the coordinate system composed of various coordinates in the coordinate conversion process in the game application includes local coordinates, world coordinates, observation coordinates, clipping coordinates, and screen coordinates. Among them:
[0096] Local coordinates: refer to the coordinates of an object relative to a local origin, which are also the coordinates at which the object starts.
[0097] World coordinates: also known as world space coordinates, refer to a coordinate system of a larger space range, which can be converted from local coordinates through an M matrix (i.e., M matrix in Figure 5 , model matrix).
[0098] Observation coordinates: refer to the coordinates observed from the angle of a camera or an observer, which can be converted from world space coordinates through a V matrix (i.e., V matrix in Figure 5 , observation matrix).
[0099] Clipping coordinates: refer to defining a frustum, cutting off objects outside the frustum, and normalizing the coordinates to the range of -1.0 to 1.0, which can be realized through a P matrix (i.e., P matrix in Figure 5 , projection matrix).
[0100] Finally, the clipping coordinates are converted into screen coordinates through a viewport transformation, which can be realized through a glViewPort function.
[0101] During the game rendering process, each object is composed of several vertices. These vertices undergo transformations through model matrix, view matrix, projection matrix, and viewport transformation to ultimately present their final position and shape in screen space. Of course, textures can also be added to these object models during the rendering process to bring players a realistic experience.
[0102] Figure 6 This is a schematic diagram illustrating the principle of a control flow for a game application. Please refer to [link / reference]. Figure 6 In this embodiment, the operation is performed during the intermediate rendering process. Game rendering commands are intercepted to obtain vertex data, MVP data (referring to the data of the M, V, and P matrices), and character coordinate data of a certain scene landmark model. Then, the coordinates of the landmark model in the world space coordinate system are calculated using the vertex data and the M matrix, and the distance between the character and the landmark is further calculated. When this distance is less than a certain threshold, the character is determined to be in a certain location and scene within the game, thereby enabling appropriate optimization schemes to improve the game experience. Simultaneously, this distance value is refreshed every frame, allowing for real-time determination of the user's position, when they enter and leave that location, and precise control over the effective time and scope of various optimization strategies.
[0103] This section uses the control flow of a game application as an example to illustrate the control method of this application.
[0104] Figure 7 This is a flowchart illustrating an exemplary method for controlling a game application. Figure 8 For example Figure 7 A detailed flowchart illustrating the control process.
[0105] Please see Figure 7 and Figure 8 In this embodiment, the process of controlling the game application may include the following steps:
[0106] Step S1: Capture image frames from the game application for offline analysis to obtain unique marker feature data for each scene in the game.
[0107] The offline analysis content includes, for example: Figure 8 As shown in the "Offline Analysis" box in the upper left corner.
[0108] The marker feature data may include data such as the size of the data buffer and the target.
[0109] By analyzing shader variables offline, the data structure can be analyzed, and then the data in the buffer can be parsed, such as the MVP matrix and the camera's coordinates in world space.
[0110] In one example, unique marker feature data for each scene in the game is obtained by capturing image frames, and this marker feature data is saved in an electronic device.
[0111] Each scene in the game has a unique landmark. Figure 4 For example, the only marker in scene 1 is Figure 4 When the rendering of marker 1 begins from the rendering instruction stream, it can be determined that the character has appeared near the location (i.e., marker 1). By further calculating the distance between the character and marker 1, it is possible to accurately determine the character's position in the location and when the character leaves the location.
[0112] That is, when the distance between a person and marker 1 is less than a preset threshold, it can be determined that the person is near marker 1 (at this time, the person's position is...). Figure 4 Within the circle 1, if the distance between the person and the marker 1 is greater than or equal to a preset threshold, it can be determined that the person is not near the marker 1 (at this time, the person's position is within the circle 1). Figure 4 Outside the circle 1 in the middle), the figure left the marker 1.
[0113] Frame-by-frame offline analysis was performed on the characteristics of marker 1, including its corresponding label during rendering, data size, target type of the buffer, and data organization method. The vertex data of marker 1 is shown in Table 3 below.
[0114] Table 3
[0115]
[0116]
[0117] In Table 3, "VIX" represents the vertex number of the object model, "IDX" represents the index value of the vertex of the object model, and "in_ATTRIBUTE0" represents the coordinate value of the vertex of the object model in the local coordinate system.
[0118] Step S2 involves intercepting rendering data by hooking rendering commands and matching it with offline analysis features.
[0119] In this step, the offline analysis features are the marker features from step S1.
[0120] The detailed process for this step can be found as follows: Figure 8 Steps S801 to S805 are shown in the following:
[0121] Step S801: HOOK command, intercept data.
[0122] Step S802, the marker feature matching is performed, that is, the marker feature matching is performed according to the intercepted rendering data.
[0123] Step S803, it is judged whether the marker feature matching is matched successfully, if yes, that is, the matching is successful, step S804 is executed, otherwise, the process is ended.
[0124] Step S804, the data Buffer feature matching is performed.
[0125] Step S805, it is judged whether the data Buffer feature matching is matched successfully, if yes, that is, the matching is successful, step S806 is executed, otherwise, the process is ended.
[0126] Hook is a technology used to obtain or change some data during program execution, or to change the program execution flow. In this step, the following data can be intercepted through the hook instruction:
[0127] (1) Intercept vertex data
[0128] Hook game rendering instructions, intercept vertex data through glGenBuffer, glBindBuffer, glBufferData, glBufferSubData, etc. instructions, determine what vertex attribute is used for vertex position information, determine the organization form of vertex data, including using vertex array buffer, index array, etc. to organize; parse the data and cache.
[0129] For example, buffer ID = 111. The corresponding program code is as follows:
[0130] Name
[0131] glGenBuffers-generate buffer object names
[0132] C Specification
[0133] void glGenBuffers(GLsizei n,
[0134] GLuint*buffers);
[0135] According to the above code, here, the name of the cache object is generated by the function glGenBuffer, which is a unique identifier 111 for the cache.
[0136] The two targets GL_ELEMENT_ARRAY_BUFFER and GL_ARRAY_BUFFER need to be intercepted; the operation ID bufferID is 111. The corresponding program code is as follows:
[0137] Name
[0138] glBindBuffer-bind a named buffer object
[0139] C Specification
[0140] void glBindBuffer(GLenum target,
[0141] GLuint buffer);
[0142] According to the above code, here, the buffer object generated by the function glGenBuffer is bound by the function glBindBuffer.
[0143] The corresponding bufferID is 111; the two targets GL_ELEMENT_ARRAY_BUFFER and GL_ARRAY_BUFFER need to be intercepted.
[0144] According to the ID, the data and size are cached to the memory; if size == 0 or data == nullptr; then only allocate space, do not cache data. The corresponding program code is as follows:
[0145] Name
[0146] glBufferData, glNamedBufferData-creates and initializes a buffer object’s data store
[0147] C Specification
[0148] void glBufferData(GLenum target,
[0149] GLsizeiptr size,
[0150] const void*data,
[0151] GLenum usage);
[0152] According to the above code, here, the function glBufferData is used to allocate space and store data for the buffer object.
[0153] Then, the data is passed to the corresponding position. The corresponding program code is as follows:
[0154] glBufferSubData, glNamedBufferSubData - updates a subset of a buffer object's data store
[0155] C Specification
[0156] void glBufferSubData(GLenum target,
[0157] GLintptr offset,
[0158] GLsizeiptr size,
[0159] const void*data);
[0160] According to the above code, here, the data in the buffer object is updated by the function glBufferSubData.
[0161] For example, a game application is intercepted by using renderDoc to obtain an image frame. Fig. 9(a) is an example of an instruction sequence of a drawing model 1 corresponding to the image frame. As shown in Fig. 9(a), for the Draw #56, the instruction sequence corresponding to the drawing model is located in the lower half of the figure, that is, the instruction sequence numbered from 979 to 989 in Fig. 9(a).
[0162] Fig. 9(b) is an example of vertex coordinate data, and Fig. 9(c) is an example of an instruction stream corresponding to the vertex coordinate data shown in Fig. 9(b). As can be seen from Fig. 9(b), the vertex coordinate is vertex attribute 0 (that is, in_ATTRIBUTE0), and as can be seen from the instruction stream shown in Fig. 9(c), 985_glVertexAttribPointer sets the parsing mode of the vertex attribute 0, and the corresponding vertex buffer is 5634, that is, the parameter of 984_glBindBuffer. As can be seen from the instruction stream 983_glBindBuffer, the vertex index buffer object is buffer 5632. The data of the vertex buffer 5634 and the index object buffer 5632 are exported and combined together, and it can be seen that the vertex is the vertex of the current Draw (Draw #56), that is, the drawing model 1.
[0163] Figure 9(d) is a complete data example diagram of vertex coordinate data in Figure 9(b). Figure 9(e) is a derived data example diagram of vertex coordinate data in Figure 9(d). For example, the first row data (6.81526, 44.39426, 1564.0105) in the table Buffer 5634-Contents in Figure 9(e) is one of the data of vertex buffer 5634 derived from Figure 9(d), and the first row data 0 (located in the data column) in the table Buffer 5632-Contents in Figure 9(e) is one of the data of index object buffer 5632 derived from Figure 9(d).
[0164] (2) Intercept M matrix, V matrix, P matrix data, character coordinate data
[0165] In the game application, the camera follows the movement of the character, so the position coordinates of the character in the world space can be directly replaced by the camera coordinates.
[0166] 21. Analyze the corresponding VS shader (vertex shader) to determine the Uniform variable names of M matrix, V matrix, P matrix, and Camera; the Uniform variable name of M matrix is Primitive_LocalToWorldTranslated, and the Uniform variable names of V matrix and P matrix are View_TranslatedWorldToClip.
[0167] 22. Determine the passing mode of M matrix, V matrix, P matrix, and Camera variables
[0168] 23. Obtain the coordinate values of the corresponding M matrix, V matrix, P matrix, and Camera in the world space.
[0169] Figure 10(a) is an example diagram showing the contents in the vertex shader, and Figure 10(b) is an example diagram showing the corresponding variable storage contents of Figure 10(a). As can be seen from Figure 10(a) and Figure 10(b), the Primitive_LocalToWorldTranslated variable is stored in Buffer 10626, and the View_TranslatedWorldToClip variable is stored in Buffer 2832, corresponding to shader 2039.
[0170] Step S3. If the matching passes, parse the Buffer data and save the model vertex data, M matrix, V matrix, P matrix data, and character coordinate data.
[0171] This step corresponds to Figure 8Step S806 in FIG. 8 (parsing Buffer data and saving vertex, M matrix, character coordinate, and other data).
[0172] The purpose of this step S3 is to cache vertex position information buffer 5634, index data buffer 5632, M matrix, V matrix, P matrix data (Buffer 10626 and Buffer 2832). The buffer ID needs to be recorded when the buffer is created, the corresponding data is cached when the data is transmitted into the buffer, and the cached data is updated synchronously when the buffer is updated.
[0173] Taking the buffer 5634 as an example. Figure 11 For an example of the content of the buffer 5634, please refer to Figure 11 When the glGenBuffers instruction is called, the buffer parameter is stored as bufferID=5634; when the glBufferData instruction is called, a block of memory of bytesize size (7044 in this example) is allocated for bufferID_5634, and the corresponding data is stored. Figure 11 In other examples, glBufferSubData can also be called to update the cached data according to specific parameters.
[0174] Step S4, calculate the distance between the marker center coordinate and the character coordinate, and determine the position and scene of the character in the game.
[0175] This step corresponds to Figure 8 Step S807 in FIG. 8 (calculate the distance between the character and the marker to determine the position and scene of the character).
[0176] In one example, after obtaining the vertex data of the marker model, the center coordinate of the marker model can be calculated by the idea of the Axis-aligned bounding box (AABB).
[0177] Figure 12 For an example of the marker model and the bounding box, please refer to Figure 12 As shown in FIG. 8, the marker model is placed in the bounding box, the maximum value of the X axis of the bounding box is x_max, and the minimum value is x_min; the maximum value of the Y axis of the bounding box is y_max, and the minimum value is y_min; the maximum value of the Z axis of the bounding box is z_max, and the minimum value is z_min.
[0178] In this way, the coordinates (center_x, center_y, center_z) of the center point of the marker model are calculated as follows:
[0179] center_x = (x_min + x_max) / 2;
[0180] center_y = (y_min + y_max) / 2;
[0181] center_z = (z_min + z_max) / 2.
[0182] That is, the value of the X axis of the marker model center point coordinate is equal to the average value of the maximum and minimum values of the X axis of the marker model bounding box, the value of the Y axis of the marker model center point coordinate is equal to the average value of the maximum and minimum values of the Y axis of the marker model bounding box, and the value of the Z axis of the marker model center point coordinate is equal to the average value of the maximum and minimum values of the Z axis of the marker model bounding box.
[0183] Then, the marker model center point coordinate is directly subjected to matrix operation, so that the coordinate value of the marker model center point in the world space coordinate system can be obtained. The M matrix is Primitive_LocalToWorldvb1. The style of the M matrix is as follows:
[0184]
[0185] In practical applications, the "*" symbol is replaced with a specific number.
[0186] Suppose the local coordinates of the vertex are: V1: {45, 51, 65, 11}
[0187] Then, the world coordinates of the vertex are: M*V1 = {x, y, z, w} = {5, 23, 4, 5}
[0188] Wherein, x, y, z are the coordinate values of the point on the X axis, Y axis, Z axis respectively, and w
[0189] After obtaining the coordinate value of the marker model center point in the world space coordinate system, the distance between the marker center coordinate and the camera coordinate (i.e. the character coordinate) can be calculated according to the coordinate value of the marker model center point in the world space coordinate system and the character coordinate data, and then the position and scene of the character in the game can be determined according to the distance.
[0190] For example, suppose the coordinate value of the marker model center point in the world space coordinate system is {x1, y1, z1, w1}, and the camera coordinate is {x2, y2, z2, w2}, then the distance d between the two can be calculated according to the following formula (1):
[0191]
[0192] S5, enable appropriate optimization strategies according to different scenes.
[0193] This step corresponds to Figure 8 Step S808 (Enable appropriate optimization strategies based on location and scene matching).
[0194] This step enhances the user's gaming experience by enabling appropriate optimization strategies based on different scenarios.
[0195] Among them, the appropriate optimization strategy refers to the optimization strategy that matches the scenario.
[0196] For example, when players are in popular game areas, where there are many players and intense battles, players have high demands for game performance, smoothness, responsiveness, and network latency. Therefore, optimization strategies such as SOC (System-on-Chip) upscaling, frame interpolation, touch enhancement, and network acceleration can be enabled in this scenario. When players are in casual scenes, where performance requirements are lower but image quality requirements are higher, optimization strategies that enhance image quality can be considered to improve the gaming experience.
[0197] In this embodiment, the optimization strategies are all based on the aforementioned location identification for selection and matching.
[0198] The control method of this embodiment will be further described in detail below with examples.
[0199] Example 1
[0200] In offline analysis, select location Figure 1 Entering game mode, the character controlled by the user in the game is Character 1. Figure 1 In electronic devices, the combination of parameter values related to the gaming experience is parameter value combination 0. Figure 1 Scenes such as Figure 4 As shown. The electronic devices respectively capture the locations of game application 1. Figure 1 Image frames from scenes 1, 2, and 3 are analyzed offline to obtain feature data for each scene: Feature Data 1, Feature Data 2, and Feature Data 3. Feature Data 1, Feature Data 2, and Feature Data 3 are then stored in the electronic device. It should be noted that the offline analysis is performed in advance by the developers; after obtaining the scene feature data, the scene feature data is stored in the electronic device. During user operation of the application, the electronic device does not perform offline analysis while executing the control method provided in this embodiment.
[0201] After the user opens the game application 1, the electronic device intercepts the instruction stream 1 of the rendering process in the game application 1, and identifies that the character 1 is in the scene 1 according to the feature data and the instruction stream 1. The scene 1 includes the landmark 1. The identification can be that the landmark feature data 1 is included in the rendering data 1 extracted from the instruction stream 1, and the landmark feature data 1 matches the feature data 1, so it is confirmed that the character 1 is in the scene 1.
[0202] The electronic device determines that the distance 1 between the character 1 and the landmark 1 at this time is less than the threshold 1 according to the rendering data 1 extracted from the instruction stream 1.
[0203] The electronic device enables the optimization strategy 1 and the optimization strategy 2 corresponding to the scene 1, adjusts the parameter values of the parameters related to the optimization strategy 1 and the optimization strategy 2 in the electronic device according to the optimization strategy 1 and the optimization strategy 2 corresponding to the scene 1 (see Table 1 and Table 2 described above), that is, the frequency points of the CPU, the GPU and the DDR in the electronic device are improved, and the display video of the game application 1 is inserted frame processing.
[0204] For the convenience of subsequent description, the parameter value combination after this adjustment is referred to as parameter value combination 1, and the parameter value combination before this adjustment is the aforementioned parameter value combination 0.
[0205] Example 2
[0206] After Example 1.
[0207] After intercepting the instruction stream 1, the electronic device performs the following operations.
[0208] The electronic device intercepts the instruction stream 2 of the rendering process in the game application 1, and identifies that the character 1 is still in the scene 1 according to the feature data and the instruction stream 2. The identification can be that the landmark feature data 1 is included in the rendering data 2 extracted from the instruction stream 2, and the landmark feature data 1 matches the feature data 1, so it is confirmed that the character 1 is in the scene 1.
[0209] The electronic device determines that the distance 2 between the character 1 and the landmark 1 at this time is still less than the threshold 1 according to the rendering data 2 extracted from the instruction stream 2.
[0210] The electronic device keeps the aforementioned parameter value combination 1 unchanged. That is, after intercepting the instruction stream 2, the parameter value combination in the electronic device is still the parameter value combination 1.
[0211] Example 3
[0212] After Example 2.
[0213] After intercepting the instruction stream 2, the electronic device performs the following operations.
[0214] The electronic device intercepts the instruction stream 3 of the rendering process in the game application 1, and identifies that the character 1 is still in the scene 1 according to the feature data and the instruction stream 3. The identification can be that the rendering data 3 extracted from the instruction stream 3 includes the landmark feature data 1, and the landmark feature data 1 matches the feature data 1, so it is confirmed that the character 1 is in the scene 1.
[0215] The electronic device determines that the distance 3 between the character 1 and the landmark 1 at this time is greater than the threshold 1 according to the rendering data 3 extracted from the instruction stream 3.
[0216] The electronic device stops enabling the optimization strategy 1 and the optimization strategy 2 corresponding to the scene 1, that is, the electronic device adjusts the parameter values of the parameters related to the optimization strategy 1 and the optimization strategy 2 in the electronic device, so that the parameter value combination after this adjustment is the aforementioned parameter value combination 0, that is, the same as the parameter value combination before the optimization strategy 1 and the optimization strategy 2 corresponding to the scene 1 are not enabled.
[0217] Example 4
[0218] Following Example 3.
[0219] After intercepting the instruction stream 3, the electronic device performs the following operations.
[0220] The electronic device intercepts the instruction stream 4 of the rendering process in the game application 1, and identifies that the character 1 is in the scene 3 according to the feature data and the instruction stream 4. The scene 3 includes the landmark 3. The identification can be that the rendering data 4 extracted from the instruction stream 4 includes the landmark feature data 3, and the landmark feature data 3 matches the aforementioned feature data 3, so it is confirmed that the character 1 is in the scene 3.
[0221] The electronic device determines that the distance 4 between the character 1 and the landmark 3 at this time is greater than the threshold 3 according to the rendering data 4 extracted from the instruction stream 4.
[0222] The electronic device keeps the aforementioned parameter value combination 0 unchanged. That is, after intercepting the instruction stream 4, the parameter value combination in the electronic device is still the parameter value combination 0. In this example, the electronic device does not enable any optimization strategy.
[0223] Example 5
[0224] Following Example 4.
[0225] After intercepting the instruction stream 4, the electronic device performs the following operations.
[0226] The electronic device intercepts the instruction stream 5 of the rendering process in game application 1. Based on the feature data and instruction stream 5, it identifies that character 1 is still in scene 3, which includes landmark 3. The identification method can be as follows: the rendering data 5 extracted from instruction stream 5 includes landmark feature data 3, and the landmark feature data 3 matches the aforementioned feature data 3, thus confirming that character 1 is in scene 3.
[0227] The electronic device determines, based on the rendering data 5 extracted from the instruction stream 5, that the distance 5 between the character 1 and the landmark 3 is less than the threshold 3.
[0228] The optimization strategy 3 corresponding to scenario 3 of the electronic device is used to adjust the parameter values of the parameters related to optimization strategy 3 in the electronic device, that is, to perform image quality enhancement processing on the display video of game application 1. For the convenience of subsequent description, the combination of parameter values after this adjustment will be referred to as parameter value combination 2.
[0229] Afterwards, the electronic device can continue to intercept the command stream, determine the scene where character 1 is located based on the command stream, and obtain the distance between character 1 and the landmarks in the scene. Then, based on the relationship between the distance and the corresponding threshold, it can determine whether to enable the optimization strategy corresponding to the current scene.
[0230] Example 6
[0231] See Example 5.
[0232] Users from game application 1 Figure 1 Exit from here, select location Figure 2 Enter game mode. The character controlled by the user in the game is Character 2. Figure 1 In electronic devices, the combination of parameter values related to the gaming experience is parameter value combination 0.
[0233] Electronic devices respectively capture the location of game application 1 Figure 2 The image frames of scenes 4, 5, and 6 are analyzed offline to obtain the feature data of scenes 4, 5, and 6: feature data 4, feature data 5, and feature data 6.
[0234] Then, as in Examples 2 to 5 above, the electronic device intercepts the instruction stream of the rendering process in the game application 1, identifies the scene where the character 2 is located (at this time, the scene is one of scene 4, scene 5, or scene 6) based on feature data 4, feature data 5, feature data 6 and the intercepted instruction stream, and obtains the distance between the character 2 and the landmark in the scene, and then determines whether to enable the optimization strategy corresponding to the current scene based on the relationship between the distance and the corresponding threshold.
[0235] The control method of the embodiment can adjust relevant parameters of the electronic device by using different optimization strategies according to different scenes in which a character in an application such as a game application is located, flexibly meet experience requirements of users in different scenes, and improve the use experience of the users.
[0236] The embodiment of the application further provides an electronic device, which comprises a memory and a processor, the memory is coupled with the processor, and the memory stores program instructions, when the program instructions are executed by the processor, the electronic device executes the control method of the foregoing electronic device.
[0237] It can be understood that, in order to implement the above functions, the electronic device comprises hardware and / or software modules corresponding to the functions. The algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is implemented in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application in combination with the embodiments, but such implementation should not be considered beyond the scope of the application.
[0238] The embodiment further provides a computer storage medium, which stores computer instructions, when the computer instructions are run on an electronic device, the electronic device executes the related method steps to implement the control method in the above embodiment.
[0239] The embodiment further provides a computer program product, when the computer program product is run on a computer, the computer executes the related steps to implement the control method in the above embodiment.
[0240] In addition, the embodiment of the application further provides an apparatus, which can be a chip, a component or a module. The apparatus can comprise a processor and a memory connected to each other. The memory is used to store computer execution instructions. When the apparatus is running, the processor can execute the computer execution instructions stored in the memory, so that the chip executes the control method in the above method embodiments.
[0241] The electronic device, the computer storage medium, the computer program product or the chip provided in the embodiment are used to execute the corresponding method provided above, and thus the beneficial effects that can be achieved are referable to the beneficial effects in the corresponding method provided above, which will not be described herein again.
[0242] Through the description of the above embodiments, those skilled in the art can understand that, for the convenience and brevity of description, only the division of the above functional modules is exemplified, and in actual application, the above functions can be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above.
[0243] In several embodiments provided in the present application, it should be understood that the disclosed apparatus and method can be implemented in other ways. For example, the apparatus embodiments described above are only schematic, for example, the division of the modules or units is only a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another device, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units shown or discussed can be indirect coupling or communication connection through some interface, device or unit, and can be electrical, mechanical or other forms.
[0244] The units described as separate components can or can not be physically separate, and the components shown as units can be one physical unit or multiple physical units, that is, can be located in one place, or can be distributed to multiple different places. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiment scheme.
[0245] In addition, each functional unit in each embodiment of the present application can be integrated in one processing unit, or each unit can be physically present alone, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit.
[0246] Any content of each embodiment of the present application, and any content of the same embodiment, can be freely combined. Any combination of the above is within the scope of the present application.
[0247] If the integrated unit is implemented in the form of a software function unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present application essentially or say the parts that make contributions to the prior art or the whole or part of the technical solutions can be embodied in the form of a software product, which is stored in a storage medium, includes several instructions to make a device (which can be a single-chip microcomputer, a chip, etc.) or a processor execute all or part of the steps of the various embodiments of the method of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various media that can store program codes.
[0248] The embodiments of the present application are described above in combination with the drawings, but the present application is not limited to the above-described specific embodiments, and the above-described specific embodiments are only illustrative, not restrictive. Those skilled in the art can make many forms under the inspiration of the present application without departing from the scope of the present application and the scope of protection of the claims, and all of them belong to the protection of the present application.
[0249] The steps of the method or algorithm described in combination with the disclosure of the embodiments of the present application can be implemented in hardware or by a processor executing software instructions. The software instructions can be composed of corresponding software modules, which can be stored in a random access memory (RAM), a flash memory, a read-only memory (ROM), an erasable programmable ROM (EPROM), an electrically EPROM (EEPROM), a register, a hard disk, a mobile hard disk, a compact disc (CD-ROM), or any other form of storage medium well known in the art. An exemplary storage medium is coupled to the processor, so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be an integral part of the processor. The processor and the storage medium can be located in an ASIC.
[0250] Those skilled in the art can understand that the functions described in the embodiments of the present application in the one or more examples above can be implemented in hardware, software, firmware or any combination thereof. When implemented in software, the functions can be stored in a computer readable medium or transmitted as one or more instructions or codes on a computer readable medium. The computer readable medium includes computer storage medium and communication medium, wherein the communication medium includes any medium that facilitates the transfer of computer program from one place to another. The storage medium can be any available medium that can be accessed by a general or special purpose computer.
[0251] The embodiments of the present application are described above in conjunction with the drawings, but the present application is not limited to the specific embodiments described above, and the specific embodiments described above are merely illustrative rather than limiting, and those of ordinary skill in the art can make many forms under the inspiration of the present application without departing from the purpose of the present application and the scope protected by the claims.
Claims
1. A control method characterized by, The method is applied to an electronic device, and the method comprises: intercepting first rendering data in a first application rendering process; identifying a first scene in which a first character is located according to feature data and the first rendering data, the first scene including a first marker, the feature data being data representing marker features of each scene in the first application stored in the electronic device and obtained by offline analysis of image frames corresponding to each scene in the first application, the feature data including first feature data corresponding to the first marker, each scene in the first application having a unique marker, and the feature data including feature data corresponding to markers corresponding to each scene; determining whether a first distance between the first character and the first marker is less than a first threshold according to the first rendering data; if yes, adjusting a parameter value of a parameter related to a first optimization strategy in the electronic device according to the first optimization strategy corresponding to the first scene; the method further comprises: intercepting second rendering data in the first application rendering process; identifying the first scene in which the first character is located according to the feature data and the second rendering data; determining whether a second distance between the first character and the first marker is less than the first threshold according to the second rendering data; if no, modifying the parameter value of the parameter related to the first optimization strategy in the electronic device to the parameter value before adjustment.
2. The method of claim 1, wherein, intercepting first rendering data in a first application rendering process comprises: intercepting first rendering data in a first application rendering process through a hook rendering instruction.
3. The method of claim 1, wherein, identifying a first scene in which a first character is located according to feature data and the first rendering data comprises: comparing the first rendering data with the feature data; if the first rendering data matches the first feature data in the feature data, it is identified that the first character is in the first scene.
4. The method of claim 1, wherein, before determining whether a first distance between the first character and the first marker is less than a first threshold, further comprising: parsing first model matrix data, first coordinate data of the first character and first vertex data of the first marker from the first rendering data; determining the first distance between the first character and the first marker according to the first vertex data, the first model matrix data and the first coordinate data.
5. The method of claim 4, wherein, determining the first distance between the first character and the first marker according to the first vertex data, the first model matrix data and the first coordinate data comprises: obtaining first local coordinate data of a first center point according to the first vertex data, the first center point being a center point of the first marker; converting the first local coordinate data into first world coordinate data by using the first model matrix data; obtaining the first distance between the first character and the first marker according to the first coordinate data and the first world coordinate data.
6. The method of claim 1, wherein, Before adjusting the parameter value of the parameter related to the first optimization strategy in the electronic device according to the first optimization strategy corresponding to the first scene, the method further includes: finding the first optimization strategy corresponding to the first scene from a preset correspondence between scenes and optimization strategies.
7. The method of claim 1, wherein, The feature data includes any one or more of the following data: size data of a data buffer; target data in the data buffer.
8. The method of claim 1, wherein, The method further includes: intercepting third rendering data in the first application rendering process, and identifying a second scene in which a first character is located according to the feature data and the third rendering data, the second scene including a second landmark, the feature data including second feature data corresponding to the second landmark; determining whether a third distance between the first character and the second landmark is less than a second threshold according to the third rendering data; if yes, adjusting a parameter value of a parameter related to a second optimization strategy in the electronic device according to the second optimization strategy corresponding to the second scene.
9. The method of claim 1, wherein, The method further includes: intercepting fourth rendering data in the first application rendering process, and identifying the first scene in which the first character is located according to the feature data and the fourth rendering data; determining whether a fourth distance between the first character and the first landmark is less than the first threshold according to the fourth rendering data; if yes, keeping the adjusted parameter value unchanged.
10. An electronic device, comprising: The method includes: a memory and a processor, the memory being coupled to the processor; the memory stores program instructions, when the program instructions are executed by the processor, the electronic device executes the control method according to any one of claims 1 to 9.
11. A computer readable storage medium comprising a computer program, characterized in that, When the computer program runs on the electronic device, the electronic device executes the control method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Data processing method and related device
CN116091292A