Method, device and equipment for repairing a faulty webpage and storage medium

By detecting faulty web pages in the browser and obtaining repair scripts, the problem of web page failures caused by browser version differences was resolved, thus improving the success rate of web page display.

CN113626228BActive Publication Date: 2025-11-18BEIJING QIHOOD TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010390710.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-05-09
Publication Date
2025-11-18
Estimated Expiration
2040-05-09

AI Technical Summary

Technical Problem

Existing web business systems suffer from webpage malfunctions due to browser version differences and technology updates, which cannot be fixed through adjustments at the business system level, thus reducing the success rate of webpage display.

Method used

By detecting whether there are faulty web pages in the browser, obtaining the repair script corresponding to the target web page, and using the repair script to repair the faulty web page, including obtaining the browser version number, URL, message digest algorithm to select the latest repair script, and injecting the repair script to repair the web page.

Benefits of technology

It improves the success rate of webpage display, ensuring that faulty webpages can be successfully repaired and displayed normally.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113626228B_ABST
    Figure CN113626228B_ABST
Patent Text Reader

Abstract

The application discloses a webpage failure repairing method, device and equipment and a storage medium, and the webpage failure repairing method comprises the following steps: when it is determined that a browser is started, it is detected whether a target webpage in a failure state exists in a webpage corresponding to the browser; if it is detected that the target webpage exists in the webpage corresponding to the browser, a repairing script corresponding to the target webpage is acquired; and the target webpage is repaired through the repairing script. The application realizes repairing the webpage in the failure state through the repairing script, thereby improving the success rate of successful webpage display.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and in particular to a method, apparatus, device, and storage medium for repairing faulty web pages. Background Technology

[0002] Currently, some web (World Wide Web) business systems are developed based on a specific browser brand and version. Due to differences in how different browser versions parse pages, and with the development of web technologies and browser updates, web pages in these business systems experience malfunctions. For various reasons, the developers of these business systems cannot provide the capability to adjust them, making it impossible to fix web page malfunctions through system-level adjustments, thus reducing the success rate of web page display. Therefore, how to fix browser-specific web page malfunctions and improve the success rate of web page display is an urgent problem to be solved. Summary of the Invention

[0003] The main objective of this invention is to provide a method, apparatus, device, and storage medium for repairing faulty web pages, aiming to solve the existing technical problems of how to repair faults in browser-corresponding web pages and improve the success rate of web page display.

[0004] To achieve the above objectives, the present invention provides a method for repairing faulty web pages, the method comprising the following steps:

[0005] Once the browser is started, it is checked whether there is a target webpage in a faulty state in the webpage corresponding to the browser;

[0006] If the target webpage is detected in the webpage corresponding to the browser, then the repair script corresponding to the target webpage is obtained;

[0007] The target webpage is repaired using the repair script.

[0008] Optionally, the step of obtaining the repair script corresponding to the target webpage if the target webpage is detected in the webpage corresponding to the browser includes:

[0009] If the target webpage is detected in the webpage corresponding to the browser, then the version number of the browser is obtained;

[0010] Obtain the repair script corresponding to the target webpage based on the version number.

[0011] Optionally, the step of obtaining the repair script corresponding to the target webpage if the target webpage is detected in the webpage corresponding to the browser includes:

[0012] If the target webpage is detected in the webpage corresponding to the browser, then the target URL corresponding to the target webpage is determined;

[0013] Obtain the repair script corresponding to the target webpage based on the target URL.

[0014] Optionally, the step of obtaining the repair script corresponding to the target webpage based on the target URL includes:

[0015] Obtain the repair script corresponding to the target URL, and check whether the target URL corresponds to at least two repair scripts;

[0016] If it is detected that the target URL corresponds to only one repair script, then the repair script corresponding to the target URL is determined as the repair script corresponding to the target webpage;

[0017] If it is detected that the target URL corresponds to at least two repair scripts, then the repair scripts corresponding to the target URL are compared using an information digest algorithm to determine the latest repair script among the repair scripts corresponding to the target URL, and the latest repair script is determined as the repair script corresponding to the target webpage.

[0018] Optionally, after the step of obtaining the repair script corresponding to the target webpage if the target webpage is detected in the webpage corresponding to the browser, the method further includes:

[0019] Upon detecting a loading instruction to load the target webpage, the target webpage is loaded according to the loading instruction;

[0020] After successfully loading the target webpage, the step of repairing the target webpage using the repair script includes:

[0021] The repair script is injected into the target webpage to repair the target webpage that is in a faulty state.

[0022] Optionally, the step of injecting the repair script into the target webpage to repair the target webpage in a faulty state includes:

[0023] Render the target webpage to obtain the rendered target webpage;

[0024] The repair script is injected into the rendered target webpage to repair the target webpage that is in a faulty state.

[0025] Optionally, before the step of detecting whether a target webpage in a faulty state exists in the webpage corresponding to the browser after it is determined that the browser has started, the method further includes:

[0026] Once a request to obtain the repair script is detected, the communication information of the server is determined based on the request.

[0027] The repair script stored on the server is obtained based on the communication information, and the obtained repair script is stored.

[0028] Optionally, the step of detecting whether a target webpage in a faulty state exists in the webpage corresponding to the browser after it is determined that the browser has started includes:

[0029] Once the browser is started, check whether an access request to access the browser has been received;

[0030] If the access request is received, the webpage code of the webpage corresponding to the access request is obtained, as well as the preset code;

[0031] If the webpage code is inconsistent with the preset code, then the webpage corresponding to the access request is determined to be the target webpage.

[0032] Optionally, the step of detecting whether a target webpage in a faulty state exists in the webpage corresponding to the browser after it is determined that the browser has started includes:

[0033] Once the browser is started, check whether an access request to access the browser has been received;

[0034] If the access request is received, the URL of the webpage corresponding to the access request is obtained;

[0035] If it is determined that the webpage URL exists in the repair URL library corresponding to the pre-stored repair script, then the webpage corresponding to the access request is determined to be the target webpage in a faulty state.

[0036] Optionally, the step of detecting whether a target webpage in a faulty state exists in the webpage corresponding to the browser after it is determined that the browser has started includes:

[0037] Once the browser is launched, retrieve the pre-stored detection tools;

[0038] The detection tool is used to detect whether there is a target business system in an abnormal state in the business system corresponding to the browser.

[0039] If the target business system is detected to exist in the business system corresponding to the browser, then it is detected whether there is a target webpage in a faulty state in the webpage corresponding to the target business system.

[0040] Furthermore, to achieve the above objectives, the present invention also provides a device for repairing faulty web pages, the device comprising:

[0041] The detection module is used to detect whether there is a target webpage in a faulty state in the webpage corresponding to the browser after it is determined that the browser has started.

[0042] The acquisition module is used to acquire the repair script corresponding to the target webpage if the target webpage is detected in the webpage corresponding to the browser.

[0043] The repair module is used to repair the target webpage using the repair script.

[0044] Optionally, the acquisition module is further configured to, if the target webpage is detected to exist in the webpage corresponding to the browser, acquire the version number of the browser; and acquire the repair script corresponding to the target webpage based on the version number.

[0045] Optionally, the acquisition module includes:

[0046] The first determining unit is configured to determine the target URL corresponding to the target webpage if the target webpage is detected to exist in the webpage corresponding to the browser.

[0047] The first acquisition unit is used to acquire the repair script corresponding to the target webpage based on the target URL.

[0048] Optionally, the first acquisition unit includes:

[0049] A sub-unit is used to obtain the repair script corresponding to the target URL;

[0050] The detection subunit is used to detect whether the target URL corresponds to at least two repair scripts;

[0051] The determination subunit is used to determine the repair script corresponding to the target URL as the repair script corresponding to the target webpage if it is detected that the target URL corresponds to only one repair script;

[0052] The comparison subunit is used to compare the repair scripts corresponding to the target URL using an information digest algorithm if it is detected that the target URL corresponds to at least two repair scripts, so as to determine the latest repair script among the repair scripts corresponding to the target URL.

[0053] The determining subunit is used to determine the latest repair script as the repair script corresponding to the target webpage.

[0054] Optionally, the device for repairing faulty web pages further includes:

[0055] A loading module is used to load the target webpage according to the loading instruction after detecting a loading instruction to load the target webpage;

[0056] The repair module is also used to inject the repair script into the target webpage after the target webpage is successfully loaded, so as to repair the target webpage in a faulty state.

[0057] Optionally, the repair module includes:

[0058] A rendering unit is used to render the target webpage to obtain the rendered target webpage.

[0059] An injection unit is used to inject the repair script into the rendered target webpage to repair the target webpage that is in a faulty state.

[0060] Optionally, the device for repairing faulty web pages further includes:

[0061] The determination module is used to determine the communication information of the server based on the acquisition instruction after detecting the acquisition instruction for obtaining the repair script;

[0062] The acquisition module is also used to acquire the repair script stored on the server based on the communication information;

[0063] The device for repairing faulty web pages also includes:

[0064] The storage module is used to store the acquired repair scripts.

[0065] Optionally, the detection module includes:

[0066] The first detection unit is used to detect whether an access request to the browser has been received after the browser is determined to be launched.

[0067] The second acquisition unit is used to acquire the webpage code of the webpage corresponding to the access request and to acquire a preset code if the access request is received.

[0068] The second determining unit is used to determine the webpage corresponding to the access request as the target webpage if the webpage code is inconsistent with the preset code.

[0069] Optionally, the detection module further includes:

[0070] The second detection unit is used to detect whether an access request to the browser has been received after the browser is determined to be launched.

[0071] The third acquisition unit is used to acquire the webpage URL of the webpage corresponding to the access request if the access request is received.

[0072] The third determining unit is used to determine that the webpage corresponding to the access request is a target webpage in a faulty state if it is determined that the webpage URL exists in the repair URL library corresponding to the pre-stored repair script.

[0073] Optionally, the detection module further includes:

[0074] The fourth acquisition unit is used to acquire the pre-stored detection tools after it is determined that the browser has started.

[0075] The third detection unit is used to detect whether there is a target business system in an abnormal state in the business system corresponding to the browser through the detection tool; if the target business system is detected in the business system corresponding to the browser, then it is detected whether there is a target webpage in a fault state in the webpage corresponding to the target business system.

[0076] Furthermore, to achieve the above objectives, the present invention also provides a device for repairing faulty web pages. The device includes a memory, a processor, and a faulty web page repair program stored in the memory and executable on the processor. When the faulty web page repair program is executed by the processor, it implements the steps of a faulty web page repair method, such as that for a federated learning server.

[0077] In addition, to achieve the above objectives, the present invention also provides a computer-readable storage medium storing a repair program for a faulty webpage, wherein when the repair program for the faulty webpage is executed by a processor, it implements the steps of the faulty webpage repair method described above.

[0078] This invention improves the success rate of webpage display by detecting whether a target webpage in a faulty state exists in the browser after it is determined to start. If the target webpage exists, a repair script corresponding to the target webpage is obtained, and the target webpage in a faulty state is repaired by the repair script. Attached Figure Description

[0079] Figure 1 This is a flowchart illustrating the first embodiment of the method for repairing faulty web pages according to the present invention;

[0080] Figure 2 This is a flowchart illustrating the third embodiment of the method for repairing faulty web pages according to the present invention;

[0081] Figure 3 This is a functional schematic diagram of a preferred embodiment of the device for repairing faulty web pages according to the present invention.

[0082] Figure 4 This is a schematic diagram of the hardware operating environment involved in the embodiments of the present invention.

[0083] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0084] It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.

