CN110716747B - Program operation efficiency optimization method and terminal equipment based on function parameter statistics - Google Patents
Program operation efficiency optimization method and terminal equipment based on function parameter statistics Download PDFInfo
- Publication number
- CN110716747B CN110716747B CN201910875312.XA CN201910875312A CN110716747B CN 110716747 B CN110716747 B CN 110716747B CN 201910875312 A CN201910875312 A CN 201910875312A CN 110716747 B CN110716747 B CN 110716747B
- Authority
- CN
- China
- Prior art keywords
- instruction
- function
- preset
- execution
- memory address
- 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.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/70—Software maintenance or management
- G06F8/72—Code refactoring
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/34—Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
- G06F11/3452—Performance evaluation by statistical analysis
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Software Systems (AREA)
- General Physics & Mathematics (AREA)
- Life Sciences & Earth Sciences (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Bioinformatics & Computational Biology (AREA)
- Evolutionary Biology (AREA)
- Probability & Statistics with Applications (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Debugging And Monitoring (AREA)
Abstract
本发明适用于程序优化技术领域,提供了基于函数参数统计的程序运行效率优化方法及终端设备,该方法包括:获取与函数名称对应的两个内存地址以及两个执行指令;将预设异常指令替换两个执行指令中的任一个执行指令;执行预设异常指令对应的预设异常程序,由预设异常指令对应的预设异常程序将对应的执行指令还原至触发预设异常指令的内存地址处,将另一执行指令替换为预设异常指令,并更新待处理函数的使用次数,当预设定时器时间达到时,将两个执行指令分别还原至对应的两个内存地址处,确定统计结果,可以在不需要修改程序代码的情况下达到获取程序运行时指定函数的调用频率,提高统计效率,将调用频率高的函数优化,提高程序优化效率。
The present invention is applicable to the technical field of program optimization, and provides a program operation efficiency optimization method and terminal device based on function parameter statistics. The method includes: acquiring two memory addresses and two execution instructions corresponding to a function name; Replace any one of the two execution instructions; execute the preset exception program corresponding to the preset exception instruction, and restore the corresponding execution instruction to the memory address that triggers the preset exception instruction by the preset exception program corresponding to the preset exception instruction , replace another execution instruction with a preset exception instruction, and update the usage times of the function to be processed. When the preset timer time expires, restore the two execution instructions to the corresponding two memory addresses respectively, and determine the statistics. As a result, the calling frequency of the specified function when the program is running can be obtained without modifying the program code, the statistical efficiency can be improved, the functions with high calling frequency can be optimized, and the program optimization efficiency can be improved.
Description
技术领域technical field
本发明属于程序优化技术领域,尤其涉及一种基于函数参数统计的程序运行效率优化方法及终端设备。The invention belongs to the technical field of program optimization, and in particular relates to a program operation efficiency optimization method and terminal device based on function parameter statistics.
背景技术Background technique
在程序执行过程中,为了完成操作,一个程序通常还需要获取其他正在执行的程序的执行参数。为了优化程序运行的效率,针对程序中使用频率较高的函数可以进行重点优化,这样可以对整个程序的运行效率起到极大作用。In the process of program execution, in order to complete the operation, a program usually needs to obtain the execution parameters of other executing programs. In order to optimize the efficiency of program operation, key optimizations can be made for functions that are frequently used in the program, which can play a great role in the operation efficiency of the entire program.
现有技术中一般统计函数的使用频率时,通常是通过修改程序对应的软件代码来增加调试信息来达到目的。然而,通过反复修改软件代码来统计函数的使用频率,使得统计效率极低,从而导致程序优化效率低。When the frequency of use of a general statistical function in the prior art is generally achieved by modifying the software code corresponding to the program to increase debugging information. However, by repeatedly modifying the software code to count the frequency of use of the function, the statistical efficiency is extremely low, resulting in low program optimization efficiency.
发明内容SUMMARY OF THE INVENTION
有鉴于此,本发明实施例提供了一种基于函数参数统计的程序运行效率优化方法及终端设备,以解决现有技术中通过反复修改软件代码来统计函数的使用频率,使得统计效率极低,从而导致程序优化效率低的问题。In view of this, the embodiments of the present invention provide a method for optimizing program operation efficiency and a terminal device based on function parameter statistics, so as to solve the problem that the frequency of use of functions is counted by repeatedly modifying software codes in the prior art, so that the statistical efficiency is extremely low, This leads to the problem of low program optimization efficiency.
本发明实施例的第一方面提供了一种基于函数参数统计的程序运行效率优化方法,包括:A first aspect of the embodiments of the present invention provides a method for optimizing program operation efficiency based on function parameter statistics, including:
获取与待处理函数的函数名称对应的两个内存地址以及所述两个内存地址上的两个执行指令,并将预设异常指令替换所述两个执行指令中的任一个执行指令;Acquiring two memory addresses corresponding to the function name of the function to be processed and two execution instructions on the two memory addresses, and replacing any one execution instruction in the two execution instructions with a preset exception instruction;
当程序运行到所述预设异常指令时,由所述预设异常指令对应的预设异常程序将对应的执行指令还原至触发所述预设异常指令的内存地址处,将另一执行指令替换为所述预设异常指令,并更新所述待处理函数的使用次数;当预设定时器时间达到时,将所述两个执行指令分别还原至对应的两个内存地址处,并确定统计结果;When the program runs to the preset exception instruction, the preset exception program corresponding to the preset exception instruction restores the corresponding execution instruction to the memory address that triggered the preset exception instruction, and replaces another execution instruction with another execution instruction. is the preset exception instruction, and updates the usage times of the function to be processed; when the preset timer time reaches, restore the two execution instructions to the corresponding two memory addresses respectively, and determine the statistical result ;
将所述程序中的统计结果达到预设阈值的待处理函数进行优化。The functions to be processed whose statistical results in the program reach a preset threshold are optimized.
在一实施例中,所述两个内存地址包括第一内存地址和第二内存地址;In one embodiment, the two memory addresses include a first memory address and a second memory address;
所述两个执行指令包括所述第一内存地址上的第一执行指令和所述第二内存地址上的第二执行指令;The two execution instructions include a first execution instruction at the first memory address and a second execution instruction at the second memory address;
在首次采用预设异常指令替换执行指令时,将所述预设异常指令替换所述第一执行指令。When the preset exception instruction is used to replace the execution instruction for the first time, the first execution instruction is replaced with the preset exception instruction.
在一实施例中,在所述获取与待处理函数的函数名称对应的两个内存地址以及所述两个内存地址上的两个执行指令之前,还包括:In an embodiment, before the acquiring two memory addresses corresponding to the function names of the functions to be processed and the two execution instructions on the two memory addresses, the method further includes:
获取待处理函数的函数名称以及统计时间段。Get the function name and statistical time period of the function to be processed.
在一实施例中,所述获取与待处理函数的函数名称对应的两个内存地址以及所述两个内存地址上的两个执行指令,包括:In one embodiment, the acquiring two memory addresses corresponding to the function name of the function to be processed and two execution instructions on the two memory addresses includes:
根据获取的待处理函数的函数名称,获取与所述函数名称对应的第一内存地址;According to the obtained function name of the function to be processed, obtain the first memory address corresponding to the function name;
读取所述第一内存地址上的第一执行指令,并根据所述第一内存地址以及所述第一执行指令的长度,计算第二执行指令对应的第二内存地址,所述第一执行指令与所述第二执行指令为同一个待处理函数下的包括的两个执行指令;Read the first execution instruction on the first memory address, and calculate the second memory address corresponding to the second execution instruction according to the first memory address and the length of the first execution instruction, and the first execution instruction The instruction and the second execution instruction are two execution instructions included under the same function to be processed;
在所述获取与待处理函数的函数名称对应的两个内存地址以及所述两个内存地址上的两个执行指令之后,还包括:After the acquiring the two memory addresses corresponding to the function names of the functions to be processed and the two execution instructions on the two memory addresses, the method further includes:
备份所述第一执行指令和所述第二执行指令。The first execution instruction and the second execution instruction are backed up.
在一实施例中,在所述将预设异常指令替换所述两个执行指令中的任一个执行指令之后,还包括:In an embodiment, after replacing any one of the two execution instructions with the preset exception instruction, the method further includes:
当将所有待处理函数都替换为预设异常指令后,根据所述统计时间段启动预设定时器,并开始运行所述程序。After all the functions to be processed are replaced with preset exception instructions, a preset timer is started according to the statistical time period, and the program starts to run.
在一实施例中,所述由所述预设异常指令对应的预设异常程序将对应的执行指令还原至触发所述预设异常指令的内存地址处,将另一执行指令替换为所述预设异常指令,并更新所述待处理函数的使用次数,包括:In one embodiment, the preset exception program corresponding to the preset exception instruction restores the corresponding execution instruction to the memory address that triggers the preset exception instruction, and replaces another execution instruction with the preset exception instruction. Set an exception instruction, and update the usage times of the to-be-processed function, including:
执行所述预设异常指令对应的预设异常程序;Execute the preset exception program corresponding to the preset exception instruction;
所述预设异常程序检测触发所述预设异常指令的内存地址;The preset abnormal program detects a memory address that triggers the preset abnormal instruction;
当触发所述预设异常指令的内存地址为第一内存地址时,更新所述待处理函数的使用次数,并将所述第一执行指令还原至所述第一内存地址处;When the memory address that triggers the preset exception instruction is the first memory address, updating the usage times of the to-be-processed function, and restoring the first execution instruction to the first memory address;
将第二内存地址上的第二执行指令替换为所述预设异常指令。The second execution instruction at the second memory address is replaced with the preset exception instruction.
在一实施例中,在所述预设异常程序检测触发所述预设异常指令的内存地址之后,还包括:In one embodiment, after the preset abnormal program detects the memory address that triggers the preset abnormal instruction, the method further includes:
当触发所述预设异常指令的内存地址为第二内存地址时,将所述第一内存地址上的所述第一执行指令替换为所述预设异常指令,同时将所述第二执行指令还原至所述第二内存地址处。When the memory address that triggers the preset exception instruction is the second memory address, the first execution instruction at the first memory address is replaced with the preset exception instruction, and the second execution instruction is Restore to the second memory address.
在一实施例中,其特征在于,所述当预设定时器时间达到时,将所述两个执行指令分别还原至对应的两个内存地址处,并确定统计结果,包括:In an embodiment, it is characterized in that when the preset timer time reaches, restoring the two execution instructions to the corresponding two memory addresses respectively, and determining the statistical results, including:
当预设定时器时间达到时,触发定时处理流程;When the preset timer time reaches, trigger the timing processing flow;
所述定时处理流程停止所述程序运行,并将备份的第一执行指令和第二执行指令分别还原至对应的第一内存地址和第二内存地址,以及读取每个待处理函数在所述统计时间段内的使用次数,输出处理结果,所述处理结果包括根据所述使用次数以及所述统计时间段计算获得的使用频率;The timing processing flow stops the running of the program, restores the backed up first execution instruction and second execution instruction to the corresponding first memory address and second memory address, respectively, and reads each function to be processed in the Counting the number of times of use within a time period, and outputting a processing result, where the processing result includes the frequency of use calculated according to the number of times of use and the statistical time period;
在所述计算待处理函数的使用频率之后,还包括:After the calculating the usage frequency of the function to be processed, the method further includes:
将所述处理结果通过网络发送给云端,以便云端根据所述处理结果重新指定待处理函数。The processing result is sent to the cloud through the network, so that the cloud can re-designate the function to be processed according to the processing result.
本发明实施例的第二方面提供了一种基于函数参数统计的程序运行效率优化装置,包括:A second aspect of the embodiments of the present invention provides an apparatus for optimizing program operation efficiency based on function parameter statistics, including:
获取模块,用于获取与待处理函数的函数名称对应的两个内存地址以及所述两个内存地址上的两个执行指令;an acquisition module for acquiring two memory addresses corresponding to the function name of the function to be processed and two execution instructions on the two memory addresses;
替换模块,用于将预设异常指令替换所述两个执行指令中的任一个执行指令;A replacement module, configured to replace any one of the two execution instructions with a preset abnormal instruction;
处理模块,用于当程序运行到所述预设异常指令时,由所述预设异常指令对应的预设异常程序将对应的执行指令还原至触发所述预设异常指令的内存地址处,将另一执行指令替换为所述预设异常指令,并更新所述待处理函数的使用次数;以及当预设定时器时间达到时,将所述两个执行指令分别还原至对应的两个内存地址处,并确定统计结果;The processing module is configured to restore the corresponding execution instruction to the memory address that triggers the preset exception instruction by the preset exception program corresponding to the preset exception instruction when the program runs to the preset exception instruction, and convert the preset exception instruction corresponding to the preset exception instruction. Another execution instruction is replaced with the preset exception instruction, and the number of times of use of the to-be-processed function is updated; and when the preset timer time reaches, the two execution instructions are restored to the corresponding two memory addresses respectively and determine the statistical results;
优化模块,用于将所述程序中的统计结果达到预设阈值的待处理函数进行优化。The optimization module is used to optimize the functions to be processed whose statistical results in the program reach a preset threshold.
本发明实施例的第三方面提供了一种终端设备,包括:包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现如上述基于函数参数统计的程序运行效率优化方法所述的步骤。A third aspect of the embodiments of the present invention provides a terminal device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor executes the computer During the program, the steps described in the above-mentioned method for optimizing program operation efficiency based on function parameter statistics are implemented.
本发明实施例与现有技术相比存在的有益效果是:获取所述函数名称对应的两个内存地址以及两个执行指令;将预设异常指令替换两个执行指令中的任一个执行指令;当程序运行到预设异常指令时,由预设异常指令对应的预设异常程序将对应的执行指令还原至触发预设异常指令的内存地址处,将另一执行指令替换为预设异常指令,并更新待处理函数的使用次数,当预设定时器时间达到时,将两个执行指令分别还原至对应的两个内存地址处,并确定统计结果,从而可以在不需要修改程序代码的情况下即可达到获取程序运行时指定函数的调用频率,使得提高统计效率,针对调用频率高的函数进行优化,可以提高程序优化效率。Compared with the prior art, the embodiment of the present invention has the following beneficial effects: acquiring two memory addresses and two execution instructions corresponding to the function name; replacing any execution instruction in the two execution instructions with a preset exception instruction; When the program runs to the preset exception instruction, the preset exception program corresponding to the preset exception instruction restores the corresponding execution instruction to the memory address that triggers the preset exception instruction, and replaces another execution instruction with the preset exception instruction, And update the number of times of use of the function to be processed, when the preset timer time reaches, restore the two execution instructions to the corresponding two memory addresses, and determine the statistical results, so that the program code does not need to be modified. The calling frequency of the specified function when the program is running can be obtained, so as to improve the statistical efficiency, and optimizing the function with high calling frequency can improve the program optimization efficiency.
附图说明Description of drawings
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to illustrate the technical solutions in the embodiments of the present invention more clearly, the following briefly introduces the accompanying drawings that need to be used in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only for the present invention. In some embodiments, for those of ordinary skill in the art, other drawings can also be obtained according to these drawings without any creative effort.
图1是本发明实施例提供的基于函数参数统计的程序运行效率优化方法的实现流程示意图;Fig. 1 is the implementation flow diagram of the program operation efficiency optimization method based on function parameter statistics provided by the embodiment of the present invention;
图2是本发明另一实施例提供的基于函数参数统计的程序运行效率优化方法的实现流程示意图;FIG. 2 is a schematic flowchart of the implementation of a method for optimizing program operation efficiency based on function parameter statistics provided by another embodiment of the present invention;
图3是本发明另一实施例提供的获取函数参数的方法的示意图;3 is a schematic diagram of a method for obtaining function parameters provided by another embodiment of the present invention;
图4是本发明实施例提供的基于函数参数统计的程序运行效率优化装置的示例图;4 is an exemplary diagram of an apparatus for optimizing program operation efficiency based on function parameter statistics provided by an embodiment of the present invention;
图5是本发明实施例提供的终端设备的示意图。FIG. 5 is a schematic diagram of a terminal device provided by an embodiment of the present invention.
具体实施方式Detailed ways
以下描述中,为了说明而不是为了限定,提出了诸如特定系统结构、技术之类的具体细节,以便透彻理解本发明实施例。然而,本领域的技术人员应当清楚,在没有这些具体细节的其它实施例中也可以实现本发明。在其它情况中,省略对众所周知的系统、装置、电路以及方法的详细说明,以免不必要的细节妨碍本发明的描述。In the following description, for the purpose of illustration rather than limitation, specific details such as specific system structures and technologies are set forth in order to provide a thorough understanding of the embodiments of the present invention. However, it will be apparent to those skilled in the art that the present invention may be practiced in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present invention with unnecessary detail.
为了说明本发明所述的技术方案,下面通过具体实施例来进行说明。In order to illustrate the technical solutions of the present invention, the following specific embodiments are used for description.
图1为本发明实施例提供的一种基于函数参数统计的程序运行效率优化方法的实现流程示意图,详述如下。FIG. 1 is a schematic diagram of an implementation flowchart of a method for optimizing program operation efficiency based on function parameter statistics provided by an embodiment of the present invention, which is described in detail as follows.
步骤101,获取与待处理函数的函数名称对应的两个内存地址以及所述两个内存地址上的两个执行指令。Step 101: Acquire two memory addresses corresponding to the function name of the function to be processed and two execution instructions on the two memory addresses.
可选的,这里待处理函数可以为单个函数也可以为多个函数。Optionally, the function to be processed here may be a single function or multiple functions.
如图2所示在本步骤之前还可以包括:As shown in Figure 2, before this step, it can also include:
步骤201,获取待处理函数的函数名称以及统计时间段。Step 201: Obtain the function name and statistical time period of the function to be processed.
可选的,步骤201可以为获取需要统计使用频率的函数名称。Optionally,
可选的,在本实施例中,所述两个内存地址包括第一内存地址和第二内存地址;所述两个执行指令包括所述第一内存地址上的第一执行指令和所述第二内存地址上的第二执行指令。如图2所示,步骤101可以包括:Optionally, in this embodiment, the two memory addresses include a first memory address and a second memory address; the two execution instructions include a first execution instruction on the first memory address and the second memory address. The second execution instruction at the second memory address. As shown in FIG. 2, step 101 may include:
步骤202,根据获取的待处理函数的函数名称,获取与所述函数名称对应的第一内存地址。
可选的,若待处理函数包括多个执行指令时,首先获取函数名称对应的第一条执行指令对应的第一内存地址。Optionally, if the function to be processed includes multiple execution instructions, first obtain the first memory address corresponding to the first execution instruction corresponding to the function name.
步骤203,读取所述第一内存地址上的第一执行指令,并根据所述第一内存地址以及所述第一执行指令的长度,计算第二执行指令对应的第二内存地址,所述第一执行指令与所述第二执行指令为同一个待处理函数下的包括的两个执行指令。Step 203: Read the first execution instruction on the first memory address, and calculate the second memory address corresponding to the second execution instruction according to the first memory address and the length of the first execution instruction. The first execution instruction and the second execution instruction are two execution instructions included under the same function to be processed.
可选的,步骤203中,第一内存地址可以用A1表示,第二内存地址可以用A2表示,第一执行指令可以用I1表示,第二执行指令可以用I2表示。根据A1计算内存地址A2的过程可以为,根据CPU取指令的方向和指令长度来计算。例如CPU依次从内存低地址往高地址取指令执行,同时执行指令长度可以固定为4字节,那么下个指令的内存地址则为A2=A1+4。如果执行指令长度是变长的,则根据当前执行指令的长度确定下个指令的内存地址。Optionally, in
步骤204,将统计所述待处理函数的使用次数清零。Step 204: Clear the counted usage times of the to-be-processed function to zero.
本步骤为可选步骤,在图2中采用虚线框表示。在初次采用定时时间段获取统计结果时,直接统计所述待处理函数的使用次数即可,当进入第二个定时时间段之前,则需要将上次统计待处理函数的使用次数进行清零处理,以便从零开始进行统计,保证统计结果正确。This step is an optional step, which is represented by a dashed box in FIG. 2 . When the timing period is used for the first time to obtain the statistical results, it is enough to directly count the usage times of the functions to be processed. , so that the statistics can be started from zero to ensure that the statistical results are correct.
步骤205,备份所述第一执行指令和所述第二执行指令。
可选的,将程序待处理函数的原执行指令备份完成后即可继续执行步骤102。Optionally, after the original execution instructions of the functions to be processed in the program are backed up, step 102 can be continued.
可选的,步骤204和步骤205的执行顺序不限定。Optionally, the execution order of
步骤102,将预设异常指令替换所述两个执行指令中的任一个执行指令。Step 102: Replace any one of the two execution instructions with a preset exception instruction.
可选的,在首次采用预设异常指令替换执行指令时,将所述预设异常指令替换所述两个执行指令中的第一执行指令;即在本实施例中,可将A1内存位置上的I1替换为预设异常指令。Optionally, when the preset exception instruction is used to replace the execution instruction for the first time, the preset exception instruction is used to replace the first execution instruction of the two execution instructions; that is, in this embodiment, the A1 memory location can be Replace the I1 with the preset exception instruction.
后续执行程序过程中当运行到预设异常指令对应的预设异常程序时,由预设异常程序将未触发所述预设异常指令的内存地址上的执行指令替换为预设异常指令,此时可能是两个执行指令中的第一执行指令,也可能为第二执行指令。即可将A1内存位置上的I1替换为预设异常指令,也可将A2内存位置上的I2替换为预设异常指令,视具体情况而定。During the subsequent execution of the program, when the preset exception program corresponding to the preset exception instruction is run, the preset exception program replaces the execution instruction on the memory address that does not trigger the preset exception instruction with the preset exception instruction. It may be the first execution instruction among the two execution instructions, or it may be the second execution instruction. That is, I1 on the A1 memory location can be replaced with a preset exception instruction, or I2 on the A2 memory location can be replaced with a preset exception instruction, as the case may be.
可选的,重复步骤101和步骤102,直到所有待处理函数的执行指令均被预设异常指令代替。当将所有待处理函数都替换为预设异常指令后,根据统计时间段启动预设定时器,并开始运行所述程序。可选的,预设定时器可以为到时定时器,其设定的时间为统计时间段对应的时间。Optionally, steps 101 and 102 are repeated until all execution instructions of the functions to be processed are replaced by preset exception instructions. After all the functions to be processed are replaced with preset abnormal instructions, a preset timer is started according to the statistical time period, and the program starts to run. Optionally, the preset timer may be an expiration timer, and the set time is the time corresponding to the statistical time period.
可选的,程序可以为指包含多个函数的执行程序,可以是系统本身的程序,也可以是另外动态安装加载的程序。Optionally, the program may refer to an execution program including multiple functions, may be a program of the system itself, or may be another program dynamically installed and loaded.
步骤103,当程序运行到所述预设异常指令时,由所述预设异常指令对应的预设异常程序将对应的执行指令还原至触发所述预设异常指令的内存地址处,将另一执行指令替换为所述预设异常指令,并更新所述待处理函数的使用次数;当预设定时器时间达到时,将所述两个执行指令分别还原至对应的两个内存地址处,并确定统计结果。
其中,所述预设异常程序为根据处理目标设置的程序。Wherein, the preset abnormal program is a program set according to a processing target.
可选的,如图2所示步骤103可以包括以下步骤:Optionally, as shown in FIG. 2, step 103 may include the following steps:
步骤206,当程序运行到所述预设异常指令时,执行所述预设异常指令对应的预设异常程序。
可选的,当程序运行到所述预设异常指令时,将触发异常,跳转到预设异常指令对应的预设异常程序。Optionally, when the program runs to the preset exception instruction, an exception will be triggered and jump to the preset exception program corresponding to the preset exception instruction.
步骤207,所述预设异常程序检测触发所述预设异常指令的内存地址。
可选的,这里预设异常程序检测触发所述预设异常指令的内存地址是A1还是A2,针对不同的内存地址需要不同的处理方式,以便获得精确地统计频率的次数。Optionally, here the preset exception program detects whether the memory address that triggers the preset exception instruction is A1 or A2, and different processing methods are required for different memory addresses, so as to obtain the number of times the frequency is accurately counted.
步骤208,当触发所述预设异常指令的内存地址为第一内存地址时,更新所述待处理函数的使用次数,并将所述第一执行指令还原至所述第一内存地址处。
步骤209,将第二内存地址上的第二执行指令替换为所述预设异常指令。Step 209: Replace the second execution instruction at the second memory address with the preset exception instruction.
可选的,当处理完步骤209之后,可以返回到触发异常的所述第一内存地址重新执行指令,在本实施例中不对此进行详细描述。Optionally, after
步骤210,当触发所述预设异常指令的内存地址为第二内存地址时,将所述第一内存地址上的所述第一执行指令替换为所述预设异常指令,同时将所述第二执行指令还原至所述第二内存地址处;
可选的,当处理完步骤210之后,可以返回到触发异常的所述第二内存地址重新执行指令,在本实施例中不对此进行详细描述。Optionally, after
可选的,步骤206-步骤210中使用两个执行指令,并按需进行替换为异常指令的目的是:第一执行指令设为预设异常指令,是为了对该待处理函数被调用时进行统计,统计完成后,还原第一执行指令;把第二执行指令替换为预设异常指令,是为了实现对待处理函数进行多次重复调用时的统计。如果此时把第二执行指令替换为预设异常指令,若还原为第一执行指令后,则下一次调用该待处理函数时,无法再次触发异常程序进行统计。那么函数在执行第一条执行指令后,接着执行第二次执行指令时,将重新有机会把A1位置的执行指令重新替换为异常指令,从而实现了多次调用该函数时,第一执行指令都处于异常指令,触发异常实现统计功能。Optionally, the purpose of using two execution instructions in
可选的,如图2所示当预设定时器时间达到时,本步骤还可以包括:Optionally, when the preset timer time reaches as shown in FIG. 2 , this step may further include:
步骤211,当预设定时器时间达到时,触发定时处理流程。
步骤212,所述定时处理流程停止所述程序运行,并将备份的第一执行指令和第二执行指令分别还原至对应的第一内存地址和第二内存地址,以及读取每个待处理函数在所述统计时间段内的使用次数,输出处理结果。
其中,所述处理结果包括根据所述使用次数以及统计时间段计算获得的待处理函数的使用频率。The processing result includes the frequency of use of the function to be processed calculated and obtained according to the number of times of use and the statistical time period.
步骤213,将所述处理结果通过网络发送给云端,以便云端根据所述处理结果重新指定待处理函数。Step 213: Send the processing result to the cloud through the network, so that the cloud can re-designate the function to be processed according to the processing result.
可选的,云端根据处理结果可以重新指定需要的函数统计使用频率并发送给本机,从而达到动态调整待处理函数的目的。不同精度的统计,可以通过指定不同的时间段来实现,时间段越长,统计出来的函数的使用频率精度越高。Optionally, according to the processing result, the cloud can re-designate the required function statistics usage frequency and send it to the local machine, so as to achieve the purpose of dynamically adjusting the function to be processed. Statistics with different precisions can be achieved by specifying different time periods. The longer the time period, the higher the frequency of use of the statistics.
步骤104,将所述程序中的统计结果达到预设阈值的待处理函数进行优化。Step 104: Optimize the functions to be processed whose statistical results in the program reach a preset threshold.
可选的,对程序中待处理函数的使用频率进行统计,对使用频率较高的函数进行重点优化,对提高整个程序的运行效率起到极大作用。Optionally, statistics on the usage frequency of the functions to be processed in the program are performed, and key optimization is performed on functions with higher usage frequencies, which plays a great role in improving the running efficiency of the entire program.
可选的,预设阈值可以根据需求进行设定,在本申请中不限定预设阈值的取值范围。Optionally, the preset threshold may be set according to requirements, and the value range of the preset threshold is not limited in this application.
可选的,当待处理函数包括的执行指令仅有一个时,则可以根据附图3所示的流程获取函数的参数,如图3所示,获取函数的参数包括以下步骤。Optionally, when the function to be processed includes only one execution instruction, the parameters of the function can be obtained according to the process shown in FIG. 3 . As shown in FIG. 3 , obtaining the parameters of the function includes the following steps.
步骤301,获取待处理函数的函数名称。Step 301: Obtain the function name of the function to be processed.
这里待处理函数可以为单个函数也可以为多个函数。The function to be processed here can be a single function or multiple functions.
步骤302,根据获取的待处理函数的函数名称,获取与所述函数名称对应的内存地址。
步骤303,读取所述内存地址上的执行指令。Step 303: Read the execution instruction on the memory address.
可选的,读取内存地址上内存空间为S的指令块。需要说明的是,步骤303中的执行指令在内存中所占的内存空间与设置的预设异常指令在内存中所占的内存空间相同。Optionally, read the instruction block whose memory space is S at the memory address. It should be noted that, the memory space occupied in the memory by the execution instruction in
步骤304,备份所述执行指令。
步骤305,将预设异常指令替换所述执行指令。
当程序中所有的待处理函数都替换为预设异常指令后,执行程序。After all the functions to be processed in the program are replaced with preset exception instructions, the program is executed.
步骤306,当程序运行到所述预设异常指令时,执行所述预设异常指令对应的预设异常程序并进行处理,处理完成后将所述执行指令还原至所述内存地址处。
可选的,在如图3所示的获取函数参数的过程中,当程序运行时,待处理函数被其它函数调用时,将运行指令块跳转至预设异常程序,预设异常程序根据过程调用标准(Procedure Call Standard,PCS)规则读取CPU的对应的寄存器以及栈空间上对应的内容并分析、处理、保存等操作。需要说明的是,函数之间的相互调用,需要遵循PCS,PCS会对函数参数传递,返回值等做具体规定。PCS可以由各种技术联盟制定,也可以程序员自行设计,函数参数传递的规定因不同PCS而不同。函数参数的传递,大多数PCS基本上都是基于CPU的工作寄存器和栈空间来传递,当然也可以用其它方法。因此获取函数被调用时,调用者传递过来的参数,只要根据具体的PCS,按照其规定读取对应的寄存器和栈空间上的内容即可,然后根据PCS规则解析即可得到函数调用者传递的参数。Optionally, in the process of obtaining function parameters as shown in FIG. 3, when the program is running, when the function to be processed is called by other functions, the running instruction block is jumped to the preset exception program, and the preset exception program is based on the process. The Procedure Call Standard (PCS) rule reads the corresponding registers of the CPU and the corresponding content on the stack space, and analyzes, processes, saves and other operations. It should be noted that the mutual calls between functions need to follow PCS, and PCS will make specific regulations on function parameter transfer and return value. PCS can be formulated by various technical alliances, or can be designed by programmers themselves. The rules for passing function parameters are different for different PCSs. The transfer of function parameters, most PCS are basically based on the CPU's working registers and stack space to transfer, of course, other methods can also be used. Therefore, when the function is called, the parameters passed by the caller only need to read the contents of the corresponding registers and stack space according to the specific PCS, and then parse according to the PCS rules to get the parameters passed by the function caller. parameter.
步骤307,获取处理结果,并继续执行所述执行指令以及后续程序。Step 307: Acquire the processing result, and continue to execute the execution instruction and subsequent programs.
当预设异常程序获取到函数参数后,读取之前备份的指令块并还原到内存地址处,预设异常程序跳转到内存地址处,完成函数参数的获取。After the preset exception program acquires the function parameters, the previously backed up instruction block is read and restored to the memory address, and the preset exception program jumps to the memory address to complete the acquisition of the function parameters.
附图3所述的函数参数的获取,可以在不修改程序代码的情况下,获取程序中指定函数运行时调用者传递的参数值,分析程序中各函数参数在运行过程中的具体传递情况,可以协助验证程序逻辑设计。The acquisition of the function parameters described in accompanying drawing 3 can obtain the parameter values passed by the caller when the specified function is running in the program without modifying the program code, and analyze the specific transmission situation of each function parameter in the running process in the program, Can assist in verifying program logic design.
上述基于函数参数统计的程序运行效率优化方法,可以获取与待处理函数的函数名称对应的两个内存地址以及两个执行指令;将预设异常指令替换两个执行指令中的任一个执行指令;当程序运行到预设异常指令时,由所述预设异常指令对应的预设异常程序将对应的执行指令还原至触发所述预设异常指令的内存地址处,将另一执行指令替换为所述预设异常指令,并更新所述待处理函数的使用次数,当预设定时器时间达到时,将两个执行指令分别还原至对应的两个内存地址处,并确定统计结果,从而可以达到在不修改软件代码的情况下能快速统计指定任意数量的函数在规定时间段被调用的频率,效率极高,并且被统计对象本身不需要具备统计功能。另外,对使用频率较高的函数进行重点优化,对提高整个程序的运行效率起到极大作用。The above-mentioned method for optimizing program operation efficiency based on function parameter statistics can obtain two memory addresses and two execution instructions corresponding to the function name of the function to be processed; and replace any one of the two execution instructions with a preset abnormal instruction; When the program runs to the preset exception instruction, the preset exception program corresponding to the preset exception instruction restores the corresponding execution instruction to the memory address that triggered the preset exception instruction, and replaces another execution instruction with the specified exception instruction. The preset exception instruction is updated, and the number of times of use of the function to be processed is updated. When the preset timer time is reached, the two execution instructions are restored to the corresponding two memory addresses respectively, and the statistical results are determined, so as to achieve Without modifying the software code, it can quickly count the frequency that any number of functions are called in a specified time period, and the efficiency is very high, and the objects to be counted do not need to have statistical functions themselves. In addition, focusing on optimizing the functions with high frequency can greatly improve the running efficiency of the whole program.
应理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本发明实施例的实施过程构成任何限定。It should be understood that the size of the sequence numbers of the steps in the above embodiments does not mean the sequence of execution, and the execution sequence of each process should be determined by its functions and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.
对应于上文实施例所述的基于函数参数统计的程序运行效率优化方法,图4示出了本发明实施例提供的基于函数参数统计的程序运行效率优化装置的示例图。如图4所示,该装置可以包括:获取模块401、替换模块402、处理模块403和优化模块404。Corresponding to the method for optimizing program operation efficiency based on function parameter statistics described in the above embodiments, FIG. 4 shows an example diagram of an apparatus for optimizing program operation efficiency based on function parameter statistics provided by an embodiment of the present invention. As shown in FIG. 4 , the apparatus may include: an
获取模块401,用于获取与待处理函数的函数名称对应的两个内存地址以及所述两个内存地址上的两个执行指令;an
替换模块402,用于将预设异常指令替换所述两个执行指令中的任一个执行指令;A
处理模块403,用于当程序运行到所述预设异常指令时,由所述预设异常指令对应的预设异常程序将对应的执行指令还原至触发所述预设异常指令的内存地址处,将另一执行指令替换为所述预设异常指令,并更新所述待处理函数的使用次数;以及当预设定时器时间达到时,将所述两个执行指令分别还原至对应的两个内存地址处,并确定统计结果;The
优化模块404,用于将所述程序中的统计结果达到预设阈值的待处理函数进行优化。The
可选的,所述两个内存地址包括第一内存地址和第二内存地址;Optionally, the two memory addresses include a first memory address and a second memory address;
所述两个执行指令包括所述第一内存地址上的第一执行指令和所述第二内存地址上的第二执行指令。The two execution instructions include a first execution instruction at the first memory address and a second execution instruction at the second memory address.
可选的,所述获取模块401还可以用于:获取待处理函数的函数名称以及统计时间段。Optionally, the obtaining
可选的,所述获取模块401获取与待处理函数的函数名称对应的两个内存地址以及所述两个内存地址上的两个执行指令时,可以根据获取的待处理函数的函数名称,获取与所述函数名称对应的第一内存地址;读取所述第一内存地址上的第一执行指令,并根据所述第一内存地址以及所述第一执行指令的长度,计算第二执行指令对应的第二内存地址,所述第一执行指令与所述第二执行指令为同一个待处理函数下的包括的两个执行指令。以及备份所述第一执行指令和所述第二执行指令。Optionally, when the obtaining
可选的,所述替换模块402,在首次采用预设异常指令替换执行指令时,用于将所述预设异常指令替换所述两个执行指令中的第一执行指令。Optionally, the
当将所有待处理函数都替换为预设异常指令后,所述处理模块403可以根据所述统计时间段启动预设定时器,并开始运行所述程序。After all functions to be processed are replaced with preset exception instructions, the
可选的,所述处理模块403可以用于:执行所述预设异常指令对应的预设异常程序;所述预设异常程序检测触发所述预设异常指令的内存地址;当触发所述预设异常指令的内存地址为第一内存地址时,更新所述待处理函数的使用次数,并将所述第一执行指令还原至所述第一内存地址处;将第二内存地址上的第二执行指令替换为所述预设异常指令。Optionally, the
以及当触发所述预设异常指令的内存地址为第二内存地址时,将所述第一内存地址上的所述第一执行指令替换为所述预设异常指令,同时将所述第二执行指令还原至所述第二内存地址处。and when the memory address that triggers the preset abnormal instruction is the second memory address, replace the first execution instruction on the first memory address with the preset abnormal instruction, and simultaneously execute the second execution instruction. The instruction is restored to the second memory address.
可选的,当预设定时器时间达到时,所述处理模块403将所述两个执行指令分别还原至对应的两个内存地址处,并确定统计结果时,可以用于:Optionally, when the preset timer time reaches, the
当预设定时器时间达到时,触发定时处理流程;When the preset timer time reaches, trigger the timing processing flow;
所述定时处理流程停止所述程序运行,并将备份的第一执行指令和第二执行指令分别还原至对应的第一内存地址和第二内存地址,以及读取每个待处理函数在所述统计时间段内的使用次数,输出处理结果,所述处理结果包括根据所述使用次数以及所述统计时间段计算获得的使用频率;The timing processing flow stops the running of the program, restores the backed up first execution instruction and second execution instruction to the corresponding first memory address and second memory address, respectively, and reads each function to be processed in the Counting the number of times of use within a time period, and outputting a processing result, where the processing result includes the frequency of use calculated according to the number of times of use and the statistical time period;
可选的,所述处理模块403还用于将所述处理结果通过网络发送给云端,以便云端根据所述处理结果重新指定待处理函数。Optionally, the
上述基于函数参数统计的程序运行效率优化装置,可以由获取模块获取与函数名称对应的两个内存地址以及两个执行指令;替换模块将预设异常指令替换两个执行指令中的任一个执行指令;以及处理模块用于由所述预设异常指令对应的预设异常程序将对应的执行指令还原至触发所述预设异常指令的内存地址处,将另一执行指令替换为所述预设异常指令,并更新所述待处理函数的使用次数;以及当预设定时器时间达到时,将所述两个执行指令分别还原至对应的两个内存地址处,并确定统计结果,从而可以达到在不修改软件代码的情况下能快速统计指定任意数量的函数在规定时间段被调用的频率,效率极高,并且被统计对象本身不需要具备统计功能。另外,优化模块对使用频率较高的函数进行重点优化,对提高整个程序的运行效率起到极大作用。In the above-mentioned device for optimizing program operation efficiency based on function parameter statistics, the acquisition module can acquire two memory addresses corresponding to the function name and two execution instructions; the replacement module replaces any one of the two execution instructions with a preset abnormal instruction. and the processing module is used to restore the corresponding execution instruction to the memory address that triggers the preset exception instruction by the preset exception program corresponding to the preset exception instruction, and replace another execution instruction with the preset exception instruction, and update the number of times of use of the function to be processed; and when the preset timer time reaches, restore the two execution instructions to the corresponding two memory addresses respectively, and determine the statistical results, so that the Without modifying the software code, it can quickly count the frequency that any number of functions are called in a specified time period, and the efficiency is extremely high, and the objects to be counted do not need to have statistical functions themselves. In addition, the optimization module focuses on optimizing the functions with high frequency, which plays a great role in improving the running efficiency of the whole program.
图5是本发明一实施例提供的终端设备的示意图。如图5所示,该实施例的终端设备500包括:处理器501、存储器502以及存储在所述存储器502中并可在所述处理器501上运行的计算机程序503,例如基于函数参数统计的程序运行效率优化程序。所述处理器501执行所述计算机程序503时实现上述基于函数参数统计的程序运行效率优化方法实施例中的步骤,例如图1所示的步骤101至104,或者图2所示的步骤或者图3所示的步骤,所述处理器501执行所述计算机程序503时实现上述各装置实施例中各模块的功能,例如图4所示模块401至404的功能。FIG. 5 is a schematic diagram of a terminal device according to an embodiment of the present invention. As shown in FIG. 5 , the
示例性的,所述计算机程序503可以被分割成一个或多个程序模块,所述一个或者多个程序模块被存储在所述存储器502中,并由所述处理器501执行,以完成本发明。所述一个或多个程序模块可以是能够完成特定功能的一系列计算机程序指令段,该指令段用于描述所述计算机程序503在所述基于函数参数统计的程序运行效率优化装置或者终端设备500中的执行过程。例如,所述计算机程序503可以被分割成获取模块401、替换模块402、处理模块403和优化模块404,各模块具体功能如图4所示,在此不再一一赘述。Exemplarily, the
所述终端设备500可以是桌上型计算机、笔记本、掌上电脑及云端服务器等计算设备。所述终端设备可包括,但不仅限于,处理器501、存储器502。本领域技术人员可以理解,图5仅仅是终端设备500的示例,并不构成对终端设备500的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如所述终端设备还可以包括输入输出设备、网络接入设备、总线等。The
所称处理器501可以是中央处理单元(Central Processing Unit,CPU),还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。The so-called
所述存储器502可以是所述终端设备500的内部存储单元,例如终端设备500的硬盘或内存。所述存储器502也可以是所述终端设备500的外部存储设备,例如所述终端设备500上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(SecureDigital,SD)卡,闪存卡(Flash Card)等。进一步地,所述存储器502还可以既包括所述终端设备500的内部存储单元也包括外部存储设备。所述存储器502用于存储所述计算机程序以及所述终端设备500所需的其他程序和数据。所述存储器502还可以用于暂时地存储已经输出或者将要输出的数据。The
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能单元、模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元、模块完成,即将所述装置的内部结构划分成不同的功能单元或模块,以完成以上描述的全部或者部分功能。实施例中的各功能单元、模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中,上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。另外,各功能单元、模块的具体名称也只是为了便于相互区分,并不用于限制本申请的保护范围。上述系统中单元、模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that, for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. Module completion, that is, dividing the internal structure of the device into different functional units or modules to complete all or part of the functions described above. Each functional unit and module in the embodiment may be integrated in one processing unit, or each unit may exist physically alone, or two or more units may be integrated in one unit, and the above-mentioned integrated units may adopt hardware. It can also be realized in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing from each other, and are not used to limit the protection scope of the present application. For the specific working process of the units and modules in the above-mentioned system, reference may be made to the corresponding process in the foregoing method embodiments, which will not be repeated here.
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述或记载的部分,可以参见其它实施例的相关描述。In the foregoing embodiments, the description of each embodiment has its own emphasis. For parts that are not described or described in detail in a certain embodiment, reference may be made to the relevant descriptions of other embodiments.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本发明的范围。Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each particular application, but such implementations should not be considered beyond the scope of the present invention.
在本发明所提供的实施例中,应该理解到,所揭露的装置/终端设备和方法,可以通过其它的方式实现。例如,以上所描述的装置/终端设备实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通讯连接可以是通过一些接口,装置或单元的间接耦合或通讯连接,可以是电性,机械或其它的形式。In the embodiments provided by the present invention, it should be understood that the disclosed apparatus/terminal device and method may be implemented in other manners. For example, the apparatus/terminal device embodiments described above are only illustrative. For example, the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units. Or components may be combined or may be integrated into another system, or some features may be omitted, or not implemented. On the other hand, the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit. The above-mentioned integrated units may be implemented in the form of hardware, or may be implemented in the form of software functional units.
所述集成的模块/单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明实现上述实施例方法中的全部或部分流程,也可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一计算机可读存储介质中,该计算机程序在被处理器执行时,可实现上述各个方法实施例的步骤。。其中,所述计算机程序包括计算机程序代码,所述计算机程序代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。所述计算机可读介质可以包括:能够携带所述计算机程序代码的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、计算机存储器、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、电载波信号、电信信号以及软件分发介质等。需要说明的是,所述计算机可读介质包含的内容可以根据司法管辖区内立法和专利实践的要求进行适当的增减,例如在某些司法管辖区,根据立法和专利实践,计算机可读介质不包括电载波信号和电信信号。The integrated modules/units, if implemented in the form of software functional units and sold or used as independent products, may be stored in a computer-readable storage medium. Based on this understanding, the present invention can implement all or part of the processes in the methods of the above embodiments, and can also be completed by instructing relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium. When the program is executed by the processor, the steps of the foregoing method embodiments can be implemented. . Wherein, the computer program includes computer program code, and the computer program code may be in the form of source code, object code, executable file or some intermediate form, and the like. The computer-readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM, Read-Only Memory) , Random Access Memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable media may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction, for example, in some jurisdictions, according to legislation and patent practice, the computer-readable media Electric carrier signals and telecommunication signals are not included.
以上所述实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的精神和范围,均应包含在本发明的保护范围之内。The above-mentioned embodiments are only used to illustrate the technical solutions of the present invention, but not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: it is still possible to implement the foregoing implementations. The technical solutions described in the examples are modified, or some technical features thereof are equivalently replaced; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the within the protection scope of the present invention.
Claims (9)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201910875312.XA CN110716747B (en) | 2019-09-17 | 2019-09-17 | Program operation efficiency optimization method and terminal equipment based on function parameter statistics |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201910875312.XA CN110716747B (en) | 2019-09-17 | 2019-09-17 | Program operation efficiency optimization method and terminal equipment based on function parameter statistics |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN110716747A CN110716747A (en) | 2020-01-21 |
| CN110716747B true CN110716747B (en) | 2022-08-12 |
Family
ID=69209878
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201910875312.XA Active CN110716747B (en) | 2019-09-17 | 2019-09-17 | Program operation efficiency optimization method and terminal equipment based on function parameter statistics |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN110716747B (en) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN113485903B (en) * | 2021-07-09 | 2024-11-15 | 郑州阿帕斯数云信息科技有限公司 | A parameter statistics method and device based on hook |
Family Cites Families (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US8612802B1 (en) * | 2011-01-31 | 2013-12-17 | Open Invention Network, Llc | System and method for statistical application-agnostic fault detection |
| CN101770422A (en) * | 2008-12-30 | 2010-07-07 | 鸿富锦精密工业(深圳)有限公司 | Software bug tracking method and computer system thereof |
| CN101847096B (en) * | 2010-02-05 | 2012-12-12 | 中国科学院计算技术研究所 | Optimization method of stack variable-containing function |
| WO2012119446A1 (en) * | 2011-09-20 | 2012-09-13 | 华为技术有限公司 | Memory monitoring method and device |
| CN108614763B (en) * | 2016-12-09 | 2022-01-04 | 武汉斗鱼网络科技有限公司 | Application debugging method and device |
-
2019
- 2019-09-17 CN CN201910875312.XA patent/CN110716747B/en active Active
Also Published As
| Publication number | Publication date |
|---|---|
| CN110716747A (en) | 2020-01-21 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN113065656B (en) | A rule engine configuration method, device, server and readable storage medium | |
| CN111104421A (en) | Data query method and device based on data interface standard configuration | |
| CN109634822B (en) | Function time consumption statistical method and device, storage medium and terminal equipment | |
| CN109358873B (en) | Application program updating method, storage medium and terminal device | |
| CN109542462B (en) | System environment deployment method, storage medium and server | |
| CN110580220B (en) | Method for measuring code segment execution time and terminal equipment | |
| CN110851339A (en) | Method and device for reporting buried point data, storage medium and terminal equipment | |
| CN110851207A (en) | State transition management method and device, electronic equipment and computer readable storage medium | |
| CN110232022A (en) | Network environment test method, device and terminal device | |
| CN110688320B (en) | Detection method, device and terminal equipment of global variables | |
| CN110716747B (en) | Program operation efficiency optimization method and terminal equipment based on function parameter statistics | |
| US10740218B2 (en) | Method and device for determining usage log | |
| CN110347683B (en) | Data table merging processing method and device | |
| CN109408265B (en) | IOS abnormal operation protection method and device, terminal equipment and storage medium | |
| CN114428464B (en) | Robot cluster control interaction method and device, terminal equipment and storage medium | |
| CN112732427B (en) | Data processing method, system and related device based on Redis cluster | |
| CN115934178A (en) | Code running method and device, electronic equipment and storage medium | |
| CN107273229B (en) | Method, device and computer-readable storage medium for handling abnormal timing of timer | |
| CN115933514B (en) | Control method, device, terminal and storage medium based on soft PLC | |
| CN111045730A (en) | Hardware fast interrupt processing system and method for RISC-V architecture | |
| CN111444057A (en) | Page performance data acquisition method and device and computing equipment | |
| CN110874246A (en) | Module loading method, system and equipment | |
| CN114780259A (en) | Kernel matching method, server and storage medium | |
| CN110188491B (en) | Processing method and device for improving calculation efficiency in simulation calculation process | |
| CN115774574A (en) | Operating system kernel switching method and device |
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 | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |