Information acquisition method, device and storage medium for the entire life cycle of a plug-in

By obtaining and visualizing the lifecycle information of plug-ins, the problems of slow plug-in construction and large module size are solved, targeted optimization is achieved, and the efficiency of plug-in development is improved.

CN114296728BActive Publication Date: 2025-09-05SHENZHEN JINGTAI TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202111639349.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-29
Publication Date
2025-09-05
Estimated Expiration
2041-12-29

AI Technical Summary

Technical Problem

During the project development process, the plug-in construction speed is slow and the module size is large. Blind optimization may lead to negative optimization and cannot be effectively targeted.

Method used

By obtaining the configuration information of the target plug-in, recording its execution start time, end time and attribute information of the generated module, and using the agent binding event to visualize the construction time and module attributes, a method for obtaining information about the entire life cycle of the plug-in is provided.

Benefits of technology

Targeted optimization has been achieved for plug-ins that take too long to build and have large module sizes, improving the efficiency of plug-in construction and module management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114296728B_ABST
    Figure CN114296728B_ABST
Patent Text Reader

Abstract

The present application is about a method, device and storage medium for obtaining information about the entire life cycle of a plug-in, the method comprising: obtaining configuration information of at least one target plug-in, wherein the configuration information comprises the identifier of each target plug-in in at least one target plug-in and the corresponding startup method; obtaining the execution start time and end time of each target plug-in and the attribute information of the module generated after the execution of each target plug-in by proxying the startup method corresponding to each target plug-in in at least one target plug-in, wherein the attribute information of the module comprises the volume of the module generated after the execution of each target plug-in before and after compression; visually presenting the construction time of each target plug-in and the attribute information of the corresponding module according to the identifier of each target plug-in. The technical solution of the present application can visually present the information of each plug-in in the entire life cycle during project development, thereby optimizing the plug-in in a targeted manner.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of software development, and in particular to a method, device, and storage medium for obtaining information about a plug-in throughout its life cycle. Background Art

[0002] A plug-in is a program written in accordance with a certain standard application program interface. Since it is necessary to call the function library or data provided by the original pure system, the plug-in generally runs on the system platform specified by the program (it may support multiple platforms at the same time) and cannot run independently from the specified platform. During the front-end development of the project, a large number of plug-ins need to be built, compiled, and packaged. As the project continues to advance or the project scale increases, the build speed of the plug-in may become slower and slower, and the size after compilation and packaging will also become larger and larger. In related technologies, the main approach is to optimize the build time of the plug-in and the size of the module after compilation. However, when it is not clear which plug-ins have a slow build speed and which modules have a large size, blind optimization is likely to be negative optimization, which will lead to other undesirable results. Therefore, it is not advisable to simply and roughly optimize all plug-ins. Summary of the Invention

[0003] In order to solve or partially solve the problems existing in the related technology, the present application provides a method, device and storage medium for obtaining information of the entire life cycle of a plug-in. This technical solution can visually present the information of each plug-in in the entire life cycle during project development, thereby optimizing the plug-in in a targeted manner.

[0004] The first aspect of the present application provides a method for obtaining information about a plug-in throughout its life cycle, comprising:

[0005] Obtaining configuration information of at least one target plug-in, the configuration information including an identifier of each target plug-in in the at least one target plug-in and a corresponding startup method;

[0006] Proxify the startup method corresponding to each target plug-in in the at least one target plug-in, obtaining the execution start time and end time of each target plug-in and attribute information of a module generated after the execution of each target plug-in, wherein the attribute information includes the size of the module before and after compression;

[0007] According to the identifier of each target plug-in, the construction time of each target plug-in and the attribute information of the module are visually presented.

[0008] A second aspect of the present application provides a device for obtaining information about a plug-in throughout its life cycle, including:

[0009] A first acquisition module is configured to acquire configuration information of at least one target plug-in, wherein the configuration information includes an identifier of each target plug-in in the at least one target plug-in and a corresponding startup method;

[0010] a second acquisition module, configured to proxy a startup method corresponding to each target plug-in in the at least one target plug-in to acquire the execution start time and end time of each target plug-in, and attribute information of a module generated after the execution of each target plug-in, wherein the attribute information includes the size of the module before and after compression;