[0085] According to the present invention, a method for repairing faulty web pages is provided, referring to... Figure 1 , Figure 1 This is a flowchart illustrating the first embodiment of the method for repairing faulty web pages according to the present invention.

[0086] According to the method for repairing faulty web pages provided by the present invention, it should be noted that although the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than that shown here.

[0087] The methods for repairing faulty web pages are applied to client-side devices, which can include mobile terminals such as mobile phones, tablets, laptops, PDAs, and personal digital assistants (PDAs), as well as fixed terminals such as digital TVs and desktop computers. The methods for repairing faulty web pages include:

[0088] Step S11: After the browser is started, check whether there is a target webpage in a faulty state in the webpage corresponding to the browser.

[0089] In this embodiment, a browser installed on the client is used as an example. After the client determines that the browser has started, it checks whether there is a webpage in a faulty state among the corresponding webpages. In this embodiment, a webpage in a faulty state is recorded as the target webpage. Specifically, when the client powers on, the browser on the client can start automatically; the client can also start the browser according to a startup command received. This startup command can be triggered by the client as needed, or it can be automatically triggered after the client receives an access request from another device; the client can also set a scheduled startup task, which will start the browser after the client powers on. It should be noted that there may be only one target webpage in a faulty state in the browser, or there may be multiple target webpages in a faulty state, or there may be no target webpage in a faulty state. Specifically, when the browser is incompatible with the corresponding webpage, it will cause the webpage to be in a faulty state; or when the relevant code of the webpage is illegally modified, it will also cause the webpage to be in a faulty state. It is understandable that there are more than just the two reasons mentioned above for a webpage to be in a faulty state. When a webpage is in a faulty state, it may not be able to be displayed successfully on the client, or some content of the webpage displayed on the client may not be displayed or may be displayed incorrectly.

[0090] Further, step S11 includes:

[0091] Step a: After the browser is started, check whether an access request to access the browser has been received.

[0092] Step b: If the access request is received, obtain the webpage code of the webpage corresponding to the access request, and obtain the preset code.

[0093] Furthermore, once the client confirms that the browser has started, it checks whether it has received an access request to the browser. This access request can be triggered by the client user or sent to the client by other devices. Upon receiving the access request, the client identifies the webpage corresponding to the request and retrieves its code. It should be noted that the access request carries a URL (Uniform Resource Locator), and each webpage in the browser also has its own URL and code. Therefore, upon receiving the access request, the client retrieves the URL carried in the request and uses it to obtain the corresponding webpage code. The client then retrieves a preset code, which is a pre-stored, correct code for the webpage corresponding to the access request. In this embodiment, the code can be HTML (Hypertext Markup Language), CSS (Cascading Style Sheets), or JS (JavaScript) source code.

[0094] Step d: If the webpage code is inconsistent with the preset code, then the webpage corresponding to the access request is determined to be the target webpage.

[0095] After the client obtains the webpage code and the preset code, it checks whether the webpage code and the preset code are consistent. If the webpage code is inconsistent with the preset code, the client determines that the webpage corresponding to the access request is the target webpage, that is, it determines that the webpage corresponding to the access request is a target webpage in a faulty state. If the webpage code is consistent with the preset code, the client determines that the webpage corresponding to the access request is a normal webpage and loads the webpage corresponding to the access request to respond to the access request. In this embodiment, the client can calculate the similarity between the webpage code and the preset code. When the similarity between the webpage code and the preset code is greater than or equal to the preset similarity, that is, when the webpage code is consistent with the preset code, the client determines that the webpage corresponding to the access request is a normal webpage. When the similarity between the webpage code and the preset code is less than the preset similarity, that is, when the webpage code is inconsistent with the preset code, the client determines that the webpage corresponding to the access request is the target webpage. The preset similarity can be set according to specific needs, such as 80%, 95%, or 100%. Furthermore, if the client does not receive the access request, the client continues to check whether the access request has been received.

[0096] By only detecting whether a target webpage in a faulty state exists in the browser when an access request is received, i.e., when the browser needs to respond to the access request through the corresponding webpage, the system avoids checking for faulty webpages in the browser when no access request needs to be responded to, thereby reducing the resources required to detect faulty webpages in the browser.

[0097] Furthermore, step S11 also includes:

[0098] Step e: After the browser is determined to be launched, check whether an access request to access the browser has been received.

[0099] Step f: If the access request is received, obtain the URL of the webpage corresponding to the access request.

[0100] Step g: If it is determined that the webpage URL exists in the repair URL library corresponding to the pre-stored repair script, then the webpage corresponding to the access request is determined to be the target webpage in a faulty state.

[0101] Furthermore, once the browser is launched, the client checks if it has received an access request to the browser. If so, the client obtains the URL of the webpage corresponding to the access request and records it as the webpage URL. It should be noted that the URL of the webpage corresponding to the access request is carried within the access request itself. After obtaining the webpage URL, the client checks if it exists in the pre-stored repair URL library corresponding to the repair script. It can be understood that each repair script has a corresponding URL, and these URLs, which are pre-stored in the client, constitute the repair URL library. If the client detects that the webpage URL exists in the repair URL library, it determines that the webpage corresponding to the access request is a target webpage in a faulty state; if it detects that the webpage URL does not exist in the repair URL library, it determines that the webpage corresponding to the access request is a normal webpage. It can be understood that when the webpage URL exists in the repair URL library, it indicates the existence of a repair script for the page corresponding to the access request, thus confirming that the webpage corresponding to the access request is a target webpage in a faulty state.

[0102] Furthermore, once it's determined that the webpage URL exists in the repair URL database, the client further checks whether the code corresponding to the webpage URL is the same as the code corresponding to the repair URL in the database. Here, the repair URL is a URL in the database that matches the webpage URL. When the code corresponding to the webpage URL is the same as the code corresponding to the repair URL, the client determines that the webpage corresponding to the access request is a normal webpage; when the code corresponding to the webpage URL is different from the code corresponding to the repair URL, the client determines that the webpage corresponding to the access request is the target webpage, thereby improving the accuracy of detecting whether the webpage corresponding to the access request is in a faulty state. It's understandable that the code corresponding to the repair URL can be a portion of the code corresponding to the webpage. In this case, during the comparison of the code corresponding to the repair URL and the code corresponding to the webpage URL, it's only necessary to compare whether the portion of the code corresponding to the repair URL is the same as the corresponding portion of the code in the webpage URL.

