A method and apparatus for obtaining page fault information

By storing page error information locally on the page display device, the problem of difficulty in comprehensively collecting page error information in existing technologies is solved, achieving more comprehensive error information acquisition and a better user experience.

CN115878926BActive Publication Date: 2026-07-03BEIJING KINGSOFT CLOUD NETWORK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING KINGSOFT CLOUD NETWORK TECH CO LTD
Filing Date
2021-09-29
Publication Date
2026-07-03

Smart Images

  • Figure CN115878926B_ABST
    Figure CN115878926B_ABST
Patent Text Reader

Abstract

The application relates to a page error information acquisition method and device. In the case of an event that may cause the page error information to be lost, the page error information can be stored in the local of a page display end at least, so that the possibility of the page error information being lost is reduced. In addition, since the reading and writing speed of the page display end for the locally stored data is high, the time consumed for storing the page error information in the local of the page display end can obviously affect the experience of a user. Further, the specified file in the specification is stored in a page server in advance. When the page server sends a 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 process the monitored page error information in the whole page display process, and the comprehensiveness of the page error information acquisition is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing technology, and in particular to a method and apparatus for obtaining page error information. Background Technology

[0002] With the advent of the internet age, users can use web-based interfaces to access data and other software resources on local area networks (LANs) or the internet, enabling data interaction and obtaining more information. Data accessed via LANs, the internet, or other software resources is typically presented to users in webpage format.

[0003] During the process of displaying a webpage to a user, events typically occur, such as mouse events and form events. The results of these events can, to some extent, indicate the page's display effect, making it essential to collect data that characterizes these event outcomes. Summary of the Invention

[0004] This application provides a method and apparatus for obtaining page error information, in order to solve the problem in the prior art that it is difficult to collect page error information comprehensively.

[0005] Firstly, this application provides a first method for obtaining page error information. This method is applied to a page server and includes: receiving a page access request; responding to the page access request, determining a page information file and a specified file, wherein the page information file represents information displayed on a first specified page, and the specified file represents a specified event that needs to be listened to during the display of the first specified page; sending the page information file and the specified file to a page display terminal, such that among the pages currently being displayed by the page display terminal, the pages managed by the page server only include the first specified page; if the page display terminal receives a page close instruction to close the first specified page, then after storing the page error information listened to for the specified event but not yet sent to the page server in a specified location locally on the page display terminal, the first specified page is closed.

[0006] In an optional embodiment of this specification, the method further includes at least one of the following:

[0007] Specified events include: error event;

[0008] The specified events include: the unhandledrejection event;

[0009] The specified location includes: localstorage.

[0010] In an optional embodiment of this specification, after sending the page information file and the specified file to the page display terminal, the method further includes:

[0011] Receive page error messages sent by the page display client.

[0012] Secondly, this application provides a second method for obtaining page error information. This method is applied to a page display end and includes: receiving a page information file and a specified file; displaying a first specified page corresponding to the page information file; listening to a specified event indicated by the specified file; and if, among the pages being displayed, the page managed by the page server only contains the first specified page, and if the page display end receives a page close instruction to close the first specified page, then the page error information listened to for the specified event but not yet sent to the page server is stored in a specified location on the local machine of the page display end before the first specified page is closed.

[0013] In an optional embodiment of this specification, after listening to the specified event represented by the specified file, the method further includes: receiving a page close instruction to close the first specified page; determining whether target information exists, wherein the target information is page error information listened to for the specified event of the first specified page and not yet sent to the page server; if so, determining whether the currently displayed pages include a second specified page, wherein the second specified page is a page obtained from the page server other than the first specified page; if the second specified page is included, sending the target information to the page server during the display of the second specified page; if the second specified page is not included, displaying a prompt message indicating delayed page closing.

[0014] In an optional embodiment of this specification, after displaying the prompt message indicating delayed page closing, the method further includes: determining whether historical error information is read at a specified location, wherein the historical error information is page error information stored when a page obtained from the page server was displayed in the past; if so, the historical error information is sent to the page server.

[0015] In an optional embodiment of this specification, after sending historical error information to the page server, the method further includes:

[0016] Delete historical error messages stored in the specified location.

[0017] In an optional embodiment of this specification, the method further includes at least one of the following:

[0018] Specified events include: error event;

[0019] The specified events include: the unhandledrejection event;

[0020] The specified location includes: localstorage.

[0021] Thirdly, this application provides a first type of device for obtaining page error information, which is applied to a page server and includes:

[0022] The first receiving module is configured to receive page access requests.

[0023] The response module is configured to: respond to a page access request, determine the page information file and the specified file, wherein the page information file represents the information displayed on the first specified page, and the specified file represents the specified events that need to be listened to during the display of the first specified page;

[0024] The first sending module is configured to send the page information file and the specified file to the page display terminal, so that if the page displayed terminal only contains the first specified page among the pages managed by the page server, and the page display terminal receives a page close instruction to close the first specified page, then it stores the page error information that has been listened to for the specified event and has not yet been sent to the page server in the specified location on the local machine of the page display terminal, and then closes the first specified page.

[0025] Fourthly, this application provides a second type of device for obtaining page error information, which is applied to the page display end and includes:

[0026] The second receiving module is configured to receive page information files and specified files.

[0027] The display module is configured to display the first specified page corresponding to the page information file;

[0028] The listening module is configured to listen for specified events displayed by a specified file.

[0029] The page closing module is configured as follows: If the page managed by the page server is only the first specified page among the pages currently being displayed, and a page closing instruction to close the first specified page is received, the page error information that has been listened to for the specified event but has not yet been sent to the page server will be stored in the specified location on the local machine of the page display terminal before the first specified page is closed.

[0030] Fifthly, this application provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus;

[0031] Memory, used to store computer programs;

[0032] When a processor executes a program stored in memory, it implements the steps of the method for obtaining any page error information in the first aspect, or the steps of the method for obtaining any page error information in the second aspect.

[0033] In a sixth aspect, this application provides a computer-readable storage medium having a computer program stored thereon, characterized in that, when the computer program is executed by a processor, it implements the steps of the method for obtaining any page error information in the first aspect, or the steps of the method for obtaining any page error information in the second aspect.

[0034] The technical solutions provided in this application have the following advantages compared with the prior art:

[0035] The method and apparatus for obtaining page error information described in this specification can, in the event of an event that could potentially cause the page error information to be lost, at least store the page error information locally on the page display terminal, reducing the possibility of page error information loss. Furthermore, since the page display terminal has a fast read and write speed to its local storage, the time spent storing page error information locally on the page display terminal can be avoided from significantly impacting the user experience. Moreover, the specified file in this specification is pre-stored on the page server. When the page server sends the page information file to the page display terminal, it also sends the specified file to the page display terminal, enabling the page display terminal to effectively process the detected page error information throughout the page display process, thus improving the comprehensiveness of page error information acquisition. Attached Figure Description

[0036] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0037] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0038] Figure 1 A schematic diagram illustrating a scenario involving the process of obtaining page error information as provided in an embodiment of this application;

[0039] Figure 2 A flowchart illustrating a process for obtaining page error information provided in an embodiment of this application;

[0040] Figure 3 A flowchart illustrating at least some steps in the process of obtaining page error information, as provided in an embodiment of this application;

[0041] Figure 4 For corresponding Figure 2 A schematic diagram of the device for obtaining the first type of page error information in the method process;

[0042] Figure 5 For corresponding Figure 2 A schematic diagram of the device for obtaining the second type of page error information in a step of the method process;

[0043] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0044] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0045] For example, the method for obtaining page error information in this specification is used to obtain page error information during the process of displaying a page to a user. A page (or "web page") in this specification is a basic element of a website and a platform that hosts various website applications. A page is a plain text file containing HTML tags. It can be stored on a web server and is a "page" on the World Wide Web. It is in Hypertext Markup Language format (an application of Standard Generalized Markup Language, with the file extension .html or .htm). Pages typically use image files to provide visuals. Pages are displayed through a web application.

[0046] During the display of a webpage, events typically occur, such as mouse events and form events. The results of these events can indicate the page's display effect to a certain extent. If the event results in a normal result, it indicates that the page display is good and no action is needed. However, if the event results in an error, it indicates a problem with the page display. This error should be recorded (this error can be recorded as "Page Error Message" in this manual) and saved so that the webpage developers can take appropriate measures. If this error is not recorded, the error will not be detected by the webpage developers, making it impossible to address the problem. The problem may recur in subsequent visits to the webpage. Therefore, collecting data that represents the results of events is essential.

[0047] In view of this, in order to solve the problem of the difficulty in collecting page error information comprehensively in the existing technology, this specification provides a method for obtaining page error information.

[0048] The method for obtaining page error information in this manual involves both the page server and the page display client. The page server is used to maintain and manage the page. After completing the page development, the page developers can store the page on the page server. The page server and the page display client communicate with each other. The page display client accesses the page server and displays the page stored on the page server to the user.

