WO2020108085A1 - Resource allocation method and apparatus, terminal, and storage medium - Google Patents

Resource allocation method and apparatus, terminal, and storage medium Download PDF

Info

Publication number
WO2020108085A1
WO2020108085A1 PCT/CN2019/109167 CN2019109167W WO2020108085A1 WO 2020108085 A1 WO2020108085 A1 WO 2020108085A1 CN 2019109167 W CN2019109167 W CN 2019109167W WO 2020108085 A1 WO2020108085 A1 WO 2020108085A1
Authority
WO
WIPO (PCT)
Prior art keywords
game
application
scene
screenshot
resource configuration
Prior art date
Application number
PCT/CN2019/109167
Other languages
French (fr)
Chinese (zh)
Inventor
陈岩
Original Assignee
Oppo广东移动通信有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Publication of WO2020108085A1 publication Critical patent/WO2020108085A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches

Definitions

  • the embodiments of the present application relate to the technical field of application optimization, and in particular, to a resource configuration method, device, terminal, and storage medium.
  • a mobile application For example, a mobile application, a social application, a video playback application, an instant communication application, and a shopping application are installed in the mobile terminal.
  • mobile terminal manufacturers are constantly improving their hardware configuration to improve the running speed and quality of applications.
  • mobile terminals are configured with high-performance Central Processing Unit (CPU) and Graphics Processing Unit (GPU) to improve the running speed and picture quality of game applications.
  • CPU Central Processing Unit
  • GPU Graphics Processing Unit
  • Embodiments of the present application provide a resource configuration method, device, terminal, and storage medium.
  • the technical solution is as follows:
  • a resource configuration method including:
  • a resource configuration device including:
  • the display module is used to display the game screen when running the game application
  • a screenshot module used to take a screenshot of the game screen to obtain a screenshot of the game
  • a scene recognition module used to identify the game screenshot through the game scene recognition model, and determine the game scene corresponding to the game screen, where the game scene is used to indicate the running stage of the game application;
  • a strategy determination module for determining a resource configuration strategy corresponding to the game scene
  • the resource allocation module is configured to allocate system resources to the game application according to the resource configuration strategy.
  • the terminal includes a processor and a memory; the memory stores at least one instruction, and the at least one instruction is used to be executed by the processor to implement the resource as described above Configuration method.
  • a computer-readable storage medium where the storage medium stores at least one instruction, and the at least one instruction is used to be executed by a processor to implement the resource configuration method as described above.
  • FIG. 1 is a schematic structural diagram of a terminal provided by an exemplary embodiment of the present application.
  • FIG. 2 is a schematic diagram of the implementation of the communication process between the application program and the operating system in the terminal;
  • FIG. 3 is a schematic structural diagram of a terminal provided by an exemplary embodiment of the present application.
  • FIG. 4 and 5 are schematic diagrams of the communication process between the application program and the operating system in the terminal shown in FIG. 3;
  • FIG. 6 is a schematic structural diagram of a terminal provided by another exemplary embodiment of the present application.
  • FIG. 7 shows a flowchart of a resource configuration method shown in an exemplary embodiment of the present application.
  • FIG. 8 shows a flowchart of a resource configuration method shown in another exemplary embodiment of the present application.
  • FIG. 9 shows a flowchart of a resource configuration method shown in another exemplary embodiment of the present application.
  • FIG. 10 shows a flowchart of a resource configuration method shown in another exemplary embodiment of the present application.
  • 11 is a schematic diagram of an interface for displaying acceleration controls on the upper layer of the game screen
  • FIG. 12 shows a structural block diagram of a resource configuration device provided by an embodiment of the present application.
  • the "plurality” referred to herein refers to two or more.
  • “And/or” describes the relationship of the related objects, indicating that there can be three relationships, for example, A and/or B, which can indicate: there are three conditions: A exists alone, A and B exist simultaneously, and B exists alone.
  • the character "/” generally indicates that the related object is a "or" relationship.
  • FIG. 1 shows a structural block diagram of a terminal 100 provided by an exemplary embodiment of the present application.
  • the terminal 100 may be an electronic device capable of running a game application program, such as a smart phone, a tablet computer, a portable personal computer, or the like.
  • the terminal 100 in this application may include one or more of the following components: a processor 110, a memory 120, and an input/output device 130.
  • the processor 110 may include one or more processing cores.
  • the processor 110 uses various interfaces and lines to connect various parts of the entire terminal 100, and executes the terminal by running or executing instructions, programs, code sets or instruction sets stored in the memory 120, and calling data stored in the memory 120 100 various functions and processing data.
  • the processor 110 may use at least one of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA).
  • DSP Digital Signal Processing
  • FPGA field programmable gate array
  • PLA programmable logic array
  • the processor 110 may integrate one or a combination of a central processing unit (Central Processing Unit, CPU), an image processing unit (Graphics Processing Unit, GPU), and a modem.
  • CPU mainly deals with operating system, user interface and application program, etc.
  • GPU is used for rendering and rendering of display content
  • modem is used for handling wireless communication. It can be understood that the above-mentioned modem may not be integrated into the processor 110, and may be implemented by a communication chip alone.
  • the processor 110 may also include an AI (Artificial Intelligence, Artificial Intelligence) processor, which is used to process computing operations related to machine learning.
  • AI Artificial Intelligence, Artificial Intelligence
  • the memory 120 may include random access memory (RAM) or read-only memory (Read-Only Memory).
  • RAM random access memory
  • Read-Only Memory Read-Only Memory
  • the memory 120 includes a non-transitory computer-readable storage medium.
  • the memory 120 may be used to store instructions, programs, codes, code sets, or instruction sets.
  • the memory 120 may include a storage program area and a storage data area, where the storage program area may store instructions for implementing an operating system and instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.) , Instructions for implementing the following method embodiments, the operating system may be an Android system (including a system based on the deep development of the Android system), an IOS system developed by Apple (including a system based on the deep development of the IOS system) ) Or other systems.
  • the storage data area may also store data created by the terminal 100 in use (such as a phone book, audio and video data, and chat history data).
  • the input/output device 130 may include a touch display screen for receiving a user's touch operation on or near any suitable object using a finger, a touch pen, or the like, and a user interface displaying various application programs.
  • the touch display screen is usually provided on the front panel of the terminal 100.
  • the touch screen can be designed as a full screen, curved screen, or profile screen.
  • the touch display screen can also be designed as a combination of a full screen and a curved screen, and a combination of a special-shaped screen and a curved screen, which is not limited in the embodiments of the present application.
  • the structure of the terminal 100 shown in the above drawings does not constitute a limitation on the terminal 100, and the terminal may include more or fewer components than the illustration, or a combination of certain Components, or different component arrangements.
  • the terminal 100 further includes components such as a radio frequency circuit, an input unit, a sensor, an audio circuit, a wireless fidelity (WiFi) module, a power supply, and a Bluetooth module, which will not be repeated here.
  • WiFi wireless fidelity
  • the memory 120 can be divided into an operating system space and a user space.
  • the operating system runs in the operating system space, and native and third-party application programs run in the user space.
  • the operating system allocates corresponding system resources for different third-party applications.
  • the requirements of different application scenarios for system resources in the same third-party application are also different.
  • the third-party application has higher requirements for disk read speed; in the animation rendering scenario, the first Three-party applications have higher requirements for GPU performance.
  • the operating system and the third-party application are independent of each other. The operating system often fails to perceive the current application scenario of the third-party application in time, so that the operating system cannot perform targeted system resource adaptation according to the specific application scenario of the third-party application.
  • the programs and data stored in the memory 120 are shown in FIG. 3, and the memory 120 may store a Linux kernel layer 220, a system runtime library layer 240, an application framework layer 260, and an application layer 280, of which The Linux kernel layer 220, the system runtime library layer 240, and the application framework layer 260 belong to the operating system space, and the application layer 280 belongs to the user space.
  • the Linux kernel layer 220 provides low-level drivers for various hardware of the terminal 100, such as display drivers, audio drivers, camera drivers, Bluetooth drivers, Wi-Fi drivers, and power management.
  • the system runtime library layer 240 provides major feature support for the Android system through some C/C++ libraries.
  • the SQLite library provides database support
  • the OpenGL/ES library provides 3D drawing support
  • the Webkit library provides browser kernel support.
  • An Android runtime library (Android Runtime) is also provided in the system runtime library layer 240, which mainly provides some core libraries that can allow developers to write Android applications using the Java language.
  • the application framework layer 260 provides various APIs that may be used when building applications, and developers can also use these APIs to build their own applications, such as activity management, window management, view management, notification management, content providers, Package management, call management, resource management, positioning management.
  • At least one application program runs in the application layer 280, and these application programs may be native application programs built in the operating system, such as a contact program, an SMS program, a clock program, a camera application, etc.; or may be developed by a third-party developer Third-party applications, such as game applications, instant messaging programs, photo beautification programs, shopping programs, etc.
  • FIG. 4 A feasible communication method between the operating system and the third-party application program is shown in FIG. 4, and a software development kit (Software Development Kit, SDK) for communicating with the operating system is embedded in the third-party application program.
  • SDK Software Development Kit
  • the SDK contains a number of abstract application programming interfaces (Application Programming Interface), and is provided by the operating system developer to third-party application developers, and the third-party application developers embed the SDK into the Tripartite application. After such third-party applications are installed and run on the operating system, they can call the API provided by the SDK to communicate with the operating system.
  • Application Programming Interface Application Programming Interface
  • the system runtime library layer 240 may additionally include an interface communication system 242.
  • the interface communication system 242 can be regarded as a subsystem in the operating system, or as an application program embedded in the operating system.
  • the interface communication system 242 is provided with an SDK interface, and a third-party application program calls the API of the embedded SDK and the SDK interface to perform data communication through a binder. In this way, data related to the application scenarios of third-party applications can be transferred to the operating system through the SDK.
  • the operating system can also actively transfer data to third-party applications, or two-way data transmission can be performed between the operating system and third-party applications.
  • the third-party application program can also establish a long connection with the Socket interface of the interface communication system 242 by using the Socket method.
  • the application scenarios of the third-party application program are related.
  • the data can be transferred to the operating system through the long connection.
  • different strategy modules can be set in the interface communication system 242.
  • the interface communication system 242 After receiving the data sent by the third-party application, the interface communication system 242 uses the strategy module corresponding to the third-party application to analyze the data To get the corresponding resource adaptation optimization strategy. Based on the resource adaptation optimization strategy obtained by the analysis, the interface communication system 242 notifies the Linux kernel layer 220 through the control interface to perform system resource adaptation optimization. Among them, the control interface can communicate with the Linux kernel layer 220 in the manner of Sysfs.
  • different policy modules in the interface communication system 242 can correspond to different third-party applications (that is, set policy modules for different applications), or different policy modules correspond to different types of third-party applications (that is, for Different types of applications set policy modules), or different policy modules correspond to different system resources (that is, set policy modules for different system resources), or different policy modules correspond to different application scenarios (that is, for different applications) Scenario setting strategy module), the embodiments of the present application do not limit the specific setting mode of the strategy module. .
  • the interface communication system 242 can also communicate with the application framework layer 260 through the way of Binder to receive the foreground application information sent by the application framework layer 260, so that based on the foreground application information, only the third-party applications currently running in the foreground System resource optimization.
  • the IOS system includes: a core operating system layer 320 (Core OS layer), a core service layer 340 (Core Services layer), and a media layer 360 (Media Layer), touchable layer 380 (Cocoa Touch Layer).
  • the core operating system layer 320 includes an operating system kernel, drivers, and low-level program frameworks. These low-level program frameworks provide functions closer to the hardware for use by the program framework at the core service layer 340.
  • the core service layer 340 provides system services and/or program frameworks required by applications, such as a foundation framework, account framework, advertising framework, data storage framework, network connection framework, geographic location framework, sports framework, and so on.
  • the media layer 360 provides audiovisual interfaces for applications, such as graphics and image related interfaces, audio technology related interfaces, video technology related interfaces, and audio and video transmission technology wireless playback (AirPlay) interfaces.
  • the touchable layer 380 provides various commonly used interface-related frameworks for application development. The touchable layer 380 is responsible for user's touch interaction operations on the terminal 100. Such as local notification service, remote push service, advertising framework, game tool framework, message user interface (User Interface, UI) framework, user interface UIKit framework, map framework, etc.
  • frameworks related to most applications include, but are not limited to: the basic framework in the core service layer 340 and the UIKit framework in the touchable layer 380.
  • the basic framework provides many basic object classes and data types to provide the most basic system services for all applications, regardless of the UI.
  • the class provided by the UIKit framework is a basic UI class library for creating touch-based user interfaces. iOS applications can provide UI based on the UIKit framework, so it provides the basic architecture of the application for building user interfaces and drawing. , Handling and user interaction events, responding to gestures, etc.
  • the method and principle of implementing data communication between the third-party application program and the operating system in the IOS system can refer to the Android system, and will not be repeated here.
  • the third-party applications need to be adjusted during the development process, such as those provided by developers of embedded operating systems. SDK; and, in order to prevent the data interface of the operating system from being exposed to illegal applications and cause potential security risks to the system, the operating system only supports data communication with some third-party applications, resulting in a narrower scope of system resource adaptation.
  • the operating system takes screenshots of the running game application and uses machine learning to identify game screenshots through a pre-trained game scene recognition model to determine the current game The game scene corresponding to the screen, and further allocate system resources to the game application according to the resource configuration strategy corresponding to the game scene. Since there is no need for data communication between the operating system and the game application during the entire system resource allocation process, there is no need to embed the SDK during the development of the game application, and the data interface of the operating system does not need to be exposed to third-party applications, thereby improving Operating system security.
  • the following uses an exemplary embodiment for description.
  • FIG. 7 shows a flowchart of a resource configuration method according to an exemplary embodiment of the present application.
  • This embodiment is exemplified by the method applied to the terminal 100 shown in FIG. 1.
  • the method includes:
  • Step 701 when the game application is running, the game screen is displayed.
  • the terminal When the game application is in the foreground running state, the terminal displays a real-time game screen, which constantly changes during the game running process.
  • the game screen is the game startup screen; after the game startup is completed, the game screen is the game main interface; when the game is in progress, the game screen is the game progress screen.
  • Step 702 Take a screenshot of the game screen to obtain a screenshot of the game.
  • the terminal in the embodiment of the present application recognizes the current game scene based on the game screen.
  • the terminal operating system takes screenshots of the game screen at predetermined intervals to obtain corresponding game screenshots.
  • the terminal displays the acceleration control above the game screen, and takes a screenshot when the trigger operation of the acceleration control is received.
  • the operating system takes a screenshot of the game screen, it directly extracts the game layer through the background to obtain a screenshot of the game. There is no need for the user to manually take a screenshot, and the user will not perceive it in the foreground.
  • screenshots of the game captured by the operating system are cached in memory and deleted directly after scene recognition.
  • Step 703 Identify the game screenshot through the game scene recognition model to determine the game scene corresponding to the game screen.
  • the game scene is used to indicate the running stage of the game application.
  • a game scene recognition model for identifying a game scene is pre-stored in the terminal.
  • the game scene recognition model may be a convolutional neural network model, a deep learning model, or other models for image recognition.
  • the game scene recognition model is obtained by training based on a sample game screenshot carrying a game scene identifier.
  • the terminal operating system inputs the game screenshot into the game scene recognition model to obtain several candidate game scenes output by the game scene model and corresponding probabilities, and then determines the candidate game scene with the highest probability as the game scene corresponding to the game screen.
  • the game scene includes at least one of the following: a game startup scene, a game loading scene, a game main interface scene, and a game progress scene.
  • the game scene output by the game scene recognition model is obtained as the "game progress scene”.
  • Step 704 Determine the resource configuration strategy corresponding to the game scene.
  • the terminal operating system further determines the resource configuration strategy corresponding to the game scenario according to the game scenario where the game application is currently located.
  • the resource configuration strategy includes configuration information of various system resources in the game scenario. It includes at least one of CPU resources, GPU resources, disk resources, memory resources, and network resources.
  • the configuration information corresponding to the CPU resources can include the CPU operating frequency and the number of CPU cores turned on;
  • the configuration information corresponding to the GPU resources can include the GPU operating frequency and the number of GPU cores turned on;
  • the configuration information corresponding to the disk resources can include disk rotation speed and disk reading Write speed;
  • configuration information corresponding to memory resources can include memory frequency and memory read and write speed;
  • configuration information corresponding to network resources can include network speed and delay.
  • the terminal stores the correspondence between the game scene and the resource configuration strategy, and the terminal operating system determines the resource configuration strategy corresponding to the current game scene based on the correspondence.
  • the corresponding relationship is shown in Table 1.
  • Game loading scene Resource Allocation Strategy A Game main interface scene Resource Allocation Strategy B Game progress scene Resource Allocation Strategy C
  • the terminal operating system determines that the resource configuration strategy is "resource configuration strategy C" based on Table 1.
  • Step 705 Assign system resources to the game application according to the resource configuration strategy.
  • the terminal operating system allocates system resources to the game application program.
  • the operating system when the target system resource configuration indicated by the resource configuration strategy is lower than the current system resource configuration, the operating system down-regulates the current system resource configuration to the target system resource configuration indicated by the resource configuration strategy, thereby ensuring the game At the same time as the running quality of the application, it reduces the power consumption of the terminal; when the target system resource configuration indicated by the resource configuration strategy is higher than the current system resource configuration, the operating system increases the current system resource configuration to the target system resource configuration indicated by the resource configuration strategy, Thereby improving the running quality of the game application.
  • the game scene corresponding to the game screen is determined, thereby According to the resource configuration strategy corresponding to the game scenario, allocate system resources to the game application, thereby optimizing the performance and power consumption of the game application in different game scenarios; in the resource configuration method provided by the embodiments of the present application, the game application does not need to be accessed
  • the terminal operating system the terminal operating system can also intelligently analyze the current game scene, thereby eliminating the process of establishing a data channel between the game application program and the operating system, and helping to improve the security of the operating system.
  • the game screenshot is identified by the game scene recognition model to determine the game scene corresponding to the game screen, including:
  • the game types include at least one of the following: first-person shooter game FPS, third-person shooter game TPS, multiplayer online tactical competitive game MOBA, card game, racing game, music game, simulation management game, adventure game AVG, fighting Game FTG, role-playing game RPG and sandbox game.
  • the method before determining the resource configuration strategy corresponding to the game scenario, the method further includes:
  • the application size is used to indicate the storage space occupied by the game application
  • determine the resource allocation strategy corresponding to the game scenario including:
  • the resource configuration model is a neural network model based on deep learning.
  • the resource configuration model is trained based on sample input parameters and sample output parameters.
  • the sample training parameters include sample power, sample application size, sample type and sample game scene
  • the output parameters include sample resource allocation strategies.
  • the method further includes:
  • the preset game list contains the identification of the target game application.
  • the target game application sends scene information to the operating system through the data channel with the operating system during operation.
  • the operating system uses Determine the resource allocation strategy according to the game scene indicated by the scene information;
  • the application identifier does not belong to the preset game list, then perform a step of taking a screenshot of the game screen to obtain a screenshot of the game.
  • the method further includes:
  • the game scene recognition model is trained through the back propagation algorithm.
  • a screenshot of the game screen to obtain a screenshot of the game, including:
  • a screenshot is taken of the game screen to obtain a screenshot of the game.
  • the method further includes:
  • the resource configuration strategy corresponding to the current game scene is re-determined.
  • the resource types of the system resources include at least one of central processing unit CPU resources, graphics processor GPU resources, disk resources, memory resources, and network resources.
  • a sample game screenshot marked with a game type and a game scene identifier is used to train a game scene recognition model; accordingly, a game scene recognition model is used to identify a game scene
  • the operating system takes the game type and game screenshot of the current game application as model input, and inputs it into the game scene recognition model.
  • FIG. 8 shows a flowchart of a resource configuration method shown in another exemplary embodiment of the present application. This embodiment is exemplified by the method applied to the terminal 100 shown in FIG. 1.
  • the method includes:
  • Step 801 when the game application is running, the game screen is displayed.
  • Step 802 Obtain the application identification of the game application.
  • the scene information (including game scenes) can be reported to the operating system through the data channel .
  • the operating system can configure system resources for the target game application based on the obtained scene information. Therefore, for the target game application, the operating system does not need to perform screenshot and game screenshot identification.
  • the operating system obtains the application identification of the currently running game application.
  • the application identifier may be the application package name of the game application program.
  • Step 803 it is detected whether the application identifier belongs to the preset game list, and the preset game list contains the identifier of the target game application program, and the target game application program sends scene information to the operating system through a data channel with the operating system during operation,
  • the operating system is used to determine the resource allocation strategy according to the game scene indicated by the scene information.
  • a preset game list is stored in the terminal, and the preset game list includes the identification of the target game application.
  • the preset game list is the terminal regularly updates and downloads from the background server.
  • the terminal operating system detects whether the application ID of the current game application belongs to the preset game list. If it belongs, it determines that the current game application is the target application, and subsequent screenshot scene recognition is not required; if it does not, it determines that the current game application cannot Send the scene information directly to the operating system, and perform step 804.
  • the operating system when the application identifier does not belong to the preset game list, the operating system further detects whether the application identifier belongs to the game whitelist, and if it belongs to the game whitelist, step 804 is executed.
  • the game whitelist contains game applications optimized for game performance.
  • Step 804 if the application identifier does not belong to the preset game list, then take a screenshot of the game screen to obtain a screenshot of the game.
  • step of taking screenshots by the terminal operating system reference may be made to the above step 702, and this embodiment will not repeat them here.
  • Step 805 Obtain the game type corresponding to the game application.
  • the operating system obtains the game type corresponding to the game application.
  • the game type may include at least one of the following: First-Person Shooter (First-Person Shooter game, FPS), third-person shooter game ( Third-Person Shooter game (TPS), multiplayer online tactical competitive game (Multiplayer Online Battle Arena, MOBA), card game, racing game, music game, simulation management game, adventure game (Adventure Game, AVG), fighting game (Fighting Game, FTG), Role-Playing Game (RPG) and sandbox games.
  • the operating system obtains the application name or application package name of the game application program, so as to query the game type of the game application program according to the application name or application package name.
  • the embodiment of the present application does not limit the specific way of acquiring the game type.
  • Step 806 Enter the game type and game screenshot into the game scene recognition model to obtain the game scene output from the game scene recognition model.
  • the operating system inputs the game type and game screenshot together into the game scene recognition model, thereby obtaining several candidate game scenes and their probabilities output by the game scene recognition model, and the candidate game corresponding to the highest probability
  • the scene is determined to be the game scene corresponding to the current game screen.
  • Step 807 according to the game type and the game scene, determine the resource configuration strategy corresponding to the game scene.
  • the system determines the resource allocation strategy corresponding to the current game scene based on the game type and game scene.
  • the terminal stores a correspondence between the three types of games, game scenes, and resource configuration strategies, and the terminal operating system determines the resource configuration strategy corresponding to the current game scene based on the correspondence.
  • the corresponding relationship is shown in Table 2.
  • Game scene Resource allocation strategy card game Game loading scene Resource allocation strategy A1 MOBA games Game loading scene Resource allocation strategy A2 card game Game progress scene Resource allocation strategy C1 MOBA games Game progress scene Resource allocation strategy C2
  • the terminal operating system determines that the resource configuration strategy is "resource configuration strategy C2" based on Table 2.
  • the terminal operating system obtains the current remaining The amount of power and the application size of the game application.
  • the application size is used to indicate the storage space occupied by the game application.
  • the resource configuration model is a neural network model based on deep learning
  • the sample input parameters used in training the resource configuration model include sample power, sample application size, sample type, and sample game scene
  • sample output parameters include samples Resource allocation strategy.
  • the embodiments of the present application do not limit the training process of the resource allocation model.
  • the terminal operating system obtains the current remaining power is "50%”, the application size is "1.5GB”, the game type is "MOBA game” and the game scene is “game progress scene”, and the above parameters are entered into the resource configuration After the model, the resource allocation strategy output by the resource allocation model is obtained.
  • the terminal may also use other parameters related to the resource configuration strategy as model inputs for model training, so as to improve the accuracy of the resource configuration strategy output by the resource configuration model.
  • Step 808 Assign system resources to the game application according to the resource configuration strategy.
  • step 705 For the implementation of this step, reference may be made to step 705 described above, and this embodiment will not be repeated here.
  • the resource configuration strategy corresponding to the game scenario is determined according to the current game application type and the current game scenario, which improves the accuracy of the determined resource configuration strategy.
  • the operating system performs reverse training on the game scene recognition model according to the game screen when the target application reports the scene information.
  • the following steps may also be included.
  • Step 809 When receiving the scene information sent by the target game application, take a screenshot of the current game screen of the target game application to obtain a sample game screenshot.
  • the terminal operating system when detecting whether the application identifier belongs to the preset game list, receives scene information containing game scenes sent by the target game application during operation of the target game application, and based on the scene The information configures the resource of the target game application; at the same time, the operating system takes a screenshot of the current game screen to obtain a sample game screenshot corresponding to the current game scene of the target game application.
  • Step 810 Train the game scene recognition model through a back propagation algorithm according to the game scene indicated by the scene information and the sample game screenshots.
  • the terminal operating system performs back propagation training on the original game scene recognition model according to the game scene indicated by the scene information and sample game screenshots, so as to improve the recognition accuracy of the game scene recognition model.
  • the terminal operating system may perform back propagation training on the game scene recognition model according to the game scene indicated by the scene information, the game type of the target game application, and the sample game screenshot.
  • the terminal operating system inputs the sample game screenshots into the original game scene recognition model to obtain several candidate game scenes and their probabilities output by the model, and based on the game scene and various candidates indicated by the scene information Probability corresponding to the game scene, back propagation training.
  • the terminal operating system when receiving the scene information reported by the target game application, takes a screenshot of the game screen, so that the game scene recognition model is back-propagated according to the game scene indicated by the game screenshot and the scene information, to This improves the recognition accuracy of the game scene recognition model.
  • step 804 may include the following steps:
  • Step 804A Display the acceleration control.
  • the terminal operating system displays the acceleration control and receives the trigger operation on the acceleration control.
  • the acceleration control may be a floating icon located on the upper layer of the game screen, or a shortcut function icon displayed in the shortcut bar (such as an acceleration icon displayed in the opposite area of the display screen), and the trigger operation may be a click operation, a press operation, or a long Press at least one of the operations. This embodiment of the present application does not limit this.
  • an acceleration control 1102 is displayed on the upper layer of the game screen 1101.
  • Step 804B When receiving the trigger signal for the acceleration control, take a screenshot of the game screen to obtain a screenshot of the game.
  • the terminal When receiving the trigger signal for the acceleration control, the terminal determines that it is necessary to optimize the performance of the game application, so as to perform operations such as subsequent screenshots and game scene recognition. For a specific implementation manner, reference may be made to the embodiment in FIG. 8, and this embodiment will not be repeated here.
  • step 808 It also includes the following steps.
  • Step 811 Identify the current game scene corresponding to the current game picture every predetermined time interval.
  • the terminal operating system re-identifies the current game scene corresponding to the current game screen through a screenshot and model recognition operation at predetermined intervals, and detects whether the current game scene and the last recognized game scene If they are consistent, the current resource configuration mode is maintained; if they are not consistent, the resource configuration strategy corresponding to the current game scene is re-determined through the following step 812.
  • the predetermined time interval may be determined according to the predicted duration corresponding to the last recognized game scene. For example, for a MOBA game, when the last game scene identified is a "game progress scene", the terminal operating system determines that the predetermined time interval is 30 minutes.
  • Step 812 if the current game scene changes, then re-determine the resource configuration strategy corresponding to the current game scene.
  • the terminal operating system re-determines the resource configuration strategy and performs system resource configuration according to the re-determined resource configuration strategy.
  • the terminal operating system automatically recognizes the current game screen every predetermined time interval.
  • the resource allocation strategy corresponding to the current game scene is re-determined, which can automatically optimize the performance of the game application and reduce The number of user operations to optimize the user experience.
  • FIG. 12 shows a structural block diagram of a resource configuration apparatus provided by an embodiment of the present application.
  • the resource configuration device can be implemented as all or part of the terminal through software, hardware, or a combination of both.
  • the device includes:
  • the display module 1201 is used to display a game screen when running a game application
  • the screenshot module 1202 is used to take a screenshot of the game screen to obtain a screenshot of the game;
  • the scene recognition module 1203 is used to recognize the game screenshot through the game scene recognition model and determine the game scene corresponding to the game screen, where the game scene is used to indicate the running stage of the game application;
  • the strategy determination module 1204 is configured to determine a resource configuration strategy corresponding to the game scene
  • the resource allocation module 1205 is configured to allocate system resources to the game application according to the resource configuration strategy.
  • the scene recognition module 1203 includes:
  • a type obtaining unit configured to obtain a game type corresponding to the game application
  • a scene prediction unit configured to input the game type and the game screenshot into the game scene recognition model to obtain the game scene output by the game scene recognition model;
  • the strategy determination module 1204 is used to:
  • the game types include at least one of the following: FPS, TPS, MOBA, card games, racing games, music games, simulation business games, AVG, FTG, RPG, and sandbox games.
  • the device further includes:
  • a first obtaining module configured to obtain the current remaining power and the application size of the game application, and the application size is used to indicate the storage space occupied by the game application;
  • the strategy determination module 1204 is also used to:
  • the resource configuration model is a neural network model based on deep learning.
  • the resource configuration model is trained based on sample input parameters and sample output parameters.
  • the sample training parameters include sample power, sample application size, and sample type.
  • the sample output parameters include a sample resource configuration strategy.
  • the device further includes:
  • a second obtaining module configured to obtain the application identification of the game application program
  • the detection module is configured to detect whether the application identifier belongs to a preset game list, and the preset game list includes an identifier of a target game application, and the target game application passes data between the operating system during operation
  • the channel sends scene information to the operating system, and the operating system is used to determine the resource configuration strategy according to the game scene indicated by the scene information;
  • the screenshot module 1202 is configured to execute the step of taking a screenshot of the game screen to obtain a screenshot of the game if the application identifier does not belong to the preset game list.
  • the device further includes:
  • a sample screenshot module configured to take a screenshot of the current game screen of the target game application when receiving the scene information sent by the target game application, to obtain a sample game screenshot
  • the training module is configured to train the game scene recognition model through a back propagation algorithm according to the game scene indicated by the scene information and the sample game screenshot.
  • the screenshot module 1202 includes:
  • a control display unit for displaying an acceleration control on the upper layer of the game screen
  • the screenshot unit is configured to take a screenshot of the game screen when the trigger signal for the acceleration control is received to obtain the screenshot of the game.
  • the device further includes:
  • the timing recognition module is used to identify the current game scene corresponding to the current game screen at predetermined time intervals
  • the strategy resetting module is used to re-determine the resource configuration strategy corresponding to the current game scene if the current game scene changes.
  • the resource types of the system resources include at least one of CPU resources, GPU resources, disk resources, memory resources, and network resources.
  • the game scene corresponding to the game screen is determined, thereby According to the resource configuration strategy corresponding to the game scenario, allocate system resources to the game application, thereby optimizing the performance and power consumption of the game application in different game scenarios; in the resource configuration method provided by the embodiments of the present application, the game application does not need to be accessed
  • the terminal operating system the terminal operating system can also intelligently analyze the current game scene, thereby eliminating the process of establishing a data channel between the game application program and the operating system, and helping to improve the security of the operating system.
  • the resource configuration strategy corresponding to the game scenario is determined according to the current game application type and the current game scenario, which improves the accuracy of the determined resource configuration strategy.
  • the terminal operating system when receiving the scene information reported by the target game application, takes a screenshot of the game screen, so that the game scene recognition model is back-propagated according to the game scene indicated by the game screenshot and the scene information, to This improves the recognition accuracy of the game scene recognition model.
  • An embodiment of the present application further provides a computer-readable medium that stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the resource configuration method described in the foregoing embodiments .
  • An embodiment of the present application further provides a computer program product that stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the resource configuration method described in the foregoing embodiments.
  • Computer-readable media includes computer storage media and communication media, where communication media includes any medium that facilitates transfer of a computer program from one place to another.
  • the storage medium may be any available medium that can be accessed by a general-purpose or special-purpose computer.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Artificial Intelligence (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • User Interface Of Digital Computer (AREA)
  • Stored Programmes (AREA)

Abstract

Embodiments of the present application disclose a resource allocation method and apparatus, a terminal, and a storage medium, pertaining to the field of application optimization. The method comprises: when a game application is run, displaying a game screen; taking a screenshot of the game screen to acquire a game screenshot; using a game scene identification model to identify the game screenshot, and determining a game scene corresponding to the game screen, wherein the game scene is used to indicate a running stage of the game application; determining a resource allocation policy corresponding to the game scene; and allocating system resources to the game application according to the resource allocation policy. In the resource allocation method provided by the embodiments of the present application, a terminal operating system can learn to identify a current game scene by means of intelligent analysis without the game application needing to access the terminal operating system, thereby eliminating the need to establish a data channel between the game application and the operating system, and improving the security of the operating system.

Description

资源配置方法、装置、终端及存储介质Resource configuration method, device, terminal and storage medium
本申请要求于2018年11月30日提交的申请号为201811457185.3、发明名称为“资源配置方法、装置、终端及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application requires the priority of the Chinese patent application with the application number 201811457185.3 and the invention titled "Resource Allocation Method, Device, Terminal, and Storage Medium" filed on November 30, 2018, the entire content of which is incorporated by reference in this application .
技术领域Technical field
本申请实施例涉及应用优化技术领域,特别涉及一种资源配置方法、装置、终端及存储介质。The embodiments of the present application relate to the technical field of application optimization, and in particular, to a resource configuration method, device, terminal, and storage medium.
背景技术Background technique
随着移动终端技术的不断发展,移动终端中应用程序的种类也越来越多。比如,移动终端中同时安装有游戏类应用程序、社交类应用程序、视频播放类应用程序、即时通信类应用程序和购物类应用程序。With the continuous development of mobile terminal technology, there are more and more types of application programs in mobile terminals. For example, a mobile application, a social application, a video playback application, an instant communication application, and a shopping application are installed in the mobile terminal.
为了提高应用程序的使用体验,移动终端厂商都在不断提升自身的硬件配置,以提高应用程序的运行速度及质量。比如,移动终端通过配置高性能的中央处理器(Central Processing Unit,CPU)和图形处理器(Graphics Processing Unit,GPU),来提高游戏类应用程序的运行速度和画面质量。In order to improve the application experience, mobile terminal manufacturers are constantly improving their hardware configuration to improve the running speed and quality of applications. For example, mobile terminals are configured with high-performance Central Processing Unit (CPU) and Graphics Processing Unit (GPU) to improve the running speed and picture quality of game applications.
发明内容Summary of the invention
本申请实施例提供了一种资源配置方法、装置、终端及存储介质。所述技术方案如下:Embodiments of the present application provide a resource configuration method, device, terminal, and storage medium. The technical solution is as follows:
一方面,提供了一种资源配置方法,所述方法包括:In one aspect, a resource configuration method is provided, the method including:
当运行游戏应用程序时,显示游戏画面;When running the game application, display the game screen;
对所述游戏画面进行截图,得到游戏截图;Take a screenshot of the game screen to obtain a screenshot of the game;
通过游戏场景识别模型对所述游戏截图进行识别,确定所述游戏画面对应的游戏场景,所述游戏场景用于指示所述游戏应用程序所处的运行阶段;Identifying the game screenshot through the game scene recognition model to determine the game scene corresponding to the game screen, where the game scene is used to indicate the running stage of the game application;
确定所述游戏场景对应的资源配置策略;Determine a resource allocation strategy corresponding to the game scene;
根据所述资源配置策略为所述游戏应用程序分配系统资源。Allocate system resources to the game application according to the resource configuration strategy.
另一方面,提供了一种资源配置装置,所述装置包括:In another aspect, a resource configuration device is provided, the device including:
显示模块,用于当运行游戏应用程序时,显示游戏画面;The display module is used to display the game screen when running the game application;
截图模块,用于对所述游戏画面进行截图,得到游戏截图;A screenshot module, used to take a screenshot of the game screen to obtain a screenshot of the game;
场景识别模块,用于通过游戏场景识别模型对所述游戏截图进行识别,确定所述游戏画面对应的游戏场景,所述游戏场景用于指示所述游戏应用程序所处的运行阶段;A scene recognition module, used to identify the game screenshot through the game scene recognition model, and determine the game scene corresponding to the game screen, where the game scene is used to indicate the running stage of the game application;
策略确定模块,用于确定所述游戏场景对应的资源配置策略;A strategy determination module for determining a resource configuration strategy corresponding to the game scene;
资源分配模块,用于根据所述资源配置策略为所述游戏应用程序分配系统资源。The resource allocation module is configured to allocate system resources to the game application according to the resource configuration strategy.
另一方面,提供了一种终端,所述终端包括处理器和存储器;所述存储器存储有至少一条指令,所述至少一条指令用于被所述处理器执行以实现如上述方面所述的资源配置方法。On the other hand, a terminal is provided. The terminal includes a processor and a memory; the memory stores at least one instruction, and the at least one instruction is used to be executed by the processor to implement the resource as described above Configuration method.
另一方面,提供了一种计算机可读存储介质,所述存储介质存储有至少一条指令,所述至少一条指令用于被处理器执行以实现如上述方面所述的资源配置方法。On the other hand, a computer-readable storage medium is provided, where the storage medium stores at least one instruction, and the at least one instruction is used to be executed by a processor to implement the resource configuration method as described above.
附图说明BRIEF DESCRIPTION
图1是本申请一个示例性实施例提供的终端的结构示意图;FIG. 1 is a schematic structural diagram of a terminal provided by an exemplary embodiment of the present application;
图2是终端中应用程序与操作系统通信过程的实施示意图;2 is a schematic diagram of the implementation of the communication process between the application program and the operating system in the terminal;
图3是本申请一个示例性实施例提供的终端的结构示意图;3 is a schematic structural diagram of a terminal provided by an exemplary embodiment of the present application;
图4和图5是图3所示终端中应用程序与操作系统通信过程的实施示意图;4 and 5 are schematic diagrams of the communication process between the application program and the operating system in the terminal shown in FIG. 3;
图6是本申请另一个示例性实施例提供的终端的结构示意图;6 is a schematic structural diagram of a terminal provided by another exemplary embodiment of the present application;
图7示出了本申请一个示例性实施例示出的资源配置方法的流程图;7 shows a flowchart of a resource configuration method shown in an exemplary embodiment of the present application;
图8示出了本申请另一个示例性实施例示出的资源配置方法的流程图;FIG. 8 shows a flowchart of a resource configuration method shown in another exemplary embodiment of the present application;
图9示出了本申请另一个示例性实施例示出的资源配置方法的流程图;9 shows a flowchart of a resource configuration method shown in another exemplary embodiment of the present application;
图10示出了本申请另一个示例性实施例示出的资源配置方法的流程图;10 shows a flowchart of a resource configuration method shown in another exemplary embodiment of the present application;
图11是在游戏画面上层显示加速控件的界面示意图;11 is a schematic diagram of an interface for displaying acceleration controls on the upper layer of the game screen;
图12示出了本申请一个实施例提供的资源配置装置的结构框图。FIG. 12 shows a structural block diagram of a resource configuration device provided by an embodiment of the present application.
具体实施方式detailed description
为使本发明的目的、技术方案和优点更加清楚,下面将结合附图对本发明实施方式作进一步地详细描述。To make the objectives, technical solutions, and advantages of the present invention clearer, the following describes the embodiments of the present invention in further detail with reference to the accompanying drawings.
在本文中提及的“多个”是指两个或两个以上。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。字符“/”一般表示前后关联对象是一种“或”的关系。The "plurality" referred to herein refers to two or more. "And/or" describes the relationship of the related objects, indicating that there can be three relationships, for example, A and/or B, which can indicate: there are three conditions: A exists alone, A and B exist simultaneously, and B exists alone. The character "/" generally indicates that the related object is a "or" relationship.
请参考图1,其示出了本申请一个示例性实施例提供的终端100的结构方框图。该终端100可以是智能手机、平板电脑、便携式个人计算机等能够运行有游戏应用程序的电子设备。本申请中的终端100可以包括一个或多个如下部件:处理器110、存储器120和输入输出装置130。Please refer to FIG. 1, which shows a structural block diagram of a terminal 100 provided by an exemplary embodiment of the present application. The terminal 100 may be an electronic device capable of running a game application program, such as a smart phone, a tablet computer, a portable personal computer, or the like. The terminal 100 in this application may include one or more of the following components: a processor 110, a memory 120, and an input/output device 130.
处理器110可以包括一个或者多个处理核心。处理器110利用各种接口和线路连接整个终端100内的各个部分,通过运行或执行存储在存储器120内的指令、程序、代码集或指令集,以及调用存储在存储器120内的数据,执行终端100的各种功能和处理数据。可选地,处理器110可以采用数字信号处理(Digital Signal Processing,DSP)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)、可编程逻辑阵列(Programmable Logic Array,PLA)中的至少一种硬件形式来实现。处理器110可集成中央处理器(Central Processing Unit,CPU)、图像处理器(Graphics Processing Unit,GPU)和调制解调器等中的一种或几种的组合。其中,CPU主要处理操作系统、用户界面和应用程序等;GPU用于负责显示内容的渲染和绘制;调制解调器用于处理无线通信。可以理解的是,上述调制解调器也可以不集成到处理器110中,单独通过一块通信芯片进行实现。The processor 110 may include one or more processing cores. The processor 110 uses various interfaces and lines to connect various parts of the entire terminal 100, and executes the terminal by running or executing instructions, programs, code sets or instruction sets stored in the memory 120, and calling data stored in the memory 120 100 various functions and processing data. Alternatively, the processor 110 may use at least one of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). Various hardware forms. The processor 110 may integrate one or a combination of a central processing unit (Central Processing Unit, CPU), an image processing unit (Graphics Processing Unit, GPU), and a modem. Among them, CPU mainly deals with operating system, user interface and application program, etc.; GPU is used for rendering and rendering of display content; modem is used for handling wireless communication. It can be understood that the above-mentioned modem may not be integrated into the processor 110, and may be implemented by a communication chip alone.
可选的,处理器110还可以包括AI(Artificial Intelligence,人工智能)处理器,该AI处理器用于处理有关机器学习的计算操作。Optionally, the processor 110 may also include an AI (Artificial Intelligence, Artificial Intelligence) processor, which is used to process computing operations related to machine learning.
存储器120可以包括随机存储器(Random Access Memory,RAM),也可以包括只读存储器(Read-Only Memory)。可选地,该存储器120包括非瞬时性计算机可读介质(non-transitory computer-readable storage medium)。存储器120可用于存储指令、程序、代码、代码集或指令集。存储器120可包括存储程序区和存储数据区,其中,存储程序区可存储用于实现操作系统的指令、用于实现至少一个功能的指令(比如触控功能、声音播放功能、图像播放功能等)、用于实现下述各个方法实施例的指令等,该操作系统可以是安卓(Android)系统(包括基于Android系统深度开发的系统)、苹果公司开发的IOS系统(包括基于IOS系统深度开发的系统)或其它系统。存储数据区还可以存储终端100在使用中所创建的数据(比如电话本、音视频数据、聊天记录数据)等。The memory 120 may include random access memory (RAM) or read-only memory (Read-Only Memory). Optionally, the memory 120 includes a non-transitory computer-readable storage medium. The memory 120 may be used to store instructions, programs, codes, code sets, or instruction sets. The memory 120 may include a storage program area and a storage data area, where the storage program area may store instructions for implementing an operating system and instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.) , Instructions for implementing the following method embodiments, the operating system may be an Android system (including a system based on the deep development of the Android system), an IOS system developed by Apple (including a system based on the deep development of the IOS system) ) Or other systems. The storage data area may also store data created by the terminal 100 in use (such as a phone book, audio and video data, and chat history data).
输入输出装置130可以包括触摸显示屏,该触摸显示屏用于接收用户使用手指、触摸笔等任何适合的物体在其上或附近的触摸操作,以及显示各个应用程序的用户界面。触摸显示屏通常设置在终端100的前面板。触摸显示屏可被设计成为全面屏、曲面屏或异型屏。触摸 显示屏还可被设计成为全面屏与曲面屏的结合,异型屏与曲面屏的结合,本申请实施例对此不加以限定。The input/output device 130 may include a touch display screen for receiving a user's touch operation on or near any suitable object using a finger, a touch pen, or the like, and a user interface displaying various application programs. The touch display screen is usually provided on the front panel of the terminal 100. The touch screen can be designed as a full screen, curved screen, or profile screen. The touch display screen can also be designed as a combination of a full screen and a curved screen, and a combination of a special-shaped screen and a curved screen, which is not limited in the embodiments of the present application.
除此之外,本领域技术人员可以理解,上述附图所示出的终端100的结构并不构成对终端100的限定,终端可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。比如,终端100中还包括射频电路、输入单元、传感器、音频电路、无线保真(Wireless Fidelity,WiFi)模块、电源、蓝牙模块等部件,在此不再赘述。In addition, those skilled in the art may understand that the structure of the terminal 100 shown in the above drawings does not constitute a limitation on the terminal 100, and the terminal may include more or fewer components than the illustration, or a combination of certain Components, or different component arrangements. For example, the terminal 100 further includes components such as a radio frequency circuit, an input unit, a sensor, an audio circuit, a wireless fidelity (WiFi) module, a power supply, and a Bluetooth module, which will not be repeated here.
存储器120可分为操作系统空间和用户空间,操作系统即运行于操作系统空间,原生及第三方应用程序即运行于用户空间。为了保证不同第三方应用程序均能够达到较好的运行效果,操作系统针对不同第三方应用程序为其分配相应的系统资源。然而,同一第三方应用程序中不同应用场景对系统资源的需求也存在差异,比如,在本地资源加载场景下,第三方应用程序对磁盘读取速度的要求较高;在动画渲染场景下,第三方应用程序则对GPU性能的要求较高。而操作系统与第三方应用程序之间相互独立,操作系统往往不能及时感知第三方应用程序当前的应用场景,导致操作系统无法根据第三方应用程序的具体应用场景进行针对性的系统资源适配。The memory 120 can be divided into an operating system space and a user space. The operating system runs in the operating system space, and native and third-party application programs run in the user space. In order to ensure that different third-party applications can achieve better operating results, the operating system allocates corresponding system resources for different third-party applications. However, the requirements of different application scenarios for system resources in the same third-party application are also different. For example, in the local resource loading scenario, the third-party application has higher requirements for disk read speed; in the animation rendering scenario, the first Three-party applications have higher requirements for GPU performance. However, the operating system and the third-party application are independent of each other. The operating system often fails to perceive the current application scenario of the third-party application in time, so that the operating system cannot perform targeted system resource adaptation according to the specific application scenario of the third-party application.
在一种可能的实施方式中,如图2所示,为了使操作系统能够区分第三方应用程序的具体应用场景,需要打通第三方应用程序与操作系统之间的数据通信,使得操作系统能够随时获取第三方应用程序当前的场景信息,进而基于当前场景进行针对性的系统资源适配。In a possible implementation manner, as shown in FIG. 2, in order for the operating system to distinguish the specific application scenario of the third-party application, it is necessary to get through the data communication between the third-party application and the operating system, so that the operating system can always Obtain the current scene information of the third-party application, and then perform targeted system resource adaptation based on the current scene.
以操作系统为Android系统为例,存储器120中存储的程序和数据如图3所示,存储器120中可存储有Linux内核层220、系统运行库层240、应用框架层260和应用层280,其中,Linux内核层220、系统运行库层240和应用框架层260属于操作系统空间,应用层280属于用户空间。Linux内核层220为终端100的各种硬件提供了底层的驱动,如显示驱动、音频驱动、摄像头驱动、蓝牙驱动、Wi-Fi驱动、电源管理等。系统运行库层240通过一些C/C++库来为Android系统提供了主要的特性支持。如SQLite库提供了数据库的支持,OpenGL/ES库提供了3D绘图的支持,Webkit库提供了浏览器内核的支持等。在系统运行库层240中还提供有安卓运行时库(Android Runtime),它主要提供了一些核心库,能够允许开发者使用Java语言来编写Android应用。应用框架层260提供了构建应用程序时可能用到的各种API,开发者也可以通过使用这些API来构建自己的应用程序,比如活动管理、窗口管理、视图管理、通知管理、内容提供者、包管理、通话管理、资源管理、定位管理。应用层280中运行有至少一个应用程序,这些应用程序可以是操作系统自带的原生应用程序,比如联系人程序、短信程序、时钟程序、相机应用等;也可以是第三方开发者所开发的第三方应用程序,比如游戏类应用程序、即时通信程序、相片美化程序、购物程序等。Taking the Android operating system as an example, the programs and data stored in the memory 120 are shown in FIG. 3, and the memory 120 may store a Linux kernel layer 220, a system runtime library layer 240, an application framework layer 260, and an application layer 280, of which The Linux kernel layer 220, the system runtime library layer 240, and the application framework layer 260 belong to the operating system space, and the application layer 280 belongs to the user space. The Linux kernel layer 220 provides low-level drivers for various hardware of the terminal 100, such as display drivers, audio drivers, camera drivers, Bluetooth drivers, Wi-Fi drivers, and power management. The system runtime library layer 240 provides major feature support for the Android system through some C/C++ libraries. For example, the SQLite library provides database support, the OpenGL/ES library provides 3D drawing support, and the Webkit library provides browser kernel support. An Android runtime library (Android Runtime) is also provided in the system runtime library layer 240, which mainly provides some core libraries that can allow developers to write Android applications using the Java language. The application framework layer 260 provides various APIs that may be used when building applications, and developers can also use these APIs to build their own applications, such as activity management, window management, view management, notification management, content providers, Package management, call management, resource management, positioning management. At least one application program runs in the application layer 280, and these application programs may be native application programs built in the operating system, such as a contact program, an SMS program, a clock program, a camera application, etc.; or may be developed by a third-party developer Third-party applications, such as game applications, instant messaging programs, photo beautification programs, shopping programs, etc.
操作系统与第三方应用程序之间一种可行的通信方式如图4所示,第三方应用程序中内嵌有用于与操作系统进行通信的软件开发工具包(Software Development Kit,SDK)。A feasible communication method between the operating system and the third-party application program is shown in FIG. 4, and a software development kit (Software Development Kit, SDK) for communicating with the operating system is embedded in the third-party application program.
其中,SDK包含若干经过抽象的应用程序编程接口(Application Programming Interface,API),并由操作系统开发者提供给第三方应用程序开发者,并由第三方应用程序开发者将该SDK内嵌到第三方应用程序中。此类第三方应用程序安装并运行在操作系统后,即可调用SDK提供的API与操作系统进行通信。Among them, the SDK contains a number of abstract application programming interfaces (Application Programming Interface), and is provided by the operating system developer to third-party application developers, and the third-party application developers embed the SDK into the Tripartite application. After such third-party applications are installed and run on the operating system, they can call the API provided by the SDK to communicate with the operating system.
如图4所示,系统运行库层240可以额外包括接口通信系统242。该接口通信系统242可以视为操作系统中的一个子系统,或视为操作系统内嵌的一个应用程序。接口通信系统242中设置有SDK接口,第三方应用程序即调用内嵌SDK的API与该SDK接口之间通过粘合(Binder)的方式进行数据通信。这样,第三方应用程序的应用场景相关的数据就可以通过SDK传输给操作系统。借助内嵌SDK,操作系统还可以主动向第三方应用程序传输数据,或者,操作系统与第三方应用程序之间可以进行双向数据传输。As shown in FIG. 4, the system runtime library layer 240 may additionally include an interface communication system 242. The interface communication system 242 can be regarded as a subsystem in the operating system, or as an application program embedded in the operating system. The interface communication system 242 is provided with an SDK interface, and a third-party application program calls the API of the embedded SDK and the SDK interface to perform data communication through a binder. In this way, data related to the application scenarios of third-party applications can be transferred to the operating system through the SDK. With the help of the embedded SDK, the operating system can also actively transfer data to third-party applications, or two-way data transmission can be performed between the operating system and third-party applications.
在另一种可行的通信方式中,如图5所示,第三方应用程序还可以采用套接字(Socket)方式与接口通信系统242的Socket接口建立长连接,第三方应用程序的应用场景相关的数据即可以通过该长连接传输给操作系统。In another feasible communication method, as shown in FIG. 5, the third-party application program can also establish a long connection with the Socket interface of the interface communication system 242 by using the Socket method. The application scenarios of the third-party application program are related. The data can be transferred to the operating system through the long connection.
如图4和5所示,接口通信系统242中可设置有不同的策略模块,接收到第三方应用程序发送的数据后,接口通信系统242即采用第三方应用程序对应的策略模块对数据进行分析,得到相应的资源适配优化策略。基于分析得到的资源适配优化策略,接口通信系统242通过控制接口通知Linux内核层220进行系统资源适配优化。其中,该控制接口可以采用Sysfs的方式与Linux内核层220进行通信。As shown in FIGS. 4 and 5, different strategy modules can be set in the interface communication system 242. After receiving the data sent by the third-party application, the interface communication system 242 uses the strategy module corresponding to the third-party application to analyze the data To get the corresponding resource adaptation optimization strategy. Based on the resource adaptation optimization strategy obtained by the analysis, the interface communication system 242 notifies the Linux kernel layer 220 through the control interface to perform system resource adaptation optimization. Among them, the control interface can communicate with the Linux kernel layer 220 in the manner of Sysfs.
可选的,接口通信系统242中不同的策略模块可以对应不同的第三方应用程序(即针对不同的应用程序设置策略模块),或者,不同的策略模块对应不同类型的第三方应用程序(即针对不同类型的应用程序设置策略模块),或者,不同的策略模块对应不同的系统资源(即针对不同系统资源设置策略模块),或者,不同的策略模块对应不同的应用场景(即针对不同的以应用场景设置策略模块),本申请实施例并不对策略模块的具体设置方式进行限定。。Optionally, different policy modules in the interface communication system 242 can correspond to different third-party applications (that is, set policy modules for different applications), or different policy modules correspond to different types of third-party applications (that is, for Different types of applications set policy modules), or different policy modules correspond to different system resources (that is, set policy modules for different system resources), or different policy modules correspond to different application scenarios (that is, for different applications) Scenario setting strategy module), the embodiments of the present application do not limit the specific setting mode of the strategy module. .
其中,接口通信系统242还可以通过Binder的方式与应用框架层260进行通信,用于接收应用框架层260发送的前景应用信息,从而基于前景应用信息,仅针对当前前台运行的第三方应用程序进行系统资源优化。Among them, the interface communication system 242 can also communicate with the application framework layer 260 through the way of Binder to receive the foreground application information sent by the application framework layer 260, so that based on the foreground application information, only the third-party applications currently running in the foreground System resource optimization.
以操作系统为IOS系统为例,存储器120中存储的程序和数据如图6所示,IOS系统包括:核心操作系统层320(Core OS layer)、核心服务层340(Core Services layer)、媒体层360(Media layer)、可触摸层380(Cocoa Touch Layer)。核心操作系统层320包括了操作系统内核、驱动程序以及底层程序框架,这些底层程序框架提供更接近硬件的功能,以供位于核心服务层340的程序框架所使用。核心服务层340提供给应用程序所需要的系统服务和/或程序框架,比如基础(Foundation)框架、账户框架、广告框架、数据存储框架、网络连接框架、地理位置框架、运动框架等等。媒体层360为应用程序提供有关视听方面的接口,如图形图像相关的接口、音频技术相关的接口、视频技术相关的接口、音视频传输技术的无线播放(AirPlay)接口等。可触摸层380为应用程序开发提供了各种常用的界面相关的框架,可触摸层380负责用户在终端100上的触摸交互操作。比如本地通知服务、远程推送服务、广告框架、游戏工具框架、消息用户界面接口(User Interface,UI)框架、用户界面UIKit框架、地图框架等等。Taking the operating system as an IOS system as an example, the programs and data stored in the memory 120 are shown in FIG. 6. The IOS system includes: a core operating system layer 320 (Core OS layer), a core service layer 340 (Core Services layer), and a media layer 360 (Media Layer), touchable layer 380 (Cocoa Touch Layer). The core operating system layer 320 includes an operating system kernel, drivers, and low-level program frameworks. These low-level program frameworks provide functions closer to the hardware for use by the program framework at the core service layer 340. The core service layer 340 provides system services and/or program frameworks required by applications, such as a foundation framework, account framework, advertising framework, data storage framework, network connection framework, geographic location framework, sports framework, and so on. The media layer 360 provides audiovisual interfaces for applications, such as graphics and image related interfaces, audio technology related interfaces, video technology related interfaces, and audio and video transmission technology wireless playback (AirPlay) interfaces. The touchable layer 380 provides various commonly used interface-related frameworks for application development. The touchable layer 380 is responsible for user's touch interaction operations on the terminal 100. Such as local notification service, remote push service, advertising framework, game tool framework, message user interface (User Interface, UI) framework, user interface UIKit framework, map framework, etc.
在图6所示出的框架中,与大部分应用程序有关的框架包括但不限于:核心服务层340中的基础框架和可触摸层380中的UIKit框架。基础框架提供许多基本的对象类和数据类型,为所有应用程序提供最基本的系统服务,和UI无关。而UIKit框架提供的类是基础的UI类库,用于创建基于触摸的用户界面,iOS应用程序可以基于UIKit框架来提供UI,所以它提供了应用程序的基础架构,用于构建用户界面,绘图、处理和用户交互事件,响应手势等等。In the framework shown in FIG. 6, frameworks related to most applications include, but are not limited to: the basic framework in the core service layer 340 and the UIKit framework in the touchable layer 380. The basic framework provides many basic object classes and data types to provide the most basic system services for all applications, regardless of the UI. The class provided by the UIKit framework is a basic UI class library for creating touch-based user interfaces. iOS applications can provide UI based on the UIKit framework, so it provides the basic architecture of the application for building user interfaces and drawing. , Handling and user interaction events, responding to gestures, etc.
其中,在IOS系统中实现第三方应用程序与操作系统数据通信的方式以及原理可参考Android系统,此处不再赘述。Among them, the method and principle of implementing data communication between the third-party application program and the operating system in the IOS system can refer to the Android system, and will not be repeated here.
然而,采用打通第三方应用程序与操作系统之间数据通信的方式实现基于应用场景的系统资源适配时,第三方应用程序在开发过程中需要进行相应调整,比如内嵌操作系统开发商提供的SDK;并且,为了避免操作系统的数据接口暴露给非法应用程序,造成系统安全隐患,操作系统仅支持与部分第三方应用程序进行数据通信,导致系统资源适配的适用范围较窄。However, when the communication between third-party applications and the operating system is achieved by adapting system resources based on application scenarios, the third-party applications need to be adjusted during the development process, such as those provided by developers of embedded operating systems. SDK; and, in order to prevent the data interface of the operating system from being exposed to illegal applications and cause potential security risks to the system, the operating system only supports data communication with some third-party applications, resulting in a narrower scope of system resource adaptation.
而本申请实施例提供的资源配置方法中,操作系统通过对运行中的游戏应用程序进行截图,并采用机器学习的方式,通过预先训练的游戏场景识别模型对游戏截图进行识别,确定出当前游戏画面对应的游戏场景,进而根据该游戏场景对应的资源配置策略为游戏应用程序分配系统资源。由于整个系统资源分配过程中,操作系统与游戏应用程序之间无需进行数据 通信,因此游戏应用程序在开发过程中无需内嵌SDK,且操作系统的数据接口无需暴露给第三方应用程序,从而提高操作系统的安全性。下面采用示意性的实施例进行说明。In the resource configuration method provided in the embodiments of the present application, the operating system takes screenshots of the running game application and uses machine learning to identify game screenshots through a pre-trained game scene recognition model to determine the current game The game scene corresponding to the screen, and further allocate system resources to the game application according to the resource configuration strategy corresponding to the game scene. Since there is no need for data communication between the operating system and the game application during the entire system resource allocation process, there is no need to embed the SDK during the development of the game application, and the data interface of the operating system does not need to be exposed to third-party applications, thereby improving Operating system security. The following uses an exemplary embodiment for description.
请参考图7,其示出了本申请一个示例性实施例示出的资源配置方法的流程图。本实施例以该方法应用于图1所示的终端100来举例说明。该方法包括:Please refer to FIG. 7, which shows a flowchart of a resource configuration method according to an exemplary embodiment of the present application. This embodiment is exemplified by the method applied to the terminal 100 shown in FIG. 1. The method includes:
步骤701,当运行游戏应用程序时,显示游戏画面。 Step 701, when the game application is running, the game screen is displayed.
当游戏应用程序处于前台运行状态时,终端显示实时的游戏画面,该游戏画面在游戏运行过程中不断发生变化。比如,在游戏启动阶段,该游戏画面为游戏启动画面;完成游戏启动后,该游戏画面为游戏主界面;游戏进行中时,该游戏画面为游戏进行画面。When the game application is in the foreground running state, the terminal displays a real-time game screen, which constantly changes during the game running process. For example, in the game startup phase, the game screen is the game startup screen; after the game startup is completed, the game screen is the game main interface; when the game is in progress, the game screen is the game progress screen.
步骤702,对游戏画面进行截图,得到游戏截图。Step 702: Take a screenshot of the game screen to obtain a screenshot of the game.
由于不同游戏场景下,游戏画面具有不同的特点,因此本申请实施例中终端基于游戏画面识别当前所处的游戏场景。Since the game screen has different characteristics under different game scenes, the terminal in the embodiment of the present application recognizes the current game scene based on the game screen.
在一种可能的实施方式中,游戏应用程序启动后,终端操作系统每隔预定时间间隔对游戏画面进行截图,从而得到相应的游戏截图。In a possible implementation manner, after the game application is started, the terminal operating system takes screenshots of the game screen at predetermined intervals to obtain corresponding game screenshots.
在另一种可能的实施方式中,游戏应用程序启动后,终端在游戏画面上方显示加速控件,并在接收到对该加速控件的触发操作时进行截图。In another possible implementation manner, after the game application is started, the terminal displays the acceleration control above the game screen, and takes a screenshot when the trigger operation of the acceleration control is received.
需要说明的是,操作系统在对游戏画面进行截图时,直接通过后台提取游戏图层,从而获取游戏截图,无需用户手动截图,用户在前台并不会感知。It should be noted that when the operating system takes a screenshot of the game screen, it directly extracts the game layer through the background to obtain a screenshot of the game. There is no need for the user to manually take a screenshot, and the user will not perceive it in the foreground.
可选的,操作系统截取得到的游戏截图缓存在内存中,并在经过场景识别后直接删除。Optionally, screenshots of the game captured by the operating system are cached in memory and deleted directly after scene recognition.
步骤703,通过游戏场景识别模型对游戏截图进行识别,确定游戏画面对应的游戏场景,游戏场景用于指示游戏应用程序所处的运行阶段。Step 703: Identify the game screenshot through the game scene recognition model to determine the game scene corresponding to the game screen. The game scene is used to indicate the running stage of the game application.
本申请实施例中,终端中预先存储有用于对游戏场景进行识别的游戏场景识别模型,该游戏场景识别模型可以是卷积神经网络模型、深度学习模型等其他用于进行图像识别的模型。In the embodiment of the present application, a game scene recognition model for identifying a game scene is pre-stored in the terminal. The game scene recognition model may be a convolutional neural network model, a deep learning model, or other models for image recognition.
针对该游戏场景识别模型的训练方法,在一种可能的实施方式中,该游戏场景识别模型根据携带有游戏场景标识的样本游戏截图训练得到。For the training method of the game scene recognition model, in a possible implementation manner, the game scene recognition model is obtained by training based on a sample game screenshot carrying a game scene identifier.
可选的,终端操作系统将游戏截图输入游戏场景识别模型,得到游戏场景模型输出的若干种候选游戏场景以及对应的概率,进而将概率最高的候选游戏场景确定为游戏画面对应的游戏场景。Optionally, the terminal operating system inputs the game screenshot into the game scene recognition model to obtain several candidate game scenes output by the game scene model and corresponding probabilities, and then determines the candidate game scene with the highest probability as the game scene corresponding to the game screen.
可选的,该游戏场景包括如下至少一种:游戏启动场景、游戏加载场景、游戏主界面场景和游戏进行场景。Optionally, the game scene includes at least one of the following: a game startup scene, a game loading scene, a game main interface scene, and a game progress scene.
示意性的,操作系统将游戏截图输入游戏场景识别模型后,得到游戏场景识别模型输出的游戏场景为“游戏进行场景”。Illustratively, after the operating system inputs the game screenshot into the game scene recognition model, the game scene output by the game scene recognition model is obtained as the "game progress scene".
步骤704,确定游戏场景对应的资源配置策略。Step 704: Determine the resource configuration strategy corresponding to the game scene.
终端操作系统根据确定出游戏应用程序当前所处的游戏场景,进一步确定游戏场景对应的资源配置策略,可选的,该资源配置策略中包含游戏场景下各项系统资源的配置信息,该系统资源包括CPU资源、GPU资源、磁盘资源、内存资源和网络资源中的至少一种。相应的,CPU资源对应的配置信息可以包括CPU工作频率和CPU核心开启数;GPU资源对应的配置信息可以包括GPU工作频率、GPU核心开启数;磁盘资源对应的配置信息可以包括磁盘转速和磁盘读写速度;内存资源对应的配置信息可以包括内存频率和内存读写速度;网络资源对应的配置信息可以包括网速和延迟。The terminal operating system further determines the resource configuration strategy corresponding to the game scenario according to the game scenario where the game application is currently located. Optionally, the resource configuration strategy includes configuration information of various system resources in the game scenario. It includes at least one of CPU resources, GPU resources, disk resources, memory resources, and network resources. Correspondingly, the configuration information corresponding to the CPU resources can include the CPU operating frequency and the number of CPU cores turned on; the configuration information corresponding to the GPU resources can include the GPU operating frequency and the number of GPU cores turned on; the configuration information corresponding to the disk resources can include disk rotation speed and disk reading Write speed; configuration information corresponding to memory resources can include memory frequency and memory read and write speed; configuration information corresponding to network resources can include network speed and delay.
在一种可能的实施方式中,终端中存储有游戏场景与资源配置策略之间的对应关系,终端操作系统即基于该对应关系确定当前游戏场景对应的资源配置策略。示意性的,该对应关系如表一所示。In a possible implementation manner, the terminal stores the correspondence between the game scene and the resource configuration strategy, and the terminal operating system determines the resource configuration strategy corresponding to the current game scene based on the correspondence. Schematically, the corresponding relationship is shown in Table 1.
表一Table I
游戏场景Game scene 资源配置策略Resource allocation strategy
游戏加载场景Game loading scene 资源配置策略AResource Allocation Strategy A
游戏主界面场景Game main interface scene 资源配置策略BResource Allocation Strategy B
游戏进行场景Game progress scene 资源配置策略CResource Allocation Strategy C
示意性的,当识别出的游戏场景为“游戏进行场景”时,终端操作系统基于表一确定出资源配置策略为“资源配置策略C”。Illustratively, when the identified game scene is a "game progress scene", the terminal operating system determines that the resource configuration strategy is "resource configuration strategy C" based on Table 1.
步骤705,根据资源配置策略为游戏应用程序分配系统资源。Step 705: Assign system resources to the game application according to the resource configuration strategy.
可选的,根据资源配置策略中各项系统资源对应的配置信息,终端操作系统对游戏应用程序进行系统资源分配。Optionally, according to the configuration information corresponding to each system resource in the resource configuration strategy, the terminal operating system allocates system resources to the game application program.
在一种可能的实施方式中,当资源配置策略指示的目标系统资源配置低于当前系统资源配置,操作系统则将当前系统资源配置下调至资源配置策略指示的目标系统资源配置,从而在保证游戏应用程序运行质量的同时,降低终端的功耗;当资源配置策略指示的目标系统资源配置高于当前系统资源配置,操作系统则将当前系统资源配置上调至资源配置策略指示的目标系统资源配置,从而提高游戏应用程序的运行质量。In a possible implementation, when the target system resource configuration indicated by the resource configuration strategy is lower than the current system resource configuration, the operating system down-regulates the current system resource configuration to the target system resource configuration indicated by the resource configuration strategy, thereby ensuring the game At the same time as the running quality of the application, it reduces the power consumption of the terminal; when the target system resource configuration indicated by the resource configuration strategy is higher than the current system resource configuration, the operating system increases the current system resource configuration to the target system resource configuration indicated by the resource configuration strategy, Thereby improving the running quality of the game application.
综上所述,本申请实施例中,游戏应用程序运行过程中,通过对游戏画面进行截图,并通过预先训练得到的游戏场景识别模型对游戏截图进行识别,确定游戏画面对应的游戏场景,从而根据该游戏场景对应的资源配置策略为游戏应用程序分配系统资源,进而优化游戏应用程序在不同游戏场景下的性能以及功耗;本申请实施例提供的资源配置方法中,游戏应用程序无需接入终端操作系统,终端操作系统也能够智能分析出当前所处的游戏场景,从而免去了在游戏应用程序与操作系统之间建立数据通道的过程,并有助于提高操作系统的安全性。In summary, in the embodiment of the present application, during the running of the game application, by taking screenshots of the game screen and identifying the game screenshots by the pre-trained game scene recognition model, the game scene corresponding to the game screen is determined, thereby According to the resource configuration strategy corresponding to the game scenario, allocate system resources to the game application, thereby optimizing the performance and power consumption of the game application in different game scenarios; in the resource configuration method provided by the embodiments of the present application, the game application does not need to be accessed The terminal operating system, the terminal operating system can also intelligently analyze the current game scene, thereby eliminating the process of establishing a data channel between the game application program and the operating system, and helping to improve the security of the operating system.
可选的,通过游戏场景识别模型对游戏截图进行识别,确定游戏画面对应的游戏场景,包括:Optionally, the game screenshot is identified by the game scene recognition model to determine the game scene corresponding to the game screen, including:
获取游戏应用程序对应的游戏类型;Get the game type corresponding to the game application;
将游戏类型和游戏截图输入游戏场景识别模型,得到游戏场景识别模型输出的游戏场景;Enter the game type and game screenshot into the game scene recognition model to obtain the game scene output by the game scene recognition model;
确定游戏场景对应的资源配置策略,包括:Determine the resource allocation strategy corresponding to the game scene, including:
根据游戏类型以及游戏场景,确定游戏场景对应的资源配置策略;According to the game type and game scene, determine the resource allocation strategy corresponding to the game scene;
其中,游戏类型包括如下至少一种:第一人称射击游戏FPS、第三人称射击游戏TPS、多人在线战术竞技游戏MOBA、卡牌游戏、竞速游戏、音乐游戏、模拟经营游戏、冒险游戏AVG、格斗游戏FTG、角色扮演游戏RPG和沙盒游戏。Among them, the game types include at least one of the following: first-person shooter game FPS, third-person shooter game TPS, multiplayer online tactical competitive game MOBA, card game, racing game, music game, simulation management game, adventure game AVG, fighting Game FTG, role-playing game RPG and sandbox game.
可选的,确定游戏场景对应的资源配置策略之前,方法还包括:Optionally, before determining the resource configuration strategy corresponding to the game scenario, the method further includes:
获取当前剩余电量以及游戏应用程序的应用程序大小,应用程序大小用于指示游戏应用程序所占的存储空间;Get the current remaining power and the application size of the game application. The application size is used to indicate the storage space occupied by the game application;
根据游戏类型以及游戏场景,确定游戏场景对应的资源配置策略,包括:According to the game type and game scenario, determine the resource allocation strategy corresponding to the game scenario, including:
将当前剩余电量、应用程序大小、游戏类型以及游戏场景输入资源配置模型,得到资源配置模型输出的资源配置策略。Input the current remaining power, application size, game type, and game scene into the resource configuration model to obtain the resource configuration strategy output by the resource configuration model.
可选的,资源配置模型是基于深度学习的神经网络模型,资源配置模型根据样本输入参数和样本输出参数训练得到,样本训练参数包括样本电量、样本应用程序大小、样本类型和样本游戏场景,样本输出参数包括样本资源配置策略。Optionally, the resource configuration model is a neural network model based on deep learning. The resource configuration model is trained based on sample input parameters and sample output parameters. The sample training parameters include sample power, sample application size, sample type and sample game scene The output parameters include sample resource allocation strategies.
可选的,对游戏画面进行截图,得到游戏截图之前,方法还包括:Optionally, take a screenshot of the game screen, and before obtaining the screenshot of the game, the method further includes:
获取游戏应用程序的应用标识;Obtain the application identification of the game application;
检测应用标识是否属于预设游戏列表,预设游戏列表中包含目标游戏应用程序的标识,目标游戏应用程序在运行过程中通过与操作系统之间的数据通道向操作系统发送场景信息,操作系统用于根据场景信息指示的游戏场景确定资源配置策略;Detect whether the application ID belongs to the preset game list. The preset game list contains the identification of the target game application. The target game application sends scene information to the operating system through the data channel with the operating system during operation. The operating system uses Determine the resource allocation strategy according to the game scene indicated by the scene information;
若应用标识不属于预设游戏列表,则执行对游戏画面进行截图,得到游戏截图的步骤。If the application identifier does not belong to the preset game list, then perform a step of taking a screenshot of the game screen to obtain a screenshot of the game.
可选的,方法还包括:Optionally, the method further includes:
当接收到目标游戏应用程序发送的场景信息时,对目标游戏应用程序的当前游戏画面进 行截图,得到样本游戏截图;When receiving the scene information sent by the target game application, take a screenshot of the current game screen of the target game application to obtain a sample game screenshot;
根据场景信息指示的游戏场景以及样本游戏截图,通过反向传播算法对游戏场景识别模型进行训练。According to the game scene indicated by the scene information and the sample game screenshots, the game scene recognition model is trained through the back propagation algorithm.
可选的,对游戏画面进行截图,得到游戏截图,包括:Optionally, take a screenshot of the game screen to obtain a screenshot of the game, including:
在游戏画面上层显示加速控件;Display acceleration controls on the upper layer of the game screen;
当接收到对加速控件的触发信号时,对游戏画面进行截图,得到游戏截图。When the trigger signal for the acceleration control is received, a screenshot is taken of the game screen to obtain a screenshot of the game.
可选的,根据资源配置策略为游戏应用程序分配系统资源之后,方法还包括:Optionally, after allocating system resources to the game application according to the resource configuration strategy, the method further includes:
每隔预定时间间隔识别当前游戏画面对应的当前游戏场景;Identify the current game scene corresponding to the current game screen every predetermined time interval;
若当前游戏场景发生变化,则重新确定当前游戏场景对应的资源配置策略。If the current game scene changes, the resource configuration strategy corresponding to the current game scene is re-determined.
可选的,系统资源的资源类型包括中央处理器CPU资源、图形处理器GPU资源、磁盘资源、内存资源和网络资源中的至少一种。Optionally, the resource types of the system resources include at least one of central processing unit CPU resources, graphics processor GPU resources, disk resources, memory resources, and network resources.
由于不同类型游戏应用程序中游戏画面的画面特征不同,比如游戏进行场景下,卡牌游戏的游戏画面中包含卡牌元素,而竞速游戏的游戏画面中包含赛道元素。因此,为了提高游戏场景识别的准确性,在一种可能的实施方式中,利用标记有游戏类型以及游戏场景标识的样本游戏截图训练游戏场景识别模型;相应的,使用游戏场景识别模型识别游戏场景时,操作系统将当前游戏应用程序的游戏类型和游戏截图作为模型输入,输入游戏场景识别模型中。下面采用示意性的实施例进行说明。Due to the different screen characteristics of game screens in different types of game applications, for example, in the game playing scene, the card game game screen contains card elements, and the racing game game screen contains track elements. Therefore, in order to improve the accuracy of game scene recognition, in a possible implementation manner, a sample game screenshot marked with a game type and a game scene identifier is used to train a game scene recognition model; accordingly, a game scene recognition model is used to identify a game scene At this time, the operating system takes the game type and game screenshot of the current game application as model input, and inputs it into the game scene recognition model. The following uses an exemplary embodiment for description.
请参考图8,其示出了本申请另一个示例性实施例示出的资源配置方法的流程图。本实施例以该方法应用于图1所示的终端100来举例说明。该方法包括:Please refer to FIG. 8, which shows a flowchart of a resource configuration method shown in another exemplary embodiment of the present application. This embodiment is exemplified by the method applied to the terminal 100 shown in FIG. 1. The method includes:
步骤801,当运行游戏应用程序时,显示游戏画面。 Step 801, when the game application is running, the game screen is displayed.
本步骤的实施方式可以参考上述步骤701,本实施例在此不再赘述。For the implementation of this step, reference may be made to the above step 701, and this embodiment will not be repeated here.
步骤802,获取游戏应用程序的应用标识。Step 802: Obtain the application identification of the game application.
当终端中安装有能够与操作系统建立数据通道,并进行数据通信的目标游戏应用程序时,此类目标游戏应用程序在运行过程中,可以通过数据通道向操作系统上报场景信息(包含游戏场景),操作系统即可基于获取到的场景信息为目标游戏应用程序进行系统资源配置。因此,针对目标游戏应用程序,操作系统无需进行截图和游戏截图识别。When a target game application that can establish a data channel with the operating system and perform data communication is installed in the terminal, during the running of such target game application, the scene information (including game scenes) can be reported to the operating system through the data channel , The operating system can configure system resources for the target game application based on the obtained scene information. Therefore, for the target game application, the operating system does not need to perform screenshot and game screenshot identification.
为了避免对目标游戏应用程序进行截图以及场景识别,造成终端处理资源浪费,在一种可能的实施方式中,操作系统获取当前运行游戏应用程序的应用标识。其中,该应用标识可以为游戏应用程序的应用包名。In order to avoid taking screenshots and identifying scenes of the target game application, resulting in a waste of terminal processing resources, in a possible implementation manner, the operating system obtains the application identification of the currently running game application. The application identifier may be the application package name of the game application program.
步骤803,检测应用标识是否属于预设游戏列表,预设游戏列表中包含目标游戏应用程序的标识,目标游戏应用程序在运行过程中通过与操作系统之间的数据通道向操作系统发送场景信息,操作系统用于根据场景信息指示的游戏场景确定资源配置策略。 Step 803, it is detected whether the application identifier belongs to the preset game list, and the preset game list contains the identifier of the target game application program, and the target game application program sends scene information to the operating system through a data channel with the operating system during operation, The operating system is used to determine the resource allocation strategy according to the game scene indicated by the scene information.
可选的,终端中存储有预设游戏列表,该预设游戏列表中即包含目标游戏应用程序的标识。其中,该预设游戏列表是终端从后台服务器处定期更新下载。Optionally, a preset game list is stored in the terminal, and the preset game list includes the identification of the target game application. Among them, the preset game list is the terminal regularly updates and downloads from the background server.
终端操作系统检测当前游戏应用程序的应用标识是否属于预设游戏列表,若属于,则确定当前游戏应用程序为目标应用程序,后续无需进行截图场景识别;若不属于,则确定当前游戏应用程序无法直接向操作系统发送场景信息,并执行步骤804。The terminal operating system detects whether the application ID of the current game application belongs to the preset game list. If it belongs, it determines that the current game application is the target application, and subsequent screenshot scene recognition is not required; if it does not, it determines that the current game application cannot Send the scene information directly to the operating system, and perform step 804.
在其他可能的实施方式中,当应用标识不属于预设游戏列表时,操作系统进一步检测应用标识是否属于游戏白名单,若属于游戏白名单,则执行步骤804。其中,该游戏白名单中包含游戏性能优化的游戏应用程序。In other possible implementation manners, when the application identifier does not belong to the preset game list, the operating system further detects whether the application identifier belongs to the game whitelist, and if it belongs to the game whitelist, step 804 is executed. Among them, the game whitelist contains game applications optimized for game performance.
步骤804,若应用标识不属于预设游戏列表,则对游戏画面进行截图,得到游戏截图。 Step 804, if the application identifier does not belong to the preset game list, then take a screenshot of the game screen to obtain a screenshot of the game.
其中,终端操作系统进行截图的步骤可以参考上述步骤702,本实施例在此不再赘述。For the step of taking screenshots by the terminal operating system, reference may be made to the above step 702, and this embodiment will not repeat them here.
步骤805,获取游戏应用程序对应的游戏类型。Step 805: Obtain the game type corresponding to the game application.
为了提高后续游戏场景识别的准确性,操作系统获取游戏应用程序对应的游戏类型,该 游戏类型可以包括如下至少一种:第一人称射击游戏(First-Person Shooter game,FPS)、第三人称射击游戏(Third-Person Shooter game,TPS)、多人在线战术竞技游戏(Multiplayer Online Battle Arena,MOBA)、卡牌游戏、竞速游戏、音乐游戏、模拟经营游戏、冒险游戏(Adventure Game,AVG)、格斗游戏(Fighting Game,FTG)、角色扮演游戏(Role-Playing Game,RPG)和沙盒游戏。In order to improve the accuracy of subsequent game scene recognition, the operating system obtains the game type corresponding to the game application. The game type may include at least one of the following: First-Person Shooter (First-Person Shooter game, FPS), third-person shooter game ( Third-Person Shooter game (TPS), multiplayer online tactical competitive game (Multiplayer Online Battle Arena, MOBA), card game, racing game, music game, simulation management game, adventure game (Adventure Game, AVG), fighting game (Fighting Game, FTG), Role-Playing Game (RPG) and sandbox games.
在一种可能的实施方式中,操作系统获取游戏应用程序的应用名称或应用包名,从而根据该应用名称或应用包名查询该游戏应用程序的游戏类型。本申请实施例并不对获取游戏类型的具体方式进行限定。In a possible implementation manner, the operating system obtains the application name or application package name of the game application program, so as to query the game type of the game application program according to the application name or application package name. The embodiment of the present application does not limit the specific way of acquiring the game type.
步骤806,将游戏类型和游戏截图输入游戏场景识别模型,得到游戏场景识别模型输出的游戏场景。Step 806: Enter the game type and game screenshot into the game scene recognition model to obtain the game scene output from the game scene recognition model.
进一步的,在进行游戏场景识别时,操作系统将游戏类型和游戏截图共同输入游戏场景识别模型,从而得到游戏场景识别模型输出的若干种候选游戏场景及其概率,并将最高概率对应的候选游戏场景确定为当前游戏画面对应的游戏场景。Further, during game scene recognition, the operating system inputs the game type and game screenshot together into the game scene recognition model, thereby obtaining several candidate game scenes and their probabilities output by the game scene recognition model, and the candidate game corresponding to the highest probability The scene is determined to be the game scene corresponding to the current game screen.
步骤807,根据游戏类型以及游戏场景,确定游戏场景对应的资源配置策略。 Step 807, according to the game type and the game scene, determine the resource configuration strategy corresponding to the game scene.
相同游戏场景下,由于不同游戏类型的游戏应用程序对系统资源的需求不同,比如,同样在游戏进行场景下,卡牌游戏对系统资源的需求低于MOBA游戏对系统资源的需求,因此,操作系统同时基于游戏类型以及游戏场景,确定当前游戏场景对应的资源配置策略。In the same game scenario, due to different game types, game applications have different requirements on system resources. For example, in the same game scenario, card games have lower system resource requirements than MOBA games. Therefore, operate The system also determines the resource allocation strategy corresponding to the current game scene based on the game type and game scene.
在一种可能的实施方式中,终端中存储有游戏类型、游戏场景以及资源配置策略三者之间的对应关系,终端操作系统即基于该对应关系确定当前游戏场景对应的资源配置策略。示意性的,该对应关系如表二所示。In a possible implementation manner, the terminal stores a correspondence between the three types of games, game scenes, and resource configuration strategies, and the terminal operating system determines the resource configuration strategy corresponding to the current game scene based on the correspondence. Schematically, the corresponding relationship is shown in Table 2.
表二Table II
游戏类型game type 游戏场景Game scene 资源配置策略Resource allocation strategy
卡牌游戏card game 游戏加载场景Game loading scene 资源配置策略A1Resource allocation strategy A1
MOBA游戏MOBA games 游戏加载场景Game loading scene 资源配置策略A2Resource allocation strategy A2
卡牌游戏card game 游戏进行场景Game progress scene 资源配置策略C1Resource allocation strategy C1
MOBA游戏MOBA games 游戏进行场景Game progress scene 资源配置策略C2Resource allocation strategy C2
示意性的,当识别出的游戏场景为“游戏进行场景”,且游戏类型为“MOBA游戏”时,终端操作系统基于表二确定出资源配置策略为“资源配置策略C2”。Illustratively, when the identified game scene is "game progress scene" and the game type is "MOBA game", the terminal operating system determines that the resource configuration strategy is "resource configuration strategy C2" based on Table 2.
由于资源配置策略所指示系统资源配置的高低还与游戏大小相关(游戏大小越大,对系统资源的需求越高),且与终端当前的电量相关(电量较低时,过高的系统资源配置会影响终端续航),因此为了进一步提高确定出的资源配置策略的准确性和适用性,在另一种可能的实施方式中,在确定游戏场景对应的资源配置策略之前,终端操作系统获取当前剩余电量以及游戏应用程序的应用程序大小,该应用程序大小用于指示游戏应用程序所占的存储空间。在确定游戏场景对应的资源配置策略时,终端操作系统将当前剩余电量、应用程序大小、游戏类型以及游戏场景输入资源配置模型,得到资源配置模型输出的资源配置策略。Because the level of system resource allocation indicated by the resource allocation strategy is also related to the game size (the larger the game size, the higher the demand for system resources), and is related to the current power of the terminal (when the power is low, the system resource configuration is too high Will affect the endurance of the terminal), so in order to further improve the accuracy and applicability of the determined resource allocation strategy, in another possible implementation manner, before determining the resource allocation strategy corresponding to the game scenario, the terminal operating system obtains the current remaining The amount of power and the application size of the game application. The application size is used to indicate the storage space occupied by the game application. When determining the resource configuration strategy corresponding to the game scenario, the terminal operating system inputs the current remaining power, application size, game type, and game scenario into the resource configuration model to obtain the resource configuration strategy output by the resource configuration model.
可选的,资源配置模型为基于深度学习的神经网络模型,且训练该资源配置模型时使用的样本输入参数包括样本电量、样本应用程序大小、样本类型和样本游戏场景,样本输出参数则包括样本资源配置策略。本申请实施例并不对资源配置模型的训练过程进行限定。Optionally, the resource configuration model is a neural network model based on deep learning, and the sample input parameters used in training the resource configuration model include sample power, sample application size, sample type, and sample game scene, and sample output parameters include samples Resource allocation strategy. The embodiments of the present application do not limit the training process of the resource allocation model.
示意性的,终端操作系统获取到当前剩余电量为“50%”、应用程序大小为“1.5GB”、游戏类型为“MOBA游戏”且游戏场景为“游戏进行场景”,将上述参数输入资源配置模型后,得到资源配置模型输出的资源配置策略。Schematically, the terminal operating system obtains the current remaining power is "50%", the application size is "1.5GB", the game type is "MOBA game" and the game scene is "game progress scene", and the above parameters are entered into the resource configuration After the model, the resource allocation strategy output by the resource allocation model is obtained.
需要说明的是,终端还可以将其他与资源配置策略相关的参数作为模型输入进行模型训练,以此提高资源配置模型输出的资源配置策略的准确性。It should be noted that the terminal may also use other parameters related to the resource configuration strategy as model inputs for model training, so as to improve the accuracy of the resource configuration strategy output by the resource configuration model.
步骤808,根据资源配置策略为游戏应用程序分配系统资源。Step 808: Assign system resources to the game application according to the resource configuration strategy.
本步骤的实施方式可以参考上述步骤705,本实施例在此不再赘述。For the implementation of this step, reference may be made to step 705 described above, and this embodiment will not be repeated here.
本实施例中,考虑到不同类型游戏具有不同的游戏画面特征,通过将当前游戏应用的游戏类型以及游戏截图一同输入游戏场景识别模型,得到游戏场景识别模型输出的游戏场景,提高了游戏场景识别的准确性。In this embodiment, considering that different types of games have different game screen characteristics, by entering the game type of the current game application and the game screenshot together into the game scene recognition model, the game scene output by the game scene recognition model is obtained, which improves the game scene recognition Accuracy.
同时,考虑到不同类型游戏对系统资源的不同需求,根据当前游戏应用的游戏类型以及当前所处的游戏场景,确定游戏场景对应的资源配置策略,提高了确定出的资源配置策略的准确性。At the same time, considering the different needs of different types of games for system resources, the resource configuration strategy corresponding to the game scenario is determined according to the current game application type and the current game scenario, which improves the accuracy of the determined resource configuration strategy.
为了进一步提高游戏场景识别模型的识别准确性,在一种可能的实施方式中,操作系统根据目标应用程序上报场景信息时的游戏画面,对游戏场景识别模型进行反向训练。在图8的基础上,如图9所示,步骤808之后还可以包括如下步骤。In order to further improve the recognition accuracy of the game scene recognition model, in a possible implementation manner, the operating system performs reverse training on the game scene recognition model according to the game screen when the target application reports the scene information. On the basis of FIG. 8, as shown in FIG. 9, after step 808, the following steps may also be included.
步骤809,当接收到目标游戏应用程序发送的场景信息时,对目标游戏应用程序的当前游戏画面进行截图,得到样本游戏截图。Step 809: When receiving the scene information sent by the target game application, take a screenshot of the current game screen of the target game application to obtain a sample game screenshot.
在一种可能的实施方式中,当检测应用标识是否属于预设游戏列表时,终端操作系统在目标游戏应用程序运行过程中,接收目标游戏应用程序发送的包含游戏场景的场景信息,并基于场景信息对目标游戏应用程序进行资源配置;与此同时,操作系统对当前游戏画面进行截图,得到与目标游戏应用程序当前游戏场景对应样本游戏截图。In a possible implementation manner, when detecting whether the application identifier belongs to the preset game list, the terminal operating system receives scene information containing game scenes sent by the target game application during operation of the target game application, and based on the scene The information configures the resource of the target game application; at the same time, the operating system takes a screenshot of the current game screen to obtain a sample game screenshot corresponding to the current game scene of the target game application.
步骤810,根据场景信息指示的游戏场景以及样本游戏截图,通过反向传播算法对游戏场景识别模型进行训练。Step 810: Train the game scene recognition model through a back propagation algorithm according to the game scene indicated by the scene information and the sample game screenshots.
进一步的,终端操作系统根据场景信息指示的游戏场景以及样本游戏截图,对原有的游戏场景识别模型进行反向传播训练,以此提高游戏场景识别模型的识别准确性。Further, the terminal operating system performs back propagation training on the original game scene recognition model according to the game scene indicated by the scene information and sample game screenshots, so as to improve the recognition accuracy of the game scene recognition model.
可选的,终端操作系统可以根据场景信息指示的游戏场景、目标游戏应用程序的游戏类型以及样本游戏截图,对游戏场景识别模型进行反向传播训练。Optionally, the terminal operating system may perform back propagation training on the game scene recognition model according to the game scene indicated by the scene information, the game type of the target game application, and the sample game screenshot.
在一种可能的实施方式中,终端操作系统将样本游戏截图输入原有的游戏场景识别模型,得到模型输出的若干种候选游戏场景及其概率,并基于场景信息所指示游戏场景与各种候选游戏场景对应的概率,进行反向传播训练。In a possible implementation manner, the terminal operating system inputs the sample game screenshots into the original game scene recognition model to obtain several candidate game scenes and their probabilities output by the model, and based on the game scene and various candidates indicated by the scene information Probability corresponding to the game scene, back propagation training.
本实施例中,终端操作系统在接收到目标游戏应用程序上报的场景信息时,对游戏画面进行截图,从而根据游戏截图和场景信息指示的游戏场景对游戏场景识别模型进行反向传播训练,以此提高游戏场景识别模型的识别准确性。In this embodiment, when receiving the scene information reported by the target game application, the terminal operating system takes a screenshot of the game screen, so that the game scene recognition model is back-propagated according to the game scene indicated by the game screenshot and the scene information, to This improves the recognition accuracy of the game scene recognition model.
在一种可能的实施方式中,在图8的基础上,如图10所示,步骤804可以包括如下步骤:In a possible implementation manner, based on FIG. 8, as shown in FIG. 10, step 804 may include the following steps:
步骤804A,显示加速控件。 Step 804A: Display the acceleration control.
在一种可能的实施方式中,终端操作系统显示加速控件,并接收加速控件上的触发操作。其中,该加速控件可以是位于游戏画面上层的悬浮图标,或者显示在快捷栏中的快捷功能图标(比如显示在显示屏异性区域的加速图标),且触发操作可以是点击操作、按压操作或长按操作中的至少一种。本申请实施例对此不做限定。In a possible implementation manner, the terminal operating system displays the acceleration control and receives the trigger operation on the acceleration control. The acceleration control may be a floating icon located on the upper layer of the game screen, or a shortcut function icon displayed in the shortcut bar (such as an acceleration icon displayed in the opposite area of the display screen), and the trigger operation may be a click operation, a press operation, or a long Press at least one of the operations. This embodiment of the present application does not limit this.
示意性的,如图11所示,游戏画面1101的上层显示有加速控件1102。Illustratively, as shown in FIG. 11, an acceleration control 1102 is displayed on the upper layer of the game screen 1101.
步骤804B,当接收到对加速控件的触发信号时,对游戏画面进行截图,得到游戏截图。Step 804B: When receiving the trigger signal for the acceleration control, take a screenshot of the game screen to obtain a screenshot of the game.
当接收到对加速控件的触发信号时,终端确定需要对游戏应用程序进行性能优化,从而执行后续截图以及游戏场景识别等操作。其具体实施方式可以参考图8实施例,本实施例在此不再赘述。When receiving the trigger signal for the acceleration control, the terminal determines that it is necessary to optimize the performance of the game application, so as to perform operations such as subsequent screenshots and game scene recognition. For a specific implementation manner, reference may be made to the embodiment in FIG. 8, and this embodiment will not be repeated here.
由于游戏运行过程中,游戏场景在不断发生变化,比如游戏结束后,将由游戏进行场景切换至游戏主界面场景,因此操作系统需要及时调试资源配置策略,相应的,如图10所示,步骤808之后还包括如下步骤。Since the game scene is constantly changing during the game running, for example, after the game is over, the game scene will be switched to the game main interface scene, so the operating system needs to debug the resource configuration strategy in time, accordingly, as shown in FIG. 10, step 808 It also includes the following steps.
步骤811,每隔预定时间间隔识别当前游戏画面对应的当前游戏场景。Step 811: Identify the current game scene corresponding to the current game picture every predetermined time interval.
在一种可能的实施方式中,终端操作系统每隔预定时间间隔,通过截图和模型识别操作, 重新识别当前游戏画面对应的当前游戏场景,并检测当前游戏场景与上一次识别出的游戏场景是否一致,若一致,则保持当前资源配置方式;若不一致,则通过下述步骤812重新确定当前游戏场景对应的资源配置策略。In a possible implementation manner, the terminal operating system re-identifies the current game scene corresponding to the current game screen through a screenshot and model recognition operation at predetermined intervals, and detects whether the current game scene and the last recognized game scene If they are consistent, the current resource configuration mode is maintained; if they are not consistent, the resource configuration strategy corresponding to the current game scene is re-determined through the following step 812.
可选的,该预定时间间隔可以根据上一次识别游戏场景对应的预计持续时长确定。比如,对于MOBA游戏,当上一次识别出的游戏场景为“游戏进行场景”时,终端操作系统确定预定时间间隔为30分钟。Optionally, the predetermined time interval may be determined according to the predicted duration corresponding to the last recognized game scene. For example, for a MOBA game, when the last game scene identified is a "game progress scene", the terminal operating system determines that the predetermined time interval is 30 minutes.
步骤812,若当前游戏场景发生变化,则重新确定当前游戏场景对应的资源配置策略。 Step 812, if the current game scene changes, then re-determine the resource configuration strategy corresponding to the current game scene.
当游戏场景发生变化时,终端操作系统重新确定资源配置策略,并根据重新确定的资源配置策略进行系统资源配置。When the game scene changes, the terminal operating system re-determines the resource configuration strategy and performs system resource configuration according to the re-determined resource configuration strategy.
本实施例中,终端操作系统每隔预定时间间隔自动对当前游戏画面进行识别,当游戏场景发生变化时,重新确定当前游戏场景对应的资源配置策略,可以实现自动优化游戏应用程序的性能,减少用户的操作次数,优化用户体验。In this embodiment, the terminal operating system automatically recognizes the current game screen every predetermined time interval. When the game scene changes, the resource allocation strategy corresponding to the current game scene is re-determined, which can automatically optimize the performance of the game application and reduce The number of user operations to optimize the user experience.
请参考图12,其示出了本申请一个实施例提供的资源配置装置的结构框图。该资源配置装置可以通过软件、硬件或者两者的结合实现成为终端的全部或一部分。该装置包括:Please refer to FIG. 12, which shows a structural block diagram of a resource configuration apparatus provided by an embodiment of the present application. The resource configuration device can be implemented as all or part of the terminal through software, hardware, or a combination of both. The device includes:
显示模块1201,用于当运行游戏应用程序时,显示游戏画面;The display module 1201 is used to display a game screen when running a game application;
截图模块1202,用于对所述游戏画面进行截图,得到游戏截图;The screenshot module 1202 is used to take a screenshot of the game screen to obtain a screenshot of the game;
场景识别模块1203,用于通过游戏场景识别模型对所述游戏截图进行识别,确定所述游戏画面对应的游戏场景,所述游戏场景用于指示所述游戏应用程序所处的运行阶段;The scene recognition module 1203 is used to recognize the game screenshot through the game scene recognition model and determine the game scene corresponding to the game screen, where the game scene is used to indicate the running stage of the game application;
策略确定模块1204,用于确定所述游戏场景对应的资源配置策略;The strategy determination module 1204 is configured to determine a resource configuration strategy corresponding to the game scene;
资源分配模块1205,用于根据所述资源配置策略为所述游戏应用程序分配系统资源。The resource allocation module 1205 is configured to allocate system resources to the game application according to the resource configuration strategy.
可选的,所述场景识别模块1203,包括:Optionally, the scene recognition module 1203 includes:
类型获取单元,用于获取所述游戏应用程序对应的游戏类型;A type obtaining unit, configured to obtain a game type corresponding to the game application;
场景预测单元,用于将所述游戏类型和所述游戏截图输入所述游戏场景识别模型,得到所述游戏场景识别模型输出的所述游戏场景;A scene prediction unit, configured to input the game type and the game screenshot into the game scene recognition model to obtain the game scene output by the game scene recognition model;
所述策略确定模块1204,用于:The strategy determination module 1204 is used to:
根据所述游戏类型以及所述游戏场景,确定所述游戏场景对应的所述资源配置策略;Determine the resource configuration strategy corresponding to the game scenario according to the game type and the game scenario;
其中,所述游戏类型包括如下至少一种:FPS、TPS、MOBA、卡牌游戏、竞速游戏、音乐游戏、模拟经营游戏、AVG、FTG、RPG和沙盒游戏。Among them, the game types include at least one of the following: FPS, TPS, MOBA, card games, racing games, music games, simulation business games, AVG, FTG, RPG, and sandbox games.
可选的,所述装置,还包括:Optionally, the device further includes:
第一获取模块,用于获取当前剩余电量以及所述游戏应用程序的应用程序大小,所述应用程序大小用于指示所述游戏应用程序所占的存储空间;A first obtaining module, configured to obtain the current remaining power and the application size of the game application, and the application size is used to indicate the storage space occupied by the game application;
所述策略确定模块1204,还用于:The strategy determination module 1204 is also used to:
将所述当前剩余电量、所述应用程序大小、所述游戏类型以及所述游戏场景输入资源配置模型,得到所述资源配置模型输出的所述资源配置策略。Input the current remaining power, the size of the application program, the game type, and the game scene into a resource configuration model to obtain the resource configuration strategy output by the resource configuration model.
可选的,所述资源配置模型是基于深度学习的神经网络模型,所述资源配置模型根据样本输入参数和样本输出参数训练得到,所述样本训练参数包括样本电量、样本应用程序大小、样本类型和样本游戏场景,所述样本输出参数包括样本资源配置策略。Optionally, the resource configuration model is a neural network model based on deep learning. The resource configuration model is trained based on sample input parameters and sample output parameters. The sample training parameters include sample power, sample application size, and sample type. And a sample game scenario, the sample output parameters include a sample resource configuration strategy.
可选的,所述装置还包括:Optionally, the device further includes:
第二获取模块,用于获取所述游戏应用程序的应用标识;A second obtaining module, configured to obtain the application identification of the game application program;
检测模块,用于检测所述应用标识是否属于预设游戏列表,所述预设游戏列表中包含目标游戏应用程序的标识,所述目标游戏应用程序在运行过程中通过与操作系统之间的数据通道向所述操作系统发送场景信息,所述操作系统用于根据所述场景信息指示的所述游戏场景确定所述资源配置策略;The detection module is configured to detect whether the application identifier belongs to a preset game list, and the preset game list includes an identifier of a target game application, and the target game application passes data between the operating system during operation The channel sends scene information to the operating system, and the operating system is used to determine the resource configuration strategy according to the game scene indicated by the scene information;
所述截图模块1202,用于若所述应用标识不属于所述预设游戏列表,则执行所述对游戏 画面进行截图,得到游戏截图的步骤。The screenshot module 1202 is configured to execute the step of taking a screenshot of the game screen to obtain a screenshot of the game if the application identifier does not belong to the preset game list.
可选的,所述装置还包括:Optionally, the device further includes:
样本截图模块,用于当接收到所述目标游戏应用程序发送的所述场景信息时,对所述目标游戏应用程序的当前游戏画面进行截图,得到样本游戏截图;A sample screenshot module, configured to take a screenshot of the current game screen of the target game application when receiving the scene information sent by the target game application, to obtain a sample game screenshot;
训练模块,用于根据所述场景信息指示的所述游戏场景以及所述样本游戏截图,通过反向传播算法对所述游戏场景识别模型进行训练。The training module is configured to train the game scene recognition model through a back propagation algorithm according to the game scene indicated by the scene information and the sample game screenshot.
可选的,所述截图模块1202,包括:Optionally, the screenshot module 1202 includes:
控件显示单元,用于在所述游戏画面上层显示加速控件;A control display unit for displaying an acceleration control on the upper layer of the game screen;
截图单元,用于当接收到对所述加速控件的触发信号时,对所述游戏画面进行截图,得到所述游戏截图。The screenshot unit is configured to take a screenshot of the game screen when the trigger signal for the acceleration control is received to obtain the screenshot of the game.
可选的,所述装置还包括:Optionally, the device further includes:
定时识别模块,用于每隔预定时间间隔识别当前游戏画面对应的当前游戏场景;The timing recognition module is used to identify the current game scene corresponding to the current game screen at predetermined time intervals;
策略重置模块,用于若所述当前游戏场景发生变化,则重新确定所述当前游戏场景对应的所述资源配置策略。The strategy resetting module is used to re-determine the resource configuration strategy corresponding to the current game scene if the current game scene changes.
可选的,所述系统资源的资源类型包括CPU资源、GPU资源、磁盘资源、内存资源和网络资源中的至少一种。Optionally, the resource types of the system resources include at least one of CPU resources, GPU resources, disk resources, memory resources, and network resources.
综上所述,本申请实施例中,游戏应用程序运行过程中,通过对游戏画面进行截图,并通过预先训练得到的游戏场景识别模型对游戏截图进行识别,确定游戏画面对应的游戏场景,从而根据该游戏场景对应的资源配置策略为游戏应用程序分配系统资源,进而优化游戏应用程序在不同游戏场景下的性能以及功耗;本申请实施例提供的资源配置方法中,游戏应用程序无需接入终端操作系统,终端操作系统也能够智能分析出当前所处的游戏场景,从而免去了在游戏应用程序与操作系统之间建立数据通道的过程,并有助于提高操作系统的安全性。In summary, in the embodiment of the present application, during the running of the game application, by taking screenshots of the game screen and identifying the game screenshots by the pre-trained game scene recognition model, the game scene corresponding to the game screen is determined, thereby According to the resource configuration strategy corresponding to the game scenario, allocate system resources to the game application, thereby optimizing the performance and power consumption of the game application in different game scenarios; in the resource configuration method provided by the embodiments of the present application, the game application does not need to be accessed The terminal operating system, the terminal operating system can also intelligently analyze the current game scene, thereby eliminating the process of establishing a data channel between the game application program and the operating system, and helping to improve the security of the operating system.
本实施例中,考虑到不同类型游戏具有不同的游戏画面特征,通过将当前游戏应用的游戏类型以及游戏截图一同输入游戏场景识别模型,得到游戏场景识别模型输出的游戏场景,提高了游戏场景识别的准确性。In this embodiment, considering that different types of games have different game screen characteristics, by entering the game type of the current game application and the game screenshot together into the game scene recognition model, the game scene output by the game scene recognition model is obtained, which improves the game scene recognition Accuracy.
同时,考虑到不同类型游戏对系统资源的不同需求,根据当前游戏应用的游戏类型以及当前所处的游戏场景,确定游戏场景对应的资源配置策略,提高了确定出的资源配置策略的准确性。At the same time, considering the different needs of different types of games for system resources, the resource configuration strategy corresponding to the game scenario is determined according to the current game application type and the current game scenario, which improves the accuracy of the determined resource configuration strategy.
本实施例中,终端操作系统在接收到目标游戏应用程序上报的场景信息时,对游戏画面进行截图,从而根据游戏截图和场景信息指示的游戏场景对游戏场景识别模型进行反向传播训练,以此提高游戏场景识别模型的识别准确性。In this embodiment, when receiving the scene information reported by the target game application, the terminal operating system takes a screenshot of the game screen, so that the game scene recognition model is back-propagated according to the game scene indicated by the game screenshot and the scene information, to This improves the recognition accuracy of the game scene recognition model.
本申请实施例还提供了一种计算机可读介质,该计算机可读介质存储有至少一条指令,所述至少一条指令由所述处理器加载并执行以实现如上各个实施例所述的资源配置方法。An embodiment of the present application further provides a computer-readable medium that stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the resource configuration method described in the foregoing embodiments .
本申请实施例还提供了一种计算机程序产品,该计算机程序产品存储有至少一条指令,所述至少一条指令由所述处理器加载并执行以实现如上各个实施例所述的资源配置方法。An embodiment of the present application further provides a computer program product that stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the resource configuration method described in the foregoing embodiments.
本领域技术人员应该可以意识到,在上述一个或多个示例中,本申请实施例所描述的功能可以用硬件、软件、固件或它们的任意组合来实现。当使用软件实现时,可以将这些功能存储在计算机可读介质中或者作为计算机可读介质上的一个或多个指令或代码进行传输。计算机可读介质包括计算机存储介质和通信介质,其中通信介质包括便于从一个地方向另一个地方传送计算机程序的任何介质。存储介质可以是通用或专用计算机能够存取的任何可用介质。Those skilled in the art should be aware that in one or more of the above examples, the functions described in the embodiments of the present application may be implemented by hardware, software, firmware, or any combination thereof. When implemented in software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or code on a computer-readable medium. Computer-readable media includes computer storage media and communication media, where communication media includes any medium that facilitates transfer of a computer program from one place to another. The storage medium may be any available medium that can be accessed by a general-purpose or special-purpose computer.
以上所述仅为本申请的较佳实施例,并不用以限制本申请,凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。The above are only preferred embodiments of this application and are not intended to limit this application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of this application should be included in the protection of this application Within range.

Claims (20)

  1. 一种资源配置方法,所述方法包括:A resource configuration method, the method includes:
    当运行游戏应用程序时,显示游戏画面;When running the game application, display the game screen;
    对所述游戏画面进行截图,得到游戏截图;Take a screenshot of the game screen to obtain a screenshot of the game;
    通过游戏场景识别模型对所述游戏截图进行识别,确定所述游戏画面对应的游戏场景,所述游戏场景用于指示所述游戏应用程序所处的运行阶段;Identifying the game screenshot through the game scene recognition model to determine the game scene corresponding to the game screen, where the game scene is used to indicate the running stage of the game application;
    确定所述游戏场景对应的资源配置策略;Determine a resource allocation strategy corresponding to the game scene;
    根据所述资源配置策略为所述游戏应用程序分配系统资源。Allocate system resources to the game application according to the resource configuration strategy.
  2. 根据权利要求1所述的方法,其中,所述通过游戏场景识别模型对所述游戏截图进行识别,确定所述游戏画面对应的游戏场景,包括:The method according to claim 1, wherein the identifying the game screenshot through the game scene recognition model to determine the game scene corresponding to the game screen includes:
    获取所述游戏应用程序对应的游戏类型;Obtain the game type corresponding to the game application;
    将所述游戏类型和所述游戏截图输入所述游戏场景识别模型,得到所述游戏场景识别模型输出的所述游戏场景;Input the game type and the game screenshot into the game scene recognition model to obtain the game scene output by the game scene recognition model;
    所述确定所述游戏场景对应的资源配置策略,包括:The determining the resource configuration strategy corresponding to the game scene includes:
    根据所述游戏类型以及所述游戏场景,确定所述游戏场景对应的所述资源配置策略;Determine the resource configuration strategy corresponding to the game scenario according to the game type and the game scenario;
    其中,所述游戏类型包括如下至少一种:第一人称射击游戏FPS、第三人称射击游戏TPS、多人在线战术竞技游戏MOBA、卡牌游戏、竞速游戏、音乐游戏、模拟经营游戏、冒险游戏AVG、格斗游戏FTG、角色扮演游戏RPG和沙盒游戏。Among them, the game types include at least one of the following: first-person shooter game FPS, third-person shooter game TPS, multiplayer online tactical competitive game MOBA, card game, racing game, music game, simulation management game, adventure game AVG , Fighting game FTG, role-playing game RPG and sandbox game.
  3. 根据权利要求2所述的方法,其中,所述确定所述游戏场景对应的资源配置策略之前,所述方法还包括:The method according to claim 2, wherein before determining the resource configuration strategy corresponding to the game scene, the method further comprises:
    获取当前剩余电量以及所述游戏应用程序的应用程序大小,所述应用程序大小用于指示所述游戏应用程序所占的存储空间;Acquiring the current remaining power and the application size of the game application, where the application size is used to indicate the storage space occupied by the game application;
    所述根据所述游戏类型以及所述游戏场景,确定所述游戏场景对应的所述资源配置策略,包括:The determining the resource configuration strategy corresponding to the game scenario according to the game type and the game scenario includes:
    将所述当前剩余电量、所述应用程序大小、所述游戏类型以及所述游戏场景输入资源配置模型,得到所述资源配置模型输出的所述资源配置策略。Input the current remaining power, the size of the application program, the game type, and the game scene into a resource configuration model to obtain the resource configuration strategy output by the resource configuration model.
  4. 根据权利要求3所述的方法,其中,所述资源配置模型是基于深度学习的神经网络模型,所述资源配置模型根据样本输入参数和样本输出参数训练得到,所述样本训练参数包括样本电量、样本应用程序大小、样本类型和样本游戏场景,所述样本输出参数包括样本资源配置策略。The method according to claim 3, wherein the resource configuration model is a neural network model based on deep learning, and the resource configuration model is trained based on sample input parameters and sample output parameters, and the sample training parameters include sample power, Sample application size, sample type, and sample game scenario, the sample output parameters include sample resource configuration strategies.
  5. 根据权利要求1至4任一所述的方法,其中,所述对所述游戏画面进行截图,得到游戏截图之前,所述方法还包括:The method according to any one of claims 1 to 4, wherein, before taking a screenshot of the game screen and before obtaining a screenshot of the game, the method further comprises:
    获取所述游戏应用程序的应用标识;Obtaining the application identification of the game application;
    检测所述应用标识是否属于预设游戏列表,所述预设游戏列表中包含目标游戏应用程序的标识,所述目标游戏应用程序在运行过程中通过与操作系统之间的数据通道向所述操作系统发送场景信息,所述操作系统用于根据所述场景信息指示的所述游戏场景确定所述资源配置策略;Detecting whether the application identifier belongs to a preset game list, and the preset game list includes an identifier of a target game application program, and the target game application program runs to the operation through a data channel with an operating system during operation The system sends scene information, and the operating system is used to determine the resource configuration strategy according to the game scene indicated by the scene information;
    若所述应用标识不属于所述预设游戏列表,则执行所述对游戏画面进行截图,得到游戏截图的步骤。If the application identifier does not belong to the preset game list, the step of taking a screenshot of the game screen to obtain a screenshot of the game is executed.
  6. 根据权利要求5所述的方法,其中,所述方法还包括:The method of claim 5, wherein the method further comprises:
    当接收到所述目标游戏应用程序发送的所述场景信息时,对所述目标游戏应用程序的当前游戏画面进行截图,得到样本游戏截图;When receiving the scene information sent by the target game application, take a screenshot of the current game screen of the target game application to obtain a sample game screenshot;
    根据所述场景信息指示的所述游戏场景以及所述样本游戏截图,通过反向传播算法对所述游戏场景识别模型进行训练。According to the game scene indicated by the scene information and the sample game screenshot, the game scene recognition model is trained through a back propagation algorithm.
  7. 根据权利要求5所述的方法,其中,所述对所述游戏画面进行截图,得到游戏截图,包括:The method according to claim 5, wherein the screenshot of the game screen to obtain a screenshot of the game includes:
    在所述游戏画面上层显示加速控件;Display acceleration controls on the upper layer of the game screen;
    当接收到对所述加速控件的触发信号时,对所述游戏画面进行截图,得到所述游戏截图。When receiving the trigger signal for the acceleration control, take a screenshot of the game screen to obtain the screenshot of the game.
  8. 根据权利要求5所述的方法,其中,所述根据所述资源配置策略为所述游戏应用程序分配系统资源之后,所述方法还包括:The method according to claim 5, wherein after allocating system resources to the game application according to the resource configuration strategy, the method further comprises:
    每隔预定时间间隔识别当前游戏画面对应的当前游戏场景;Identify the current game scene corresponding to the current game screen every predetermined time interval;
    若所述当前游戏场景发生变化,则重新确定所述当前游戏场景对应的所述资源配置策略。If the current game scene changes, the resource configuration strategy corresponding to the current game scene is re-determined.
  9. 根据权利要求1至4任一所述的方法,其中,The method according to any one of claims 1 to 4, wherein
    所述系统资源的资源类型包括中央处理器CPU资源、图形处理器GPU资源、磁盘资源、内存资源和网络资源中的至少一种。The resource types of the system resources include at least one of central processing unit CPU resources, graphics processor GPU resources, disk resources, memory resources, and network resources.
  10. 一种资源配置装置,所述装置包括:A resource configuration device, the device includes:
    显示模块,用于当运行游戏应用程序时,显示游戏画面;The display module is used to display the game screen when running the game application;
    截图模块,用于对所述游戏画面进行截图,得到游戏截图;A screenshot module, used to take a screenshot of the game screen to obtain a screenshot of the game;
    场景识别模块,用于通过游戏场景识别模型对所述游戏截图进行识别,确定所述游戏画面对应的游戏场景,所述游戏场景用于指示所述游戏应用程序所处的运行阶段;A scene recognition module, used to identify the game screenshot through the game scene recognition model, and determine the game scene corresponding to the game screen, where the game scene is used to indicate the running stage of the game application;
    策略确定模块,用于确定所述游戏场景对应的资源配置策略;A strategy determination module for determining a resource configuration strategy corresponding to the game scene;
    资源分配模块,用于根据所述资源配置策略为所述游戏应用程序分配系统资源。The resource allocation module is configured to allocate system resources to the game application according to the resource configuration strategy.
  11. 根据权利要求10所述的装置,其中,所述场景识别模块包括:The apparatus according to claim 10, wherein the scene recognition module comprises:
    类型获取单元,用于获取所述游戏应用程序对应的游戏类型;A type obtaining unit, configured to obtain a game type corresponding to the game application;
    场景预测单元,用于将所述游戏类型和所述游戏截图输入所述游戏场景识别模型,得到所述游戏场景识别模型输出的所述游戏场景;A scene prediction unit, configured to input the game type and the game screenshot into the game scene recognition model to obtain the game scene output by the game scene recognition model;
    所述策略确定模块,用于:The strategy determination module is used to:
    根据所述游戏类型以及所述游戏场景,确定所述游戏场景对应的所述资源配置策略;Determine the resource configuration strategy corresponding to the game scenario according to the game type and the game scenario;
    其中,所述游戏类型包括如下至少一种:FPS、TPS、MOBA、卡牌游戏、竞速游戏、音乐游戏、模拟经营游戏、AVG、FTG、RPG和沙盒游戏。Among them, the game types include at least one of the following: FPS, TPS, MOBA, card games, racing games, music games, simulation business games, AVG, FTG, RPG, and sandbox games.
  12. 根据权利要求11所述的装置,其中,所述装置还包括:The device according to claim 11, wherein the device further comprises:
    第一获取模块,用于获取当前剩余电量以及所述游戏应用程序的应用程序大小,所述应用程序大小用于指示所述游戏应用程序所占的存储空间;A first obtaining module, configured to obtain the current remaining power and the application size of the game application, and the application size is used to indicate the storage space occupied by the game application;
    所述策略确定模块,还用于:The strategy determination module is also used to:
    将所述当前剩余电量、所述应用程序大小、所述游戏类型以及所述游戏场景输入资源配置模型,得到所述资源配置模型输出的所述资源配置策略。Input the current remaining power, the size of the application program, the game type, and the game scene into a resource configuration model to obtain the resource configuration strategy output by the resource configuration model.
  13. 根据权利要求12所述的装置,其中,所述资源配置模型是基于深度学习的神经网络模型,所述资源配置模型根据样本输入参数和样本输出参数训练得到,所述样本训练参数包 括样本电量、样本应用程序大小、样本类型和样本游戏场景,所述样本输出参数包括样本资源配置策略。The apparatus according to claim 12, wherein the resource configuration model is a neural network model based on deep learning, and the resource configuration model is trained based on sample input parameters and sample output parameters, and the sample training parameters include sample power, Sample application size, sample type, and sample game scenario, the sample output parameters include sample resource configuration strategies.
  14. 根据权利要求10至13任一所述的装置,其中,所述装置还包括:The device according to any one of claims 10 to 13, wherein the device further comprises:
    第二获取模块,用于获取所述游戏应用程序的应用标识;A second obtaining module, configured to obtain the application identification of the game application program;
    检测模块,用于检测所述应用标识是否属于预设游戏列表,所述预设游戏列表中包含目标游戏应用程序的标识,所述目标游戏应用程序在运行过程中通过与操作系统之间的数据通道向所述操作系统发送场景信息,所述操作系统用于根据所述场景信息指示的所述游戏场景确定所述资源配置策略;The detection module is configured to detect whether the application identifier belongs to a preset game list, and the preset game list includes an identifier of a target game application, and the target game application passes data between the operating system during operation The channel sends scene information to the operating system, and the operating system is used to determine the resource configuration strategy according to the game scene indicated by the scene information;
    所述截图模块,用于若所述应用标识不属于所述预设游戏列表,则执行所述对游戏画面进行截图,得到游戏截图的步骤。The screenshot module is configured to execute the step of taking a screenshot of the game screen to obtain a screenshot of the game if the application identifier does not belong to the preset game list.
  15. 根据权利要求14所述的装置,其中,所述装置还包括:The device of claim 14, wherein the device further comprises:
    样本截图模块,用于当接收到所述目标游戏应用程序发送的所述场景信息时,对所述目标游戏应用程序的当前游戏画面进行截图,得到样本游戏截图;A sample screenshot module, configured to take a screenshot of the current game screen of the target game application when receiving the scene information sent by the target game application, to obtain a sample game screenshot;
    训练模块,用于根据所述场景信息指示的所述游戏场景以及所述样本游戏截图,通过反向传播算法对所述游戏场景识别模型进行训练。The training module is configured to train the game scene recognition model through a back propagation algorithm according to the game scene indicated by the scene information and the sample game screenshot.
  16. 根据权利要求14所述的装置,其中,所述截图模块,包括:The apparatus according to claim 14, wherein the screenshot module includes:
    控件显示单元,用于在所述游戏画面上层显示加速控件;A control display unit for displaying an acceleration control on the upper layer of the game screen;
    截图单元,用于当接收到对所述加速控件的触发信号时,对所述游戏画面进行截图,得到所述游戏截图。The screenshot unit is configured to take a screenshot of the game screen when the trigger signal for the acceleration control is received to obtain the screenshot of the game.
  17. 根据权利要求14所述的装置,其中,所述装置还包括:The device of claim 14, wherein the device further comprises:
    定时识别模块,用于每隔预定时间间隔识别当前游戏画面对应的当前游戏场景;The timing recognition module is used to identify the current game scene corresponding to the current game screen at predetermined time intervals;
    策略重置模块,用于若所述当前游戏场景发生变化,则重新确定所述当前游戏场景对应的所述资源配置策略。The strategy resetting module is used to re-determine the resource configuration strategy corresponding to the current game scene if the current game scene changes.
  18. 根据权利要求10至13任一所述的装置,其中,所述系统资源的资源类型包括CPU资源、GPU资源、磁盘资源、内存资源和网络资源中的至少一种。The apparatus according to any one of claims 10 to 13, wherein the resource types of the system resources include at least one of CPU resources, GPU resources, disk resources, memory resources, and network resources.
  19. 一种终端,所述终端包括处理器和存储器;所述存储器存储有至少一条指令,所述至少一条指令用于被所述处理器执行以实现如权利要求1至9任一所述的资源配置方法。A terminal includes a processor and a memory; the memory stores at least one instruction, the at least one instruction is used by the processor to implement the resource configuration according to any one of claims 1 to 9. method.
  20. 一种计算机可读存储介质,所述存储介质存储有至少一条指令,所述至少一条指令用于被处理器执行以实现如权利要求1至9任一所述的资源配置方法。A computer-readable storage medium storing at least one instruction, the at least one instruction being used by a processor to implement the resource configuration method according to any one of claims 1 to 9.
PCT/CN2019/109167 2018-11-30 2019-09-29 Resource allocation method and apparatus, terminal, and storage medium WO2020108085A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201811457185.3A CN109582463B (en) 2018-11-30 2018-11-30 Resource allocation method, device, terminal and storage medium
CN201811457185.3 2018-11-30

Publications (1)

Publication Number Publication Date
WO2020108085A1 true WO2020108085A1 (en) 2020-06-04

Family

ID=65926748

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/109167 WO2020108085A1 (en) 2018-11-30 2019-09-29 Resource allocation method and apparatus, terminal, and storage medium

Country Status (2)

Country Link
CN (1) CN109582463B (en)
WO (1) WO2020108085A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112348089A (en) * 2020-11-10 2021-02-09 中南民族大学 Working state identification method, server, storage medium and device
CN116027880A (en) * 2022-05-16 2023-04-28 荣耀终端有限公司 Resource scheduling method and electronic equipment

Families Citing this family (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109582463B (en) * 2018-11-30 2021-04-06 Oppo广东移动通信有限公司 Resource allocation method, device, terminal and storage medium
CN110377359A (en) * 2019-07-11 2019-10-25 努比亚技术有限公司 Game performance optimization method, mobile terminal and computer readable storage medium
CN110339567B (en) * 2019-07-17 2023-05-26 三星电子(中国)研发中心 System resource allocation and scene prediction model training method and device
CN110496387B (en) * 2019-08-23 2023-08-29 Oppo(重庆)智能科技有限公司 Game optimization method, game optimization device, mobile terminal and storage medium
CN110704191A (en) * 2019-09-29 2020-01-17 Oppo广东移动通信有限公司 Game optimization method, game optimization device and mobile terminal
CN112732434A (en) * 2019-10-28 2021-04-30 华为终端有限公司 Application management method and device
CN111111220B (en) * 2020-03-26 2020-07-07 腾讯科技(深圳)有限公司 Self-chess-playing model training method and device for multiplayer battle game and computer equipment
CN113556604B (en) * 2020-04-24 2023-07-18 深圳市万普拉斯科技有限公司 Sound effect adjusting method, device, computer equipment and storage medium
CN111760276B (en) * 2020-07-16 2022-06-14 腾讯科技(深圳)有限公司 Game behavior control method, device, terminal, server and storage medium
CN112130821B (en) * 2020-09-22 2024-04-09 北京冰封互娱科技有限公司 Game activity management method, device and storage medium
CN112494938B (en) * 2020-12-07 2024-01-12 北京达佳互联信息技术有限公司 Game resource distribution method, game resource distribution device, electronic equipment and storage medium
CN113209630B (en) * 2021-05-14 2022-09-30 上海完美时空软件有限公司 Frame grabbing defense method and device for game application, storage medium and computer equipment
CN113641488A (en) * 2021-07-07 2021-11-12 荣耀终端有限公司 Method and device for optimizing resources based on user use scene
CN113985999B (en) * 2021-10-27 2023-07-25 展讯通信(天津)有限公司 Device management method, device, electronic device and storage medium
CN114489422A (en) * 2022-01-26 2022-05-13 荣耀终端有限公司 Display method of sidebar and electronic equipment
CN114632329B (en) * 2022-05-16 2022-10-25 荣耀终端有限公司 Terminal equipment performance adjusting method and related device
CN114968602B (en) * 2022-08-01 2022-10-21 成都图影视讯科技有限公司 Architecture, method and apparatus for a dynamically resource-allocated neural network chip
CN116661584B (en) * 2022-10-11 2024-04-12 荣耀终端有限公司 Resource scheduling method and related equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104991775A (en) * 2015-07-03 2015-10-21 北京奇虎科技有限公司 Game acceleration method and apparatus
CN107613107A (en) * 2017-08-31 2018-01-19 广东欧珀移动通信有限公司 Resource allocation method and related product
CN107995357A (en) * 2017-11-15 2018-05-04 广东欧珀移动通信有限公司 Resource allocation method and device
CN109582463A (en) * 2018-11-30 2019-04-05 Oppo广东移动通信有限公司 Resource allocation method, device, terminal and storage medium

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6427902B2 (en) * 2014-03-17 2018-11-28 富士通株式会社 Extraction program, method, and apparatus
US10380222B2 (en) * 2016-10-17 2019-08-13 International Business Machines Corporation Matrix factorization with two-stage data block dispatch associated with graphics processing units
CN107577537A (en) * 2017-09-06 2018-01-12 广东欧珀移动通信有限公司 Resource allocation method and Related product
CN108628652B (en) * 2018-03-13 2023-02-28 Oppo广东移动通信有限公司 User interface rendering method and device and terminal
CN108540358B (en) * 2018-04-08 2021-09-21 努比亚技术有限公司 Control method of household appliance, mobile terminal and computer readable storage medium
CN108734002A (en) * 2018-05-16 2018-11-02 Oppo广东移动通信有限公司 Intelligent configuration method, device, storage medium and the mobile terminal of system resource
CN108764141B (en) * 2018-05-25 2021-07-02 广州虎牙信息科技有限公司 Game scene description method, device, equipment and storage medium thereof
CN108769821B (en) * 2018-05-25 2019-03-29 广州虎牙信息科技有限公司 Scene of game describes method, apparatus, equipment and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104991775A (en) * 2015-07-03 2015-10-21 北京奇虎科技有限公司 Game acceleration method and apparatus
CN107613107A (en) * 2017-08-31 2018-01-19 广东欧珀移动通信有限公司 Resource allocation method and related product
CN107995357A (en) * 2017-11-15 2018-05-04 广东欧珀移动通信有限公司 Resource allocation method and device
CN109582463A (en) * 2018-11-30 2019-04-05 Oppo广东移动通信有限公司 Resource allocation method, device, terminal and storage medium

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112348089A (en) * 2020-11-10 2021-02-09 中南民族大学 Working state identification method, server, storage medium and device
CN112348089B (en) * 2020-11-10 2024-01-16 中南民族大学 Working state identification method, server, storage medium and device
CN116027880A (en) * 2022-05-16 2023-04-28 荣耀终端有限公司 Resource scheduling method and electronic equipment
CN116027880B (en) * 2022-05-16 2023-11-24 荣耀终端有限公司 Resource scheduling method and electronic equipment

Also Published As

Publication number Publication date
CN109582463A (en) 2019-04-05
CN109582463B (en) 2021-04-06

Similar Documents

Publication Publication Date Title
WO2020108085A1 (en) Resource allocation method and apparatus, terminal, and storage medium
CN108762937B (en) Configuration information sending method, configuration information obtaining method, configuration information sending device, configuration information obtaining device and terminal
CN109032793B (en) Resource allocation method, device, terminal and storage medium
CN107861814B (en) Resource allocation method and equipment
CN108363593B (en) Application program preloading method and device, storage medium and terminal
CN109992315B (en) Touch screen control method and device, terminal and storage medium
CN109343902B (en) Audio processing assembly operation method and device, terminal and storage medium
CN109542614B (en) Resource allocation method, device, terminal and storage medium
WO2019024649A1 (en) Application program launching method, device, storage medium and terminal
CN110119727B (en) Fingerprint identification method, fingerprint identification device, terminal and storage medium
US11782756B2 (en) Method and apparatus for scheduling processor core, and storage medium
WO2019072208A1 (en) Application running control method and device
CN110955499B (en) Processor core configuration method, device, terminal and storage medium
CN113268212A (en) Screen projection method and device, storage medium and electronic equipment
CN109522131A (en) Resource allocation method, device and equipment
CN108989547B (en) Light emission control method, device, terminal and storage medium
CN111596971A (en) Application cleaning method and device, storage medium and electronic equipment
CN107450951B (en) Application processing method and device, storage medium and terminal
CN111918386B (en) Positioning method, positioning device, storage medium and electronic equipment
CN113286349B (en) Personal hot spot connection method, device, terminal and storage medium
CN107291543B (en) Application processing method and device, storage medium and terminal
CN112256354B (en) Application starting method and device, storage medium and electronic equipment
CN113692026B (en) Network connection method, device, terminal and storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19888360

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19888360

Country of ref document: EP

Kind code of ref document: A1