[0103] Furthermore, step S11 also includes:

[0104] Step h: Once the browser is confirmed to be running, retrieve the pre-stored detection tool.

[0105] Step i: Use the detection tool to detect whether there is a target business system in an abnormal state in the business system corresponding to the browser.

[0106] Furthermore, once the client confirms that the browser has started, it retrieves a pre-stored detection tool. In this embodiment, the detection tool includes at least two modules: the Elements module and the Console module. The Elements module is used to view the HTML and CSS elements in the corresponding webpage, while the Console module is used to display debugging information output by the corresponding webpage script or run test scripts. Specifically, the Elements and Console modules have error reporting capabilities. When the client confirms that the browser has started, it calls the Elements and / or Console modules to detect whether there is an abnormal business system in the browser's corresponding business system, and records the abnormal business system as the target business system. It is understood that when an abnormal business system exists in the browser, the Elements and / or Console modules will generate error information, which the client can output in its display interface to notify the user that an abnormal target business system exists in the browser's corresponding business system. When the Elements and / or Console modules do not generate error information, it indicates that the browser's corresponding business systems are all normal. It should be noted that each browser corresponds to at least one business system, and each business system corresponds to at least one webpage.

[0107] Step j: If the target business system is detected in the business system corresponding to the browser, then check whether there is a target webpage in a faulty state in the webpage corresponding to the target business system.

[0108] If the target business system is detected within the browser's corresponding business system, the client checks if a target webpage in a faulty state exists within the webpage corresponding to that business system. It's understood that only if a business system is in an abnormal state can its corresponding webpage be in a faulty state; if a business system is in a normal state, its corresponding webpage cannot be in a faulty state. Specifically, when checking if a target webpage in a faulty state exists within the webpage corresponding to the target business system, the client can compare the code of the target webpage with the corresponding preset code to determine if a target webpage in a faulty state exists; alternatively, it can obtain the URL of the target webpage and check if the URL exists in the repair URL library corresponding to the repair script to determine if a target webpage in a faulty state exists within the webpage corresponding to the target business system. It should be noted that the process of comparing the code of the webpage corresponding to the target business system with the corresponding preset code to determine whether there is a target webpage in a faulty state is the same as the process of comparing the webpage code corresponding to the access request with the corresponding preset code to determine whether the webpage corresponding to the access request is the target webpage, and will not be repeated here; the process of checking whether the URL of the webpage corresponding to the target business system exists in the repair URL library corresponding to the repair script to determine whether there is a target webpage in a faulty state is the same as the process of checking whether the webpage URL corresponding to the access request exists in the repair URL library corresponding to the repair script to determine whether the webpage corresponding to the access request is a target webpage in a faulty state, and will not be repeated here.

[0109] Step S13: If the target webpage is detected in the webpage corresponding to the browser, then obtain the repair script corresponding to the target webpage.

[0110] If the target webpage is detected in the browser's corresponding webpage, the client retrieves the corresponding repair script. This repair script can be pre-stored on the client, or it can be retrieved from a server storing repair scripts when the client detects the target webpage's presence in the browser's corresponding webpage. The server storing repair scripts can be a physical device or a virtual device such as a cloud server. Furthermore, if the client detects that the target page does not exist in the browser's corresponding webpage and no access request has been received at this time, the client checks whether an access request has been received. If an access request is received, the client responds to the access request.

[0111] Further, step S13 includes:

[0112] Step k: If the target webpage is detected in the webpage corresponding to the browser, then obtain the browser version number.

[0113] Step 1: Obtain the repair script corresponding to the target webpage based on the version number.

[0114] Furthermore, if the client detects the presence of the target webpage in the browser's corresponding webpage, the client obtains the browser's version number. It should be noted that in this embodiment, each browser has a corresponding version number. After obtaining the browser's version number, the client retrieves the repair script corresponding to the target webpage based on the version number. In this embodiment, for the same webpage and the same fault cause, different version numbers correspond to different repair scripts. In this embodiment, a mapping relationship between version numbers and repair script URLs is pre-stored; therefore, after obtaining the browser's version number, the client can retrieve the repair script corresponding to the target webpage based on the mapping relationship between the version number and the repair script URL. In this embodiment, the format of the version number is not limited; the version number can be represented by numbers and / or English characters.

[0115] By setting different repair scripts for web pages corresponding to different browser versions, the success rate of repairing web pages that are in a faulty state in the corresponding browser is improved.

[0116] Step S15: Repair the target webpage using the repair script.

[0117] Once the client obtains the repair script corresponding to the target webpage, it uses this script to repair the webpage that is in a faulty state. Specifically, in this embodiment, the repair script is pre-set by the developers and is a JavaScript repair script. After obtaining the JavaScript repair script for the target webpage, the client starts the pre-set JavaScript engine. Using JavaScript injection technology, the JavaScript engine dynamically loads the JavaScript repair script to overwrite or update the corresponding script code on the target webpage, thus repairing the faulty webpage. It can be understood that in the overwriting method, the repair script is the code for a complete webpage, and the repair script directly replaces the corresponding code on the target webpage to repair the faulty webpage; in the updating method, the repair script is a portion of the code from a complete webpage, and the repair script replaces the corresponding code on the target webpage to repair the faulty webpage.

[0118] Further, step S15 includes:

[0119] Step m: After detecting a loading instruction to load the target webpage, load the target webpage according to the loading instruction.

[0120] Step n: After successfully loading the target webpage, inject the repair script into the target webpage to repair the target webpage that is in a faulty state.