[0049] This manual does not restrict the specific distribution method of the page server. For example, the page server can be a single server; or, for another example, the page server can be a cluster consisting of several servers.

[0050] This specification does not impose specific restrictions on the type of page display client. For example, the page display client can be an application (APP) with page display capabilities, such as a web browser; another example is a terminal with a display interface. Furthermore, the type of page server can also be determined according to actual needs.

[0051] The terminals in this specification may include: user equipment (UE), such as mobile phones, tablets, desktop computers, headphones, speakers, etc.; they may also include: machine intelligence devices, such as self-driving devices, transportation safety devices, smart home devices (such as audio-visual devices, security devices, smart lighting devices, environmental monitoring devices, etc., one or more), virtual reality (VR) terminal devices, augmented reality (AR) terminal devices, machine type communication (MTC) devices, industrial control devices, remote medical devices, smart grid devices, smart city devices; and wearable devices, such as smartwatches, smart bracelets, smart glasses, pedometers, etc.

[0052] During the process of obtaining page error information in this specification, the page server can simultaneously allow multiple (one or more) page display clients to access the pages it stores. For example, such as... Figure 1 As shown, page display terminals 1 to n are respectively connected to the page server. The following explanation uses any one of the n page display terminals as an example to illustrate the method for obtaining page error information in this manual.

[0053] like Figure 2 As shown, the method for obtaining page error information in this manual includes the following steps:

[0054] S200: The page server receives page access requests.

[0055] The page access request in this specification is used to obtain the data required to display the first specified page from the page server.

[0056] In an optional embodiment of this specification, the page access request may be sent from the page display client to the page server. Specifically, the page display client parses the obtained URL (exemplarily, the user may input the URL to allow the page display client to obtain the URL) to determine the domain name corresponding to the URL. In this specification, the URL may be data with a certain format. The page display client establishes a communication connection (e.g., a TCP connection) with the page server corresponding to the domain name. The page display client sends the page access request to the page server corresponding to the domain name through the established communication connection.

[0057] For example, a page access request can be a text-based HTTP request message. An HTTP request message can include several fields formed from ASCII strings, with different fields having different lengths. Specifically, an HTTP request message can include: a request line, a request header, a blank line, and request data.

[0058] S202: The page server responds to the page access request and determines the page information file and the specified file.

[0059] In this specification, the page server stores the page in the form of a page information file, which can be a collection of data that constitutes the page. The data constituting the page can be in the form of code. One of the functions of the page display server is to "translate" the page information file in code form into graphics, text, and other information that can be received by the user. This specification does not specifically limit the type of code that constitutes the page; for example, the code type can include at least one of the following: HTML, JavaScript, ASP, PHP, CGI, and Servlet. For pages written using HTML code, the page information file is the HTML file.

[0060] In one optional embodiment of this specification, the page information file and the specified file can be stored locally on the page server. The page server can then search its locally stored data to determine the page information file and the specified file. In another optional embodiment of this specification, the page information file and the specified file can be stored on a storage server. In response to a page access request, the page server can search its locally stored source data service file to determine the storage location of the data corresponding to the page access request on the storage server, using this location as the target location. The target location is then accessed to determine the page information file and the specified file from that location.

[0061] The specified file in this specification is the file required by the page display terminal to listen to the page. The specified file indicates the specified events (e.g., keyboard events, mouse click events, etc.) that need to be listened to during the display of the first specified page. Furthermore, in an optional embodiment of this specification, the specified file contains a first specified script (e.g., a JavaScript file) that needs to be executed when the page display terminal detects the specified events. In this specification, "specified page" refers to the page corresponding to the specified file.

[0062] The specified files in this manual may be written by the page developers and stored on the page server before performing this step.

[0063] S204: The page server sends the page information file and the specified file to the page display client.

[0064] In this specification, after a communication connection is established between the page server and the page display client, if no event occurs that affects the validity of the communication connection, the connection between the page server and the page display client will not be interrupted. The page server can then send the page information file and a specified file to the page display client through the communication link formed by the communication connection between the page server and the page display client. Events that affect the validity of the communication connection may include at least one of the following: the user closes the page, the network connection is lost, or the page display client disconnects the communication connection based on its own page display logic.

