Web page access status determination method, device, storage medium and electronic device
By creating link tags in the browser, adjusting style attributes, and monitoring rendering time, the problem of the browser being unable to determine the web page access status is solved. This method realizes the web page access status judgment without plug-ins and style attribute acquisition, and adapts to the rendering mechanisms of different browsers.
Patent Information
- Application Number
- CN202111574765.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-21
- Publication Date
- 2025-09-30
- Estimated Expiration
- 2041-12-21
AI Technical Summary
The prior art lacks a practical method for determining whether a web page has been visited by a user, especially since the latest browsers do not support obtaining link color attributes and the screenshot method relies on browser plug-ins.
Create a link tag in the browser and trigger the target rendering process. By adjusting the style attributes of the link tag and the link target, monitoring the rendering duration, and determining the number of renderings, the access status of the web page can be judged without obtaining the link style attributes or installing plug-ins.
It achieves the accurate determination of web page access status without the need for browser plug-ins and style attribute acquisition, adapts to different browser rendering mechanisms, and improves the feasibility of user behavior information collection.
Smart Images

Figure CN114238837B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a method, device, storage medium, and electronic device for determining a web page access status. Background Art
[0002] Collecting user behavior through the internet is particularly important for the development of technologies such as big data and artificial intelligence. Collecting user behavior includes collecting users' web page access records. Related technologies install plugins on browser clients to take screenshots of web pages accessed by users and send them to backend servers. The backend servers then use algorithms to identify the link's access status, or obtain the link's color attributes through the browser to determine the link's access status based on the color attributes. However, the latest versions of browsers no longer support obtaining link color attributes, and screenshots rely on installing plugins in the browser.
[0003] This shows that there is currently a lack of a practical method for determining whether a web page has been visited by a user. Summary of the Invention
[0004] The purpose of the present disclosure is to provide a method, device, storage medium and electronic device for determining web page access status to solve the problems existing in the related art.
[0005] To achieve the above objectives, according to a first aspect of an embodiment of the present disclosure, a method for determining a webpage access status is provided, the method comprising:
[0006] Creating a link tag in a designated web page that has been visited by the browser, with the link target pointing to the designated web page, so as to trigger the browser to perform a target rendering process on the link tag;
[0007] Wherein, when the rendering value adopted by the browser does not match the access status of the webpage pointed to by the link target, the target rendering process is to render the link tag twice so that the rendering value of the link tag adopted by the browser matches the access status of the webpage pointed to by the link target; when the rendering value adopted by the browser matches the access status of the webpage pointed to by the link target, the target rendering process is to render the link tag once;
[0008] Modify the link target of the link tag to a target web page, and trigger the browser to perform the target rendering process for the link tag again;
[0009] Determine a target number of times for rendering the link tag in the target rendering process being performed this time;
[0010] The access status of the target webpage is determined according to the target number of times.
[0011] Optionally, determining a target number of times of rendering the link target in the target rendering process currently being performed includes:
[0012] Monitor the rendering time of each frame within a preset number of frames of the browser;
[0013] Determining a target number of frames greater than a preset duration threshold from the rendering duration of each frame;
[0014] The target number of times the link tag is rendered in the target rendering process is determined according to the target number of frames.
[0015] Optionally, there are multiple link tags, and the preset duration threshold and the preset number of frames are both positively correlated with the number of the link tags.
[0016] Optionally, triggering the browser to perform the target rendering process again on the link tag includes:
[0017] By adjusting the style attribute of the link tag, the browser is triggered to perform the target rendering process on the link tag again.
[0018] Optionally, adjust the style attributes of the link tag as follows:
[0019] Adjusting the first style attribute of the link tag from a first preset style value to a second preset style value;
[0020] The first style attribute is adjusted from the second preset style value back to the first preset style value.
[0021] Optionally, there are multiple target web pages, and modifying the link target of the link tag to the target web page includes:
[0022] The link target is modified in turn according to each target web page, and each modification of the link target is performed after the access status of the target web page after the last modification is determined.
[0023] Optionally, the method further includes:
[0024] During the period when the browser accesses the designated web page, the step of determining the access status of the plurality of target web pages is executed cyclically, wherein each cycle includes the step of modifying the link target according to each target web page in turn.
[0025] Optionally, creating a link tag in the designated webpage with a link target pointing to the designated webpage includes:
[0026] A link tag is created in the designated webpage, a link target of the link tag is set to point to the designated webpage, and a second style attribute of the link tag is set to a third preset style value so that the link tag is invisible in the designated webpage.
[0027] Optionally, the method further includes:
[0028] In response to a browser accessing a designated web page, obtaining information of a web page to be monitored sent by a website server corresponding to the designated web page, and using a web page in the information of the web page to be monitored as the target web page;
[0029] The method further comprises:
[0030] The access status of the target web page is sent to the website server.
[0031] According to a second aspect of an embodiment of the present disclosure, a device for determining a webpage access status is provided, the device comprising:
[0032] A creation module, configured to create a link tag in a designated web page that has been visited by the browser, the link target of which points to the designated web page, so as to trigger the browser to perform a target rendering process on the link tag;
[0033] Wherein, when the rendering value adopted by the browser does not match the access status of the webpage pointed to by the link target, the target rendering process is to render the link tag twice so that the rendering value of the link tag adopted by the browser matches the access status of the webpage pointed to by the link target; when the rendering value adopted by the browser matches the access status of the webpage pointed to by the link target, the target rendering process is to render the link tag once;
[0034] a modification module, configured to modify the link target of the link tag to a target web page, and trigger the browser to perform the target rendering process for the link tag again;
[0035] A first determining module is used to determine a target number of times of rendering the link tag in the target rendering process being performed this time;
[0036] The second determining module is configured to determine the access status of the target webpage according to the target number of times.
[0037] According to a third aspect of an embodiment of the present disclosure, a non-temporary computer-readable storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the steps of the method described in any one of the first aspects are implemented.
[0038] According to a fourth aspect of the embodiments of the present disclosure, there is provided an electronic device, including:
[0039] a memory having a computer program stored thereon;
[0040] A processor is used to execute the computer program in the memory to implement the steps of any one of the methods described in the first aspect above.
[0041] The above technical solution can at least achieve the following technical effects:
[0042] Typically, when a browser detects a change in the webpage layout or style, it will render the page accordingly based on the access status of the links on the current webpage. Specifically, when rendering a link tag, the browser first renders the link using the rendering value of the rendered link tag. If, after querying the database, it discovers that the access status of the link does not match the rendering value used, the browser updates the rendering value to match the access status of the link, and then renders the link a second time based on the updated rendering value.
[0043] Therefore, in response to detecting that a browser has accessed a specified webpage, a link tag is created on the specified webpage, with the link target pointing to the specified webpage. An event that causes a change in the webpage layout is then used to trigger the browser to perform a target rendering process on the created link tag. The target rendering process involves: when the rendering value used by the browser does not match the access status of the webpage pointed to by the link target, the link tag is rendered twice to ensure that the browser's rendering value matches the access status of the webpage pointed to by the link target; and when the rendering value used by the browser matches the access status of the webpage pointed to by the link target, the link tag is rendered once. This ensures that the rendering value of the link tag rendered by the browser matches the access status of the specified webpage, based on the fact that the specified webpage has been visited by the user.
[0044] If it is determined that the browser's rendered link tag's rendering value indicates that the webpage link has been visited, the link target of the created link tag is modified to the target webpage, and the browser can be triggered to perform the aforementioned target rendering process again by adjusting the style attributes of the link tag. Based on the target rendering process performed by the browser, a target number of times for rendering the link tag in this target rendering process is determined.
[0045] Since the browser's current rendering value for the link tag matches the access status of the specified web page, if the target web page has not been accessed (in this case, the browser's rendering value does not match the access status of the web page pointed to by the link tag's link target), the target rendering process performed again will render the link tag twice. If the target web page has been accessed (in this case, the browser's rendering value matches the access status of the web page pointed to by the link tag's link target), the target rendering process performed again will render the link tag once. Therefore, the access status of the target web page can be determined based on the target number of times, thereby achieving the user's access behavior information on the target web page without obtaining the link's style attributes through the browser or installing a plug-in in the browser.
[0046] Other features and advantages of the present disclosure will be described in detail in the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] The accompanying drawings are used to provide a further understanding of the present disclosure and constitute a part of the specification. Together with the following detailed description, they are used to explain the present disclosure but do not constitute a limitation of the present disclosure. In the accompanying drawings:
[0048] Figure 1 The figure is a flowchart of a method for determining a web page access status according to an exemplary embodiment of the present disclosure.
[0049] Figure 2 The figure is a block diagram of a device for determining a web page access status according to an exemplary embodiment of the present disclosure.
[0050] Figure 3 It is a block diagram of an electronic device shown in an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION
[0051] The following describes the specific embodiments of the present disclosure in detail with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are only used to illustrate and explain the present disclosure and are not intended to limit the present disclosure.
[0052] First of all, it is worth explaining that the technical solution provided by the embodiment of the present disclosure can be implemented with the user's authorization. For example, when a user accesses a specified web page through a browser, or when a user registers to become a user of a specified web page, or when a user completes registration and logs in to a specified web page, the user is informed by a pop-up prompt box, or by a direct display on the specified web page, or by other means that the specified web page will collect relevant user behavior information during the user's access process, and the technical solution provided by the embodiment of the present disclosure is implemented after the user confirms the authorization. The following is a detailed description of the web page access status determination method, device, storage medium and electronic device provided by the embodiment of the present disclosure.
[0053] Figure 1 FIG. 1 is a flow chart showing a method for determining a web page access status according to an exemplary embodiment of the present disclosure. Figure 1 As shown, the method includes:
[0054] S101: creating a link tag in a designated web page that has been visited by a browser, with the link target pointing to the designated web page, so as to trigger the browser to perform a target rendering process on the link tag.
[0055] Among them, when the rendering value used by the browser does not match the access status of the web page pointed to by the link target, the target rendering process is to render the link tag twice so that the rendering value of the link tag used by the browser matches the access status of the web page pointed to by the link target. When the rendering value used by the browser matches the access status of the web page pointed to by the link target, the target rendering process is to render the link tag once.
[0056] Step S101 may, for example, be a response to a browser accessing a designated webpage, creating a link tag on the designated webpage with a link target pointing to the designated webpage. Step S101 may also be a response to a user triggering a preset control on the designated webpage that the browser has accessed, creating a link tag on the designated webpage with a link target pointing to the designated webpage. The preset control may, for example, be a control for requesting user authorization for the collection of webpage access information, and the user's triggering operation on the preset control may be a preset authorization operation.
[0057] It should be understood that creating a link tag in a specified web page may cause the web page layout to change, thereby triggering the browser to re-render the page. Generally, when the browser detects that the web page layout has been changed or the web page style has been changed, it can perform corresponding page rendering based on the access status of the link in the current web page (i.e., the above-mentioned target rendering process). Among them, the target rendering process can be specifically:
[0058] When the browser renders a link in a page, it first uses the rendering value of the rendering link tag to render the link for the first time. If it is then learned through a query to the database (the database records the user's historical web page access records, and the website server corresponding to the specified web page cannot directly query the database to obtain the user's historical access records) that the access status of the link does not match the used rendering value, the rendering value is updated so that the updated rendering value matches the access status of the link, and the link is rendered a second time according to the updated rendering value. Among them, the rendering value is used by the browser to render the link tag. The link tag has different styles in different link access states. These different styles are displayed by the browser based on the corresponding rendering value rendering link. Therefore, the rendering value can represent the access status of the web page link. For example, for the access status of the corresponding link that has been visited, the rendering value can be purple, that is, the browser renders the link purple according to the rendering value; for the access status of the corresponding link that has not been visited, the rendering value can be blue, that is, the browser renders the link blue according to the rendering value.
[0059] It can be understood that by creating a link tag in the specified web page with a link target pointing to the specified web page to trigger the browser to perform the target rendering process, the rendering value of the browser rendering link tag is consistent with the access status of the specified web page, that is, the rendering value of the browser rendering link tag is consistent with the status that the specified web page has been visited.
[0060] S102: Modify the link target of the link tag to the target web page, and trigger the browser to perform the target rendering process for the link tag again.
[0061] The link target of the link tag can be modified to the target web page by modifying the url (Uniform Resource Locators) address indicated by the href (Hypertext Reference) attribute of the link tag to the link address of the target web page.
[0062] It should be noted that different browsers may not use the same page rendering mechanism. During implementation, this solution can be modified to suit the rendering characteristics of different browsers. For example, for some browsers, simply changing the link target to the target webpage can trigger the browser to perform the target rendering process. For other browsers, modifying the webpage style or layout of the specified webpage can trigger the browser to perform the target rendering process.
[0063] S103: Determine the target number of times to render the link tag in the target rendering process being performed this time.
[0064] It should be noted that, in the process of triggering the browser to perform the target rendering process for the link tag again, all frames rendered by the browser may include: frames in which the browser continuously renders the page as the screen refreshes and frames in which the browser renders for the link tag. Among them, when the screen refresh frequency is 60Hz, the time it takes for the browser to render a frame as the screen refreshes is usually 16.7ms; when the amount of link tag rendering is large and causes the browser rendering to be blocked, the time it takes for the browser to render a frame is usually greater than 16.7ms. Therefore, the frame that the browser renders for the link tag can be determined by monitoring the rendering time of each frame in the target rendering process. It should be understood that the browser can query the database to know the access status of the link for the rendering of the link tag, and thus perform one or two renderings.
[0065] In order to distinguish the time it takes for a browser to render a frame for a link tag from the time it takes for a browser to render a frame at the frequency of screen refresh, you can create multiple link tags when creating a link tag whose link target points to a specified web page, and modify the link targets of multiple link tags when modifying the web page to which the link target of a link tag points; or, for a single link tag, change multiple style attributes of the single link tag, thereby extending the time it takes for the browser to render a frame for the link tag, so that the judgment of the target number is more accurate.
[0066] S104: Determine the access status of the target webpage according to the target number of times.
[0067] Because, when the rendering value used by the browser does not match the access status of the web page pointed to by the link target, the target rendering process is to render the link tag twice so that the browser's rendering value of the link tag matches the access status of the web page pointed to by the link target; when the rendering value used by the browser matches the access status of the web page pointed to by the link target, the target rendering process is to render the link tag once. Therefore, when it is determined that the specified web page has been visited, and the browser's rendering value of the link tag matches the access status of the specified web page, it can be determined based on the target number of times whether the rendering value is changed, and then whether the access status of the target web page is consistent with the access status of the specified web page. That is, when the target number of times is one rendering, the access status of the target web page is determined to have been visited (consistent with the access status of the specified web page); when the target number of times is two renderings, the access status of the target web page is determined to have not been visited (different from the access status of the specified web page).
[0068] The web page access status determination method provided by the embodiment of the present disclosure does not require obtaining the style attributes of the link through the browser, nor does it require installing a plug-in in the browser. It can determine the access status of the target web page after the user visits the specified web page.
[0069] In order to make it easier for those skilled in the art to understand the web page access status determination method provided by the present disclosure, the above steps are described in detail with examples below.
[0070] Optionally, the above step S103 may specifically include:
[0071] Monitor the browser's rendering time for each frame within the preset frame number;
[0072] Determine a target number of frames greater than a preset duration threshold from the rendering duration of each frame;
[0073] The target number of times the link tag is rendered in the target rendering process is determined according to the target number of frames.
[0074] Among them, the preset frame number and the preset duration threshold are positively correlated with the number of link tags, because the preset frame number is related to the performance of the computing device running the browser, the rendering engine of the browser, etc. Among them, for devices with relatively poor computing performance, the more link tags there are, the longer it takes for the computing device to execute the corresponding code. In this case, even if the browser is triggered to perform the target rendering process by adjusting the style attributes of the link tag, before the computing device has completed executing the corresponding code for adjusting the style attributes of the link tag, the browser usually only renders the page in response to a screen refresh, and only after the computing device has completed executing the corresponding code will it render once or twice according to the link access status. Therefore, for devices with relatively poor computing performance, the preset frame number can be set relatively larger in specific implementation.
[0075] It can be understood that the setting of the preset frame number can make the frames rendered by the browser within the preset frame number include the frames in which the target rendering process renders the link tag, so as to determine the target frame number that can represent the number of times the target rendering process renders the link tag from the preset frame number.
[0076] In addition, the preset duration threshold is related to the performance of the computing device running the browser, the rendering engine of the browser, the length of the link text, and the screen refresh frequency. Without considering other factors, when the screen refresh frequency is 60Hz, the preset duration threshold can be as low as 16.7ms, and the maximum can be set according to the number of link tags. Specifically, the more link tags there are, the longer it takes to trigger the browser to render a frame by adjusting the style attributes of the link tags. On this basis, the preset duration threshold does not exceed the maximum duration of triggering the browser to render a frame by adjusting the style attributes of the link tag. Since there are many factors that affect the preset duration threshold, in order to reduce the judgment error, the preset duration threshold can be set to a larger value, for example, 60ms. In a specific implementation, the preset duration threshold can be set according to the actual situation, and the present disclosure does not make specific limitations on this.
[0077] The rendering duration can be determined specifically by calling back the requestAnimationFrame function in a specified web page to monitor the rendering duration of each frame of the browser within a preset number of frames. Among them, the requestAnimationFrame function is usually called by the browser before rendering each frame of the page. Since the browser usually continuously renders the page according to the frequency of screen refresh when calling the requestAnimationFrame function, and adjusting the link tag of the target web page may cause the loading of CSS (Cascading Style Sheets) or JS (JavaScript, scripting language) to be blocked, thereby causing the browser to extend the rendering duration of at least one frame of the page. Therefore, after determining the duration (that is, the preset duration threshold) of the browser rendering a frame of the page when there is no loading blockage or other situation that extends the page rendering duration, it is possible to determine the target number of frames for the browser to render the page triggered by the operation of adjusting the link tag of the target web page, and the rendering duration of each frame in the target number of frames is greater than the preset duration threshold.
[0078] In the present disclosure, the rendering duration of each frame within a preset number of frames can be obtained by subtracting the time it took the previous frame to call back the requestAnimationFrame function from the time it took the current frame to call back the requestAnimationFrame function, and a target number of frames greater than the preset rendering duration can be determined from the rendering duration of each frame. It is understood that the browser can render one frame as one rendering, that is, the target number of times the link tag is rendered in the target rendering process can be determined based on the target number of frames.
[0079] Optionally, the method of triggering the browser to perform a target rendering process for the link tag may include:
[0080] Method 1: Adjust the style attributes of the link tag.
[0081] For example, the first style attribute of the link tag is adjusted from a first preset style value to a second preset style value; and the first style attribute is adjusted from the second preset style value back to the first preset style value.
[0082] It is understandable that adjusting the style attributes of a link tag can trigger the browser to perform the target rendering process. A link tag has multiple attributes, such as an id that uniquely identifies an HTML (HyperText Markup Language) element, a title that describes additional information about the HTML element, and a style that specifies the style of the HTML element. Modifying attributes such as the id or title will not trigger the browser to render the page, but modifying the style attributes can change the appearance of the HTML element, thereby triggering the browser to render the page.
[0083] Since, when rendering a page, if it is detected that some web page styles are specified in the resource file of the page, the page rendering will be performed according to the resource file of the page first. If the styles of certain HTML elements in the page are not specified in the resource file of the page, the corresponding HTML elements will be rendered according to the style values preset by the browser. Therefore, the first style attribute of the link tag can be adjusted from the first preset style value to the second preset style value so that the browser can render the page according to the resource file of the specified web page, wherein the first style attribute can be the color attribute, text decoration attribute, etc. of the link tag, and the first preset style value can be the style value preset by the browser. Correspondingly, the first style attribute can be adjusted from the second preset style value back to the first preset style value so that the browser can render the corresponding HTML element according to the preset style value.
[0084] In some embodiments, the operation of adjusting the first style attribute of the link tag from the first preset style value to the second preset style value can be achieved by adding the first style attribute of the link tag to the second preset style value in the CSS resource file of the initial web page through JS code; the operation of adjusting the first style attribute from the second preset style value back to the first preset style value can be achieved by deleting the second preset style value in the CSS resource file or setting the second preset style value to an empty value through JS code. In other embodiments, the second preset style value can be pre-set in the CSS resource file of the specified web page, and the second preset style value is set to not match the link tag, so that the operation of adjusting the first style attribute of the link tag from the first preset style value to the second preset style value can be achieved by setting the second preset style value to match the link tag through JS code, and the operation of adjusting the first style attribute from the second preset style value back to the first preset style value can be achieved by setting the second preset style value to not match the link tag again through JS code.
[0085] Specifically, taking the color attribute as an example, the first style attribute of the link tag can be adjusted as follows:
[0086] {style.color="red";
[0087] style.color=""}
[0088] That is, first set the color attribute of the link tag to red, and then set the color attribute to an empty value to trigger the browser to render the link tag according to the preset style value.
[0089] It is understandable that the first style attribute of the link tag may be adjusted in other ways to trigger the browser to perform the target rendering process on the link tag again, and this disclosure does not make any specific limitation on this.
[0090] Method 2: Adjust the style attributes of other HTML elements in the specified web page except the created link tag.
[0091] For example, after determining the web page functions that a specified web page has, you can determine the HTML elements that already exist in the specified web page before creating a link tag, so that after changing the link target in the link tag to the target web page, you can trigger the browser to render the page by modifying the HTML elements that already exist in the specified web page. Alternatively, create an HTML element other than a link tag (such as a block tag) ), and use the created link tag as the content of the HTML element (that is, the link tag as the child tag of the HTML element), and trigger the browser to render the page by modifying the HTML element. Specifically, with the block tag For example, the link tag as a child tag of the block tag can be as follows:
[0092] <a href=”url”> Link text
[0093] It is worth noting that the timing of calling the requestAnimationFrame function in a given web page can affect the target frame rate.
[0094] In some embodiments, after the first style attribute of the link tag is adjusted from the first preset style value to the second preset style value, the requestAnimationFrame function is called back to monitor the duration of each frame rendered by the browser. In this case, the requestAnimationFrame function callback will first monitor the duration of a frame rendered by the browser according to the second preset style value, and then monitor the duration of the rendering frame of the link tag by the target rendering process started after the first style attribute is adjusted from the second preset style value back to the first preset style value, that is, the target number of frames is two or three frames. In this case, when the target number of frames is two frames, the access status of the target web page is consistent with the rendering value before the browser renders the link tag of the target web page, that is, the target number of times the browser renders the link tag in the target rendering process is once; when the target number of frames is three frames, the access status of the target web page is inconsistent with the rendering value before the browser renders the link tag of the target web page, that is, the target number of times the browser renders the link tag in the target rendering process is twice.
[0095] In other embodiments, after adjusting the first style attribute from the second preset style value back to the first preset style value, the requestAnimationFrame function is called back to monitor the duration of the browser rendering each frame. In this case, the callback requestAnimationFrame function will directly monitor the duration of the target rendering process rendering the link tag frame. In this case, when the target frame number is one frame, the access status of the target web page is consistent with the rendering value before the browser renders the link tag of the target web page, that is, the target number of times the browser renders the link tag in the target rendering process is once; when the target frame number is two frames, the access status of the target web page is inconsistent with the rendering value before the browser renders the link tag of the target web page, that is, the target number of times the browser renders the link tag in the target rendering process is twice.
[0096] It is understandable that in the process of monitoring the duration of the browser rendering each frame, there may be other factors that affect the target frame number. Regardless of the influencing factors, when the rendering value used by the browser does not match the access status of the web page pointed to by the link target, the target frame number of the browser rendering the link tag should be one frame more than the case where the rendering value used by the browser is consistent with the access status of the web page pointed to by the link target, and the target frame number of one more frame indicates that the browser renders the link tag twice in the target rendering process.
[0097] Optionally, there are multiple target web pages, and modifying the link target of the link tag to the target web page includes:
[0098] The link target is modified in turn according to each target web page, and each modification of the link target is performed after the access status of the target web page after the last modification is determined.
[0099] In a possible implementation, the link address of the target web page may be obtained from a website server corresponding to the designated web page.
[0100] For example, the method provided in the embodiment of the present disclosure can obtain the web page information to be monitored sent by the website server corresponding to the specified web page in response to the browser accessing the specified web page, and use the web page in the web page information to be monitored as the target web page.
[0101] Among them, the web page information to be monitored can include a link to a web page to be monitored, or it can include a link list consisting of multiple web page links to be monitored. By modifying the "href" attribute of the link tag to the target link in the link list in turn, the web pages to be monitored in the web page information to be monitored can be used as target web pages in turn, and then the access status of each web page to be monitored in the link list can be determined in turn.
[0102] It is worth noting that the determination of the status of each target web page depends on the access status determined for the previous web page (the previous web page of the first target web page is the designated web page). It is understandable that when determining the access status of any target web page, the browser's current rendering value of the link tag is consistent with the access status of the target web page. In this way, when determining the access status for the next target web page of the target web page, if the above-mentioned target number of frames determined for the next target web page is two, it indicates that the access status of the next target web page of the target web page is inconsistent with the access status of the target web page, and if the target number of frames is one, it indicates that the access status of the next target web page of the target web page is consistent with the access status of the target web page. Therefore, when there are multiple target web pages, except for the first target web page (the previous web page of the first target web page is the designated web page with a known access status), the access status of any other target web page can be determined based on the access status of the previous target web page and the target number of frames.
[0103] Table 1 shows the access status determination results for 5 target web pages, taking the case where there are 5 target web pages, the preset number of frames is 8 frames, the preset duration is 60ms, and the duration of each frame of the browser rendering is monitored after the first style attribute is adjusted from the second preset style value back to the first preset style value.
[0104]
[0105] Table 1
[0106] It can be understood that after creating a link tag and pointing the link target of the link tag to the link address of the specified web page, triggering the browser to perform the first target rendering process for the link tag, the browser's rendering value for the link tag is consistent with the state that the specified web page has been accessed. On this basis, the URL address of the link tag can be modified to the target link address (that is, link address 1 in Table 1), and the browser can be triggered to perform the target rendering process again, and by monitoring the rendering time of each frame within the preset number of frames of the browser, the target number of frames greater than 60ms is determined to be 1 frame from the rendering time of each frame, thereby determining that the target number of times the link tag is rendered in this target rendering process is 1 time, that is, the rendering value used by the browser is consistent with the access status of link address 1, and then determining that link address 1 has been accessed.
[0107] If it is determined that link address 1 has been accessed, the URL address of the link tag can be modified to the next target link address (i.e., link address 2 in Table 1). The same method is used to determine the target number of frames greater than 60ms from the rendering time of each frame as 2 frames, thereby determining the target number of times the link tag is rendered in the target rendering process to be 2 times. In other words, the rendering value used by the browser does not match the access status of link address 2, and thus determines that link address 2 has not been accessed. After triggering the browser to perform the target rendering process again, the browser's rendering value is updated to match the access status of link address 2.
[0108] Similarly, after the access status of the target web page after the last modification is determined, the link target is modified according to the target link address in turn, and the browser is triggered to perform the target rendering process again, thereby determining the access status of the target web page pointed to by each target link.
[0109] Optionally, the method provided in the embodiment of the present disclosure may further include:
[0110] During the browser accessing the designated web page, the step of determining the access status of the plurality of target web pages is executed cyclically, wherein each cycle includes the step of modifying the link target according to each target web page in turn.
[0111] Still taking Table 1 as an example, after determining the access status corresponding to link address 5, the link target of the link tag can be set to link address 1 again to achieve a loop. This can determine whether the browser has also visited each target web page during the entire process of accessing the specified web page.
[0112] Optionally, the method provided in the embodiment of the present disclosure may further include:
[0113] The access status of the target web page is sent to the website server.
[0114] In the specific implementation process, when determining the access status of multiple target web pages, after determining the access status of a target web page, it can be fed back to the website server corresponding to the specified web page, or after determining the access status of each target web page in each cycle, the access status of all target web pages can be returned to the website server, so that the website server can analyze user behavior and characterize user portraits based on these access status information.
[0115] Optionally, creating a link tag in the designated webpage with a link target pointing to the designated webpage may include:
[0116] A link tag is created in the designated webpage, a link target of the link tag is set to point to the designated webpage, and a second style attribute of the link tag is set to a third preset style value to make the link tag invisible in the designated webpage.
[0117] Specifically, a link tag with a link target pointing to a specified web page can be created in a specified web page through JS code, and the second style attribute of the link tag is set to a third preset style value to make the link tag invisible, thereby preventing the user from perceiving the creation and subsequent modification of the link tag, thereby improving the user's experience of browsing the specified web page. Among them, since adjusting the style attributes of the link tag will not trigger the browser to render when the link tag is completely invisible, making the link tag invisible can refer to making the link tag almost invisible. The second style attribute is used to characterize the attribute that can make the link tag almost invisible, and can be multiple different style attributes, such as transparency (opacity), position (position) and stacking order (z-index). Among them, the z-index attribute sets the stacking order of elements, and elements with a higher stacking order will always be in front of elements with a lower stacking order. Accordingly, the third preset style value can have different values corresponding to different second style attributes. For example, the corresponding transparency can be 0.01, and the corresponding stacking order can be -10.
[0118] Specifically, you can set the style attributes of the link tag as follows:
[0119] {opacity:0.01;
[0120] float:right;
[0121] position:absolute;
[0122] z-index: -10}
[0123] The link tag's transparency is set to 0.01, its position is fixed to the right side of the specified webpage, and its stacking order is -10. In this case, the link tag is almost invisible. Since the link text in a link tag is usually long, the link tag's text can also be replaced with smaller characters, such as ".", "," and "`". By setting the link tag's second style attribute and replacing the link text, the link tag can be made almost invisible to users on the specified webpage.
[0124] By adopting the above method, there is no need to obtain the style attributes of the link through the browser, nor is there a need to install a plug-in in the browser. After the user visits the specified web page, based on the status that the specified web page has been visited, a link tag can be created in the specified web page to determine the rendering value of the link rendered by the browser, thereby modifying the link target of the link tag and modifying the style attributes of the link tags of different web pages one by one on the specified web page to trigger the browser to perform the target rendering process again. According to the target rendering process performed by the browser, the target number of times the link tag is rendered in the target rendering process this time is determined, and the access status of the target web page is determined according to the target number.
[0125] Based on the same inventive concept, the present disclosure also provides a device for determining a web page access status, see Figure 2 , Figure 2 is a block diagram of a device for determining a web page access status according to an exemplary embodiment of the present disclosure. Figure 2 As shown, the web page access status determination device 100 includes:
[0126] A creation module 101 is configured to create a link tag in a designated web page that has been visited by a browser, with the link target pointing to the designated web page, so as to trigger the browser to perform a target rendering process on the link tag;
[0127] Wherein, when the rendering value adopted by the browser does not match the access status of the webpage pointed to by the link target, the target rendering process is to render the link tag twice so that the rendering value of the link tag adopted by the browser matches the access status of the webpage pointed to by the link target; when the rendering value adopted by the browser matches the access status of the webpage pointed to by the link target, the target rendering process is to render the link tag once;
[0128] A modification module 102 is configured to modify the link target of the link tag to a target web page, and trigger the browser to perform the target rendering process for the link tag again;
[0129] A first determining module 103 is configured to determine a target number of times for rendering the link tag in the target rendering process being performed this time;
[0130] The second determining module 104 is configured to determine the access status of the target webpage according to the target number of times.
[0131] The web page access status determination device provided by the embodiment of the present disclosure can determine the access status of a target web page after a user accesses a specified web page without obtaining the style attributes of the link through the browser or installing a plug-in in the browser.
[0132] Optionally, the first determining module 103 is further configured to:
[0133] Monitor the rendering time of each frame within a preset number of frames of the browser;
[0134] Determining a target number of frames greater than a preset duration threshold from the rendering duration of each frame;
[0135] The target number of times the link tag is rendered in the target rendering process is determined according to the target number of frames.
[0136] Optionally, there are multiple link tags, and the preset duration threshold and the preset number of frames are both positively correlated with the number of the link tags.
[0137] Optionally, the modification module 102 is further configured to:
[0138] By adjusting the style attribute of the link tag, the browser is triggered to perform the target rendering process on the link tag again.
[0139] Optionally, the modification module 102 is further configured to:
[0140] Adjusting the first style attribute of the link tag from a first preset style value to a second preset style value;
[0141] The first style attribute is adjusted from the second preset style value back to the first preset style value.
[0142] Optionally, there are multiple target web pages, and the modification module 102 is further configured to:
[0143] The link target is modified in turn according to each target web page, and each modification of the link target is performed after the access status of the target web page after the last modification is determined.
[0144] Optionally, the apparatus 100 further includes:
[0145] The execution module is used to cyclically execute the step of determining the access status of multiple target web pages during the browser accessing the designated web page, wherein each cycle includes the step of modifying the link target according to each target web page in turn.
[0146] Optionally, the creation module 101 is further configured to:
[0147] A link tag is created in the designated webpage, a link target of the link tag is set to point to the designated webpage, and a second style attribute of the link tag is set to a third preset style value so that the link tag is invisible in the designated webpage.
[0148] Optionally, the apparatus 100 further includes:
[0149] The acquisition module is used for acquiring the web page information to be monitored sent by the website server corresponding to the designated web page in response to the browser accessing the designated web page, and taking the web page in the web page information to be monitored as the target web page.
[0150] Optionally, the apparatus 100 further includes:
[0151] The sending module is used to send the access status of the target web page to the website server.
[0152] Regarding the apparatus in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0153] Based on the same inventive concept, an embodiment of the present disclosure further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which implements the steps of the above-mentioned method for determining the web page access status when executed by a processor.
[0154] Specifically, the computer-readable storage medium can be a flash memory, a hard disk, a multimedia card, a card-type memory (for example, an SD or DX memory, etc.), a random access memory (RAM), a static random access memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a disk, an optical disk, a server, a public cloud server, etc.
[0155] Regarding the computer-readable storage medium in the above embodiment, the steps of the method for determining the web page access status when the computer program stored thereon is executed have been described in detail in the embodiment of the method and will not be elaborated here.
[0156] Based on the same inventive concept, an embodiment of the present disclosure further provides an electronic device, the electronic device comprising:
[0157] a memory having a computer program stored thereon;
[0158] The processor is configured to execute the computer program in the memory to implement the steps of the above-mentioned method for determining the web page access status.
[0159] Figure 3 FIG. 2 is a block diagram of an electronic device 200 according to an exemplary embodiment. Figure 3 As shown, the electronic device 200 may include: a processor 201 , a memory 202 , and may further include one or more of a multimedia component 203 , an input / output (I / O) interface 204 , and a communication component 205 .
[0160] The processor 201 is used to control the overall operation of the electronic device 200 to complete all or part of the steps in the webpage access status determination method described above. The memory 202 is used to store various types of data to support the operation of the electronic device 200. For example, this data may include instructions for any application or method operating on the electronic device 200, as well as application-related data, such as contact information, sent and received messages, pictures, audio, video, etc. The memory 202 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The multimedia component 203 may include a screen and an audio component. The screen may be, for example, a touch screen, and the audio component is used to output and / or input audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signals may be further stored in the memory 202 or transmitted via the communication component 205. The audio component also includes at least one speaker for outputting audio signals. The I / O interface 204 provides an interface between the processor 201 and other interface modules. The aforementioned other interface modules may be a keyboard, a mouse, buttons, etc. These buttons may be virtual buttons or physical buttons. The communication component 205 is used for wired or wireless communication between the electronic device 200 and other devices. Wireless communication, such as Wi-Fi, Bluetooth, Near Field Communication (NFC), 2G, 3G, 4G or 5G, NB-IOT (Narrow Band Internet of Things), or a combination of one or more thereof, and therefore the corresponding communication component 205 may include: a Wi-Fi module, a Bluetooth module, and an NFC module.
[0161] In an exemplary embodiment, the electronic device 200 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to execute the above-mentioned method for determining the web page access status.
[0162] The preferred embodiments of the present disclosure are described in detail above in conjunction with the accompanying drawings. However, the present disclosure is not limited to the specific details of the above embodiments. Within the technical concept of the present disclosure, various simple modifications can be made to the technical solutions of the present disclosure, and these simple modifications all fall within the scope of protection of the present disclosure.
[0163] It should also be noted that the various specific technical features described in the above specific embodiments can be combined in any appropriate manner without contradiction. In order to avoid unnecessary repetition, the present disclosure will not further describe various possible combinations.
[0164] In addition, the various embodiments of the present disclosure may be arbitrarily combined, and as long as they do not violate the concept of the present disclosure, they should also be regarded as the contents disclosed by the present disclosure.
Claims
1. A method for determining a web page access status, characterized in that: The method comprises: Creating a link tag in a designated web page that has been visited by the browser, with the link target pointing to the designated web page, so as to trigger the browser to perform a target rendering process on the link tag; Wherein, when the rendering value adopted by the browser does not match the access status of the webpage pointed to by the link target, the target rendering process is to render the link tag twice so that the rendering value of the link tag adopted by the browser matches the access status of the webpage pointed to by the link target; when the rendering value adopted by the browser matches the access status of the webpage pointed to by the link target, the target rendering process is to render the link tag once; Modify the link target of the link tag to a target web page, and trigger the browser to perform the target rendering process for the link tag again; Determine a target number of times for rendering the link tag in the target rendering process being performed this time; Determining the access status of the target webpage according to the target number of times; The determining of the target number of times of rendering the link target in the target rendering process currently being performed includes: Monitor the rendering time of each frame within a preset number of frames of the browser; Determining a target number of frames greater than a preset duration threshold from the rendering duration of each frame; The target number of times the link tag is rendered in the target rendering process is determined according to the target number of frames.
2. The method according to claim 1, characterized in that There are multiple link tags, and the preset duration threshold and the preset number of frames are both positively correlated with the number of the link tags.
3. The method according to claim 1, characterized in that The triggering the browser to perform the target rendering process again on the link tag includes: By adjusting the style attribute of the link tag, the browser is triggered to perform the target rendering process on the link tag again.
4. The method according to claim 3, characterized in that Adjust the style attributes of the link tag as follows: Adjusting the first style attribute of the link tag from a first preset style value to a second preset style value; The first style attribute is adjusted from the second preset style value back to the first preset style value.
5. The method according to any one of claims 1 to 4, characterized in that There are multiple target web pages, and modifying the link target of the link tag to the target web page includes: The link target is modified in turn according to each target web page, and each modification of the link target is performed after the access status of the target web page after the last modification is determined.
6. The method according to claim 5, characterized in that The method further comprises: During the period when the browser accesses the designated web page, the step of determining the access status of the plurality of target web pages is executed cyclically, wherein each cycle includes the step of modifying the link target according to each target web page in turn.
7. The method according to any one of claims 1 to 4, characterized in that The step of creating a link tag in the designated webpage with the link target pointing to the designated webpage includes: A link tag is created in the designated webpage, a link target of the link tag is set to point to the designated webpage, and a second style attribute of the link tag is set to a third preset style value so that the link tag is invisible in the designated webpage.
8. The method according to any one of claims 1 to 4, characterized in that The method further comprises: In response to a browser accessing a designated web page, obtaining information of a web page to be monitored sent by a website server corresponding to the designated web page, and using a web page in the information of the web page to be monitored as the target web page; The method further comprises: The access status of the target web page is sent to the website server.
9. A device for determining a web page access status, characterized in that: The device comprises: A creation module, configured to create a link tag in a designated web page that has been visited by the browser, the link target of which points to the designated web page, so as to trigger the browser to perform a target rendering process on the link tag; Wherein, when the rendering value adopted by the browser does not match the access status of the webpage pointed to by the link target, the target rendering process is to render the link tag twice so that the rendering value of the link tag adopted by the browser matches the access status of the webpage pointed to by the link target; when the rendering value adopted by the browser matches the access status of the webpage pointed to by the link target, the target rendering process is to render the link tag once; A modification module, configured to modify the link target of the link tag to a target web page, and trigger the browser to perform the target rendering process for the link tag again; A first determining module is used to determine a target number of times of rendering the link tag in the target rendering process being performed this time; A second determining module, configured to determine the access status of the target webpage according to the target number of times; The first determining module is further configured to: Monitor the rendering time of each frame within a preset number of frames of the browser; Determining a target number of frames greater than a preset duration threshold from the rendering duration of each frame; The target number of times the link tag is rendered in the target rendering process is determined according to the target number of frames.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.
11. An electronic device, characterized in that: include: a memory having a computer program stored thereon; A processor, configured to execute the computer program in the memory to implement the steps of the method according to any one of claims 1 to 8.