CN115878926A - Method and device for acquiring page error information - Google Patents

Method and device for acquiring page error information Download PDF

Info

Publication number
CN115878926A
CN115878926A CN202111152274.9A CN202111152274A CN115878926A CN 115878926 A CN115878926 A CN 115878926A CN 202111152274 A CN202111152274 A CN 202111152274A CN 115878926 A CN115878926 A CN 115878926A
Authority
CN
China
Prior art keywords
page
designated
information
file
specified
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
CN202111152274.9A
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.)
Beijing Kingsoft Cloud Network Technology Co Ltd
Original Assignee
Beijing Kingsoft Cloud Network Technology 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 Beijing Kingsoft Cloud Network Technology Co Ltd filed Critical Beijing Kingsoft Cloud Network Technology Co Ltd
Priority to CN202111152274.9A priority Critical patent/CN115878926A/en
Publication of CN115878926A publication Critical patent/CN115878926A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • User Interface Of Digital Computer (AREA)

Abstract

The application relates to a method and a device for acquiring page fault information, which can at least store the page fault information to the local of a page display end and reduce the possibility of losing the page fault information under the condition that the event possibly causing the loss of the page fault information occurs. In addition, the speed of reading and writing the locally stored data by the page display end is high, so that the time consumed for locally storing page error information at the page display end can be avoided from obviously influencing the experience of a user. Furthermore, the specified file in the specification is stored in the page server in advance, and when the page server sends the page information file to the page display end, the specified file is sent to the page display end, so that the page display end can effectively perform corresponding processing on the monitored page fault information in the whole page display process, and the comprehensiveness of acquiring the page fault information is favorably improved.

Description