[0065] For example, the page display client disconnecting the communication connection based on its own page display logic may include: after the page display client establishes a communication connection with the page server, if the page display client does not receive a response file sent by the page server within a specified time period, the connection is disconnected, and the response file may include a page information file; if the page displayed by the page display client and maintained by the page server is at the end of the display order (i.e., at the end in the Z sequence) for a period of time exceeding a preset specified time, the page display client disconnects the communication connection with the page server, etc.

[0066] In one optional embodiment of this specification, the page information file and the specified file can be sent to the page display terminal in the form of a single data packet. In another optional embodiment of this specification, the page information file can be sent to the page display terminal in the form of a first data packet, and the specified file can be sent to the page display terminal in the form of a second data packet.

[0067] S206: The page display terminal receives the page information file and the specified file.

[0068] S208: The page display terminal displays the first specified page corresponding to the page information file.

[0069] After receiving the page information file, the page display client can process the data in the page information file to obtain a page that can be displayed to the user.

[0070] Typically, the page display process is continuous over time; that is, it is not completed in an instant. Therefore, the length of the display period involved in this step needs to be determined based on the actual situation.

[0071] Furthermore, page display is only possible under certain conditions; for example, all information on the page can only be displayed after the page has finished loading. Therefore, "display" in this specification includes the process of loading the page and / or the process of displaying all information on the page to the user after loading is complete.

[0072] During the "display" phase, which is the process of loading a page, events can be generated by loading text, loading dropdown controls, etc.

[0073] When "display" refers to the process of showing the user all the information on the page after loading is complete, the event can be a mouse event generated by the user clicking the mouse, etc.

[0074] S210: The page display client listens for specified events represented by the specified file.

[0075] After receiving the specified file, the page display client parses the identifiers of the events to be listened to when displaying the first specified page, and uses these identifiers as the identifiers of the specified events. During the subsequent display of the first specified page, the page display client listens for events that occur during the display of the first specified page and whose identifiers match (e.g., are the same) the identifiers of the specified events (i.e., the specified events).

[0076] By listening to a specified event, the obtained listening data represents the result caused by the occurrence of the specified event. If the result indicates that an error occurred in the specified event (for example, a mouse event was detected, but the dropdown control to which the mouse event was triggered did not respond), then the listening data representing this result can be used as page error information in this specification.

[0077] S212: If the first specified page is the only page managed by the page server among the pages being displayed, and a page close instruction to close the first specified page is received, the page error information that has been listened to for the specified event but has not yet been sent to the page server will be stored in the specified location on the local page display terminal before the first specified page is closed.

[0078] If page error messages are not saved when they are detected, the page error messages may be lost.

[0079] To avoid the loss of page error information and ensure that page error information can be stored at least locally on the page display terminal, in this specification, if the page display terminal receives a page close command to close the first specified page, and the page error information that has been listened to for the specified event but has not yet been sent to the page server is stored in the specified location locally on the page display terminal before closing the first specified page.

[0080] In an optional embodiment of this specification, the specified file contains a first specified script. When the page display terminal displays the first specified page (that is, when the specified file contains the first specified script, the page display terminal executes the first specified script), if it receives a page close command, it determines whether the currently displayed pages, besides the first specified page targeted by the page close command, also include a second specified page. If the determination result is no, the page error information that has been listened to for the specified event but has not yet been sent to the page server is stored in a specified location on the local machine of the page display terminal. Then, it is determined whether the storage is complete. If the storage is complete, the first specified page is closed.

[0081] For example, the specified location includes, but is not limited to, localstorage.

[0082] It should be noted that this manual does not specify whether page error information that has been sent to the page server needs to be stored locally on the page display device.

[0083] Step S210 can be executed simultaneously with step S208. This allows for listening for specified events during the loading of the page and / or the display of all information on the page to the user.

[0084] As can be seen, the process described in this specification, even if an event occurs that could potentially cause the loss of page error information, can at least store the page error information locally on the page display client, reducing the possibility of page error information loss. Furthermore, since the page display client has a fast read and write speed to its local machine, it also avoids the time spent storing page error information locally on the page display client significantly impacting the user experience. Moreover, the specified file in this specification is pre-stored on the page server. When the page server sends the page information file to the page display client, it also sends the specified file to the page display client, enabling the page display client to effectively process the detected page error information throughout the page display process, thus improving the comprehensiveness of page error information acquisition.

[0085] In one optional embodiment of this specification, the specified events listened to by the page display client may include an error event and / or an unhandled rejection event. Listening to the error event allows for the acquisition of page error information during synchronous methods, asynchronous methods, and the page loading process; listening to the unhandled rejection event allows for the acquisition of page error information corresponding to promises, thereby further enabling the acquisition of page error information throughout the entire page display process.