[0011] The presentation module is configured to visually present the construction time of each target plug-in and the attribute information of the module according to the identifier of each target plug-in.

[0012] A third aspect of the present application provides an electronic device, including:

[0013] processor; and

[0014] The memory stores executable codes thereon, and when the executable codes are executed by the processor, the processor is caused to execute the method described above.

[0015] A fourth aspect of the present application provides a storage medium having executable code stored thereon. When the executable code is executed by a processor of an electronic device, the processor is caused to execute the method described above.

[0016] From the technical solution provided in the present application, it can be seen that after obtaining the execution start time, end time of each target plug-in and the attribute information of the module generated after the execution of each target plug-in, the construction time of each target plug-in and the attribute information of the module can be visualized according to the identification of each target plug-in. Therefore, the user can optimize the plug-ins with too long construction time and / or large corresponding module size in a targeted manner according to the presented construction time of each target plug-in and the attribute information of the corresponding module.

[0017] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] The above and other objects, features and advantages of the present application will become more apparent through a more detailed description of exemplary embodiments of the present application in conjunction with the accompanying drawings, wherein the same reference numerals generally represent the same components in the exemplary embodiments of the present application.

[0019] Figure 1 This is a flow chart of a method for obtaining information about a plug-in throughout its life cycle, as shown in an embodiment of the present application;

[0020] Figure 2 This is a schematic diagram of the structure of the information acquisition device for the entire life cycle of a plug-in shown in an embodiment of the present application;

[0021] Figure 3 It is a structural diagram of an electronic device shown in an embodiment of the present application. DETAILED DESCRIPTION

[0022] The following describes embodiments of the present application in more detail with reference to the accompanying drawings. Although the accompanying drawings illustrate embodiments of the present application, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments described herein. Rather, these embodiments are provided to make the present application more thorough and complete, and to fully convey the scope of the present application to those skilled in the art.

[0023] The terms used in this application are for the purpose of describing specific embodiments only and are not intended to limit this application. As used in this application and the appended claims, the singular forms "a," "an," "the," and "the" are intended to include the plural forms, unless the context clearly indicates otherwise. It should also be understood that the term "and / or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.

[0024] It should be understood that although the terms "first", "second", "third", etc. may be used in this application to describe various information, this information should not be limited to these terms. These terms are only used to distinguish information of the same type from each other. For example, without departing from the scope of this application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of this application, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.

[0025] During the front-end development of a project, a large number of plug-ins need to be built, compiled, and packaged. As the project progresses or grows in size, the plug-in build speed may become slower and slower, and the size of the compiled and packaged plug-ins may also become larger and larger. Related technologies mainly optimize the plug-in build time and the size of the compiled modules. However, when it is unclear which plug-ins have slow build speeds and which modules are large, blind optimization is likely to be negative optimization, leading to other undesirable consequences. Therefore, it is not advisable to simply and crudely optimize all plug-ins.

[0026] To address the above issues, an embodiment of the present application provides a method for obtaining information about a plug-in throughout its life cycle, which can optimize the plug-in in a targeted manner.

[0027] The technical solutions of the embodiments of the present application are described in detail below with reference to the accompanying drawings.

[0028] See also Figure 1 , is a flow chart of a method for obtaining information about a plug-in's entire life cycle, according to an embodiment of the present application. The method mainly includes steps S101 to S103, which are described in detail as follows:

[0029] Step S101: obtaining configuration information of at least one target plug-in, wherein the configuration information includes an identifier of each target plug-in in the at least one target plug-in and a corresponding startup method.

[0030] In an embodiment of the present application, a target plug-in may be a plug-in that may need to be optimized after observing information about its entire life cycle; further, as an embodiment, these target plug-ins may be plug-ins developed based on packaging tools such as webpack. Obtaining the configuration information of at least one target plug-in means that the configuration information of one or more target plug-ins can be obtained. The specific method may be to develop a new plug-in based on webpack in a front-end development project (in order to distinguish it from the aforementioned target plug-in, it may be referred to as a project plug-in here), and to call a method or function through the project plug-in to receive the configuration information of at least one target plug-in stored in an array. The array may be named a plug-in configuration array, recorded as pluginArray; the configuration information includes at least the identifier of each target plug-in in at least one target plug-in and the corresponding startup method of each target plug-in. It should be noted that a project plug-in may also be an optimized plug-in.

[0031] Step S102: By proxying the startup method corresponding to each target plug-in in at least one target plug-in, the execution start time and end time of each target plug-in and the attribute information of the module generated after the execution of each target plug-in are obtained, wherein the attribute information includes the volume of the module before and after compression.

[0032] In an embodiment of the present application, because additional operations need to be performed on the target plug-in or for security reasons, it is not possible to directly call the startup method corresponding to the target plug-in to execute the logic of the target plug-in. Therefore, the startup method corresponding to each target plug-in in at least one target plug-in can be proxied to obtain the execution start time and end time of each target plug-in, as well as the attribute information of the module generated after the execution of each target plug-in. Specifically, before starting to execute each target plug-in, the proxy is triggered to proxy the startup method corresponding to each target plug-in in at least one target plug-in to obtain the execution start time and end time of each target plug-in; at the end time of the execution of the last target plug-in in at least one target plug-in, the attribute information of the module generated after the execution of each target plug-in in at least one target plug-in is obtained.

[0033] In the above embodiment, before starting to execute each target plug-in, the triggering agent proxies the startup method corresponding to each target plug-in in at least one target plug-in to obtain the execution start time and end time of each target plug-in, which can be achieved by the following steps S11 to S14:

[0034] Step S11: Before starting to execute each target plug-in, the trigger agent binds a start event and an end event to each target plug-in.

[0035] The proxy is essentially an interceptor, and its role is to capture or intercept these external behaviors when the outside world tries to directly access the target plug-in or call the startup method of the target plug-in, so as to execute the logic of the proxy itself. Specifically, in an embodiment of the present application, before starting to execute each target plug-in, the trigger proxy binds a start event and an end event to each target plug-in, that is, when starting to execute each target plug-in, the trigger proxy performs the following operations: using the identifier of each target plug-in obtained previously (recorded as pluginName in the embodiment of the present application) as the unique identifier, create a record object (recordTimeObject in the embodiment of the present application) for each target plug-in, define the startTime in the record object as the plug-in's start event attribute, and endTime as the plug-in's end event attribute; then, store these recordTimeObjects in an array named recordTimeArray (time record), thereby binding a start event and an end event to each target plug-in.

[0036] Step S12: Call the startup method of each target plug-in.

[0037] After binding a start event and an end event to each target plug-in through the trigger agent, you can call the start method of each target plug-in. Calling the start method of each target plug-in means starting to execute the logic of each target plug-in.

[0038] Step S13: triggering the start event bound to each target plug-in to record the execution start time of each target plug-in.

[0039] As previously mentioned, calling each target plugin's start method signifies the start of execution of each target plugin's logic. Therefore, the start event previously bound to each target plugin can be triggered. When a target plugin's start event is triggered, the start event attribute "startTime" is assigned a value. That is, the value of "startTime" is the execution start time of that target plugin. The execution start time of each target plugin is stored in a record object, recordTimeObject, which uniquely identifies the target plugin's execution start time.

[0040] Step S14: When each target plug-in is executed, the end event bound to each target plug-in is triggered to record the execution end time of each target plug-in.

[0041] After calling each target plugin's start method and completing its own logic execution, the end event bound to each target plugin can be triggered. When a target plugin's end event is triggered, the end event attribute endTime is assigned a value. That is, the value of endTime is the execution end time of the target plugin. The execution end time of each target plugin is stored in the record object recordTimeObject, which uniquely identifies the target plugin's execution end time.

[0042] In the above embodiment, at the moment when the execution of the last target plug-in in at least one target plug-in ends, the attribute information of the module generated after the execution of each target plug-in in at least one target plug-in is obtained. Specifically, when the execution of each target plug-in in at least one target plug-in is completed, the end event bound to each target plug-in is triggered, and the attribute information of the module generated after the execution of each target plug-in in at least one target plug-in is obtained. When the execution of each target plug-in in at least one target plug-in is completed and the end event bound to each target plug-in is triggered, the packaging tools such as webpack pass in the attribute information of the module generated after the execution of each target plug-in in at least one target plug-in, including the module identification, the dependency relationship between each module, the hierarchical relationship, and the volume before and after compression of the module, etc. In an embodiment of the present application, the attribute information of the module generated after the execution of each target plug-in can be stored in an array named moduleMessageArray (module information).