[0121] Furthermore, after the client obtains the repair script, it checks whether it has detected a loading instruction for the target webpage. Specifically, this loading instruction can be automatically triggered by the client upon receiving an access request. When the client detects the loading instruction, it loads the target webpage according to the instruction, and after successfully loading the target webpage, it uses JavaScript injection technology to inject the repair script into the target webpage to repair the malfunctioning webpage. It should be noted that if the client receives an access request and determines that the webpage corresponding to the request is the target webpage, the client will automatically trigger the loading instruction after obtaining the repair script, load the target webpage through this instruction, inject the repair script into the target webpage to repair the malfunctioning webpage, and respond to the access request through the successfully repaired target webpage. If the client determines that the target webpage exists in the browser after the browser starts, the client can trigger the loading instruction after obtaining the repair script and receiving the access request. Further, if the client does not detect a loading instruction for the target webpage, it continues to check whether it has been detected.

[0122] By detecting the loading command for the target webpage and successfully loading the target webpage according to the loading command, and then repairing the target webpage using a repair script, the target webpage can be successfully and normally displayed when the client needs to open it.

[0123] Further, step n includes:

[0124] Step n1: After successfully loading the target webpage, render the target webpage to obtain the rendered target webpage.

[0125] Step n2: Inject the repair script into the rendered target webpage to repair the target webpage that is in a faulty state.

[0126] Furthermore, after the client successfully loads the target webpage, it invokes a pre-configured rendering engine to render the webpage, resulting in a rendered webpage. The rendering engine converts HTML / CSS / JS text and corresponding resource files into image results. Once the client receives the rendered webpage, it injects a repair script into it to fix the faulty webpage. After successfully injecting the repair script, the client displays the repaired webpage on its interface. It should be noted that this embodiment also supports loading and executing specified repair files during HTTP (Hypertext Transfer Protocol) / HTTPS (Hypertext Transfer Protocol over Secure Socket Layer) protocol communication processes.

[0127] This embodiment detects whether a target webpage in a faulty state exists in the browser after it is determined to start. If the target webpage exists, a repair script corresponding to the target webpage is obtained. The repair script is used to repair the target webpage in a faulty state, thereby improving the success rate of webpage display.

[0128] Furthermore, a second embodiment of the method for repairing faulty web pages is proposed. The difference between the second embodiment and the first embodiment is that step S13 further includes:

[0129] Step o: If the target webpage is detected in the webpage corresponding to the browser, then determine the Uniform Resource Locator (URL) corresponding to the target webpage.

[0130] Step p: Obtain the repair script corresponding to the target webpage based on the target URL.

[0131] If the client detects the existence of the target webpage in the browser's webpage, it determines the target URL and retrieves the corresponding repair script. Specifically, after detecting the target webpage, the client checks its database to see if a repair script corresponding to the target URL is stored. If so, the client retrieves the repair script from its database. Further, if the client does not find a repair script in its database, it retrieves the repair script from the server. Since both the repair script and the target webpage have corresponding URLs, the client can retrieve the repair script using both the target URL and its corresponding URL. For example, if the client detects a repair script in its database with the same URL as the target URL, it can determine that the repair script for the target webpage is stored in its database.

[0132] Furthermore, if the client does not obtain the repair script from the server, the client generates and outputs a prompt message, which prompts the developer to write the repair script corresponding to the target webpage. This embodiment does not limit the output method of the prompt message; it can be output via voice or text. After the client outputs the prompt message, it checks whether it has received the repair script written by the developer. If the client receives the repair script, it identifies it as the repair script corresponding to the target webpage.

[0133] This embodiment improves the accuracy of repair script acquisition by obtaining the corresponding repair script through the unique attribute URL of the target webpage after identifying the target webpage in a faulty state.

[0134] Further, step p includes:

[0135] Step p1: Obtain the repair script corresponding to the target URL, and detect whether the target URL corresponds to at least two repair scripts.

[0136] Step p2: If it is detected that the target URL corresponds to only one repair script, then the repair script corresponding to the target URL is determined as the repair script corresponding to the target webpage.

[0137] Step p3: If at least two repair scripts are detected to correspond to the target URL, the repair scripts corresponding to the target URL are compared using an information digest algorithm to determine the latest repair script among the repair scripts corresponding to the target URL, and the latest repair script is determined as the repair script corresponding to the target webpage.

[0138] Furthermore, after the client obtains the repair script corresponding to the target URL, the client checks whether the target URL corresponds to at least two repair scripts. It should be noted that for the same target webpage, the client may obtain multiple repair scripts. If the client detects that the target URL corresponds to only one repair script, the client determines the repair script corresponding to the target URL as the repair script corresponding to the target webpage; if the client detects that the target URL corresponds to at least two repair scripts, the client compares the repair scripts corresponding to the target URL using a message digest algorithm to determine the latest repair script among the repair scripts corresponding to the target URL, and determines the latest repair script as the repair script corresponding to the target webpage. It should be noted that the message digest algorithm in this embodiment is the MD5 algorithm; other message digest algorithms may also be used in other embodiments. In the process of determining the latest repair script using the message digest algorithm, the hash value corresponding to each repair script is calculated using the message digest algorithm, and then the size of the hash values ​​corresponding to each repair script is compared. The repair script with the largest hash value is determined as the latest repair script.

[0139] This embodiment selects the latest repair script from among the multiple repair scripts corresponding to the target URL of the target webpage, thus avoiding the failure of repairing the target webpage due to the use of an old repair script, thereby further improving the success rate of repair through repair scripts.

[0140] Furthermore, a third embodiment of the method for repairing faulty web pages is proposed. The difference between this third embodiment and the first and / or second embodiments of the method for repairing faulty web pages lies in the following: [Referring to...] Figure 2 The method for repairing the faulty webpage also includes:

[0141] Step S31: After detecting the acquisition instruction for the repair script, determine the communication information of the server according to the acquisition instruction.