[0086] In addition, for Vue-based projects, Vue.config.errorHandler can be used to listen for page error messages. For React-based projects, componentDidCatch can be used to listen for page error messages.

[0087] Typically, a page server maintains and manages several pages simultaneously, and two or more of these pages (e.g., the first specified page and the second specified page) correspond to specified files.

[0088] For example, a domain name typically has the following format: www.<username><second-level domain><first-level domain>. One domain name can correspond to multiple pages, for example, "www.XYZ.com / 1" (hereinafter referred to as page 1) and "www.XYZ.com / 2" (hereinafter referred to as page 2). Since page 1 and page 2 have the same username, second-level domain, and first-level domain, page 1 and page 2 are usually maintained and managed by the same page server, and both page 1 and page 2 can correspond to specific files. When both page 1 and page 2 are displayed on the page display platform, page 1 can be the first designated page, and page 2 can be the second designated page.

[0089] During the process described in this manual, if the page display terminal receives a specified file corresponding to the second specified page after closing the first specified page, the page display terminal can send the page error information (i.e., historical page error information) stored in the specified location and collected during the display of the first specified page to the page server when displaying the second specified page (that is, when the page display terminal executes the first specified script corresponding to the second specified page if the specified file contains the first specified script).

[0090] Optionally, when storing page error information in a designated location, the page display client can add the time of the error occurrence to the page error information. If two or more historical error messages are stored in the designated location, the time of the error occurrence corresponding to each historical error message can be identified, and the historical error messages can be sent sequentially according to the sorted order, either from first to last or from last to first.

[0091] In addition, after closing the first specified page that was previously displayed, if the page display client receives the specified file corresponding to the first specified page again, the page display client can send the page error information (i.e., historical error information) stored in the specified location and collected during the display of the first specified page that was previously displayed to the page server when displaying the subsequent first specified page (that is, when the specified file contains the first specified script, the page display client executes the first specified script corresponding to the subsequent first specified page).

[0092] In this embodiment, not only can page error information be obtained at least locally on the page display terminal to avoid loss of page error information, but page error information can also be sent to the page server so that the page server can manage and maintain the page based on the page error information.

[0093] Optionally, when the page display client runs the specified file, for each historical error message stored in the specified location, after sending the historical error message to the page server from the page display client, the historical error message is identified as a sent error message. Then, the sent error messages stored in the specified location are deleted to avoid occupying local storage space on the page display client and to prevent the resending of sent error messages.

[0094] To efficiently retrieve historical error information from a specified location, in a further optional embodiment of this specification, when storing page error information in a specified location, the page display terminal uses the domain name of the first specified page as an identifier for the page error information. Then, when displaying the first specified page again, or when displaying the second specified page, the terminal searches among the identifiers stored in the specified location for an identifier whose matching degree with the re-displayed first or second specified page is greater than a matching degree threshold, and uses this identifier as the designated identifier. The page error information corresponding to the designated identifier is then used as historical error information.

[0095] The process of determining the matching degree can be as follows: for each identifier stored in a specified location, determine whether the username, first-level domain name, and second-level domain name of that identifier are the same as the username, first-level domain name, and second-level domain name when the first specified page is displayed again, or when the second specified page is displayed. If the determination result is yes, then it is determined that the matching degree between the first specified page or the second specified page displayed again and the identifier is greater than the matching degree threshold. If the determination result is no, then it is determined that the matching degree between the first specified page or the second specified page displayed again and the identifier is not greater than the matching degree threshold.

[0096] In some cases, the page display client may show a second specified page to the user simultaneously with the first specified page. In an optional embodiment of this specification, if the pages being displayed on the page display client include the second specified page in addition to the first specified page, and the page display client receives a page close instruction to close the first specified page, then for page error information detected by the specified event listener but not yet sent to the page server, the error information is sent to the page server when the second specified page is displayed on the page display client.

[0097] In this embodiment, when displaying the second designated page, the page error information collected for the first designated page is sent to the page server so that the page server can obtain the page error information collected for the first designated page in a timely manner.

[0098] Specifically, such as Figure 3 As shown, the process by which the page display client listens for a specified event (that is, the process by which the page display client runs the specified script when the specified file contains the first specified script) in this specification can be:

[0099] S300: Use the identifier of the event represented by the specified file as the identifier of the specified event.

[0100] S302: Invoke the event listener that matches the identifier of the specified event to listen for and obtain page error information for the specified event.

[0101] S304: A page close command to close the first specified page has been received.

