CN110912918A - Page repairing method and device - Google Patents

Page repairing method and device Download PDF

Info

Publication number
CN110912918A
CN110912918A CN201911212369.8A CN201911212369A CN110912918A CN 110912918 A CN110912918 A CN 110912918A CN 201911212369 A CN201911212369 A CN 201911212369A CN 110912918 A CN110912918 A CN 110912918A
Authority
CN
China
Prior art keywords
page
website
illegal
file
elements
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201911212369.8A
Other languages
Chinese (zh)
Inventor
季纯杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Taikang Insurance Group Co Ltd
Taikang Online Property Insurance Co Ltd
Original Assignee
Taikang Insurance Group Co Ltd
Taikang Online Property Insurance Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Taikang Insurance Group Co Ltd, Taikang Online Property Insurance Co Ltd filed Critical Taikang Insurance Group Co Ltd
Priority to CN201911212369.8A priority Critical patent/CN110912918A/en
Publication of CN110912918A publication Critical patent/CN110912918A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/14Network architectures or network communication protocols for network security for detecting or protecting against malicious traffic
    • H04L63/1441Countermeasures against malicious traffic
    • H04L63/1483Countermeasures against malicious traffic service impersonation, e.g. phishing, pharming or web spoofing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • G06F16/986Document structures and storage, e.g. HTML extensions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/45Network directories; Name-to-address mapping
    • H04L61/4505Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols
    • H04L61/4511Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols using domain name system [DNS]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • General Engineering & Computer Science (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The embodiment of the invention provides a page repairing method and device, which are used for acquiring a first page when a terminal device displays the first page corresponding to a first website, and then judging whether the first page contains illegal elements or not according to a second page. And if the first page contains illegal elements, redirecting the first website domain name to a second website, and repairing the first page according to the second website so that the repaired first page displays the product information of the target product in compliance. By adopting the method, on one hand, the product information page is ensured to be always in compliance when a user purchases the product online, on the other hand, the product information page is automatically repaired and continuously monitored, the accuracy and the working efficiency are improved, and the cost is greatly saved.

Description

Page repairing method and device
Technical Field
The embodiment of the invention relates to the technical field of internet, in particular to a page repairing method and device.
Background
As product iterative updates are accelerated and the number of collaboratable internet channels increases, more and more merchants sell products through internet channels.
Generally, when a product is purchased through an internet channel, after a user selects the product, a page containing product information is pushed to a terminal device of the user. The non-compliant page has a risk of misleading the consumer, so in order to ensure the compliance of the product information page, the page needs to be checked. The checking process comprises the steps of judging whether the product information displayed on the page has illegal characters, if so, determining that the page is illegal, and requiring a technician to modify the page until the page is on line after compliance.
In the page repairing process, the illegal pages are modified in a manual mode, so that the efficiency is low, the accuracy is low and the cost is high.
Disclosure of Invention
The embodiment of the invention provides a page repairing method and device, when a page is not in compliance, the page which is not in compliance is automatically repaired according to the page which is in compliance, and the method and device are high in efficiency, high in accuracy and low in cost.
In a first aspect, the present invention provides a page repairing method, including:
when terminal equipment displays a first page corresponding to a first website, acquiring the first page;
judging whether the first page contains illegal elements or not according to a second page;
if the first page contains illegal elements, redirecting the first website domain name to the second website;
and repairing the first page according to a second website, so that the product information meeting the target product is displayed on the repaired first page.
In one possible design, the current product information of the target product is displayed on the first page; displaying product information of the target product compliance on the second page; the second website is a website corresponding to the second page.
In a possible design, if the first page includes an illegal element, repairing the first page according to a second website includes:
if the first page contains illegal elements, determining the illegal elements from the first page;
determining a first file from the first file set, wherein the first file set is a file set corresponding to the first website, and the first file is a file where the illegal element is located;
determining a second file from the second file set, wherein the second file set is a file set corresponding to the second website, and the name of the second file is the same as that of the first file;
and replacing a first file in the first file set by using the second file to repair the first page.
In a feasible design, when the terminal device displays a first page corresponding to the first website, before acquiring the first page, the method further includes:
when the terminal equipment displays an initial page corresponding to the first website, acquiring the initial page;
judging whether illegal elements exist in the initial page or not;
and if the illegal elements do not exist in the initial page, generating the second website according to the first website, and generating the second page according to the initial page.
In a possible design, after determining whether there is an illegal element in the initial page, the method further includes:
if the initial page has the illegal elements, repairing the initial page so that the initial page does not contain the illegal elements;
and generating the second website according to the first website, and generating the second page according to the repaired initial page.
In a possible design, the determining whether an illegal element exists in the initial page includes:
establishing an illegal element library;
extracting elements to be recognized from the initial page;
judging whether the element to be identified is contained in the illegal element library or not;
if the element to be identified is contained in the illegal element library, determining that the element to be identified is an illegal element; and if the element to be identified is not contained in the illegal element library, determining that the element to be identified is an illegal element.
In a possible design, the determining whether the first page includes an illegal element according to the second page includes:
normalizing the first histogram of the first page to obtain a first normalization result;
normalizing the second histogram of the second page to obtain a second normalization result;
judging whether the similarity of the first normalization result and the second normalization result exceeds a preset threshold value or not;
if the similarity exceeds the preset threshold, determining that the first page does not contain illegal elements; and if the similarity does not exceed the preset threshold, determining that the first page contains illegal elements.
In one possible design, the illegal elements include illegal characters and/or illegal images.
In a second aspect, an embodiment of the present invention provides a page repairing apparatus, including:
the acquisition module is used for acquiring a first page corresponding to a first website when the terminal equipment displays the first page, and the first page displays the current product information of a target product;
the first judging module is used for judging whether the first page contains illegal elements or not according to a second page, and the second page displays the product information of the target product compliance;
a redirection module, configured to redirect the first website domain name to the second website if the first page includes an illegal element;
and the first repairing module is used for repairing the first page according to a second website after the first website domain name is redirected to the second website, so that the product information which is in compliance with the target product is displayed on the repaired first page, and the second website is a website corresponding to the second page.
In a feasible design, the first repairing module is configured to determine, if the first page includes an illegal element, the illegal element from the first page, determine a first file from the first file set, where the first file set is a file set corresponding to the first website, where the first file is a file in which the illegal element is located, determine, from the second file set, a second file that is a file set corresponding to the second website, where the second file has a same name as the first file, and replace, with the second file, the first file in the first file set, so as to repair the first page.
In one possible design, the apparatus further comprises: a second determining module, configured to, before the obtaining module obtains the first page, obtain the initial page when the terminal device displays the initial page corresponding to the first website, determine whether an illegal element exists in the initial page, if the illegal element does not exist in the initial page, generate the second website according to the first website, and generate the second page according to the initial page.
In one possible design, the apparatus further comprises: a second repairing module, configured to, after the second determining module, repair the initial page if an illegal element exists in the initial page, so that the initial page does not include the illegal element, generate the second website according to the first website, and generate the second page according to the repaired initial page.
In a feasible design, the second determining module is configured to, when determining whether an illegal element exists in the initial page, establish an illegal element library, extract an element to be identified from the initial page, determine whether the element to be identified is included in the illegal element library, and if the element to be identified is included in the illegal element library, determine that the element to be identified is an illegal element; and if the element to be identified is not contained in the illegal element library, determining that the element to be identified is an illegal element.
In a feasible design, the first determining module is configured to determine whether the first page includes an illegal element according to the second page, normalize a first histogram of the first page to obtain a first normalization result, normalize a second histogram of the second page to obtain a second normalization result, determine whether a similarity between the first normalization result and the second normalization result exceeds a preset threshold, and determine that the first page does not include the illegal element if the similarity exceeds the preset threshold; and if the similarity does not exceed the preset threshold, determining that the first page contains illegal elements.
In one possible design, the illegal elements include illegal characters and/or illegal images.
In a third aspect, an embodiment of the present invention provides an electronic device, which includes a processor, a memory, and a computer program stored in the memory and executable on the processor, and the processor executes the computer program to implement the method according to the first aspect or the various possible implementations of the first aspect.
In a fourth aspect, embodiments of the present invention provide a storage medium, which stores instructions that, when executed on an electronic device, cause the electronic device to perform the method according to the first aspect or any of the possible implementations of the first aspect.
In a fifth aspect, embodiments of the present invention provide a computer program product, which, when run on an electronic device, causes the electronic device to perform the method according to the first aspect or the various possible implementations of the first aspect.
The embodiment of the invention provides a method and a device for repairing a page, which are used for acquiring a first page when a terminal device displays the first page corresponding to a first website, and then judging whether the first page contains illegal elements or not according to a second page. And if the first page contains illegal elements, redirecting the first website domain name to the second website, and repairing the first page according to the second website so that the repaired first page displays the product information of the target product in compliance. By adopting the method, on one hand, the product information page is ensured to be always in compliance when a user purchases the product online, on the other hand, the product information page is automatically repaired and continuously monitored, the accuracy and the working efficiency are improved, and the cost is greatly saved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a flowchart of a page repairing method according to an embodiment of the present invention;
fig. 2 is a page review flow chart adapted to the page repairing method provided in the embodiment of the present invention;
fig. 3 is a schematic structural diagram of a page repairing apparatus according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of another page repairing apparatus according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 1 is a flowchart of a page repairing method according to an embodiment of the present invention. The present embodiment is explained from the perspective of an electronic device, and as shown in fig. 1, the page repairing method provided in the present embodiment includes:
101. and when the terminal equipment displays a first page corresponding to the first website, acquiring the first page, and displaying the current product information of the target product on the first page.
In the embodiment of the invention, the target product can be an insurance product and the like and can be released through various channels. For example, if the target product is an aviation accident risk, the target product can be released through a portable network; if the target product is a return claim insurance, the target product can be published through a shopping website. In order to avoid that the released target product is not compliant, compliance verification needs to be performed on the page displaying the product information of the target product. The compliance audit refers to whether characters, pictures and the like misleading the customer exist in the product information displayed on the audit page or not, or whether the audit product information is not in accordance with the reality or not.
In the embodiment of the invention, the compliance audit comprises initial audit and recheck. In the initial examination, a user enters an initial page of a first website by clicking a link, inputting the website and the like, and the electronic equipment acquires the initial page, for example, when the electronic equipment is terminal equipment, the electronic equipment captures a screen and stores the initial page; for another example, when the electronic device is a server, the terminal device captures an initial page and sends the initial page obtained by capturing the screen to the server, so that the server obtains the initial page. And then, the electronic equipment judges whether the illegal elements exist in the initial page, if the electronic equipment judges that the illegal elements do not exist in the initial page, a second website is generated according to the first website, a second page is generated according to the initial page, the second page displays the product information of the target product compliance, and when the electronic equipment is actually realized, the electronic equipment can store the second page in a picture form. Wherein the second web address may be referred to as a backup web address of the first web address.
And then, the electronic equipment acquires a first page corresponding to the first website irregularly or periodically, rechecks the first page, and repairs the first page when the recheck fails so as to ensure that the product information page displayed to the user is always in compliance. And during review, simulating a business process of purchasing a target product on the internet by a user, so that the terminal equipment displays a current page, namely a first page, corresponding to the first website, wherein the first page may be the same as or different from the initial page. The electronic equipment acquires the first page and stores the first page in a picture format. For example, the electronic device simulates a user to log in a portable web site to purchase an airplane ticket, clicks a link of an accident risk, enters a product information page of the accident risk, then captures a screen and stores the product information page of the accident risk, and the product information page displays detailed information or brief information of the accident risk and the like. The monitoring period may be set according to an actual situation, and this embodiment does not specifically limit the monitoring period.
102. And judging whether the first page contains illegal elements or not according to a second page, wherein the second page displays the product information of target product compliance.
In the embodiment of the present invention, during review, the electronic device calls a second page that is pre-stored and displays product information that the target product conforms to, and compares the second page with the first page picture obtained in step 101 to determine whether the first page contains an illegal element. If the illegal elements appear on the first page, the first page needs to be repaired until the first page does not contain the illegal elements. Illustratively, a perceptual hash algorithm is used for comparing the similarity of the pictures, if the similarity is low, the first page is judged to contain illegal elements, and the first page is repaired, otherwise, if the similarity is high, the first page is judged not to contain illegal elements, and the first page is a compliant product information page and can be displayed for a user to know and purchase a target product. Wherein the illegal elements comprise illegal pictures and illegal characters. The method for comparing the second page with the first page comprises a perceptual hash algorithm, a histogram method, an image template matching method and the like. The operation principle of these methods will be described in detail below.
The working principle of the perceptual hash algorithm includes 1) scaling the image to a certain size (e.g., 8 × 8); 2) converting the image into gray scale (such as 64-level gray scale); 3) calculating the average value of all pixels; 4) comparing the gray levels of the pixels, namely comparing the gray level of each pixel with the average value, wherein the average value which is greater than or equal to the gray level of each pixel is marked as 1, and the average value which is smaller than the gray level of each pixel is marked as 0; 5) and calculating a hash value, namely combining the comparison results of the previous step together to form a 64-bit integer, so as to obtain the fingerprint of the picture. After the fingerprint is obtained, different pictures can be compared to see how many of the 64 bits are different. In theory, this is equivalent to calculating the "Hamming distance" (Hamming distance). If the different data bits do not exceed 5, the two pictures are very similar; if it is greater than 10, it is indicated that these are two different pictures.
The working principle of the histogram method is as follows: there are two images patch (or the whole image), the histograms of the two images are calculated respectively, and normalized, and then the similarity is measured according to some distance measurement standard. The method measures the image similarity based on simple vector similarity.
The working principle of the image template matching method is as follows: generally, if the source image and the template image are the same in size, the method of image similarity measurement can be directly used; if the source image is not the same size as the template image, a sliding matching window is usually required to scan the entire image to obtain the best matching patch. The method can adopt a corresponding function matchTemplate () in OpenCV, wherein the function is to search the similarity between each position and a template image patch by sliding a window in an input image. The embodiment does not specifically limit the image comparison method
103. And if the first page contains the illegal elements, redirecting the domain name of the first website to a second website.
In the embodiment of the invention, if the electronic equipment determines that the first page contains illegal elements, the first website which is simulating the login of a user and is being switched to the second website by the electronic equipment through the domain name redirection technology, wherein the second website is the website corresponding to the information page of the compliance product. Illustratively, when the electronic device simulates that a user logs in a portable web site to purchase an accident risk attached to an airline ticket, if a logged accident risk product page causes misleading to a purchasing behavior of the user due to the existence of illegal characters or illegal pictures, after the electronic device detects that the accident risk page has illegal elements, the website of the user is guided to the website corresponding to a backed-up compliant accident risk product information page through a domain name redirection technology, so that the user can continue to purchase the accident risk without influencing the shopping of the user. The domain name redirection is to guide a user who visits your current domain name to another network address specified by your through special setting of the server.
104. And repairing the first page according to a second website, so that the repaired first page displays the product information of the target product in compliance, wherein the second website is a website corresponding to the second page.
In the embodiment of the invention, one website corresponds to one file set, the file set stores a plurality of files and/or folders, and the product information displayed on the page corresponding to the website is contained in one or more files in the file set. Repairing a page is essentially the process of replacing a file or files in a collection of files with the correct file. Repairing the first page according to the second website, determining an illegal element from the first page, and determining a first file from the first file set, wherein the first file set is a file set corresponding to the first website, and the first file is a file where the illegal element is located. Then, the electronic equipment determines a second file from the second file set, wherein the second file set is a file set corresponding to the second website, and the name of the second file is the same as that of the first file; finally, the electronic device replaces the first file in the first file set with the second file to repair the first page. The replacement technology for replacing the first file with the second file includes linux common replacement and custom program replacement, and the replacement technology is not specifically limited in this embodiment.
The embodiment of the invention provides a page repairing method, which comprises the steps of obtaining a first page corresponding to a first website when a terminal device displays the first page, and then judging whether the first page contains illegal elements or not according to a stored second page. And if the first page contains illegal elements, redirecting the first website domain name to a second website, and repairing the first page according to the second website so that the repaired first page displays the product information of the target product in compliance. By adopting the method, on one hand, the product information page is ensured to be always in compliance when a user purchases the product online, on the other hand, the product information page is automatically repaired and continuously monitored, the accuracy and the working efficiency are improved, and the cost is greatly saved.
Fig. 2 is a page review flow chart adapted to the page repairing method provided in the embodiment of the present invention. The embodiment is explained from the perspective of the electronic device, and as shown in fig. 2, the page review process includes a primary review stage, a repair stage, and a secondary review stage. These stages will be described in detail below.
First, a primary audit stage
In the embodiment of the invention, the electronic equipment stores the illegal character library in advance as shown in table 1. When the electronic equipment is used for primarily checking a target product information page, firstly, a user shopping process is simulated, a first website is clicked, an initial page containing target product information is accessed, the electronic equipment obtains the initial page, then an element to be identified is extracted from the initial page and whether the element to be identified is contained in an illegal element library is judged, and if the element to be identified is contained in the illegal element library, the element to be identified is determined to be an illegal element; and if the element to be recognized is not contained in the illegal element library, determining that the element to be recognized is not an illegal element. And if the illegal elements do not exist in the initial page, generating a second website according to the first website, and generating a second page according to the initial page. And if the illegal elements exist in the initial page, repairing the initial page until the initial page does not contain the illegal elements, generating a second website according to the first website, and generating a second page according to the repaired initial page.
For example, when the electronic device performs initial review on the accident information page of the XX insurance company, the electronic device first simulates a behavior that a user purchases an airline ticket on a portable network station, clicks an additional accident, jumps to enter the accident information page, namely an initial page, corresponding to a first website http:// xxx. If the initial page is found to contain the illegal characters such as 'hundred percent guarantee' in the illegal character library, the initial page is considered to contain the illegal elements, and the initial page cannot pass the primary examination and needs to be repaired. And deleting the illegal elements on the initial page by the electronic equipment, and then re-auditing the repaired initial page until the initial page does not contain all the illegal characters in the table 1, and then considering that the initial auditing is passed. And finally, backing up the first website as a second website http:// xxx. During the initial review, if the initial page does not contain any illegal characters in the table 1, the review is considered to be passed, the first website address "http:// xxx. The second web address is stored on the electronic device as a set of files, and as shown in table 2, the second page is a file under the set of files, and the storage address of the file is "https:// xxx.
The above is only an example, and in the example, only the illegal character is taken as an example to explain how to determine the illegal element in the initial review, and in practice, the illegal character is not limited, and the illegal element also includes illegal syntax, and the like, and the specific limitation is not provided here.
TABLE 1
Serial number Illegal character
1 Maximum severity
2 Hundredth percent
TABLE 2
Figure BDA0002298486220000091
Figure BDA0002298486220000101
Second, a review stage.
In the embodiment of the invention, the electronic equipment continuously monitors the product information page which passes the first audit so as to prevent the misleading of the purchasing behavior of the user due to any tampering of the compliant product information page. And during review, when the electronic equipment displays a first page corresponding to the first website, acquiring the first page, and judging whether the first page contains illegal elements or not according to the second page. If the first page has no illegal elements, the review is finished, and if the first page has illegal elements, the page repairing stage is entered. Specifically, the electronic device presets a preset threshold for comparing two pages. Firstly, a user shopping process is simulated, a first page containing target product information is entered, and the first page is obtained corresponding to a first website. Then, normalizing the first histogram of the first page to obtain a first normalization result, and simultaneously normalizing the second histogram of the second page to obtain a second normalization result, and then, judging whether the similarity between the first normalization result and the second normalization result exceeds a preset threshold, if the similarity exceeds the preset threshold, determining that the first page does not contain illegal elements, and if the similarity does not exceed the preset threshold, determining that the first page contains illegal elements, wherein the specific judgment method is shown in table 3. And displaying the product information of the target product in compliance on the second page, and displaying the current product information of the target product on the first page. Here, the page similarity may be defined as an absolute value of a difference between two page normalization results, and the similarity is compared with a preset threshold. The embodiment does not limit the specific calculation method of the similarity.
TABLE 3
Comparing the page similarity with a preset threshold value Whether the first page contains an illegal element
<Desired threshold Whether or not
>Expected threshold value Is that
For example, the electronic device presets the expected threshold of page matching to be 0.2. Firstly, the square angle of the first page and the square angle of the second page are calculated, the two square angles are normalized and respectively correspond to 0.6 and 0.7, the similarity of the two pages is |0.7-0.6| -0.1, and 0.1<0.2, so that the first page does not contain illegal elements. For another example, the histogram normalization of the two pages respectively corresponds to 0.4 and 0.8, and the similarity of the two pages is calculated to be |0.8-0.4| -0.4, and 0.4>0.2, so the first page contains illegal elements.
And thirdly, a page repairing stage.
In the embodiment of the invention, after the electronic equipment determines that the first page has the illegal elements, the electronic equipment firstly jumps to the second page corresponding to the second website through domain name redirection, so that the shopping behavior of the user is not influenced, and then the first page is repaired according to the second website. When the first page is repaired, the electronic equipment determines illegal elements from the first page. And then determining a first file from the first file set, determining a second file from the second file set, and replacing the first file in the first file set with the second file to repair the first page. The first file set is a file set corresponding to the first website, the first file is a file where the illegal element is located, the second file set is a file set corresponding to the second website, and the name of the second file is the same as that of the first file. In practice, the web site is stored on the electronic device in the form of a file set, under which a plurality of files and/or subfolders are located, corresponding to pages, scripts, materials and styles, respectively. The first file corresponds to the first page, is stored in the first file set, and displays the target product information, and similarly, the second file corresponds to the second page, is stored in the second file set, and displays the compliant product information, and the structure shown in table 4 is stored in the electronic device.
TABLE 4
Figure BDA0002298486220000111
For example, a user logs in a portable web site, purchases airline tickets to los angeles and accident risk 24/12/2019, and opens an additional accident risk page provided by XX insurance company, wherein the page displays information of the accident risk and corresponds to a first page, and the page has characters of 'hundred percent guarantee'. The electronic equipment captures a screen and stores a first page, the first page and a second page are compared through a histogram method, the fact that the first page contains illegal elements is determined, and the illegal elements are further positioned to be illegal character 'percent guarantee'. Looking up a table 1 to obtain a second website 'https:// xxx.ai-back.com' corresponding to the first website 'https:// xxx.ai.com', jumping the first website displayed on the user terminal to the second website by using a domain name redirection technology, presenting the second website to the user, displaying the detailed information of the products in compliance on the page, and allowing the user to continuously read the detailed information of the accident risk and finish purchasing. The domain name redirection is to guide a user who visits your current domain name to another network address specified by your through special setting of the server. And looking up a table 5 to obtain a first file storage address of https:// xxx.ai.com/ai02.html, searching a second file with a file name of ai02.html under a file set of a second website, wherein the storage address of the second file is https:// xxx.ai-back.com/ai02.html, and finally replacing the first file with the second file to repair the first page, so that illegal elements of hundred percent security do not appear on the first page. Table 5 shows the memory addresses of the first page where the illegal character is located and the second page of the compliant product information. The file replacement technology comprises linux common replacement and custom program replacement. The embodiment is not particularly limited.
TABLE 5
Figure BDA0002298486220000121
Final, secondary audit
In the embodiment of the invention, the electronic equipment can perform secondary verification on the repaired first page, including verification of characters and/or pictures, and can perform verification by adopting a one-by-one comparison method and/or a picture comparison method of the characters of the first page and illegal characters in an illegal character library to determine whether illegal elements exist in the first page. And if other illegal elements still exist in the first page during secondary examination, performing repair operation on the first page by adopting a file replacement technology until the first page does not contain any illegal elements. And jumping the second website displayed on the user terminal to the first website by utilizing a domain name redirection technology, and presenting the second website to a first page of the user, wherein the page is a repaired compliance product information page. And finally, storing the first page and the first website for updating the second page and the second website.
By adopting the scheme of the embodiment, when the terminal device displays the first page corresponding to the first website, the first page is obtained, and then whether the first page contains illegal elements or not is judged according to the second page. And if the first page contains illegal elements, redirecting the first website domain name to a second website, and repairing the first page according to the second website so that the repaired first page displays the product information of the target product in compliance. By adopting the method, on one hand, the product information page is ensured to be always in compliance when a user purchases the product online, on the other hand, the product information page is automatically repaired and continuously monitored, the accuracy and the working efficiency are improved, and the cost is greatly saved.
The following are embodiments of the apparatus of the present invention that may be used to perform embodiments of the method of the present invention. For details which are not disclosed in the embodiments of the apparatus of the present invention, reference is made to the embodiments of the method of the present invention.
Fig. 3 is a schematic structural diagram of a page repairing apparatus according to an embodiment of the present invention. The page repairing apparatus 100 may be implemented by software and/or hardware. As shown in fig. 3, the page repairing apparatus 100 includes:
the acquisition module 11 is configured to acquire a first page when the terminal device displays the first page corresponding to the first website, where the first page displays current product information of a target product;
the first judging module 12 is configured to judge whether the first page includes an illegal element according to a second page, where product information that meets the target product is displayed on the second page;
a redirection module 13, configured to redirect the first website domain name to a second website if the first page includes an illegal element;
the first repairing module 14 is configured to repair the first page according to the second website after the first website domain name is redirected to the second website, so that the product information that the target product is compliant is displayed on the repaired first page, where the second website is a website corresponding to the second page.
In a feasible implementation manner, the first repairing module 14 is configured to determine, if the first page includes an illegal element, the illegal element from the first page, determine a first file from the first file set, where the first file set is a file set corresponding to the first website, the first file is a file in which the illegal element is located, determine, from the second file set, a second file that is a file set corresponding to the second website, where the second file has a same name as the first file, and replace the first file in the first file set with the second file to repair the first page.
In a feasible implementation manner, the first determining module 12 is configured to determine whether the first page includes an illegal element according to the second page, normalize the first histogram of the first page to obtain a first normalization result, normalize the second histogram of the second page to obtain a second normalization result, determine whether a similarity between the first normalization result and the second normalization result exceeds a preset threshold, and determine that the first page does not include the illegal element if the similarity exceeds the preset threshold; and if the similarity does not exceed the preset threshold, determining that the first page contains illegal elements.
In a possible implementation manner, in the first determining module 12, the illegal elements include illegal characters and/or illegal images.
Fig. 4 is a schematic structural diagram of another page repairing apparatus according to an embodiment of the present invention. Referring to fig. 4, the page repairing apparatus 100 provided in this embodiment further includes, on the basis of fig. 3:
the second determining module 15 is configured to, before the obtaining module 11 obtains the first page, obtain the initial page when the terminal device displays the initial page corresponding to the first website, determine whether an illegal element exists in the initial page, if the illegal element does not exist in the initial page, generate a second website according to the first website, and generate a second page according to the initial page.
A second repairing module 16, configured to, after the second determining module 15, repair the initial page if an illegal element exists in the initial page, so that the initial page does not include the illegal element, generate a second website according to the first website, and generate a second page according to the repaired initial page.
In a feasible implementation manner, the second determining module 15 is configured to, when determining whether an illegal element exists in an initial page, establish an illegal element library, extract an element to be identified from the initial page, determine whether the element to be identified is included in the illegal element library, and if the element to be identified is included in the illegal element library, determine that the element to be identified is an illegal element; and if the element to be recognized is not contained in the illegal element library, determining that the element to be recognized is an illegal element.
In a feasible implementation manner, the second repairing module 16 is configured to, after the second determining module 15 determines whether an illegal element exists in the initial page, repair the initial page if the illegal element exists in the initial page, so that the initial page does not include the illegal element, generate the second website according to the first website, and generate the second page according to the repaired initial page.
The page repairing device provided by the embodiment of the application can execute the actions of the electronic equipment in the above embodiments, and the implementation principle and the technical effect are similar, which are not described herein again.
Fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present invention. As shown in fig. 5, the electronic apparatus 200 includes:
at least one processor 21 and memory 22;
the memory 22 stores computer-executable instructions;
the at least one processor 21 executes computer-executable instructions stored by the memory 22, causing the at least one processor 21 to perform the page repair method as described above.
Optionally, the electronic device 200 further comprises a communication component 23. The processor 21, the memory 22, and the communication unit 23 may be connected by a bus 24.
The embodiment of the present invention further provides a storage medium, where the storage medium stores a computer execution instruction, and the computer execution instruction is used to implement the page repairing method described above when being executed by a processor.
The embodiment of the invention also provides a computer program product, and when the computer program product runs on the electronic equipment, the electronic equipment is enabled to execute the page repairing method.
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The program may be stored in a computer-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.