[0142] Furthermore, after the client detects the command to retrieve the repair script, the client determines the server's communication information based on the command. This communication information includes, but is not limited to, the server's IP (Internet Protocol) address and port number. In this embodiment, the command can be triggered by the client user as needed, or it can be automatically triggered by the client after power-on.

[0143] Step S33: Obtain the repair script stored on the server according to the communication information, and store the obtained repair script.

[0144] After the client receives the communication information, it establishes a connection with the server to retrieve the repair scripts stored on the server. It should be noted that the client can retrieve all or only a portion of the repair scripts stored on the server. Specifically, after establishing a connection, the client generates a retrieval request and sends it to the server. Upon receiving the request, the server returns the corresponding repair script to the client. The retrieval request includes script information for the requested repair script, which the server can use to determine the appropriate script. This script information can include a URL, browser name, and / or browser version number. After successfully retrieving the repair script from the server, the client stores it in its database. This allows the client to quickly retrieve the repair script for a specific webpage from the database when needed.

[0145] Furthermore, the server can also uniformly distribute the stored repair scripts to the client. Before distributing the repair scripts to the client, the server can configure a policy based on the client's browser category and version number. The server then sends the repair scripts to the client according to the configured policy, meaning it sends the corresponding repair script to the client based on the browser's category and version number. It's understandable that browsers developed by different vendors belong to different categories, and different categories require different repair scripts. Even within the same category, different version numbers of browsers may have different repair scripts.

[0146] Step S35: After the browser is started, check whether there is a target webpage in a faulty state in the webpage corresponding to the browser.

[0147] Step S37: If the target webpage is detected in the webpage corresponding to the browser, then obtain the repair script corresponding to the target webpage.

[0148] Step S39: Repair the target webpage using the repair script.

[0149] It should be noted that the specific implementation processes of steps S35, S37 and S39 have been explained in detail in steps S11, S13 and S15, and will not be repeated here.

[0150] In this embodiment, the client first obtains and stores the repair script. When the client needs to obtain the repair script corresponding to the target webpage, it can directly and quickly retrieve the repair script corresponding to the target webpage from the database, thereby improving the repair efficiency of webpages in a faulty state.

[0151] In addition, a device for repairing faulty web pages is also provided, as described above. Figure 3 The device for repairing the faulty webpage includes:

[0152] The detection module 10 is used to detect whether there is a target webpage in a faulty state in the webpage corresponding to the browser after it is determined that the browser has started.

[0153] The acquisition module 30 is used to acquire a repair script corresponding to the target webpage if the target webpage is detected in the webpage corresponding to the browser.

[0154] Repair module 50 is used to repair the target webpage using the repair script.

[0155] Furthermore, the acquisition module 10 is also used to acquire the browser version number if the target webpage is detected in the webpage corresponding to the browser; and acquire the repair script corresponding to the target webpage according to the version number.

[0156] Furthermore, the acquisition module 10 includes:

[0157] The first determining unit is configured to determine the target URL corresponding to the target webpage if the target webpage is detected to exist in the webpage corresponding to the browser.

[0158] The first acquisition unit is used to acquire the repair script corresponding to the target webpage based on the target URL.

[0159] Further, the first acquisition unit includes:

[0160] A sub-unit is used to obtain the repair script corresponding to the target URL;

[0161] The detection subunit is used to detect whether the target URL corresponds to at least two repair scripts;

[0162] The determination subunit is used to determine the repair script corresponding to the target URL as the repair script corresponding to the target webpage if it is detected that the target URL corresponds to only one repair script;

[0163] The comparison subunit is used to compare the repair scripts corresponding to the target URL using an information digest algorithm if it is detected that the target URL corresponds to at least two repair scripts, so as to determine the latest repair script among the repair scripts corresponding to the target URL.

[0164] The determining subunit is used to determine the latest repair script as the repair script corresponding to the target webpage.

[0165] Furthermore, the device for repairing faulty web pages also includes:

[0166] A loading module is used to load the target webpage according to the loading instruction after detecting a loading instruction to load the target webpage;

[0167] The repair module is also used to inject the repair script into the target webpage after the target webpage is successfully loaded, so as to repair the target webpage in a faulty state.

[0168] Furthermore, the repair module 50 includes:

[0169] A rendering unit is used to render the target webpage to obtain the rendered target webpage.

[0170] An injection unit is used to inject the repair script into the rendered target webpage to repair the target webpage that is in a faulty state.

[0171] Furthermore, the device for repairing faulty web pages also includes:

[0172] The determination module is used to determine the communication information of the server based on the acquisition instruction after detecting the acquisition instruction for obtaining the repair script;

[0173] The acquisition module is also used to acquire the repair script stored on the server based on the communication information;

[0174] The device for repairing faulty web pages also includes:

[0175] The storage module is used to store the acquired repair scripts.

[0176] Furthermore, the detection module 10 includes:

[0177] The first detection unit is used to detect whether an access request to the browser has been received after the browser is determined to be launched.

[0178] The second acquisition unit is used to acquire the webpage code of the webpage corresponding to the access request and to acquire a preset code if the access request is received.

[0179] The second determining unit is used to determine the webpage corresponding to the access request as the target webpage if the webpage code is inconsistent with the preset code.

[0180] Furthermore, the detection module 10 also includes:

[0181] The second detection unit is used to detect whether an access request to the browser has been received after the browser is determined to be launched.

[0182] The third acquisition unit is used to acquire the webpage URL of the webpage corresponding to the access request if the access request is received.

[0183] The third determining unit is used to determine that the webpage corresponding to the access request is a target webpage in a faulty state if it is determined that the webpage URL exists in the repair URL library corresponding to the pre-stored repair script.

[0184] Furthermore, the detection module 10 also includes:

[0185] The fourth acquisition unit is used to acquire the pre-stored detection tools after it is determined that the browser has started.

