WO2022134875A1 - 数据的获取方法及电子设备 - Google Patents
数据的获取方法及电子设备 Download PDFInfo
- Publication number
- WO2022134875A1 WO2022134875A1 PCT/CN2021/128390 CN2021128390W WO2022134875A1 WO 2022134875 A1 WO2022134875 A1 WO 2022134875A1 CN 2021128390 W CN2021128390 W CN 2021128390W WO 2022134875 A1 WO2022134875 A1 WO 2022134875A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- rendering
- data
- webpage
- web page
- attribute
- 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.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/34—Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/958—Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
Definitions
- the present disclosure relates to the field of computer technology, and in particular, to a data acquisition method and an electronic device.
- Web page performance monitoring is an important function in the technical field of web pages.
- High-performance pages can bring users an excellent experience, increase user stickiness, and improve the conversion rate of web pages.
- a data acquisition method which is executed by an electronic device, where a browser is installed in the electronic device, and the browser includes an interface description language file, and the interface description language file contains An attribute type is set, and the attribute type indicates the type to which the performance data of the webpage belongs, and the method includes:
- the attribute value of the attribute type contained in the interface description language file is transmitted to the performance monitoring interface of the browser, and the attribute value of the attribute type is obtained from the performance monitoring interface.
- the obtaining, by using the browser, rendering parameters of web page data includes:
- a rendering notification method is invoked to obtain the rendering parameters of the web page data for which this rendering is completed.
- the kernel of the browser has a performance timing interface
- the method further includes:
- the generating the attribute value of the attribute type based on the rendering parameter includes:
- the performance timing interface is called to generate the attribute value of the attribute type based on the rendering parameter.
- the performance monitoring interface is an interface in a scripting environment of the browser
- the obtaining the attribute value of the attribute type from the performance monitoring interface includes:
- the calling script obtains the attribute value of the attribute type from the performance monitoring interface.
- the rendering parameter includes a first rendering parameter, and the attribute type includes a first drawing time; the generating an attribute value of the attribute type based on the rendering parameter includes:
- the time point when the rendering of the webpage data ends is determined as the first rendering time property value.
- the rendering parameter includes text rendering parameters; the attribute type includes the first content rendering time; and the generating an attribute value of the attribute type based on the rendering parameter includes:
- the time point when the rendering of the webpage data ends is determined as the first content The property value of the draw time.
- the rendering parameters include text rendering parameters and/or image rendering parameters;
- the attribute type includes the first effective drawing time; and the generating an attribute value of the attribute type based on the rendering parameter includes:
- the attribute value of the first effective rendering time is generated based on the text rendering parameter and/or the picture rendering parameter of the webpage data, and the time point when the webpage data is rendered complete.
- the target web page corresponds to multiple frames of the web page data, the text rendering parameters and/or the image rendering parameters based on the web page data, and the time when the web page data is rendered.
- the attribute value of the first valid drawing time is generated, including:
- For each frame of the webpage data obtain the number of target webpage objects based on the text rendering parameters and/or the picture rendering parameters of the webpage data, where the target webpage objects are webpage objects included in the target webpage, and the webpage layout of the target webpage is changed;
- the time point when the webpage data corresponding to the largest second ratio is rendered is determined as the attribute value of the first effective rendering time.
- the time point when the webpage data corresponding to the largest second ratio is rendered is determined as the attribute value of the first effective rendering time ,include:
- an apparatus for acquiring data a browser is installed in the apparatus, the browser includes an interface description language file, and an attribute type is set in the interface description language file, The attribute type indicates the type to which the performance data of the webpage belongs, and the apparatus includes:
- an acquisition module configured to acquire, through the browser, rendering parameters of web page data, where the web page data is data of a target web page;
- a generating module configured to generate an attribute value of the attribute type based on the rendering parameter
- the export module is configured to transmit the attribute value of the attribute type contained in the interface description language file to the performance monitoring interface of the browser based on the interface description language file, and obtain the attribute type from the performance monitoring interface property value.
- the obtaining module is configured to, through the browser, call a rendering notification method to obtain the webpage whose rendering ends this time after each frame of the webpage data of the target webpage is rendered. Rendering parameters for the data.
- the kernel of the browser has a performance timing interface
- the apparatus further includes:
- a transmission module configured to transmit the rendering parameters to the performance timing interface
- the generating module is configured to call the performance timing interface to generate an attribute value of the attribute type based on the rendering parameter.
- the performance monitoring interface is an interface in a scripting environment of the browser
- the export module is configured to call a script to obtain the attribute value of the attribute type from the performance monitoring interface.
- the rendering parameter includes a first rendering parameter;
- the attribute type of the performance data includes a first rendering time;
- the generating module is configured to, when the parameter value of the first rendering parameter is a first parameter threshold, And if the attribute value of the first rendering time is empty, the time point when the rendering of the webpage data ends is determined as the attribute value of the first rendering time.
- the rendering parameter includes a text rendering parameter; the attribute type includes the first content rendering time; the generating module is further configured to be a second parameter threshold when the parameter value of the text rendering parameter is a second parameter threshold, and When the attribute value of the first content rendering time is empty, the time point when the rendering of the webpage data ends is determined as the attribute value of the first content rendering time.
- the rendering parameters include text rendering parameters and/or image rendering parameters;
- the attribute type includes the first effective drawing time;
- the generating module is further configured to render the text based on the webpage data The parameter and/or the picture rendering parameter, and the time point when the webpage data is rendered complete, generate the attribute value of the first effective rendering time.
- the target webpage corresponds to multiple frames of the webpage data
- the generating module includes:
- a quantity acquisition module configured to, for each frame of the web page data, acquire the number of target web page objects based on the text rendering parameters and/or the picture rendering parameters of the web page data, where the target web page objects are the The web page object contained in the target web page, and the web page layout of the target web page is changed;
- a ratio generating module configured to generate a first ratio between the height of the target web page and the height of the screen
- a ratio comparison module configured to determine a larger value between the first ratio and a preset value, and to determine a second ratio between the quantity and the larger value
- the time recording module is configured to determine, based on the second ratio corresponding to the webpage data of each frame, the time point when the webpage data corresponding to the largest second ratio is rendered as the attribute value of the first effective rendering time.
- the time recording module is configured to, after the text object and/or picture object in the target webpage is loaded, based on the second ratio corresponding to the webpage data of each frame, The time point when the rendering of the webpage data corresponding to the two ratios ends is determined as the attribute value of the first effective rendering time.
- an electronic device comprising: a processor; a memory for storing instructions executable by the processor; wherein the electronic device is installed with a browser, the browser It includes an interface description language file, wherein an attribute type is set in the interface description language file, and the attribute type indicates the type to which the performance data of the web page belongs, and the processor is configured to execute the instruction to realize the following steps:
- the attribute value of the attribute type contained in the interface description language file is transmitted to the performance monitoring interface of the browser, and the attribute value of the attribute type is obtained from the performance monitoring interface.
- the processor is configured to execute the instructions to perform the following steps:
- a rendering notification method is invoked to obtain the rendering parameters of the web page data for which this rendering is completed.
- the kernel of the browser has a performance timing interface
- the processor is configured to execute the instructions to implement the following steps:
- the performance timing interface is called to generate the attribute value of the attribute type based on the rendering parameter.
- the performance monitoring interface is an interface in a scripting environment of the browser; the processor is configured to execute the instructions to implement the following steps:
- the calling script obtains the attribute value of the attribute type from the performance monitoring interface.
- the rendering parameters include first rendering parameters, and the attribute type includes first rendering time;
- the processor is configured to execute the instructions to achieve the following steps:
- the time point when the rendering of the webpage data ends is determined as the first rendering time property value.
- the rendering parameters include text rendering parameters; the attribute type includes first content rendering time; and the processor is configured to execute the instructions to implement the following steps:
- the time point when the rendering of the webpage data ends is determined as the first content The property value of the draw time.
- the rendering parameters include text rendering parameters and/or image rendering parameters;
- the attribute type includes the first effective rendering time;
- the processor is configured to execute the instructions to implement the following steps:
- the attribute value of the first effective rendering time is generated based on the text rendering parameter and/or the picture rendering parameter of the webpage data, and the time point when the webpage data is rendered complete.
- the target web page corresponds to multiple frames of the web page data
- the processor is configured to execute the instructions to implement the following steps:
- For each frame of the webpage data obtain the number of target webpage objects based on the text rendering parameters and/or the picture rendering parameters of the webpage data, where the target webpage objects are webpage objects included in the target webpage, and the webpage layout of the target webpage is changed;
- the time point when the webpage data corresponding to the largest second ratio is rendered is determined as the attribute value of the first effective rendering time.
- the processor is configured to execute the instructions to perform the following steps:
- a non-volatile computer-readable storage medium which, when the instructions in the non-volatile computer-readable storage medium are executed by a processor of an electronic device, causes all the The electronic device can perform the following steps:
- the attribute value of the attribute type contained in the interface description language file is transmitted to the performance monitoring interface of the browser, and the attribute value of the attribute type is obtained from the performance monitoring interface. .
- a computer program product comprising readable program code executable by a processor of an electronic device to accomplish the following steps:
- the attribute value of the attribute type contained in the interface description language file is transmitted to the performance monitoring interface of the browser, and the attribute value of the attribute type is obtained from the performance monitoring interface.
- the method provided by the embodiment of the present disclosure does not need to manually mark the webpage data or monitor the loading event when acquiring the attribute value of the attribute type, which reduces the professional skill requirements for technical personnel, does not affect the performance of the webpage, and is suitable for on all web pages.
- modifying the browser kernel that is, setting the attribute type in the description language file included in the browser, loading the web page data of the target web page through the browser, and then acting as a bridge between the browser kernel and the scripting environment based on the interface description language file It exports the attribute value of the attribute type to the performance monitoring interface of the scripting environment of the browser, and obtains the attribute value of the attribute type from the performance monitoring interface, which realizes the automatic acquisition of the performance data of the webpage.
- it is not necessary to use the developer tool of the browser and the web page will not be reloaded, which improves the efficiency of acquiring the performance data.
- Fig. 1 is a flowchart of a method for acquiring data according to an exemplary embodiment.
- Fig. 2 is a schematic diagram of acquiring rendering parameters according to an exemplary embodiment.
- FIG. 3 is a schematic diagram showing the change of the attribute value of the first valid drawing time with time according to an exemplary embodiment.
- Fig. 4 is a block diagram of an apparatus for acquiring data according to an exemplary embodiment.
- Fig. 5 is a block diagram of an electronic device for acquiring data according to an exemplary embodiment.
- Fig. 6 is a block diagram of an electronic device for acquiring data according to an exemplary embodiment.
- the object of the webpage is manually marked, and then the loading event of the object is monitored to obtain the performance data of the webpage.
- monitoring the loading event will affect the performance of the web page, and manual tagging is not suitable for all web pages, and requires high professional skills of technicians.
- performance data is obtained based on the developer tools in the browser.
- the developer tool needs to be started manually, which cannot be automated, and the developer tool needs to reload the web page, which makes the process of obtaining performance data time-consuming and inefficient.
- FIG. 1 is a flow chart of a method for acquiring data according to an exemplary embodiment.
- the method for acquiring data is performed by an electronic device, and a browser is installed in the electronic device, and the browser includes An interface description language file, where an attribute type is set in the interface description language file, the attribute type indicates the type to which the performance data of the web page belongs, and the method for acquiring the data specifically includes the following steps.
- step S11 through the browser, the rendering parameters of the webpage data are obtained, and the webpage data is the data of the target page.
- the browser loads the webpage data of the target webpage, and during the loading process, the rendering engine of the browser renders the webpage data. After the webpage data is rendered, the rendering parameters of the webpage data can be obtained.
- step S12 an attribute value of the attribute type is generated based on the rendering parameter.
- the performance data mainly includes rendering time information of the target web page.
- the performance data contains various kinds of drawing time information, therefore, it is necessary to obtain various kinds of rendering parameters, and then generate the attribute values of the corresponding attribute types of the performance data according to the various kinds of rendering parameters.
- an attribute type is set in the interface description language file, the attribute type indicates the type to which the performance data of the webpage belongs, and the attribute value of the attribute type is the performance data of the webpage.
- Drawing time information the attribute value of the attribute type generated based on the rendering parameters, is the drawing time information contained in the performance data.
- multiple attribute types are set in the interface description language file, and different attribute types are types to which different performance data belong.
- an attribute value of each attribute type is generated, and the attribute value of each attribute type is a kind of performance data of the webpage, that is, the attribute values of multiple attribute types are multiple performance parameters of the webpage.
- the performance parameter includes various kinds of drawing time information, and the attribute value of each attribute type is a kind of drawing time information.
- step S13 the attribute value of the attribute type is exported to the performance monitoring interface of the browser based on the interface description language file, and the script is invoked to obtain the attribute value of the attribute type from the performance monitoring interface.
- the interface description language is a computer language used to describe software component interfaces.
- the interface description language describes the interface in a neutral way, so that objects running on different platforms and programs written in different languages can communicate with each other.
- the interface description language file acts as a bridge between the browser's kernel (eg, written in the C++ language) and the scripting environment (eg, the JavaScript environment). Since the performance monitoring interface is located in the scripting environment, the attribute value of the attribute type is exported based on the interface description language file to the performance monitoring interface, and the JavaScript script is called to obtain the attribute value of the attribute type from the performance monitoring interface, that is, the performance data of the target web page is obtained.
- the process of acquiring rendering parameters of webpage data and the process of generating attribute values of attribute types based on the rendering parameters are executed in the kernel of the browser.
- the interface description language file acts as a bridge between the browser's kernel and the scripting environment. After the attribute value of the attribute type is generated in the browser's kernel, the attribute value of the attribute type contained in the interface description file can be determined. Based on the interface description The language file can transmit the attribute value of the attribute type contained in the interface description language file to the performance monitoring interface located in the script environment, so that the calling script can obtain the attribute value of the attribute type from the performance monitoring interface, which realizes the browser's The interaction between the kernel and the scripting environment.
- a script is called to obtain the attribute value of the attribute type from the performance monitoring interface, while in another embodiment, the script can be obtained from the performance monitoring interface in other ways without calling the script.
- the attribute value of the attribute type is called to obtain the attribute value of the attribute type from the performance monitoring interface.
- the data acquisition solution provided by the embodiments of the present disclosure is implemented by the electronic device through the installed browser, and the attribute type of the performance data is set in the interface description language file of the performance timing interface of the kernel of the browser.
- the browser is used to load the target webpage, and after the webpage data of the target webpage is rendered, the rendering parameters of the webpage data are obtained, and the attribute value of the attribute type of the performance data is generated based on the rendering parameter. Then, based on the interface description language file, the attribute value of the attribute type of the performance data is exported to the performance monitoring interface of the browser, and the script is invoked to obtain the attribute value of the attribute type from the performance monitoring interface.
- the data acquisition method provided by the embodiments of the present disclosure is realized by the electronic device through the installed browser, the electronic device obtains the rendering parameters of the webpage data through the installed browser, and through the browser, based on The rendering parameter generates the attribute value of the attribute type.
- the attribute value of the attribute type is exported to the performance monitoring interface of the browser based on the interface description language file, and the attribute value of the attribute type is obtained from the performance monitoring interface.
- the method provided by the embodiment of the present disclosure does not need to manually mark the webpage data or monitor the loading event when acquiring the attribute value of the attribute type, which reduces the professional skill requirements for technical personnel, does not affect the performance of the webpage, and is suitable for on all web pages.
- modifying the browser kernel that is, setting the attribute type in the description language file included in the browser, loading the web page data of the target web page through the browser, and then acting as a bridge between the browser kernel and the scripting environment based on the interface description language file It exports the attribute value of the attribute type to the performance monitoring interface of the scripting environment of the browser, and obtains the attribute value of the attribute type from the performance monitoring interface, which realizes the automatic acquisition of the performance data of the webpage.
- it is not necessary to use the developer tool of the browser and the web page will not be reloaded, which improves the efficiency of acquiring the performance data.
- the kernel of the browser adopts the open source Chromium (an open source browser engine), and the rendering engine adopted by Chromium is blink (a browser typesetting engine).
- the NotifyPaint method (a kind of drawing time) of the PaintTiming interface (an application program interface for users to obtain drawing time information) is called.
- Notification acquisition method to obtain the rendering parameters of each frame of web page data.
- the rendering parameter is the parameter of the NotifyPaint method, for example, whether it is the first rendering (is first paint), whether the text content is rendered (text painted), and whether the image is rendered (image painted).
- the rendering parameters include one or more of first rendering parameters, text rendering parameters, and picture rendering parameters.
- the first rendering parameter is whether it is the first rendering
- the text rendering parameter is whether the text content is rendered
- the image rendering parameter is whether the image is rendered.
- the first rendering parameter indicates whether the first pixel is rendered in the page when the corresponding webpage data is rendered
- the text rendering parameter indicates whether the text content is rendered in the page when the corresponding webpage data is rendered
- image rendering The parameter indicates whether the image is rendered in the page when the corresponding web page data is rendered.
- the rendering notification method is called, the rendering parameters are transmitted to the performance timing interface, the performance timing interface is called, and the attribute value of the attribute type is generated based on the rendering parameters.
- the target web page corresponds to multiple frames of web page data
- the attribute value of this attribute type is generated based on the rendering parameters in the multi-frame web page data.
- the browser calls the rendering notification method to obtain each The rendering parameters of the web page data of the frame, and the rendering parameters of each frame of web page data are transmitted to the performance timing interface.
- the performance timing interface is called to generate the attribute value of the attribute type based on the rendering parameters of the multi-frame web page data.
- the process of the browser loading the web page data of the target web page is a changing process.
- the browser renders each frame of web page data.
- the embodiment of the present disclosure can use the NotifyPaint method to obtain the rendering parameters of each frame of webpage data, so as to ensure that after rendering each frame of webpage data, the rendering parameters corresponding to each frame of webpage data are obtained, and the obtained rendering parameters
- the unit of web page data is per frame.
- the browser can obtain the rendering parameters of each frame of webpage data, transmit the rendering parameters of each frame of webpage data to the performance timing interface, and provide the attribute value of the attribute type for the subsequent performance timing interface generation.
- the data foundation is avoided, and the rendering parameters are not obtained after all the webpage data has been rendered, which improves the accuracy of the rendering parameters.
- the attribute value of the attribute type is generated by calling the performance timing interface after transferring the rendering parameters to the performance timing interface by invoking the rendering notification method. After the notification method obtains the rendering parameters, there is no need to transmit the rendering parameters to the performance timing interface, and other methods can be used to generate attribute values of the attribute type based on the rendering parameters.
- the attribute type includes one or more of first drawing time, first content drawing time, and first valid drawing time.
- the first rendering time represents the time point when the first pixel in the target web page is rendered.
- the first content rendering time refers to the time point at which any object in the Document Object Model (DOM for short) of the target web page is rendered for the first time.
- the first effective drawing time refers to the time point when the target object in the target webpage is drawn, and the target object is the main part of the target webpage, such as the video object in the video webpage, and the picture object in the picture webpage.
- the attribute value of the first rendering time can be generated based on the first rendering parameter, the first rendering time and the time point when the webpage data is rendered. That is, when the parameter value of the first rendering parameter is the first parameter threshold, and the attribute value of the first rendering time is empty, the time point when the webpage data corresponding to the first rendering parameter is rendered is determined as the first rendering time. property value. For example, true is the first parameter threshold. When the parameter value of the first rendering parameter of a certain frame of webpage data is "true", and the attribute value of the first rendering time is empty, it can be used when the webpage data is rendered.
- the time point is recorded as the property value of the first drawing time, and the property value of the first drawing time is stored in the variable of the first drawing time.
- the variable of the first drawing time is used to record the corresponding attribute value.
- the attribute value is assigned to the variable of the first drawing time, so that the assigned variable can represent the target webpage.
- First draw time In this embodiment of the present disclosure, the first rendering parameter in the rendering parameters is combined with the first rendering time in the attribute type, and the first rendering time and the first rendering parameter of a certain frame of webpage data satisfy the first target condition (such as the first rendering parameter of the first rendering parameter).
- the time point when the page data is rendered is determined as the attribute value of the first rendering time, which realizes the use of the first rendering parameters, the first rendering time and the webpage.
- the property value of the first drawing time is generated. In this process, there is no need to listen to the loading event, and no need to manually add tags to the target object, and no need to manually open the browser's developer tools. The loading rate of the target web page is improved, and the attribute value of the first drawing time of any target web page can be quickly obtained.
- the target web page corresponds to multiple frames of web page data
- the browser sequentially acquires the rendering parameters of each frame of web page data.
- it is judged in turn whether the first rendering time and the first rendering parameters of each frame of webpage data satisfy the above-mentioned first target condition, and if the first rendering time and the first rendering parameters of any frame of webpage data satisfy
- the time point when the rendering of the webpage data ends is determined as the attribute value of the first rendering time.
- the attribute value of the first drawing time is stored in the variable of the first drawing time, while in another embodiment, only the first drawing time is determined.
- the property value is enough, after that, there is no need to store the property value of the first drawing time in the variable of the first drawing time.
- the attribute value of the first content rendering time can also be generated based on the text rendering parameters, the first content rendering time, and the time point when the webpage data is rendered. That is, when the parameter value of the text rendering parameter is the second parameter threshold, and the attribute value of the first content rendering time is empty, the time point when the webpage data corresponding to the text rendering parameter is rendered is determined as the first content rendering.
- the time attribute value For example, true is the second parameter threshold. In an actual application scenario, the first parameter threshold and the second parameter threshold are the same, or the first parameter threshold and the second parameter threshold are different.
- the time point when the rendering of the webpage data ends is recorded as the time of the first content rendering time.
- Property value store the property value of the first content drawing time into the variable of the first content drawing time.
- the variable of the first content rendering time is used to record the corresponding attribute value, and after determining the attribute value of the first content rendering time, the attribute value is assigned to the variable of the first content rendering time, so that the assigned variable can represent the target The first content paint time of the web page.
- the text rendering parameters in the rendering parameters are combined with the first content rendering time in the attribute type, and the first content rendering time and the text rendering parameters of a certain frame of webpage data satisfy the second target condition (such as text rendering If the parameter value of the parameter is true, and the attribute value of the first content rendering time is empty), the time point when the webpage data is rendered is determined as the attribute value of the first content rendering time, which realizes the use of text rendering parameters.
- the first content rendering time and the time point when the web page data is rendered generate the attribute value of the first content rendering time.
- the target web page corresponds to multiple frames of web page data
- the browser sequentially acquires the rendering parameters of each frame of web page data.
- the first content rendering time and the text rendering parameters of each frame of webpage data satisfy the above-mentioned second target condition. If the parameter satisfies the above-mentioned second target condition, the time point at which the rendering of the webpage data ends is determined as the attribute value of the first content rendering time. After that, when it has been determined that the attribute value of the first content rendering time is not empty, the step of judging whether the first content rendering time and the text rendering parameters of the rest of the webpage data satisfy the second target condition is no longer performed.
- the attribute value of the first content rendering time is stored in the variable of the first content rendering time, while in another embodiment, only the first content rendering time is determined.
- the property value of the content drawing time is sufficient. After that, there is no need to store the property value of the first content drawing time in the variable of the first content drawing time.
- the attribute value of the attribute type when the attribute value of the attribute type is generated based on the rendering parameter, it can also be based on the text rendering parameter and/or image rendering parameter of the webpage data, as well as the height of the target webpage, the screen height of the terminal where the browser is located, and the webpage data.
- the property value of the first valid drawing time is generated, and the property value of the first valid drawing time is stored in the variable of the first valid drawing time.
- the variable of the first effective drawing time is used to record the corresponding attribute value.
- the attribute value is assigned to the variable of the first effective drawing time, so that the assigned variable can represent the target The first valid draw time of the web page.
- the process of generating the attribute value of the first effective rendering time it is determined whether the time point when the rendering of each frame of webpage data ends is the attribute value of the first effective rendering time. That is to say, after each frame of web page data is rendered, a first effective rendering time judgment operation is performed. Taking the rendering of a certain frame of webpage data as an example, in the above judgment operation process, first, the number of target webpage objects is obtained based on the text rendering parameters and/or image rendering parameters of the webpage data, and the target webpage object is the target webpage. Contains the web page object that changes the web page layout of the target web page.
- the target webpage object is a text object, a video object, a picture object, etc. in the target webpage.
- a first ratio of the height of the target web page to the height of the screen is generated.
- the height of the target web page is the height of the target web page in a full-screen display state.
- the first ratio is compared with the preset value, that is, it is determined whether the first ratio is larger or the preset value is larger, and the larger value between the first ratio and the preset value is obtained, and the comparison between the above-mentioned quantity and the preset value is obtained.
- the second ratio between the large values that is, dividing the above-mentioned quantity by the above-mentioned large value.
- the second ratio is used to determine whether the time point when the webpage data is rendered is completed is the first valid rendering time, and the second ratio can also be called an attribute ratio.
- it is determined whether the time point when the next frame of webpage data is rendered is the attribute value of the first effective rendering time, and the attribute ratio corresponding to the next frame of webpage data to be rendered is obtained.
- the height of the target web page and the screen height The ratio will also increase, however, the attribute ratio will gradually decrease.
- the attribute ratio corresponding to each frame of webpage data can be obtained, that is, multiple attribute ratios can be obtained.
- the time point when the webpage data corresponding to the second largest ratio among the multiple attribute ratios is finished being rendered is determined as the attribute value at the first effective rendering time. That is to say, the time point when the webpage data corresponding to the largest attribute ratio is rendered is the time point when the webpage object of the target webpage is loaded. As shown in FIG.
- FIG. 3 it is a schematic diagram showing the change of the attribute value of the first valid drawing time with time.
- the abscissa represents the time point when the browser renders each frame of webpage data
- the ordinate represents the number of webpage objects loaded by the browser
- the irregular line is the change curve of the attribute ratio corresponding to each frame of webpage data. From Figure 3 It can be seen from the above that 6.047s is the attribute value of the first valid drawing time.
- the attribute ratio is calculated by using the number of target webpage objects that change the webpage layout, the height of the target webpage, the screen height, etc., and based on the obtained multiple attribute ratios, the largest
- the time point when the webpage data corresponding to the attribute ratio is rendered is determined as the attribute value of the first effective rendering time, which realizes the automatic generation of the first time using the text rendering parameters and/or image rendering parameters, the height of the target webpage, the screen height and the time point.
- the attribute value of the effective drawing time is determined as the attribute value of the first effective rendering time, which realizes the automatic generation of the first time using the text rendering parameters and/or image rendering parameters, the height of the target webpage, the screen height and the time point.
- the attribute value of the first valid drawing time needs to be determined after the text objects and/or picture objects are loaded. That is to say, after the text object and/or image object in the target webpage is loaded, based on the obtained multiple attribute ratios, the time point when the webpage data corresponding to the largest attribute ratio is rendered is determined as the first effective rendering The time attribute value.
- the attribute value of the first valid drawing time is recorded, so as to avoid the failure to load the text object on the target web page. and/or picture objects, the recorded property value of the first valid drawing time expands the adaptability of the property value of the first valid drawing time, so that the property value of the first valid drawing time is more in line with the actual loading situation of the target web page.
- the embodiments of the present disclosure are based on text rendering parameters and/or image rendering parameters of web page data, as well as the height of the target web page, the screen height of the terminal where the browser is located, and the time point when the web page data is rendered.
- the attribute value of the first effective rendering time is generated, and in another embodiment, without performing the above steps, it can be generated based on the text rendering parameters and/or image rendering parameters of the webpage data, and the time point when the webpage data is rendered.
- Property value for first valid draw time is generated, and in another embodiment, without performing the above steps, it can be generated based on the text rendering parameters and/or image rendering parameters of the webpage data, and the time point when the webpage data is rendered.
- the embodiments of the present disclosure can recompile the above-mentioned kernel into a new browser, use the new browser to load any web page, and then obtain the performance data of any web page, without the need to modify, mark, etc. the web page to be loaded, thus reducing the batch size
- the workload of detecting web page performance also expands the scope of application of web page performance detection.
- Fig. 4 is a block diagram of an apparatus for acquiring data according to an exemplary embodiment.
- a browser is installed in the device.
- the browser includes an interface description language file.
- the interface description language file is provided with attribute types of performance data.
- the attribute type indicates the type of the performance data of the webpage.
- the device includes the following modules.
- the obtaining module 41 is configured to obtain the rendering parameters of the webpage data through the browser, and the webpage data is the data of the target webpage;
- the generating module 42 is configured to generate the attribute value of the attribute type based on the rendering parameter
- the export module 43 is configured to transmit the attribute value of the attribute type contained in the interface description language file to the performance monitoring interface of the browser based on the interface description language file, and obtain the attribute value of the attribute type from the performance monitoring interface.
- the obtaining module 41 is configured to, through the browser, call a rendering notification method to obtain the rendering of the webpage data for which the rendering ends this time after each frame of webpage data of the target webpage is rendered. parameter.
- the kernel of the browser has a performance timing interface
- the apparatus further includes:
- a transmission module configured to transmit rendering parameters to the performance timing interface
- the generating module 42 is configured to call the performance timing interface to generate the attribute value of the attribute type based on the rendering parameter.
- the performance monitoring interface is an interface in a scripting environment of a browser
- the export module 43 is configured to call a script to obtain the attribute value of the attribute type from the performance monitoring interface.
- the rendering parameter includes the first rendering parameter;
- the attribute type of the performance data includes the first rendering time;
- the generating module 42 is configured to be the first parameter threshold when the parameter value of the first rendering parameter is the first parameter threshold, and If the property value of the first drawing time is empty, the time point when the rendering of the web page data ends is determined as the property value of the first drawing time.
- the rendering parameter includes a text rendering parameter; the attribute type includes the first content rendering time; the generating module 42 is further configured to set the parameter value of the text rendering parameter to a second parameter threshold, and If the attribute value of the first content rendering time is empty, the time point when the rendering of the web page data ends is determined as the attribute value of the first content rendering time.
- the rendering parameters include text rendering parameters and/or image rendering parameters; the attribute type includes the first valid rendering time; the generating module 42 is further configured to be based on the text rendering parameters and/or the webpage data. Or image rendering parameters, and the time point when the webpage data is rendered, generate the attribute value of the first valid rendering time.
- the target web page corresponds to multiple frames of web page data
- the generating module 42 includes:
- the quantity acquisition module is configured to, for each frame of web page data, acquire the number of target web page objects based on text rendering parameters and/or image rendering parameters of the web page data, where the target web page objects are web page objects contained in the target web page, and the target web page is changed web page layout;
- a ratio generating module configured to generate a first ratio between the height of the target web page and the height of the screen
- a ratio comparison module configured to determine the larger value between the first ratio and the preset value, and to determine the second ratio between the quantity and the larger value
- the time recording module is configured to, based on the second ratio corresponding to each frame of webpage data, determine the time point when the webpage data corresponding to the largest second ratio is rendered as the attribute value of the first effective rendering time.
- the time recording module is configured to, after the text objects and/or picture objects in the target webpage are loaded, based on the second ratio corresponding to each frame of webpage data, record the largest first The time point when the webpage data corresponding to the two ratios is rendered is determined as the attribute value of the first effective rendering time.
- An embodiment of the present disclosure further provides an electronic device, including: a processor; a memory for storing executable instructions of the processor; wherein the electronic device is installed with a browser, and the browser includes an interface description language file, and the interface description language file
- the attribute type is set in the attribute type, and the attribute type indicates the type of the performance data of the webpage.
- the processor is configured to execute the instruction to realize the following operations: through the browser, the rendering parameters of the webpage data are obtained, and the webpage data is the data of the target webpage. ; Based on the rendering parameters, the attribute value of the attribute type is generated; based on the interface description language file, the attribute value of the attribute type contained in the interface description language file is transmitted to the performance monitoring interface of the browser, and the attribute value of the attribute type is obtained from the performance monitoring interface.
- the processor is configured to execute an instruction to implement the following steps: by using the browser, after each frame of webpage data of the target webpage is rendered, call a rendering notification method to obtain the rendering of the webpage data for which the rendering has ended. parameter.
- the kernel of the browser has a performance timing interface
- the processor is configured to execute an instruction to implement the following steps: transmitting rendering parameters to the performance timing interface; calling the performance timing interface to generate an attribute of the attribute type based on the rendering parameter value.
- the performance monitoring interface is an interface in the scripting environment of the browser; the processor is configured to execute an instruction to implement the following steps: invoking a script to obtain the attribute value of the attribute type from the performance monitoring interface.
- the rendering parameter includes the first rendering parameter
- the attribute type includes the first rendering time
- the processor is configured to execute the instruction to implement the following steps: when the parameter value of the first rendering parameter is the first parameter threshold, and the first rendering time When the attribute value is empty, the time point when the rendering of the web page data ends is determined as the attribute value of the first drawing time.
- the rendering parameter includes a text rendering parameter; the attribute type includes the first content rendering time; the processor is configured to execute the instruction to implement the following steps: when the parameter value of the text rendering parameter is the second parameter threshold, and the first content rendering When the attribute value of time is empty, the time point when the rendering of the webpage data ends is determined as the attribute value of the first content rendering time.
- the rendering parameters include text rendering parameters and/or image rendering parameters;
- the attribute type includes the first valid rendering time;
- the processor is configured to execute instructions to implement the following steps: text rendering parameters and/or images based on web page data Rendering parameters, as well as the time point when the web page data is rendered, generate the property value of the first valid drawing time.
- the target web page corresponds to multiple frames of web page data
- the processor is configured to execute instructions to implement the following steps: for each frame of web page data, obtain the target web page based on text rendering parameters and/or image rendering parameters of the web page data
- the number of objects, the target webpage object is the webpage object contained in the target webpage, and the webpage layout of the target webpage is changed; the first ratio between the height of the target webpage and the screen height is generated; the larger value between the first ratio and the preset value is determined , determine the second ratio between the number and the larger value; based on the second ratio corresponding to each frame of webpage data, determine the time point when the webpage data corresponding to the largest second ratio is rendered as the first effective rendering time property value.
- the processor is configured to execute the instructions to implement the following steps: after the text objects and/or picture objects in the target webpage are loaded, based on the second ratio corresponding to each frame of webpage data, the largest second The time point at the end of rendering of the webpage data corresponding to the ratio is determined as the attribute value of the first valid rendering time.
- FIG. 5 is a block diagram of an electronic device 500 according to an exemplary embodiment.
- the electronic device 500 is provided as a terminal.
- electronic device 500 is a mobile phone, computer, digital broadcast terminal, messaging device, game console, tablet device, medical device, fitness device, personal digital assistant, and the like.
- an electronic device 500 includes one or more of the following components: a processing component 502, a memory 504, a power component 506, a multimedia component 508, an audio component 510, an input/output (I/O) interface 512, a sensor component 514, and communication component 516 .
- the processing component 502 generally controls the overall operation of the electronic device 500, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations.
- the processing component 502 includes one or more processors 520 to execute the instructions to complete all or part of the steps of the above data acquisition method.
- processing component 502 includes one or more modules that facilitate interaction between processing component 502 and other components.
- processing component 502 includes a multimedia module to facilitate interaction between multimedia component 508 and processing component 502.
- Memory 504 is configured to store various types of data to support operation at electronic device 500 . Examples of such data include instructions for any application or method operating on electronic device 500, contact data, phonebook data, messages, images, videos, and the like. Memory 504 is implemented by any type of volatile or non-volatile storage device or combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read Only Memory (EEPROM), Erasable Programmable Read Only Memory (EPROM), Programmable Read Only Memory (PROM), Read Only Memory (ROM), Magnetic Memory, Flash Memory, Magnetic or Optical Disk.
- SRAM Static Random Access Memory
- EEPROM Electrically Erasable Programmable Read Only Memory
- EPROM Erasable Programmable Read Only Memory
- PROM Programmable Read Only Memory
- ROM Read Only Memory
- Magnetic Memory Flash Memory
- Magnetic or Optical Disk Magnetic Memory
- Power supply assembly 506 provides power to various components of electronic device 500 .
- Power supply components 506 include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to electronic device 500 .
- Multimedia component 508 includes a screen that provides an output interface between electronic device 500 and the user.
- the screen includes a liquid crystal display (LCD) and a touch panel (TP).
- the screen is implemented as a touch screen to receive input signals from a user.
- the touch panel includes one or more touch sensors to sense touch, swipe, and gestures on the touch panel.
- a touch sensor not only senses the boundaries of a touch or swipe action, but also detects the duration and pressure associated with the touch or swipe action.
- the multimedia component 508 includes a front-facing camera and/or a rear-facing camera. When the electronic device 500 is in an operation mode, such as a shooting mode or a video mode, the front camera and/or the rear camera can receive external multimedia data.
- Each of the front and rear cameras can be a fixed optical lens system or have focal length and optical zoom capability.
- Audio component 510 is configured to output and/or input audio signals.
- audio component 510 includes a microphone (MIC) that is configured to receive external audio signals when electronic device 500 is in operating modes, such as call mode, recording mode, and voice recognition mode.
- the received audio signal can be further stored in memory 504 or transmitted via communication component 516 .
- the audio component 510 also includes a speaker for outputting audio signals.
- I/O interface 512 provides an interface between processing component 502 and peripheral interface modules, which can be keyboards, click wheels, buttons, and the like. These buttons may include, but are not limited to: home button, volume buttons, start button, and lock button.
- Sensor assembly 514 includes one or more sensors for providing status assessments of various aspects of electronic device 500 .
- the sensor assembly 514 can detect the open/closed state of the electronic device 500, the relative positioning of the components, such as the display and keypad of the electronic device 500, and the sensor assembly 514 can also detect the electronic device 500 or a component of the electronic device 500. Changes in position, presence or absence of user contact with the electronic device 500 , orientation or acceleration/deceleration of the electronic device 500 , and temperature changes in the electronic device 500 .
- Sensor assembly 514 includes a proximity sensor configured to detect the presence of nearby objects in the absence of any physical contact.
- Sensor assembly 514 also includes a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications.
- the sensor assembly 514 also includes an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
- Communication component 516 is configured to facilitate wired or wireless communication between electronic device 500 and other devices.
- Electronic device 500 is capable of accessing wireless networks based on communication standards, such as WiFi, carrier networks (eg, 2G, 3G, 4G, or 5G), or a combination thereof.
- the communication component 516 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel.
- the communication component 516 also includes a near field communication (NFC) module to facilitate short-range communication.
- the NFC module may be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
- RFID radio frequency identification
- IrDA infrared data association
- UWB ultra-wideband
- Bluetooth Bluetooth
- electronic device 500 is implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable A gate array (FPGA), a controller, a microcontroller, a microprocessor or other electronic components are implemented for implementing the above data acquisition method.
- ASICs application specific integrated circuits
- DSPs digital signal processors
- DSPDs digital signal processing devices
- PLDs programmable logic devices
- FPGA field programmable A gate array
- controller a controller
- microcontroller a microcontroller
- microprocessor or other electronic components are implemented for implementing the above data acquisition method.
- a storage medium including instructions such as a memory 504 including instructions, is also provided, and the above-mentioned instructions can be executed by the processor 520 of the electronic device 500 to complete the above-mentioned data acquisition method.
- the storage medium is a non-transitory computer-readable storage medium, or, alternatively, a non-transitory computer-readable storage medium, eg, a non-transitory computer-readable storage medium is ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk or optical data storage device, etc.
- the electronic device can perform the following steps: obtaining the rendering parameters of the web page data through the browser installed in the electronic device, and the web page data is The data of the target web page; based on the rendering parameters, the attribute value of the attribute type is generated; based on the interface description language file, the attribute value of the attribute type contained in the interface description language file is transmitted to the performance monitoring interface of the browser, and the attribute type is obtained from the performance monitoring interface property value.
- the instructions in the non-volatile computer-readable storage medium when executed by the processor of the electronic device, enable the electronic device to perform the following steps: through the browser, each frame of web page data of the target web page is After the rendering is completed, the rendering notification method is called to obtain the rendering parameters of the web page data at the end of the rendering.
- the kernel of the browser has a performance timing interface
- the instructions in the non-volatile computer-readable storage medium when executed by the processor of the electronic device, enable the electronic device to perform the steps of: transmitting rendering parameters to Performance timing interface; call the performance timing interface to generate the attribute value of the attribute type based on the rendering parameters.
- the performance monitoring interface is an interface in the scripting environment of the browser; when the instructions in the non-volatile computer-readable storage medium are executed by the processor of the electronic device, the electronic device can perform the following steps:
- the calling script obtains the attribute value of the attribute type from the performance monitoring interface.
- the rendering parameters include first rendering parameters, and the attribute type includes first rendering time; when the instructions in the non-volatile computer-readable storage medium are executed by the processor of the electronic device, the electronic device can perform the following steps: When the parameter value of the first rendering parameter is the first parameter threshold, and the attribute value of the first rendering time is empty, the time point when the rendering of the webpage data ends is determined as the attribute value of the first rendering time.
- the rendering parameters include text rendering parameters; the attribute type includes the first content rendering time; when the instructions in the non-volatile computer-readable storage medium are executed by the processor of the electronic device, the electronic device can perform the following steps : When the parameter value of the text rendering parameter is the second parameter threshold, and the attribute value of the first content rendering time is empty, the time point when the webpage data is rendered is determined as the attribute value of the first content rendering time.
- the rendering parameters include text rendering parameters and/or picture rendering parameters;
- the attribute type includes the first valid drawing time;
- the instructions in the non-volatile computer-readable storage medium are executed by the processor of the electronic device, the The electronic device can perform the following steps: based on the text rendering parameters and/or picture rendering parameters of the webpage data, and the time point when the webpage data is rendered, generate the attribute value of the first effective drawing time.
- the target web page corresponds to multiple frames of web page data
- the electronic device can perform the following steps: for each frame of web page data , based on the text rendering parameters and/or image rendering parameters of the web page data, obtain the number of target web page objects, the target web page objects are web page objects contained in the target web page, and change the web page layout of the target web page; generate the height and screen height of the target web page determine the first ratio between the first ratio and the preset value, and determine the second ratio between the quantity and the larger value; based on the second ratio corresponding to each frame of webpage data, the largest second ratio corresponds to The time point when the web page data is rendered is determined as the property value of the first valid drawing time.
- the electronic device when the instructions in the non-volatile computer-readable storage medium are executed by the processor of the electronic device, the electronic device can perform the following steps: the text object and/or the picture object in the target web page is loaded Then, based on the second ratio corresponding to each frame of webpage data, the time point when the webpage data corresponding to the largest second ratio is rendered is determined as the attribute value of the first effective rendering time.
- a computer program product comprising readable program code executable by the processor 520 of the electronic device 500 to perform the steps of:
- the browser installed in the device obtains the rendering parameters of the webpage data, and the webpage data is the data of the target webpage; based on the rendering parameters, the attribute value of the attribute type is generated; based on the interface description language file, the attribute type of the attribute type contained in the interface description language file is converted into The value is transmitted to the performance monitoring interface of the browser, and the attribute value of the attribute type is obtained from the performance monitoring interface.
- the readable program code can be executed by the processor of the electronic device to complete the following steps: through the browser, after each frame of web page data of the target web page is rendered, call a rendering notification method to obtain the end of this rendering The rendering parameters of the web page data.
- the kernel of the browser has a performance timing interface
- the readable program code can be executed by the processor of the electronic device to complete the following steps: transmitting rendering parameters to the performance timing interface; calling the performance timing interface, based on the rendering parameters, Generates the attribute value of the attribute type.
- the performance monitoring interface is an interface in the scripting environment of the browser; the readable program code can be executed by the processor of the electronic device to complete the following steps:
- the calling script obtains the attribute value of the attribute type from the performance monitoring interface.
- the rendering parameter includes the first rendering parameter
- the attribute type includes the first rendering time
- the readability program code can be executed by the processor of the electronic device to complete the following steps: when the parameter value of the first rendering parameter is the first parameter threshold, And if the property value of the first drawing time is empty, the time point when the rendering of the web page data ends is determined as the property value of the first drawing time.
- the rendering parameter includes a text rendering parameter; the attribute type includes the first content rendering time; the readability program code can be executed by the processor of the electronic device to complete the following steps: when the parameter value of the text rendering parameter is the second parameter threshold , and if the attribute value of the first content rendering time is empty, the time point when the rendering of the webpage data ends is determined as the attribute value of the first content rendering time.
- the rendering parameters include text rendering parameters and/or image rendering parameters;
- the attribute type includes first valid drawing time;
- the readability program code can be executed by the processor of the electronic device to complete the following steps: text rendering based on web page data Parameters and/or image rendering parameters, as well as the time point when the webpage data is rendered, generate the attribute value of the first valid rendering time.
- the target web page corresponds to multiple frames of web page data
- the readable program code can be executed by the processor of the electronic device to complete the following steps: for each frame of web page data, text rendering parameters and/or image rendering based on the web page data parameter, obtains the number of target web page objects, the target web page objects are web page objects contained in the target web page, and the web page layout of the target web page is changed; the first ratio between the height of the target web page and the screen height is generated; the first ratio and the preset value are determined Determine the second ratio between the number and the larger value; based on the second ratio corresponding to each frame of webpage data, determine the time point when the webpage data corresponding to the largest second ratio is rendered as the first The property value of the next valid draw time.
- the readability program code can be executed by the processor of the electronic device to complete the following steps: after the text object and/or the picture object in the target webpage is loaded, based on the second ratio corresponding to each frame of webpage data, The time point when the rendering of the webpage data corresponding to the largest second ratio is completed is determined as the attribute value of the first effective rendering time.
- the program code is stored in a storage medium of the electronic device 500, which is a non-transitory computer-readable storage medium, or a non-transitory computer-readable storage medium, eg, a non-transitory computer-readable storage medium
- the read storage medium is ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, or optical data storage device, or the like.
- FIG. 6 is a block diagram of another electronic device 600 according to an exemplary embodiment.
- the electronic device 600 is provided as a server.
- electronic device 600 includes a processing component 622, which further includes one or more processors, and a memory resource, represented by memory 632, for storing instructions executable by processing component 622, such as applications.
- the application program stored in memory 632 includes one or more modules, each corresponding to a set of instructions.
- the processing component 622 is configured to execute instructions to perform the above-described data acquisition method.
- the electronic device 600 also includes a power supply assembly 626 configured to perform power management of the electronic device 600, a wired or wireless network interface 650 configured to connect the electronic device 600 to a network, and an input output (I/O) interface 658.
- Electronic device 600 is capable of operating based on an operating system stored in memory 632, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM or the like.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Information Transfer Between Computers (AREA)
Abstract
Description
Claims (29)
- 一种数据的获取方法,由电子设备执行,所述电子设备中安装有浏览器,所述浏览器包括接口描述语言文件,所述接口描述语言文件中设置有属性类型,所述属性类型指示网页的性能数据所属的类型,所述方法包括:通过所述浏览器,获取网页数据的渲染参数,所述网页数据为目标网页的数据;基于所述渲染参数,生成所述属性类型的属性值;基于所述接口描述语言文件,将所述接口描述语言文件包含的属性类型的属性值传输至所述浏览器的性能监控接口,从所述性能监控接口获取所述属性类型的属性值。
- 根据权利要求1所述的方法,其中,所述通过所述浏览器,获取网页数据的渲染参数,包括:通过所述浏览器,在所述目标网页的每帧所述网页数据被渲染结束之后,调用渲染通知方法获取本次渲染结束的所述网页数据的渲染参数。
- 根据权利要求2所述的方法,其中,所述浏览器的内核具有性能计时接口,所述方法还包括:将所述渲染参数传输至所述性能计时接口;所述基于所述渲染参数,生成所述属性类型的属性值,包括:调用所述性能计时接口,基于所述渲染参数,生成所述属性类型的属性值。
- 根据权利要求1所述的方法,其中,所述性能监控接口为所述浏览器的脚本环境中的接口;所述从所述性能监控接口获取所述属性类型的属性值,包括:调用脚本从所述性能监控接口获取所述属性类型的属性值。
- 根据权利要求1所述的方法,其中,所述渲染参数包含首次渲染参数,所述属性类型包含首次绘制时间;所述基于所述渲染参数,生成所述属性类型的属性值,包括:在所述首次渲染参数的参数值为第一参数阈值,且所述首次绘制时间的属性值为空的情况下,将所述网页数据被渲染结束时的时间点,确定为所述首次绘制时间的属性值。
- 根据权利要求1所述的方法,其中,所述渲染参数包含文字渲染参数;所述属性类型包含首次内容绘制时间;所述基于所述渲染参数,生成所述属性类型的属性值,包括:在所述文字渲染参数的参数值为第二参数阈值,且所述首次内容绘制时间的属性值为空的情况下,将所述网页数据被渲染结束时的时间点,确定为所述首次内容绘制时间的属性值。
- 根据权利要求1所述的方法,其中,所述渲染参数包含文字渲染参数和/或图片渲染参数;所述属性类型包含首次有效绘制时间;所述基于所述渲染参数,生成所述属性类型的属性值,包括:基于所述网页数据的所述文字渲染参数和/或所述图片渲染参数,以及所述网页数据被渲染结束时的时间点,生成所述首次有效绘制时间的属性值。
- 根据权利要求7所述的方法,其中,所述目标网页对应有多帧所述网页数据,所述基于所述网页数据的所述文字渲染参数和/或所述图片渲染参数,以及所述网页数据被渲染结束时的时间点,生成所述首次有效绘制时间的属性值,包括:对于每帧所述网页数据,基于所述网页数据的所述文字渲染参数和/或所述图片渲染参数,获取目标网页对象的数量,所述目标网页对象为所述目标网页包含的网页对象,且改变了所述目标网页的网页布局;生成所述目标网页的高度与所述屏幕高度的第一比值;确定所述第一比值与预设数值中的较大值,确定所述数量与所述较大值之间的第二比值;基于每帧所述网页数据对应的第二比值,将最大的第二比值对应的网页数据被渲染结束时的时间点,确定为所述首次有效绘制时间的属性值。
- 根据权利要求8所述的方法,其中,所述基于每帧所述网页数据对应的第二比值,将最大的第二比值对应的网页数据被渲染结束时的时间点,确定为所述首次有效绘制时间的属性值,包括:在所述目标网页中的文字对象和/或图片对象加载完毕之后,基于每帧所述网页数据对应的第二比值,将最大的第二比值对应的网页数据被渲染结束时的时间点,确定为所述首次有效绘制时间的属性值。
- 一种数据的获取装置,所述装置中安装有浏览器,所述浏览器包括接口描述语言文件,所述接口描述语言文件中设置有属性类型,所述属性类型指示网页的性能数据所属的类型,所述装置包括:获取模块,被配置为通过所述浏览器,获取网页数据的渲染参数,所述网页数据为目标网页的数据;生成模块,被配置为基于所述渲染参数,生成所述属性类型的属性值;导出模块,被配置为基于所述接口描述语言文件,将所述接口描述语言文件包含的属 性类型的属性值传输至所述浏览器的性能监控接口,从所述性能监控接口获取所述属性类型的属性值。
- 根据权利要求10所述的装置,其中,所述获取模块,被配置为通过所述浏览器,在所述目标网页的每帧所述网页数据被渲染结束之后,调用渲染通知方法获取本次渲染结束的所述网页数据的渲染参数。
- 根据权利要求11所述的装置,其中,所述浏览器的内核具有性能计时接口,所述装置还包括:传输模块,被配置为将所述渲染参数传输至所述性能计时接口;所述生成模块,被配置为调用所述性能计时接口,基于所述渲染参数,生成所述属性类型的属性值。
- 根据权利要求10所述的装置,其中,所述性能监控接口为所述浏览器的脚本环境中的接口;所述导出模块,被配置为调用脚本从所述性能监控接口获取所述属性类型的属性值。
- 根据权利要求10所述的装置,其中,所述渲染参数包含首次渲染参数;所述属性类型包含首次绘制时间;所述生成模块,被配置为在所述首次渲染参数的参数值为第一参数阈值,且所述首次绘制时间的属性值为空的情况下,将所述网页数据被渲染结束时的时间点,确定为所述首次绘制时间的属性值。
- 根据权利要求10所述的装置,其中,所述渲染参数包含文字渲染参数;所述属性类型包含首次内容绘制时间;所述生成模块,还被配置为在所述文字渲染参数的参数值为第二参数阈值,且所述首次内容绘制时间的属性值为空的情况下,将所述网页数据被渲染结束时的时间点,确定为所述首次内容绘制时间的属性值。
- 根据权利要求10所述的装置,其中,所述渲染参数包含文字渲染参数和/或图片渲染参数;所述属性类型包含首次有效绘制时间;所述生成模块,还被配置为基于所述网页数据的所述文字渲染参数和/或所述图片渲染参数,以及所述网页数据被渲染结束时的时间点,生成所述首次有效绘制时间的属性值。
- 根据权利要求16所述的装置,其中,所述目标网页对应有多帧所述网页数据,所述生成模块,包括:数量获取模块,被配置为对于每帧所述网页数据,基于所述网页数据的所述文字渲染参数和/或所述图片渲染参数,获取目标网页对象的数量,所述目标网页对象为所述目标网页包含的网页对象,且改变了所述目标网页的网页布局;比值生成模块,被配置为生成所述目标网页的高度与所述屏幕高度的第一比值;比值比较模块,被配置为确定所述第一比值与预设数值中的较大值,确定所述数量与所述较大值之间的第二比值;时间记录模块,被配置为基于每帧所述网页数据对应的第二比值,将最大的第二比值对应的网页数据被渲染结束时的时间点,确定为所述首次有效绘制时间的属性值。
- 根据权利要求17所述的装置,其中,所述时间记录模块,被配置为在所述目标网页中的文字对象和/或图片对象加载完毕之后,基于每帧所述网页数据对应的第二比值,将最大的第二比值对应的网页数据被渲染结束时的时间点,确定为所述首次有效绘制时间的属性值。
- 一种电子设备,其中,包括:处理器;用于存储所述处理器可执行指令的存储器;其中,所述电子设备安装有浏览器,所述浏览器包括接口描述语言文件,所述接口描述语言文件中设置有属性类型,所述属性类型指示网页的性能数据所属的类型,所述处理器被配置为执行所述指令,实现以下步骤:通过所述浏览器,获取网页数据的渲染参数,所述网页数据为目标网页的数据;基于所述渲染参数,生成所述属性类型的属性值;基于所述接口描述语言文件,将所述接口描述语言文件包含的属性类型的属性值传输至所述浏览器的性能监控接口,从所述性能监控接口获取所述属性类型的属性值。
- 根据权利要求19所述的电子设备,其中,所述处理器被配置为执行所述指令,实现以下步骤:通过所述浏览器,在所述目标网页的每帧所述网页数据被渲染结束之后,调用渲染通知方法获取本次渲染结束的所述网页数据的渲染参数。
- 根据权利要求20所述的电子设备,其中,所述浏览器的内核具有性能计时接口,所述处理器被配置为执行所述指令,实现以下步骤:将所述渲染参数传输至所述性能计时接口;调用所述性能计时接口,基于所述渲染参数,生成所述属性类型的属性值。
- 根据权利要求19所述的电子设备,其中,所述性能监控接口为所述浏览器的脚本环境中的接口;所述处理器被配置为执行所述指令,实现以下步骤:调用脚本从所述性能监控接口获取所述属性类型的属性值。
- 根据权利要求19所述的电子设备,其中,所述渲染参数包含首次渲染参数,所述属性类型包含首次绘制时间;所述处理器被配置为执行所述指令,实现以下步骤:在所述首次渲染参数的参数值为第一参数阈值,且所述首次绘制时间的属性值为空的情况下,将所述网页数据被渲染结束时的时间点,确定为所述首次绘制时间的属性值。
- 根据权利要求19所述的电子设备,其中,所述渲染参数包含文字渲染参数;所述属性类型包含首次内容绘制时间;所述处理器被配置为执行所述指令,实现以下步骤:在所述文字渲染参数的参数值为第二参数阈值,且所述首次内容绘制时间的属性值为空的情况下,将所述网页数据被渲染结束时的时间点,确定为所述首次内容绘制时间的属性值。
- 根据权利要求19所述的电子设备,其中,所述渲染参数包含文字渲染参数和/或图片渲染参数;所述属性类型包含首次有效绘制时间;所述处理器被配置为执行所述指令,实现以下步骤:基于所述网页数据的所述文字渲染参数和/或所述图片渲染参数,以及所述网页数据被渲染结束时的时间点,生成所述首次有效绘制时间的属性值。
- 根据权利要求25所述的电子设备,其中,所述目标网页对应有多帧所述网页数据,所述处理器被配置为执行所述指令,实现以下步骤:对于每帧所述网页数据,基于所述网页数据的所述文字渲染参数和/或所述图片渲染参数,获取目标网页对象的数量,所述目标网页对象为所述目标网页包含的网页对象,且改变了所述目标网页的网页布局;生成所述目标网页的高度与所述屏幕高度的第一比值;确定所述第一比值与预设数值中的较大值,确定所述数量与所述较大值之间的第二比值;基于每帧所述网页数据对应的第二比值,将最大的第二比值对应的网页数据被渲染结束时的时间点,确定为所述首次有效绘制时间的属性值。
- 根据权利要求26所述的电子设备,其中,所述处理器被配置为执行所述指令,实现以下步骤:在所述目标网页中的文字对象和/或图片对象加载完毕之后,基于每帧所述网页数据对应的第二比值,将最大的第二比值对应的网页数据被渲染结束时的时间点,确定为所述首次有效绘制时间的属性值。
- 一种非易失性计算机可读存储介质,当所述非易失性计算机可读存储介质中的指令由电子设备的处理器执行时,使得所述电子设备能够执行如下步骤:通过所述电子设备中安装的浏览器,获取网页数据的渲染参数,所述网页数据为目标网页的数据;基于所述渲染参数,生成所述属性类型的属性值;基于所述接口描述语言文件,将所述接口描述语言文件包含的属性类型的属性值传输至所述浏览器的性能监控接口,从所述性能监控接口获取所述属性类型的属性值。
- 一种计算机程序产品,包括可读性程序代码,所述可读性程序代码可由电子设备的处理器执行以完成如下步骤:通过所述电子设备中安装的浏览器,获取网页数据的渲染参数,所述网页数据为目标网页的数据;基于所述渲染参数,生成所述属性类型的属性值;基于所述接口描述语言文件,将所述接口描述语言文件包含的属性类型的属性值传输至所述浏览器的性能监控接口,从所述性能监控接口获取所述属性类型的属性值。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202011522734.8A CN112685269A (zh) | 2020-12-21 | 2020-12-21 | 数据的获取方法、装置、电子设备及存储介质 |
| CN202011522734.8 | 2020-12-21 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2022134875A1 true WO2022134875A1 (zh) | 2022-06-30 |
Family
ID=75450139
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2021/128390 Ceased WO2022134875A1 (zh) | 2020-12-21 | 2021-11-03 | 数据的获取方法及电子设备 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN112685269A (zh) |
| WO (1) | WO2022134875A1 (zh) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN119383100A (zh) * | 2024-12-30 | 2025-01-28 | 北京云中融信网络科技有限公司 | 一种Web应用的无入侵式监控方法及系统 |
Families Citing this family (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112685269A (zh) * | 2020-12-21 | 2021-04-20 | 北京达佳互联信息技术有限公司 | 数据的获取方法、装置、电子设备及存储介质 |
| CN113177176A (zh) * | 2021-05-21 | 2021-07-27 | 脸萌有限公司 | 特征构建方法、内容显示方法及相关装置 |
Citations (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN104881273A (zh) * | 2014-02-27 | 2015-09-02 | 腾讯科技(深圳)有限公司 | 一种网页渲染的分析方法和终端设备 |
| CN108205487A (zh) * | 2016-12-20 | 2018-06-26 | 广州市动景计算机科技有限公司 | 一种监控浏览器性能的方法、装置及用户终端 |
| CN110162451A (zh) * | 2019-04-22 | 2019-08-23 | 腾讯科技(深圳)有限公司 | 一种性能分析方法、装置、服务器及存储介质 |
| US20200104232A1 (en) * | 2018-09-28 | 2020-04-02 | Ebay Inc. | Automated Determination of Web Page Rendering Performance |
| CN111290912A (zh) * | 2020-01-22 | 2020-06-16 | 北京百度网讯科技有限公司 | 单页面应用性能监控方法、装置和电子设备 |
| US20200241996A1 (en) * | 2019-01-30 | 2020-07-30 | Salesforce.Com, Inc. | Distributed web page performance monitoring methods and systems |
| CN112685269A (zh) * | 2020-12-21 | 2021-04-20 | 北京达佳互联信息技术有限公司 | 数据的获取方法、装置、电子设备及存储介质 |
Family Cites Families (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN108536594B (zh) * | 2018-04-02 | 2022-03-08 | 腾讯科技(武汉)有限公司 | 页面测试方法、装置及存储设备 |
-
2020
- 2020-12-21 CN CN202011522734.8A patent/CN112685269A/zh active Pending
-
2021
- 2021-11-03 WO PCT/CN2021/128390 patent/WO2022134875A1/zh not_active Ceased
Patent Citations (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN104881273A (zh) * | 2014-02-27 | 2015-09-02 | 腾讯科技(深圳)有限公司 | 一种网页渲染的分析方法和终端设备 |
| CN108205487A (zh) * | 2016-12-20 | 2018-06-26 | 广州市动景计算机科技有限公司 | 一种监控浏览器性能的方法、装置及用户终端 |
| US20200104232A1 (en) * | 2018-09-28 | 2020-04-02 | Ebay Inc. | Automated Determination of Web Page Rendering Performance |
| US20200241996A1 (en) * | 2019-01-30 | 2020-07-30 | Salesforce.Com, Inc. | Distributed web page performance monitoring methods and systems |
| CN110162451A (zh) * | 2019-04-22 | 2019-08-23 | 腾讯科技(深圳)有限公司 | 一种性能分析方法、装置、服务器及存储介质 |
| CN111290912A (zh) * | 2020-01-22 | 2020-06-16 | 北京百度网讯科技有限公司 | 单页面应用性能监控方法、装置和电子设备 |
| CN112685269A (zh) * | 2020-12-21 | 2021-04-20 | 北京达佳互联信息技术有限公司 | 数据的获取方法、装置、电子设备及存储介质 |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN119383100A (zh) * | 2024-12-30 | 2025-01-28 | 北京云中融信网络科技有限公司 | 一种Web应用的无入侵式监控方法及系统 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN112685269A (zh) | 2021-04-20 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| WO2019109564A1 (zh) | 屏幕显示控制的方法和装置 | |
| CN108509232A (zh) | 屏幕录制方法、装置及计算机可读存储介质 | |
| US10708512B2 (en) | Method and device for capturing image and storage medium | |
| US20170060260A1 (en) | Method and device for connecting external equipment | |
| US12561173B2 (en) | Method for data processing and apparatus, and electronic device | |
| WO2022134875A1 (zh) | 数据的获取方法及电子设备 | |
| CN106547547B (zh) | 数据采集方法及装置 | |
| US20220343056A1 (en) | Method for loading image and electronic device | |
| CN104679599A (zh) | 在应用程序间进行复制的方法和装置 | |
| EP3012750A1 (en) | Method and device for identifying encoding of web page | |
| CN112269556A (zh) | 信息展示方法、装置、系统、设备、服务器及存储介质 | |
| CN106851695B (zh) | 一种测试网速的方法、装置和系统 | |
| US11210449B2 (en) | Page display method and device and storage medium | |
| CN112711723A (zh) | 一种恶意网址检测方法、装置及电子设备 | |
| CN107423059A (zh) | 页面的显示方法、装置及终端 | |
| US20160364459A1 (en) | Search method and search device | |
| CN112083841B (zh) | 信息输入方法、装置和存储介质 | |
| CN109491655B (zh) | 一种输入事件处理方法及装置 | |
| CN110046019A (zh) | 一种聊天信息查找方法、装置及电子设备 | |
| CN113535161B (zh) | 一种用户界面生成方法及装置 | |
| CN113885986B (zh) | 数据传输方法、装置和电子设备 | |
| CN106155875A (zh) | 一种导出系统日志的方法和装置 | |
| CN111538486B (zh) | 布局文件嵌套层数筛查方法、装置及电子设备 | |
| CN108830268A (zh) | 内容获取方法、装置、终端及存储介质 | |
| WO2023046105A1 (zh) | 消息发送方法、装置和电子设备 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 21908876 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 21908876 Country of ref document: EP Kind code of ref document: A1 |
|
| 32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 160124) |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 21908876 Country of ref document: EP Kind code of ref document: A1 |