Method and device for acquiring page error information
Technical Field
The present application relates to the field of data processing technologies, and in particular, to a method and an apparatus for acquiring page fault information.
Background
With the advent of the network age, users can access data and other software resources of a server on a local area network or the internet through a network by using a page display end to realize data interaction so as to obtain more information. Data provided by a network access local area network, the internet, or other software resources is typically presented to a user in the form of pages.
The page presenting end usually accompanies the occurrence of events, such as mouse events, form events, etc., in the process of presenting the page to the user. The result caused by the occurrence of the event can show the display effect of the page to a certain extent, and it is necessary to collect data capable of representing the result of the event.
Disclosure of Invention
The application provides a method and a device for acquiring page fault information, which aim to solve the problem that the page fault information is difficult to collect comprehensively in the prior art.
In a first aspect, the present application provides a first method for acquiring page fault information, where the method is applied to a page server, and the method includes: receiving a page access request; responding to a page access request, and determining a page information file and a designated file, wherein the page information file represents information displayed by a first designated page, and the designated file represents designated events needing monitoring in the process of displaying the first designated page; and sending the page information file and the specified file to a page display end so that in each page displayed by the page display end, if the page display end receives a page closing instruction for closing the first specified page under the condition that the page managed by the page server end only contains the first specified page, storing page fault information which is monitored by the specified event and is not sent to the page server end to a local specified position of the page display end, and then closing the first specified page.
In an optional embodiment of the present description, the method further comprises at least one of:
specifying events includes: an error event;
specifying events includes: an unhandledrejection event;
the specifying the location includes: localstorage.
In an optional embodiment of this specification, after sending the page information file and the designated file to the page display end, the method further includes:
and receiving page error information sent by a page display end.
In a second aspect, the present application provides a second method for acquiring page fault information, where the method is applied to a page display end, and the method includes: receiving a page information file and a specified file; displaying a first designated page corresponding to the page information file; monitoring a specified event represented by a specified file; in the case that the page managed by the page server only includes the first designated page in the pages being displayed, if the page display end receives a page close instruction for closing the first designated page, the page display end stores the page fault information which is monitored by the designated event and is not sent to the page server to a local designated position of the page display end, and then closes the first designated page.
In an alternative embodiment of the present specification, after listening for a specified event represented by a specified file, the method further comprises: receiving a page closing instruction for closing the first designated page, and judging whether target information exists, wherein the target information is page error information which is monitored aiming at a designated event of the first designated page and is not sent to a page server; if so, judging whether each page currently being displayed comprises a second appointed page, wherein the second appointed page is a page which is acquired from the page server and is except the first appointed page; if the second appointed page is included, the target information is sent to the page server side in the process of displaying the second appointed page; and if the second designated page is not included, displaying prompt information for delaying closing of the page.
In an optional embodiment of this specification, after presenting the prompt to delay the closing of the page, the method further includes: judging whether historical error information is read at the specified position, wherein the historical error information is page error information stored when a page acquired from a page server is displayed historically; and if so, sending the historical error information to the page server.
In an optional embodiment of this specification, after sending the historical error information to the page server, the method further includes:
and deleting the historical error information stored in the specified position.
In an optional embodiment of the present description, the method further comprises at least one of:
specifying events includes: an error event;
specifying events includes: an unhandledrejection event;
the specifying the location includes: localstorage.
In a third aspect, the present application provides a first apparatus for acquiring page fault information, where the apparatus is applied to a page server, and the apparatus includes:
a first receiving module configured to: receiving a page access request;
a response module configured to: responding to a page access request, and determining a page information file and a designated file, wherein the page information file shows information displayed by a first designated page, and the designated file shows a designated event needing to be monitored in the process of displaying the first designated page;
a first transmitting module configured to: sending a page information file and an appointed file to a page display end so that in each page displayed by the page display end, if a page display end receives a page closing instruction for closing the first appointed page under the condition that the page managed by the page server end only contains the first appointed page, page error information which is monitored by the appointed event and is not sent to the page server end is stored to a local appointed position of the page display end, and then closing the first appointed page.
In a fourth aspect, the present application provides a second apparatus for acquiring page fault information, where the apparatus is applied to a page display end, and the apparatus includes:
a second receiving module configured to: receiving a page information file and a designated file;
a presentation module configured to: displaying a first designated page corresponding to the page information file;
a listening module configured to: monitoring a specified event represented by a specified file;
a page close module configured to: in the case that the page managed by the page server only includes the first designated page among the pages being displayed, if a page closing instruction for closing the first designated page is received, the page fault information which is monitored by the designated event and is not sent to the page server is stored in a local designated position of the page display terminal, and then the first designated page is closed.
In a fifth aspect, the present application provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete communication with each other through the communication bus;
a memory for storing a computer program;
and the processor is used for realizing the step of the method for acquiring the page fault information in the first aspect or the step of the method for acquiring the page fault information in the second aspect when the program stored in the memory is executed.
In a sixth aspect, the present application provides a computer-readable storage medium, on which a computer program is stored, wherein the computer program, when executed by a processor, implements the steps of the method for acquiring any one of the page fault information in the first aspect, or implements the steps of the method for acquiring any one of the page fault information in the second aspect.
Compared with the prior art, the technical scheme provided by the embodiment of the application has the following advantages:
in the method and the device for acquiring the page fault information in the present specification, when a matter that may cause the loss of the page fault information occurs, the page fault information can be stored at least in the local of the page display end, so that the possibility of the loss of the page fault information is reduced. In addition, the speed of reading and writing the page display end to the local part of the page display end is high, so that the time consumed for storing page error information at the local part of the page display end can be avoided from obviously influencing the experience of a user. Furthermore, the designated file in the specification is stored in the page server in advance, and when the page server sends the page information file to the page display end, the designated file is sent to the page display end, so that the page display end can effectively perform corresponding processing on the monitored page fault information in the whole page display process, and the comprehensiveness of obtaining the page fault information is improved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention.
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without inventive exercise.
Fig. 1 is a scene schematic diagram related to a process of acquiring page fault information according to an embodiment of the present disclosure;
fig. 2 is a schematic flowchart of a process for acquiring page fault information according to an embodiment of the present disclosure;
fig. 3 is a schematic flowchart of at least part of steps in an acquisition process of page fault information according to an embodiment of the present application;
FIG. 4 is a schematic diagram of a first apparatus for acquiring page fault information corresponding to a part of the process steps of the method of FIG. 2;
FIG. 5 is a diagram of a second apparatus for acquiring page fault information corresponding to a portion of the steps of the method of FIG. 2;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present application without making creative efforts shall fall within the protection scope of the present application.
Illustratively, the method for acquiring page fault information in this specification is used for acquiring page fault information in a process of presenting a page to a user. In this specification, a page (or called "web page") is a basic element constituting a website, and is a platform for carrying various website applications. A page is a plain text file containing HTML tags that can be stored in a certain page server, is a "page" in the world wide web, and is in hypertext markup language format (an application of standard universal markup language, with the file extension being HTML or htm). Pages typically provide drawings with image files. The page is displayed through the page display end.
The page display end usually accompanies the occurrence of events, such as mouse events, form events, etc., during the process of displaying the page. The result caused by the occurrence of the event can show the display effect of the page to a certain extent. If the result caused by the event is normal, the page display effect is good, and the result caused by the event does not need to be processed; if the result caused by the occurrence of the event is wrong, it indicates that there is a problem in the page display, records the wrong result (the wrong result may be recorded as "page fault information" in this specification), and saves the record for the web page developer to take corresponding measures. If the record of the characterization error is not saved, the error cannot be perceived by the developer of the web page, and the problem causing the error cannot be handled, and the problem may occur again in the subsequent access process of the web page. It can be seen that it is essential to collect data that can characterize the outcome of an event.
In view of this, in order to solve the problem in the prior art that it is difficult to collect page fault information more comprehensively, the present specification provides a method for acquiring page fault information.
The method for acquiring page fault information in the specification relates to a page server and a page display. The page server is used for maintaining and managing pages, and developers of the pages can store the pages in the page server after completing the development of the pages. The page server is in communication connection with the page display end, and the page display end is used for accessing the page server and displaying the pages stored in the page server to the user.
The specification does not limit the specific distribution mode of the page server, for example, the page server may be a certain server; for another example, the page server may also be a cluster consisting of several servers.
The present specification does not specifically limit the type of the page displaying end, for example, the page displaying end may be an Application (APP) with a page displaying function, such as a page browser; for another example, the page displaying terminal may be a terminal having a displaying interface. In addition, the type of the page server can be determined according to actual requirements.
The terminal in this specification may include: user Equipment (UE), such as a mobile phone (mobile phone), a tablet (pad), a desktop computer, an earphone, a stereo, etc.; the method can also comprise the following steps: machine smart devices such as self-driving (self-driving) devices, transportation safety (transportation safety) devices, smart home devices (e.g., one or more of audio-video devices, security devices, smart lighting devices, environment monitoring devices, etc.), virtual Reality (VR) terminal devices, augmented Reality (AR) terminal devices, machine Type Communication (MTC) devices, industrial control (industrial control) devices, remote medical (remote medical) devices, smart grid (smart grid) devices, city (city) devices; wearable devices such as smart watches, smart bracelets, smart glasses, pedometers, and the like may also be included.
In the process of acquiring the page fault information in this specification, the page server may simultaneously provide a plurality of (one or more) page display terminals to access the pages stored by the page server, and exemplarily, as shown in fig. 1, the page display terminals 1 to n are respectively in communication connection with the page server. The following describes a method for acquiring page fault information in this specification, taking any one of n page display ends as an example.
As shown in fig. 2, the method for acquiring page fault information in this specification includes the following steps:
s200: the page server receives a page access request.
The page access request in this specification is used to obtain data required for displaying the first designated page from the page server.
In an alternative embodiment of the present specification, the page access request may be sent from the page display side to the page server side. Specifically, the page display end analyzes the acquired website (for example, a user may perform input of a specific website to enable the page display end to acquire the website), so as to determine a domain name corresponding to the website. In this specification, a web address may be data having a certain format. The page display end establishes communication connection (for example, TCP connection) with the page server end corresponding to the domain name. And the page display end sends the page access request to the page server end corresponding to the domain name through the established communication connection.
Illustratively, the page access request may be a text-oriented HTTP request message. The HTTP request message may include several fields formed from ASCII code strings, and the lengths of the different fields may be different. Specifically, the HTTP request packet may include: request line (request line), request header (header), null line, and request data.
S202: and the page server side responds to the page access request and determines the page information file and the specified file.
In this specification, the page server stores pages in the form of a page information file, which may be a collection of data constituting the pages. The data making up the page may be carried in code. One of the functions of the page display end is to translate the page information file in the code form into information such as graphics and text which can be received by a user. The present specification does not specifically limit the type of code constituting a page, and for example, the type of code may include at least one of: HTML, javaScript, ASP, PHP, CGI, servlet. The page information file is an HTML file for a page written by an HTML code.
In an optional embodiment of this specification, the page information file and the designated file may be stored locally in the page server, and the page server may perform a search for data stored locally therein to determine the page information file and the designated file. In another optional embodiment of this specification, the page information file and the specified file may be stored in a storage server, and the page server may, in response to the page access request, find out, from a source data service file locally stored by the page server, a storage location of data corresponding to the page access request in the storage server, as a target location. And accessing the target position to determine the page information file and the specified file from the target position.
The file specified in the specification is a file required by the process of monitoring the page by the page display end. The designated file represents designated events (such as, for example, keyboard events, mouse click events, etc.) that need to be listened to in the process of presenting the first designated page. In addition, in an optional embodiment of the present specification, the specified file includes a first specified script (for example, the first specified script may be a Javascript file) that needs to be executed when the page display end monitors a specified event. In this specification, a "designated page" is a page corresponding to a designated file.
The specified file in the specification can be written by a developer of the page and stored to the page server before the step is executed.
S204: and the page server sends the page information file and the specified file to the page display end.
In this specification, after the communication connection is established between the page server and the page display terminal, if the connection between the page server and the page display terminal is not interrupted because no matter affecting the effectiveness of the communication connection occurs, the page server may send the page information file and the designated file to the page display terminal through a communication link formed by the communication connection between the page server and the page display terminal. Wherein the event affecting the effectiveness of the communication connection may comprise at least one of: and the user closes the page, breaks the network and disconnects the communication connection of the page display end based on the page display logic of the user.
Illustratively, the disconnection of the communication connection by the page showing end based on the page showing logic of the page showing end may include: after the communication connection between the page display end and the page server end is established, if the page display end does not receive a response file sent by the page server end within a specified time period, the connection is disconnected, and the response file can comprise a page information file; if the time length of the page displayed by the page display end and maintained by the page server in the last order of the display order (namely, the time length of the page in the Z sequence) exceeds the preset specified time length, the page display end disconnects the communication connection with the page server end, and the like.
In an alternative embodiment of the present specification, the page information file and the specific file may be sent to the page presentation side in a single data packet. In another optional embodiment of this specification, the page information file may be sent to the page display end in a first data packet manner, and the designated file may be sent to the page display end in a second data packet manner.
S206: the page display end receives the page information file and the specified file.
S208: and the page display end displays a first appointed page corresponding to the page information file.
After the page information file is received, the page display end can process the data in the page information file to obtain a page which can be displayed to a user.
Generally, the process of page presentation is time-continuous, i.e., the page presentation is not completed in a moment. The length of the display time period related to the display in this step needs to be determined according to the actual situation.
Furthermore, page display can be realized under certain conditions, for example, after the page loading is completed, all information in the page can be displayed. The term "presentation" in this specification includes the process of loading a page and/or the process of presenting all the information in a page to a user after loading is complete.
Where "show" is the process of loading a page, the event may be an event resulting from loading text, an event resulting from loading a pull-down control, or the like.
When "show" is the process of showing all the information in a page to a user after the loading is completed, the event may be a mouse event generated by the user clicking a mouse, or the like.
S210: and the page display end monitors a specified event shown by a specified file.
After receiving the specified file, the page display end analyzes the identifier of the event which needs to be monitored when the first specified page is displayed from the specified file, and the identifier is used as the identifier of the specified event. In the process of displaying the first designated page by the page displaying terminal, the page displaying terminal listens for an event (i.e., a designated event) which occurs in the process of displaying the first designated page and has an identifier matching (e.g., identical) with that of the designated event.
The snoop data indicates the result of the occurrence of the specified event by snooping the specified event. If the result indicates that an error occurred in the specified event (e.g., a mouse event was heard, but the pull-down control to which the mouse event is directed is not responsive), the snoop data indicating the result may be used as page error information in this specification.
S212: in the case that the page managed by the page server only includes the first designated page among the pages being displayed, if a page closing instruction for closing the first designated page is received, the page fault information which is monitored by the designated event and is not sent to the page server is stored in a local designated position of the page display terminal, and then the first designated page is closed.
When the page fault information is monitored, if the page fault information cannot be saved, the page fault information may be lost.
In order to avoid the loss of page fault information and ensure that the page fault information can be stored at least locally at a page display end, a page display end in the description is based on a specified file in each page being displayed at the page display end, and under the condition that a page managed by a page server only comprises a first specified page, if the page display end receives a page closing instruction for closing the first specified page, the page fault information which is monitored aiming at a specified event and is not sent to the page server is stored to a specified position locally at the page display end, and then the first specified page is closed.
In an optional embodiment of this specification, the specified file includes a first specified script, and when the page display end displays the first specified page (that is, when the specified file includes the first specified script, and the page display end executes the first specified script), if a page close instruction is received, it is determined whether a second specified page is included in each page being displayed, except for the first specified page targeted by the page close instruction. If the judgment result is negative, storing the page fault information which is monitored aiming at the specified event and is not sent to the page service end to a local specified position of the page display end. And then judging whether the storage is finished or not, and if the storage is finished, closing the first appointed page.
Illustratively, the specified location includes, but is not limited to, localstorage.
It should be noted that, for whether the page fault information that has been sent to the page server needs to be stored locally at the page display end, the process in this specification does not make specific requirements.
Step S210 may be performed simultaneously with step S208. So as to monitor for a specified event during the process of loading the page and/or showing all information in the page to the user.
Therefore, in the process in the present specification, even if a matter that may cause the loss of the page fault information occurs in the case of monitoring the page fault information, the page fault information can be at least stored locally at the page display end, so that the possibility of the loss of the page fault information is reduced. In addition, the speed of reading and writing the page display end to the local part of the page display end is high, so that the time consumed for storing page error information at the local part of the page display end can be avoided from obviously influencing the experience of a user. Furthermore, the designated file in the specification is stored in the page server in advance, and when the page server sends the page information file to the page display end, the designated file is sent to the page display end, so that the page display end can effectively perform corresponding processing on the monitored page fault information in the whole page display process, and the comprehensiveness of obtaining the page fault information is improved.
In an optional embodiment of this specification, the specified event monitored by the page display end may include an error event and/or an unhandredobjection event. Aiming at monitoring of error events, page fault information in a synchronous method, an asynchronous method and a page loading process can be obtained; and for monitoring the unhandledrejection event, page fault information corresponding to the premium can be obtained, so that the page fault information in the whole page display process can be further acquired.
Furthermore, for items implemented based on vue, page error information can be listened to using vue. And for items implemented based on the act, the componentDidCatch can be adopted to listen for page fault information.
In general, a page server maintains and manages several pages simultaneously, and two (e.g., a first designated page and a second designated page) or more pages of the several pages correspond to a designated file.
Illustratively, domain names typically have the following format www. < user name > < secondary domain name > < primary domain name >. A domain name may correspond to a plurality of pages, for example, "www.xyz.com/1" (hereinafter referred to as page 1) and "www.xyz.com/2" (hereinafter referred to as page 2). Because the user names, the secondary domain names and the primary domain names of the pages 1 and 2 are the same, the pages 1 and 2 are usually maintained and managed by the same page server, and the pages 1 and 2 can both correspond to the designated files. Under the condition that the page 1 and the page 2 are displayed at the page display end, the page 1 can be a first designated page, and the page 2 can be a second designated page.
In the process of this specification, after the page display end closes the first designated page, if the page display end receives the designated file corresponding to the second designated page, the page display end may send page fault information (i.e., historical page fault information) stored in the designated position and collected in the first designated page display process to the page server end when displaying the second designated page (i.e., when the designated file includes the first designated script, and when the page display end executes the first designated script corresponding to the second designated page).
Optionally, when the page fault information is stored to the specified position, the page display end adds the time when the fault occurs to the page fault information. If two or more than two pieces of historical error information are stored in the designated position, the time of the error occurrence corresponding to the historical error information can be identified for each piece of historical error information, and the historical error information is sequentially sent according to the time sequence from first to last or from last to first and the sequence after the sequence.
In addition, after the first specified page that is displayed first is closed, if the page display end receives the specified file corresponding to the first specified page again, the page display end may send the page fault information (i.e., the historical fault information) stored in the specified location and collected in the process of displaying the first specified page that is displayed first to the page service end when the first specified script corresponding to the first specified page that is displayed later is displayed (i.e., when the specified file includes the first specified script, the page display end executes the first specified script corresponding to the first specified page that is displayed later).
In this embodiment, not only can the page fault information be at least acquired to the local of the page display end to avoid the loss of the page fault information, but also the page fault information can be sent to the page server end, so that the page server end can manage and maintain the page based on the page fault information.
Optionally, when the page display end runs the specified file, for each piece of historical error information stored in the specified location, after the page display end sends the historical error information to the page server, the historical error information is determined as sent error information. And then deleting the sent error information stored in the designated position so as to avoid occupying the local storage space of the page display end and avoid repeated sending of the sent error information.
In order to search the historical error information from the designated position more efficiently, in a further optional embodiment of the present specification, the page display end uses the domain name of the first designated page as the identifier of the page error information when storing the page error information to the designated position. When the first designated page is displayed again or when the second designated page is displayed, in the identifiers stored in the designated position, the identifier with the matching degree of the first designated page or the second designated page displayed again being greater than the threshold value of the matching degree is searched to be used as the designated identifier. And taking the page error information corresponding to the specified identification as historical error information.
The process of determining the matching degree may be to, for each identifier stored in the designated location, determine whether the user name, the primary domain name, and the secondary domain name of the identifier are the same as the user name, the primary domain name, and the secondary domain name of the identifier displayed on the first designated page again or the user name, the primary domain name, and the secondary domain name displayed on the second designated page are the same, respectively. If the judgment result is yes, the matching degree of the first appointed page or the second appointed page displayed again and the mark is determined to be larger than the threshold value of the matching degree. If the judgment result is negative, the matching degree of the first appointed page or the second appointed page displayed again and the identification is determined to be not more than the threshold value of the matching degree.
In some cases, the page presenting end presents the first designated page to the user and presents the second designated page to the user. In an optional embodiment of the present specification, in each page being displayed by the page display end, when the page acquired from the page server includes a second designated page in addition to the first designated page, if the page display end receives a page close instruction for closing the first designated page, the page display end sends, to the page server, page fault information that is monitored for the designated event and that has not been sent to the page server, and when the page display end displays the second designated page, the page fault information is sent to the page server.
In this embodiment, when the second designated page is displayed, the page fault information collected for the first designated page is sent to the page server, so that the page server can acquire the page fault information collected for the first designated page relatively in time.
Specifically, as shown in fig. 3, a process of monitoring a specified event by a page showing end in this specification (that is, a process of running a specified script by the page showing end when a specified file includes a first specified script) may be:
s300: and taking the identifier of the event represented by the specified file as the identifier of the specified event.
S302: and calling an event monitor matched with the identifier of the specified event for monitoring to obtain page fault information aiming at the specified event.
S304: a page close instruction to close the first specified page is received.
S306: and judging whether the target information exists or not, and if so, executing the step S308. If the determination result is negative, step S314 is executed.
The target information is page fault information which is monitored by aiming at a specified event of the first specified page and is not sent to the page server.
S308: and judging whether each page currently being displayed comprises a second appointed page or not, and if so, executing the step S310. If the determination result is negative, step S312 is executed.
S310: and in the process of displaying the second designated page, sending the target information to the page server. Step S314 is performed.
Through the step, the page fault information which is monitored by the appointed event and is not sent to the page server side can be sent to the page server side when the second appointed page is displayed by the page display side.
S312: after the target information is stored in the local designated location of the page display end, step S314 is executed.
In the embodiments, the page display end stores the page fault information to the local, so that the page storage information can be efficiently stored. However, in the actual page display process, there may be a phenomenon that the efficiency of storing the page fault information to the designated position is affected due to the problem of the page display end itself. At this time, the storage of the target information may be slow due to the problem at the page display end.
In view of this, in an optional embodiment of the present specification, in a case that the determination result in step S308 is negative, the prompt information of the delayed page closing is displayed to prompt the user to reduce a negative impact on the user experience, and after the execution of step S312 is completed, the display of the prompt information for the delayed page closing is stopped. In the embodiment, the page display end stores the page fault information to the designated position and simultaneously displays the prompt message to the user so as to inform the current state of the user, and the problem of poor user experience caused by delaying the closing of the first designated page is solved.
S314: the first designated page is closed.
In an actual page display scenario, the reason that the user closes the first specific page may be that the user has finished browsing the first specific page, and the reason that the user closes the first specific page may also be that the user abandons browsing the first specific page due to a factor (for example, browser jamming) of the page display end itself. If the user gives up browsing the first designated page due to the self-reason of the page display end, the user may give up browsing the second designated page based on the same reason.
In view of this, in another optional embodiment of this specification, on one hand, page fault information collected for a first specified page is stored in a specified location, and on the other hand, page fault information that is monitored by a specified event and has not been sent to a page server is sent to the page server when a first specified script corresponding to a second specified page is run by a page display side. And when the second designated page is displayed, deleting the page fault information which is stored in the designated position and collected aiming at the first designated page under the condition that the page fault information aiming at the first designated page is all sent to the page server.
In this embodiment, for the problem that the page fault information cannot be sent to the page server due to the fact that the user closes the designated page due to poor performance of the page display end, the process in this specification, on one hand, sends the page fault information collected for the first designated page to the page server when displaying the second designated page, which is beneficial to improving timeliness of data acquisition; on the other hand, the page fault information collected aiming at the first designated page is timely stored to the designated position, and the page fault information loss caused by the self problem of the page display end can be effectively avoided.
In the foregoing embodiments, even if the user closes the first designated page, the page display end can store the page fault message to the local designated location, so as to avoid the phenomenon of page fault information loss. That is to say, in the foregoing embodiments, at least the page fault information can be acquired by the page display terminal.
In general, the maintenance and management of pages are performed by a page server. In order to enable the page server to obtain the page fault information stored in the local page display end, in an optional embodiment of this specification, when the page display end displays the page managed by the page server again (that is, when the first specified script is executed again by the page display end under the condition that the specified file includes the first specified script), the data stored in the local specified position of the page display end is read. And if historical error information stored when the page acquired from the page server is displayed historically is read at the specified position, sending the historical error information to the page server.
In this specification, there may be various occasions for triggering reading of the history error information locally stored at the page presentation end.
In an optional embodiment of the present description, after the prompt information for delaying the closing of the page is displayed in step S312, it may be determined whether historical error information is read at the specified location, where the historical error information is page error information stored when the page acquired from the page server is historically displayed, if yes, the historical error information is sent to the page server, and if not, after the execution of step S312 is completed, step S314 is executed.
In the embodiment, the first designated page can be preferentially displayed, and the display effect of the first designated page caused by the fact that the historical error information is read to occupy the resources of the page display end is avoided.
In another alternative embodiment of the present specification, the reading of the locally stored historical error information may be performed when step S210 is performed. In this embodiment, the historical error information locally stored by the page display terminal can be sent to the page server as soon as possible, so that the page server can process the historical error information in a relatively timely manner, optionally, the sent historical error information is deleted after the historical error information locally stored by the page display terminal is sent to the page server, and the local storage space of the page display terminal can be released as soon as possible.
In order to reasonably distribute resources of the page display end, on one hand, the page display effect is guaranteed, and on the other hand, historical error information can be sent to the page server end. In an optional embodiment of the present specification, the page display end determines, according to an instruction of the specified file, the number of the pages currently being displayed as an actual number (optionally, the specified file carries a second specified script, and the page display end may determine the actual number by running the second specified script). And judging whether the actual number is greater than a reference number, wherein the reference number can be a preset value, the reference number can be set by one of a page display end, a page service end and a user, and the specified file can carry the reference number under the condition that the reference number is set by the page service end. If yes, after the prompt message of delaying the page closing is displayed in step S312, it is determined whether the historical error information is read at the specified position. If not, in step S210, it is determined whether historical error information is read at the designated location.
Based on the same idea, the present specification further provides a device for acquiring first page fault information, where the device for acquiring first page fault information is applied to a page server, as shown in fig. 4, and the device for acquiring first page fault information includes one or more of the following modules:
a first receiving module 400 configured to: receiving a page access request;
a response module 402 configured to: responding to a page access request, and determining a page information file and a designated file, wherein the page information file shows information displayed by a first designated page, and the designated file shows a designated event needing to be monitored in the process of displaying the first designated page;
a first sending module 404 configured to: sending a page information file and an appointed file to a page display end so that in each page displayed by the page display end, if a page display end receives a page closing instruction for closing the first appointed page under the condition that the page managed by the page server end only contains the first appointed page, page error information which is monitored by the appointed event and is not sent to the page server end is stored to a local appointed position of the page display end, and then closing the first appointed page.
In an alternative embodiment of the present description, the specified events include: an error event.
In an alternative embodiment of the present description, the specified events include: an unhandledrejection event.
In an alternative embodiment of the present description, specifying the location includes: localstorage.
In an optional embodiment of this specification, the apparatus for obtaining the first page fault information may further include a third receiving module 406. The third receiving module 406 is configured to: and receiving page error information sent by a page display end.
Based on the same idea, the present specification further provides a device for acquiring second type of page fault information, where the device for acquiring second type of page fault information is applied to a page display side, as shown in fig. 5, and the device for acquiring second type of page fault information includes one or more of the following modules:
a second receiving module 500 configured to: receiving a page information file and a designated file;
a presentation module 502 configured to: displaying a first designated page corresponding to the page information file;
a listening module 504 configured to: monitoring a specified event represented by a specified file;
a page close module 506 configured to: in the case that the page managed by the page server only includes the first designated page among the pages being displayed, if the page display receives a page closing instruction for closing the first designated page, the page display stores page fault information which is monitored by a designated event and is not sent to the page server to a local designated position of the page display, and then closes the first designated page.
In an optional embodiment of this specification, the second apparatus for acquiring page fault information may further include a prompt information presentation module 508 in fig. 6. The reminder presentation module 508 is configured to: receiving a page closing instruction for closing a first designated page, and judging whether target information exists, wherein the target information is page error information which is monitored aiming at a designated event of the first designated page and is not sent to a page server; if yes, judging whether each page currently being displayed comprises a second appointed page, wherein the second appointed page is a page which is acquired from the page server and is except the first appointed page; if the second designated page is included, the target information is sent to the page server in the process of displaying the second designated page; and if the second appointed page is not included, displaying prompt information for delaying page closing.
In an optional embodiment of this specification, the second page fault information obtaining apparatus may further include a historical fault information sending module 510. The historical error information sending module 510 is configured to: judging whether historical error information is read at the specified position, wherein the historical error information is page error information stored when a page acquired from the page server is displayed historically; and if so, sending the historical error information to the page server.
In an optional embodiment of the present specification, the second apparatus for acquiring page fault information may further include a deleting module configured to delete the historical fault information stored in the designated location.
In an alternative embodiment of the present description, the specified events include: an error event.
In an alternative embodiment of the present description, the specified events include: an unhandledrejection event.
In an alternative embodiment of the present description, specifying the location includes: localstorage.
As shown in fig. 6, the embodiment of the present application provides an apparatus for acquiring page fault information, which includes a processor 111, a communication interface 112, a memory 113, and a communication bus 114, where the processor 111, the communication interface 112, and the memory 113 complete mutual communication through the communication bus 114,
a memory 113 for storing a computer program;
in an embodiment of the present application, the method for controlling the processor 111 to implement the acquisition of the page fault information provided in any one of the foregoing method embodiments when executing the program stored in the memory 113 includes:
the present application further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the step of obtaining the page fault information provided by any one of the foregoing method embodiments.
It is noted that, in this document, relational terms such as "first" and "second," and the like, may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrases "comprising one of 8230; \8230;" 8230; "does not exclude the presence of additional like elements in a process, method, article, or apparatus that comprises the element.
The foregoing are merely exemplary embodiments of the present invention, which enable those skilled in the art to understand or practice the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (12)

