CN117370694A - Method and device for determining reduction degree of skeleton screen and electronic equipment - Google Patents

Method and device for determining reduction degree of skeleton screen and electronic equipment Download PDF

Info

Publication number
CN117370694A
CN117370694A CN202311425933.0A CN202311425933A CN117370694A CN 117370694 A CN117370694 A CN 117370694A CN 202311425933 A CN202311425933 A CN 202311425933A CN 117370694 A CN117370694 A CN 117370694A
Authority
CN
China
Prior art keywords
target
picture
page
determining
reduction degree
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311425933.0A
Other languages
Chinese (zh)
Inventor
李贺
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tianyi Electronic Commerce Co Ltd
Original Assignee
Tianyi Electronic Commerce Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Tianyi Electronic Commerce Co Ltd filed Critical Tianyi Electronic Commerce Co Ltd
Priority to CN202311425933.0A priority Critical patent/CN117370694A/en
Publication of CN117370694A publication Critical patent/CN117370694A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/74Image or video pattern matching; Proximity measures in feature spaces
    • G06V10/761Proximity, similarity or dissimilarity measures

Abstract

The application discloses a method and device for determining reduction degree of a skeleton screen and electronic equipment. Wherein the method comprises the following steps: generating a first picture according to a first target element, wherein the first target element is a tag element or a node element in a skeleton screen, the first picture is used for representing page content corresponding to the first target element, a response operation corresponding to a page request of a target user is executed, the response operation is used for displaying resource information corresponding to the page request at a browser end, a second picture is generated according to a second target element, the second target element is a tag element or a node element in a real webpage, the second picture is used for representing page content corresponding to the second target element, a target reduction degree is determined according to the first picture and the second picture, and the target reduction degree is used for representing similarity between the page content in the skeleton screen and the page content in the real webpage. The method and the device solve the technical problem of low efficiency in determining the restoration degree of the skeleton screen to the real webpage.

Description

Method and device for determining reduction degree of skeleton screen and electronic equipment
Technical Field
The application relates to the technical field of computers, the technical field of front ends and other related technical fields, in particular to a method and a device for determining the reduction degree of a skeleton screen and electronic equipment.
Background
In the front-end technical field, in the process of loading a front-end page, a skeleton screen needs to be set as a transition page, so that anxiety of a user is reduced, and user experience is improved. If the difference between the skeleton screen and the real webpage after the user request is completed is too large, that is, if the degree of restoration of the skeleton screen to the real webpage after the user request is completed is low, the problem of generating an incorrect transition page may be caused, so that the user operation is affected. In the prior art, in the process of generating a skeleton screen, the calculation of the restoration degree of the skeleton screen is usually ignored, and a standardized flow is lacking in the process of evaluating the restoration degree of the skeleton screen to a real webpage, so that the problem of low efficiency of determining the restoration degree of the skeleton screen to the real webpage is caused.
In view of the above problems, no effective solution has been proposed at present.
Disclosure of Invention
The application provides a method and a device for determining the reduction degree of a skeleton screen and electronic equipment, and aims to at least solve the technical problem that the efficiency of determining the reduction degree of the skeleton screen to a real webpage in the prior art is low.
According to one aspect of the application, a method for determining the reduction degree of a skeleton screen is provided, which comprises the following steps: generating a first picture according to a first target element, wherein the first target element is a tag element or a node element in a skeleton screen, the skeleton screen is used for representing a temporary loading page before a page request of a target user is completed, and the first picture is used for representing page content corresponding to the first target element; executing response operation corresponding to the page request of the target user, wherein the response operation is used for displaying resource information corresponding to the page request at the browser end; generating a second picture according to a second target element, wherein the second target element is a tag element or a node element in a real webpage, the real webpage is used for representing a loaded page after a page request of a target user is completed, and the second picture is used for representing page content corresponding to the second target element; and determining a target reduction degree according to the first picture and the second picture, wherein the target reduction degree is used for representing the similarity between the page content in the skeleton screen and the page content in the real webpage.
Optionally, an interception operation is executed according to a first policy or a second policy, where the first policy is used to characterize that the server intercepts the page request of the target user, the second policy is used to intercept the page request of the target user at the browser, and the interception operation is used to prohibit execution of a response operation corresponding to the page request of the target user; and determining the temporary loading page after the interception operation is completed as a skeleton screen.
Optionally, determining a first target element according to a page selector, wherein the page selector is used for screening N elements included in a page according to a page request, N is a positive integer, and the page is a page corresponding to a skeleton screen or a page corresponding to a real webpage; determining a first object according to a first target element, wherein the first object is used for representing an interface corresponding to a page operation method, and the page operation method is used for carrying out animation effect rendering or interactive operation on a page; and executing a page operation method corresponding to the first object based on the first target element to obtain a first picture.
Optionally, preprocessing the first picture and the second picture respectively to obtain a first target picture and a second target picture, wherein the preprocessing is used for enhancing the contrast of pixel points included in the first picture and the second picture; and determining the target reduction degree according to the first target picture and the second target picture.
Optionally, extracting features of the first target picture to obtain M first feature vectors corresponding to the first target picture, wherein M is a positive integer, and the first feature vectors are used for representing feature information of pixel points in the first target picture; extracting features of a second target picture to obtain M second feature vectors corresponding to the second target picture, wherein the second feature vectors are used for representing feature information of pixel points in the second target picture; determining M vector corresponding relations between the first target picture and the second target picture according to the position information of each pixel point in the first target picture and the second target picture, wherein each vector corresponding relation in the M vector corresponding relations is used for representing a one-to-one corresponding relation between a first feature vector and a second feature vector; and determining the target reduction degree according to the corresponding relation of the M vectors.
Optionally, determining P first vector correspondences in the M vector correspondences, where P is a positive integer smaller than M, and page content corresponding to a first feature vector corresponding to the first vector correspondences is allowed to be updated by the page request; q second vector corresponding relations in the M vector corresponding relations are determined, wherein Q is equal to the difference between M and P, Q is a positive integer, and page contents corresponding to the first feature vectors corresponding to the second vector corresponding relations are forbidden to be updated by page requests; and determining the target reduction degree according to the P first vector corresponding relations and the Q second vector corresponding relations.
Optionally, determining a first sub-similarity corresponding to each first vector corresponding relation in the P first vector corresponding relations, where the first sub-similarity corresponding to each first vector corresponding relation is used to represent a euclidean distance between a first feature vector and a second feature vector corresponding to the first vector corresponding relation; determining a second sub-similarity corresponding to each second vector corresponding relation in the Q second vector corresponding relations, wherein the second sub-similarity corresponding to each second vector corresponding relation is used for representing cosine similarity between the first feature vector and the second feature vector corresponding to the second vector corresponding relation; and carrying out weighted summation operation on the first sub-similarity corresponding to each first vector corresponding relation and the second sub-similarity corresponding to each second vector corresponding relation to obtain the target reduction degree.
Optionally, under the condition that the target reduction degree is smaller than a preset reduction degree threshold value, generating first early warning information, wherein the first early warning information at least comprises R abnormal sub-similarities, R is a positive integer smaller than or equal to M, and the abnormal sub-similarities are used for representing a first sub-similarity smaller than the preset reduction degree sub-threshold value and a second sub-similarity smaller than the preset reduction degree sub-threshold value; and generating a target comparison picture according to the first picture and the second picture under the condition that the target reduction degree is larger than or equal to a preset reduction degree threshold value, wherein the target comparison picture is used for representing difference information between the first picture and the second picture.
According to another aspect of the application, there is also provided a device for determining the reduction degree of a skeleton screen, where the device includes: the first generation unit is used for generating a first picture according to a first target element, wherein the first target element is a tag element or a node element in a skeleton screen, the skeleton screen is used for representing a temporary loading page before a page request of a target user is completed, and the first picture is used for representing page content corresponding to the first target element; the execution unit is used for executing response operation corresponding to the page request of the target user, wherein the response operation is used for displaying resource information corresponding to the page request at the browser end; the second generation unit is used for generating a second picture according to a second target element, wherein the second target element is a tag element or a node element in a real webpage, the real webpage is used for representing a loaded page after a page request of a target user is completed, and the second picture is used for representing page content corresponding to the second target element; the first determining unit is used for determining a target reduction degree according to the first picture and the second picture, wherein the target reduction degree is used for representing similarity between page content in the skeleton screen and page content in the real webpage.
According to another aspect of the present application, there is also provided an electronic device, where the electronic device includes one or more processors and a memory, and the memory is configured to store one or more programs, where the one or more programs, when executed by the one or more processors, cause the one or more processors to implement a method for determining a reduction degree of a skeleton screen in any one of the foregoing.
In the method, first, a first picture is generated according to a first target element, wherein the first target element is a tag element or a node element in a skeleton screen, the skeleton screen is used for representing a temporary loading page before a page request of a target user is completed, the first picture is used for representing page content corresponding to the first target element, then response operation corresponding to the page request of the target user is executed, the response operation is used for displaying resource information corresponding to the page request at a browser end, then a second picture is generated according to a second target element, the second target element is a tag element or a node element in a real webpage, the real webpage is used for representing a loading page after the page request of the target user is completed, the second picture is used for representing page content corresponding to the second target element, and finally target reduction degree is determined according to the first picture and the second picture, wherein the target reduction degree is used for representing similarity between the page content in the skeleton screen and the page content in the real webpage.
As can be seen from the above, the present application compares the first picture corresponding to the skeleton screen with the second picture corresponding to the real web page after the user request is completed, and then determines the restoration degree of the skeleton screen to the real web page according to the similarity between the first picture and the second picture, thereby providing a normalized and standardized procedure for determining the restoration degree of the skeleton screen to the real web page, and further improving the efficiency of determining the restoration degree of the skeleton screen to the real web page.
Therefore, the technical scheme of the application obtains the reduction degree of the skeleton screen to the real webpage by determining the similarity between the first picture corresponding to the skeleton screen and the second picture corresponding to the real webpage, fills up the blank of determining the reduction degree of the skeleton screen to the real webpage after the user request is completed, and further solves the technical problem that the efficiency of determining the reduction degree of the skeleton screen to the real webpage is low in the prior art.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiments of the application and together with the description serve to explain the application and do not constitute an undue limitation to the application. In the drawings:
FIG. 1 is a flow chart of an alternative method of determining the degree of restoration of a skeletal screen in accordance with an embodiment of the present application;
FIG. 2 is a flowchart of an alternative method for determining a target reduction degree according to M vector correspondences according to an embodiment of the present application;
FIG. 3 is a schematic diagram of an alternative apparatus for determining the degree of reduction of a skeletal screen in accordance with an embodiment of the present application;
fig. 4 is a schematic diagram of an alternative electronic device according to an embodiment of the present application.
Detailed Description
In order to make the present application solution better understood by those skilled in the art, the following description will be made in detail and with reference to the accompanying drawings in the embodiments of the present application, it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, shall fall within the scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of the present application and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that embodiments of the present application described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It should be further noted that, the related information (including the resource information corresponding to the page request and the feature information corresponding to the pixel point in the picture) and the data (including, but not limited to, the data for displaying and the data for analyzing) related to the present application are both information and data authorized by the user or fully authorized by each party. For example, an interface is provided between the system and the relevant user or institution, before acquiring the relevant information, the system needs to send an acquisition request to the user or institution through the interface, and acquire the relevant information after receiving the consent information fed back by the user or institution.
The present application is further illustrated below in conjunction with various embodiments.
Example 1
According to the embodiments of the present application, there is provided an embodiment of a method for determining the degree of restoration of a skeleton screen, it should be noted that the steps illustrated in the flowchart of the drawings may be performed in a computer system such as a set of computer executable instructions, and that although a logical order is illustrated in the flowchart, in some cases, the steps illustrated or described may be performed in an order different from that herein.
The application provides a system for determining the reduction degree of a skeleton screen (simply referred to as a determining system) for executing a method for determining the reduction degree of the skeleton screen in the application, and fig. 1 is a flowchart of an alternative method for determining the reduction degree of the skeleton screen according to an embodiment of the application, as shown in fig. 1, where the method includes the following steps:
Step S101, a first picture is generated according to a first target element.
In step S101, the first target element is a tag element or a node element in a skeleton screen, the skeleton screen is used for representing a temporary loading page before completing a page request of a target user, and the first picture is used for representing page content corresponding to the first target element.
Optionally, the skeleton screen is generally used for a user to preview the page content to be presented, and fills the blank area of the page temporarily before loading the page content corresponding to the real web page is completed, before generating the first picture according to the first target element, the determining system may generate Cheng Gujia screen by writing HTML code and CSS code according to the design structure and front end frame of the web page, and simulate the loading process of the web page through the placeholder element or animation effect.
Step S102, executing response operation corresponding to the page request of the target user.
In step S102, the response operation is used to display the resource information corresponding to the page request at the browser end.
Optionally, after receiving a page request corresponding to a target user, the response operation includes parsing parameters and header information in the page request to obtain a request type corresponding to the page request, calling a corresponding API according to the request type and specific request content of the page request, and displaying resource information returned by calling the API on a browser side.
Step S103, generating a second picture according to the second target element.
In step S103, the second target element is a tag element or a node element in the real web page, the real web page is used for representing the loaded page after the page request of the target user is completed, and the second picture is used for representing the page content corresponding to the second target element.
Optionally, after the browser displays the real webpage, the determining system first obtains a second target element in the real webpage, and converts the second target element into a Canvas object, where the Canvas is an HTML5 element and is used to draw a graph or display other visual contents on the webpage, the Canvas object provides a set of APIs, through the Canvas object, a user may draw various graphs such as a line, a rectangle, or a circle, or may perform image processing and implement an animation effect, and then the determining system converts the Canvas object corresponding to the second target element into a comparable picture format, so as to obtain a second picture.
Step S104, determining the target reduction degree according to the first picture and the second picture.
In step S104, the target restoration degree is used to characterize the similarity between the page content in the skeleton screen and the page content in the real web page.
Optionally, the determining system may further determine a difference percentage according to the first picture and the second picture, where a calculation formula corresponding to the difference percentage is shown in the following formula (1), where result represents the difference percentage between the first picture and the second picture, and similarity represents the similarity between the first picture and the second picture.
As can be seen from the above, the present application compares the first picture corresponding to the skeleton screen with the second picture corresponding to the real web page after the user request is completed, and then determines the restoration degree of the skeleton screen to the real web page according to the similarity between the first picture and the second picture, thereby providing a normalized and standardized procedure for determining the restoration degree of the skeleton screen to the real web page, and further improving the efficiency of determining the restoration degree of the skeleton screen to the real web page.
Therefore, the technical scheme of the application obtains the reduction degree of the skeleton screen to the real webpage by determining the similarity between the first picture corresponding to the skeleton screen and the second picture corresponding to the real webpage, fills up the blank of determining the reduction degree of the skeleton screen to the real webpage after the user request is completed, and further solves the technical problem that the efficiency of determining the reduction degree of the skeleton screen to the real webpage is low in the prior art.
In an optional embodiment, the determining system may perform an intercepting operation according to a first policy or a second policy, where the first policy is used to characterize that a page request of the target user is intercepted at the server side, the second policy is used to intercept the page request of the target user at the browser side, the intercepting operation is used to prohibit execution of a response operation corresponding to the page request of the target user, and then the temporary loading page after the intercepting operation is completed is determined as the skeleton screen.
Optionally, the determining system may further perform an intercepting operation according to a third policy, where the third policy is used to characterize that, in the front-end page, the target user's page request is monitored through JavaScript code, and the page request is intercepted before the page request is sent to the browser.
In an optional embodiment, the determining system determines a first target element according to a page selector, where the page selector is configured to screen N elements included in a page according to a page request, N is a positive integer, the page is a page corresponding to a skeleton screen or a page corresponding to a real webpage, and then determines a first object according to the first target element, where the first object is used to represent an interface corresponding to a page operation method, the page operation method is used to perform animation effect rendering or interactive operation on the page, and then execute the page operation method corresponding to the first object based on the first target element to obtain a first picture.
Optionally, the determining system determines a second target element in the real webpage according to the page selector, and then determines a second object corresponding to the second target element according to the second target element, where the second object is used to represent an interface corresponding to the second target element and performing animation effect rendering or interactive operation on the real webpage, and a page operation method corresponding to the second object is executed based on the second target element to obtain a second picture.
Alternatively, the target element may be a tag in an HTML document, for example: div, p, or a, may also be a node in the DOM tree, for example: the page selector may select the target element according to the tag name, class name, ID, attribute, and other conditions of the element in the page. Page selectors include, but are not limited to, tag selectors, class selectors, ID selectors, attribute selectors, and the like. The determining system can quickly position the target element through the page selector, and perform operations such as style setting, event binding and the like on the target element.
In an alternative embodiment, the determining system performs a preprocessing operation on the first picture and the second picture, to obtain a first target picture and a second target picture, where the preprocessing operation is used to enhance a contrast ratio of a pixel point included in the first picture and the second picture, and then determines a target reduction degree according to the first target picture and the second target picture.
Optionally, the preprocessing operation includes, in addition to the image enhancement operation, a conversion operation for converting pixels in the first and second pictures from one color attribute to another color attribute, such as: the method comprises the steps of converting an RGB image into a gray image, performing size adjustment operation on the first picture and the second picture to scale or cut, and performing filtering operation on the first picture and the second picture to smooth according to a mean filter, a Gaussian filter or a median filter.
In an alternative embodiment, fig. 2 is a flowchart of an alternative method for determining a target reduction degree according to M vector correspondences according to an embodiment of the present application, as shown in fig. 2, where the method includes the following steps:
step S201, extracting features of the first target picture to obtain M first feature vectors corresponding to the first target picture.
In step S201, M is a positive integer, and the first feature vector is used to characterize feature information of a pixel point in the first target picture.
Step S202, extracting features of the second target picture to obtain M second feature vectors corresponding to the second target picture.
In step S202, the second feature vector is used to characterize feature information of the pixel point in the second target picture.
Step S203, determining M vector correspondences between the first target picture and the second target picture according to the position information of each pixel point in the first target picture and the second target picture.
In step S203, each of the M vector correspondences is used to characterize a one-to-one correspondence between one first feature vector and one second feature vector.
Step S204, determining the target reduction degree according to the corresponding relation of the M vectors.
Optionally, the determining system determines the sub-similarity corresponding to each of the M vector correspondences first, and then determines the target reduction degree according to the sub-similarity corresponding to each of the M vector correspondences.
Optionally, the determining system divides the first target picture into M first target sub-pictures, and then generates a first feature vector corresponding to each first target sub-picture according to W pixel points included in each first target sub-picture, wherein W is a positive integer; dividing the second target picture into M second target sub-pictures, and generating a second feature vector corresponding to each second target sub-picture according to W pixel points included in each second target sub-picture.
In an alternative embodiment, the determining system determines P first vector correspondences among the M vector correspondences first, where P is a positive integer smaller than M, the page content corresponding to the first feature vector corresponding to the first vector correspondences is allowed to be updated by the page request, then determines Q second vector correspondences among the M vector correspondences, where Q is equal to a difference between M and P, Q is a positive integer, the page content corresponding to the first feature vector corresponding to the second vector correspondences is forbidden to be updated by the page request, and then determines the target reduction degree according to the P first vector correspondences and the Q second vector correspondences.
For example, assuming that the first target picture includes a first target sub-picture 1 and a first target sub-picture 2, the page content in the first target sub-picture 1 in the skeleton screen is "name", the page content in the first target sub-picture 2 is "XXX", after the request resource corresponding to the page request of the target user is returned, the page content in the second target sub-picture 1 in the same position as the first target sub-picture 1 in the real web page is still "name", and the page content in the second target sub-picture 2 in the same position as the first target sub-picture 2 is updated to be the real name "li some" corresponding to the target user, so that the vector correspondence between the first feature vector corresponding to the first target sub-picture 1 and the second feature vector corresponding to the second target sub-picture 1 is the second vector correspondence, and the vector correspondence between the first feature vector corresponding to the first target sub-picture 2 and the second feature vector corresponding to the second target sub-picture 2 is the first vector correspondence.
In an alternative embodiment, the determining system first determines a first sub-similarity corresponding to each first vector correspondence in the P first vector correspondences, where the first sub-similarity corresponding to each first vector correspondence is used to characterize a euclidean distance between a first feature vector and a second feature vector corresponding to the first vector correspondence, and then determines a second sub-similarity corresponding to each second vector correspondence in the Q second vector correspondences, the second sub-similarity corresponding to each second vector corresponding relation is used for representing cosine similarity between the first feature vector and the second feature vector corresponding to the second vector corresponding relation, and then weighted summation operation is carried out on the first sub-similarity corresponding to each first vector corresponding relation and the second sub-similarity corresponding to each second vector corresponding relation to obtain target reduction degree.
Optionally, it is assumed that a first feature vector corresponding to a certain first vector correspondence is a (a 1 ,a 2 ,…,a n ) The corresponding second feature vector is B (B 1 ,b 2 ,…,b n ) The calculation method of the first sub-similarity corresponding to the first vector correspondence is shown in the following formula (2):
optionally, assuming that a first feature vector corresponding to a certain second vector is C and a corresponding second feature vector is D, a calculation method of the second sub-similarity corresponding to the second vector corresponding to the certain second vector is as shown in the following formula (3):
In the formula (3), c·d represents a dot product of two vectors, C represents a norm of the vector C, and D represents a norm of the vector D.
In an optional embodiment, the determining system generates first early warning information when the target reduction degree is smaller than a preset reduction degree threshold, where the first early warning information includes at least R abnormal sub-similarities, R is a positive integer smaller than or equal to M, the abnormal sub-similarities are used to represent a first sub-similarity smaller than the preset reduction degree sub-threshold and a second sub-similarity smaller than the preset reduction degree sub-threshold, and then generates a target comparison picture according to the first picture and the second picture when the target reduction degree is greater than or equal to the preset reduction degree threshold, where the target comparison picture is used to represent difference information between the first picture and the second picture.
Alternatively, the determining system may compare the first target picture with the second target picture through a resembble. Js library, where the resembble. Js library is a JavaScript library for comparing images.
In the method, first, a first picture is generated according to a first target element, wherein the first target element is a tag element or a node element in a skeleton screen, the skeleton screen is used for representing a temporary loading page before a page request of a target user is completed, the first picture is used for representing page content corresponding to the first target element, then response operation corresponding to the page request of the target user is executed, the response operation is used for displaying resource information corresponding to the page request at a browser end, then a second picture is generated according to a second target element, the second target element is a tag element or a node element in a real webpage, the real webpage is used for representing a loading page after the page request of the target user is completed, the second picture is used for representing page content corresponding to the second target element, and finally target reduction degree is determined according to the first picture and the second picture, wherein the target reduction degree is used for representing similarity between the page content in the skeleton screen and the page content in the real webpage.
As can be seen from the above, the present application compares the first picture corresponding to the skeleton screen with the second picture corresponding to the real web page after the user request is completed, and then determines the restoration degree of the skeleton screen to the real web page according to the similarity between the first picture and the second picture, thereby providing a normalized and standardized procedure for determining the restoration degree of the skeleton screen to the real web page, and further improving the efficiency of determining the restoration degree of the skeleton screen to the real web page.
Therefore, the technical scheme of the application obtains the reduction degree of the skeleton screen to the real webpage by determining the similarity between the first picture corresponding to the skeleton screen and the second picture corresponding to the real webpage, fills up the blank of determining the reduction degree of the skeleton screen to the real webpage after the user request is completed, and further solves the technical problem that the efficiency of determining the reduction degree of the skeleton screen to the real webpage is low in the prior art.
Example 2
According to the embodiment of the application, an embodiment of a device for determining the reduction degree of a skeleton screen is provided. Fig. 3 is a schematic diagram of an alternative apparatus for determining a reduction degree of a skeleton screen according to an embodiment of the present application, where, as shown in fig. 3, the apparatus for determining a reduction degree of a skeleton screen includes: a first generating unit 301, an executing unit 302, a second generating unit 303, and a first determining unit 304.
Optionally, the first generating unit is configured to generate a first picture according to a first target element, where the first target element is a tag element or a node element in a skeleton screen, the skeleton screen is used to characterize a temporary loading page before a page request of a target user is completed, and the first picture is used to characterize page content corresponding to the first target element; the execution unit is used for executing response operation corresponding to the page request of the target user, wherein the response operation is used for displaying resource information corresponding to the page request at the browser end; the second generation unit is used for generating a second picture according to a second target element, wherein the second target element is a tag element or a node element in a real webpage, the real webpage is used for representing a loaded page after a page request of a target user is completed, and the second picture is used for representing page content corresponding to the second target element; the first determining unit is used for determining a target reduction degree according to the first picture and the second picture, wherein the target reduction degree is used for representing similarity between page content in the skeleton screen and page content in the real webpage.
In an optional embodiment, the device for determining the reduction degree of the skeleton screen further includes: an interception unit and a second determination unit.
Optionally, the interception unit is configured to perform an interception operation according to a first policy or a second policy, where the first policy is used to characterize that a server intercepts a page request of a target user, the second policy is used to intercept the page request of the target user at a browser, and the interception operation is used to prohibit execution of a response operation corresponding to the page request of the target user; and the second determining unit is used for determining the temporary loading page after the interception operation is completed as a skeleton screen.
In an alternative embodiment, the first generating unit comprises: the first determining subunit, the second determining subunit and the executing subunit.
Optionally, the first determining subunit is configured to determine a first target element according to a page selector, where the page selector is configured to screen N elements included in a page according to a page request, N is a positive integer, and the page is a page corresponding to a skeleton screen or a page corresponding to a real webpage; the second determining subunit is used for determining a first object according to the first target element, wherein the first object is used for representing an interface corresponding to a page operation method, and the page operation method is used for carrying out animation effect rendering or interactive operation on a page; and the execution subunit is used for executing the page operation method corresponding to the first object based on the first target element to obtain a first picture.
In an alternative embodiment, the first determining unit comprises: a preprocessing subunit and a third determining subunit.
Optionally, a preprocessing subunit, configured to perform a preprocessing operation on the first picture and the second picture, to obtain a first target picture and a second target picture respectively, where the preprocessing operation is used to enhance a contrast ratio of a pixel point included in the first picture and the second picture; and the third determination subunit is used for determining the target reduction degree according to the first target picture and the second target picture.
In an alternative embodiment, the third determining subunit comprises: the device comprises a first extraction module, a second extraction module, a first determination module and a second determination module.
Optionally, the first extraction module is configured to perform feature extraction on the first target picture to obtain M first feature vectors corresponding to the first target picture, where M is a positive integer, and the first feature vectors are used to represent feature information of pixel points in the first target picture; the second extraction module is used for carrying out feature extraction on the second target picture to obtain M second feature vectors corresponding to the second target picture, wherein the second feature vectors are used for representing feature information of pixel points in the second target picture; the first determining module is used for determining M vector corresponding relations between the first target picture and the second target picture according to the position information of each pixel point in the first target picture and the second target picture, wherein each vector corresponding relation in the M vector corresponding relations is used for representing a one-to-one corresponding relation between a first feature vector and a second feature vector; and the second determining module is used for determining the target reduction degree according to the corresponding relation of the M vectors.
In an alternative embodiment, the second determining module includes: the first, second and third determination sub-modules.
Optionally, the first determining submodule is configured to determine P first vector correspondences in the M vector correspondences, where P is a positive integer smaller than M, and page content corresponding to a first feature vector corresponding to the first vector correspondences is allowed to be updated by the page request; the second determining submodule is used for determining Q second vector corresponding relations in the M vector corresponding relations, wherein Q is equal to the difference between M and P, Q is a positive integer, and page contents corresponding to the first feature vectors corresponding to the second vector corresponding relations are forbidden to be updated by page requests; and the third determining submodule is used for determining the target reduction degree according to the P first vector corresponding relations and the Q second vector corresponding relations.
In an alternative embodiment, the third determination submodule includes: the first determining module, the second determining module and the summing module.
Optionally, the first determining module is configured to determine a first sub-similarity corresponding to each first vector correspondence in the P first vector correspondences, where the first sub-similarity corresponding to each first vector correspondence is used to characterize a euclidean distance between a first feature vector and a second feature vector corresponding to the first vector correspondence; the second determining module is used for determining a second sub-similarity corresponding to each second vector corresponding relation in the Q second vector corresponding relations, wherein the second sub-similarity corresponding to each second vector corresponding relation is used for representing cosine similarity between the first feature vector and the second feature vector corresponding to the second vector corresponding relation; and the summing module is used for carrying out weighted summation operation on the first sub-similarity corresponding to each first vector corresponding relation and the second sub-similarity corresponding to each second vector corresponding relation to obtain the target reduction degree.
In an optional embodiment, the device for determining the reduction degree of the skeleton screen further includes: a third generation unit and a fourth generation unit.
Optionally, the third generating unit is configured to generate first early warning information when the target reduction degree is less than a preset reduction degree threshold, where the first early warning information includes at least R abnormal sub-similarities, where R is a positive integer less than or equal to M, and the abnormal sub-similarities are used to characterize a first sub-similarity less than the preset reduction degree sub-threshold and a second sub-similarity less than the preset reduction degree sub-threshold; and the fourth generation unit is used for generating a target comparison picture according to the first picture and the second picture under the condition that the target reduction degree is larger than or equal to a preset reduction degree threshold value, wherein the target comparison picture is used for representing difference information between the first picture and the second picture.
As can be seen from the above, the present application compares the first picture corresponding to the skeleton screen with the second picture corresponding to the real web page after the user request is completed, and then determines the restoration degree of the skeleton screen to the real web page according to the similarity between the first picture and the second picture, thereby providing a normalized and standardized procedure for determining the restoration degree of the skeleton screen to the real web page, and further improving the efficiency of determining the restoration degree of the skeleton screen to the real web page.
Therefore, the technical scheme of the application obtains the reduction degree of the skeleton screen to the real webpage by determining the similarity between the first picture corresponding to the skeleton screen and the second picture corresponding to the real webpage, fills up the blank of determining the reduction degree of the skeleton screen to the real webpage after the user request is completed, and further solves the technical problem that the efficiency of determining the reduction degree of the skeleton screen to the real webpage is low in the prior art.
Example 3
According to another aspect of the embodiments of the present application, there is also provided an electronic device, including: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to perform the method of determining the degree of restoration of the skeletal screen of any one of the above embodiment 1 via execution of the executable instructions.
Fig. 4 is a schematic diagram of an alternative electronic device according to an embodiment of the present application, and as shown in fig. 4, the embodiment of the present application provides an electronic device, where the electronic device includes a processor, a memory, and a program stored on the memory and capable of running on the processor, and the processor implements the method for determining the reduction degree of the skeleton screen in any one of the foregoing embodiments 1 when executing the program.
The foregoing embodiment numbers of the present application are merely for describing, and do not represent advantages or disadvantages of the embodiments.
In the foregoing embodiments of the present application, the descriptions of the embodiments are emphasized, and for a portion of this disclosure that is not described in detail in this embodiment, reference is made to the related descriptions of other embodiments.
In the several embodiments provided in the present application, it should be understood that the disclosed technology content may be implemented in other manners. The above-described embodiments of the apparatus are merely exemplary, and the division of the units, for example, may be a logic function division, and may be implemented in another manner, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be through some interfaces, units or modules, or may be in electrical or other forms.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be embodied in essence or a part contributing to the prior art or all or part of the technical solution in the form of a software product stored in a storage medium, including several instructions to cause a computer device (which may be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a removable hard disk, a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The foregoing is merely a preferred embodiment of the present application and it should be noted that modifications and adaptations to those skilled in the art may be made without departing from the principles of the present application and are intended to be comprehended within the scope of the present application.

Claims (10)

1. The method for determining the reduction degree of the skeleton screen is characterized by comprising the following steps of:
generating a first picture according to a first target element, wherein the first target element is a tag element or a node element in a skeleton screen, the skeleton screen is used for representing a temporary loading page before a page request of a target user is completed, and the first picture is used for representing page content corresponding to the first target element;
executing response operation corresponding to the page request of the target user, wherein the response operation is used for displaying resource information corresponding to the page request at a browser end;
generating a second picture according to a second target element, wherein the second target element is a tag element or a node element in a real webpage, the real webpage is used for representing a loaded page after a page request of the target user is completed, and the second picture is used for representing page content corresponding to the second target element;
And determining a target reduction degree according to the first picture and the second picture, wherein the target reduction degree is used for representing the similarity between the page content in the skeleton screen and the page content in the real webpage.
2. The method for determining the reduction degree of a skeleton screen according to claim 1, wherein before generating the first picture according to the first target element, the method for determining the reduction degree of the skeleton screen further comprises:
executing interception operation according to a first strategy or a second strategy, wherein the first strategy is used for representing that a page request of the target user is intercepted at a server side, the second strategy is used for intercepting the page request of the target user at a browser side, and the interception operation is used for prohibiting execution of response operation corresponding to the page request of the target user;
and determining the temporary loading page after the interception operation is completed as the skeleton screen.
3. The method for determining the reduction degree of a skeleton screen according to claim 1, wherein generating a first picture according to a first target element comprises:
determining a first target element according to a page selector, wherein the page selector is used for screening N elements included in a page according to the page request, N is a positive integer, and the page is a page corresponding to the skeleton screen or a page corresponding to the real webpage;
Determining a first object according to the first target element, wherein the first object is used for representing an interface corresponding to a page operation method, and the page operation method is used for carrying out animation effect rendering or interactive operation on the page;
and executing a page operation method corresponding to the first object based on the first target element to obtain the first picture.
4. The method for determining the reduction degree of a skeleton screen according to claim 1, wherein determining the target reduction degree from the first picture and the second picture includes:
respectively preprocessing the first picture and the second picture to obtain a first target picture and a second target picture, wherein the preprocessing is used for enhancing the contrast ratio of pixel points included in the first picture and the second picture;
and determining the target reduction degree according to the first target picture and the second target picture.
5. The method for determining the reduction degree of a skeleton screen according to claim 4, wherein determining the target reduction degree according to the first target picture and the second target picture comprises:
extracting features of the first target picture to obtain M first feature vectors corresponding to the first target picture, wherein M is a positive integer, and the first feature vectors are used for representing feature information of pixel points in the first target picture;
Extracting features of the second target picture to obtain M second feature vectors corresponding to the second target picture, wherein the second feature vectors are used for representing feature information of pixel points in the second target picture;
determining M vector corresponding relations between the first target picture and the second target picture according to the position information of each pixel point in the first target picture and the second target picture, wherein each vector corresponding relation in the M vector corresponding relations is used for representing a one-to-one corresponding relation between a first feature vector and a second feature vector;
and determining the target reduction degree according to the M vector correspondence.
6. The method for determining the reduction degree of a skeleton screen according to claim 5, wherein determining the target reduction degree according to the M vector correspondence relation comprises:
determining P first vector corresponding relations in the M vector corresponding relations, wherein P is a positive integer smaller than M, and page contents corresponding to first feature vectors corresponding to the first vector corresponding relations are allowed to be updated by the page request;
q second vector corresponding relations in the M vector corresponding relations are determined, wherein Q is equal to the difference between M and P, Q is a positive integer, and page contents corresponding to first feature vectors corresponding to the second vector corresponding relations are forbidden to be updated by the page request;
And determining the target reduction degree according to the P first vector corresponding relations and the Q second vector corresponding relations.
7. The method for determining the reduction degree of the skeleton screen according to claim 6, wherein determining the target reduction degree according to the P first vector correspondences and the Q second vector correspondences comprises:
determining first sub-similarity corresponding to each first vector corresponding relation in the P first vector corresponding relations, wherein the first sub-similarity corresponding to each first vector corresponding relation is used for representing Euclidean distance between a first feature vector and a second feature vector corresponding to the first vector corresponding relation;
determining a second sub-similarity corresponding to each second vector corresponding relation in the Q second vector corresponding relations, wherein the second sub-similarity corresponding to each second vector corresponding relation is used for representing cosine similarity between a first feature vector and a second feature vector corresponding to the second vector corresponding relation;
and carrying out weighted summation operation on the first sub-similarity corresponding to each first vector corresponding relation and the second sub-similarity corresponding to each second vector corresponding relation to obtain the target reduction degree.
8. The method for determining the reduction degree of a skeleton screen according to claim 7, wherein after performing a weighted summation operation on the first sub-similarity corresponding to each first vector correspondence and the second sub-similarity corresponding to each second vector correspondence to obtain the target reduction degree, the method for determining the reduction degree of a skeleton screen further comprises:
generating first early warning information under the condition that the target reduction degree is smaller than a preset reduction degree threshold value, wherein the first early warning information at least comprises R abnormal sub-similarities, R is a positive integer smaller than or equal to M, and the abnormal sub-similarities are used for representing first sub-similarities smaller than the preset reduction degree sub-threshold value and second sub-similarities smaller than the preset reduction degree sub-threshold value;
and generating a target comparison picture according to the first picture and the second picture under the condition that the target reduction degree is larger than or equal to the preset reduction degree threshold, wherein the target comparison picture is used for representing difference information between the first picture and the second picture.
9. The device for determining the reduction degree of the skeleton screen is characterized by comprising the following components:
the first generation unit is used for generating a first picture according to a first target element, wherein the first target element is a tag element or a node element in a skeleton screen, the skeleton screen is used for representing a temporary loading page before a page request of a target user is completed, and the first picture is used for representing page content corresponding to the first target element;
The execution unit is used for executing response operation corresponding to the page request of the target user, wherein the response operation is used for displaying resource information corresponding to the page request at a browser end;
the second generation unit is used for generating a second picture according to a second target element, wherein the second target element is a tag element or a node element in a real webpage, the real webpage is used for representing a loaded page after a page request of the target user is completed, and the second picture is used for representing page content corresponding to the second target element;
the first determining unit is used for determining a target reduction degree according to the first picture and the second picture, wherein the target reduction degree is used for representing similarity between page content in the skeleton screen and page content in the real webpage.
10. An electronic device comprising one or more processors and a memory for storing one or more programs, wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method of determining the degree of restoration of a skeletal screen of any one of claims 1-8.
CN202311425933.0A 2023-10-30 2023-10-30 Method and device for determining reduction degree of skeleton screen and electronic equipment Pending CN117370694A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311425933.0A CN117370694A (en) 2023-10-30 2023-10-30 Method and device for determining reduction degree of skeleton screen and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311425933.0A CN117370694A (en) 2023-10-30 2023-10-30 Method and device for determining reduction degree of skeleton screen and electronic equipment

Publications (1)

Publication Number Publication Date
CN117370694A true CN117370694A (en) 2024-01-09

Family

ID=89388955

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311425933.0A Pending CN117370694A (en) 2023-10-30 2023-10-30 Method and device for determining reduction degree of skeleton screen and electronic equipment

Country Status (1)

Country Link
CN (1) CN117370694A (en)

Similar Documents

Publication Publication Date Title
CN110366001B (en) Method and device for determining video definition, storage medium and electronic device
CN107301046B (en) Icon processing method and device, computer equipment and storage medium
CN110889824A (en) Sample generation method and device, electronic equipment and computer readable storage medium
CN113126937B (en) Display terminal adjusting method and display terminal
KR20200132682A (en) Image optimization method, apparatus, device and storage medium
US11887218B2 (en) Image optimization method, apparatus, device and storage medium
GB2524047A (en) Improvements in and relating to rendering of graphics on a display device
CN112565887B (en) Video processing method, device, terminal and storage medium
CN116761037B (en) Method, device, equipment and medium for video implantation of multimedia information
CN111741329B (en) Video processing method, device, equipment and storage medium
CN117370694A (en) Method and device for determining reduction degree of skeleton screen and electronic equipment
CN108804652B (en) Method and device for generating cover picture, storage medium and electronic device
CN105956173A (en) Page content acquisition method and apparatus
CN108304118B (en) Screenshot method and device
CN110851883B (en) Equipment fingerprint generation method and device based on picture drawing
US20220189088A1 (en) Method and system for removing scene text from images
CN114299105A (en) Image processing method, image processing device, computer equipment and storage medium
CN114079815B (en) Subtitle protection method, system, terminal equipment and storage medium
CN117635788A (en) Image rendering method and device, electronic equipment and storage medium
CN117935010A (en) Video cover picture generation method and device, electronic equipment and storage medium
CN111967957A (en) Business handling method, device, equipment and system
CN115601234A (en) Image super-resolution reconstruction method, device and equipment and storage medium
CN117078521A (en) Image processing method, device, computer equipment and storage medium
CN117762543A (en) Remote desktop image processing method, system, electronic equipment and storage medium
CN116962782A (en) Media information display method and device, storage medium and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination