CN112083931A - Program processing method, device and equipment - Google Patents
Program processing method, device and equipment Download PDFInfo
- Publication number
- CN112083931A CN112083931A CN202010965658.1A CN202010965658A CN112083931A CN 112083931 A CN112083931 A CN 112083931A CN 202010965658 A CN202010965658 A CN 202010965658A CN 112083931 A CN112083931 A CN 112083931A
- Authority
- CN
- China
- Prior art keywords
- program
- code
- subprogram
- variable
- determining
- Prior art date
- Legal status (The legal status 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 status listed.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/40—Transformation of program code
- G06F8/41—Compilation
- G06F8/44—Encoding
- G06F8/443—Optimisation
Landscapes
- Engineering & Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
Abstract
本申请实施例提供一种程序处理方法、装置及设备,该方法包括:获取第一程序,所述第一程序中包括多个子程序;在所述第一程序中添加每个子程序对应的计时代码,得到第二程序;运行所述第二程序,并在所述第二程序运行的过程中,通过所述计时代码获取每个子程序对应的运行时长;根据每个子程序对应的运行时长,确定待优化的子程序。终端设备可以准确的确定需要优化的计算模块,进而提高计算模块的优化效率。
Embodiments of the present application provide a program processing method, device, and device. The method includes: acquiring a first program, where the first program includes a plurality of subprograms; adding a timing code corresponding to each subprogram in the first program , obtain the second program; run the second program, and during the running process of the second program, obtain the running duration corresponding to each subprogram through the timing code; Optimized subroutines. The terminal device can accurately determine the calculation module that needs to be optimized, thereby improving the optimization efficiency of the calculation module.
Description
技术领域technical field
本申请涉及计算机技术领域,尤其涉及一种程序处理方法、装置及设备。The present application relates to the field of computer technology, and in particular, to a program processing method, apparatus, and device.
背景技术Background technique
目前,可以使用计算程序进行科研计算。为了保证计算程序的计算效率,可以对计算模块进行优化。Currently, scientific calculations can be performed using computational programs. In order to ensure the calculation efficiency of the calculation program, the calculation module can be optimized.
在现有技术中,通常根据编程人员的经验对计算模块进行优化。编程人员根据计算模块的组成(例如计算模块中代码的数量),选择需要进行优化的计算模块。然而,这种方法需要编程人员的经验选择需要优化的计算模块,不同的编程人员选择需要优化的计算模块可能不同,因此无法准确的确定需要优化的计算模块,导致优化效率不高。In the prior art, the calculation module is usually optimized according to the experience of the programmer. The programmer selects the calculation module to be optimized according to the composition of the calculation module (eg, the number of codes in the calculation module). However, this method requires the experience of the programmer to select the calculation module to be optimized. Different programmers may choose different calculation modules to be optimized. Therefore, the calculation module to be optimized cannot be accurately determined, resulting in low optimization efficiency.
发明内容SUMMARY OF THE INVENTION
本申请提供一种程序处理方法、装置及设备。使得终端设备可以准确的确定需要优化的计算模块,进而提高计算模块的优化效率。The present application provides a program processing method, apparatus and device. The terminal device can accurately determine the calculation module to be optimized, thereby improving the optimization efficiency of the calculation module.
第一方面,本申请实施例提供一种程序处理方法,所述方法包括:In a first aspect, an embodiment of the present application provides a program processing method, the method comprising:
获取第一程序,所述第一程序中包括多个子程序;obtaining a first program, the first program includes a plurality of subprograms;
在所述第一程序中添加每个子程序对应的计时代码,得到第二程序;Add the timing code corresponding to each subroutine in the first program to obtain the second program;
运行所述第二程序,并在所述第二程序运行的过程中,通过所述计时代码获取每个子程序对应的运行时长;Running the second program, and in the process of running the second program, obtaining the running duration corresponding to each subprogram through the timing code;
根据每个子程序对应的运行时长,确定待优化的子程序。The subroutine to be optimized is determined according to the running time corresponding to each subroutine.
在一种可能的实施方式中,在所述第一程序中添加每个子程序对应的计时代码,得到第二程序,包括:In a possible implementation manner, a timing code corresponding to each subroutine is added to the first program to obtain a second program, including:
在所述第一程序中确定多个位置集合,所述位置集合中包括多个添加位置;determining a plurality of sets of locations in the first program, the set of locations including a plurality of addition locations;
确定每个添加位置对应的计时代码;Determine the timing code corresponding to each addition position;
分别在每个添加位置添加对应的计时代码。Add the corresponding timing code at each addition position.
在一种可能的实施方式中,所述位置集合包括:In a possible implementation, the location set includes:
子程序代码的起始位置;the starting position of the subroutine code;
子程序代码的结束位置;the end position of the subroutine code;
第一程序代码的结束位置。The end position of the first program code.
在一种可能的实施方式中所述计时代码包括:In a possible implementation, the timing code includes:
变量赋值代码;variable assignment code;
第一变量代码;first variable code;
第二变量代码;second variable code;
变量输出代码。Variable output code.
在一种可能的实施方式中,确定每个添加位置对应的计时代码,包括:In a possible implementation manner, determining the timing code corresponding to each adding position includes:
在所述添加位置为子程序代码的起始位置时,确定所述添加位置对应的计时代码是变量赋值代码和第一变量代码;或者,When the addition position is the starting position of the subroutine code, it is determined that the timing code corresponding to the addition position is the variable assignment code and the first variable code; or,
在所述添加位置为子程序代码的结束位置时,确定所述添加位置对应的计时代码是第二变量代码;或者,When the added position is the end position of the subroutine code, it is determined that the timing code corresponding to the added position is the second variable code; or,
在所述添加的位置为第一程序代码的结束位置时,确定所述添加位置对应的计时代码是变量输出代码。When the added position is the end position of the first program code, it is determined that the timing code corresponding to the added position is a variable output code.
在一种可能的实施方式中,根据每个子程序对应的运行时长,确定待优化的子程序,包括:In a possible implementation manner, the subroutine to be optimized is determined according to the corresponding running time of each subroutine, including:
将运行时长大于或等于第一阈值的子程序确定为所述待优化的子程序。A subroutine whose running duration is greater than or equal to the first threshold is determined as the subroutine to be optimized.
第二方面,本申请实施例提供一种程序处理装置,包括获取模块、添加模块、运行模块和确定模块,其中:In a second aspect, an embodiment of the present application provides a program processing apparatus, including an acquisition module, an addition module, an operation module, and a determination module, wherein:
所述获取模块用于,获取第一程序,所述第一程序中包括多个子程序;The obtaining module is used to obtain a first program, and the first program includes a plurality of subprograms;
所述添加模块用于,在所述第一程序中添加每个子程序对应的计时代码,得到第二程序;The adding module is used to add the timing code corresponding to each subprogram in the first program to obtain the second program;
所述运行模块用于,运行所述第二程序,并在所述第二程序运行的过程中,通过所述计时代码获取每个子程序对应的运行时长;The running module is configured to run the second program, and obtain the running duration corresponding to each subprogram through the timing code during the running of the second program;
所述确定模块用于,根据每个子程序对应的运行时长,确定待优化的子程序。The determining module is used for determining the subroutine to be optimized according to the running duration corresponding to each subroutine.
在一种可能的实施方式中,所述添加模块具体用于:In a possible implementation manner, the adding module is specifically used for:
在所述第一程序中确定多个位置集合,所述位置集合中包括多个添加位置;determining a plurality of sets of locations in the first program, the set of locations including a plurality of addition locations;
确定每个添加位置对应的计时代码;Determine the timing code corresponding to each addition position;
分别在每个添加位置添加对应的计时代码。Add the corresponding timing code at each addition position.
在一种可能的实施方式中,所述位置集合包括:In a possible implementation, the location set includes:
子程序代码的起始位置;the starting position of the subroutine code;
子程序代码的结束位置;the end position of the subroutine code;
第一程序代码的结束位置。The end position of the first program code.
在一种可能的实施方式中,所述计时代码包括:In a possible implementation, the timing code includes:
变量赋值代码;variable assignment code;
第一变量代码;first variable code;
第二变量代码;second variable code;
变量输出代码。Variable output code.
在一种可能的实施方式中,所述添加模块具体用于:In a possible implementation manner, the adding module is specifically used for:
在所述添加位置为子程序代码的起始位置时,确定所述添加位置对应的计时代码是变量赋值代码和第一变量代码;或者,When the addition position is the starting position of the subroutine code, it is determined that the timing code corresponding to the addition position is the variable assignment code and the first variable code; or,
在所述添加位置为子程序代码的结束位置时,确定所述添加位置对应的计时代码是第二变量代码;或者,When the added position is the end position of the subroutine code, it is determined that the timing code corresponding to the added position is the second variable code; or,
在所述添加的位置为第一程序代码的结束位置时,确定所述添加位置对应的计时代码是变量输出代码。When the added position is the end position of the first program code, it is determined that the timing code corresponding to the added position is a variable output code.
在一种可能的实施方式中,所述确定模块具体用于:In a possible implementation manner, the determining module is specifically used for:
将运行时长大于或等于第一阈值的子程序确定为所述待优化的子程序。A subroutine whose running duration is greater than or equal to the first threshold is determined as the subroutine to be optimized.
第三方面,本申请实施例提供一种程序处理设备,包括:存储器、处理器和通信接口,所述存储器用于存储程序指令,所述处理器用于调用存储器中的程序指令执行如第一方面任一项所述的程序处理方法。In a third aspect, an embodiment of the present application provides a program processing device, including: a memory, a processor, and a communication interface, where the memory is used for storing program instructions, and the processor is used for calling the program instructions in the memory to execute the execution as in the first aspect The program processing method of any one.
第四方面,本申请实施例提供一种可读存储介质,所述可读存储介质上存储有计算机程序;所述计算机程序用于实现如第一方面任一项所述的程序处理方法。In a fourth aspect, an embodiment of the present application provides a readable storage medium, where a computer program is stored on the readable storage medium; the computer program is used to implement the program processing method according to any one of the first aspect.
本申请实施例提供的一种程序处理方法、装置及设备,先获取第一程序,其中,第一程序中包括多个子程序,在第一程序中添加每个子程序对应的计时代码,得到第二程序;运行第二程序,并在第二程序运行的过程中,通过计时代码获取每个子程序对应的运行时长;根据每个子程序对应的运行时长,确定待优化的子程序。由于第二程序中的每个子程序添加了对应的计时代码,当终端设备运行第二程序时,计时代码可以获取每个子程序的运行时长,用户可以根据每个子程序的运行时长确定待优化的子程序,使得终端设备可以准确的确定需要优化的计算模块,进而提高计算模块的优化效率。In a program processing method, device, and device provided by the embodiments of the present application, a first program is obtained first, wherein the first program includes a plurality of subprograms, and a timing code corresponding to each subprogram is added to the first program to obtain a second program. program; run the second program, and during the running of the second program, obtain the running duration corresponding to each subroutine through the timing code; determine the subroutine to be optimized according to the running duration corresponding to each subroutine. Since the corresponding timing code is added to each subroutine in the second program, when the terminal device runs the second program, the timing code can obtain the running duration of each subroutine, and the user can determine the subroutine to be optimized according to the running duration of each subroutine. The program enables the terminal device to accurately determine the calculation module that needs to be optimized, thereby improving the optimization efficiency of the calculation module.
附图说明Description of drawings
图1为本申请实施例提供的一种应用场景下的终端界面示意图;FIG. 1 is a schematic diagram of a terminal interface in an application scenario provided by an embodiment of the present application;
图2为本申请实施例提供的一种程序处理方法的的流程示意图;2 is a schematic flowchart of a program processing method provided by an embodiment of the present application;
图3为本申请实施例提供的另一种程序处理方法的流程示意图;3 is a schematic flowchart of another program processing method provided by an embodiment of the present application;
图4为本申请实施例提供的一种程序处理装置的结构示意图;FIG. 4 is a schematic structural diagram of a program processing apparatus provided by an embodiment of the present application;
图5为本申请实施例提供的程序处理设备的硬件结构示意图。FIG. 5 is a schematic diagram of a hardware structure of a program processing device provided by an embodiment of the present application.
具体实施方式Detailed ways
这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本公开相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本公开的一些方面相一致的装置和方法的例子。Exemplary embodiments will be described in detail herein, examples of which are illustrated in the accompanying drawings. Where the following description refers to the drawings, the same numerals in different drawings refer to the same or similar elements unless otherwise indicated. The implementations described in the illustrative examples below are not intended to represent all implementations consistent with this disclosure. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present disclosure as recited in the appended claims.
本申请的说明书和权利要求书及所述附图中的术语“包括”和“具有”以及它们任何变形,意图在于覆盖不排他的包含。例如包含了一系列步骤或单元的过程、方法、系统、产品或设备没有限定于已列出的步骤或单元,而是可选地还包括没有列出的步骤或单元,或可选地还包括对于这些过程、方法、产品或设备固有的其它步骤或单元。The terms "comprising" and "having", and any variations thereof, in the description and claims of this application and said drawings are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device comprising a series of steps or units is not limited to the listed steps or units, but optionally also includes unlisted steps or units, or optionally also includes For other steps or units inherent to these processes, methods, products or devices.
为了便于理解,下面,以终端设备为计算机为例,对本申请所适用的应用场景进行说明。For ease of understanding, the following describes an application scenario applicable to the present application by taking the terminal device as a computer as an example.
图1为本申请实施例提供的一种应用场景下的终端界面示意图。请参见图1,终端设备101为计算机,终端界面包括界面102、界面103和界面104。FIG. 1 is a schematic diagram of a terminal interface in an application scenario provided by an embodiment of the present application. Referring to FIG. 1 , the terminal device 101 is a computer, and the terminal interface includes an
请参见界面102,包括第一程序、计时代码和添加图标。其中,第一程序中包括多个子程序,例如,第一程序可以为WRF模式(The Weather Research and Forecasting Model,天气预报模式),WRF模式中包括辐射过程模块、路面过程模块、行星边界层过程模块和积云过程模块,每个模块都属于WRF模式中的子程序。计时代码可以包括变量赋值代码、第一变量代码、第二变量代码和变量输出代码。假设用户需要获取第一程序中每个子程序的运行时间,则用户可以对“添加”图标进行点击操作,以使终端设备101显示界面103。See
请参见界面103,包括第二程序和运行图标。其中,第二程序中包括多个子程序和多个计时代码。用户点击界面102中的“添加”图标时,终端设备101可以通过本申请所示的程序处理方法对第一程序进行处理,得到第二程序。例如,终端设备可以在第一程序中的每个子程序的添加位置中添加对应的计时代码,得到第二程序。假设用户需要获取第一程序中每个子程序的运行时间,则用户可以对“运行”图标进行点击操作,以使终端设备101显示界面104。Please refer to the
请参加界面104,包括子程序的运行时间。用户点击界面103中的“运行”图标时,界面104可以显示第一程序中每个子程序的运行时间。终端设备101可以根据每个子程序的运行时间,选择需要进行优化的子程序。Please participate in
在本申请中,终端设备可以获取第一程序,其中,第一程序中包括多个子程序,在第一程序中添加每个子程序对应的计时代码,得到第二程序;运行第二程序,并在第二程序运行的过程中,通过计时代码获取每个子程序对应的运行时长;根据每个子程序对应的运行时长,确定待优化的子程序。由于第二程序中的每个子程序添加了对应的计时代码,当终端设备运行第二程序时,计时代码可以获取每个子程序的运行时长,用户可以根据每个子程序的运行时长确定待优化的子程序,使得终端设备可以准确的确定需要优化的计算模块,进而提高计算模块的优化效率。In the present application, the terminal device can obtain the first program, wherein the first program includes multiple subprograms, add the timing code corresponding to each subprogram in the first program to obtain the second program; run the second program, and in During the running of the second program, the running duration corresponding to each subroutine is obtained through the timing code; the subroutine to be optimized is determined according to the running duration corresponding to each subroutine. Since the corresponding timing code is added to each subroutine in the second program, when the terminal device runs the second program, the timing code can obtain the running duration of each subroutine, and the user can determine the subroutine to be optimized according to the running duration of each subroutine. The program enables the terminal device to accurately determine the calculation module that needs to be optimized, thereby improving the optimization efficiency of the calculation module.
下面,通过具体实施例对本申请所示的方法进行说明。需要说明的是,下面几个实施例可以单独存在,也可以互相结合,对于相同或相似的内容,在不同的实施例中不再重复说明。Hereinafter, the method shown in the present application will be described through specific examples. It should be noted that the following embodiments may exist independently or may be combined with each other, and the same or similar content will not be repeated in different embodiments.
图2为本申请实施例提供的一种程序处理方法的的流程示意图。请参见图2,包括:FIG. 2 is a schematic flowchart of a program processing method provided by an embodiment of the present application. See Figure 2, including:
S201、获取第一程序。S201. Obtain a first program.
本申请实施例的执行主体可以为电子设备,也可以为设置在电子设备中的程序处理装置。电子设备可以为电脑、服务器等设备。电子设备可以为便携式电子设备。例如,电子设备可以为手机、平板电脑等。程序处理装置可以通过软件实现,也可以通过软件和硬件的结合实现。The execution body of the embodiment of the present application may be an electronic device, or may be a program processing apparatus provided in the electronic device. The electronic device may be a computer, a server or the like. The electronic device may be a portable electronic device. For example, the electronic device may be a mobile phone, a tablet computer, or the like. The program processing device can be realized by software, or can be realized by a combination of software and hardware.
第一程序可以包括应用程序、数值计算程序、控制器的驱动程序等。例如,第一程序可以包括WRF模式、需要进行大量计算的数值模式。The first program may include an application program, a numerical calculation program, a driver program of a controller, and the like. For example, the first program may include a WRF mode, a numerical mode that requires extensive computation.
可选的,第一程序中包括多个子程序。例如,WRF模式中包括物理模块和化学模块,其中,物理模块包括辐射过程模块、路面过程模块、行星边界层过程模块和积云过程模块,每一个物理模块都属于WRF模式中的子程序。Optionally, the first program includes multiple subprograms. For example, the WRF mode includes a physics module and a chemistry module, wherein the physics module includes a radiation process module, a road surface process module, a planetary boundary layer process module, and a cumulus process module, and each physics module belongs to the subroutine in the WRF mode.
可选的,可以通过如下可行的方式获取第一程序:可以根据程序的运行时间获取第一程序。例如,根据预设的时间阈值获取第一程序,若程序的运行时间大于或等于预设的时间阈值,可以将该程序确定为第一程序,对其进行优化;若程序的运行时间小于预设的时间阈值,可以将该程序确定为不需要优化的程序。Optionally, the first program may be acquired in the following feasible manner: the first program may be acquired according to the running time of the program. For example, the first program is obtained according to a preset time threshold, and if the running time of the program is greater than or equal to the preset time threshold, the program can be determined as the first program and optimized; if the running time of the program is less than the preset time threshold The time threshold of the program can be determined as a program that does not need optimization.
可选的,可以通过如下可行的方式获取第一程序:可以根据用户的计算需求获取第一程序。例如,根据预设的计算需求阈值获取第一程序,在气象业务领域中,若气象业务对计算能力的需求大于或等于预设的计算需求,可以将计算气象业务的程序确定为第一程序,对其进行优化;若气象业务对计算能力的需求小于预设的计算需求,则无需对计算气象业务的程序进行优化。Optionally, the first program may be acquired in the following feasible manner: the first program may be acquired according to the user's computing requirements. For example, the first program is obtained according to a preset computing demand threshold. In the field of meteorological services, if the computing power demand of meteorological services is greater than or equal to the preset computing demand, the program for computing meteorological services may be determined as the first program, Optimizing it; if the computing power requirement of the meteorological service is less than the preset computing requirement, there is no need to optimize the program for computing the meteorological service.
S202、在第一程序中添加每个子程序对应的计时代码,得到第二程序。S202 , adding a timing code corresponding to each subroutine in the first program to obtain a second program.
计时代码可以包括变量赋值代码、第一变量代码、第二变量代码和变量输出代码。The timing codes may include variable assignment codes, first variable codes, second variable codes, and variable output codes.
可选的,可以使用第一程序外部的计时器代码。例如,可以编辑计时器代码。Optionally, timer code external to the first program can be used. For example, the timer code can be edited.
变量赋值代码用于对时间变量进行赋值。例如,WRF模式中,获取辐射过程模块的运行时间之前,可以对辐射过程模块的时间变量赋值,若为第一次运行辐射过程模块,可以对时间变量赋值为0,若为第二次运行辐射过程模块,可以对时间变量赋值为辐射过程模块第一次运行的时间。这样可以获取WRF模式中所有辐射过程模块的总运行时间。Variable assignment codes are used to assign values to time variables. For example, in WRF mode, before obtaining the running time of the radiation process module, the time variable of the radiation process module can be assigned a value. If the radiation process module is run for the first time, the time variable can be assigned a value of 0. If the radiation process module is run for the second time, the time variable can be assigned a value of 0. Process modules, the time variable can be assigned the time when the radiation process module first ran. This gives the total runtime of all radiation process modules in WRF mode.
第一变量代码用于获取系统时间。例如,在程序代码的第一行添加第一变量代码,当程序运行时,第一时间变量代码可以获取程序开始运行时的系统时间。The first variable code is used to obtain the system time. For example, adding the first variable code in the first line of the program code, when the program runs, the first time variable code can obtain the system time when the program starts to run.
第二变量代码用于获取系统时间差。其中,系统时间差可以为第二变量获取的系统时间与第一变量获取的系统时间的差值。例如,第二变量代码可以为获取当前系统时间与第一变量代码获取的系统时间的差值。The second variable code is used to obtain the system time difference. The system time difference may be the difference between the system time obtained by the second variable and the system time obtained by the first variable. For example, the second variable code may be the difference between the current system time and the system time obtained by the first variable code.
可选的,获取系统时间代码可以包括计时器代码,例如,计时器代码可以包括秒表计时器代码和当前系统时间的代码。Optionally, acquiring the system time code may include a timer code, for example, the timer code may include a stopwatch timer code and a code of the current system time.
可选的,可以根据第一程序确定计时器代码。例如,在WRF模式中,WRF代码的程序中包含一个RSL_INTERNAL_MICROCLOCK()函数,其主要作用是获取操作系统当前时刻,可以将其作为计时器代码。Optionally, the timer code may be determined according to the first program. For example, in the WRF mode, the program of the WRF code contains a RSL_INTERNAL_MICROCLOCK() function, whose main function is to obtain the current moment of the operating system, which can be used as a timer code.
变量输出代码用于输出赋值的时间变量。例如,第二时间变量代码获取到系统的时间差可以为赋值的时间变量,变量输出代码可以输出赋值的时间变量,即为输出系统的时间差。The variable output code is used to output the assigned time variable. For example, the time difference obtained by the second time variable code to the system may be the assigned time variable, and the variable output code may output the assigned time variable, that is, the time difference of the output system.
第二程序可以包括添加计时代码后的子程序。例如,WRF模式中,子程序可以为物理模块中的行星边界层过程模块,在行星边界层过程模块中添加计时代码后,可以得到行星边界层过程模块的第二程序。The second program may include a subroutine after adding the timing code. For example, in the WRF mode, the subroutine can be the planetary boundary layer process module in the physics module. After adding the timing code to the planetary boundary layer process module, the second program of the planetary boundary layer process module can be obtained.
可选的,可以根据如下可行的方式在第一程序中的每个子程序中添加计时代码:在第一程序中确定多个位置集合,位置集合中包括多个添加位置,确定每个添加位置对应的计时代码,分别在每个添加位置添加对应的计时代码。Optionally, a timing code can be added to each subprogram in the first program according to the following feasible methods: in the first program, multiple location sets are determined, the location sets include multiple addition locations, and it is determined that each addition location corresponds to , add the corresponding timing code in each addition position.
其中,位置集合中包括多个添加位置,添加位置用于指示计时代码的添加位置。例如,添加位置可以为子程序代码的起始位置、子程序代码的结束位置等。Wherein, the position set includes a plurality of addition positions, and the addition positions are used to indicate the addition positions of the timing codes. For example, the addition position may be the start position of the subroutine code, the end position of the subroutine code, and the like.
位置集合可以包括:子程序代码的起始位置、子程序代码的结束位置和第一程序代码的结束位置。例如WRF模式中包括两个辐射过程模块,那么辐射过程的计时代码的添加位置可以包括:WRF模式代码的结束位置、辐射过程模块代码的起始位置和辐射过程模块代码的结束位置。The set of locations may include a start location of the subprogram code, an end location of the subprogram code, and an end location of the first program code. For example, the WRF mode includes two radiation process modules, then the addition positions of the timing codes of the radiation process may include: the end position of the WRF mode code, the start position of the radiation process module code, and the end position of the radiation process module code.
可选的,可以根据每个添加位置确定对应的计时代码。例如,WRF模式中包括两个辐射过程模块,WRF模式代码的结束位置可以添加变量输出代码,辐射过程模块代码的起始位置可以添加变量赋值代码和第一变量代码,辐射过程模块代码的结束位置可以添加第二变量代码。Optionally, the corresponding timing code may be determined according to each addition position. For example, the WRF mode includes two radiation process modules, the end position of the WRF mode code can add the variable output code, the start position of the radiation process module code can add the variable assignment code and the first variable code, and the end position of the radiation process module code can be added A second variable code can be added.
可选的,可以分别在第一程序中的每个添加位置添加对应的计时代码,得到第二程序。例如,在WRF模式中每个添加位置添加对应的计时代码,可以得到WRF模式对应的第二程序。Optionally, a corresponding timing code may be added to each addition position in the first program to obtain the second program. For example, by adding a corresponding timing code to each addition position in the WRF mode, the second program corresponding to the WRF mode can be obtained.
S203、运行第二程序,并在第二程序运行的过程中,通过计时代码获取每个子程序对应的运行时长。S203. Run the second program, and obtain the running duration corresponding to each subprogram through the timing code during the running of the second program.
在第一程序中的每个添加位置添加对应的计时代码,得到第二程序,第二程序运行的过程中,计时代码可以获取到每个子程序对应的运行时长。A corresponding timing code is added to each addition position in the first program to obtain the second program. During the running of the second program, the timing code can obtain the running duration corresponding to each subroutine.
可选的,第二程序运行时,每个子程序的起始位置和结束位置都添加有对应的计时代码。Optionally, when the second program is running, a corresponding timing code is added to the start position and the end position of each subprogram.
运行第二程序时,计时代码也会运行,计时代码会输出每个子程序的运行时长。例如,WRF模式中,辐射过程模块的起始位置添加变量赋值代码和第一变量代码,变量赋值代码可以对第一次运行的辐射过程模块的时间变量赋值为0,第二次运行的辐射过程模块的时间变量赋值为上一次辐射过程模块运行的时间变量,第一变量代码可以获取到辐射过程开始运行时的系统时间;辐射过程模块的结束位置添加第二变量代码,当辐射过程模块运行结束时,第二变量代码可以获取当前系统时间与辐射过程模块开始运行时的时间差,进而获取辐射过程模块的运行时间;WRF模式的结束位置添加变量输出代码,变量输出代码可以输出辐射过程模块运行的总时间。When running the second program, the timing code will also run, and the timing code will output the running time of each subroutine. For example, in the WRF mode, the variable assignment code and the first variable code are added to the starting position of the radiation process module. The variable assignment code can assign a value of 0 to the time variable of the radiation process module in the first run, and the radiation process in the second run. The time variable of the module is assigned the time variable of the last radiation process module operation, and the first variable code can obtain the system time when the radiation process starts to run; the second variable code is added to the end position of the radiation process module, and when the radiation process module finishes running , the second variable code can obtain the time difference between the current system time and the start of the radiation process module, and then obtain the running time of the radiation process module; add a variable output code at the end of the WRF mode, and the variable output code can output the running time of the radiation process module. total time.
S204、根据每个子程序对应的运行时长,确定待优化的子程序。S204: Determine the subprogram to be optimized according to the running time length corresponding to each subprogram.
可选的,可以将运行时长最长的子程序确定为待优化的子程序。例如,WRF模式中,辐射过程模块的运行时间为10秒、陆面过程模块的运行时间为7秒、行星边界层过程模块的运行时间为6秒、积云过程模块的运行时间为4秒,可以将辐射过程模块作为WRF模式中待优化的子程序。Optionally, the subprogram with the longest running time may be determined as the subprogram to be optimized. For example, in WRF mode, the runtime of the Radiation Process Module is 10 seconds, the Land Surface Process Module is 7 seconds, the Planetary Boundary Layer Process Module is 6 seconds, and the Cumulus Process Module is 4 seconds. The Radiation Process Module can be used as a subroutine to be optimized in the WRF mode.
可选的,可以将运行时长大于或等于第一阈值的子程序确定为所述待优化的子程序。例如,若第一阈值为10秒钟,若运行第二程序后,输出子程序的运行时长大于或等于10秒钟,则该子程序为待优化的子程序,若输出子程序的运行时长小于10秒钟,则该子程序为不需优化的子程序。Optionally, a subprogram whose running duration is greater than or equal to the first threshold may be determined as the subprogram to be optimized. For example, if the first threshold is 10 seconds, if the running duration of the output subroutine is greater than or equal to 10 seconds after running the second program, the subroutine is the subroutine to be optimized, and if the running duration of the output subroutine is less than or equal to 10 seconds 10 seconds, the subroutine is a subroutine that does not need to be optimized.
可选的,可以多次运行第二程序,获取多个子程序的总运行时长,取其平均值作为子程序的总运行时长。例如,WRF模式中,多次获取辐射过程模块的总运行时长,取其平均值作为辐射过程模块的总运行时长。Optionally, the second program may be run multiple times to obtain the total running time of the multiple subprograms, and the average value is taken as the total running time of the subprograms. For example, in the WRF mode, the total running time of the radiation process module is obtained multiple times, and the average value is taken as the total running time of the radiation process module.
在本申请中,终端设备可以获取第一程序,其中,第一程序中包括多个子程序。终端设备在第一程序中添加每个子程序对应的计时代码,得到第二程序。终端设备运行第二程序,并在第二程序运行的过程中,通过计时代码获取每个子程序对应的运行时长。根据每个子程序对应的运行时长,确定待优化的子程序。由于第二程序中的每个子程序添加了对应的计时代码,当终端设备运行第二程序时,计时代码可以获取每个子程序的运行时长,用户可以根据每个子程序的运行时长确定待优化的子程序,使得终端设备可以准确的确定需要优化的计算模块,进而提高计算模块的优化效率。In this application, the terminal device may acquire the first program, where the first program includes multiple subprograms. The terminal device adds the timing code corresponding to each subprogram in the first program to obtain the second program. The terminal device runs the second program, and in the process of running the second program, obtains the running duration corresponding to each subprogram through the timing code. The subroutine to be optimized is determined according to the running time corresponding to each subroutine. Since the corresponding timing code is added to each subroutine in the second program, when the terminal device runs the second program, the timing code can obtain the running duration of each subroutine, and the user can determine the subroutine to be optimized according to the running duration of each subroutine. The program enables the terminal device to accurately determine the calculation module that needs to be optimized, thereby improving the optimization efficiency of the calculation module.
在上述任意一个实施例的基础上,下面,结合图3,对上述程序处理方法进行详细说明。On the basis of any one of the foregoing embodiments, the foregoing program processing method will be described in detail below with reference to FIG. 3 .
图3为本申请实施例提供的另一种程序处理方法的流程示意图。请参见图3,该方法可以包括:FIG. 3 is a schematic flowchart of another program processing method provided by an embodiment of the present application. Referring to Figure 3, the method can include:
S301、获取第一程序,确定第一程序的结构。S301. Acquire a first program, and determine the structure of the first program.
第一程序可以包括应用程序、数值计算程序、控制器的驱动程序等。例如,第一程序可以包括WRF模式、需要进行大量计算的数值模式。The first program may include an application program, a numerical calculation program, a driver program of a controller, and the like. For example, the first program may include a WRF mode, a numerical mode that requires extensive computation.
第一程序中包括多个子程序。例如,应用程序中包括多个功能不同的子程序。The first program includes a plurality of subroutines. For example, an application includes multiple subroutines with different functions.
可选的,第一程序可以为终端设备中的本地程序(例如,终端设备中的系统程序),也可以为网络中的程序。Optionally, the first program may be a local program in the terminal device (for example, a system program in the terminal device), or may be a program in the network.
第一程序的结构可以为第一程序中子程序的调用位置、子程序的函数名和子程序的调用顺序。子程序的调用位置可以为子程序运行时调用子程序的地址。子程序的函数名可以为子程序运行时调用的函数名称。子程序的调用顺序用于指示调用子程序的优先级。例如,WRF模式中,物理过程都以Fortran语言中的子函数形式存在。根据WRF模式的结构,可以得知主要的物理过程在WRF代码子目录dyn_em下module_first_rk_step_part1.F程序中被调用。调用的顺序为辐射过程(函数名为radiation_driver())、陆面过程(函数名为surface_driver())、行星边界层过程(函数名为pbl_driver())和积云过程(函数名为cumulus_driver())。The structure of the first program may be the calling position of the subprogram in the first program, the function name of the subprogram, and the calling sequence of the subprogram. The calling location of the subprogram can be the address of the calling subprogram when the subprogram is running. The function name of the subprogram can be the name of the function called when the subprogram runs. The calling sequence of subroutines is used to indicate the priority of calling subroutines. For example, in the WRF mode, the physical processes all exist in the form of subfunctions in the Fortran language. According to the structure of the WRF mode, it can be known that the main physical process is called in the module_first_rk_step_part1.F program under the WRF code subdirectory dyn_em. The order of calls is the radiation process (the function name is radiation_driver()), the land surface process (the function name is surface_driver()), the planetary boundary layer process (the function name is pbl_driver()), and the cumulus process (the function name is cumulus_driver()) ).
S302、根据第一程序的结构,确定第一程序中的添加位置。S302. Determine the addition position in the first program according to the structure of the first program.
可选的,可以根据第一程序的结构,获取每个子程序的调用位置,根据每个子程序的调用位置,确定第一程序中的添加位置。例如,WRF模式中,物理过程在WRF代码子目录dyn_em下module_first_rk_step_part1.F程序中被调用,可以在该目录下获取物理过程中的添加位置。Optionally, the calling position of each subprogram may be obtained according to the structure of the first program, and the adding position in the first program may be determined according to the calling position of each subprogram. For example, in WRF mode, the physical process is called in the module_first_rk_step_part1.F program in the WRF code subdirectory dyn_em, and the addition location of the physical process can be obtained in this directory.
可选的,终端设备可以根据每个子程序的代码获取子程序代码的起始位置和结束位置。Optionally, the terminal device may obtain the start position and end position of the subprogram code according to the code of each subprogram.
S303、根据添加位置与计时代码的对应关系,在第一程序中添加每个子程序对应的计时代码,得到第二程序。S303. According to the corresponding relationship between the adding position and the timing code, add the timing code corresponding to each subroutine in the first program to obtain the second program.
对应关系用于指示添加位置与计时代码之间的关系,例如,对应关系可以如表1所示:The corresponding relationship is used to indicate the relationship between the addition position and the timing code, for example, the corresponding relationship can be as shown in Table 1:
表1Table 1
在表1中每一个添加位置都有对应的计时代码,需要说明的是,表1只是以示例的形式示意对应关系,并非对对应关系的限定。In Table 1, each addition position has a corresponding timing code. It should be noted that Table 1 only shows the corresponding relationship in the form of an example, and does not limit the corresponding relationship.
例如,在添加位置为子程序代码的起始位置时,确定添加位置对应的计时代码是变量赋值代码和第一变量代码;在添加位置为子程序代码的结束位置时,确定添加位置对应的计时代码是第二变量代码;在所述添加的位置为第一程序代码的结束位置时,确定添加位置对应的计时代码是变量输出代码。For example, when the addition position is the start position of the subroutine code, determine that the timing code corresponding to the addition position is the variable assignment code and the first variable code; when the addition position is the end position of the subroutine code, determine the timing code corresponding to the addition position The code is the second variable code; when the added position is the end position of the first program code, it is determined that the timing code corresponding to the added position is the variable output code.
可选的,变量赋值代码的添加位置在第一变量代码的添加位置之前,变量赋值代码可以对第一次运行的辐射过程模块的时间变量赋值为0,第二次运行的辐射过程模块的时间变量赋值为上一次辐射过程模块运行的时间变量。这样当第二程序运行结束时,根据变量赋值代码,可以获取同一功能子程序的总运行时间。例如,在WRF模式中,通过变量赋值代码,可以获取WRF模式中所有辐射过程模块的运行总时长。Optionally, the addition position of the variable assignment code is before the addition position of the first variable code, and the variable assignment code can assign a value of 0 to the time variable of the radiation process module in the first run, and the time of the radiation process module in the second run. The variable is assigned the time variable of the last radiation process module run. In this way, when the second program finishes running, the total running time of the same function subroutine can be obtained according to the variable assignment code. For example, in WRF mode, the total running time of all radiation process modules in WRF mode can be obtained through variable assignment codes.
可选的,变量输出代码可以添加在最后一个子程序的结束位置。例如,WRF模式中,变量输出代码可以添加在最后一个辐射过程模块的结束位置,当所有的辐射过程模块运行结束后,变量输出代码即可输出所有辐射过程模块的总运行时长。Optionally, variable output code can be added at the end of the last subroutine. For example, in WRF mode, the variable output code can be added at the end of the last radiation process module. When all radiation process modules have finished running, the variable output code can output the total running time of all radiation process modules.
S304、运行第二程序,通过计时代码获取每个子程序对应的运行时长。S304. Run the second program, and obtain the running duration corresponding to each subprogram through the timing code.
下面以WRF模式为例,详细说明通过计时代码获取每个子程序对应的运行时长的过程。The following takes the WRF mode as an example to describe in detail the process of obtaining the running duration corresponding to each subroutine through the timing code.
可选的,WRF模式中的物理过程包括辐射过程、陆面过程、行星边界层过程和积云过程,以辐射过程为例。Optionally, the physical processes in the WRF model include radiation processes, land surface processes, planetary boundary layer processes and cumulus processes, taking radiation processes as an example.
根据WRF模式的结构可以确定辐射过程在在WRF代码子目录dyn_em下module_first_rk_step_part1.F程序中被调用,函数名为radiation_driver(),辐射过程的优先级高于陆面过程、行星边界层过程和积云过程。According to the structure of the WRF model, it can be determined that the radiation process is called in the module_first_rk_step_part1.F program under the WRF code subdirectory dyn_em. The function name is radiation_driver(), and the radiation process has a higher priority than the land surface process, planetary boundary layer process and cumulus clouds. process.
可选的,选用WRF模式中的RSL_INTERNAL_MICROCLOCK()函数作为获取系统当前时刻的函数。Optionally, the RSL_INTERNAL_MICROCLOCK() function in the WRF mode is selected as the function for obtaining the current moment of the system.
在辐射过程模块的起始位置添加如下代码:Add the following code at the beginning of the Radiation Process Module:
BENCH_DECL(rad_driver_tim)rad_driver_tim=0BENCH_DECL(rad_driver_tim)rad_driver_tim=0
对辐射过程模块的时间变量赋值为0,然后添加代码:Assign a value of 0 to the time variable of the Radiation Process Module, then add the code:
BENCH_START(rad_driver_tim)btimex=rsl_internal_microclock()BENCH_START(rad_driver_tim)btimex=rsl_internal_microclock()
获取辐射过程模块开始运行时的系统时间。在辐射过程模块的结束位置添加如下代码:Gets the system time when the Radiation Process module started running. Add the following code at the end of the Radiation Process Module:
BENCH_END(rad_driver_tim)BENCH_END(rad_driver_tim)
rad_driver_tim=rad_driver_tim+rsl_internal_microclock()-btimexrad_driver_tim=rad_driver_tim+rsl_internal_microclock()-btimex
获取辐射过程模块运行结束时的系统时间与辐射过程模块运行结束时的系统时间的差值,并将系统时间的差值赋值给辐射过程模块的时间变量。Obtain the difference between the system time at the end of the radiation process module and the system time at the end of the radiation process module, and assign the difference of the system time to the time variable of the radiation process module.
在WRF模式的结束位置添加如下代码:BENCH_REPORT(rad_driver_tim)write(0,*)'rad_driver_tim=',rad_driver_timAdd the following code at the end of the WRF mode: BENCH_REPORT(rad_driver_tim)write(0,*)'rad_driver_tim=',rad_driver_tim
输出辐射过程模块的时间变量,即可得到WRF模式中所有辐射过程模块的总运行时长。By outputting the time variable of the radiation process module, the total running time of all radiation process modules in the WRF mode can be obtained.
可选的,可以在子程序变量声明结束之前添加宏定义,可以降低程序的复杂程度。可选的,可以在WRF模式的编译配置文件configure.wrf的ARCHFLAGS变量定义中加入-DBENCH选项,表明定义了宏BENCH。在添加宏定义时,可以添加定义为空的代码,在程序运行时,若定义了宏BENCH,则代码会替换为宏定义代码,若未定义宏BENCH,则代码替换为空行,对程序没有影响。Optionally, macro definitions can be added before the end of the subroutine variable declaration, which can reduce the complexity of the program. Optionally, you can add the -DBENCH option to the ARCHFLAGS variable definition in the WRF mode compilation configuration file configure.wrf, indicating that the macro BENCH is defined. When adding a macro definition, you can add an empty code. When the program is running, if the macro BENCH is defined, the code will be replaced with the macro definition code. If the macro BENCH is not defined, the code will be replaced with an empty line, which has no effect on the program. influences.
S305、根据每个子程序对应的运行时长,确定待优化的子程序。S305. Determine the subprogram to be optimized according to the running time length corresponding to each subprogram.
可选的,终端设备可以将子程序对应的总运行时长进行排序。例如,终端设备输出的子程序对应的运行时长为从高到低排序。总运行时长大于或等于预设时间阈值的子程序,确定为待优化的子程序。Optionally, the terminal device may sort the total running time corresponding to the subprograms. For example, the running durations corresponding to the subprograms output by the terminal device are sorted from high to low. The subroutine whose total running time is greater than or equal to the preset time threshold is determined as the subroutine to be optimized.
可选的,可以根据每个子程序的运行时长确定待优化的子程序。例如,WRF模式中,辐射过程模块的总运行时长为10秒,陆面过程模块的总运行时长为8秒,但是每个辐射过程模块的运行时间为2秒,每个陆面过程模块的运行时长为4秒,此时可以将陆面过程模块作为待优化的子程序。Optionally, the subroutine to be optimized may be determined according to the running time of each subroutine. For example, in WRF mode, the total operating time of the radiation process module is 10 seconds, the total operating time of the land surface process module is 8 seconds, but the operating time of each radiation process module is 2 seconds, and the operation time of each land surface process module is 2 seconds. The duration is 4 seconds. At this time, the land surface process module can be used as a subroutine to be optimized.
可选的,可以多次获取每个子程序的运行时长,获取每个子程序的平均运行时长,根据每个子程序的平均运行时长确定待优化的子程序。Optionally, the running duration of each subprogram can be obtained multiple times, the average running duration of each subprogram can be obtained, and the subprogram to be optimized is determined according to the average running duration of each subprogram.
在本申请中,终端设备可以获取第一程序,其中,第一程序中包括多个子程序。终端设备根据添加位置与计时代码的对应关系,在每个子程序中添加计时代码,得到第二程序。终端设备运行第二程序,并在第二程序运行的过程中,通过计时代码获取每个子程序对应的运行时长。根据每个子程序对应的运行时长,确定待优化的子程序。由于第二程序中的每个子程序添加了对应的计时代码,当终端设备运行第二程序时,计时代码可以获取每个子程序的运行时长,用户可以根据每个子程序的运行时长确定待优化的子程序,使得终端设备可以准确的确定需要优化的计算模块,进而提高计算模块的优化效率。In this application, the terminal device may acquire the first program, where the first program includes multiple subprograms. The terminal device adds a timing code to each subroutine according to the corresponding relationship between the added position and the timing code to obtain the second program. The terminal device runs the second program, and in the process of running the second program, obtains the running duration corresponding to each subprogram through the timing code. The subroutine to be optimized is determined according to the running time corresponding to each subroutine. Since the corresponding timing code is added to each subroutine in the second program, when the terminal device runs the second program, the timing code can obtain the running duration of each subroutine, and the user can determine the subroutine to be optimized according to the running duration of each subroutine. The program enables the terminal device to accurately determine the calculation module that needs to be optimized, thereby improving the optimization efficiency of the calculation module.
图4为本申请实施例提供的一种程序处理装置的结构示意图。该装置可以设置在终端设备中,请参见图4,所述程序处理装置10包括获取模块11、添加模块12、运行模块13和确定模块14,其中:FIG. 4 is a schematic structural diagram of a program processing apparatus provided by an embodiment of the present application. The apparatus can be set in a terminal device, please refer to FIG. 4 , the program processing apparatus 10 includes an
所述获取模块11用于,获取第一程序,所述第一程序中包括多个子程序;The obtaining
所述添加模块12用于,在所述第一程序中添加每个子程序对应的计时代码,得到第二程序;The adding
所述运行模块13用于,运行所述第二程序,并在所述第二程序运行的过程中,通过所述计时代码获取每个子程序对应的运行时长;The running
所述确定模块14用于,根据每个子程序对应的运行时长,确定待优化的子程序。The determining
在一种可能的实施方式中,所述添加模块具体用于:In a possible implementation manner, the adding module is specifically used for:
在所述第一程序中确定多个位置集合,所述位置集合中包括多个添加位置;determining a plurality of sets of locations in the first program, the set of locations including a plurality of addition locations;
确定每个添加位置对应的计时代码;Determine the timing code corresponding to each addition position;
分别在每个添加位置添加对应的计时代码。Add the corresponding timing code at each addition position.
在一种可能的实施方式中,所述位置集合包括:In a possible implementation, the location set includes:
子程序代码的起始位置;the starting position of the subroutine code;
子程序代码的结束位置;the end position of the subroutine code;
第一程序代码的结束位置。The end position of the first program code.
在一种可能的实施方式中,所述计时代码包括:In a possible implementation, the timing code includes:
变量赋值代码;variable assignment code;
第一变量代码;first variable code;
第二变量代码;second variable code;
变量输出代码。Variable output code.
在一种可能的实施方式中,所述添加模块具体用于:In a possible implementation manner, the adding module is specifically used for:
在所述添加位置为子程序代码的起始位置时,确定所述添加位置对应的计时代码是变量赋值代码和第一变量代码;或者,When the addition position is the starting position of the subroutine code, it is determined that the timing code corresponding to the addition position is the variable assignment code and the first variable code; or,
在所述添加位置为子程序代码的结束位置时,确定所述添加位置对应的计时代码是第二变量代码;或者,When the added position is the end position of the subroutine code, it is determined that the timing code corresponding to the added position is the second variable code; or,
在所述添加的位置为第一程序代码的结束位置时,确定所述添加位置对应的计时代码是变量输出代码。When the added position is the end position of the first program code, it is determined that the timing code corresponding to the added position is a variable output code.
在一种可能的实施方式中,所述确定模块具体用于:In a possible implementation manner, the determining module is specifically used for:
将运行时长大于或等于第一阈值的子程序确定为所述待优化的子程序。A subroutine whose running duration is greater than or equal to the first threshold is determined as the subroutine to be optimized.
本申请实施例提供的频率调整装置可以执行上述方法实施例所示的技术方案,其实现原理以及有益效果类似,此处不再进行赘述。The frequency adjustment apparatus provided in the embodiments of the present application can implement the technical solutions shown in the foregoing method embodiments, and the implementation principles and beneficial effects thereof are similar, which will not be repeated here.
图5为本申请实施例提供的程序处理设备的硬件结构示意图。请参见图5,该程序处理设备20可以包括:处理器21和存储器22,其中,处理器21和存储器22可以通信;示例性的,处理器21和存储器22通过通信总线23通信,所述存储器22用于存储程序指令,所述处理器21用于调用存储器中的程序指令执行上述任意方法实施例所示的程序处理方法。FIG. 5 is a schematic diagram of a hardware structure of a program processing device provided by an embodiment of the present application. Referring to FIG. 5, the program processing device 20 may include: a
可选的,程序处理设备20还可以包括通信接口,通信接口可以包括发送器和/或接收器。Optionally, the program processing device 20 may further include a communication interface, and the communication interface may include a transmitter and/or a receiver.
可选的,上述处理器可以是中央处理单元(Central Processing Unit,CPU),还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本申请所公开的方法的步骤可以直接体现为硬件处理器执行完成,或者用处理器中的硬件及软件模块组合执行完成。Optionally, the above-mentioned processor may be a central processing unit (Central Processing Unit, CPU), and may also be other general-purpose processors, digital signal processors (Digital Signal Processors, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC) )Wait. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps in combination with the method disclosed in the present application can be directly embodied as executed by a hardware processor, or executed by a combination of hardware and software modules in the processor.
本申请提供一种可读存储介质,所述可读存储介质上存储有计算机程序;所述计算机程序用于实现如上述任意实施例所述的程序处理方法。The present application provides a readable storage medium on which a computer program is stored; the computer program is used to implement the program processing method described in any of the foregoing embodiments.
本申请实施例提供一种计算机程序产品,所述计算机程序产品包括指令,当所述指令被执行时,使得计算机执行上述程序处理方法。An embodiment of the present application provides a computer program product, where the computer program product includes instructions, which, when the instructions are executed, cause a computer to execute the above program processing method.
实现上述各方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成。前述的程序可以存储于一可读取存储器中。该程序在执行时,执行包括上述各方法实施例的步骤;而前述的存储器(存储介质)包括:只读存储器(英文:read-only memory,缩写:ROM)、RAM、快闪存储器、硬盘、固态硬盘、磁带(英文:magnetic tape)、软盘(英文:floppydisk)、光盘(英文:optical disc)及其任意组合。All or part of the steps for implementing the above method embodiments may be completed by program instructions related to hardware. The aforementioned program can be stored in a readable memory. When the program is executed, the steps including the above method embodiments are executed; and the aforementioned memory (storage medium) includes: read-only memory (English: read-only memory, abbreviation: ROM), RAM, flash memory, hard disk, Solid state drive, magnetic tape (English: magnetic tape), floppy disk (English: floppydisk), optical disc (English: optical disc) and any combination thereof.
本申请实施例是参照根据本申请实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理单元以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理单元执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The embodiments of the present application are described with reference to flowcharts and/or block diagrams of methods, apparatuses (systems), and computer program products according to the embodiments of the present application. It will be understood that each flow and/or block in the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processing unit of a general purpose computer, special purpose computer, embedded processor or other programmable data processing device to produce a machine such that the instructions executed by the processing unit of the computer or other programmable data processing device produce Means for implementing the functions specified in a flow or flow of a flowchart and/or a block or blocks of a block diagram.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory result in an article of manufacture comprising instruction means, the instructions The apparatus implements the functions specified in the flow or flow of the flowcharts and/or the block or blocks of the block diagrams.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded on a computer or other programmable data processing device to cause a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process such that The instructions provide steps for implementing the functions specified in the flow or blocks of the flowcharts and/or the block or blocks of the block diagrams.
显然,本领域的技术人员可以对本申请实施例进行各种改动和变型而不脱离本申请的精神和范围。这样,倘若本申请实施例的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请也意图包含这些改动和变型在内。Obviously, those skilled in the art can make various changes and modifications to the embodiments of the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the embodiments of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
应该理解的是,虽然上述实施例中的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,其可以以其他的顺序执行。而且,图中的至少一部分步骤可以包括多个子步骤或者多个阶段,这些子步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,其执行顺序也不必然是依次进行,而是可以与其他步骤或者其他步骤的子步骤或者阶段的至少一部分轮流或者交替地执行。It should be understood that, although the steps in the flow charts in the above embodiments are sequentially displayed according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, the execution of these steps is not strictly limited to the order and may be performed in other orders. Moreover, at least a part of the steps in the figure may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but may be executed at different times, and the execution order is not necessarily sequential. Instead, it may be performed in turn or alternately with other steps or at least a portion of sub-steps or stages of other steps.
在本申请中,术语“包括”及其变形可以指非限制性的包括;术语“或”及其变形可以指“和/或”。本本申请中术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。本申请中,“多个”是指两个或两个以上。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。字符“/”一般表示前后关联对象是一种“或”的关系。In this application, the term "comprising" and its variants may mean non-limiting inclusion; the term "or" and its variants may mean "and/or". The terms "first", "second" and the like in this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. In this application, "plurality" means two or more. "And/or", which describes the association relationship of the associated objects, means that there can be three kinds of relationships, for example, A and/or B, which can mean that A exists alone, A and B exist at the same time, and B exists alone. The character "/" generally indicates that the associated objects are an "or" relationship.
Claims (14)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010965658.1A CN112083931A (en) | 2020-09-15 | 2020-09-15 | Program processing method, device and equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010965658.1A CN112083931A (en) | 2020-09-15 | 2020-09-15 | Program processing method, device and equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112083931A true CN112083931A (en) | 2020-12-15 |
Family
ID=73737061
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010965658.1A Pending CN112083931A (en) | 2020-09-15 | 2020-09-15 | Program processing method, device and equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112083931A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113791801A (en) * | 2021-09-07 | 2021-12-14 | 浙江三维利普维网络有限公司 | Application program updating method and device, storage medium and electronic device |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20080127067A1 (en) * | 2006-09-06 | 2008-05-29 | Matthew Edward Aubertine | Method and system for timing code execution in a korn shell script |
US20110055818A1 (en) * | 2009-08-26 | 2011-03-03 | Kabushiki Kaisha Toshiba | Source code analyzing system and source code analyzing method |
CN102236551A (en) * | 2010-04-30 | 2011-11-09 | 微软公司 | Software development tool |
CN107480043A (en) * | 2016-12-23 | 2017-12-15 | 宝沃汽车(中国)有限公司 | The method of testing and system of code execution time |
CN107851003A (en) * | 2015-04-02 | 2018-03-27 | 数据仓库投资有限公司 | Field specialization system and method for improving program performance |
CN110008008A (en) * | 2017-12-29 | 2019-07-12 | 广东欧珀移动通信有限公司 | Applied program processing method and device, electronic equipment, computer readable storage medium |
CN111414295A (en) * | 2020-03-09 | 2020-07-14 | 浙江大华技术股份有限公司 | CPU occupancy rate statistical method, device, equipment and medium |
-
2020
- 2020-09-15 CN CN202010965658.1A patent/CN112083931A/en active Pending
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20080127067A1 (en) * | 2006-09-06 | 2008-05-29 | Matthew Edward Aubertine | Method and system for timing code execution in a korn shell script |
US20110055818A1 (en) * | 2009-08-26 | 2011-03-03 | Kabushiki Kaisha Toshiba | Source code analyzing system and source code analyzing method |
CN102236551A (en) * | 2010-04-30 | 2011-11-09 | 微软公司 | Software development tool |
CN107851003A (en) * | 2015-04-02 | 2018-03-27 | 数据仓库投资有限公司 | Field specialization system and method for improving program performance |
CN107480043A (en) * | 2016-12-23 | 2017-12-15 | 宝沃汽车(中国)有限公司 | The method of testing and system of code execution time |
CN110008008A (en) * | 2017-12-29 | 2019-07-12 | 广东欧珀移动通信有限公司 | Applied program processing method and device, electronic equipment, computer readable storage medium |
CN111414295A (en) * | 2020-03-09 | 2020-07-14 | 浙江大华技术股份有限公司 | CPU occupancy rate statistical method, device, equipment and medium |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113791801A (en) * | 2021-09-07 | 2021-12-14 | 浙江三维利普维网络有限公司 | Application program updating method and device, storage medium and electronic device |
CN113791801B (en) * | 2021-09-07 | 2024-12-24 | 浙江三维利普维网络有限公司 | Application program updating method, device, storage medium and electronic device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110889439B (en) | Image feature extraction method and device, electronic equipment and storage medium | |
CN112286623B (en) | An information processing method and device, storage medium | |
CN108090142A (en) | Card sort method, device, server and storage medium | |
CN113126994A (en) | Hotspot code processing method and device, electronic equipment and storage medium | |
CN112083931A (en) | Program processing method, device and equipment | |
CN111352791A (en) | System application detection method and device, terminal equipment and storage medium | |
CN107341097B (en) | Information pushing method and device | |
CN113468442B (en) | Distribution method of resource bit flow, computing equipment and computer storage medium | |
CN110689114A (en) | Network node processing method, device, storage medium and electronic device | |
CN114387016A (en) | Advertisement putting method and device | |
CN119668692A (en) | Job execution method, device, equipment, and program product in distributed scenarios | |
CN113196232A (en) | Neural network scheduling method and device, computer equipment and readable storage medium | |
CN114510331A (en) | Thread quantity adjusting method and device and computing equipment | |
CN111273939B (en) | Information processing method, information processing device and terminal equipment | |
CN111340215A (en) | Network model reasoning acceleration method and device, storage medium and intelligent equipment | |
CN117651044A (en) | Edge computing task scheduling method and device | |
CN109408033B (en) | A method and device for constructing an image file based on jenkins | |
CN103488506A (en) | Method and device for unloading management of application programs | |
CN111290850A (en) | Data storage method, device and equipment | |
CN114187397B (en) | Virtual hair rendering method, device, medium, electronic device and program product | |
CN116708651A (en) | Multimedia data preloading method, device, electronic equipment and storage medium | |
CN116185606A (en) | Resource scheduling method and device, electronic equipment and readable storage medium | |
CN116192759A (en) | Data transmission amount adjusting method and device, electronic equipment and storage medium | |
CN112346849B (en) | A method and device for configuring CPU | |
CN114237444A (en) | Application program starting method and device, electronic equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
AD01 | Patent right deemed abandoned |
Effective date of abandoning: 20250627 |
|
AD01 | Patent right deemed abandoned |