1. A method for acquiring page fault information is applied to a page server, and the method comprises the following steps:
receiving a page access request;
responding to the page access request, and determining a page information file and a designated file, wherein the page information file represents information displayed by a first designated page, and the designated file represents a designated event needing to be monitored in the process of displaying the first designated page;
and sending the page information file and the specified file to a page display end so that in each page displayed by the page display end, if the page display end receives a page closing instruction for closing the first specified page under the condition that the page managed by the page server end only contains the first specified page, storing page error information which is monitored by the specified event and is not sent to the page server end to a local specified position of the page display end, and then closing the first specified page.
2. The method of claim 1, further comprising at least one of:
the specified events include: an error event;
the specified events include: an unhandledrejection event;
the specified location includes: localstorage.
3. The method of claim 1, wherein after sending the page information file and the designated file to a page display side, the method further comprises:
and receiving page error information sent by the page display end.
4. A method for acquiring page fault information is applied to a page display end, and comprises the following steps:
receiving a page information file and a designated file;
displaying a first designated page corresponding to the page information file;
monitoring a specified event represented by the specified file;
in each page being displayed, if the page managed by the page server only includes the first designated page, if the page closing instruction for closing the first designated page is received, the first designated page is closed after page fault information which is monitored for the designated event and is not sent to the page server is stored to a local designated position of the page display terminal.
5. The method of claim 4, wherein after listening for a specified event represented by the specified file, the method further comprises:
receiving a page closing instruction for closing a first designated page, and judging whether target information exists, wherein the target information is page error information which is monitored aiming at a designated event of the first designated page and is not sent to a page server;
if yes, judging whether each page currently being displayed comprises a second appointed page, wherein the second appointed page is a page which is acquired from the page server and is except the first appointed page;
if the second designated page is included, the target information is sent to the page server in the process of displaying the second designated page;
and if the second appointed page is not included, displaying prompt information for delaying page closing.
6. The method of claim 5, wherein after presenting the hint information to delay page closing, the method further comprises:
judging whether historical error information is read at the specified position, wherein the historical error information is page error information stored when a page acquired from the page server is displayed historically;
and if so, sending the historical error information to the page server.
7. The method of claim 6, wherein after sending the historical error information to the page server, the method further comprises:
and deleting the historical error information stored in the specified position.
8. The method of claim 4, further comprising at least one of:
the specified event comprises: an error event;
the specified event comprises: an unhandledrejection event;
the specified location includes: localstorage.
9. An apparatus for acquiring page fault information, wherein the apparatus is applied to a page server, and the apparatus comprises:
a first receiving module configured to: receiving a page access request;
a response module configured to: responding to the page access request, and determining a page information file and a designated file, wherein the page information file represents information displayed by a first designated page, and the designated file represents a designated event needing to be monitored in the process of displaying the first designated page;
a first transmitting module configured to: and sending the page information file and the designated file to the page display end so that the first designated page is closed after page error information which is monitored aiming at the designated event and is not sent to the page server end is stored to a local designated position of the page display end if the page display end receives a page closing instruction for closing the first designated page under the condition that the page managed by the page server end only contains the first designated page.
10. An apparatus for acquiring page fault information, wherein the apparatus is applied to a page display side, and the apparatus comprises:
a second receiving module configured to: receiving a page information file and a designated file;
a presentation module configured to: displaying a first designated page corresponding to the page information file;
a listening module configured to: monitoring a specified event represented by the specified file;
a page close module configured to: in each page being displayed, if the page managed by the page server only includes the first designated page, if the page closing instruction for closing the first designated page is received, the first designated page is closed after page fault information which is monitored for the designated event and is not sent to the page server is stored to a local designated position of the page display terminal.
11. An electronic device is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for realizing mutual communication by the memory through the communication bus;
a memory for storing a computer program;
a processor for implementing the steps of the method for acquiring page fault information according to any one of claims 1 to 3, or the steps of the method for acquiring page fault information according to any one of claims 4 to 8, when executing a program stored in a memory.
12. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method for acquiring page fault information according to any one of claims 1 to 3, or the steps of the method for acquiring page fault information according to any one of claims 4 to 8.
CN202111152274.9A 2021-09-29 2021-09-29 Method and device for acquiring page error information Pending CN115878926A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111152274.9A CN115878926A (en) 2021-09-29 2021-09-29 Method and device for acquiring page error information

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111152274.9A CN115878926A (en) 2021-09-29 2021-09-29 Method and device for acquiring page error information