[0043] Step S103: Based on the identifier of each target plug-in, the construction time and module attribute information of each target plug-in are visually presented.

[0044] Specifically, as an embodiment of the present application, based on the identifier of each target plug-in, visually presenting the construction time of each target plug-in and the attribute information of the module can be: determining whether the HTTP server is started; if the HTTP server is started, updating the existing HTML structure with the identifier of each target plug-in, the execution start time and end time of each target plug-in, and the attribute information of the module generated after the execution of each target plug-in is completed; based on the updated HTML structure, presenting the construction time of each target plug-in and the attribute information of the corresponding module on a page on the client (which can be a browser in this case). There are no special requirements for the above-mentioned HTTP server. For example, it can be a Node.js server, that is, an HTTP server that can be started in the Node.js runtime environment through JavaScript, or it can be an HTTP server that can be started in the corresponding runtime environment through other computer programming languages ​​such as C, Php or Python. In other words, an HTTP server is just one of many types of servers that can receive HTTP request protocol packets sent from a browser as a client, and automatically parse the content of the HTTP request protocol packet, automatically locate the resource file being accessed, write the content, commands and / or running results in the resource file into an HTTP response protocol packet, and finally, send the HTTP response protocol packet back to the browser that initiated the request; the embodiment of the present application does not limit the computer programming language used to start the HTTP server and its corresponding environment. In another embodiment of the present application, if the HTTP server is not started, the HTTP server is started; the HTML structure is generated by the identifier of each target plug-in, the execution start time and end time of each target plug-in, and the attribute information of the module generated after the execution of each target plug-in. In this way, when the HTTP server is started, the existing HTML structure is updated with the identifier of each target plug-in, the execution start time and end time of each target plug-in, and the attribute information of the module generated after the execution of each target plug-in; according to the updated HTML structure, the client (which can be a browser here) presents the construction time of each target plug-in and the attribute information of the corresponding module in a page.

[0045] In the above embodiment, the identifier of each target plug-in and the execution start and end times of each target plug-in are recorded in the recordTimeArray array, and the attribute information of the module generated after the execution of each target plug-in is recorded in the moduleMessageArray array. Therefore, when the Node.js service is started, only the information in the recordTimeArray and moduleMessageArray arrays needs to be used to update the existing HTML rendering template; when the Node.js service is not started, the information in the recordTimeArray and moduleMessageArray arrays needs to be used to generate the HTML rendering template. This achieves rendering on the server side, and displays the construction time of each target plug-in and the attribute information of the module on the client side.

[0046] As mentioned above, a project plug-in can be developed based on webpack in a front-end development project. In an embodiment of the present application, the same operation as the target plug-in in the aforementioned embodiment can also be performed on the project plug-in, that is, in an embodiment of the present application, the above method can also include: by proxying the startup method corresponding to the project plug-in, obtaining the execution start time and end time of the project plug-in and the attribute information of the project plug-in module generated after the project plug-in is executed; according to the identification of the project target plug-in, visually presenting the construction time of the project target plug-in and the attribute information of the project plug-in module, wherein the attribute information of the project plug-in module includes the volume of the project plug-in module before and after compression.

[0047] From the above Figure 1 It can be seen from the technical solution of the example that after obtaining the execution start time, end time of each target plug-in and the attribute information of the module generated after the execution of each target plug-in, the construction time of each target plug-in and the attribute information of the module can be visualized according to the identification of each target plug-in. Therefore, the user can optimize the plug-ins with too long construction time and / or large corresponding module size in a targeted manner according to the presented construction time of each target plug-in and the attribute information of the corresponding module.

[0048] Corresponding to the aforementioned embodiment of the method for realizing application functions, the present application also provides a device for obtaining information about the entire life cycle of a plug-in, an electronic device, and corresponding embodiments.

[0049] See also Figure 2 1 is a schematic diagram of the structure of the information acquisition device for the entire life cycle of the plug-in shown in the embodiment of the present application. For the sake of convenience, only the parts related to the embodiment of the present application are shown. Figure 2 The exemplary apparatus may include a first acquisition module 201, a second acquisition module 202, and a presentation module 203, as described below:

[0050] A first acquisition module 201 is configured to acquire configuration information of at least one target plug-in, wherein the configuration information includes an identifier of each target plug-in in the at least one target plug-in and a corresponding startup method;

[0051] The second acquisition module 202 is configured to proxy the startup method corresponding to each target plug-in in at least one target plug-in to obtain the execution start time and end time of each target plug-in and attribute information of the module generated after the execution of each target plug-in, wherein the attribute information of the module includes the size of the module generated after the execution of each target plug-in before and after compression;

[0052] The presentation module 203 is configured to visually present the construction time of each target plug-in and the attribute information of the corresponding module according to the identifier of each target plug-in.

[0053] Optionally, Figure 2 The exemplary second acquisition module 202 may include a first trigger unit and an attribute acquisition unit, wherein:

[0054] A first triggering unit is configured to trigger the agent to proxy the startup method corresponding to each target plug-in in at least one target plug-in when starting to execute each target plug-in, so as to obtain the execution start time and end time of each target plug-in;

[0055] The attribute acquisition unit is used to acquire attribute information of a module generated after each target plug-in in at least one target plug-in is executed when the last target plug-in in at least one target plug-in finishes executing.

[0056] Optionally, the first triggering unit in the above example may include a second triggering unit, a calling unit, a third triggering unit, and a fourth triggering unit, wherein:

[0057] The second triggering unit is used to trigger the agent to bind a start event and an end event to each target plug-in before starting to execute each target plug-in;

[0058] The calling unit is used to call the startup method of each target plug-in;

[0059] a third triggering unit, configured to trigger a start event bound to each target plug-in to record the execution start time of each target plug-in;

[0060] The fourth triggering unit is configured to trigger an end event bound to each target plug-in when each target plug-in is executed, so as to record the execution end time of each target plug-in.

[0061] Optionally, the property acquisition unit of the above example may include a fifth triggering unit, which is used to trigger the end event bound to each target plug-in when each target plug-in in at least one target plug-in is executed, and obtain the property information of the module generated after each target plug-in in at least one target plug-in is executed.

[0062] Optionally, Figure 2 The exemplary presentation module 203 may include a judgment unit, an update unit, and an attribute presentation unit, wherein:

[0063] A judging unit, used to judge whether the HTTP server is started;

[0064] an updating unit, configured to update the existing HTML structure with the identifier of each target plug-in, the execution start time and end time of each target plug-in, and the attribute information of the module generated after the execution of each target plug-in, if the HTTP server has been started;

[0065] The property presentation unit is used to present the construction time of each target plug-in and the property information of the module on the client side in a page according to the updated HTML structure.

[0066] Optionally, Figure 2 The exemplary apparatus may further include a startup module and a generation module, wherein:

[0067] The startup module is used to start the HTTP server if it is not started;

[0068] The generation module is used to generate an HTML structure from the identifier of each target plug-in, the execution start time and end time of each target plug-in, and the attribute information of the module generated after the execution of each target plug-in.

[0069] Optionally, Figure 2 The exemplary apparatus may further include a project plug-in acquisition module and a visualization presentation module, wherein:

[0070] A project plug-in acquisition module, configured to proxy the startup method corresponding to the project plug-in to obtain the execution start and end times of the project plug-in, as well as the attribute information of the project plug-in module generated after the project plug-in is executed. The project plug-in is a plug-in that obtains the configuration information of at least one target plug-in, and the attribute information of the project plug-in module includes the size of the project plug-in module before and after compression;

[0071] The visualization presentation module is used to visualize the construction time of the project target plug-in and the attribute information of the project plug-in module according to the identifier of the project target plug-in.

[0072] Regarding the apparatus in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated again here.

[0073] from Figure 2 It can be seen from the example device that after obtaining the execution start time, end time of each target plug-in and the attribute information of the module generated after the execution of each target plug-in, the construction time of each target plug-in and the attribute information of the module can be visualized according to the identification of each target plug-in. Therefore, the user can optimize the plug-ins with too long construction time and / or large corresponding module size in a targeted manner according to the presented construction time of each target plug-in and the attribute information of the corresponding module.

