CN117632746A - Pile inserting processing method and device, storage medium and electronic equipment - Google Patents
Pile inserting processing method and device, storage medium and electronic equipment Download PDFInfo
- Publication number
- CN117632746A CN117632746A CN202311660702.8A CN202311660702A CN117632746A CN 117632746 A CN117632746 A CN 117632746A CN 202311660702 A CN202311660702 A CN 202311660702A CN 117632746 A CN117632746 A CN 117632746A
- Authority
- CN
- China
- Prior art keywords
- file
- code
- instrumentation
- bytecode
- byte code
- 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
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Prevention of errors by analysis, debugging or testing of software
- G06F11/362—Debugging of software
- G06F11/3628—Debugging of software of optimised code
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/40—Transformation of program code
- G06F8/41—Compilation
-
- 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)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Software Systems (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Debugging And Monitoring (AREA)
Abstract
本申请实施例公开了一种插桩处理方法、装置、存储介质及电子设备,其中,方法包括:编译程序源码文件对应的中间字节码文件,确定针对程序源码文件的热点代码监测插桩逻辑,基于预设插桩模块使用字节码操作工具对中间字节码文件添加热点代码监测插桩逻辑,得到目标中间字节码文件,运行目标中间字节码文件,获取热点代码监测插桩逻辑对应的热点代码执行记录文件。
Embodiments of the present application disclose an instrumentation processing method, device, storage medium and electronic equipment. The method includes: compiling an intermediate bytecode file corresponding to a program source code file, and determining hot code monitoring instrumentation logic for the program source code file. , based on the preset instrumentation module, use the bytecode operation tool to add hot code monitoring instrumentation logic to the intermediate bytecode file, obtain the target intermediate bytecode file, run the target intermediate bytecode file, and obtain the hot code monitoring instrumentation logic. The corresponding hotspot code execution record file.
Description
技术领域Technical field
本申请涉及计算机技术领域,尤其涉及一种插桩处理方法、装置、存储介质及电子设备。The present application relates to the field of computer technology, and in particular to an instrumentation processing method, device, storage medium and electronic equipment.
背景技术Background technique
随着计算机技术的快速发展,诸如手机、平板电脑等终端得到了快速普及,对于终端系统而言,常常会涉及到系统热点代码统计,系统热点代码统计通常是指对终端系统的应用程序中的关键代码进行分析和统计,以了解代码的执行频率、热点函数或方法的调用情况等,系统热点代码统计可以帮助开发人员优化性能、提升安全性、改进用户体验,并提供数据支持进行产品改进和代码维护,进而可以提高应用程序的质量、可靠性和用户满意度。With the rapid development of computer technology, terminals such as mobile phones and tablet computers have gained rapid popularity. For terminal systems, system hot code statistics are often involved. System hot code statistics usually refer to the application programs of the terminal system. Analysis and statistics of key codes are performed to understand the execution frequency of the code, the calling of hot functions or methods, etc. System hot code statistics can help developers optimize performance, improve security, improve user experience, and provide data support for product improvement and Code maintenance, which in turn improves application quality, reliability, and user satisfaction.
发明内容Contents of the invention
本申请实施例提供了一种插桩处理方法、装置、存储介质及电子设备,所述技术方案如下:Embodiments of the present application provide a staking processing method, device, storage medium and electronic equipment. The technical solution is as follows:
第一方面,本申请实施例提供了一种插桩处理方法,所述方法包括:In a first aspect, embodiments of the present application provide a staking processing method, which method includes:
编译程序源码文件对应的中间字节码文件,确定针对所述程序源码文件的热点代码监测插桩逻辑;Compile the intermediate bytecode file corresponding to the program source code file, and determine the hot code monitoring instrumentation logic for the program source code file;
基于预设插桩模块使用字节码操作工具对所述中间字节码文件添加所述热点代码监测插桩逻辑,得到目标中间字节码文件;Use a bytecode operation tool to add the hotspot code monitoring instrumentation logic to the intermediate bytecode file based on the preset instrumentation module to obtain the target intermediate bytecode file;
运行所述目标中间字节码文件,获取所述热点代码监测插桩逻辑对应的热点代码执行记录文件。Run the target intermediate bytecode file to obtain the hotspot code execution record file corresponding to the hotspot code monitoring instrumentation logic.
第二方面,本申请实施例提供了一种插桩处理装置,所述装置包括:In a second aspect, embodiments of the present application provide a staking processing device, which includes:
编译模块,用于编译程序源码文件对应的中间字节码文件,确定针对所述程序源码文件的热点代码监测插桩逻辑;The compilation module is used to compile the intermediate bytecode file corresponding to the program source code file, and determine the hot code monitoring instrumentation logic for the program source code file;
插桩模块,用于基于预设插桩模块使用字节码操作工具对所述中间字节码文件添加所述热点代码监测插桩逻辑,得到目标中间字节码文件;An instrumentation module, configured to use a bytecode operation tool to add the hotspot code monitoring instrumentation logic to the intermediate bytecode file based on the preset instrumentation module to obtain the target intermediate bytecode file;
运行模块,用于运行所述目标中间字节码文件,获取所述热点代码监测插桩逻辑对应的热点代码执行记录文件。An operation module is used to run the target intermediate bytecode file and obtain the hotspot code execution record file corresponding to the hotspot code monitoring instrumentation logic.
第三方面,本申请实施例提供一种计算机存储介质,所述计算机存储介质存储有多条指令,所述指令适于由处理器加载并执行上述的方法步骤。In a third aspect, embodiments of the present application provide a computer storage medium that stores multiple instructions, and the instructions are suitable for being loaded by a processor and executing the above method steps.
第四方面,本申请实施例提供一种电子设备,可包括:处理器和存储器;其中,所述存储器存储有计算机程序,所述计算机程序适于由所述处理器加载并执行上述的方法步骤。In a fourth aspect, embodiments of the present application provide an electronic device, which may include: a processor and a memory; wherein the memory stores a computer program, and the computer program is adapted to be loaded by the processor and execute the above method steps. .
本申请一些实施例提供的技术方案带来的有益效果至少包括:The beneficial effects brought by the technical solutions provided by some embodiments of this application include at least:
在本申请一个或多个实施例中,终端编译程序源码文件对应的中间字节码文件,确定针对程序源码文件的热点代码监测插桩逻辑,为了实现基于字节码操作工具的非侵入式热点代码方法调用监测和调用统计,预先配置了预设插桩模块,基于预设插桩模块使用字节码操作工具对中间字节码文件添加热点代码监测插桩逻辑得到目标中间字节码文件,中间字节码文件进行修改而不是直接修改程序源码文件,再运行目标中间字节码文件就可以获取到热点代码监测插桩逻辑对应的热点代码执行记录文件,从而实现了程序源代码的非侵入式插桩,与侵入式代码插桩方案相比,提高了插桩的自动化程度降低了人工成本,减少了插桩对源码性能的影响,使插桩过程中终端系统包含的众多子模块变得更加便捷高效。In one or more embodiments of the present application, the terminal compiles the intermediate bytecode file corresponding to the program source code file, and determines the hotspot code monitoring instrumentation logic for the program source code file, in order to implement non-intrusive hotspots based on bytecode operating tools. Code method call monitoring and call statistics are pre-configured with a preset instrumentation module. Based on the preset instrumentation module, bytecode operation tools are used to add hot code monitoring and instrumentation logic to the intermediate bytecode file to obtain the target intermediate bytecode file. Modify the intermediate bytecode file instead of directly modifying the program source code file, and then run the target intermediate bytecode file to obtain the hotspot code execution record file corresponding to the hotspot code monitoring instrumentation logic, thus achieving non-intrusion of the program source code. Compared with intrusive code instrumentation solutions, this method improves the automation of instrumentation, reduces labor costs, reduces the impact of instrumentation on source code performance, and makes the many sub-modules included in the terminal system during the instrumentation process More convenient and efficient.
附图说明Description of drawings
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to explain the embodiments of the present application or the technical solutions in the prior art more clearly, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings in the following description are only These are some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without exerting creative efforts.
图1是本申请实施例提供的一种插桩处理方法的流程示意图;Figure 1 is a schematic flow chart of a staking processing method provided by an embodiment of the present application;
图2是本申请实施例提供的一种源码编译的场景示意图;Figure 2 is a schematic diagram of a source code compilation scenario provided by an embodiment of the present application;
图3是本申请实施例提供的一种源码插桩监测的场景示意图;Figure 3 is a schematic diagram of a source code instrumentation monitoring scenario provided by an embodiment of the present application;
图4是本申请实施例提供的一种插桩处理方法的另一种实施例的流程示意图;Figure 4 is a schematic flowchart of another embodiment of a staking processing method provided by the embodiment of the present application;
图5是本申请实施例提供的一种预设插桩模块的示意图;Figure 5 is a schematic diagram of a preset instrumentation module provided by an embodiment of the present application;
图6是本申请实施例提供的一种预设插桩模块的示意图;Figure 6 is a schematic diagram of a preset instrumentation module provided by an embodiment of the present application;
图7是本申请实施例提供的一种热点代码调用次数记录的示意图;Figure 7 is a schematic diagram of a hotspot code call count record provided by an embodiment of the present application;
图8是本申请实施例提供的一种插桩处理装置的装置示意图;Figure 8 is a schematic diagram of a pile insertion processing device provided by an embodiment of the present application;
图9是本申请实施例提供的一种电子设备的结构示意图;Figure 9 is a schematic structural diagram of an electronic device provided by an embodiment of the present application;
图10是本申请实施例提供的操作系统和用户空间的结构示意图;Figure 10 is a schematic structural diagram of the operating system and user space provided by the embodiment of the present application;
图11是图10中安卓操作系统的架构图;Figure 11 is the architecture diagram of the Android operating system in Figure 10;
图12是图10中IOS操作系统的架构图。Figure 12 is an architectural diagram of the IOS operating system in Figure 10.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative efforts fall within the scope of protection of this application.
在本申请的描述中,需要理解的是,术语“第一”、“第二”等仅用于描述目的,而不能理解为指示或暗示相对重要性。在本申请的描述中,需要说明的是,除非另有明确的规定和限定,“包括”和“具有”以及它们任何变形,意图在于覆盖不排他的包含。例如包含了一系列步骤或单元的过程、方法、系统、产品或设备没有限定于已列出的步骤或单元,而是可选地还包括没有列出的步骤或单元,或可选地还包括对于这些过程、方法、产品或设备固有的其他步骤或单元。对于本领域的普通技术人员而言,可以具体情况理解上述术语在本申请中的具体含义。此外,在本申请的描述中,除非另有说明,“多个”是指两个或两个以上。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。字符“/”一般表示前后关联对象是一种“或”的关系。In the description of the present application, it should be understood that the terms "first", "second", etc. are used for descriptive purposes only and shall not be understood as indicating or implying relative importance. In the description of this application, it should be noted that, unless otherwise expressly stated and limited, "including" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally also includes steps or units that are not listed, or optionally also includes Other steps or units inherent to such processes, methods, products or devices. For those of ordinary skill in the art, the specific meanings of the above terms in this application can be understood on a case-by-case basis. Furthermore, in the description of this application, "plurality" means two or more unless otherwise specified. "And/or" describes the relationship between related objects, indicating that there can be three relationships. For example, A and/or B can mean: A exists alone, A and B exist simultaneously, and B exists alone. The character "/" generally indicates that the related objects are in an "or" relationship.
在相关技术中,终端的操作系统(可简称终端系统)的热点代码统计或热点代码分析是通过人工或自动化方式在系统相关模块的程序源码中添加埋点逻辑、数据记录逻辑以及导出相关逻辑等热点代码监测逻辑生成新的程序源码,然后新的程序源码经过重新编译生成新的程序,最后执行修改后的程序实现热点代码调用的统计。In related technologies, the hot code statistics or hot code analysis of the terminal's operating system (which can be referred to as the terminal system) is to add burying logic, data recording logic, and export related logic to the program source code of the system's relevant modules through manual or automated methods. The hot code monitoring logic generates new program source code, and then the new program source code is recompiled to generate a new program. Finally, the modified program is executed to implement statistics of hot code calls.
然后,一方面,终端系统相关模块有大量的代码仓库,对热点代码仓库源码进行修改的工作量极大且效率低下;另一方面,在程序源码中添加热点代码监测逻辑属于侵入式代码插桩,可能改变原系统模块的执行逻辑,从而会引发降低程序执行性能、程序崩溃等现象;Then, on the one hand, terminal system-related modules have a large number of code warehouses, and modifying the hot code warehouse source code requires a huge workload and is inefficient; on the other hand, adding hot code monitoring logic to the program source code is an intrusive code instrumentation , which may change the execution logic of the original system module, which may lead to reduced program execution performance, program crash, etc.;
可见,相关技术中的热点代码调用监测存在一定的局限性。It can be seen that hot code call monitoring in related technologies has certain limitations.
下面结合具体的实施例对本申请进行详细说明。The present application will be described in detail below with reference to specific embodiments.
在一个实施例中,如图1所示,特提出了一种插桩处理方法,该方法可依赖于计算机程序实现,可运行于基于冯诺依曼体系的插桩处理装置上。该计算机程序可集成在应用中,也可作为独立的工具类应用运行。所述插桩处理装置可以为终端设备,包括但不限于:个人电脑、平板电脑、手持设备、车载设备、可穿戴设备、计算设备或连接到无线调制解调器的其它处理设备等。在不同的网络中终端设备可以叫做不同的名称,例如:用户设备、接入终端、用户单元、用户站、移动站、移动台、远方站、远程终端、移动设备、用户终端、终端、无线通信设备、用户代理或用户装置、蜂窝电话、无绳电话、5G网络或未来演进网络中的终端设备等。In one embodiment, as shown in FIG. 1 , an instrumentation processing method is proposed, which can be implemented by relying on a computer program and can run on an instrumentation processing device based on the von Neumann system. The computer program can be integrated into an application or run as a stand-alone utility application. The instrumentation processing device may be a terminal device, including but not limited to: a personal computer, a tablet computer, a handheld device, a vehicle-mounted device, a wearable device, a computing device or other processing devices connected to a wireless modem. Terminal equipment can be called different names in different networks, such as: user equipment, access terminal, user unit, user station, mobile station, mobile station, remote station, remote terminal, mobile device, user terminal, terminal, wireless communication Equipment, user agent or user device, cellular phone, cordless phone, terminal equipment in 5G network or future evolution network, etc.
具体的,该插桩处理方法包括:Specifically, the instrumentation processing method includes:
S102:编译程序源码文件对应的中间字节码文件,确定针对所述程序源码文件的热点代码监测插桩逻辑;S102: Compile the intermediate bytecode file corresponding to the program source code file, and determine the hot code monitoring instrumentation logic for the program source code file;
程序源码文件可以理解为开发端在代码编写阶段、代码调试阶段、代码维护阶段等阶段的程序源码,以不同机器可编程语言编码的源码文件可称之为不同的语言程序源码文件;Program source code files can be understood as the program source codes of the development end in the code writing stage, code debugging stage, code maintenance stage, etc. Source code files encoded in different machine programmable languages can be called different language program source code files;
例如,如图2所示,图2是一种源码编译的场景示意图。机器可编程语言可以是Java语言,程序源码文件可称之为Java程序源码文件(简称Java源码);示例性的,Java源码通过javac(Java的编译器前端)编译转换为class文件(也即中间字节码文件),class的文件内容为Java字节码。For example, as shown in Figure 2, Figure 2 is a schematic diagram of a source code compilation scenario. The machine programmable language can be the Java language, and the program source code file can be called a Java program source code file (Java source code for short); for example, the Java source code is compiled and converted into a class file (that is, an intermediate file) through javac (Java compiler front-end). Bytecode file), the file content of class is Java bytecode.
在实际应用中,对于终端系统而言,常常会涉及到系统热点代码统计,系统热点代码统计通常是指对终端系统的应用程序中的关键代码进行分析和统计,以了解代码的执行频率、热点函数或方法的调用情况等,为了避免侵入式修改所导致的局限性,可以执行本说明书一个或多个实施例的插桩处理方法,实现基于字节码操作工具的非侵入式热点代码方法调用监测和调用统计。In practical applications, for terminal systems, system hot code statistics are often involved. System hot code statistics usually refer to the analysis and statistics of key codes in terminal system applications to understand the execution frequency and hot spots of the code. In order to avoid limitations caused by intrusive modifications, such as the calling of functions or methods, the instrumentation processing method of one or more embodiments of this specification can be implemented to implement non-intrusive hot code method invocation based on bytecode operating tools. Monitoring and call statistics.
编译程序源码文件对应的中间字节码文件,首先将源代码转化为机器可编程语言虚拟机(如Java虚拟机)能够识别的字节码,这些字节码可称之为中间字节码文件。Compile the intermediate bytecode file corresponding to the program source code file. First, the source code is converted into bytecode that can be recognized by the machine programmable language virtual machine (such as Java virtual machine). These bytecodes can be called intermediate bytecode files. .
基于实际需要确定需要关注的是注入那些可能存在性能问题、被频繁调用的代码段,这些代码段即热点代码,而热点代码监测插桩逻辑则是:终端的用户(例如开发人员、测试人员、维护人员等)根据对源码中热点代码调用监测的目标确定了热点代码监测插桩逻辑(也可称之为热点代码调用插桩逻辑),以便在待监测热点代码执行时收集有关程序行为或性能的信息。Based on actual needs, it is determined that what needs attention is to inject those code segments that may have performance problems and are frequently called. These code segments are hot code, and the hot code monitoring instrumentation logic is: terminal users (such as developers, testers, Maintenance personnel, etc.) determine the hot code monitoring instrumentation logic (which can also be called hot code call instrumentation logic) based on the goal of hot code call monitoring in the source code, in order to collect relevant program behavior or performance when the hot code to be monitored is executed. Information.
具体的,可以预先使用各种工具和技术来确定程序源码文件中本次待监测的热点代码,确定了程序源码文件中的热点代码后,可以使用非侵入式插桩逻辑生成热点代码监测插桩逻辑,基于热点代码监测插桩逻辑来监测热点代码的执行调用情况。Specifically, various tools and technologies can be used in advance to determine the hot code to be monitored in the program source code file. After determining the hot code in the program source code file, non-intrusive instrumentation logic can be used to generate hot code monitoring instrumentation. Logic, based on hot code monitoring instrumentation logic to monitor the execution and calling of hot code.
在一种可行的实施方式中,终端可以获取用户(例如开发人员、测试人员、维护人员等)针对程序源码文件所输入的热点代码监测方式,所述热点代码监测方式包括方法调用次数记录、方法入参出参记录、方法调用链记录、方法调用耗时记录、方法传参记录、方法重写记录、方法功能扩展记录中的至少一种,然后基于热点代码监测方式生成热点代码监测插桩逻辑。In a feasible implementation, the terminal can obtain the hot code monitoring method input by users (such as developers, testers, maintainers, etc.) for the program source code file. The hot code monitoring method includes method call count records, method At least one of input and output parameters records, method call chain records, method call time-consuming records, method parameter transfer records, method rewrite records, and method function expansion records, and then generate hot code monitoring instrumentation logic based on the hot code monitoring method. .
采用用户输入热点代码监测方式,后续可结合预设插桩模块使用字节码操作工具对中间字节码文件添加用户自定义的热点代码监测插桩逻辑。Using the user input hotspot code monitoring method, you can then use the bytecode operation tool in conjunction with the preset instrumentation module to add user-defined hotspot code monitoring instrumentation logic to the intermediate bytecode file.
一种方式可以是:用户(例如开发人员、测试人员、维护人员等)针对程序源码文件输入的热点代码监测方式,并由用户自定义编码热点代码监测插桩逻辑,热点代码监测插桩逻辑以代码数据的形式表征,对于终端而言仅需接收用户所输入的热点代码监测插桩逻辑即可;One way can be: the hot code monitoring method input by users (such as developers, testers, maintainers, etc.) for the program source code file, and the user customizes the coding hot code monitoring instrumentation logic, and the hot code monitoring instrumentation logic is based on For the formal representation of code data, the terminal only needs to receive the hotspot code monitoring instrumentation logic input by the user;
一种方式可以是:预先定义了热点代码监测类型与插桩逻辑自动生成模板之间的模板映射关系,用户仅需输入热点代码监测方式,热点代码监测方式对应的数据中携带有热点代码监测配置,热点代码监测配置包括热点代码、热点代码监测参数、热点代码监测类型(如调用次数记录类型、方法入参出参类型)等等,基于模板映射关系,基于热点代码监测类型可以从模板映射关系中查询当前热点代码监测类型对应的目标插桩逻辑自动生成模板,然后使用目标插桩逻辑自动生成模板结合用户所输入的热点代码监测方式所携带的热点代码、热点代码监测参数、热点代码监测类型等数据自动生成热点代码监测插桩逻辑。One way can be: the template mapping relationship between the hot code monitoring type and the instrumentation logic automatically generated template is predefined, and the user only needs to enter the hot code monitoring method, and the data corresponding to the hot code monitoring method carries the hot code monitoring configuration. , hotspot code monitoring configuration includes hotspot code, hotspot code monitoring parameters, hotspot code monitoring type (such as call count record type, method input and output parameter type), etc., based on template mapping relationship, based on hotspot code monitoring type can be from the template mapping relationship Query the target instrumentation logic corresponding to the current hot code monitoring type to automatically generate a template, and then use the target instrumentation logic to automatically generate the template combined with the hot code, hot code monitoring parameters, and hot code monitoring type carried by the hot code monitoring method input by the user. Wait for the data to automatically generate hotspot code monitoring instrumentation logic.
S104:基于预设插桩模块使用字节码操作工具对所述中间字节码文件添加所述热点代码监测插桩逻辑,得到目标中间字节码文件;S104: Use a bytecode operation tool to add the hotspot code monitoring instrumentation logic to the intermediate bytecode file based on the preset instrumentation module to obtain the target intermediate bytecode file;
为了实现基于字节码操作工具的非侵入式热点代码方法调用监测和调用统计,预先配置了预设插桩模块,例如,预设插桩模块融合进编译中间产物-中间字节码文件的修改步骤,对中间字节码文件进行修改而不是直接修改程序源码文件(Java源文件),实现了程序源代码的非侵入式插桩。与现有的侵入式代码插桩方案相比,提高了插桩的自动化程度降低了人工成本,减少了插桩对源码性能的影响,使插桩过程中终端系统包含的众多子模块变得更加便捷高效。In order to achieve non-intrusive hot code method call monitoring and call statistics based on bytecode operating tools, a preset instrumentation module is pre-configured. For example, the preset instrumentation module is integrated into the compilation intermediate product - the modification of the intermediate bytecode file. In this step, the intermediate bytecode file is modified instead of directly modifying the program source code file (Java source file), realizing non-intrusive instrumentation of the program source code. Compared with existing intrusive code instrumentation solutions, it improves the automation of instrumentation, reduces labor costs, reduces the impact of instrumentation on source code performance, and makes the numerous sub-modules included in the terminal system during the instrumentation process more efficient. Convenient and efficient.
字节码操作工具是指用于对中间字节码文件进行相关操作的工具程序;Bytecode operation tools refer to tool programs used to perform related operations on intermediate bytecode files;
可选的,字节码操作工具可以是ASM类库,ASM类库是一个操作Java字节码的库。在本说明书基于预设插桩模块使用字节码操作工具-ASM类库可以用来读取、修改和生成Java类的字节码,并将点代码监测插桩逻辑注入到中间字节码文件。通过ASM,可以通过编程方式操作中间字节码文件,进行各种字节码级别的操作,如方法的插入、修改和删除等。这个类库提供了丰富的API接口,在本说明书基于预设插桩模块使用字节码操作工具使得可以方便地处理中间字节码文件中的Java字节码。Optionally, the bytecode operation tool can be the ASM class library, which is a library for operating Java bytecode. In this manual, based on the preset instrumentation module, the bytecode manipulation tool-ASM class library can be used to read, modify and generate the bytecode of Java classes, and inject point code monitoring instrumentation logic into the intermediate bytecode file. . Through ASM, intermediate bytecode files can be manipulated programmatically to perform various bytecode-level operations, such as method insertion, modification, and deletion. This class library provides a rich API interface. In this manual, the Java bytecode in the intermediate bytecode file can be easily processed using bytecode manipulation tools based on the preset instrumentation module.
具体的,基于插桩模块利用字节码操作工具如ASM类库向中间字节码文件(Class文件)中添加自定义的热点代码监测插桩逻辑,得到目标中间字节码文件,插热点代码监测插桩逻辑诸如可以是方法调用次数记录逻辑、方法入参出参记录逻辑、方法调用链记录逻辑、方法调用耗时记录逻辑、方法传参记录逻辑、方法重写记录逻辑、方法功能扩展记录逻辑等逻辑中的至少一种;Specifically, based on the instrumentation module, bytecode operation tools such as ASM class libraries are used to add customized hotspot code monitoring instrumentation logic to the intermediate bytecode file (Class file), obtain the target intermediate bytecode file, and insert the hotspot code Monitoring instrumentation logic can include method call count recording logic, method input and output parameter recording logic, method call chain recording logic, method call time-consuming recording logic, method parameter passing recording logic, method rewriting recording logic, and method function expansion recording logic. At least one of logic and other logics;
S106:运行所述目标中间字节码文件,获取所述热点代码监测插桩逻辑对应的热点代码执行记录文件。S106: Run the target intermediate bytecode file and obtain the hotspot code execution record file corresponding to the hotspot code monitoring instrumentation logic.
具体的,将插桩后的目标中间字节码文件配置到终端系统中,终端运行目标中间字节码文件,基于目标中间字节码文件会触发终端系统相关模块的功能,以执行相关程序代码,这个过程中热点代码会被执行操作,同时在执行热点代码过程中,基于前述插桩的热点代码监测插桩逻辑,会自动记录相关热点代码的执行情况,如方法调用次数记录、方法入参出参记录、方法调用链记录、方法调用耗时记录、方法传参记录、方法重写记录、方法功能扩展记录等等;在目标中间字节码文件对应的源程序结束运行时,通过热点代码监测插桩逻辑会将热点代码的调用记录导出为二进制文件,该二进制文件也即本说明书中的热点代码执行记录文件,导出的热点代码执行记录文件根据热点代码监测插桩逻辑可以包含方法调用次数、执行时间、入参、出参以及动态调用链等预先设置好的监测信息。Specifically, the instrumented target intermediate bytecode file is configured into the terminal system, and the terminal runs the target intermediate bytecode file. Based on the target intermediate bytecode file, the functions of the relevant modules of the terminal system are triggered to execute the relevant program code. , during this process the hotspot code will be executed. At the same time, during the execution of the hotspot code, the hotspot code monitoring instrumentation logic based on the aforementioned instrumentation will automatically record the execution of the relevant hotspot code, such as the record of the number of method calls and the method input parameters. Parameter records, method call chain records, method call time-consuming records, method parameter transfer records, method rewrite records, method function extension records, etc.; when the source program corresponding to the target intermediate bytecode file ends running, through the hotspot code The monitoring instrumentation logic will export the call records of hot code into a binary file. This binary file is also the hot code execution record file in this manual. The exported hot code execution record file can contain the number of method calls according to the hot code monitoring instrumentation logic. , execution time, input parameters, output parameters, and dynamic call chain and other preset monitoring information.
示例性的,如图3,图3是一种源码插桩监测的场景示意图。机器可编程语言可以是Java语言,程序源码文件可称之为Java程序源码文件(简称Java源码);示例性的,Java源码通过javac(Java的编译器前端)编译转换为class文件(也即中间字节码文件),class的文件内容为Java字节码。然后通过预设插桩模块使用字节码操作工具对所述中间字节码文件添加所述热点代码监测插桩逻辑,得到进行插桩后的class文件-目标中间字节码文件,进一步的,在本说明书一个或多个实施例中预设插桩模块支持“on-the-fly”实时插桩和“offline”离线插桩功能,然后运行class文件-目标中间字节码文件,基于热点代码监测插桩逻辑进行运行热点代码过程中的数据导出,可以得到对应的热点代码执行记录文件,后续结合实际需求可以对热点代码执行记录文件进行进一步的数据解析。For example, as shown in Figure 3, Figure 3 is a schematic diagram of a source code instrumentation monitoring scenario. The machine programmable language can be the Java language, and the program source code file can be called a Java program source code file (Java source code for short); for example, the Java source code is compiled and converted into a class file (that is, an intermediate file) through javac (Java compiler front-end). Bytecode file), the file content of class is Java bytecode. Then use the preset instrumentation module to use the bytecode operation tool to add the hotspot code monitoring instrumentation logic to the intermediate bytecode file, and obtain the class file after instrumentation - the target intermediate bytecode file. Further, In one or more embodiments of this specification, it is preset that the instrumentation module supports "on-the-fly" real-time instrumentation and "offline" offline instrumentation functions, and then runs the class file - the target intermediate bytecode file, based on the hotspot code By monitoring the instrumentation logic and exporting data during the running of hot code, the corresponding hot code execution record file can be obtained. Subsequently, the hot code execution record file can be further analyzed based on actual needs.
在本说明书一个或多个实施例中,终端编译程序源码文件对应的中间字节码文件,确定针对程序源码文件的热点代码监测插桩逻辑,为了实现基于字节码操作工具的非侵入式热点代码方法调用监测和调用统计,预先配置了预设插桩模块,基于预设插桩模块使用字节码操作工具对中间字节码文件添加热点代码监测插桩逻辑得到目标中间字节码文件,中间字节码文件进行修改而不是直接修改程序源码文件,再运行目标中间字节码文件就可以获取到热点代码监测插桩逻辑对应的热点代码执行记录文件,从而实现了程序源代码的非侵入式插桩,与侵入式代码插桩方案相比,提高了插桩的自动化程度降低了人工成本,减少了插桩对源码性能的影响,使插桩过程中终端系统包含的众多子模块变得更加便捷高效。In one or more embodiments of this specification, the terminal compiles the intermediate bytecode file corresponding to the program source code file, and determines the hotspot code monitoring instrumentation logic for the program source code file, in order to implement non-intrusive hotspots based on bytecode operation tools. Code method call monitoring and call statistics are pre-configured with a preset instrumentation module. Based on the preset instrumentation module, bytecode operation tools are used to add hot code monitoring and instrumentation logic to the intermediate bytecode file to obtain the target intermediate bytecode file. Modify the intermediate bytecode file instead of directly modifying the program source code file, and then run the target intermediate bytecode file to obtain the hotspot code execution record file corresponding to the hotspot code monitoring instrumentation logic, thus achieving non-intrusion of the program source code. Compared with intrusive code instrumentation solutions, this method improves the automation of instrumentation, reduces labor costs, reduces the impact of instrumentation on source code performance, and makes the many sub-modules included in the terminal system during the instrumentation process More convenient and efficient.
请参见图4,图4是本申请提出的一种插桩处理方法的另一种实施例的流程示意图。具体的:Please refer to Figure 4, which is a schematic flow chart of another embodiment of a staking processing method proposed in this application. specific:
S202:编译程序源码文件对应的中间字节码文件,确定针对所述程序源码文件的热点代码监测插桩逻辑;S202: Compile the intermediate bytecode file corresponding to the program source code file, and determine the hot code monitoring instrumentation logic for the program source code file;
具体的,终端编译程序源码文件对应的中间字节码文件,确定针对所述程序源码文件的热点代码监测插桩逻辑后,终端执行基于预设插桩模块使用字节码操作工具对所述中间字节码文件添加所述热点代码监测插桩逻辑,得到目标中间字节码文件;Specifically, the terminal compiles the intermediate bytecode file corresponding to the program source code file. After determining the hot code monitoring instrumentation logic for the program source code file, the terminal executes the bytecode operation tool based on the preset instrumentation module to analyze the intermediate bytecode file. Add the hotspot code monitoring instrumentation logic to the bytecode file to obtain the target intermediate bytecode file;
进一步的,终端执行基于预设插桩模块使用字节码操作工具对所述中间字节码文件添加所述热点代码监测插桩逻辑,得到目标中间字节码文件,如下:Further, the terminal executes a bytecode operation tool based on the preset instrumentation module to add the hotspot code monitoring instrumentation logic to the intermediate bytecode file to obtain the target intermediate bytecode file, as follows:
预设插桩模块可以支持实时插桩功能和离线插桩功能,实时插桩功能可适用于快速即时的小规模程序插桩,离线插桩功能可适用于大规模系统级插桩。基于不同的需求可以基于相关插桩功能对类型中间字节码文件添加所述热点代码监测插桩逻辑,得到目标中间字节码文件;The preset instrumentation module can support real-time instrumentation function and offline instrumentation function. The real-time instrumentation function can be suitable for fast and instant small-scale program instrumentation, and the offline instrumentation function can be suitable for large-scale system-level instrumentation. Based on different needs, the hot code monitoring instrumentation logic can be added to the type of intermediate bytecode file based on the relevant instrumentation function to obtain the target intermediate bytecode file;
终端确定针对所述程序源码文件的热点代码监测插桩逻辑后,先确定针对热点代码监测插桩逻辑的插桩方式为实时插桩类型或离线插桩类型;After the terminal determines the hot code monitoring instrumentation logic for the program source code file, it first determines that the instrumentation method for the hot code monitoring instrumentation logic is a real-time instrumentation type or an offline instrumentation type;
可选的,确定针对热点代码监测插桩逻辑的插桩方式为实时插桩类型,终端使用字节码操作工具在线运行所述中间字节码文件,将所述预设插桩模块作为程序代理器,采用预设插桩模块基于所述字节码操作工具读取所述中间字节码文件中的字节码类文件,对所述字节码类文件添加热点代码监测插桩逻辑生成目标字节码类文件,对所述中间字节码文件进行针对所述目标字节码类文件的回写处理,得到目标中间字节码文件;Optionally, determine that the instrumentation method for hot code monitoring instrumentation logic is a real-time instrumentation type, the terminal uses a bytecode operation tool to run the intermediate bytecode file online, and uses the preset instrumentation module as a program agent The device uses a preset instrumentation module to read the bytecode class files in the intermediate bytecode file based on the bytecode operation tool, and adds hot code monitoring instrumentation logic generation targets to the bytecode class files. Bytecode file, perform writeback processing on the intermediate bytecode file for the target bytecode file to obtain the target intermediate bytecode file;
示例性的,通过预设插桩模块的on-the-fly实时插桩功能,通过预设插桩模块作为一个程序代理器(JavaAgent),并在其中实现premain方法。在Java中,JavaAgent是一种程序代理器,它可以与目标Java应用程序集成,以修改或增强其行为。这是通过Java的Instrumentation API接口实现的。而premain方法是程序代理器JavaAgent的一个特殊入口点,premain方法在目标应用程序的main方法之前执行(可视作在源程序代码执行之前)。For example, the on-the-fly real-time instrumentation function of the preset instrumentation module is used, and the preset instrumentation module is used as a program agent (JavaAgent), and the premain method is implemented in it. In Java, a JavaAgent is a program agent that integrates with a target Java application to modify or enhance its behavior. This is achieved through Java's Instrumentation API interface. The premain method is a special entry point of the program agent JavaAgent. The premain method is executed before the main method of the target application (can be regarded as before the source program code is executed).
进一步的,在premain方法中,通过预设插桩模块使用到字节码操作工具(如ASM或其他字节码操作库)来读取中间字节码文件中的字节码类文件,可以用到字节码操作工具进行修改或重新写入“热点代码监测插桩逻辑”所对应目标类的字节码,完成对字节码类文件添加热点代码监测插桩逻辑从而生成目标字节码类文件,然后将目标字节码类文件回写至中间字节码文件,得到目标中间字节码文件;Further, in the premain method, the bytecode operation tool (such as ASM or other bytecode operation library) is used through the preset instrumentation module to read the bytecode class file in the intermediate bytecode file. You can use Go to the bytecode operation tool to modify or rewrite the bytecode of the target class corresponding to the "hot code monitoring instrumentation logic", complete adding the hot code monitoring instrumentation logic to the bytecode class file to generate the target bytecode class file, and then write back the target bytecode class file to the intermediate bytecode file to obtain the target intermediate bytecode file;
后续,在运行时,通过Java命令行可以加载JavaAgent,确保了添加热点代码监测插桩逻辑的premain方法在应用程序的main方法之前被执行,从而实现实时插桩。通过利用JavaAgent的premain方法,在类加载的过程中对指定的方法进行字节码增强。通过类加载过程中修改java编译中间产物,也就是字节码,以实现非侵入式不修改源代码的功能添加,可适用于快速即时的小规模程序插桩。Subsequently, at runtime, the JavaAgent can be loaded through the Java command line, ensuring that the premain method that adds hot code monitoring instrumentation logic is executed before the main method of the application, thereby achieving real-time instrumentation. By using the premain method of JavaAgent, bytecode enhancement is performed on the specified method during the class loading process. By modifying the Java compilation intermediate product, that is, the bytecode, during the class loading process, non-intrusive function addition without modifying the source code can be achieved, which is suitable for fast and instant small-scale program instrumentation.
预设插桩模块所支持的on-the-fly实时插桩功能使得将插桩模块作为程序代理器(如Java Agent)在程序开发阶段本地调试时便可以统计热点代码调用次数,on-the-fly实时插桩功能,更灵活快速。The on-the-fly real-time instrumentation function supported by the default instrumentation module allows the instrumentation module to be used as a program agent (such as Java Agent) to count the number of hot code calls during local debugging during the program development stage, on-the- fly's real-time instrumentation function is more flexible and faster.
可选的,确定针对所述热点代码监测插桩逻辑的插桩方式为离线插桩类型,使用字节码操作工具离线运行所述中间字节码文件,将所述中间字节码文件作为字节码,采用预设插桩模块基于所述字节码操作工具和文件输入流方式读取所述中间字节码文件中的字节码类文件,对所述字节码类文件添加热点代码监测插桩逻辑生成目标字节码类文件,基于文件输出流方式对所述中间字节码文件进行针对所述目标字节码类文件的回写处理,得到目标中间字节码文件。Optionally, determine the instrumentation method for the hot code monitoring instrumentation logic as an offline instrumentation type, use a bytecode operation tool to run the intermediate bytecode file offline, and use the intermediate bytecode file as a bytecode. To save code, a preset instrumentation module is used to read the bytecode class files in the intermediate bytecode file based on the bytecode operation tool and the file input stream method, and add hot code to the bytecode class files. The instrumentation logic is monitored to generate a target bytecode class file, and the intermediate bytecode file is written back to the target bytecode class file based on the file output stream mode to obtain the target intermediate bytecode file.
具体的,在软件开发中,特别是在终端大型系统如安卓系统中,对热点代码的跟踪、分析和优化是至关重要的。为了实现热点代码监测目的,用户经常需要使用插桩技术来收集代码的执行信息。对于大规模的系统级插桩,预设插桩模块提供offline插桩功能,也即离线插桩功能。Specifically, in software development, especially in large-scale terminal systems such as Android systems, tracking, analysis, and optimization of hot code are crucial. In order to achieve the purpose of hot code monitoring, users often need to use instrumentation technology to collect code execution information. For large-scale system-level instrumentation, the default instrumentation module provides offline instrumentation function, that is, offline instrumentation function.
示例性的,在javac编译程序源码文件生成中间字节码文件-class文件后,使用字节码操作工具离线运行中间字节码文件,将中间字节码文件视作字节码,采用预设插桩模块基于字节码操作工具和文件输入流方式读取所述中间字节码文件中的字节码类文件,也即:使用文件输入流来读取生成的中间字节码文件,将这些中间字节码文件转化为字节码形式,采用预设插桩模块将其被传递给CustomTransformer的组件。CustomTransformer组件的作用是根据特定的需求或规则对这些字节码进行修改或增强。对这些字节码进行修改或增强的这个过程实现了对字节码类文件添加热点代码监测插桩逻辑生成目标字节码类文件,这种修改或增强可能是根据热点代码监测插桩逻辑插入性能计时器、日志记录语句或其他任何类型的代码,CustomTransformer完成对字节码(也即字节码类文件)进行修改或增强后生成目标字节码类文件,经过自定义插桩的字节码(也即目标字节码类文件)会通过文件输出流写回到原始的中间字节码文件中,替换掉旧的字节码。这样,就实现了非侵入式的离线自定义插桩,其源代码文件保持不变,而中间字节码文件中的字节码已经得到了修改和增强,以生成目标中间字节码文件。For example, after the javac compiler source code file generates the intermediate bytecode file -class file, use the bytecode operation tool to run the intermediate bytecode file offline, regard the intermediate bytecode file as bytecode, and use the default The instrumentation module reads the bytecode class files in the intermediate bytecode file based on the bytecode operation tool and the file input stream method, that is, using the file input stream to read the generated intermediate bytecode file, and These intermediate bytecode files are converted into bytecode form and passed to the CustomTransformer component using the preset instrumentation module. The function of the CustomTransformer component is to modify or enhance these bytecodes according to specific requirements or rules. The process of modifying or enhancing these bytecodes realizes adding hot code monitoring and instrumentation logic to the bytecode class files to generate target bytecode class files. This modification or enhancement may be based on the insertion of hot code monitoring and instrumentation logic. Performance timers, logging statements or any other type of code, CustomTransformer completes the modification or enhancement of the bytecode (that is, the bytecode class file) to generate the target bytecode class file, and the custom instrumented bytes The code (that is, the target bytecode class file) will be written back to the original intermediate bytecode file through the file output stream, replacing the old bytecode. In this way, non-intrusive offline custom instrumentation is achieved, where the source code files remain unchanged and the bytecodes in the intermediate bytecode files have been modified and enhanced to generate the target intermediate bytecode files.
预设插桩模块提供offline插桩功能可适用于大规模的系统级插桩。在终端系统的开发中,由于系统复杂性和代码量的庞大,通过执行本说明书一个或多个实施例的方法可实现对系统各个子模块进行有效的插桩。预设插桩模块提供offline插桩功能通过一次性处理整个系统的字节码,实现了高效率热点代码调用监测。The default instrumentation module provides offline instrumentation functionality and is suitable for large-scale system-level instrumentation. In the development of terminal systems, due to the complexity of the system and the large amount of code, effective instrumentation of each sub-module of the system can be achieved by executing the method of one or more embodiments of this specification. The preset instrumentation module provides offline instrumentation function to achieve high-efficiency hot code call monitoring by processing the bytecode of the entire system at one time.
在后续处理下,可以在系统的编译阶段打开插桩编译宏。这意味着在代码编译成字节码的过程中,目标中间字节码文件已经融入了插桩的逻辑。因此,编译的最终产物目标中间字节码文件(也就是.class文件)已经包含了插桩的代码。这样,当执行时使用这些插桩后的热点代码功能时,系统会自动记录热点代码的调用次数、执行时间等信息。Under subsequent processing, instrumentation compilation macros can be turned on during the compilation phase of the system. This means that during the process of compiling the code into bytecode, the target intermediate bytecode file has been integrated with the instrumentation logic. Therefore, the compiled final product target intermediate bytecode file (that is, the .class file) already contains the instrumentation code. In this way, when these instrumented hot code functions are used during execution, the system will automatically record the number of calls, execution time and other information of the hot code.
S204:运行所述中间字节码文件;S204: Run the intermediate bytecode file;
S206:采用预设插桩模块基于所述字节码操作工具读取所述中间字节码文件中的字节码类文件,对所述字节码类文件添加热点代码监测插桩逻辑生成目标字节码类文件,对所述中间字节码文件进行针对所述目标字节码类文件的回写处理,得到目标中间字节码文件。S206: Use the preset instrumentation module to read the bytecode class files in the intermediate bytecode file based on the bytecode operation tool, and add hot code monitoring instrumentation logic generation targets to the bytecode class files. The bytecode class file performs writeback processing on the target bytecode class file on the intermediate bytecode file to obtain the target intermediate bytecode file.
在一种可行的实施方式中,如图5所示,图5是一种预设插桩模块的示意图,预设插桩模块包括插桩转换器、类读取器、类修改器、类写入器,In a feasible implementation, as shown in Figure 5, Figure 5 is a schematic diagram of a preset instrumentation module. The preset instrumentation module includes an instrumentation converter, a class reader, a class modifier, and a class writer. inserter,
插桩转换器可以称之为Transformer(CustomTransformer),Transformer关联有类读取器、类修改器、类写入器,其中,CustomTransformer中重写的instrument方法会读取class文件中的字节码,并通过关联的类写入器返回添加自定义插桩代码后的字节码。The instrumentation converter can be called Transformer (CustomTransformer). Transformer is associated with class readers, class modifiers, and class writers. Among them, the instrument method rewritten in CustomTransformer will read the bytecode in the class file. And return the bytecode after adding custom instrumentation code through the associated class writer.
类读取器可以称之为ClassReader;类修改器可称之为自定义ClassAdapter(或CustomClassAdapter),类修改器重写了ASM类库中的ClassVisitor方法;类写入器可以称之为ClassWriter,用于回写修改后的类文件。The class reader can be called ClassReader; the class modifier can be called a custom ClassAdapter (or CustomClassAdapter). The class modifier rewrites the ClassVisitor method in the ASM class library; the class writer can be called ClassWriter. To write back the modified class file.
具体执行时可采用如下方式:The following methods can be used for specific implementation:
A2:终端基于字节码操作工具通过插桩转换器控制类读取器读取中间字节码文件中的字节码类文件;A2: The terminal is based on the bytecode operation tool and controls the class reader to read the bytecode class files in the intermediate bytecode file through the instrumentation converter;
A4:基于字节码操作工具通过插桩转换器控制类修改器对字节码类文件添加热点代码监测插桩逻辑生成目标字节码类文件;A4: Based on the bytecode operation tool, add hot code monitoring instrumentation logic to the bytecode class file through the instrumentation converter control class modifier to generate the target bytecode class file;
A6:基于字节码操作工具通过插桩转换器控制类写入器对中间字节码文件进行针对目标字节码类文件的回写处理,得到目标中间字节码文件。A6: Based on the bytecode operation tool, the instrumentation converter controls the class writer to write back the intermediate bytecode file against the target bytecode class file to obtain the target intermediate bytecode file.
具体的,终端获取所述字节码操作工具对应的通知适配器类,获取所述通知适配器类对应的进入方法时方法,通过所述插桩转换器控制所述类读取器截获字节码类文件,基于所述字节码类文件确定目标字节码执行方法,调用所述进入方法时方法将热点代码监测插桩逻辑写入所述目标字节码执行方法中,生成包含所述目标字节码执行方法的目标字节码类文件。Specifically, the terminal obtains the notification adapter class corresponding to the bytecode operation tool, obtains the entry method corresponding to the notification adapter class, and controls the class reader to intercept the bytecode class through the instrumentation converter. file, determine the target bytecode execution method based on the bytecode class file, and when the entry method is called, the hot code monitoring instrumentation logic is written into the target bytecode execution method to generate a file containing the target bytecode. The target bytecode class file for the section code execution method.
例如,如图6所示,图6是本说明书所提供的一种插桩处理的场景示意图。通过类修改器CustomClassAdapter截获类文件(也即字节码类文件),通过重写ClassVisitor(可以理解为访问者模式,相对于类访问对象)的visitMethod方法实现修改逻辑。具体步骤为:1、基于字节码操作工具通过插桩转换器控制类修改器截获类文件,通过重写visitMethod方法(通知适配器类对应的方法)修改相应字节码类文件(相对于热点代码对应的字节码类文件)的方法逻辑以加入(热点代码)插桩逻辑(也即加入插桩逻辑后得到目标字节码类文件)。2、通过插桩转换器控制类写入器重写字节码操作工具(如ASM类库)的AdviceAdapter类的onMethodEnter方法(可以理解为“进入方法时”方法),将热点代码监测插桩逻辑(方法调用次数记录、入参出参记录、调用链记录)插入对应字节码类文件对应方法入口,完成对中间字节码文件进行针对目标字节码类文件的回写处理,得到目标中间字节码文件。For example, as shown in Figure 6, Figure 6 is a schematic diagram of a scenario of instrumentation processing provided in this specification. The class file (that is, the bytecode class file) is intercepted through the class modifier CustomClassAdapter, and the modification logic is implemented by rewriting the visitMethod method of ClassVisitor (which can be understood as the visitor mode, relative to the class access object). The specific steps are: 1. Based on the bytecode operation tool, intercept the class file through the instrumentation converter control class modifier, and modify the corresponding bytecode class file (relative to the hotspot code) by overriding the visitMethod method (notifying the corresponding method of the adapter class) Corresponding bytecode class file) method logic is added (hot code) instrumentation logic (that is, the target bytecode class file is obtained after adding instrumentation logic). 2. Use the instrumentation converter to control the class writer to rewrite the onMethodEnter method of the AdviceAdapter class of the bytecode operation tool (such as the ASM class library) (which can be understood as the "when entering the method" method), and monitor the hot code instrumentation logic. (Record of the number of method calls, record of input and output parameters, and call chain record) Insert the corresponding method entry of the corresponding bytecode class file, complete the write-back processing of the intermediate bytecode file for the target bytecode class file, and obtain the target intermediate Bytecode file.
示例性的,如图7所示,图7是一种热点代码调用次数记录的示意图;图7示意出了基于热点代码监测插桩逻辑针对热点代码方法的执行调用次数记录的详细流程,先生成热点代码方法唯一ID(也即图示中“获取方法信息生成唯一ID”步骤),获取热点代码方法所在“字节码类”与“入参出参”参数,随后判断热点代码方法是否可以插桩(也即插入热点代码监测插桩逻辑),Exemplarily, as shown in Figure 7, Figure 7 is a schematic diagram of recording the number of calls to hot code methods; Figure 7 illustrates the detailed process of recording the number of execution calls of hot code methods based on hot code monitoring instrumentation logic. First, generate The unique ID of the hot code method (that is, the "Get method information to generate a unique ID" step in the figure), obtain the "bytecode class" and "input and output parameters" parameters of the hot code method, and then determine whether the hot code method can be inserted Stub (that is, insert hot code to monitor the stub logic),
如果可以插桩,则控制类修改器对字节码类文件添加热点代码监测插桩逻辑,具体为通过onMethodEnterDo方法(也即进入方法时方法)实现每次进入方法时对CustomData(在内存中存储的方法调用记录数据结构)中相同ID的热点代码方法调用次数加1。If instrumentation is possible, the control class modifier adds hot code monitoring instrumentation logic to the bytecode class file. Specifically, the onMethodEnterDo method (that is, the method when entering the method) is used to implement the CustomData (stored in memory) each time the method is entered. The number of hotspot code method calls with the same ID in the method call record data structure) is increased by 1.
可选的,热点代码方法的方法入口是否可以插桩可以通过判断条件:不对热点代码方法属于“桥接方法与编译器自动生成的方法”类型进行插桩;Optionally, whether the method entry of the hot code method can be instrumented can be determined by judging the conditions: the hot code method belongs to the "bridging method and the method automatically generated by the compiler" type; instrumentation is not performed;
S208:运行所述目标中间字节码文件,记录所述热点代码监测插桩逻辑对应的热点代码执行记录文件;S208: Run the target intermediate bytecode file, and record the hotspot code execution record file corresponding to the hotspot code monitoring instrumentation logic;
具体可参考本说明书其他实施例方法步骤,此处不再赘述。For details, please refer to the method steps in other embodiments of this specification, and they will not be described again here.
S210:通过数据导出模块通过文件输出流导出所述热点代码执行记录文件,并将所述热点代码执行记录文件存储至设备文件系统。S210: Export the hotspot code execution record file through the file output stream through the data export module, and store the hotspot code execution record file in the device file system.
在中间字节码文件-class文件插桩过程中,热点代码监测插桩逻辑对应配置了热点代码的调用记录数据结构,热点代码的调用记录数据结构会被插入中间字节码文件-class文件中。调用记录包含两层数据结构:数据结构顶层为热点代码类文件“热点代码类对应方法的唯一ID(ClassId)与自定义数据CustomData”的映射对应关系,其中CustomData包含热点代码类中每一个被插桩的热点代码方法的唯一ID(MethodId)与类方法执行记录参数(例如执行次数、执行耗时等)的对应关系。程序执行完毕后,所有数据通过文件输出流写入热点代码执行记录文件,热点代码执行记录文件是一种二进制文件(如CustomEc文件),并存储到终端的设备文件系统During the instrumentation process of the intermediate bytecode file-class file, the hotspot code monitoring instrumentation logic is configured with the call record data structure of the hotspot code. The call record data structure of the hotspot code will be inserted into the intermediate bytecode file-class file. . The call record contains two layers of data structures: The top level of the data structure is the mapping relationship between the hot code class file "the unique ID (ClassId) of the corresponding method of the hot code class and the custom data CustomData", where CustomData contains each inserted data in the hot code class. The corresponding relationship between the unique ID (MethodId) of the stub's hot code method and the class method execution record parameters (such as the number of executions, execution time, etc.). After the program is executed, all data is written into the hotspot code execution record file through the file output stream. The hotspot code execution record file is a binary file (such as a CustomEc file) and is stored in the terminal's device file system.
S212:通过数据解析模块读取所述热点代码执行记录文件,对所述热点代码执行记录文件进行图解析处理,得到图数据类型的方法调用数据列表,将所述方法调用数据列表存入数据库。S212: Read the hotspot code execution record file through the data analysis module, perform graph analysis on the hotspot code execution record file, obtain a method call data list of the graph data type, and store the method call data list in the database.
数据解析模块由FileReader组成,其数据解析模块处理主要流程为:读取热点代码执行记录文件(二进制文件),通过文件输入流将热点代码执行记录文件还原为Map数据类型(即数据导出模块中ClassId与CustomData的对应关系),然后截获CustomData包含的(热点代码)方法调用数据,最后生成方法调用数据列表并存入数据库。The data parsing module is composed of FileReader. The main processing process of the data parsing module is: reading the hot code execution record file (binary file), and restoring the hot code execution record file to the Map data type (i.e. ClassId in the data export module) through the file input stream. corresponding relationship with CustomData), then intercept the (hot code) method call data contained in CustomData, and finally generate a method call data list and store it in the database.
上述方式通过诸如ASM库等字节码操作工具实现了非侵入式的热点代码统计,不影响原有程序源码的逻辑和性能,提供了灵活的插桩方式,并支持大规模的系统级插桩。The above method achieves non-intrusive hot code statistics through bytecode manipulation tools such as the ASM library, does not affect the logic and performance of the original program source code, provides a flexible instrumentation method, and supports large-scale system-level instrumentation .
在本说明书一个或多个实施例中,通过上述方式同时实现了on-the-fly插桩与offline插桩,其中on-the-fly允许用户(如开发人员)将预设插桩模块作为JavaAgent在程序开发阶段本地调试时便可以统计热点代码调用情况,对开发人员来说,这种插桩手段更灵活快速。offline插桩适用于大批量插桩场景,如针对系统各个子模块的插桩。在该应用场景下,可以在终端系统编译的时候打开插桩编译宏,实现大批量代码插桩,这样编译的产物就包含了插桩的代码。在执行时运行插桩后的代码功能时就会自动记录热点代码的调用次数等信息。以及,与传统侵入式代码埋点手法相比,扩展性更强。In one or more embodiments of this specification, on-the-fly instrumentation and offline instrumentation are simultaneously implemented in the above manner, where on-the-fly allows users (such as developers) to use the default instrumentation module as a JavaAgent During local debugging during the program development phase, hot code calls can be counted. For developers, this instrumentation method is more flexible and faster. Offline instrumentation is suitable for large-scale instrumentation scenarios, such as instrumentation for each sub-module of the system. In this application scenario, you can turn on the instrumentation compilation macro when compiling the terminal system to implement large-scale code instrumentation, so that the compiled product contains the instrumentation code. When the instrumented code function is run during execution, information such as the number of calls to the hotspot code will be automatically recorded. And, compared with traditional intrusive code burying techniques, it is more scalable.
下面将结合图8,对本申请实施例提供的插桩处理装置进行详细介绍。需要说明的是,图8所示的插桩处理装置,用于执行本申请图1~图7所示实施例的方法,为了便于说明,仅示出了与本申请实施例相关的部分,具体技术细节未揭示的,请参照本申请图1~图7所示的实施例。The staking processing device provided by the embodiment of the present application will be introduced in detail below with reference to FIG. 8 . It should be noted that the instrumentation processing device shown in Figure 8 is used to perform the methods of the embodiments shown in Figures 1 to 7 of the present application. For convenience of explanation, only the parts related to the embodiments of the present application are shown. Specifically, If the technical details are not disclosed, please refer to the embodiments shown in Figures 1 to 7 of this application.
请参见图8,其示出本申请实施例的插桩处理装置的结构示意图。该插桩处理装置1可以通过软件、硬件或者两者的结合实现成为用户终端的全部或一部分。根据一些实施例,该插桩处理装置1包括编译模块11、插桩模块12和运行模块13,具体用于:Please refer to FIG. 8 , which shows a schematic structural diagram of a pile insertion processing device according to an embodiment of the present application. The instrumentation processing device 1 can be implemented as all or part of the user terminal through software, hardware, or a combination of both. According to some embodiments, the instrumentation processing device 1 includes a compilation module 11, an instrumentation module 12 and an execution module 13, specifically for:
编译模块11,用于编译程序源码文件对应的中间字节码文件,确定针对所述程序源码文件的热点代码监测插桩逻辑;The compilation module 11 is used to compile the intermediate bytecode file corresponding to the program source code file, and determine the hot code monitoring instrumentation logic for the program source code file;
插桩模块12,用于基于预设插桩模块使用字节码操作工具对所述中间字节码文件添加所述热点代码监测插桩逻辑,得到目标中间字节码文件;The instrumentation module 12 is configured to use the bytecode operation tool to add the hotspot code monitoring instrumentation logic to the intermediate bytecode file based on the preset instrumentation module to obtain the target intermediate bytecode file;
运行模块13,用于运行所述目标中间字节码文件,获取所述热点代码监测插桩逻辑对应的热点代码执行记录文件Running module 13 is used to run the target intermediate bytecode file and obtain the hotspot code execution record file corresponding to the hotspot code monitoring instrumentation logic.
可选的,如图6所示,所述装置1,包括:Optionally, as shown in Figure 6, the device 1 includes:
可选的,所述插桩模块12,用于:Optionally, the instrumentation module 12 is used for:
使用字节码操作工具运行所述中间字节码文件;Use a bytecode manipulation tool to run the intermediate bytecode file;
采用预设插桩模块基于所述字节码操作工具读取所述中间字节码文件中的字节码类文件,对所述字节码类文件添加热点代码监测插桩逻辑生成目标字节码类文件,对所述中间字节码文件进行针对所述目标字节码类文件的回写处理,得到目标中间字节码文件。A preset instrumentation module is used to read the bytecode class files in the intermediate bytecode file based on the bytecode operation tool, and the hotspot code is added to the bytecode class file to monitor the instrumentation logic to generate target bytes. code class file, perform writeback processing on the target bytecode class file on the intermediate bytecode file to obtain the target intermediate bytecode file.
可选的,所述预设插桩模块包括插桩转换器、类读取器、类修改器、类写入器,所述插桩模块12,用于:Optionally, the preset instrumentation module includes an instrumentation converter, a class reader, a class modifier, and a class writer. The instrumentation module 12 is used for:
基于所述字节码操作工具通过所述插桩转换器控制所述类读取器读取所述中间字节码文件中的字节码类文件;Control the class reader to read the bytecode class file in the intermediate bytecode file through the instrumentation converter based on the bytecode operation tool;
基于所述字节码操作工具通过所述插桩转换器控制所述类修改器对所述字节码类文件添加热点代码监测插桩逻辑生成目标字节码类文件;Based on the bytecode operation tool, the instrumentation converter controls the class modifier to add hot code to the bytecode class file and monitor the instrumentation logic to generate a target bytecode class file;
基于所述字节码操作工具通过所述插桩转换器控制所述类写入器对所述中间字节码文件进行针对所述目标字节码类文件的回写处理,得到目标中间字节码文件。Based on the bytecode operation tool, the instrumentation converter controls the class writer to perform writeback processing on the intermediate bytecode file for the target bytecode class file to obtain the target intermediate byte code file.
可选的,所述插桩模块12,用于:Optionally, the instrumentation module 12 is used for:
获取所述字节码操作工具对应的通知适配器类,获取所述通知适配器类对应的进入方法时方法;Obtain the notification adapter class corresponding to the bytecode operation tool, and obtain the entry method method corresponding to the notification adapter class;
通过所述插桩转换器控制所述类读取器截获字节码类文件,基于所述字节码类文件确定目标字节码执行方法,调用所述进入方法时方法将热点代码监测插桩逻辑写入所述目标字节码执行方法中,生成包含所述目标字节码执行方法的目标字节码类文件。The class reader is controlled by the instrumentation converter to intercept the bytecode class file, the target bytecode execution method is determined based on the bytecode class file, and the hot code monitoring instrumentation is performed when the entry method is called. The logic is written into the target bytecode execution method, and a target bytecode class file containing the target bytecode execution method is generated.
可选的,所述插桩模块12,用于:确定针对所述热点代码监测插桩逻辑的插桩方式为实时插桩类型,使用字节码操作工具在线运行所述中间字节码文件,将所述预设插桩模块作为程序代理器,采用预设插桩模块基于所述字节码操作工具读取所述中间字节码文件中的字节码类文件,对所述字节码类文件添加热点代码监测插桩逻辑生成目标字节码类文件,对所述中间字节码文件进行针对所述目标字节码类文件的回写处理,得到目标中间字节码文件;Optionally, the instrumentation module 12 is used to: determine that the instrumentation method for monitoring the instrumentation logic for the hotspot code is a real-time instrumentation type, and use a bytecode operation tool to run the intermediate bytecode file online, The preset instrumentation module is used as a program agent, and the preset instrumentation module is used to read the bytecode class files in the intermediate bytecode file based on the bytecode operation tool, and then Add hot code monitoring and instrumentation logic to the class file to generate a target bytecode class file, perform writeback processing on the intermediate bytecode file for the target bytecode class file, and obtain the target intermediate bytecode file;
确定针对所述热点代码监测插桩逻辑的插桩方式为离线插桩类型,使用字节码操作工具离线运行所述中间字节码文件,将所述中间字节码文件作为字节码,采用预设插桩模块基于所述字节码操作工具和文件输入流方式读取所述中间字节码文件中的字节码类文件,对所述字节码类文件添加热点代码监测插桩逻辑生成目标字节码类文件,基于文件输出流方式对所述中间字节码文件进行针对所述目标字节码类文件的回写处理,得到目标中间字节码文件。Determine that the instrumentation method for the hot code monitoring instrumentation logic is the offline instrumentation type, use the bytecode operation tool to run the intermediate bytecode file offline, use the intermediate bytecode file as bytecode, and use The preset instrumentation module reads the bytecode class files in the intermediate bytecode file based on the bytecode operation tool and the file input stream method, and adds hot code monitoring instrumentation logic to the bytecode class files. Generate a target bytecode class file, and perform writeback processing on the target bytecode class file based on the file output stream mode to obtain the target intermediate bytecode file.
可选的,所述编译模块11,用于:Optionally, the compilation module 11 is used for:
获取针对所述程序源码文件所输入的热点代码监测方式,所述热点代码监测方式包括方法调用次数记录、方法入参出参记录、方法调用链记录、方法调用耗时记录、方法传参记录、方法重写记录、方法功能扩展记录中的至少一种;Obtain the hot code monitoring method input for the program source code file. The hot code monitoring method includes method call number records, method input and output parameter records, method call chain records, method call time-consuming records, method parameter transfer records, At least one of method rewriting records and method function extension records;
基于所述热点代码监测方式生成热点代码监测插桩逻辑。Hotspot code monitoring instrumentation logic is generated based on the hotspot code monitoring method.
可选的,所述运行模块,用于:Optional, the running module is used for:
运行所述目标中间字节码文件,记录所述热点代码监测插桩逻辑对应的热点代码执行记录文件;Run the target intermediate bytecode file and record the hotspot code execution record file corresponding to the hotspot code monitoring instrumentation logic;
通过数据导出模块通过文件输出流导出所述热点代码执行记录文件,并将所述热点代码执行记录文件存储至设备文件系统。The hot code execution record file is exported through the file output stream through the data export module, and the hot code execution record file is stored in the device file system.
可选的,所述装置1:Optional, the device 1:
通过数据解析模块读取所述热点代码执行记录文件,对所述热点代码执行记录文件进行图解析处理,得到图数据类型的方法调用数据列表,将所述方法调用数据列表存入数据库。The hotspot code execution record file is read through the data analysis module, and graph analysis is performed on the hotspot code execution record file to obtain a method call data list of the graph data type, and the method call data list is stored in the database.
需要说明的是,上述实施例提供的插桩处理装置在执行插桩处理方法时,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将设备的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。另外,上述实施例提供的插桩处理装置与插桩处理方法实施例属于同一构思,其体现实现过程详见方法实施例,这里不再赘述。It should be noted that when the instrumentation processing device provided in the above embodiments performs the instrumentation processing method, only the division of the above functional modules is used as an example. In practical applications, the above functions can be allocated to different functions as needed. Module completion means dividing the internal structure of the device into different functional modules to complete all or part of the functions described above. In addition, the instrumentation processing device and the instrumentation processing method embodiment provided in the above embodiments belong to the same concept. For details of the implementation process, please refer to the method embodiment, which will not be described again here.
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。The above serial numbers of the embodiments of the present application are only for description and do not represent the advantages and disadvantages of the embodiments.
本申请实施例还提供了一种计算机存储介质,所述计算机存储介质可以存储有多条指令,所述指令适于由处理器加载并执行如上述图1~图7所示实施例的所述插桩处理方法,具体执行过程可以参见图1~图7所示实施例的具体说明,在此不进行赘述。Embodiments of the present application also provide a computer storage medium. The computer storage medium can store multiple instructions. The instructions are suitable to be loaded and executed by the processor as described in the embodiments shown in Figures 1 to 7. For the specific execution process of the instrumentation processing method, please refer to the specific description of the embodiment shown in Figures 1 to 7, and will not be described in detail here.
本申请还提供了一种计算机程序产品,该计算机程序产品存储有至少一条指令,所述至少一条指令由所述处理器加载并执行如上述图1~图7所示实施例的所述插桩处理方法,具体执行过程可以参见图1~图7所示实施例的具体说明,在此不进行赘述。This application also provides a computer program product, which stores at least one instruction. The at least one instruction is loaded by the processor and executes the instrumentation as shown in the above embodiments shown in Figures 1 to 7. For the processing method and specific execution process, please refer to the specific description of the embodiment shown in Figures 1 to 7, and will not be described again here.
请参考图9,其示出了本申请一个示例性实施例提供的电子设备的结构方框图。本申请中的电子设备可以包括一个或多个如下部件:处理器110、存储器120、输入装置130、输出装置140和总线150。处理器110、存储器120、输入装置130和输出装置140之间可以通过总线150连接。Please refer to FIG. 9 , which shows a structural block diagram of an electronic device provided by an exemplary embodiment of the present application. The electronic device in this application may include one or more of the following components: a processor 110, a memory 120, an input device 130, an output device 140, and a bus 150. The processor 110, the memory 120, the input device 130 and the output device 140 may be connected through a bus 150.
处理器110可以包括一个或者多个处理核心。处理器110利用各种接口和线路连接整个电子设备内的各个部分,通过运行或执行存储在存储器120内的指令、程序、代码集或指令集,以及调用存储在存储器120内的数据,执行电子设备100的各种功能和处理数据。可选地,处理器110可以采用数字信号处理(digital signal processing,DSP)、现场可编程门阵列(field-programmable gate array,FPGA)、可编程逻辑阵列(programmable logicArray,PLA)中的至少一种硬件形式来实现。处理器110可集成中央处理器(centralprocessing unit,CPU)、图像处理器(graphics processing unit,GPU)和调制解调器等中的一种或几种的组合。其中,CPU主要处理操作系统、用户界面和应用程序等;GPU用于负责显示内容的渲染和绘制;调制解调器用于处理无线通信。可以理解的是,上述调制解调器也可以不集成到处理器110中,单独通过一块通信芯片进行实现。Processor 110 may include one or more processing cores. The processor 110 uses various interfaces and lines to connect various parts of the entire electronic device, and executes electronic devices by running or executing instructions, programs, code sets or instruction sets stored in the memory 120, and calling data stored in the memory 120. Various functions and processing data of device 100. Optionally, the processor 110 may adopt at least one of digital signal processing (DSP), field-programmable gate array (FPGA), and programmable logic array (PLA). implemented in hardware form. The processor 110 may integrate one or a combination of a central processing unit (CPU), a graphics processing unit (GPU), a modem, and the like. Among them, the CPU mainly handles the operating system, user interface, and applications; the GPU is responsible for rendering and drawing the display content; and the modem is used to handle wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 110 and may be implemented solely through a communication chip.
存储器120可以包括随机存储器(random Access Memory,RAM),也可以包括只读存储器(read-only memory,ROM)。可选地,该存储器120包括非瞬时性计算机可读介质(non-transitory computer-readable storage medium)。存储器120可用于存储指令、程序、代码、代码集或指令集。存储器120可包括存储程序区和存储数据区,其中,存储程序区可存储用于实现操作系统的指令、用于实现至少一个功能的指令(比如触控功能、声音播放功能、图像播放功能等)、用于实现下述各个方法实施例的指令等,该操作系统可以是安卓(Android)系统,包括基于Android系统深度开发的系统、苹果公司开发的IOS系统,包括基于IOS系统深度开发的系统或其它系统。存储数据区还可以存储电子设备在使用中所创建的数据比如电话本、音视频数据、聊天记录数据,等。The memory 120 may include random access memory (RAM) or read-only memory (ROM). Optionally, the memory 120 includes non-transitory computer-readable storage medium. Memory 120 may be used to store instructions, programs, codes, sets of codes, or sets of instructions. The memory 120 may include a program storage area and a data storage area, where the program storage area may store instructions for implementing an operating system and instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.) , instructions for implementing each of the following method embodiments, etc., the operating system can be an Android system, including a system developed in depth based on the Android system, an IOS system developed by Apple, including a system developed in depth based on the IOS system, or Other systems. The storage data area can also store data created during use of the electronic device, such as phone books, audio and video data, chat record data, etc.
参见图10所示,存储器120可分为操作系统空间和用户空间,操作系统即运行于操作系统空间,原生及第三方应用程序即运行于用户空间。为了保证不同第三方应用程序均能够达到较好的运行效果,操作系统针对不同第三方应用程序为其分配相应的系统资源。然而,同一第三方应用程序中不同应用场景对系统资源的需求也存在差异,比如,在本地资源加载场景下,第三方应用程序对磁盘读取速度的要求较高;在动画渲染场景下,第三方应用程序则对GPU性能的要求较高。而操作系统与第三方应用程序之间相互独立,操作系统往往不能及时感知第三方应用程序当前的应用场景,导致操作系统无法根据第三方应用程序的具体应用场景进行针对性的系统资源适配。As shown in FIG. 10 , the memory 120 can be divided into operating system space and user space. The operating system runs in the operating system space, and native and third-party applications run in the user space. In order to ensure that different third-party applications can achieve better operating results, the operating system allocates corresponding system resources to different third-party applications. However, different application scenarios in the same third-party application also have different requirements for system resources. For example, in the local resource loading scenario, the third-party application has higher requirements for disk reading speed; in the animation rendering scenario, the Third-party applications have higher requirements for GPU performance. The operating system and third-party applications are independent of each other, and the operating system is often unable to detect the current application scenarios of third-party applications in a timely manner, resulting in the operating system being unable to perform targeted system resource adaptation according to the specific application scenarios of third-party applications.
为了使操作系统能够区分第三方应用程序的具体应用场景,需要打通第三方应用程序与操作系统之间的数据通信,使得操作系统能够随时获取第三方应用程序当前的场景信息,进而基于当前场景进行针对性的系统资源适配。In order for the operating system to distinguish the specific application scenarios of third-party applications, it is necessary to open up data communication between the third-party applications and the operating system, so that the operating system can obtain the current scenario information of the third-party applications at any time, and then perform operations based on the current scenario. Targeted system resource adaptation.
以操作系统为Android系统为例,存储器120中存储的程序和数据如图11所示,存储器120中可存储有Linux内核层320、系统运行时库层340、应用框架层360和应用层380,其中,Linux内核层320、系统运行库层340和应用框架层360属于操作系统空间,应用层380属于用户空间。Linux内核层320为电子设备的各种硬件提供了底层的驱动,如显示驱动、音频驱动、摄像头驱动、蓝牙驱动、Wi-Fi驱动、电源管理等。系统运行库层340通过一些C/C++库来为Android系统提供了主要的特性支持。如SQLite库提供了数据库的支持,OpenGL/ES库提供了3D绘图的支持,Webkit库提供了浏览器内核的支持等。在系统运行时库层340中还提供有安卓运行时库(Android runtime),它主要提供了一些核心库,能够允许开发者使用Java语言来编写Android应用。应用框架层360提供了构建应用程序时可能用到的各种API,开发者也可以通过使用这些API来构建自己的应用程序,比如活动管理、窗口管理、视图管理、通知管理、内容提供者、包管理、通话管理、资源管理、定位管理。应用层380中运行有至少一个应用程序,这些应用程序可以是操作系统自带的原生应用程序,比如联系人程序、短信程序、时钟程序、相机应用等;也可以是第三方开发者所开发的第三方应用程序,比如游戏类应用程序、即时通信程序、相片美化程序等。Taking the operating system as an Android system as an example, the programs and data stored in the memory 120 are shown in Figure 11. The memory 120 can store a Linux kernel layer 320, a system runtime library layer 340, an application framework layer 360 and an application layer 380. Among them, the Linux kernel layer 320, the system runtime layer 340 and the application framework layer 360 belong to the operating system space, and the application layer 380 belongs to the user space. The Linux kernel layer 320 provides underlying drivers for various hardware of electronic devices, such as display drivers, audio drivers, camera drivers, Bluetooth drivers, Wi-Fi drivers, power management, etc. The system runtime library layer 340 provides main feature support for the Android system through some C/C++ libraries. For example, the SQLite library provides database support, the OpenGL/ES library provides 3D drawing support, and the Webkit library provides browser kernel support, etc. The system runtime library layer 340 also provides an Android runtime library (Android runtime), which mainly provides some core libraries and allows developers to write Android applications using Java language. The application framework layer 360 provides various APIs that may be used when building applications. Developers can also use these APIs to build their own applications, such as activity management, window management, view management, notification management, content providers, Package management, call management, resource management, positioning management. At least one application program runs in the application layer 380. These applications can be native applications that come with the operating system, such as contact programs, SMS programs, clock programs, camera applications, etc.; they can also be developed by third-party developers. Third-party applications, such as game applications, instant messaging programs, photo beautification programs, etc.
以操作系统为IOS系统为例,存储器120中存储的程序和数据如图11所示,IOS系统包括:核心操作系统层420(Core OS layer)、核心服务层440(Core Services layer)、媒体层460(Media layer)、可触摸层480(Cocoa Touch Layer)。核心操作系统层420包括了操作系统内核、驱动程序以及底层程序框架,这些底层程序框架提供更接近硬件的功能,以供位于核心服务层440的程序框架所使用。核心服务层440提供给应用程序所需要的系统服务和/或程序框架,比如基础(Foundation)框架、账户框架、广告框架、数据存储框架、网络连接框架、地理位置框架、运动框架等等。媒体层460为应用程序提供有关视听方面的接口,如图形图像相关的接口、音频技术相关的接口、视频技术相关的接口、音视频传输技术的无线播放(AirPlay)接口等。可触摸层480为应用程序开发提供了各种常用的界面相关的框架,可触摸层480负责用户在电子设备上的触摸交互操作。比如本地通知服务、远程推送服务、广告框架、游戏工具框架、消息用户界面接口(User Interface,UI)框架、用户界面UIKit框架、地图框架等等。Taking the operating system as an IOS system as an example, the programs and data stored in the memory 120 are shown in Figure 11. The IOS system includes: a core operating system layer 420 (Core OS layer), a core service layer 440 (Core Services layer), and a media layer. 460 (Media layer), touchable layer 480 (Cocoa Touch Layer). The core operating system layer 420 includes the operating system kernel, drivers and underlying program frameworks. These underlying program frameworks provide functions closer to hardware for use by the program framework located in the core service layer 440 . The core service layer 440 provides system services and/or program frameworks required by applications, such as foundation framework, account framework, advertising framework, data storage framework, network connection framework, geographical location framework, sports framework, etc. The media layer 460 provides audio-visual interfaces for applications, such as interfaces related to graphics and images, interfaces related to audio technology, interfaces related to video technology, wireless playback (AirPlay) interfaces of audio and video transmission technology, etc. The touchable layer 480 provides various commonly used interface-related frameworks for application development. The touchable layer 480 is responsible for the user's touch interaction operations on the electronic device. For example, local notification service, remote push service, advertising framework, game tool framework, message user interface interface (User Interface, UI) framework, user interface UIKit framework, map framework, etc.
在图12所示出的框架中,与大部分应用程序有关的框架包括但不限于:核心服务层440中的基础框架和可触摸层480中的UIKit框架。基础框架提供许多基本的对象类和数据类型,为所有应用程序提供最基本的系统服务,和UI无关。而UIKit框架提供的类是基础的UI类库,用于创建基于触摸的用户界面,iOS应用程序可以基于UIKit框架来提供UI,所以它提供了应用程序的基础架构,用于构建用户界面,绘图、处理和用户交互事件,响应手势等等。In the framework shown in FIG. 12 , frameworks related to most applications include but are not limited to: the basic framework in the core service layer 440 and the UIKit framework in the touchable layer 480 . The basic framework provides many basic object classes and data types, providing the most basic system services for all applications, regardless of the UI. The classes provided by the UIKit framework are basic UI class libraries, used to create touch-based user interfaces. iOS applications can provide UI based on the UIKit framework, so it provides the application infrastructure for building user interfaces, drawing , handle user interaction events, respond to gestures, etc.
其中,在IOS系统中实现第三方应用程序与操作系统数据通信的方式以及原理可参考Android系统,本申请在此不再赘述。Among them, the method and principle of realizing data communication between third-party applications and the operating system in the IOS system can be referred to the Android system, which will not be described in detail here in this application.
其中,输入装置130用于接收输入的指令或数据,输入装置130包括但不限于键盘、鼠标、摄像头、麦克风或触控设备。输出装置140用于输出指令或数据,输出装置140包括但不限于显示设备和扬声器等。在一个示例中,输入装置130和输出装置140可以合设,输入装置130和输出装置140为触摸显示屏,该触摸显示屏用于接收用户使用手指、触摸笔等任何适合的物体在其上或附近的触摸操作,以及显示各个应用程序的用户界面。触摸显示屏通常设置在电子设备的前面板。触摸显示屏可被设计成为全面屏、曲面屏或异型屏。触摸显示屏还可被设计成为全面屏与曲面屏的结合,异型屏与曲面屏的结合,本申请实施例对此不加以限定。The input device 130 is used to receive input instructions or data, and the input device 130 includes but is not limited to a keyboard, a mouse, a camera, a microphone, or a touch device. The output device 140 is used to output instructions or data, and the output device 140 includes but is not limited to a display device and a speaker. In one example, the input device 130 and the output device 140 may be co-located. The input device 130 and the output device 140 may be a touch display screen. The touch display screen is used to receive the user's movement of a finger, a touch pen, or any other suitable object on the display screen or the display screen. Nearby touch operations, as well as displaying the user interface of individual applications. Touch display screens are usually provided on the front panels of electronic devices. Touch display screens can be designed as full screens, curved screens or special-shaped screens. The touch display screen can also be designed as a combination of a full screen and a curved screen, or a combination of a special-shaped screen and a curved screen, which are not limited in the embodiments of the present application.
除此之外,本领域技术人员可以理解,上述附图所示出的电子设备的结构并不构成对电子设备的限定,电子设备可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。比如,电子设备中还包括射频电路、输入单元、传感器、音频电路、无线保真(wireless fidelity,WiFi)模块、电源、蓝牙模块等部件,在此不再赘述。In addition, those skilled in the art can understand that the structure of the electronic device shown in the above drawings does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than those shown in the figures, or a combination of certain components. components, or different component arrangements. For example, electronic equipment also includes radio frequency circuits, input units, sensors, audio circuits, wireless fidelity (WiFi) modules, power supplies, Bluetooth modules and other components, which will not be described again here.
在本申请实施例中,各步骤的执行主体可以是上文介绍的电子设备。可选地,各步骤的执行主体为电子设备的操作系统。操作系统可以是安卓系统,也可以是IOS系统,或者其它操作系统,本申请实施例对此不作限定。In the embodiment of the present application, the execution subject of each step may be the electronic device introduced above. Optionally, the execution subject of each step is the operating system of the electronic device. The operating system may be an Android system, an IOS system, or other operating systems, which are not limited in the embodiments of this application.
本申请实施例的电子设备,其上还可以安装有显示设备,显示设备可以是各种能实现显示功能的设备,例如:阴极射线管显示器(cathode ray tubedisplay,简称CR)、发光二极管显示器(light-emitting diode display,简称LED)、电子墨水屏、液晶显示屏(liquid crystal display,简称LCD)、等离子显示面板(plasma display panel,简称PDP)等。用户可以利用电子设备101上的显示设备,来查看显示的文字、图像、视频等信息。所述电子设备可以是智能手机、平板电脑、游戏设备、AR(Augmented Reality,增强现实)设备、汽车、数据存储装置、音频播放装置、视频播放装置、笔记本、桌面计算设备、可穿戴设备诸如电子手表、电子眼镜、电子头盔、电子手链、电子项链、电子衣物等设备。The electronic device in the embodiment of the present application can also be equipped with a display device. The display device can be a variety of devices that can realize display functions, such as: cathode ray tube display (cathode ray tube display, CR for short), light emitting diode display (light emitting diode display) -emitting diode display (LED), electronic ink screen, liquid crystal display (LCD), plasma display panel (PDP), etc. The user can use the display device on the electronic device 101 to view displayed text, images, videos and other information. The electronic device may be a smartphone, a tablet computer, a game device, an AR (Augmented Reality, augmented reality) device, a car, a data storage device, an audio playback device, a video playback device, a notebook, a desktop computing device, a wearable device such as an electronic device. Watches, electronic glasses, electronic helmets, electronic bracelets, electronic necklaces, electronic clothing and other equipment.
在图9所示的电子设备中,其中电子设备可以是一种终端,处理器110可以用于调用存储器120中存储的应用程序,并具体执行以下操作:In the electronic device shown in FIG. 9 , where the electronic device may be a terminal, the processor 110 may be used to call the application program stored in the memory 120 and specifically perform the following operations:
编译程序源码文件对应的中间字节码文件,确定针对所述程序源码文件的热点代码监测插桩逻辑;Compile the intermediate bytecode file corresponding to the program source code file, and determine the hot code monitoring instrumentation logic for the program source code file;
基于预设插桩模块使用字节码操作工具对所述中间字节码文件添加所述热点代码监测插桩逻辑,得到目标中间字节码文件;Use a bytecode operation tool to add the hotspot code monitoring instrumentation logic to the intermediate bytecode file based on the preset instrumentation module to obtain the target intermediate bytecode file;
运行所述目标中间字节码文件,获取所述热点代码监测插桩逻辑对应的热点代码执行记录文件。Run the target intermediate bytecode file to obtain the hotspot code execution record file corresponding to the hotspot code monitoring instrumentation logic.
在一个实施例中,所述处理器110在执行所述基于预设插桩模块使用字节码操作工具对所述中间字节码文件添加所述热点代码监测插桩逻辑,得到目标中间字节码文件,执行以下操作:In one embodiment, the processor 110 uses a bytecode operation tool to add the hotspot code monitoring instrumentation logic to the intermediate bytecode file based on the preset instrumentation module to obtain the target intermediate byte. code file, perform the following operations:
使用字节码操作工具运行所述中间字节码文件;Use a bytecode manipulation tool to run the intermediate bytecode file;
采用预设插桩模块基于所述字节码操作工具读取所述中间字节码文件中的字节码类文件,对所述字节码类文件添加热点代码监测插桩逻辑生成目标字节码类文件,对所述中间字节码文件进行针对所述目标字节码类文件的回写处理,得到目标中间字节码文件。A preset instrumentation module is used to read the bytecode class files in the intermediate bytecode file based on the bytecode operation tool, and the hotspot code is added to the bytecode class file to monitor the instrumentation logic to generate target bytes. code class file, perform writeback processing on the target bytecode class file on the intermediate bytecode file to obtain the target intermediate bytecode file.
在一个实施例中,所述预设插桩模块包括插桩转换器、类读取器、类修改器、类写入器,所述处理器110在执行采用预设插桩模块基于所述字节码操作工具读取所述中间字节码文件中的字节码类文件,对所述字节码类文件添加热点代码监测插桩逻辑生成目标字节码类文件,对所述中间字节码文件进行针对所述目标字节码类文件的回写处理,得到目标中间字节码文件时,具体执行以下操作:In one embodiment, the preset instrumentation module includes an instrumentation converter, a class reader, a class modifier, and a class writer. When the processor 110 executes the preset instrumentation module based on the word The section code operation tool reads the bytecode class files in the intermediate bytecode file, adds hot code monitoring instrumentation logic to the bytecode class file to generate the target bytecode class file, and The code file is subjected to writeback processing for the target bytecode class file. When the target intermediate bytecode file is obtained, the following operations are specifically performed:
基于所述字节码操作工具通过所述插桩转换器控制所述类读取器读取所述中间字节码文件中的字节码类文件;Control the class reader to read the bytecode class file in the intermediate bytecode file through the instrumentation converter based on the bytecode operation tool;
基于所述字节码操作工具通过所述插桩转换器控制所述类修改器对所述字节码类文件添加热点代码监测插桩逻辑生成目标字节码类文件;Based on the bytecode operation tool, the instrumentation converter controls the class modifier to add hot code to the bytecode class file and monitor the instrumentation logic to generate a target bytecode class file;
基于所述字节码操作工具通过所述插桩转换器控制所述类写入器对所述中间字节码文件进行针对所述目标字节码类文件的回写处理,得到目标中间字节码文件。Based on the bytecode operation tool, the instrumentation converter controls the class writer to perform writeback processing on the intermediate bytecode file for the target bytecode class file to obtain the target intermediate byte code file.
在一个实施例中,所述处理器110在执行所述基于所述字节码操作工具通过所述插桩转换器控制所述类修改器对所述字节码类文件添加热点代码监测插桩逻辑生成目标字节码类文件,执行以下步骤:In one embodiment, the processor 110 controls the class modifier to add hot code monitoring instrumentation to the bytecode class file through the instrumentation converter when executing the tool based on the bytecode operation. Logically generate target bytecode class files and perform the following steps:
获取所述字节码操作工具对应的通知适配器类,获取所述通知适配器类对应的进入方法时方法;Obtain the notification adapter class corresponding to the bytecode operation tool, and obtain the entry method method corresponding to the notification adapter class;
通过所述插桩转换器控制所述类读取器截获字节码类文件,基于所述字节码类文件确定目标字节码执行方法,调用所述进入方法时方法将热点代码监测插桩逻辑写入所述目标字节码执行方法中,生成包含所述目标字节码执行方法的目标字节码类文件。The class reader is controlled by the instrumentation converter to intercept the bytecode class file, the target bytecode execution method is determined based on the bytecode class file, and the hot code monitoring instrumentation is performed when the entry method is called. The logic is written into the target bytecode execution method, and a target bytecode class file containing the target bytecode execution method is generated.
在一个实施例中,所述处理器110在执行使用字节码操作工具运行所述中间字节码文件,采用预设插桩模块基于所述字节码操作工具读取所述中间字节码文件中的字节码类文件,对所述字节码类文件添加热点代码监测插桩逻辑生成目标字节码类文件,对所述中间字节码文件进行针对所述目标字节码类文件的回写处理,得到目标中间字节码文件,执行以下步骤:In one embodiment, the processor 110 uses a bytecode operation tool to run the intermediate bytecode file, and uses a preset instrumentation module to read the intermediate bytecode based on the bytecode operation tool. The bytecode class files in the file, add hot code monitoring instrumentation logic to the bytecode class files to generate target bytecode class files, and perform the target bytecode class file on the intermediate bytecode class files. Write back processing to obtain the target intermediate bytecode file and perform the following steps:
确定针对所述热点代码监测插桩逻辑的插桩方式为实时插桩类型,使用字节码操作工具在线运行所述中间字节码文件,将所述预设插桩模块作为程序代理器,采用预设插桩模块基于所述字节码操作工具读取所述中间字节码文件中的字节码类文件,对所述字节码类文件添加热点代码监测插桩逻辑生成目标字节码类文件,对所述中间字节码文件进行针对所述目标字节码类文件的回写处理,得到目标中间字节码文件;Determine that the instrumentation method for the hot code monitoring instrumentation logic is the real-time instrumentation type, use the bytecode operation tool to run the intermediate bytecode file online, use the preset instrumentation module as the program agent, and use The preset instrumentation module reads the bytecode class files in the intermediate bytecode file based on the bytecode operation tool, and adds hot code monitoring and instrumentation logic to the bytecode class files to generate target bytecodes. Class file: perform writeback processing on the intermediate bytecode file for the target bytecode class file to obtain the target intermediate bytecode file;
确定针对所述热点代码监测插桩逻辑的插桩方式为离线插桩类型,使用字节码操作工具离线运行所述中间字节码文件,将所述中间字节码文件作为字节码,采用预设插桩模块基于所述字节码操作工具和文件输入流方式读取所述中间字节码文件中的字节码类文件,对所述字节码类文件添加热点代码监测插桩逻辑生成目标字节码类文件,基于文件输出流方式对所述中间字节码文件进行针对所述目标字节码类文件的回写处理,得到目标中间字节码文件。Determine that the instrumentation method for the hot code monitoring instrumentation logic is the offline instrumentation type, use the bytecode operation tool to run the intermediate bytecode file offline, use the intermediate bytecode file as bytecode, and use The preset instrumentation module reads the bytecode class files in the intermediate bytecode file based on the bytecode operation tool and the file input stream method, and adds hot code monitoring instrumentation logic to the bytecode class files. Generate a target bytecode class file, and perform writeback processing on the target bytecode class file based on the file output stream mode to obtain the target intermediate bytecode file.
在一个实施例中,所述处理器110在执行确定针对所述程序源码文件的热点代码监测插桩逻辑,执行以下步骤:In one embodiment, when the processor 110 is executing the hot code monitoring instrumentation logic to determine the hot spot code for the program source code file, the processor 110 performs the following steps:
获取针对所述程序源码文件所输入的热点代码监测方式,所述热点代码监测方式包括方法调用次数记录、方法入参出参记录、方法调用链记录、方法调用耗时记录、方法传参记录、方法重写记录、方法功能扩展记录中的至少一种;Obtain the hot code monitoring method input for the program source code file. The hot code monitoring method includes method call number records, method input and output parameter records, method call chain records, method call time-consuming records, method parameter transfer records, At least one of method rewriting records and method function extension records;
基于所述热点代码监测方式生成热点代码监测插桩逻辑。Hotspot code monitoring instrumentation logic is generated based on the hotspot code monitoring method.
在一个实施例中,所述处理器110在执行所述运行所述目标中间字节码文件,获取所述热点代码监测插桩逻辑对应的热点代码执行记录文件,执行以下步骤:In one embodiment, when the processor 110 executes the target intermediate bytecode file, obtains the hotspot code execution record file corresponding to the hotspot code monitoring instrumentation logic, and performs the following steps:
运行所述目标中间字节码文件,记录所述热点代码监测插桩逻辑对应的热点代码执行记录文件;Run the target intermediate bytecode file and record the hotspot code execution record file corresponding to the hotspot code monitoring instrumentation logic;
通过数据导出模块通过文件输出流导出所述热点代码执行记录文件,并将所述热点代码执行记录文件存储至设备文件系统。The hot code execution record file is exported through the file output stream through the data export module, and the hot code execution record file is stored in the device file system.
在一个实施例中,所述处理器110在执行所述方法还执行以下步骤:In one embodiment, the processor 110 also performs the following steps when executing the method:
通过数据解析模块读取所述热点代码执行记录文件,对所述热点代码执行记录文件进行图解析处理,得到图数据类型的方法调用数据列表,将所述方法调用数据列表存入数据库。The hotspot code execution record file is read through the data analysis module, and graph analysis is performed on the hotspot code execution record file to obtain a method call data list of the graph data type, and the method call data list is stored in the database.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的程序可存储于一计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,所述的存储介质可为磁碟、光盘、只读存储记忆体或随机存储记忆体等。Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be implemented by instructing relevant hardware through a computer program. The program can be stored in a computer-readable storage medium. The program can be stored in a computer-readable storage medium. During execution, the process may include the processes of the embodiments of each of the above methods. Wherein, the storage medium may be a magnetic disk, an optical disk, a read-only memory or a random access memory, etc.
以上所揭露的仅为本申请较佳实施例而已,当然不能以此来限定本申请之权利范围,因此依本申请权利要求所作的等同变化,仍属本申请所涵盖的范围。What is disclosed above is only the preferred embodiment of the present application. Of course, it cannot be used to limit the scope of rights of the present application. Therefore, equivalent changes made according to the claims of the present application still fall within the scope of the present application.
Claims (11)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311660702.8A CN117632746A (en) | 2023-12-05 | 2023-12-05 | Pile inserting processing method and device, storage medium and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311660702.8A CN117632746A (en) | 2023-12-05 | 2023-12-05 | Pile inserting processing method and device, storage medium and electronic equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117632746A true CN117632746A (en) | 2024-03-01 |
Family
ID=90021336
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311660702.8A Pending CN117632746A (en) | 2023-12-05 | 2023-12-05 | Pile inserting processing method and device, storage medium and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117632746A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118550798A (en) * | 2024-07-26 | 2024-08-27 | 东方通信股份有限公司 | Method, apparatus, device, medium and program product for monitoring performance data |
-
2023
- 2023-12-05 CN CN202311660702.8A patent/CN117632746A/en active Pending
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118550798A (en) * | 2024-07-26 | 2024-08-27 | 东方通信股份有限公司 | Method, apparatus, device, medium and program product for monitoring performance data |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108762937B (en) | Configuration information sending method, obtaining method, device and terminal | |
CN113885870B (en) | Application program updating method, electronic equipment, terminal equipment and system | |
CN104246659A (en) | Instantiable gesture objects | |
CN112214653B (en) | String recognition method, device, storage medium and electronic device | |
CN110413347B (en) | Advertisement processing method, device, storage medium and terminal in application program | |
US12386599B2 (en) | Page rendering method, apparatus, electronic device, computer-readable storage medium, and computer program product | |
CN111124668B (en) | Memory release method, device, storage medium and terminal | |
CN104380256A (en) | Method, system and executable piece of code for virtualisation of hardware resource associated with computer system | |
CN103443763A (en) | ISA bridging including support for call to overidding virtual functions | |
CN114547604A (en) | Application detection method and device, storage medium and electronic equipment | |
CN113127050B (en) | Application resource packaging process monitoring method, device, equipment and medium | |
CN112955865B (en) | Static coordination of the application view hierarchy | |
CN111857480A (en) | Icon alignment method, device, storage medium and electronic device | |
CN114186527A (en) | A method and device for realizing automatic wiring of integrated circuits without relying on grid points | |
CN117632746A (en) | Pile inserting processing method and device, storage medium and electronic equipment | |
CN113268221B (en) | File matching method, device, storage medium and computer equipment | |
CN114911541B (en) | Processing method and device of configuration information, electronic equipment and storage medium | |
CN113609823B (en) | Method and device for editing questionnaire logic, terminal equipment and storage medium | |
CN113098859B (en) | Webpage page rollback method, device, terminal and storage medium | |
CN114372055A (en) | Method and device for displaying database table column storage in row storage | |
EP3752914B1 (en) | Techniques for native runtime of hypertext markup language graphics content | |
CN110018831B (en) | Program processing method, program processing apparatus, and computer-readable storage medium | |
CN117093225A (en) | Code file compiling method, system updating method, device, server and equipment | |
CN113961279A (en) | Page rendering method, device, server and storage medium | |
CN116149639A (en) | Method and device for developing components, 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 |