[0102] S306: Determine if target information exists. If the result is yes, proceed to step S308. If the result is no, proceed to step S314.

[0103] The target information is page error information that has been detected by listening to a specific event on the first specified page but has not yet been sent to the page server.

[0104] S308: Determine whether the currently displayed pages contain the second specified page. If the result is yes, proceed to step S310. If the result is no, proceed to step S312.

[0105] S310: During the display of the second designated page, the target information is sent to the page server. Execute step S314.

[0106] This step enables the sending of page error messages that have been detected by a specified event but have not yet been sent to the page server to the page server when the second specified page is displayed on the page display terminal.

[0107] S312: After storing the target information in the specified location on the local page display terminal, proceed to step S314.

[0108] In the foregoing embodiments, the page display client stores page error information locally, which can efficiently store page information. However, in actual page display, there may be issues with the page display client itself that affect the efficiency of storing page error information at a specified location. In this case, the storage of target information may also be slow due to problems with the page display client.

[0109] In view of this, in an optional embodiment of this specification, if the determination result of step S308 is negative, a prompt message indicating delayed page closing is displayed to inform the user and mitigate the negative impact on user experience. After step S312 is completed, the display of the prompt message indicating delayed page closing stops. In this embodiment, the page display terminal stores the page error information in a designated location while also displaying a prompt message to the user to inform them of the current status, thus mitigating the poor user experience caused by the delayed closing of the first designated page.

[0110] S314: Close the first specified page.

[0111] In real-world webpage display scenarios, a user might close the first specified page for several reasons. First, they might have already finished browsing that page. Second, the closing might be due to issues with the webpage's display itself (such as browser lag). If the user abandons browsing the first specified page due to a problem with the display itself, they might also abandon browsing the second specified page for the same reason.

[0112] In view of this, in another optional embodiment of this specification, on the one hand, the page error information collected for the first specified page is stored in a specified location; on the other hand, for page error information detected by a specified event but not yet sent to the page server, it is sent to the page server when the first specified script corresponding to the second specified page is run on the page display terminal. When displaying the second specified page, if all page error information for the first specified page has been sent to the page server, the page error information collected for the first specified page stored in the specified location is deleted.

[0113] In this embodiment, to address the issue of users closing a specified page due to poor performance of the page display terminal, resulting in page error information not being sent to the page server, the process described in this specification, on the one hand, sends the page error information collected for the first specified page to the page server when the second specified page is displayed, which helps improve the timeliness of data acquisition; on the other hand, timely storage of the page error information collected for the first specified page to a designated location can effectively avoid the loss of page error information due to problems with the page display terminal itself.

[0114] In the foregoing embodiments, even if the user closes the first designated page, the page display terminal can still store the page error information in a designated local location, preventing the loss of page error information. In other words, in the foregoing embodiments, at least the page display terminal can obtain the page error information.

[0115] Normally, page maintenance and management are performed by the page server. To enable the page server to obtain page error information stored locally on the page display device, in an optional embodiment of this specification, when the page display device displays a page managed by the page server again (i.e., when the page display device executes the first specified script again if the specified file contains it), it reads data stored in a specified location locally on the page display device. If historical error information stored from a previous display of a page obtained from the page server is found in the specified location, this historical error information is sent to the page server.

[0116] In this manual, there are several possible times when reading historical error information stored locally on the page display device can be triggered.

[0117] In an optional embodiment of this description, after displaying the delayed page closing prompt in step S312, it can be determined whether historical error information is read at the specified location. The historical error information is the page error information stored when the page obtained from the page server was displayed in the past. If yes, the historical error information is sent to the page server. If no, step S314 is executed after step S312 is completed.

[0118] In this embodiment, the first designated page can be displayed first, avoiding the consumption of page display resources by reading historical error information and thus affecting the display effect of the first designated page.

[0119] In another optional embodiment of this specification, the historical error information stored locally can be read during step S210. In this embodiment, the historical error information stored locally on the page display terminal can be sent to the page server as quickly as possible, allowing the page server to process the historical error information more promptly. Optionally, after sending the historical error information stored locally on the page display terminal to the page server, the sent historical error information can be deleted, thereby releasing local storage space on the page display terminal as quickly as possible.