Claims (10)

1. A page repairing method is characterized by comprising the following steps:
when terminal equipment displays a first page corresponding to a first website, acquiring the first page, wherein the first page displays current product information of a target product;
judging whether the first page contains illegal elements or not according to a second page, wherein the second page displays the product information of the target product compliance;
if the first page contains illegal elements, redirecting the first website domain name to a second website;
and repairing the first page according to the second website, so that the repaired first page displays the product information of the target product in compliance, wherein the second website is a website corresponding to the second page.
2. The method of claim 1, wherein repairing the first page according to a second address if the first page contains an illegal element comprises:
if the first page contains illegal elements, determining the illegal elements from the first page;
determining a first file from a first file set, wherein the first file set is a file set corresponding to the first website, and the first file is a file where the illegal element is located;
determining a second file from a second file set, wherein the second file set is a file set corresponding to the second website, and the name of the second file is the same as that of the first file;
and replacing a first file in the first file set by using the second file to repair the first page.
3. The method according to claim 1 or 2, wherein before the acquiring the first page when the terminal device displays the first page corresponding to the first website, the method further comprises:
when the terminal equipment displays an initial page corresponding to the first website, acquiring the initial page;
judging whether illegal elements exist in the initial page or not;
and if the illegal elements do not exist in the initial page, generating the second website according to the first website, and generating the second page according to the initial page.
4. The method of claim 3, wherein after determining whether the illegal element exists in the initial page, further comprising:
if the initial page has the illegal elements, repairing the initial page so that the initial page does not contain the illegal elements;
and generating the second website according to the first website, and generating the second page according to the repaired initial page.
5. The method of claim 3, wherein the determining whether the illegal element exists in the initial page comprises:
establishing an illegal element library;
extracting elements to be recognized from the initial page;
judging whether the element to be identified is contained in the illegal element library or not;
if the element to be identified is contained in the illegal element library, determining that the element to be identified is an illegal element; and if the element to be identified is not contained in the illegal element library, determining that the element to be identified is an illegal element.
6. The method according to claim 1 or 2, wherein said determining whether the first page contains illegal elements according to the second page comprises:
normalizing the first histogram of the first page to obtain a first normalization result;
normalizing the second histogram of the second page to obtain a second normalization result;
judging whether the similarity of the first normalization result and the second normalization result exceeds a preset threshold value or not;
if the similarity exceeds the preset threshold, determining that the first page does not contain illegal elements; and if the similarity does not exceed the preset threshold, determining that the first page contains illegal elements.
7. The method according to claim 1 or 2, characterized in that the illegal elements comprise illegal characters and/or illegal images.
8. A page repairing apparatus, comprising:
the acquisition module is used for acquiring a first page corresponding to a first website when the terminal equipment displays the first page, and the first page displays the current product information of a target product;
the first judging module is used for judging whether the first page contains illegal elements or not according to a second page, and the second page displays the product information of the target product compliance;
the redirection module is used for redirecting the first website domain name to a second website if the first page contains illegal elements;
and the first repairing module is used for repairing the first page according to a second website after the first website domain name is redirected to the second website, so that the product information which is in compliance with the target product is displayed on the repaired first page, and the second website is a website corresponding to the second page.
9. An electronic device comprising a processor, a memory and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the method according to any of the claims 1-7 when executing the program.
10. A storage medium having stored therein instructions that, when run on an electronic device, cause the electronic device to perform the method of any one of claims 1-7.
CN201911212369.8A 2019-12-02 2019-12-02 Page repairing method and device Pending CN110912918A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911212369.8A CN110912918A (en) 2019-12-02 2019-12-02 Page repairing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911212369.8A CN110912918A (en) 2019-12-02 2019-12-02 Page repairing method and device

Publications (1)

Publication Number Publication Date
CN110912918A true CN110912918A (en) 2020-03-24

Family

ID=69821443

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911212369.8A Pending CN110912918A (en) 2019-12-02 2019-12-02 Page repairing method and device

Country Status (1)

Country Link
CN (1) CN110912918A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115129355A (en) * 2022-09-01 2022-09-30 平安银行股份有限公司 Page repairing method and system and computer equipment

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101626368A (en) * 2008-07-11 2010-01-13 中联绿盟信息技术(北京)有限公司 Device, method and system for preventing web page from being distorted
CN102176722A (en) * 2011-03-16 2011-09-07 中国科学院软件研究所 Method and system for preventing page tampering based on front-end gateway
US20120047581A1 (en) * 2010-08-12 2012-02-23 Anirban Banerjee Event-driven auto-restoration of websites
CN103049562A (en) * 2012-12-31 2013-04-17 华为技术有限公司 Method and device for recognizing similar webpages
CN104899320A (en) * 2015-06-18 2015-09-09 安一恒通(北京)科技有限公司 Webpage repair method, terminal, server and system
CN105184159A (en) * 2015-08-27 2015-12-23 深圳市深信服电子科技有限公司 Web page falsification identification method and apparatus
US20160088015A1 (en) * 2007-11-05 2016-03-24 Cabara Software Ltd. Web page and web browser protection against malicious injections
CN106789973A (en) * 2016-12-06 2017-05-31 海信集团有限公司 The safety detecting method and terminal device of the page
CN108073631A (en) * 2016-11-16 2018-05-25 方正国际软件(北京)有限公司 A kind of method and device for preventing advertisement page from changing
CN110300111A (en) * 2019-06-28 2019-10-01 北京金山云网络技术有限公司 Page display method, device, terminal device and server

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160088015A1 (en) * 2007-11-05 2016-03-24 Cabara Software Ltd. Web page and web browser protection against malicious injections
CN101626368A (en) * 2008-07-11 2010-01-13 中联绿盟信息技术(北京)有限公司 Device, method and system for preventing web page from being distorted
US20120047581A1 (en) * 2010-08-12 2012-02-23 Anirban Banerjee Event-driven auto-restoration of websites
CN102176722A (en) * 2011-03-16 2011-09-07 中国科学院软件研究所 Method and system for preventing page tampering based on front-end gateway
CN103049562A (en) * 2012-12-31 2013-04-17 华为技术有限公司 Method and device for recognizing similar webpages
CN104899320A (en) * 2015-06-18 2015-09-09 安一恒通(北京)科技有限公司 Webpage repair method, terminal, server and system
CN105184159A (en) * 2015-08-27 2015-12-23 深圳市深信服电子科技有限公司 Web page falsification identification method and apparatus
CN108073631A (en) * 2016-11-16 2018-05-25 方正国际软件(北京)有限公司 A kind of method and device for preventing advertisement page from changing
CN106789973A (en) * 2016-12-06 2017-05-31 海信集团有限公司 The safety detecting method and terminal device of the page
CN110300111A (en) * 2019-06-28 2019-10-01 北京金山云网络技术有限公司 Page display method, device, terminal device and server

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115129355A (en) * 2022-09-01 2022-09-30 平安银行股份有限公司 Page repairing method and system and computer equipment

Similar Documents

Publication Publication Date Title
RU2613734C1 (en) Video capture in data input scenario
CN108256591B (en) Method and apparatus for outputting information
US9824270B1 (en) Self-learning receipt optical character recognition engine
CN111767228A (en) Interface testing method, device, equipment and medium based on artificial intelligence
CN109766483B (en) Regular expression generation method, device, computer equipment and storage medium
CN110888881A (en) Picture association method and device, computer equipment and storage medium
CN112580047A (en) Industrial malicious code marking method, equipment, storage medium and device
CN113392303A (en) Background blasting method, device, equipment and computer readable storage medium
US11899770B2 (en) Verification method and apparatus, and computer readable storage medium
CN114924959A (en) Page testing method and device, electronic equipment and medium
CN110912918A (en) Page repairing method and device
CN108804501B (en) Method and device for detecting effective information
CN113094287B (en) Page compatibility detection method, device, equipment and storage medium
CN110992155A (en) Bidding and enclosing processing method and related product
CN109614972A (en) Image processing method, device, electronic equipment and computer-readable medium
CN111385272A (en) Weak password detection method and device
CN115578045A (en) Tender invitation auditing method, electronic equipment and related products
CN110992139B (en) Bidding price realizing method and related product
CN111538994A (en) System security detection and repair method, device, storage medium and terminal
CN108985059B (en) Webpage backdoor detection method, device, equipment and storage medium
CN115827496A (en) Code abnormality detection method and device, electronic equipment and storage medium
CN114115628A (en) U shield display information acquisition method, device, equipment, medium and program product applied to U shield test
CN111767493A (en) Method, device, equipment and storage medium for displaying content data of website
CN110852713A (en) Unified credit code certificate recognition system and algorithm
CN108235324B (en) Short message template testing method and server

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20200324

RJ01 Rejection of invention patent application after publication