Publications (1)

Publication Number Publication Date
CN115878926A true CN115878926A (en) 2023-03-31

Family

ID=85756216

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111152274.9A Pending CN115878926A (en) 2021-09-29 2021-09-29 Method and device for acquiring page error information

Country Status (1)

Country Link
CN (1) CN115878926A (en)

Similar Documents

Publication Publication Date Title
US11201810B2 (en) Data transmission method and apparatus
US8788711B2 (en) Redacting content and inserting hypertext transfer protocol (HTTP) error codes in place thereof
US10198410B2 (en) Method, device and mobile terminal for restoring page
US7818289B2 (en) Network control system, network control method, and computer product
US8745202B2 (en) Tracking remote browser crashes via cookies
CN104426925B (en) Web page resources acquisition methods and device
CN110262807B (en) Cluster creation progress log acquisition system, method and device
CN110059269B (en) Page tracking method and device, electronic equipment and computer readable storage medium
CN105095280A (en) Caching method and apparatus for browser
CN109829121B (en) Method and device for reporting click behavior data
CN103412890A (en) Webpage loading method and device
CN103309728B (en) Asynchronous Request processing method and equipment
CN104935655A (en) Data presentation method and device
CN110535901A (en) Service degradation method, apparatus, computer equipment and storage medium
CN110032493A (en) Monitoring method, device, terminal and the readable storage medium storing program for executing of the page
CN109308239A (en) Method and apparatus for output information
CN111444103A (en) Automatic testing method for Web page and related equipment
US20140052851A1 (en) Systems and methods for discovering sources of online content
CN104731817B (en) A kind of webpage exhibiting method and device
CN111488257A (en) Cloud service link tracking monitoring method, device, equipment and storage medium
CN110881224B (en) Network long connection method, device, equipment and storage medium
CN111680247B (en) Local calling method, device and equipment of webpage character strings and storage medium
CN111538645B (en) Data visualization method and related equipment
CN115878926A (en) Method and device for acquiring page error information
CN111930548B (en) Fault simulation system for multi-cluster distributed service

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