A method for resource allocation, applicable to a terminal with an operating system and a target application, the method comprising: sending (801, 903), by the target application, scene information to the operating system through a data channel established with the operating system, wherein the scene information is indicative of a running scene of the target application; acquiring, by the operating system, a target optimization configuration file corresponding to the scene information, wherein the target optimization configuration file contains optimization configuration information corresponding to different running time periods in the running scene, and the optimization configuration information is indicative of a manner for system resource allocation; acquiring, by the operating system, target optimization configuration information corresponding to a current running time period from the target optimization configuration file; and allocating (804, 911), by the operating system, system resources to the target application according to the target optimization configuration information; wherein the target application has an optimization configuration file generated by an optimization tool, and the optimization tool is used to allocate, in a same running scene of the target application, system resources to the target application according to resource configuration parameters corresponding to sub-scenes, wherein different sub-scenes correspond to different resource configuration parameters; for each sub-scene, a frame rate standard deviation of the target application and power consumption of the terminal are calculated in different running time periods; for each running time period, a sub-scene where the frame rate standard deviation is lower than a threshold and the terminal has a lowest power consumption is determined as a target sub-scene corresponding to the running time period; and the optimization configuration file corresponding to the running scene is generated according to the target sub-scene corresponding to each running time period. sending (801, 903), by the target application, scene information to the operating system through a data channel established with the operating system, wherein the scene information is indicative of a running scene of the target application; acquiring, by the operating system, a target optimization configuration file corresponding to the scene information, wherein the target optimization configuration file contains optimization configuration information corresponding to different running time periods in the running scene, and the optimization configuration information is indicative of a manner for system resource allocation; acquiring, by the operating system, target optimization configuration information corresponding to a current running time period from the target optimization configuration file; and allocating (804, 911), by the operating system, system resources to the target application according to the target optimization configuration information; wherein the target application has an optimization configuration file generated by an optimization tool, and the optimization tool is used to allocate, in a same running scene of the target application, system resources to the target application according to resource configuration parameters corresponding to sub-scenes, wherein different sub-scenes correspond to different resource configuration parameters; for each sub-scene, a frame rate standard deviation of the target application and power consumption of the terminal are calculated in different running time periods; for each running time period, a sub-scene where the frame rate standard deviation is lower than a threshold and the terminal has a lowest power consumption is determined as a target sub-scene corresponding to the running time period; and the optimization configuration file corresponding to the running scene is generated according to the target sub-scene corresponding to each running time period.