[0074] See also Figure 3 , is a schematic diagram of the structure of an electronic device according to an embodiment of the present application. The electronic device 300 includes a memory 310 and a processor 320.

[0075] The processor 320 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.

[0076] The memory 310 may include various types of storage units, such as system memory, read-only memory (ROM), and permanent storage devices. ROM may store static data or instructions required by the processor 320 or other modules of the computer. The permanent storage device may be a readable and writable storage device. The permanent storage device may be a non-volatile storage device that retains stored instructions and data even when the computer is powered off. In some embodiments, the permanent storage device uses a large-capacity storage device (such as a magnetic or optical disk, flash memory) as the permanent storage device. In other embodiments, the permanent storage device may be a removable storage device (such as a floppy disk, optical drive). The system memory may be a readable and writable storage device or a volatile readable and writable storage device, such as dynamic random access memory. The system memory may store some or all instructions and data required by the processor during operation. In addition, the memory 310 may include any combination of computer-readable storage media, including various types of semiconductor memory chips (DRAM, SRAM, SDRAM, flash memory, programmable read-only memory), and magnetic disks and / or optical disks may also be used. In some embodiments, the memory 310 may include a readable and / or writable removable storage device, such as a compact disc (CD), a read-only digital versatile disc (e.g., DVD-ROM, dual-layer DVD-ROM), a read-only Blu-ray disc, an ultra-density optical disc, a flash memory card (e.g., SD card, mini SD card, Micro-SD card, etc.), a magnetic floppy disk, etc. Computer-readable storage media do not include carrier waves and transient electronic signals transmitted wirelessly or wired.

[0077] The memory 310 stores executable codes. When the executable codes are processed by the processor 320 , the processor 320 may execute part or all of the above-mentioned methods.

[0078] In addition, the method according to the present application may also be implemented as a computer program or a computer program product, which includes computer program code instructions for executing some or all of the steps in the above method of the present application.

[0079] Alternatively, the present application can also be implemented as a storage medium, including a non-transitory machine-readable storage medium, a computer-readable storage medium or a machine-readable storage medium, on which executable code (or computer program, or computer instruction code) is stored. When the executable code (or computer program, or computer instruction code) is executed by a processor of an electronic device (or electronic device, server, etc.), the processor executes part or all of the steps of the above-mentioned method according to the present application.

[0080] The embodiments of the present application have been described above. The above description is illustrative and not exhaustive, and is not limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is selected to best explain the principles of the embodiments, their practical applications, or improvements to the technology in the market, or to enable other persons skilled in the art to understand the embodiments disclosed herein.

Claims

1. A method for obtaining information about the entire life cycle of a plug-in, characterized in that: The method comprises: Obtaining configuration information of at least one target plug-in, the configuration information including an identifier of each target plug-in in the at least one target plug-in and a corresponding startup method; Proxify the startup method corresponding to each target plug-in in the at least one target plug-in, obtaining the execution start time and end time of each target plug-in and attribute information of a module generated after the execution of each target plug-in, wherein the attribute information includes the size of the module before and after compression; Based on the identifier of each target plug-in, the construction time of each target plug-in and the attribute information of the module are visually presented, and the target plug-in corresponding to the module that takes too long to build and / or is large in size is optimized; The obtaining, by proxying the startup method corresponding to each target plug-in in the at least one target plug-in, the execution start time and end time of each target plug-in and the attribute information of the module generated after the execution of each target plug-in is completed, includes: When starting to execute each target plug-in, triggering the agent to proxy the startup method corresponding to each target plug-in in the at least one target plug-in to obtain the execution start time and end time of each target plug-in; At a moment when the execution of each target plug-in in the at least one target plug-in ends, attribute information of a module generated after the execution of each target plug-in in the at least one target plug-in is completed is obtained.

2. The method for obtaining information about the entire life cycle of a plug-in according to claim 1, characterized in that: The target plug-in is a plug-in that may need to be optimized.

3. The method for obtaining information about the entire life cycle of a plug-in according to claim 1, characterized in that: When starting to execute each target plug-in, triggering the agent to proxy the startup method corresponding to each target plug-in to obtain the execution start time and end time of each target plug-in, including: Before starting to execute each target plug-in, triggering the agent to bind a start event and an end event to each target plug-in; Call the start method of each target plug-in; triggering a start event bound to each target plug-in to record the execution start time of each target plug-in; When the execution of each target plug-in is completed, the end event bound to each target plug-in is triggered to record the execution end time of each target plug-in.

4. The method for obtaining information about the entire life cycle of a plug-in according to claim 3, characterized in that: The acquiring, at the execution completion time of each target plug-in in the at least one target plug-in, attribute information of a module generated after the execution of each target plug-in in the at least one target plug-in is completed, includes: When each target plug-in in the at least one target plug-in is executed, an end event bound to each target plug-in is triggered, and attribute information of a module generated after each target plug-in in the at least one target plug-in is executed is obtained.

5. The method for obtaining information about the entire life cycle of a plug-in according to claim 1, characterized in that: The visually presenting the construction time of each target plug-in and the attribute information of the module according to the identifier of each target plug-in includes: Determine whether the HTTP server is started; If the HTTP server has been started, the existing HTML structure is updated with the identifier of each target plug-in, the execution start time and end time of each target plug-in, and the attribute information of the module generated after the execution of each target plug-in is completed; According to the updated HTML structure, the construction time of each target plug-in and the attribute information of the module are presented on the client in a page.

6. The method for obtaining information about the entire life cycle of a plug-in according to claim 5, characterized in that: If the HTTP server is not started, start the HTTP server; An HTML structure is generated by using the identifier of each target plug-in, the execution start time and end time of each target plug-in, and the attribute information of the module generated after the execution of each target plug-in.

7. The method for obtaining information about the entire life cycle of a plug-in according to any one of claims 1 to 6, characterized in that: The method further comprises: Obtaining, by proxying a startup method corresponding to a project plug-in, the execution start time and end time of the project plug-in, and attribute information of a project plug-in module generated after the project plug-in is executed. The project plug-in is a plug-in that obtains configuration information of the at least one target plug-in. The attribute information of the project plug-in module includes the size of the project plug-in module before and after compression. According to the identifier of the project plug-in, the construction time of the project plug-in and the attribute information of the project plug-in module are visually presented.

8. A device for acquiring information about the entire life cycle of a plug-in, characterized in that: The device comprises: A first acquisition module is configured to acquire configuration information of at least one target plug-in, wherein the configuration information includes an identifier of each target plug-in in the at least one target plug-in and a corresponding startup method; a second acquisition module, configured to proxy a startup method corresponding to each target plug-in in the at least one target plug-in to acquire the execution start time and end time of each target plug-in, and attribute information of a module generated after the execution of each target plug-in, wherein the attribute information includes the size of the module before and after compression; a presentation module configured to visually present, based on the identifier of each target plug-in, the construction time of each target plug-in and the attribute information of the module, so as to optimize the target plug-in corresponding to the module that takes too long to build and / or is too large in size; The obtaining, by proxying the startup method corresponding to each target plug-in in the at least one target plug-in, the execution start time and end time of each target plug-in and the attribute information of the module generated after the execution of each target plug-in is completed, includes: When starting to execute each target plug-in, triggering the agent to proxy the startup method corresponding to each target plug-in in the at least one target plug-in to obtain the execution start time and end time of each target plug-in; At a moment when the execution of each target plug-in in the at least one target plug-in ends, attribute information of a module generated after the execution of each target plug-in in the at least one target plug-in is completed is obtained.

9. The device for acquiring information about the entire life cycle of a plug-in according to claim 8, characterized in that: The target plug-in is a plug-in that may need to be optimized.

10. An electronic device, characterized in that: include: processor; as well as A memory having executable codes stored thereon, which, when executed by the processor, causes the processor to perform the method according to any one of claims 1 to 7.

11. A storage medium having executable code stored thereon, wherein when the executable code is executed by a processor of an electronic device, the processor is caused to execute the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Method and device for detecting time consumption of method in program and storage medium

    CN111240927A

  • Statistical method and device for consumed time of method in application program, computer equipment and medium

    CN111240937A

  • Application program performance analysis method and device and electronic equipment

    CN112199261A