CN111159607B - Website compatibility setting method, device, equipment and medium - Google Patents

Website compatibility setting method, device, equipment and medium Download PDF

Info

Publication number
CN111159607B
CN111159607B CN201811318188.9A CN201811318188A CN111159607B CN 111159607 B CN111159607 B CN 111159607B CN 201811318188 A CN201811318188 A CN 201811318188A CN 111159607 B CN111159607 B CN 111159607B
Authority
CN
China
Prior art keywords
website
target
compatibility
display image
dislocation
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.)
Active
Application number
CN201811318188.9A
Other languages
Chinese (zh)
Other versions
CN111159607A (en
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.)
China Mobile Communications Group Co Ltd
China Mobile Group Chongqing Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
China Mobile Group Chongqing 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 China Mobile Communications Group Co Ltd, China Mobile Group Chongqing Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN201811318188.9A priority Critical patent/CN111159607B/en
Publication of CN111159607A publication Critical patent/CN111159607A/en
Application granted granted Critical
Publication of CN111159607B publication Critical patent/CN111159607B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention discloses a website compatibility setting method, a device, equipment and a medium. The method comprises the following steps: determining the target website of the website to be accessed by the user as the website needing to analyze compatibility; acquiring a target source code of a target website and calling a browser of a user so that the browser respectively analyzes the target source code in a compatible mode and a non-compatible mode to obtain a first display image of the browser in the compatible mode and a second display image of the browser in the non-compatible mode; and setting a compatibility view list of the user according to the first display image and the second display image. According to the website compatibility setting method, device, equipment and medium provided by the embodiment of the invention, the compatibility of the website is automatically set, and the problem of page confusion caused by misoperation of a user is avoided.

Description

Website compatibility setting method, device, equipment and medium
Technical Field
The present invention relates to the field of data traffic, and in particular, to a method, an apparatus, a device, and a medium for setting website compatibility.
Background
Current application systems are based on browser/server architecture. The user browses the information on the server through the browser, the browser downloads the information such as hypertext markup language (HyperText Markup Language, HTML), script, animation (flash), pictures and the like from the server, and analyzes and renders codes on the server on the user browser according to a certain standard so as to assemble an interface for the user to browse.
The current maximum user quantity is an IE browser, because the IE is a default browser of a windows operating system, and the occupancy rate is more than 70%. There are many versions of the IE browser currently in which the IE6 and IE7 versions do not support the world wide web consortium (World Wide Web Consortium, W3C) standard, and the versions above IE8 and IE8 support the W3C standard.
If the rear end of the website adopts non-W3C standard development (i.e. terminal users supporting IE6 and IE 7), the user IE is upgraded to IE8 and above, and the user is required to configure and enable the compatibility view on the terminal, and manually add the website into the compatibility view list to enable normal display.
At present, users mostly view website notices, operation manuals, operation prompts and the like in using websites and configure the website notices according to the website prompts. However, information such as bulletins and operation manuals is generally hidden in locations that are relatively difficult to find. Or when the user logs in the website, the website calls the compatibility view list of the user through the JavaScript of the transliteration script language, and the website is added to the compatibility view list or deleted from the compatibility view list. However, this requires the user to first add the application to the trusted list in the IE.
That is, the user needs a certain computer knowledge to correctly set the compatibility of the website, but most users do not know how to set the compatibility of the website, so the user easily performs the following two misoperation on the setting of the compatibility:
a. for systems not developed according to the W3C standard, the terminal does not add the web address for which compatibility needs to be set to the compatibility list in the IE8 version and above.
b. For a system developed according to the W3C standard, the terminal adds a web address, which does not need to set compatibility, to the compatibility list in the IE8 version and above.
Due to misoperation of the user on compatibility, display confusion of the user page is caused.
Disclosure of Invention
The embodiment of the invention provides a website compatibility setting method, device, equipment and medium, which realize automatic website compatibility setting and avoid page confusion caused by misoperation of a user.
According to an aspect of the embodiment of the present invention, there is provided a website compatibility setting method, including:
determining the target website of the website to be accessed by the user as the website needing to analyze compatibility;
acquiring a target source code of a target website and calling a browser of a user so that the browser respectively analyzes the target source code in a compatible mode and a non-compatible mode to obtain a first display image of the browser in the compatible mode and a second display image of the browser in the non-compatible mode;
and setting a compatibility view list of the user according to the first display image and the second display image.
According to an aspect of an embodiment of the present invention, there is provided a website compatibility setting apparatus including:
the determining module is used for determining that the acquired target website of the website to be accessed by the user is a website needing to analyze compatibility;
the image acquisition module is used for acquiring the target source code of the target website and calling the browser of the user so that the browser respectively analyzes the target source code in a compatible mode and a non-compatible mode to obtain a first display image of the browser in the compatible mode and a second display image of the browser in the non-compatible mode;
and the setting module is used for setting a compatibility view list of the user according to the first display image and the second display image.
According to an aspect of an embodiment of the present invention, there is provided a website compatibility setting apparatus including: a processor and a memory storing computer program instructions;
the processor executes the computer program instructions to implement the website compatibility setting method provided by the embodiment of the invention.
According to an aspect of the embodiment of the present invention, there is provided a computer storage medium having stored thereon computer program instructions which, when executed by a processor, implement a website compatibility setting method as provided by the embodiment of the present invention.
According to the website compatibility setting method, device, equipment and medium, firstly, the target website of the website to be accessed by the user is determined to be the website which needs to be analyzed for compatibility, then the target source code of the target website is acquired, the browser of the user is called to obtain the first display image of the browser in the compatible mode and the second display image of the browser in the incompatible mode, finally, a compatibility view list of the user is set according to the first display image and the second display image, automatic setting of the compatibility of the target website is achieved, and the problem of page confusion caused by misoperation of the user is avoided.
Drawings
In order to more clearly illustrate the technical solution of the embodiments of the present invention, the drawings that are needed to be used in the embodiments of the present invention will be briefly described, and other drawings can be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flowchart illustrating a website compatibility setting method provided by an embodiment of the present invention;
fig. 2 is a schematic diagram showing the configuration of a website compatibility setting apparatus provided by an embodiment of the present invention;
fig. 3 shows a block diagram of an exemplary hardware architecture of a website compatibility setting apparatus according to an embodiment of the present invention.
Detailed Description
Features and exemplary embodiments of various aspects of the present invention will be described in detail below, and in order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be described in further detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are merely configured to illustrate the invention and are not configured to limit the invention. It will be apparent to one skilled in the art that the present invention may be practiced without some of these specific details. The following description of the embodiments is merely intended to provide a better understanding of the invention by showing examples of the invention.
It is noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising … …" does not exclude the presence of other like elements in a process, method, article or apparatus that comprises the element.
For a better understanding of the present invention, a method, apparatus, device and medium for setting website compatibility according to embodiments of the present invention will be described in detail below with reference to the accompanying drawings, and it should be noted that these embodiments are not intended to limit the scope of the present disclosure.
Fig. 1 shows a flowchart of a website compatibility setting method provided according to an embodiment of the present invention. As shown in fig. 1, the website compatibility setting method 100 in the embodiment of the present invention includes the following steps:
s110, determining the acquired target website of the website to be accessed by the user as a website needing to analyze compatibility.
In the embodiment of the invention, after the user inputs the website of the website to be accessed, the target website of the website to be accessed by the user can be obtained from the website access request of the user.
In the embodiment of the invention, the websites frequently visited by each user are different, so each user will decide the websites needing to analyze the compatibility at his own discretion. That is, for some websites, the user does not have access at all, so the user does not analyze whether the website has compatibility problems and set the compatibility of the website.
The website compatibility setting method provided by the embodiment of the invention can automatically judge whether a website is a website needing to analyze compatibility.
In an embodiment of the present invention, step S110 includes the steps of:
s1101, judging whether the target website identifier of the extracted target website belongs to a preset website identifier set.
In the embodiment of the invention, because the websites frequently visited by each user are different, in order to save resources, compatibility analysis is not necessary for all websites. Therefore, the website identification set which needs to analyze the compatibility can be preset according to the requirements of the user. The website identifier may be IP of the website, type of the website, or all websites.
And after the target website is acquired, extracting the target website identifier of the target website, and judging whether the target website identifier belongs to a preset website identifier set.
S1102, if the target website identification belongs to a preset website identification set, determining the target website as the website needing to analyze compatibility.
As one example, the set of web address identifications includes all IP addresses that lie within the range of "128.0.0.0-191.255.255.255". Assuming that the IP address of the extracted target website is "172.168.1.1", the target website belongs to the website identification set, that is, the target website is the website requiring compatibility analysis.
If the target website identification does not belong to the preset website identification set, determining the target website as the website which does not need to analyze compatibility, namely, processing a compatibility view list of the user is not needed. Wherein, for the web address in the compatible view list of the user, the browser will be displayed under the compatible view.
S120, obtaining target source codes of target websites and calling a browser of a user, so that the browser respectively analyzes the target source codes in a compatible mode and a non-compatible mode to obtain a first display image of the browser in the compatible mode and a second display image of the browser in the non-compatible mode.
In the embodiment of the invention, when the target website input by the user is determined to be the website needing to analyze compatibility, the access of the user to the target website is simulated to acquire the source code of the target website. For a website which can be accessed only by the identity information of the user, firstly acquiring data stored on a local terminal of the user and used for distinguishing the identity of the user, and simulating the access of the user to a target website by using the data so as to acquire the source code of the target website.
And after the target source code of the target website is obtained, calling the IE browser to enable the browser to analyze the source code according to the compatible mode and the incompatible mode respectively, so as to form two complete IE browser display images in the two modes, namely a first display image of the IE browser in the compatible mode and a second display image of the IE browser in the incompatible mode.
After the first display image and the second display image are acquired, whether the website has compatibility problems can be analyzed according to the two display images. And if the target website has the compatibility problem, automatically setting a compatibility view list of the user.
S130, setting a compatibility view list of the user according to the first display image and the second display image.
In an embodiment of the present invention, step S130 includes the steps of:
s1301, comparing the first display image and the second display image to obtain the image similarity of the first display image and the second display image.
In the embodiment of the invention, after the first display image and the second display image are acquired, the image similarity of the two display images is judged, so that whether the website has the compatibility problem or not is judged according to the image similarity, and whether the compatibility of the website is required to be set is further judged.
S1302, determining that the image similarity is smaller than a preset similarity threshold, and respectively performing dislocation analysis on the first display image and the second display image to obtain a first dislocation amount of the first display image and a second dislocation amount of the first display image.
In the embodiment of the invention, whether the target website has the compatibility problem is judged according to the preset similarity threshold and the image similarity of the first display image and the second display image. If the image similarity is greater than or equal to a preset similarity threshold, the two pictures are considered to be identical, namely, the target website is not enabled for compatibility, and the user can normally display the target website. That is, if the image similarity is greater than or equal to the preset similarity threshold, the compatibility view list of the user is not processed.
If the image similarity is smaller than a preset similarity threshold, determining that the compatibility of the target website is problematic, and further judging whether the compatibility of the target website needs to be set or not. In this case, it is necessary to perform misalignment analysis on the single first display image and the single second display image, respectively, so as to determine whether there is an image misalignment in the first display image and the second display image.
The analysis of the image dislocation mainly analyzes whether the secondary module in the image has dislocation or not. When designing a website, a layout of the website needs to be subjected to module layout. That is, a complete web page is made up of multiple secondary modules. The second-level module can be a module of a news list, a navigation bar, a picture list, hot content, an animation advertisement, a picture link and the like in a webpage.
Specifically, whether the first display image and the second display image are dislocated or not can be judged according to the frame of the second-level module and the color of the second-level module, and a first dislocation amount of the first display image and a second dislocation amount of the first display image are generated respectively.
S1303, a compatibility view list is set according to the first dislocation amount, the second dislocation amount and a preset dislocation threshold value.
In the embodiment of the invention, after the first dislocation amount of the first display image and the second dislocation amount of the first display image are obtained, whether the compatibility of the target website needs to be set is further judged according to the magnitude relation among the first dislocation amount, the second dislocation amount and the preset dislocation threshold value.
In an embodiment of the present invention, step S1303 includes the steps of:
s210, if the first dislocation amount is greater than or equal to a preset dislocation threshold value and the second dislocation amount is smaller than the dislocation threshold value, deleting the target website from the compatibility view list or not processing the compatibility view list.
Specifically, if the first misalignment amount is greater than or equal to a preset misalignment threshold, the first misalignment amount represents that the first display image generated through the compatibility mode has misalignment, and the target website is indicated to be developed by adopting the W3C standard. If the user does not operate by mistake to add the target website to the compatibility view list, the compatibility list of the user is not processed. However, if the user mismanipulates the target web site to be added to the compatibility view list, the target web site should be deleted from the compatibility view list at this time.
S220, if the second dislocation amount is greater than or equal to the dislocation threshold value and the first dislocation amount is smaller than the dislocation threshold value, adding the target website in the compatibility view list.
Specifically, if the second misalignment amount is greater than or equal to the misalignment threshold, it indicates that there is misalignment in the second display image generated in the non-compatibility mode, which indicates that the target website is developed using the non-W3C standard, and that the website of the target website should be added to the user's compatibility view list.
And S230, if the first dislocation amount and the second dislocation amount are both greater than or equal to the dislocation threshold value, analyzing the target source code to obtain a target page element of the target source code and a target script language JS identification of the target source code.
In the embodiment of the invention, if the first dislocation amount and the second dislocation amount are both greater than or equal to the dislocation threshold, the first dislocation amount and the second dislocation amount represent that both the first display image and the second display image are dislocated, and whether the compatibility of the target website needs to be set is further judged.
S240, a compatibility view list is set according to the target page element, the target JS identification, a preset first feature library and a preset second feature library.
The first feature library comprises page elements and JS identifications of source codes under a first standard, and the second feature library comprises page elements and JS identifications of source codes under a second standard.
In the embodiment of the invention, the first standard is a W3C standard, and the second standard is a non-W3C standard. The first feature library comprises page elements of source codes under the W3C standard and JS identifications. The second feature library comprises page elements of source codes under the non-W3C standard and JS identifications.
The page element of the source code comprises a label in the source code. The first feature library includes tags under the W3C standard, and the second feature library includes tags under the non-W3C standard.
For example, < Tr > </Tr > pair under the W3C standard occurs, whereas < Tr > pair under the W3C standard does not occur. The page element < center > is typically a non-W3C standard, while the page element < output > is a W3C standard. Thus the first feature library includes < Tr > </Tr > and < center >. The second feature library includes < Tr > and < output > that occur unpaired.
The JS identification of the source code is the JS function in the source code. The JS identification of the source code under the W3C standard is the JS function special in the W3C standard. The JS identification of the source code under the non-W3C standard is the JS function special for the non-W3C standard.
In the embodiment of the invention, the page elements except the content of the webpage source code and the occurrence times of the page elements, the JS identifications and the occurrence times of the JS identifications can be obtained by analyzing the target source code of the target website word by word.
In an embodiment of the present invention, step S240 includes the steps of:
s2401, comparing the target page element and the target JS mark with a first feature library, determining a first page element meeting a first standard in the target page element and a first JS mark meeting the first standard in the target JS mark, comparing the target page element and the target JS mark with a second feature library, and determining a second page element meeting a second standard in the target page element and a second JS mark meeting the second standard in the target JS mark.
In the embodiment of the invention, the parsed target page elements and the target JS identifications are compared with the first feature library one by one, so that the page elements which are the same as the page elements in the first feature library in the target page elements, namely the first page elements which accord with the first standard, can be obtained. And, the same JS identifier as the JS identifier in the first feature library in the target JS identifier, that is, the first JS identifier conforming to the first standard, may be obtained.
Similarly, the parsed target page element and the target JS identification are compared with the second feature library one by one, so that the page element which is the same as the page element in the second feature library in the target page element, namely the second page element which accords with the second standard, can be obtained. And, the same JS identifier as the JS identifier in the second feature library in the target JS identifier, that is, the second JS identifier that meets the second standard, may be obtained.
S2402, obtaining a first matching value of the target source code and the first standard according to the obtained occurrence number and the first preset weight of the first page element and the occurrence number and the second preset weight of the first JS mark, and obtaining a second matching value of the target source code and the second standard according to the obtained occurrence number and the third preset weight of the second page element and the occurrence number and the fourth preset weight of the second JS mark.
As an example, first, each first page element is multiplied by a preset weight corresponding to the first page element, to obtain a product corresponding to each first page element. And then multiplying each first JS mark by a preset weight corresponding to the first JS mark to obtain a product corresponding to each first JS mark. And finally, adding the product corresponding to each first page element and the product corresponding to each first JS mark to obtain a first matching value of the target source code and the W3C standard.
Similarly, a second matching value of the target source code and the non-W3C standard can be obtained according to the obtained occurrence number of the second page element, the obtained third preset weight, the obtained occurrence number of the second JS identifier, and the obtained fourth preset weight.
S2403, if the first matching value is larger than the second matching value, deleting the target website from the compatibility view list or not processing the compatibility view list.
In the embodiment of the invention, if the first matching value is greater than the second matching value, the more the target website is matched with the W3C standard, if the user does not misoperate to add the target website to the compatibility view list, the compatibility list of the user is not processed. However, if the user mismanipulates the target web site to be added to the compatibility view list, the target web site should be deleted from the compatibility view list at this time.
S2404, if the first matching value is smaller than or equal to the second matching value, adding a target website in the compatibility view list.
In the embodiment of the present invention, if the first matching value is less than or equal to the second matching value, the more matching the target website with the non-W3C standard is represented, the website of the target website should be added to the compatibility view list of the user.
S250, if the first dislocation amount and the second dislocation amount are smaller than the dislocation threshold value, the first dislocation amount and the second dislocation amount represent that no dislocation occurs in the first display image and the second display image, and the target website is not enabled for compatibility, so that the user can normally display the target website, namely, a compatibility view list of the user does not need to be processed.
And after the compatibility view list of the user is set, sending prompt information to the user so as to prompt the user to restart the browser and enable the compatibility setting to be effective.
The website compatibility setting method provided by the embodiment of the invention can automatically add the website needing to be provided with the compatibility to the compatibility view list of the user or delete the website which is added to the compatibility view list by mistake by the user, thereby avoiding the problem of page confusion caused by misoperation of the user. And moreover, manual processing of a user is not needed, so that the user experience is improved, and the workload of maintenance personnel is reduced.
Fig. 2 is a schematic diagram showing the configuration of a website compatibility setting apparatus according to an embodiment of the present invention. As shown in fig. 2, the website compatibility setting apparatus 200 includes:
the determining module 210 is configured to determine that the obtained target website of the website to be accessed by the user is a website that needs to be analyzed for compatibility.
The image obtaining module 220 is configured to obtain a target source code of a target website and call a browser of a user, so that the browser respectively analyzes the target source code in a compatible mode and a non-compatible mode to obtain a first display image of the browser in the compatible mode and a second display image of the browser in the non-compatible mode.
The setting module 230 is configured to set a compatibility view list of the user according to the first display image and the second display image.
In an embodiment of the present invention, the setting module 230 is specifically configured to:
comparing the first display image with the second display image to obtain the image similarity of the first display image and the second display image;
determining that the image similarity is smaller than a preset similarity threshold, and respectively carrying out dislocation analysis on the first display image and the second display image to obtain a first dislocation amount of the first display image and a second dislocation amount of the first display image;
and setting a compatibility view list according to the first dislocation amount, the second dislocation amount and a preset dislocation threshold value.
In an embodiment of the present invention, the setting module 230 is specifically further configured to:
if the first dislocation amount is greater than or equal to a preset dislocation threshold value and the second dislocation amount is less than the dislocation threshold value, deleting the target website from the compatibility view list or not processing the compatibility view list.
If the second dislocation amount is greater than or equal to the dislocation threshold value and the first dislocation amount is smaller than the dislocation threshold value, adding the target website in the compatible view list.
If the first dislocation amount and the second dislocation amount are both greater than or equal to the dislocation threshold value, analyzing the target source code to obtain a target page element of the target source code and a target script language JS mark of the target source code;
setting a compatibility view list according to the target page element, the target JS mark, a preset first feature library and a preset second feature library;
the first feature library comprises page elements and JS identifications of source codes under a first standard, and the second feature library comprises page elements and JS identifications of source codes under a second standard.
In an embodiment of the present invention, the setting module 230 is specifically further configured to:
comparing the target page element and the target JS mark with a first feature library, determining a first page element meeting a first standard in the target page element and a first JS mark meeting the first standard in the target JS mark, and comparing the target page element and the target JS mark with a second feature library, and determining a second page element meeting a second standard in the target page element and a second JS mark meeting the second standard in the target JS mark;
obtaining a first matching value of the target source code and the first standard according to the obtained occurrence number and the first preset weight of the first page element and the occurrence number and the second preset weight of the first JS mark, and obtaining a second matching value of the target source code and the second standard according to the obtained occurrence number and the third preset weight of the second page element and the occurrence number and the fourth preset weight of the second JS mark;
if the first matching value is larger than the second matching value, deleting the target website from the compatibility view list or not processing the compatibility view list;
and if the first matching value is smaller than or equal to the second matching value, adding the target website in the compatibility view list.
In an embodiment of the present invention, the determining module 210 is specifically configured to:
judging whether the target website identifier of the extracted target website belongs to a preset website identifier set or not;
if the target website identification belongs to a preset website identification set, determining the target website as the website needing to analyze compatibility.
In an embodiment of the present invention, the determining module 210 is further configured to:
if the target website identification does not belong to the preset website identification set, determining the target website as the website without analyzing the compatibility.
The website compatibility setting device provided by the embodiment of the invention can automatically set the compatibility of websites, avoid the problem caused by misoperation of users and improve the good experience of the users.
Other details of the website compatibility setting apparatus according to the embodiment of the present invention are similar to those of the method according to the embodiment of the present invention described above in connection with fig. 1, and are not described here again.
The website compatibility setting method and apparatus according to the embodiments of the present invention described in connection with fig. 1 to 2 may be implemented by a website compatibility setting device. Fig. 3 is a schematic diagram showing a hardware configuration 300 of the website compatibility setting apparatus according to the embodiment of the invention.
As shown in fig. 3, the website compatibility setting apparatus 300 in the present embodiment includes: processor 301, memory 302, communication interface 303, and bus 310, wherein processor 301, memory 302, and communication interface 303 are coupled to and complete communication with each other via bus 310.
In particular, the processor 301 may include a Central Processing Unit (CPU), or an Application Specific Integrated Circuit (ASIC), or may be configured as one or more integrated circuits that implement embodiments of the present invention.
Memory 302 may include mass storage for data or instructions. By way of example, and not limitation, memory 302 may comprise an HDD, floppy disk drive, flash memory, optical disk, magneto-optical disk, magnetic tape, or Universal Serial Bus (USB) drive, or a combination of two or more of these. Memory 302 may include removable or non-removable (or fixed) media, where appropriate. The memory 302 may be internal or external to the website compatibility setting apparatus 300, where appropriate. In a particular embodiment, the memory 302 is a non-volatile solid-state memory. In particular embodiments, memory 302 includes Read Only Memory (ROM). The ROM may be mask programmed ROM, programmable ROM (PROM), erasable PROM (EPROM), electrically Erasable PROM (EEPROM), electrically rewritable ROM (EAROM), or flash memory, or a combination of two or more of these, where appropriate.
The communication interface 303 is mainly used to implement communication between each module, device, unit and/or apparatus in the embodiment of the present invention.
Bus 310 includes hardware, software, or both, coupling the components of website compatibility setting device 300 to one another. By way of example, and not limitation, the buses may include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a HyperTransport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an infiniband interconnect, a Low Pin Count (LPC) bus, a memory bus, a micro channel architecture (MCa) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a video electronics standards association local (VLB) bus, or other suitable bus, or a combination of two or more of the above. Bus 310 may include one or more buses, where appropriate. Although embodiments of the invention have been described and illustrated with respect to a particular bus, the invention contemplates any suitable bus or interconnect.
That is, the website compatibility setting apparatus 300 shown in fig. 3 may be implemented to include: a processor 301, a memory 302, a communication interface 303 and a bus 310. The processor 301, memory 302, and communication interface 303 are connected and communicate with each other via a bus 310. The memory 302 is used for storing program codes; the processor 301 executes a program corresponding to the executable program code by reading the executable program code stored in the memory 302 for executing the website compatibility setting method in any of the embodiments of the present invention, thereby implementing the website compatibility setting method and apparatus described in connection with fig. 1 to 2.
The embodiment of the invention also provides a computer storage medium, and the computer storage medium is stored with computer program instructions; the computer program instructions, when executed by the processor, implement the website compatibility setting method provided by the embodiment of the invention.
The functional blocks shown in the above block diagrams may be implemented in hardware, software, firmware, or a combination thereof. When implemented in hardware, it may be, for example, an electronic circuit, an Application Specific Integrated Circuit (ASIC), suitable firmware, a plug-in, a function card, or the like. When implemented in software, the elements of the invention are the programs or code segments used to perform the required tasks. The program or code segments may be stored in a machine readable medium or transmitted over transmission media or communication links by a data signal carried in a carrier wave. A "machine-readable medium" may include any medium that can store or transfer information. Examples of machine-readable media include electronic circuitry, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, radio Frequency (RF) links, and the like. The code segments may be downloaded via computer networks such as the internet, intranets, etc.
It should also be noted that the exemplary embodiments mentioned in this disclosure describe some methods or systems based on a series of steps or devices. However, the present invention is not limited to the order of the above-described steps, that is, the steps may be performed in the order mentioned in the embodiments, or may be performed in a different order from the order in the embodiments, or several steps may be performed simultaneously.
In the foregoing, only the specific embodiments of the present invention are described, and it will be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the systems, modules and units described above may refer to the corresponding processes in the foregoing method embodiments, which are not repeated herein. It should be understood that the scope of the present invention is not limited thereto, and any equivalent modifications or substitutions can be easily made by those skilled in the art within the technical scope of the present invention, and they should be included in the scope of the present invention.

Claims (10)

1. A website compatibility setting method, characterized by comprising:
determining the target website of the website to be accessed by the user as the website needing to analyze compatibility;
acquiring a target source code of the target website and calling a browser of the user, so that the browser respectively analyzes the target source code in a compatible mode and a non-compatible mode to obtain a first display image of the browser in the compatible mode and a second display image of the browser in the non-compatible mode;
setting a compatibility view list of the user according to the first display image and the second display image;
the setting the compatibility view list of the user according to the first display image and the second display image comprises the following steps:
comparing the first display image with the second display image to obtain the image similarity of the first display image and the second display image;
determining that the image similarity is smaller than a preset similarity threshold, and respectively carrying out dislocation analysis on the first display image and the second display image to obtain a first dislocation amount of the first display image and a second dislocation amount of the second display image;
and setting the compatibility view list according to the first dislocation amount, the second dislocation amount and a preset dislocation threshold value.
2. The method according to claim 1, wherein the setting the compatibility view list according to the first misalignment amount, the second misalignment amount, and a preset misalignment threshold includes:
and if the first dislocation amount is greater than or equal to the preset dislocation threshold value and the second dislocation amount is smaller than the dislocation threshold value, deleting the target website from the compatibility view list or not processing the compatibility view list.
3. The method according to claim 1, wherein the setting the compatibility view list according to the first misalignment amount, the second misalignment amount, and a preset misalignment threshold includes:
and if the second dislocation amount is greater than or equal to the dislocation threshold value and the first dislocation amount is smaller than the dislocation threshold value, adding the target website in the compatibility view list.
4. The method according to claim 1, wherein the setting the compatibility view list according to the first misalignment amount, the second misalignment amount, and a preset misalignment threshold includes:
if the first dislocation amount and the second dislocation amount are both greater than or equal to the dislocation threshold, analyzing the target source code to obtain a target page element of the target source code and a target script language JS identification of the target source code;
setting the compatibility view list according to the target page element, the target JS identification, a preset first feature library and a preset second feature library;
the first feature library comprises page elements and JS identifications of source codes under a first standard, and the second feature library comprises page elements and JS identifications of source codes under a second standard.
5. The method of claim 4, wherein the setting the compatibility view list according to the target page element, the target JS tag, a preset first feature library, and a preset second feature library comprises:
comparing the target page element and the target JS mark with the first feature library, determining a first page element conforming to the first standard in the target page element and a first JS mark conforming to the first standard in the target JS mark, and comparing the target page element and the target JS mark with the second feature library, and determining a second page element conforming to the second standard in the target page element and a second JS mark conforming to the second standard in the target JS mark;
obtaining a first matching value of the target source code and the first standard according to the obtained occurrence number and first preset weight of the first page element and the occurrence number and second preset weight of the first JS mark, and obtaining a second matching value of the target source code and the second standard according to the obtained occurrence number and third preset weight of the second page element and the occurrence number and fourth preset weight of the second JS mark;
if the first matching value is larger than the second matching value, deleting the target website from the compatibility view list or not processing the compatibility view list;
and if the first matching value is smaller than or equal to the second matching value, adding the target website in the compatibility view list.
6. The method according to claim 1, wherein determining that the obtained target website of the website to be accessed by the user is a website for which compatibility analysis is required comprises:
judging whether the extracted target website identifier of the target website belongs to a preset website identifier set or not;
and if the target website identifier belongs to the preset website identifier set, determining the target website as the website needing to analyze compatibility.
7. The method of claim 6, wherein the method further comprises:
and if the target website identifier does not belong to the preset website identifier set, determining the target website as a website which does not need to analyze compatibility.
8. A website compatibility setting apparatus, characterized in that the apparatus comprises:
the determining module is used for determining that the acquired target website of the website to be accessed by the user is a website needing to analyze compatibility;
the image acquisition module is used for acquiring the target source code of the target website and calling the browser of the user so that the browser respectively analyzes the target source code in a compatible mode and a non-compatible mode to obtain a first display image of the browser in the compatible mode and a second display image of the browser in the non-compatible mode;
a setting module, configured to set a compatibility view list of the user according to the first display image and the second display image;
the setting the compatibility view list of the user according to the first display image and the second display image comprises the following steps:
comparing the first display image with the second display image to obtain the image similarity of the first display image and the second display image;
determining that the image similarity is smaller than a preset similarity threshold, and respectively carrying out dislocation analysis on the first display image and the second display image to obtain a first dislocation amount of the first display image and a second dislocation amount of the second display image;
and setting the compatibility view list according to the first dislocation amount, the second dislocation amount and a preset dislocation threshold value.
9. A website compatibility setting apparatus, characterized in that the apparatus comprises: a processor and a memory storing computer program instructions;
the processor, when executing the computer program instructions, implements the website compatibility setting method of any one of claims 1-7.
10. A computer storage medium having stored thereon computer program instructions which when executed by a processor implement the website compatibility setting method of any of claims 1-7.
CN201811318188.9A 2018-11-07 2018-11-07 Website compatibility setting method, device, equipment and medium Active CN111159607B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811318188.9A CN111159607B (en) 2018-11-07 2018-11-07 Website compatibility setting method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811318188.9A CN111159607B (en) 2018-11-07 2018-11-07 Website compatibility setting method, device, equipment and medium

Publications (2)

Publication Number Publication Date
CN111159607A CN111159607A (en) 2020-05-15
CN111159607B true CN111159607B (en) 2023-09-19

Family

ID=70555262

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811318188.9A Active CN111159607B (en) 2018-11-07 2018-11-07 Website compatibility setting method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN111159607B (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9053154B1 (en) * 2012-09-20 2015-06-09 Google Inc. System and method for generating a compatibility score for web content
CN105468779A (en) * 2015-12-16 2016-04-06 中国科学院软件研究所 Browser compatibility detection oriented client Web application capture and playback system and method
CN106055475A (en) * 2016-05-24 2016-10-26 广州视睿电子科技有限公司 Version compatibility detection method and apparatus
CN106776267A (en) * 2015-11-25 2017-05-31 富士通株式会社 Web application compatibility test method and web application compatibility test equipment
CN106886491A (en) * 2017-01-17 2017-06-23 博彦科技股份有限公司 Webpage compatibility test method and device
CN107315682A (en) * 2017-06-22 2017-11-03 北京凤凰理理它信息技术有限公司 Test browser-safe method, device, storage medium and electronic equipment
CN107678937A (en) * 2017-07-26 2018-02-09 上海壹账通金融科技有限公司 Page compatibility detection method, device, server and medium
CN108121647A (en) * 2016-11-26 2018-06-05 上海亿账通互联网科技有限公司 The browser compatibility test method and device of the HTML5 pages
CN108334451A (en) * 2018-01-30 2018-07-27 无线生活(杭州)信息科技有限公司 page compatibility test method and device

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8996988B2 (en) * 2009-10-19 2015-03-31 Browsera, LLC Automated application compatibility testing
US20110289489A1 (en) * 2010-05-20 2011-11-24 Verizon Patent And Licensing Inc. Concurrent cross browser testing

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9053154B1 (en) * 2012-09-20 2015-06-09 Google Inc. System and method for generating a compatibility score for web content
CN106776267A (en) * 2015-11-25 2017-05-31 富士通株式会社 Web application compatibility test method and web application compatibility test equipment
CN105468779A (en) * 2015-12-16 2016-04-06 中国科学院软件研究所 Browser compatibility detection oriented client Web application capture and playback system and method
CN106055475A (en) * 2016-05-24 2016-10-26 广州视睿电子科技有限公司 Version compatibility detection method and apparatus
CN108121647A (en) * 2016-11-26 2018-06-05 上海亿账通互联网科技有限公司 The browser compatibility test method and device of the HTML5 pages
CN106886491A (en) * 2017-01-17 2017-06-23 博彦科技股份有限公司 Webpage compatibility test method and device
CN107315682A (en) * 2017-06-22 2017-11-03 北京凤凰理理它信息技术有限公司 Test browser-safe method, device, storage medium and electronic equipment
CN107678937A (en) * 2017-07-26 2018-02-09 上海壹账通金融科技有限公司 Page compatibility detection method, device, server and medium
CN108334451A (en) * 2018-01-30 2018-07-27 无线生活(杭州)信息科技有限公司 page compatibility test method and device

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
吴国全 ; 何妹妹 ; 魏峻 ; 钟华 ; 黄涛 ; .基于捕获/重放的Web应用跨浏览器兼容性检测.计算机研究与发展.2017,(第03期),全文. *
陈智雨 ; 汪明 ; 巩少岩 ; 王栋 ; 史睿 ; 葛冰玉 ; .电力行业Web应用兼容性测试.电力信息与通信技术.2017,(第06期),全文. *

Also Published As

Publication number Publication date
CN111159607A (en) 2020-05-15

Similar Documents

Publication Publication Date Title
CN110708346B (en) Information processing system and method
CN108366058B (en) Method, device, equipment and storage medium for preventing traffic hijacking of advertisement operator
CN109451333B (en) Bullet screen display method, device, terminal and system
CN101877696A (en) Equipment and method for reconfiguring false response messages under network application environment
EP2648388A1 (en) Method, system, and device for displaying page
CN110442286B (en) Page display method and device and electronic equipment
CN102023998B (en) Method and device for processing webpage so as to display on handheld equipment
CN108885544B (en) Front-end page internationalized processing method, application server and computer-readable storage medium
CN103973506A (en) Domain name verifying method, device and system
CN112000884A (en) User content recommendation method and device, server and storage medium
CN108494728B (en) Method, device, equipment and medium for creating blacklist library for preventing traffic hijacking
CN113360106B (en) Webpage printing method and device
CN111008865A (en) Coupon synchronous display method and device, server and storage medium
CN111159607B (en) Website compatibility setting method, device, equipment and medium
CN103488508A (en) Browser working method, browser and terminal equipment
CN115113871A (en) Front-end code version information checking method, device and equipment based on data middlebox
CN111221711A (en) User behavior data processing method, server and storage medium
CN109144841B (en) Method and device for identifying advertisement application, computer equipment and storage medium
CN114239486A (en) Interface description document generation method, device, equipment and storage medium
CN113923190A (en) Method and device for identifying equipment identification jump, server and storage medium
CN111125605A (en) Page element acquisition method and device
CN110209959B (en) Information processing method and device
CN111752536A (en) Page development method, device, equipment and storage medium
CN112433752A (en) Page parsing method, device, medium and electronic equipment
CN113138817A (en) Mobile terminal interface annotation method and device, electronic equipment and computer storage medium

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
GR01 Patent grant
GR01 Patent grant