Method and device for determining page index parameters, storage medium and electronic device
By acquiring and sampling page loading videos, calculating the image change rate to determine the first-screen loading time, the problem of complex operations in the prior art resulting in low efficiency is solved, and more efficient page indicator parameter determination is achieved.
Patent Information
- Application Number
- CN202110977782.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-24
- Publication Date
- 2025-01-07
- Estimated Expiration
- 2041-08-24
AI Technical Summary
The operations used in the prior art to determine page indicator parameters are complex, resulting in low efficiency and lack of effective solutions.
By obtaining the page loading video, screen recording and sampling, the image change rate between two adjacent images in the image sequence is calculated, and the first-screen loading time is determined based on the change rate, so as to avoid relying on intrusive codes.
The operation threshold for determining page indicator parameters has been lowered, efficiency has been improved, and the problem of low efficiency in the existing technology has been overcome.
Smart Images

Figure CN113778825B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the computer field, and in particular, to a method and device for determining page index parameters, a storage medium, and an electronic device. Background Art
[0002] Many portal websites often collect user experience feedback through different indicator parameters, so as to adjust the website content based on the feedback to attract more users to the website. Among them, the first screen time is an important indicator of portal website user experience, which is used to indicate the time a website is filled with display elements.
[0003] At present, the following methods are usually used to determine the first screen time:
[0004] First screen module tag marking method: Invade the specific business code through the intrusion code, mark the end position of the first screen content in the HTML document, such as using firstScreen to mark. Assuming that the time when the page starts loading the first screen content is represented by performance.timing.navigationStart, it can be determined that: first screen time = firstScreen-performance.timing.navigationStart. However, the intrusion code will affect the security of the business code, and the operation is cumbersome.
[0005] That is to say, the operations for determining the page indicator parameters provided in the related art are relatively complicated, resulting in the problem of low efficiency in determining the page indicator parameters.
[0006] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0007] The present disclosure provides a method and device for determining page index parameters, a storage medium, and an electronic device, to at least solve the problem that the operation for determining page index parameters provided in the related art is relatively complicated, resulting in low efficiency in determining page index parameters. The technical solution of the present disclosure is as follows:
[0008] According to a first aspect of an embodiment of the present disclosure, a method for determining page indicator parameters is provided, comprising: obtaining a page loading video, wherein the page loading video is a recorded video obtained by screen recording after a target website starts to load a target page; sampling the page loading video to obtain an image sequence, wherein the image sequence includes a group of orderly arranged images; sequentially calculating the image change rate between two adjacent images in the image sequence until a target image change rate is obtained, wherein the image change rate is used to indicate the difference between page elements respectively contained in the two adjacent images, and the target image change rate is an image change rate that has reached a convergence condition; based on the page loading time corresponding to each of the two adjacent target images, determining the first screen loading time of the target page, wherein the two adjacent target images are images used to obtain the target image change rate.
[0009] According to the second aspect of the embodiment of the present disclosure, a device for determining page indicator parameters is also provided, including: a first acquisition unit, configured to acquire a page loading video, wherein the page loading video is a recorded video obtained by screen recording after the target website starts to load the target page; a sampling unit, configured to sample the page loading video to obtain an image sequence, wherein the image sequence includes a group of orderly arranged images; a second acquisition unit, configured to sequentially calculate the image change rate between two adjacent images in the image sequence until a target image change rate is acquired, wherein the image change rate is used to indicate the difference between page elements respectively contained in the two adjacent images, and the target image change rate is an image change rate that has reached a convergence condition; a determination unit, configured to determine the first screen loading time of the target page based on the page loading time corresponding to each of the two adjacent target images, wherein the two adjacent target images are images used to acquire the target image change rate.
[0010] According to a third aspect of an embodiment of the present disclosure, a computer-readable storage medium is also provided. When instructions in the above storage medium are executed by a processor of an electronic device, the above electronic device can execute the method for determining page indicator parameters as described above.
[0011] According to the fourth aspect of an embodiment of the present disclosure, there is also provided an electronic device, comprising a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to implement the method for determining the page indicator parameters.
[0012] According to a fifth aspect of an embodiment of the present disclosure, a computer program product is also provided for implementing the above-mentioned method for determining page indicator parameters.
[0013] The technical solution provided by the embodiments of the present disclosure brings at least the following beneficial effects:
[0014] After obtaining the page record video, the page loading video is sampled to obtain an image sequence. Then, the image change rate between two adjacent images in the image sequence is obtained in turn, and the first screen loading time of the target page is determined based on the page loading time corresponding to each of the two adjacent target images. In other words, the first screen time corresponding to the target page is determined based on the change rate of the page elements displayed during the loading process of the target page in the target website, without relying on the intrusion code, which reduces the operational threshold for determining the page indicator parameters, thereby achieving the effect of improving the parameter determination efficiency, thereby overcoming the problem of low determination efficiency in the method provided in the related art.
[0015] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.
[0017] Figure 1 is a schematic diagram of a hardware environment of an optional method for determining page index parameters according to an embodiment of the present invention;
[0018] Figure 2 is a schematic diagram of a hardware environment of another optional method for determining page index parameters according to an embodiment of the present invention;
[0019] Figure 3 is a flow chart of an optional method for determining page indicator parameters according to an embodiment of the present invention;
[0020] Figure 4 is a schematic diagram of an optional method for determining page indicator parameters according to an embodiment of the present invention;
[0021] Figure 5 is a schematic diagram of another optional method for determining page indicator parameters according to an embodiment of the present invention;
[0022] Figure 6 is a schematic diagram of another optional method for determining page indicator parameters according to an embodiment of the present invention;
[0023] Figure 7 It is a structural schematic diagram of an optional device for determining page indicator parameters according to an embodiment of the present invention. DETAILED DESCRIPTION
[0024] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.
[0025] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein.
[0026] The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0027] According to one aspect of an embodiment of the present invention, a method for determining a page indicator parameter is provided. Optionally, as an optional implementation, the method for determining a page indicator parameter may be, but is not limited to, applied to: Figure 1 The system for determining page index parameters in the hardware environment shown in FIG. 1 may include, but is not limited to, a terminal device 102, a network 104, and a server 106. The terminal device 102 runs a target website (such as a target website) logged in with a target user account. Figure 1 The target website is shown as a browser, which includes a search control and related data). The terminal device 102 includes a human-computer interaction screen, a processor and a memory. The human-computer interaction screen is used to display the interface content in the target website (such as Figure 1 The processor is used to generate an interaction instruction in response to the above human-computer interaction operation and send the interaction instruction to the server. The memory is used to store the information in the above target website, as well as the page loading video obtained by screen recording and the image sequence obtained by sampling.
[0028] In addition, the server 106 includes a processing engine, and the processing engine is used to perform storage or reading operations on the database 108. For example, the database 108 stores the above-mentioned received image sequence and the page indicator parameters determined for the target page.
[0029] The specific process is as follows: In step S102, a page loading video is obtained in the terminal device 102, and the page loading video is a screen recording video obtained after the target website starts to load the target page. Then, steps S104-S106 are performed to sample the page loading video to obtain an image sequence. The image sequence is sent to the server 106 through the network 104.
[0030] After the server 106 stores the received image sequence in the database 108, step S108 is executed to sequentially obtain the image change rate between two adjacent images in the image sequence from the database. Then, as in step S110, the first screen loading time of the target page is determined based on the page loading time corresponding to each of the two adjacent target images.
[0031] In addition, the system for determining the above-mentioned page index parameters may also include but is not limited to the terminal device 102. That is to say, for a terminal device with strong processing capabilities, the following steps can be completed independently: as in step S202, a page loading video is obtained in the terminal device 102, and the page loading video is a recorded video obtained by screen recording after the target website starts to load the target page. Then execute step S204 to sample the above-mentioned page loading video to obtain an image sequence. As in step S206, the image change rate between two adjacent images in the image sequence is obtained from the database in sequence. Then as in step S208, based on the page loading time corresponding to each of the two adjacent target images, the first screen loading time of the target page is determined.
[0032] Above Figure 1-Figure 2 The interface and process steps shown are examples and are not limited in this embodiment.
[0033] It should be noted that, in this embodiment, after obtaining the page record video, the page loading video is sampled to obtain an image sequence. Then, the image change rate between two adjacent images in the image sequence is obtained in turn, and the first screen loading time of the target page is determined based on the page loading time corresponding to each of the two adjacent target images. In other words, based on the change rate of the page elements displayed during the loading process of the target page in the target website, the first screen time corresponding to the target page is determined without relying on the intrusion code, which reduces the operational threshold for determining the page indicator parameters, thereby achieving the effect of improving the parameter determination efficiency, thereby overcoming the problem of low determination efficiency in the method provided in the related art.
[0034] Optionally, in this embodiment, the terminal device may be a terminal device running the target website, and may include but is not limited to at least one of the following: a mobile phone (such as an Android phone, an iOS phone, etc.), a laptop, a tablet computer, a PDA, a MID (Mobile Internet Devices), a PAD, a desktop computer, a smart TV, etc. The network may include but is not limited to: a wired network, a wireless network, wherein the wired network includes: a local area network, a metropolitan area network and a wide area network, and the wireless network includes: Bluetooth, WIFI and other networks that implement wireless communication. The server may be a single server, or a server cluster consisting of multiple servers, or a cloud server. The above is only an example, and this embodiment does not impose any limitation on this.
[0035] Optionally, as an optional implementation, as Figure 3 As shown, the determination of the above page index parameters includes:
[0036] S302, obtaining a page loading video, wherein the page loading video is a recorded video obtained by screen recording after the target website starts to load the target page;
[0037] S304, sampling the page loading video to obtain an image sequence, wherein the image sequence includes a group of images arranged in an orderly manner;
[0038] S306, sequentially calculating the image change rate between two adjacent images in the image sequence until a target image change rate is obtained, wherein the image change rate is used to indicate the difference between the page elements respectively contained in the two adjacent images, and the target image change rate is the image change rate that has reached a convergence condition;
[0039] S308, determining the first screen loading time of the target page based on the page loading times corresponding to the two adjacent target images, wherein the two adjacent target images are images used to obtain the target image change rate.
[0040] Optionally, in this embodiment, the above-mentioned method for determining the page index parameter may be applied, but not limited to, to the process of loading a page on a target website, wherein the target website may be used, but not limited to, to display web pages under different links. For example, the target website here may be a browser, and different search result pages may be displayed and loaded by inputting search keywords. This is an example, and this embodiment does not make any limitation to this.
[0041] Optionally, the page elements in the target page to be loaded in the embodiment of the present application may include, but are not limited to: one or any combination of text elements, image elements, and video elements. The above page elements may also be presented in the target page in different ways, such as being inserted into the target page in the form of a plug-in, floating at any position of the target page in the form of a floating window, displayed in the header of the target page in the form of a banner, displayed in the sidebars on both sides of the target page in the form of a couplet, etc. The above are examples, and this embodiment does not make any limitation to this.
[0042] In addition, in this embodiment, the first screen time to be determined is an important indicator of website user experience, which refers to the time required for the target area in the page of a target website to be filled. When the page is fully opened, the total loading time is much longer than the first screen time. When the target area in the page is filled, the user will be allowed to operate the displayed content.
[0043] Optionally, in this embodiment, two adjacent images in the above image sequence can be as follows: Figure 4 As shown in FIG. 1 , the image sequence includes a group of N images obtained after the page loading video is collected. According to their playback order, two adjacent images are divided into a group, such as image 1 and image 2 are divided into image group G1, image 2 and image 3 are divided into image group G2, and so on, until image N-1 and image N are divided into image group G1. (N-1) .
[0044] Further, in this embodiment, the image change rate between the two images in each image group may be determined, including but not limited to, by the following methods: comparing the page elements in the second image with the page elements in the first image; and determining the image change rate based on the comparison result. The comparison method here may include but is not limited to: 1) comparing the number of displayed page elements in the two images to obtain a quantity difference value; 2) comparing the area of the display area occupied by the displayed page elements in the two images to obtain an area difference value. The image change rate between the two images is calculated based on the above-mentioned quantity difference value or area difference value. The above-mentioned comparison methods are examples and are not limited to this in this embodiment.
[0045] Optionally, in this embodiment, after obtaining the image change rate between two adjacent images, the target image change rate can be determined, but not limited to, when multiple consecutive image change rates tend to be stable, and then the first screen loading time of the target page is determined based on the target image change rate. It should be noted that, as the page is loading, the elements in the page will experience a change from large changes to small changes, and finally tend to be stable. Therefore, in this embodiment, by comparing and analyzing the changes in page elements in the page, it is ensured that the first screen loading time is determined more accurately, without relying on the code, thereby reducing the difficulty of the determination operation.
[0046] Through the embodiments provided by the present application, after obtaining the page recording video, the page loading video is sampled to obtain an image sequence. Then, the image change rate between two adjacent images in the image sequence is obtained in turn, and the first screen loading time of the target page is determined based on the page loading time corresponding to each of the two adjacent target images. In other words, based on the change rate of the page elements displayed during the loading process of the target page in the target website, the first screen time corresponding to the target page is determined without relying on the intrusion code, which reduces the operational threshold for determining the first screen time, thereby achieving the effect of improving the parameter determination efficiency, thereby overcoming the problem of low determination efficiency in the method provided in the related art.
[0047] As an optional solution, sequentially calculating the image change rate between two adjacent images in the image sequence includes:
[0048] Sequentially obtain the adjacent first image and second image from the image sequence and perform the following operations:
[0049] S1, performing binarization processing on the first image and the second image respectively to obtain a first candidate image and a second candidate image;
[0050] S2, performing a closing operation on the first candidate image and the second candidate image to obtain a first target image and a second target image, wherein in the first target image, the page elements in the first image have been converted into regular graphic blocks, and in the second target image, the page elements in the second image have been converted into regular graphic blocks;
[0051] S3, comparing the first target image and the second target image to obtain an image change rate between the first image and the second image.
[0052] Optionally, the binarization process in this embodiment can be, but is not limited to, a method of image segmentation. It is to set the grayscale of pixels greater than a certain critical grayscale value as the grayscale maximum value, and the grayscale of pixels less than this value as the grayscale minimum value, thereby achieving binarization. For example, the black and white binarization process is to set the grayscale value of the pixel points on the image to 0 or 255, so that the entire image presents an obvious visual effect of only black and white.
[0053] Optionally, in this embodiment, the closing operation here refers to dilation and erosion processing of the binary candidate image in sequence, so as to fill the gaps or holes in the candidate image, connect adjacent objects, connect disconnected contours, and smooth the boundaries without changing the area.
[0054] Optionally, in this embodiment, performing a closing operation on the first candidate image and the second candidate image to obtain the first target image and the second target image includes:
[0055] 1) performing expansion processing on each page element in the first candidate image to obtain a plurality of first expanded image blocks; performing corrosion processing on each first expanded image block to obtain a plurality of first regular pattern blocks; determining the image containing the plurality of first regular pattern blocks as the first target image;
[0056] 2) Performing dilation processing on each page element in the second candidate image to obtain a plurality of second dilated image blocks; performing erosion processing on each second dilated image block to obtain a plurality of second regular graphic blocks; and determining the image containing the plurality of second regular graphic blocks as the second target image.
[0057] Specific combination Figure 5 The example shown is as follows: Assume that Figure 4 The i-th image group Gi is obtained from the image sequence as the current image group, and the first image and the second image are subjected to black-and-white binarization processing respectively to obtain the first candidate image and the second candidate image, as shown in FIG. Figure 5 The first candidate image has the title and publishing time loaded, while the second candidate image has the title, publishing time and page content loaded.
[0058] For each page element in the first candidate image (such as Figure 5 The title element and the publishing time element shown in (a) are closed, that is, the expansion process is first performed to obtain multiple first expansion blocks (such as Figure 5 As shown in (b), the gaps are filled and the disconnected parts are connected, and then the etching process is performed to obtain a plurality of first regular pattern blocks (such as Figure 5 Multiple rectangular solid blocks shown in (c)).
[0059] For each page element in the second candidate image (such as Figure 5 The title element, the publishing time element, and the text element shown in (d) are closed, that is, the expansion process is first performed to obtain multiple second expansion blocks (such as Figure 5 As shown in (e), the gaps are filled and the disconnected parts are connected, and then the etching process is performed to obtain a plurality of second regular pattern blocks (such as Figure 5 Multiple rectangular solid blocks as shown in (f)).
[0060] Then, a first target image including a plurality of first regular pattern blocks and a second target image including a plurality of second regular pattern blocks are compared to determine an image change rate between the two.
[0061] Through the embodiment provided by the present application, each image group in the image sequence is binarized in turn, and the obtained candidate images are closed to obtain regular graphic blocks corresponding to the page elements. Then, the regular graphic blocks in the above two images are compared to determine the image change rate, and then the page index parameters of the target page are accurately determined according to the image change rate.
[0062] As an optional solution, in the process of sequentially calculating the image change rate between two adjacent images in the image sequence, the following steps are also included:
[0063] Take each image change rate as the current image change rate and perform the following operations until the target image change rate is determined:
[0064] S1, compare the current image change rate with the target threshold;
[0065] S2, when the current image change rate is less than the target threshold, add one to the statistical result to obtain an updated statistical result, wherein the statistical result is used to indicate the number of image change rates less than the target threshold;
[0066] S3, when the updated statistical result is less than the convergence threshold, obtaining the next image change rate as the current image change rate;
[0067] S4, when the updated statistical result is equal to or greater than the convergence threshold, determining the current image change rate as the target image change rate.
[0068] Optionally, in this embodiment, after comparing the current image change rate with the target threshold, it can also include: when the current image change rate is greater than or equal to the target threshold, determining that the target page has not yet been loaded, no processing is performed, returning to the previous step, and continuing to obtain the next set of image change rates as the current image change rate.
[0069] Specific combination Figure 6 The example shown is used for illustration, assuming that the convergence threshold is set to M. The specific comparison process can be as follows:
[0070] After obtaining the current image change rate, compare the current image change rate with the target threshold. If the current image change rate is greater than or equal to the target threshold, obtain the next set of image change rates as the current image change rate. If the current image change rate is less than the target threshold, add one to the statistical result to obtain an updated statistical result.
[0071] When the updated statistical result is less than the convergence threshold M, the next image change rate is obtained as the current image change rate; when the updated statistical result is equal to or greater than the convergence threshold M, the current image change rate is determined as the target image change rate. Figure 6 As shown, it is determined that the current image change rate is less than the target threshold from the i-th group, then from G i When the change rate of M consecutive images is less than the target threshold, it is determined that the convergence condition is met, and the change rate of the Mth image (such as Figure 6 As shown in G i+(M-1) The image change rate corresponding to the group) is determined as the target image change rate.
[0072] Through the embodiments provided by the present application, each image change rate is compared and screened with the target threshold, and the number of image pairs whose image change rate is less than the target threshold is counted. When the statistical result indicates that the convergence threshold has been reached, it is determined that the convergence condition has been reached, so as to accurately determine the target image change rate used to determine the page index parameter, thereby ensuring the accuracy of the determination result of the page index parameter.
[0073] As an optional solution, the page loading video is sampled to obtain an image sequence including:
[0074] S1, taking screenshots of the page loading video at target intervals to obtain multiple images;
[0075] S2, sorting the multiple images according to the playback order to obtain an image sequence.
[0076] Optionally, in this embodiment, the target interval may be, but is not limited to, set to 200 ms. The interval configuration here is an optional example and is not limited in this embodiment.
[0077] For example, suppose a page loading video with a duration of 5 seconds is obtained, and then screenshots of the page loading video are taken at intervals of 200 ms to obtain 25 images. Then, the above 25 images are saved in sequence according to the playback order to obtain the above image sequence.
[0078] It should be noted that in this embodiment, when taking screenshots of the page loading video, the front-end application interface (Application Interface, API for short) and the function navigator.mediaDevices.getDisplayMedia() may not be used, but other screenshot software may be used, so that the operation can be performed without knowing the front-end technology at all.
[0079] Through the embodiments provided in the present application, by taking screenshots of the page loading video, an image sequence for image comparison is obtained, thereby ensuring the accuracy and efficiency of the page index parameter determination results.
[0080] As an optional solution, getting the page loading video includes:
[0081] S1, screen recording the target website that starts loading the target page;
[0082] S2, determining the recorded video within N seconds before recording as the page loading video, where N is a natural number greater than or equal to 1.
[0083] Optionally, in this embodiment, the above N can be, but is not limited to, set to a value greater than or equal to 1 and less than or equal to 5. The above recording can be, but is not limited to, starting from the moment the target page is loaded. The configuration of the recording duration here is an optional example, and this embodiment does not impose any limitation on this.
[0084] Optionally, in this embodiment, the screen of the target website (such as a browser) may be recorded by using, but not limited to, the following function: navigator.mediaDevices.getDisplayMedia().
[0085] It should be noted that in this embodiment, when performing screen recording processing on the page loading video, the front-end application interface (Application Interface, API for short) and the function navigator.mediaDevices.getDisplayMedia() may not be used, but other recording software may be used, so that the operation can be performed without knowing the front-end technology at all.
[0086] As an optional solution, screen recording the target website starting to load the target page includes one of the following:
[0087] 1) Calling a front-end application interface configured in a terminal device to perform screen recording of a target website, wherein the terminal device is a device that runs the target website and loads the target page; or
[0088] 2) Screen recording of the target website is performed through a third-party screen recording application client installed in the terminal device, where the terminal device is a device that runs the target website and loads the target page.
[0089] Optionally, in this embodiment, based on the loading time point corresponding to the target image change rate, determining the first screen time of loading the target page of the target website may include but is not limited to:
[0090] 1) Subtracting the loading time point of the second image in the target image group from the starting loading time point of the target page, and determining the difference obtained by the operation as the first screen time;
[0091] 2) Subtract the middle value of the loading time points of the first image and the second image in the target image group from the start loading time point of the target page, and determine the difference obtained by the calculation as the first screen time.
[0092] Through the embodiments provided in this application, obtaining the page indicator parameter first screen time of the target page from a non-pure front-end perspective will be more conducive to developers' understanding and operation, and the operation difficulty is briefly described, thereby achieving the purpose of improving determination efficiency.
[0093] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should know that the present invention is not limited by the described action sequence, because according to the present invention, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.
[0094] Figure 7 FIG. 1 is a schematic diagram of a structure of a device for determining a page index parameter according to an exemplary embodiment. Figure 7 As shown, the device:
[0095] The first acquisition unit 702 is configured to acquire a page loading video, wherein the page loading video is a recorded video obtained by screen recording after the target website starts to load the target page;
[0096] The sampling unit 704 is configured to sample the page loading video to obtain an image sequence, wherein the image sequence includes a group of orderly arranged images;
[0097] The second acquisition unit 706 is configured to sequentially calculate the image change rate between two adjacent images in the image sequence until a target image change rate is acquired, wherein the image change rate is used to indicate the difference between the page elements respectively included in the two adjacent images, and the target image change rate is the image change rate that has reached a convergence condition;
[0098] The determination unit 708 is configured to determine the first screen loading time of the target page based on the page loading time corresponding to two adjacent target images, wherein the two adjacent target images are images used to obtain the target image change rate.
[0099] As an optional solution, the second acquisition unit includes:
[0100] The processing module is configured to sequentially obtain adjacent first and second images from the image sequence and perform the following operations:
[0101] Binarizing the first image and the second image to obtain a first candidate image and a second candidate image;
[0102] Performing a closing operation on the first candidate image and the second candidate image to obtain a first target image and a second target image, wherein in the first target image, the page elements in the first image have been converted into regular graphic blocks, and in the second target image, the page elements in the second image have been converted into regular graphic blocks;
[0103] The first target image and the second target image are compared to obtain an image change rate between the first image and the second image.
[0104] As an optional solution, the processing module performs a closing operation on the first candidate image and the second candidate image through the following steps to obtain the first target image and the second target image:
[0105] Performing dilation processing on each page element in the first candidate image to obtain a plurality of first dilated image blocks; performing erosion processing on each first dilated image block to obtain a plurality of first regular graphic blocks; determining the image containing the plurality of first regular graphic blocks as the first target image;
[0106] Each page element in the second candidate image is expanded to obtain a plurality of second expanded image blocks; each second expanded image block is eroded to obtain a plurality of second regular graphic blocks; and an image containing the plurality of second regular graphic blocks is determined as a second target image.
[0107] As an optional solution, it also includes:
[0108] The processing unit is configured to perform the following operations by taking each image change rate as the current image change rate in turn in the process of sequentially calculating the image change rate between two adjacent images in the image sequence until a target image change rate is determined:
[0109] Compare the current image change rate with the target threshold;
[0110] When the current image change rate is less than the target threshold, the statistical result is incremented by one to obtain an updated statistical result, wherein the statistical result is used to indicate the number of image change rates less than the target threshold;
[0111] When the updated statistical result is less than the convergence threshold, the next image change rate is obtained as the current image change rate;
[0112] When the updated statistical result is equal to or greater than the convergence threshold, the current image change rate is determined as the target image change rate.
[0113] As an optional solution, the sampling unit includes:
[0114] A screenshot module is configured to process the page loading video screenshots at target intervals to obtain multiple images;
[0115] The sorting module is configured to sort the multiple images according to the playback order to obtain an image sequence.
[0116] As an optional solution, the first acquisition unit includes:
[0117] A recording module, which is set to screen record the target website that starts loading the target page;
[0118] The first determination module is configured to determine the recorded video within N seconds before recording as the page loading video, where N is a natural number greater than or equal to 1.
[0119] As an optional solution, the recording module includes one of the following:
[0120] A first recording submodule is configured to call a front-end application interface configured in a terminal device to perform screen recording of a target website, wherein the terminal device is a device that runs the target website and loads a target page; or
[0121] The second recording submodule is configured to perform screen recording of the target website through a third-party screen recording application client installed in a terminal device, wherein the terminal device is a device that runs the target website and loads the target page.
[0122] It should be noted that, in this embodiment, the embodiments of the above-mentioned device can refer to the above-mentioned method embodiments, and no limitation is made here.
[0123] In an exemplary embodiment, a computer-readable storage medium including instructions is also provided, such as a memory including instructions, and the above instructions can be executed by a processor in an electronic device to complete the above-mentioned method for determining page indicator parameters. Optionally, the storage medium can be a non-temporary computer-readable storage medium, for example, the non-temporary computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0124] In an exemplary embodiment, an electronic device is also provided, including a processor and a memory for storing executable instructions of the above-mentioned processor, wherein a computer program is stored in the memory, and the executable instructions executed by the processor can be but are not limited to being set to execute the steps in any of the above-mentioned method embodiments through a computer program.
[0125] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0126] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A method for determining page index parameters, characterized in that: include: Obtaining a page loading video, wherein the page loading video is a recorded video obtained by screen recording after the target website starts to load the target page; Sampling the page loading video to obtain an image sequence, wherein the image sequence includes a group of images arranged in an orderly manner; The image change rate between two adjacent images in the image sequence is calculated in sequence until the target image change rate is obtained, including: obtaining the adjacent first image and second image from the image sequence in sequence, and performing the following operations: performing black-and-white binarization processing on the first image and the second image respectively to obtain a first candidate image and a second candidate image; performing a closing operation on the first candidate image and the second candidate image to obtain a first target image and a second target image, wherein in the first target image, the page elements in the first image have been converted into regular graphic blocks, and in the second target image, the page elements in the second image have been converted into regular graphic blocks; comparing the first target image and the second target image to obtain the image change rate of the first image and the second image, the image change rate is used to indicate the difference between the page elements contained in each of the two adjacent images, and the target image change rate is the image change rate that has reached the convergence condition; Based on the page loading times corresponding to two adjacent target images, the first screen loading time of the target page is determined, wherein the two adjacent target images are images used to obtain the change rate of the target image.
2. The method according to claim 1, characterized in that Performing a closing operation on the first candidate image and the second candidate image to obtain a first target image and a second target image includes: Performing expansion processing on each page element in the first candidate image to obtain a plurality of first expanded image blocks; performing erosion processing on each of the first expanded image blocks to obtain a plurality of first regular graphic blocks; determining an image containing the plurality of the first regular graphic blocks as the first target image; Each page element in the second candidate image is expanded to obtain a plurality of second expanded blocks; each second expanded block is eroded to obtain a plurality of second regular graphic blocks; and an image containing a plurality of second regular graphic blocks is determined as the second target image.
3. The method according to claim 1, characterized in that The process of sequentially calculating the image change rate between two adjacent images in the image sequence also includes: The following operations are performed by taking each of the image change rates as the current image change rate in turn: Comparing the current image change rate with a target threshold; In the case where the current image change rate is less than the target threshold, adding one to the statistical result to obtain the updated statistical result, wherein the statistical result is used to indicate the number of images whose change rate is less than the target threshold; When the updated statistical result is less than the convergence threshold, obtaining the next image change rate as the current image change rate; When the updated statistical result is equal to or greater than the convergence threshold, the current image change rate is determined as the target image change rate.
4. The method according to claim 1, characterized in that: The sampling of the page loading video to obtain an image sequence comprises: Taking screenshots of the page loading video at target intervals to obtain multiple images; The multiple images are sorted according to a playback order to obtain the image sequence.
5. The method according to claim 1, characterized in that The obtaining of the page loading video comprises: Performing screen recording on the target website that starts loading the target page; The recorded video within N seconds before recording is determined as the page loading video, where N is a natural number greater than or equal to 1.
6. The method according to claim 5, characterized in that The screen recording of the target website that starts loading the target page includes one of the following: Calling a front-end application interface configured in a terminal device to perform screen recording of the target website, wherein the terminal device is a device that runs the target website and loads the target page; or The target website is screen recorded by a third-party screen recording application client installed in a terminal device, wherein the terminal device is a device that runs the target website and loads the target page.
7. A device for determining page index parameters, characterized in that: include: A first acquisition unit is configured to acquire a page loading video, wherein the page loading video is a recorded video obtained by screen recording after the target website starts to load the target page; a sampling unit, configured to sample the page loading video to obtain an image sequence, wherein the image sequence includes a group of images arranged in an orderly manner; The second acquisition unit is configured to sequentially calculate the image change rate between two adjacent images in the image sequence until the target image change rate is acquired, comprising: a processing module, configured to sequentially acquire adjacent first and second images from the image sequence, and perform the following operations: binarize the first and second images respectively to obtain a first candidate image and a second candidate image; perform a closing operation on the first candidate image and the second candidate image to obtain a first target image and a second target image, wherein in the first target image, the page elements in the first image have been converted into regular graphic blocks, and in the second target image, the page elements in the second image have been converted into regular graphic blocks; compare the first target image and the second target image to obtain the image change rate of the first image and the second image, wherein the image change rate is used to indicate the difference between the page elements contained in each of the two adjacent images, and the target image change rate is the image change rate that has reached the convergence condition; The determination unit is configured to determine the first screen loading time of the target page based on the page loading time corresponding to two adjacent target images, wherein the two adjacent target images are images used to obtain the change rate of the target image.
8. The device according to claim 7, characterized in that The processing module performs a closing operation on the first candidate image and the second candidate image to obtain a first target image and a second target image by the following steps: Performing expansion processing on each page element in the first candidate image to obtain a plurality of first expanded image blocks; performing erosion processing on each of the first expanded image blocks to obtain a plurality of first regular graphic blocks; determining an image containing the plurality of the first regular graphic blocks as the first target image; Each page element in the second candidate image is expanded to obtain a plurality of second expanded blocks; each second expanded block is eroded to obtain a plurality of second regular graphic blocks; and an image containing a plurality of second regular graphic blocks is determined as the second target image.
9. The device according to claim 7, characterized in that Also includes: The processing unit is configured to perform the following operations by taking each of the image change rates as the current image change rate in turn in the process of sequentially calculating the image change rate between two adjacent images in the image sequence until the target image change rate is determined: Comparing the current image change rate with a target threshold; In the case where the current image change rate is less than the target threshold, adding one to the statistical result to obtain the updated statistical result, wherein the statistical result is used to indicate the number of images whose change rate is less than the target threshold; When the updated statistical result is less than the convergence threshold, obtaining the next image change rate as the current image change rate; When the updated statistical result is equal to or greater than the convergence threshold, the current image change rate is determined as the target image change rate.
10. The device according to claim 7, characterized in that The sampling unit comprises: A screenshot module is configured to take screenshots of the page loading video at target intervals to obtain multiple images; The sorting module is configured to sort the multiple images according to a playback order to obtain the image sequence.
11. The device according to claim 7, characterized in that The first acquiring unit includes: A recording module, configured to perform screen recording of the target website that starts loading the target page; The first determination module is configured to determine the recorded video within N seconds before recording as the page loading video, wherein N is a natural number greater than or equal to 1.
12. The device according to claim 11, characterized in that The recording module includes one of the following: A first recording submodule is configured to call a front-end application interface configured in a terminal device to perform screen recording on the target website, wherein the terminal device is a device that runs the target website and loads the target page; or The second recording submodule is configured to perform screen recording of the target website through a third-party screen recording application client installed in a terminal device, wherein the terminal device is a device that runs the target website and loads the target page.
13. A computer-readable storage medium, characterized in that: When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the method for determining page indicator parameters as described in any one of claims 1 to 6.
14. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the method for determining the page indicator parameters as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Method and device for determining page loading duration, equipment and storage medium
CN111752817A
Time-consuming acquisition method, apparatus and device, and computer readable storage medium
CN112203150A
Video presentation method and device, computing equipment and storage medium
CN112752110A