[0186] The third detection unit is used to detect whether there is a target business system in an abnormal state in the business system corresponding to the browser through the detection tool; if the target business system is detected in the business system corresponding to the browser, then it is detected whether there is a target webpage in a fault state in the webpage corresponding to the target business system.

[0187] The specific implementation of the faulty webpage repair device according to the present invention is basically the same as the embodiments of the faulty webpage repair method described above, and will not be repeated here.

[0188] In addition, a device for repairing faulty web pages is also provided. For example... Figure 4 As shown, Figure 4 This is a schematic diagram of the hardware operating environment involved in the embodiments of the present invention.

[0189] It should be noted that, Figure 4 This can be a schematic diagram of the hardware operating environment of a device for repairing faulty web pages. According to embodiments of the present invention, the device for repairing faulty web pages can be a PC, a portable computer, or other terminal device.

[0190] like Figure 4 As shown, the device for repairing the faulty webpage may include: a processor 1001, such as a CPU; a memory 1005; a user interface 1003; a network interface 1004; and a communication bus 1002. The communication bus 1002 is used to establish communication between these components. The user interface 1003 may include a display screen and an input unit such as a keyboard; optionally, the user interface 1003 may also include a standard wired interface or a wireless interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface). The memory 1005 may be high-speed RAM or non-volatile memory, such as a disk drive. Optionally, the memory 1005 may also be a storage device independent of the aforementioned processor 1001.

[0191] Those skilled in the art will understand that Figure 4The structure of the repair device for the faulty webpage shown does not constitute a limitation on the repair device for the faulty webpage. It may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0192] like Figure 4 As shown, the memory 1005, which serves as a computer storage medium, may include an operating system, a network communication module, a user interface module, and a repair program for faulty web pages. The operating system is a program that manages and controls the hardware and software resources of the faulty web page repair device, supporting the operation of the faulty web page repair program and other software or programs.

[0193] exist Figure 4 In the faulty webpage repair device shown, the user interface 1003 is mainly used for the server side to communicate with the server, such as obtaining repair files from the server; the network interface 1004 is mainly used for the backend server to communicate with the backend server; the processor 1001 can be used to call the faulty webpage repair program stored in the memory 1005 and execute the steps of the faulty webpage repair method as described above.

[0194] The specific implementation of the faulty webpage repair device according to the present invention is basically the same as the embodiments of the faulty webpage repair method described above, and will not be repeated here.

[0195] Furthermore, according to embodiments of the present invention, a computer-readable storage medium is also provided, wherein a repair program for a faulty webpage is stored on the computer-readable storage medium, and when the repair program for the faulty webpage is executed by a processor, the steps of the faulty webpage repair method described above are implemented.

[0196] The specific embodiments of the computer-readable storage medium according to the present invention are basically the same as the embodiments of the above-described method for repairing faulty web pages, and will not be described again here.

[0197] It should be noted that, in this document, 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 that element.

[0198] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0199] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of the present invention.

[0200] The above are merely preferred embodiments of the present invention and do not limit the patent scope of the present invention. Any equivalent structural or procedural transformations made based on the content of the present invention's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of the present invention.

Claims

1. A method for repairing faulty web pages, characterized in that, The method for repairing the faulty webpage includes the following steps: Once the browser is started, it is checked whether there is a target webpage in a faulty state in the webpage corresponding to the browser; If the target webpage is detected in the webpage corresponding to the browser, then the repair script corresponding to the target webpage is obtained; The target webpage is repaired using the repair script; The step of detecting whether a target webpage in a faulty state exists in the webpage corresponding to the browser after it is determined that the browser has started includes: Once the browser is started, check whether an access request to access the browser has been received; If the access request is received, the webpage code of the webpage corresponding to the access request is obtained, as well as the preset code; If the webpage code is inconsistent with the preset code, then the webpage corresponding to the access request is determined to be the target webpage.

2. The method for repairing faulty web pages as described in claim 1, characterized in that, The step of obtaining the repair script corresponding to the target webpage if the target webpage is detected in the webpage corresponding to the browser includes: If the target webpage is detected in the webpage corresponding to the browser, then the version number of the browser is obtained; Obtain the repair script corresponding to the target webpage based on the version number.

3. The method for repairing faulty web pages as described in claim 1, characterized in that, The step of obtaining the repair script corresponding to the target webpage if the target webpage is detected in the webpage corresponding to the browser includes: If the target webpage is detected in the webpage corresponding to the browser, then the target URL corresponding to the target webpage is determined; Obtain the repair script corresponding to the target webpage based on the target URL.

4. The method for repairing faulty web pages as described in claim 3, characterized in that, The step of obtaining the repair script corresponding to the target webpage based on the target URL includes: Obtain the repair script corresponding to the target URL, and check whether the target URL corresponds to at least two repair scripts; If it is detected that the target URL corresponds to only one repair script, then the repair script corresponding to the target URL is determined as the repair script corresponding to the target webpage; If it is detected that the target URL corresponds to at least two repair scripts, then the repair scripts corresponding to the target URL are compared using an information digest algorithm to determine the latest repair script among the repair scripts corresponding to the target URL, and the latest repair script is determined as the repair script corresponding to the target webpage.

5. The method for repairing faulty web pages as described in claim 1, characterized in that, After the step of obtaining the repair script corresponding to the target webpage if the target webpage is detected in the webpage corresponding to the browser, the method further includes: Upon detecting a loading instruction to load the target webpage, the target webpage is loaded according to the loading instruction; After successfully loading the target webpage, the step of repairing the target webpage using the repair script includes: The repair script is injected into the target webpage to repair the target webpage that is in a faulty state.

6. The method for repairing faulty web pages as described in claim 5, characterized in that, The step of injecting the repair script into the target webpage to repair the target webpage in a faulty state includes: Render the target webpage to obtain the rendered target webpage; The repair script is injected into the rendered target webpage to repair the target webpage that is in a faulty state.

7. The method for repairing faulty web pages as described in claim 1, characterized in that, Before the step of detecting whether a target webpage in a faulty state exists in the webpage corresponding to the browser after it is determined that the browser has started, the method further includes: Once a request to obtain the repair script is detected, the communication information of the server is determined based on the request. The repair script stored on the server is obtained based on the communication information, and the obtained repair script is stored.

8. The method for repairing faulty web pages as described in claim 1, characterized in that, The step of detecting whether a target webpage in a faulty state exists in the webpage corresponding to the browser after it is determined that the browser has started also includes: Once the browser is started, check whether an access request to access the browser has been received; If the access request is received, the URL of the webpage corresponding to the access request is obtained; If it is determined that the webpage URL exists in the repair URL library corresponding to the pre-stored repair script, then the webpage corresponding to the access request is determined to be the target webpage in a faulty state.

9. The method for repairing faulty web pages as described in claim 1, characterized in that, The step of detecting whether a target webpage in a faulty state exists in the webpage corresponding to the browser after it is determined that the browser has started also includes: Once the browser is launched, retrieve the pre-stored detection tools; The detection tool is used to detect whether there is a target business system in an abnormal state in the business system corresponding to the browser. If the target business system is detected to exist in the business system corresponding to the browser, then it is detected whether there is a target webpage in a faulty state in the webpage corresponding to the target business system.

10. A device for repairing faulty web pages, characterized in that, The device for repairing faulty web pages includes: The detection module is used to detect whether there is a target webpage in a faulty state in the webpage corresponding to the browser after it is determined that the browser has started. The acquisition module is used to acquire the repair script corresponding to the target webpage if the target webpage is detected in the webpage corresponding to the browser. The repair module is used to repair the target webpage using the repair script; The detection module includes: The first detection unit is used to detect whether an access request to the browser has been received after the browser is determined to be launched. The second acquisition unit is used to acquire the webpage code of the webpage corresponding to the access request and to acquire a preset code if the access request is received. The second determining unit is used to determine the webpage corresponding to the access request as the target webpage if the webpage code is inconsistent with the preset code.

11. The device for repairing faulty web pages as claimed in claim 10, characterized in that, The acquisition module is further configured to, if the target webpage is detected to exist in the webpage corresponding to the browser, acquire the browser version number; and acquire the repair script corresponding to the target webpage based on the version number.

12. The device for repairing faulty web pages as claimed in claim 10, characterized in that, The acquisition module includes: The first determining unit is configured to determine the target URL corresponding to the target webpage if the target webpage is detected to exist in the webpage corresponding to the browser. The first acquisition unit is used to acquire the repair script corresponding to the target webpage based on the target URL.

13. The device for repairing faulty web pages as claimed in claim 12, characterized in that, The first acquisition unit includes: A sub-unit is used to obtain the repair script corresponding to the target URL; The detection subunit is used to detect whether the target URL corresponds to at least two repair scripts; The determination subunit is used to determine the repair script corresponding to the target URL as the repair script corresponding to the target webpage if it is detected that the target URL corresponds to only one repair script; The comparison subunit is used to compare the repair scripts corresponding to the target URL using an information digest algorithm if it is detected that the target URL corresponds to at least two repair scripts, so as to determine the latest repair script among the repair scripts corresponding to the target URL. The determining subunit is used to determine the latest repair script as the repair script corresponding to the target webpage.

14. The device for repairing faulty web pages as claimed in claim 10, characterized in that, The device for repairing faulty web pages also includes: A loading module is used to load the target webpage according to the loading instruction after detecting a loading instruction to load the target webpage; The repair module is also used to inject the repair script into the target webpage after the target webpage is successfully loaded, so as to repair the target webpage in a faulty state.

15. The device for repairing faulty web pages as claimed in claim 14, characterized in that, The repair module includes: A rendering unit is used to render the target webpage to obtain the rendered target webpage. An injection unit is used to inject the repair script into the rendered target webpage to repair the target webpage that is in a faulty state.

16. The device for repairing faulty web pages as claimed in claim 10, characterized in that, The device for repairing faulty web pages also includes: The determination module is used to determine the communication information of the server based on the acquisition instruction after detecting the acquisition instruction for obtaining the repair script; The acquisition module is also used to acquire the repair script stored on the server based on the communication information; The device for repairing faulty web pages also includes: The storage module is used to store the acquired repair scripts.

17. The device for repairing faulty web pages as claimed in claim 10, characterized in that, The detection module also includes: The second detection unit is used to detect whether an access request to the browser has been received after the browser is determined to be launched. The third acquisition unit is used to acquire the webpage URL of the webpage corresponding to the access request if the access request is received. The third determining unit is used to determine that the webpage corresponding to the access request is a target webpage in a faulty state if it is determined that the webpage URL exists in the repair URL library corresponding to the pre-stored repair script.

18. The device for repairing faulty web pages as claimed in claim 10, characterized in that, The detection module also includes: The fourth acquisition unit is used to acquire the pre-stored detection tools after it is determined that the browser has started. The third detection unit is used to detect, through the detection tool, whether there is a target business system in an abnormal state in the business system corresponding to the browser; If the target business system is detected to exist in the business system corresponding to the browser, then it is detected whether there is a target webpage in a faulty state in the webpage corresponding to the target business system.

19. A device for repairing faulty web pages, characterized in that, The device for repairing faulty web pages includes a memory, a processor, and a repair program for faulty web pages stored in the memory and executable on the processor. When the repair program for faulty web pages is executed by the processor, it implements the steps of the method for repairing faulty web pages as described in any one of claims 1 to 9.

20. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a repair program for a faulty webpage, which, when executed by a processor, implements the steps of the faulty webpage repair method as described in any one of claims 1 to 9.

Citation Information

Patent Citations

  • Browser page display method and device as well as browser and terminal

    CN104346403A

  • Browser compatibility method and browser

    CN106354484A