[0120] To rationally allocate resources on the page display end, ensuring both the page display effect and the transmission of historical error information to the page server, in an optional embodiment of this specification, the page display end determines the number of pages currently being displayed according to the instructions of a specified file, as the actual number (optionally, the specified file carries a second specified script, and the page display end can determine the actual number by running the second specified script). It is then determined whether the actual number is greater than a reference number, which can be a preset value. The reference number can be set by the page display end, the page server, or the user. If the reference number is set by the page server, it can be carried in the specified file. If yes, after displaying the delayed page closing prompt in step S312, it is determined whether historical error information is read at the specified location. If not, during step S210, it is determined whether historical error information is read at the specified location.

[0121] Based on the same approach, this specification further provides a first type of page error information acquisition device, which is applied to the page server, such as... Figure 4 As shown, the first type of page error information acquisition device includes one or more of the following modules:

[0122] The first receiving module 400 is configured to receive page access requests;

[0123] The response module 402 is configured to: respond to a page access request, determine the page information file and the specified file, wherein the page information file represents the information displayed on the first specified page, and the specified file represents the specified events that need to be listened to during the display of the first specified page;

[0124] The first sending module 404 is configured to send the page information file and the specified file to the page display terminal, so that if the page displayed terminal only contains the first specified page among the pages managed by the page server, and the page display terminal receives a page close instruction to close the first specified page, then it stores the page error information that has been listened to for the specified event and has not yet been sent to the page server in the specified location on the local machine of the page display terminal, and then closes the first specified page.

[0125] In an optional embodiment of this specification, the specified event includes: the error event.

[0126] In an optional embodiment of this specification, the specified event includes the unhandledrejection event.

[0127] In an optional embodiment of this specification, the specified location includes: localstorage.

[0128] In an optional embodiment of this specification, the first page error information acquisition device may further include a third receiving module 406. The third receiving module 406 is configured to receive page error information sent by the page display terminal.

[0129] Based on the same approach, this specification further provides a second type of page error information acquisition device, which is applied to the page display end, such as... Figure 5 As shown, the second type of page error information acquisition device includes one or more of the following modules:

[0130] The second receiving module 500 is configured to receive page information files and specified files.

[0131] Display module 502 is configured to display the first specified page corresponding to the page information file;

[0132] Listener module 504, configured to: listen for specified events represented by the specified file;

[0133] The page closing module 506 is configured as follows: If the page managed by the page server is only the first specified page among the pages currently being displayed, and the page display terminal receives a page closing instruction to close the first specified page, then it will store the page error information that has been listened to for the specified event and has not yet been sent to the page server in the specified location on the local page display terminal before closing the first specified page.

[0134] In an optional embodiment of this specification, the second page error information acquisition device may further include Figure 6 The prompt information display module 508 is configured to: upon receiving a page close instruction to close a first specified page, determine whether target information exists, wherein the target information is page error information detected by listening for a specified event of the first specified page and not yet sent to the page server; if so, determine whether the currently displayed pages include a second specified page, wherein the second specified page is a page obtained from the page server other than the first specified page; if the second specified page is included, the target information is sent to the page server during the display of the second specified page; if the second specified page is not included, a prompt information indicating delayed page closing is displayed.

[0135] In an optional embodiment of this specification, the second page error information acquisition device may further include a historical error information sending module 510. The historical error information sending module 510 is configured to: determine whether historical error information is read at the specified location, wherein the historical error information is page error information stored when a page obtained from the page server was displayed in the past; if so, send the historical error information to the page server.

[0136] In an optional embodiment of this specification, the second page error information acquisition device may further include a deletion module configured to delete historical error information stored in a specified location.

[0137] In an optional embodiment of this specification, the specified event includes: the error event.

[0138] In an optional embodiment of this specification, the specified event includes the unhandledrejection event.

[0139] In an optional embodiment of this specification, the specified location includes: localstorage.

[0140] like Figure 6 As shown in the figure, this application embodiment provides a device for obtaining page error information, including a processor 111, a communication interface 112, a memory 113, and a communication bus 114, wherein the processor 111, the communication interface 112, and the memory 113 communicate with each other through the communication bus 114.

[0141] Memory 113 is used to store computer programs;

[0142] In one embodiment of this application, when the processor 111 executes a program stored in the memory 113, it implements the control method for obtaining page error information provided in any of the foregoing method embodiments, including:

[0143] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of obtaining page error information as provided in any of the foregoing method embodiments.

[0144] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes the element.

[0145] The above are merely specific embodiments of the present invention, enabling those skilled in the art to understand or implement the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the present invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features claimed herein.

Claims

1. A method for obtaining page error information, characterized in that, The method is applied to the page server, and the method includes: Receive page access requests; In response to the page access request, a page information file and a specified file are determined, wherein the page information file represents the information displayed on the first specified page, and the specified file represents the specified events that need to be listened to during the display of the first specified page; The page information file and the specified file are sent to the page display terminal. If the page display terminal receives a page close instruction to close the first specified page, it determines whether target information exists. The target information is page error information that has been listened to for a specified event of the first specified page and has not yet been sent to the page server. If so, it determines whether the currently displayed pages include a second specified page, which is a page obtained from the page server other than the first specified page. If the second specified page is included, the target information is sent to the page server while the second specified page is being displayed, and the first specified page is closed. If the second specified page is not included, a delayed page closing prompt is displayed, the target information is stored in a specified location on the local machine of the page display terminal, and then the first specified page is closed.

2. The method according to claim 1, characterized in that, The method further includes at least one of the following: The specified events include: the error event; The specified events include: the unhandledrejection event; The specified location includes: localstorage.

3. The method according to claim 1, characterized in that, After sending the page information file and the specified file to the page display terminal, the method further includes: Receive page error information sent by the page display terminal.

4. A method for obtaining page error information, characterized in that, The method is applied to the page display end, and the method includes: Receive page information file and specified file; Display the first designated page corresponding to the page information file; Listen for the specified events represented by the specified file; If a page close instruction to close the first specified page is received, it is determined whether target information exists. The target information is page error information that has been detected by listening for a specified event of the first specified page but has not yet been sent to the page server. If so, it is determined whether the currently displayed pages include a second specified page, wherein the second specified page is a page obtained from the page server other than the first specified page. If the second specified page is included, the target information is sent to the page server while the second specified page is being displayed, and the first specified page is closed. If the second specified page is not included, a prompt message indicating delayed page closure is displayed, the target information is stored in a specified location on the local page display device, and then the first specified page is closed.

5. The method according to claim 4, characterized in that, After displaying a message indicating a delayed page closing, the method further includes: Determine whether historical error information is read at the specified location. The historical error information is the page error information stored when the page was previously displayed from the page server. If so, the historical error information will be sent to the page server.

6. The method according to claim 5, characterized in that, After sending the historical error information to the page server, the method further includes: Delete the historical error information stored at the specified location.

7. The method according to claim 4, characterized in that, The method further includes at least one of the following: The specified events include: the error event; The specified events include: the unhandledrejection event; The specified location includes: localstorage.

8. A device for obtaining page error information, characterized in that, The device is used on a page server, and the device includes: The first receiving module is configured to receive page access requests. The response module is configured to: in response to the page access request, determine the page information file and the specified file, wherein the page information file represents the information displayed on the first specified page, and the specified file represents the specified events that need to be listened to during the display of the first specified page; The first sending module is configured to: send the page information file and the specified file to the page display terminal; if the page display terminal receives a page close instruction to close the first specified page, determine whether there is target information, wherein the target information is page error information that has been listened to for a specified event of the first specified page and has not yet been sent to the page server; if so, determine whether the currently displayed pages include a second specified page, wherein the second specified page is a page obtained from the page server other than the first specified page; if the second specified page is included, send the target information to the page server and close the first specified page during the display of the second specified page; if the second specified page is not included, display a delayed page closing prompt, store the target information in a specified location on the local machine of the page display terminal, and then close the first specified page.

9. A device for obtaining page error information, characterized in that, The device is used on the page display terminal, and the device includes: The second receiving module is configured to receive page information files and specified files. The display module is configured to display the first specified page corresponding to the page information file; The listening module is configured to listen for specified events represented by the specified file. The page closing module is configured as follows: if a page closing instruction to close the first specified page is received, it determines whether target information exists. The target information is page error information that has been listened to for a specified event of the first specified page and has not yet been sent to the page server. If so, it determines whether the currently displayed pages include a second specified page, wherein the second specified page is a page obtained from the page server other than the first specified page. If the second specified page is included, the target information is sent to the page server during the display of the second specified page, and the first specified page is closed. If the second specified page is not included, a delayed page closing prompt is displayed, the target information is stored in a specified location on the local page display terminal, and then the first specified page is closed.

10. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, when executing a program stored in memory, implements the steps of the method for obtaining page error information as described in any one of claims 1-3, or implements the steps of the method for obtaining page error information as described in any one of claims 4-7.

11. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the method for obtaining page error information as described in any one of claims 1-3, or the steps of the method for obtaining page error information as described in any one of claims 4-7.

Citation Information

Patent Citations

  • CN110674016A

  • CN112749059A