WO2018209465A1 - Webpage access control method and gateway device - Google Patents
Webpage access control method and gateway device Download PDFInfo
- Publication number
- WO2018209465A1 WO2018209465A1 PCT/CN2017/084267 CN2017084267W WO2018209465A1 WO 2018209465 A1 WO2018209465 A1 WO 2018209465A1 CN 2017084267 W CN2017084267 W CN 2017084267W WO 2018209465 A1 WO2018209465 A1 WO 2018209465A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- webpage
- picture
- access request
- preset
- hash
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 32
- 238000010586 diagram Methods 0.000 description 4
- 230000006870 function Effects 0.000 description 2
- 238000004590 computer program Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000008520 organization Effects 0.000 description 1
- 238000009877 rendering Methods 0.000 description 1
- 230000004044 response Effects 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/40—Network security protocols
Definitions
- the present invention relates to the field of Internet security, and in particular, to a webpage control access method and a gateway device.
- the technical problem to be solved by the embodiments of the present invention is to provide a webpage control access method and a gateway device, which can be placed on a webpage to be tampered with, so that the user can access the correct webpage.
- the first aspect of the present application provides a webpage access control method, where a gateway device simultaneously connects a primary server and a standby server, and the terminal accesses the primary server and the standby server through the gateway device, before the webpage in the website is not tampered with, the main The server and the standby server store web pages with the same URL. Among them, you can copy the website to the standby server between the website publishing, so that the URLs in the standby server and the primary server are consistent.
- the gateway device receives the webpage access request sent by the terminal, and the webpage access request carries the webpage address, and the webpage address may be a webpage link address.
- the gateway device determines the accessed primary server according to the webpage address, the gateway device obtains the first webpage indicated by the webpage address in the primary server, and obtains the second webpage indicated by the webpage address in the standby server, and the gateway device determines the first webpage and the second webpage. If the first webpage and the second webpage are different, the network device sends the webpage access request to the standby server, and the standby server receives the webpage access request, and returns the second webpage indicated by the webpage address to the terminal.
- the backup server stores the backed up web address.
- the gateway device When the webpage of the main server is tampered with, the gateway device generates the webpage in the standby server to the terminal, so that the terminal can access the correct webpage without any sense.
- the determining the first webpage and the second Whether the pages are the same include:
- the first webpage is screenshotd according to a preset screenshot rule to obtain a first image
- the determining whether the first webpage and the second webpage are the same include:
- the method before the receiving the webpage access request, the method further includes:
- the method further includes:
- the webpage in the webpage indicated by the webpage access request is updated, the webpage that will be updated covers the corresponding webpage in the standby server.
- the second aspect of the present application further provides a gateway device, where the gateway device includes:
- a receiving unit configured to receive a webpage access request, where the webpage access request carries a webpage address
- An obtaining unit configured to acquire a first webpage whose webpage address is in a primary server, and obtain a second webpage whose webpage address is in a standby server;
- a determining unit configured to determine whether the first webpage and the second webpage are the same
- a sending unit configured to send the webpage access request to the standby server if the determining result of the determining unit is yes.
- the determining unit is configured to:
- the first webpage is screenshotd according to a preset screenshot rule to obtain a first image
- the determining unit is configured to:
- the method further includes: a storage unit, configured to:
- the method further includes:
- an updating unit configured to: when the webpage in the webpage indicated by the webpage access request is updated, the webpage that will be updated covers the corresponding webpage in the standby server.
- the present application provides a gateway device, the terminal comprising a memory, a processor and a transceiver, the memory storing program code, and the processor calling program code is used to execute the first aspect or the possible implementation manners of the first aspect Any of the web page control access methods.
- FIG. 1 is a schematic flow chart of a webpage access control method according to the present invention.
- FIG. 2 is a schematic structural diagram of a gateway device according to an embodiment of the present invention.
- FIG. 3 is another schematic structural diagram of a gateway device according to an embodiment of the present invention.
- FIG. 1 is a schematic flowchart of a webpage access control method according to an embodiment of the present invention.
- the method includes:
- the gateway device is connected to the primary server and the standby server at the same time, and the terminal accesses the primary server and the standby server through the gateway device.
- the primary server and the standby server store the webpage with the same URL.
- the gateway device copies the website to the standby server, so that the URLs in the standby server and the primary server are consistent.
- the gateway device receives the webpage access request sent by the terminal, and the webpage access request carries the webpage address, and the webpage address may be a webpage link address.
- the gateway device determines the accessed primary server according to the webpage address, the gateway device obtains the first webpage indicated by the webpage address in the primary server, and obtains the second webpage indicated by the webpage address in the standby server, and the gateway device determines the first webpage and the second webpage. Is it the same, if the first page and the second page are not the same Similarly, the network device sends the webpage access request to the standby server, and the standby server receives the webpage access request, and returns the second webpage indicated by the webpage address to the terminal. Optionally, the gateway device may send the obtained second webpage to the terminal, and does not need to send the webpage access request to the standby server, and uses the cache function of the gateway device to reduce the response time of the webpage access.
- the backup server stores the backed up web address.
- the gateway device When the webpage of the main server is tampered with, the gateway device generates the webpage in the standby server to the terminal, so that the terminal can access the correct webpage without any sense.
- the determining whether the first webpage and the second webpage are the same include:
- the first webpage is screenshotd according to a preset screenshot rule to obtain a first image
- the screenshot rule may include one or more of a screenshot location, a picture size, and a picture format, and the gateway device uses the same screenshot rule to take a screenshot of the first webpage and the second webpage.
- the algorithm for calculating the similarity value of the two pictures may be any existing similarity algorithm, such as a cosine similarity algorithm, which is not limited in this embodiment.
- the determining whether the first webpage and the second webpage are the same include:
- the hash algorithm may be any one of MD2, MD4, MD5, and SHA-1.
- the method before the receiving the webpage access request, the method further includes:
- the gateway device pre-stores the hash value of each webpage in the standby server, so that the gateway device can directly obtain the hash value of the second webpage from the local.
- the method further includes:
- the webpage in the webpage indicated by the webpage access request is updated, the webpage that will be updated covers the corresponding webpage in the standby server.
- the webpage update at this time represents a normal update process performed by the administrator of the website.
- FIG. 2 is a schematic structural diagram of a gateway device according to an embodiment of the present invention.
- the gateway device in the embodiment of the present invention is used to perform a webpage access control method in FIG. 1 , and the terminology and process involved may refer to FIG. 1 . Description of the embodiments.
- the gateway device 2 includes a receiving unit 201, an obtaining unit 202, a determining unit 203, and a transmitting unit 204.
- the receiving unit 201 is configured to receive a webpage access request, where the webpage access request carries a webpage address.
- the obtaining unit 202 is configured to acquire the first webpage whose webpage address is in the main server, and obtain the second webpage whose webpage address is in the standby server.
- the determining unit 203 is configured to determine whether the first webpage and the second webpage are the same.
- the sending unit 204 is configured to send the webpage access request to the standby server if the determination result of the determining unit is yes.
- the determining unit uses 203 to:
- the first webpage is screenshotd according to a preset screenshot rule to obtain a first image
- the determining unit 203 is configured to:
- it also includes:
- a storage unit configured to copy the website indicated by the webpage access request to the backup server, and calculate and store a hash value of each webpage in the webpage.
- it also includes:
- an updating unit configured to: when the webpage in the webpage indicated by the webpage access request is updated, the webpage that will be updated covers the corresponding webpage in the standby server.
- FIG. 3 is a schematic diagram of another structure of a gateway device according to an embodiment of the present invention.
- the gateway device 3 includes a processor 301, a memory 302, and a transceiver 303.
- the transceiver 303 is configured to transmit and receive data with and from an external device.
- the number of processors 301 in the gateway device 3 may be one or more.
- processor 301, memory 302, and transceiver 303 may be connected by a bus system or other means.
- the gateway device 3 can be used to perform the method shown in FIG.
- the transceiver 303 is configured to receive a webpage access request, where the webpage access request carries a webpage address;
- the memory 302 stores a program code
- the processor 301 calls the program code to perform the following operations:
- the transceiver 303 is instructed to send the webpage access request to the standby server.
- the performing, by the processor 301, determining whether the first webpage and the second webpage are the same include:
- the first webpage is screenshotd according to a preset screenshot rule to obtain a first image
- the performing, by the processor 301, determining whether the first webpage and the second webpage are the same include:
- the processor 301 is further configured to:
- the processor 301 is further configured to:
- the webpage in the webpage indicated by the webpage access request is updated, the webpage that will be updated covers the corresponding webpage in the standby server.
- the terminal of the embodiment of the present invention includes but is not limited to piggybacking Or terminals of other operating systems, such as mobile phones.
- Other terminals may also be used, such as a laptop or tablet or desktop computer with a touch-sensitive surface (eg, a touch screen display and/or a touch pad).
- a terminal including a display and a touch-sensitive surface is described. It should be understood, however, that the terminal can include one or more other physical user interface devices, such as a physical keyboard, mouse, and/or joystick.
- Terminals typically support a variety of applications, such as one or more of the following: a drawing application, a rendering application, a word processing application, a web page creation application, a disk editing application, a spreadsheet application, a gaming application, Telephony applications, video conferencing applications, email applications, instant messaging applications, workout support applications, photo management applications, digital camera applications, digital video camera applications, web browsing applications, digital music player applications Program, and/or digital video player application.
- applications such as one or more of the following: a drawing application, a rendering application, a word processing application, a web page creation application, a disk editing application, a spreadsheet application, a gaming application, Telephony applications, video conferencing applications, email applications, instant messaging applications, workout support applications, photo management applications, digital camera applications, digital video camera applications, web browsing applications, digital music player applications Program, and/or digital video player application.
- the various applications that can be executed on the terminal can use at least one shared physical user interface device, such as a touch-sensitive surface.
- One or more functions of the touch-sensitive surface and corresponding information displayed on the terminal may be adjusted and/or changed from one application to the next and/or adjusted and/or varied within the respective application.
- the shared physical architecture of the terminal such as a touch-sensitive surface, can support a variety of applications with a user interface that is intuitive to the user.
- the storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Information Transfer Between Computers (AREA)
Abstract
Description
本发明涉及互联网安全领域,尤其涉及一种网页控制访问方法和网关设备。The present invention relates to the field of Internet security, and in particular, to a webpage control access method and a gateway device.
越来越多的公司、企业或政府部分拥有了网址,然而很多网站缺乏专业的人员去维护,网站的安全性不高。在网站被黑客篡改时,会对组织的形象造成极大的影响,特别是访问量较大的网址,这种影响的范围是非常大的。More and more companies, companies, or governments have websites. However, many websites lack professional personnel to maintain them, and the security of the websites is not high. When the website is hacked by hackers, it will have a great impact on the image of the organization, especially for websites with a large number of visits. The scope of this impact is very large.
发明内容Summary of the invention
本发明实施例所要解决的技术问题在于,提供一种网页控制访问方法和网关设备,能放在网页被篡改,使用户访问到正确的网页。The technical problem to be solved by the embodiments of the present invention is to provide a webpage control access method and a gateway device, which can be placed on a webpage to be tampered with, so that the user can access the correct webpage.
为了解决上述技术问题,本申请第一方面提供了网页访问控制方法,网关设备同时连接主服务器和备服务器,终端通过网关设备访问主服务器和备服务器,在网站中的网页没有被篡改之前,主服务器和备服务器存储有相同的网址的网页。其中,可以在网站发布之间,将网站拷贝一份至备服务器,使备服务器和主服务器中的网址保持一致。网关设备接收终端发送的网页访问请求,网页访问请求携带网页地址,网页地址可以为网页链接地址。网关设备根据网页地址确定访问的主服务器,网关设备在主服务器中获取网页地址指示的第一网页,以及在备服务器中获取网页地址指示的第二网页,网关设备判断第一网页和第二网页是否相同,若第一网页和第二网页不相同,网络设备将网页访问请求发送给备服务器,备服务器接收网页访问请求,将网页地址指示的第二网页返回给终端。In order to solve the above technical problem, the first aspect of the present application provides a webpage access control method, where a gateway device simultaneously connects a primary server and a standby server, and the terminal accesses the primary server and the standby server through the gateway device, before the webpage in the website is not tampered with, the main The server and the standby server store web pages with the same URL. Among them, you can copy the website to the standby server between the website publishing, so that the URLs in the standby server and the primary server are consistent. The gateway device receives the webpage access request sent by the terminal, and the webpage access request carries the webpage address, and the webpage address may be a webpage link address. The gateway device determines the accessed primary server according to the webpage address, the gateway device obtains the first webpage indicated by the webpage address in the primary server, and obtains the second webpage indicated by the webpage address in the standby server, and the gateway device determines the first webpage and the second webpage. If the first webpage and the second webpage are different, the network device sends the webpage access request to the standby server, and the standby server receives the webpage access request, and returns the second webpage indicated by the webpage address to the terminal.
实施本发明的实施例,备服务器中存储有备份的网址,网关设备在主服务器中的网页被篡改时,将备服务器中的网页发生给终端,使终端能无感知的访问到正确的网页。In the embodiment of the present invention, the backup server stores the backed up web address. When the webpage of the main server is tampered with, the gateway device generates the webpage in the standby server to the terminal, so that the terminal can access the correct webpage without any sense.
在第一方面的一种可能的实现方式中,所述判断所述第一网页和所述第二 网页是否相同包括:In a possible implementation manner of the first aspect, the determining the first webpage and the second Whether the pages are the same include:
根据预设的截图规则将所述第一网页进行截图得到第一图片;The first webpage is screenshotd according to a preset screenshot rule to obtain a first image;
根据所述截图规则将所述第二网页进行截图得到第二图片;Performing a screenshot of the second webpage according to the screenshot rule to obtain a second image;
比较所述第一图片和所述第二图片的相似度;Comparing the similarity between the first picture and the second picture;
若所述第一图片和所述第二图片的相似度大于预设值,确定所述第一网页和所述第二网页相同;或If the similarity between the first picture and the second picture is greater than a preset value, determining that the first webpage and the second webpage are the same; or
若所述第一图片和所述第二图片的相似度值不大于预设预设值,确定所述第一网页和所述第二网页不相同。If the similarity value of the first picture and the second picture is not greater than a preset preset value, determining that the first webpage and the second webpage are different.
在第一方面的一种可能的实现方式中,所述判断第一网页和所述第二网页是否相同包括:In a possible implementation manner of the first aspect, the determining whether the first webpage and the second webpage are the same include:
获取所述第一网页第一网页代码;Obtaining the first webpage code of the first webpage;
获取所述第二网页的第二网页代码;Obtaining a second webpage code of the second webpage;
根据预设的哈希算法对所述第一网页代码进行哈希运算得到第一哈希值;Performing a hash operation on the first webpage code according to a preset hash algorithm to obtain a first hash value;
根据所述哈希算法对所述第二网页代码进行哈希运算得到第二哈希值;Performing a hash operation on the second webpage code according to the hash algorithm to obtain a second hash value;
判断所述第一哈希值和所述第二哈希值是否相等;Determining whether the first hash value and the second hash value are equal;
若为是,确定所述第一网页和所述第二网页相同;或If yes, determining that the first webpage and the second webpage are the same; or
若为否,确定所述第一网页和所述第二网页不相同。If not, it is determined that the first webpage and the second webpage are different.
在第一方面的一种可能的实现方式中,所述接收网页访问请求之前,还包括:In a possible implementation manner of the first aspect, before the receiving the webpage access request, the method further includes:
将所述网页访问请求指示的网站拷贝至所述备份服务器,以及计算和存储所述网址中每个网页的哈希值。Copying the website indicated by the webpage access request to the backup server, and calculating and storing a hash value of each webpage in the webpage.
在第一方面的一种可能的实现方式中,还包括:In a possible implementation manner of the first aspect, the method further includes:
若所述网页访问请求指示的网址中的网页发生更新时,将发生更新的网页覆盖所述备服务器中对应的网页。If the webpage in the webpage indicated by the webpage access request is updated, the webpage that will be updated covers the corresponding webpage in the standby server.
相应地,本申请第二方面还提供了一种网关设备,所述网关设备包括:Correspondingly, the second aspect of the present application further provides a gateway device, where the gateway device includes:
接收单元,用于接收网页访问请求;其中,所述网页访问请求携带网页地址;a receiving unit, configured to receive a webpage access request, where the webpage access request carries a webpage address;
获取单元,用于获取所述网页地址在主服务器中的第一网页,以及获取所述网页地址在备服务器中的第二网页; An obtaining unit, configured to acquire a first webpage whose webpage address is in a primary server, and obtain a second webpage whose webpage address is in a standby server;
判断单元,用于判断所述第一网页和所述第二网页是否相同;a determining unit, configured to determine whether the first webpage and the second webpage are the same;
发送单元,用于若所述判断单元的判断结果为是,将所述网页访问请求发送给所述备服务器。And a sending unit, configured to send the webpage access request to the standby server if the determining result of the determining unit is yes.
在第二方面的一种可能的实现方式中,所述判断单元用于:In a possible implementation manner of the second aspect, the determining unit is configured to:
根据预设的截图规则将所述第一网页进行截图得到第一图片;The first webpage is screenshotd according to a preset screenshot rule to obtain a first image;
根据所述截图规则将所述第二网页进行截图得到第二图片;Performing a screenshot of the second webpage according to the screenshot rule to obtain a second image;
比较所述第一图片和所述第二图片的相似度;Comparing the similarity between the first picture and the second picture;
若所述第一图片和所述第二图片的相似度大于预设值,确定所述第一网页和所述第二网页相同;或If the similarity between the first picture and the second picture is greater than a preset value, determining that the first webpage and the second webpage are the same; or
若所述第一图片和所述第二图片的相似度值不大于预设预设值,确定所述第一网页和所述第二网页不相同。If the similarity value of the first picture and the second picture is not greater than a preset preset value, determining that the first webpage and the second webpage are different.
在第二方面的一种可能的实现方式中,所述判断单元用于:In a possible implementation manner of the second aspect, the determining unit is configured to:
获取所述第一网页的第一网页代码;Obtaining a first webpage code of the first webpage;
获取所述第二网页的第二网页代码;Obtaining a second webpage code of the second webpage;
根据预设的哈希算法对所述第一网页代码进行哈希运算得到第一哈希值;Performing a hash operation on the first webpage code according to a preset hash algorithm to obtain a first hash value;
根据所述哈希算法对所述第二网页代码进行哈希运算得到第二哈希值;Performing a hash operation on the second webpage code according to the hash algorithm to obtain a second hash value;
判断所述第一哈希值和所述第二哈希值是否相等;Determining whether the first hash value and the second hash value are equal;
若为是,确定所述第一网页和所述第二网页相同;或If yes, determining that the first webpage and the second webpage are the same; or
若为否,确定所述第一网页和所述第二网页不相同。If not, it is determined that the first webpage and the second webpage are different.
在第二方面的一种可能的实现方式中,还包括:存储单元,用于:In a possible implementation manner of the second aspect, the method further includes: a storage unit, configured to:
将所述网页访问请求指示的网站拷贝至所述备份服务器,以及计算和存储所述网址中每个网页的哈希值。Copying the website indicated by the webpage access request to the backup server, and calculating and storing a hash value of each webpage in the webpage.
在第二方面的一种可能的实现方式中,还包括:In a possible implementation manner of the second aspect, the method further includes:
更新单元,用于若所述网页访问请求指示的网址中的网页发生更新时,将发生更新的网页覆盖所述备服务器中对应的网页。And an updating unit, configured to: when the webpage in the webpage indicated by the webpage access request is updated, the webpage that will be updated covers the corresponding webpage in the standby server.
第三方面,本申请提供了一种网关设备,终端包括存储器、处理器和收发器,存储器存储有程序代码,处理器调用程序代码用于执行第一方面或第一方面的各可能实施方式中的任意一种网页控制访问方法。 In a third aspect, the present application provides a gateway device, the terminal comprising a memory, a processor and a transceiver, the memory storing program code, and the processor calling program code is used to execute the first aspect or the possible implementation manners of the first aspect Any of the web page control access methods.
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the embodiments or the description of the prior art will be briefly described below. Obviously, the drawings in the following description are only It is a certain embodiment of the present invention, and other drawings can be obtained from those skilled in the art without any creative work.
图1是本发明的一种网页访问控制方法的流程示意图;1 is a schematic flow chart of a webpage access control method according to the present invention;
图2是本发明实施例提供的一种网关设备的结构示意图;2 is a schematic structural diagram of a gateway device according to an embodiment of the present invention;
图3是本发明实施例提供的一种网关设备的另一结构示意图。FIG. 3 is another schematic structural diagram of a gateway device according to an embodiment of the present invention.
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention. It is obvious that the described embodiments are only a part of the embodiments of the present invention, but not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
参见图1,图1是本发明实施例提供的一种网页访问控制方法的流程示意图,在本发明实施例中,所述方法包括:Referring to FIG. 1 , FIG. 1 is a schematic flowchart of a webpage access control method according to an embodiment of the present invention. In the embodiment of the present invention, the method includes:
S101、接收网页访问请求。S101. Receive a webpage access request.
S102、获取网页地址在主服务器中的第一网页,以及获取网页地址在备服务器中的第二网页。S102. Acquire a first webpage whose webpage address is in the main server, and obtain a second webpage whose webpage address is in the standby server.
S103、判断第一网页和第二网页是否相同。S103. Determine whether the first webpage and the second webpage are the same.
S104、若第一网页和第二网页不相同,将网页访问请求发送给备服务器。S104. If the first webpage and the second webpage are different, send the webpage access request to the standby server.
其中,网关设备同时连接主服务器和备服务器,终端通过网关设备访问主服务器和备服务器,在网站中的网页没有被篡改之前,主服务器和备服务器存储有相同的网址的网页。可选的,可以在网站发布之间,网关设备将网站拷贝一份至备服务器,使备服务器和主服务器中的网址保持一致。网关设备接收终端发送的网页访问请求,网页访问请求携带网页地址,网页地址可以为网页链接地址。网关设备根据网页地址确定访问的主服务器,网关设备在主服务器中获取网页地址指示的第一网页,以及在备服务器中获取网页地址指示的第二网页,网关设备判断第一网页和第二网页是否相同,若第一网页和第二网页不相 同,网络设备将网页访问请求发送给备服务器,备服务器接收网页访问请求,将网页地址指示的第二网页返回给终端。可选的,网关设备可以将获取到的第二网页发送给终端,不需要将网页访问请求发送给备服务器,利用网关设备的缓存功能,减少网页访问的响应时间。The gateway device is connected to the primary server and the standby server at the same time, and the terminal accesses the primary server and the standby server through the gateway device. Before the webpage in the website is not tampered with, the primary server and the standby server store the webpage with the same URL. Optionally, between the website advertisements, the gateway device copies the website to the standby server, so that the URLs in the standby server and the primary server are consistent. The gateway device receives the webpage access request sent by the terminal, and the webpage access request carries the webpage address, and the webpage address may be a webpage link address. The gateway device determines the accessed primary server according to the webpage address, the gateway device obtains the first webpage indicated by the webpage address in the primary server, and obtains the second webpage indicated by the webpage address in the standby server, and the gateway device determines the first webpage and the second webpage. Is it the same, if the first page and the second page are not the same Similarly, the network device sends the webpage access request to the standby server, and the standby server receives the webpage access request, and returns the second webpage indicated by the webpage address to the terminal. Optionally, the gateway device may send the obtained second webpage to the terminal, and does not need to send the webpage access request to the standby server, and uses the cache function of the gateway device to reduce the response time of the webpage access.
实施本发明的实施例,备服务器中存储有备份的网址,网关设备在主服务器中的网页被篡改时,将备服务器中的网页发生给终端,使终端能无感知的访问到正确的网页。In the embodiment of the present invention, the backup server stores the backed up web address. When the webpage of the main server is tampered with, the gateway device generates the webpage in the standby server to the terminal, so that the terminal can access the correct webpage without any sense.
可选的,所述判断所述第一网页和所述第二网页是否相同包括:Optionally, the determining whether the first webpage and the second webpage are the same include:
根据预设的截图规则将所述第一网页进行截图得到第一图片;The first webpage is screenshotd according to a preset screenshot rule to obtain a first image;
根据所述截图规则将所述第二网页进行截图得到第二图片;Performing a screenshot of the second webpage according to the screenshot rule to obtain a second image;
比较所述第一图片和所述第二图片的相似度;Comparing the similarity between the first picture and the second picture;
若所述第一图片和所述第二图片的相似度大于预设值,确定所述第一网页和所述第二网页相同;或If the similarity between the first picture and the second picture is greater than a preset value, determining that the first webpage and the second webpage are the same; or
若所述第一图片和所述第二图片的相似度值不大于预设预设值,确定所述第一网页和所述第二网页不相同。If the similarity value of the first picture and the second picture is not greater than a preset preset value, determining that the first webpage and the second webpage are different.
其中,截图规则可以包括截图位置、图片大小和图片格式中的一种或多种,网关设备采用相同截图规则对第一网页和第二网页进行截图。计算两个图片的相似度值的算法可采用现有的任意一种相似度算法,例如余弦相似度算法,本实施例不作限制。The screenshot rule may include one or more of a screenshot location, a picture size, and a picture format, and the gateway device uses the same screenshot rule to take a screenshot of the first webpage and the second webpage. The algorithm for calculating the similarity value of the two pictures may be any existing similarity algorithm, such as a cosine similarity algorithm, which is not limited in this embodiment.
在第一方面的一种可能的实现方式中,所述判断第一网页和所述第二网页是否相同包括:In a possible implementation manner of the first aspect, the determining whether the first webpage and the second webpage are the same include:
获取所述第一网页的第一网页代码;Obtaining a first webpage code of the first webpage;
获取所述第二网页的第二网页代码;Obtaining a second webpage code of the second webpage;
根据预设的哈希算法对所述第一网页代码进行哈希运算得到第一哈希值;Performing a hash operation on the first webpage code according to a preset hash algorithm to obtain a first hash value;
根据所述哈希算法对所述第二网页代码进行哈希运算得到第二哈希值;Performing a hash operation on the second webpage code according to the hash algorithm to obtain a second hash value;
判断所述第一哈希值和所述第二哈希值是否相等;Determining whether the first hash value and the second hash value are equal;
若为是,确定所述第一网页和所述第二网页相同;或If yes, determining that the first webpage and the second webpage are the same; or
若为否,确定所述第一网页和所述第二网页不相同。If not, it is determined that the first webpage and the second webpage are different.
其中,哈希算法可以为MD2、MD4、MD5和SHA-1中的任意一种。 The hash algorithm may be any one of MD2, MD4, MD5, and SHA-1.
在第一方面的一种可能的实现方式中,所述接收网页访问请求之前,还包括:In a possible implementation manner of the first aspect, before the receiving the webpage access request, the method further includes:
将所述网页访问请求指示的网站拷贝至所述备份服务器,以及计算和存储所述网址中每个网页的哈希值。Copying the website indicated by the webpage access request to the backup server, and calculating and storing a hash value of each webpage in the webpage.
其中,网关设备预先存储备服务器中每个网页的哈希值,这样网关设备可直接从本地获取第二网页的哈希值。The gateway device pre-stores the hash value of each webpage in the standby server, so that the gateway device can directly obtain the hash value of the second webpage from the local.
在第一方面的一种可能的实现方式中,还包括:In a possible implementation manner of the first aspect, the method further includes:
若所述网页访问请求指示的网址中的网页发生更新时,将发生更新的网页覆盖所述备服务器中对应的网页。If the webpage in the webpage indicated by the webpage access request is updated, the webpage that will be updated covers the corresponding webpage in the standby server.
其中,此时的网页更新表示网站的管理员执行的正常更新流程。The webpage update at this time represents a normal update process performed by the administrator of the website.
参见图2,为本发明实施例提供的一种网关设备的结构示意图,本发明实施例的网关设备用于执行图1中的一种网页访问控制方法,所涉及的术语和过程可参照图1实施例的描述。网关设备2包括:接收单元201、获取单元202、判断单元203和发送单元204。FIG. 2 is a schematic structural diagram of a gateway device according to an embodiment of the present invention. The gateway device in the embodiment of the present invention is used to perform a webpage access control method in FIG. 1 , and the terminology and process involved may refer to FIG. 1 . Description of the embodiments. The gateway device 2 includes a receiving unit 201, an obtaining unit 202, a determining unit 203, and a transmitting unit 204.
接收单元201,用于接收网页访问请求;其中,所述网页访问请求携带网页地址。The receiving unit 201 is configured to receive a webpage access request, where the webpage access request carries a webpage address.
获取单元202,用于获取所述网页地址在主服务器中的第一网页,以及获取所述网页地址在备服务器中的第二网页。The obtaining unit 202 is configured to acquire the first webpage whose webpage address is in the main server, and obtain the second webpage whose webpage address is in the standby server.
判断单元203,用于判断所述第一网页和所述第二网页是否相同。The determining unit 203 is configured to determine whether the first webpage and the second webpage are the same.
发送单元204,用于若所述判断单元的判断结果为是,将所述网页访问请求发送给所述备服务器。The sending unit 204 is configured to send the webpage access request to the standby server if the determination result of the determining unit is yes.
可选的,所述判断单元用203于:Optionally, the determining unit uses 203 to:
根据预设的截图规则将所述第一网页进行截图得到第一图片;The first webpage is screenshotd according to a preset screenshot rule to obtain a first image;
根据所述截图规则将所述第二网页进行截图得到第二图片;Performing a screenshot of the second webpage according to the screenshot rule to obtain a second image;
比较所述第一图片和所述第二图片的相似度;Comparing the similarity between the first picture and the second picture;
若所述第一图片和所述第二图片的相似度大于预设值,确定所述第一网页和所述第二网页相同;或If the similarity between the first picture and the second picture is greater than a preset value, determining that the first webpage and the second webpage are the same; or
若所述第一图片和所述第二图片的相似度值不大于预设预设值,确定所述 第一网页和所述第二网页不相同。Determining if the similarity value of the first picture and the second picture is not greater than a preset preset value The first web page and the second web page are different.
可选的,所述判断单元203用于:Optionally, the determining unit 203 is configured to:
获取所述第一网页的第一网页代码;Obtaining a first webpage code of the first webpage;
获取所述第二网页的第二网页代码;Obtaining a second webpage code of the second webpage;
根据预设的哈希算法对所述第一网页代码进行哈希运算得到第一哈希值;Performing a hash operation on the first webpage code according to a preset hash algorithm to obtain a first hash value;
根据所述哈希算法对所述第二网页代码进行哈希运算得到第二哈希值;Performing a hash operation on the second webpage code according to the hash algorithm to obtain a second hash value;
判断所述第一哈希值和所述第二哈希值是否相等;Determining whether the first hash value and the second hash value are equal;
若为是,确定所述第一网页和所述第二网页相同;或If yes, determining that the first webpage and the second webpage are the same; or
若为否,确定所述第一网页和所述第二网页不相同。If not, it is determined that the first webpage and the second webpage are different.
可选的,还包括:Optionally, it also includes:
存储单元,用于将所述网页访问请求指示的网站拷贝至所述备份服务器,以及计算和存储所述网址中每个网页的哈希值。And a storage unit, configured to copy the website indicated by the webpage access request to the backup server, and calculate and store a hash value of each webpage in the webpage.
可选的,还包括:Optionally, it also includes:
更新单元,用于若所述网页访问请求指示的网址中的网页发生更新时,将发生更新的网页覆盖所述备服务器中对应的网页。And an updating unit, configured to: when the webpage in the webpage indicated by the webpage access request is updated, the webpage that will be updated covers the corresponding webpage in the standby server.
本发明实施例和方法实施例一基于同一构思,其带来的技术效果也相同,具体过程可参照方法实施例一的描述,此处不再赘述。The embodiment of the present invention and the method embodiment 1 are based on the same concept, and the technical effects thereof are also the same. For the specific process, reference may be made to the description of the method embodiment 1, and details are not described herein again.
参见图3,为本发明实施例提供的一种网关设备的另一结构示意图,在本发明实施例中,网关设备3包括处理器301、存储器302和收发器303。收发器303用于与外部设备之间收发数据。网关设备3中的处理器301的数量可以是一个或多个。本发明的一些实施例中,处理器301、存储器302和收发器303可通过总线系统或其他方式连接。网关设备3可以用于执行图1所示的方法。关于本实施例涉及的术语的含义以及举例,可以参考图1对应的实施例。此处不再赘述。FIG. 3 is a schematic diagram of another structure of a gateway device according to an embodiment of the present invention. In the embodiment of the present invention, the gateway device 3 includes a processor 301, a memory 302, and a transceiver 303. The transceiver 303 is configured to transmit and receive data with and from an external device. The number of processors 301 in the gateway device 3 may be one or more. In some embodiments of the invention, processor 301, memory 302, and transceiver 303 may be connected by a bus system or other means. The gateway device 3 can be used to perform the method shown in FIG. For the meaning and examples of the terms involved in the embodiment, reference may be made to the corresponding embodiment of FIG. 1. I will not repeat them here.
所述收发器303,用于接收网页访问请求;其中,所述网页访问请求携带网页地址;The transceiver 303 is configured to receive a webpage access request, where the webpage access request carries a webpage address;
所述存储器302存储有程序代码;The memory 302 stores a program code;
所述处理器301调用所述程序代码用于执行以下操作: The processor 301 calls the program code to perform the following operations:
获取所述网页地址在主服务器中的第一网页,以及获取所述网页地址在备服务器中的第二网页;Obtaining a first webpage whose webpage address is in the main server, and acquiring a second webpage whose webpage address is in the standby server;
判断所述第一网页和所述第二网页是否相同;Determining whether the first webpage and the second webpage are the same;
若为否,指示所述收发器303将所述网页访问请求发送给所述备服务器。If not, the transceiver 303 is instructed to send the webpage access request to the standby server.
可选的,所述处理器301执行所述判断所述第一网页和所述第二网页是否相同包括:Optionally, the performing, by the processor 301, determining whether the first webpage and the second webpage are the same include:
根据预设的截图规则将所述第一网页进行截图得到第一图片;The first webpage is screenshotd according to a preset screenshot rule to obtain a first image;
根据所述截图规则将所述第二网页进行截图得到第二图片;Performing a screenshot of the second webpage according to the screenshot rule to obtain a second image;
比较所述第一图片和所述第二图片的相似度;Comparing the similarity between the first picture and the second picture;
若所述第一图片和所述第二图片的相似度大于预设值,确定所述第一网页和所述第二网页相同;或If the similarity between the first picture and the second picture is greater than a preset value, determining that the first webpage and the second webpage are the same; or
若所述第一图片和所述第二图片的相似度值不大于预设预设值,确定所述第一网页和所述第二网页不相同。If the similarity value of the first picture and the second picture is not greater than a preset preset value, determining that the first webpage and the second webpage are different.
可选的,所述处理器301执行所述判断第一网页和所述第二网页是否相同包括:Optionally, the performing, by the processor 301, determining whether the first webpage and the second webpage are the same include:
获取所述第一网页的第一网页代码;Obtaining a first webpage code of the first webpage;
获取所述第二网页的第二网页代码;Obtaining a second webpage code of the second webpage;
根据预设的哈希算法对所述第一网页代码进行哈希运算得到第一哈希值;Performing a hash operation on the first webpage code according to a preset hash algorithm to obtain a first hash value;
根据所述哈希算法对所述第二网页代码进行哈希运算得到第二哈希值;Performing a hash operation on the second webpage code according to the hash algorithm to obtain a second hash value;
判断所述第一哈希值和所述第二哈希值是否相等;Determining whether the first hash value and the second hash value are equal;
若为是,确定所述第一网页和所述第二网页相同;或If yes, determining that the first webpage and the second webpage are the same; or
若为否,确定所述第一网页和所述第二网页不相同。If not, it is determined that the first webpage and the second webpage are different.
可选的,所述处理器301还用于执行:Optionally, the processor 301 is further configured to:
将所述网页访问请求指示的网站拷贝至所述备份服务器,以及计算和存储所述网址中每个网页的哈希值。Copying the website indicated by the webpage access request to the backup server, and calculating and storing a hash value of each webpage in the webpage.
可选的,所述处理器301还用于执行:Optionally, the processor 301 is further configured to:
若所述网页访问请求指示的网址中的网页发生更新时,将发生更新的网页覆盖所述备服务器中对应的网页。If the webpage in the webpage indicated by the webpage access request is updated, the webpage that will be updated covers the corresponding webpage in the standby server.
其中,本发明实施例的终端包括但不限于搭载 或者其它操作系统的终端,诸如移动电话。也可以是其它终端,诸如具有触敏表面(例如,触摸屏显示器和/或触控板)的膝上型计算机或平板电脑或台式计算机。The terminal of the embodiment of the present invention includes but is not limited to piggybacking Or terminals of other operating systems, such as mobile phones. Other terminals may also be used, such as a laptop or tablet or desktop computer with a touch-sensitive surface (eg, a touch screen display and/or a touch pad).
在下面的讨论中,介绍了一种包括显示器和触敏表面的终端。然而应当理解,终端可以包括一个或多个其他物理用户接口设备,诸如物理键盘、鼠标和/或操作杆。In the discussion that follows, a terminal including a display and a touch-sensitive surface is described. It should be understood, however, that the terminal can include one or more other physical user interface devices, such as a physical keyboard, mouse, and/or joystick.
终端通常支持多种应用程序,诸如以下中的一种或多种:画图应用程序、呈现应用程序、文字处理应用程序、网页创建应用程序、盘编辑应用程序、电子表格应用程序、游戏应用程序、电话应用程序、视频会议应用程序、电子邮件应用程序、即时消息应用程序、锻炼支持应用程序、相片管理应用程序、数字相机应用程序、数字视频摄像机应用程序、网络浏览应用程序、数字音乐播放器应用程序、和/或数字视频播放器应用程序。Terminals typically support a variety of applications, such as one or more of the following: a drawing application, a rendering application, a word processing application, a web page creation application, a disk editing application, a spreadsheet application, a gaming application, Telephony applications, video conferencing applications, email applications, instant messaging applications, workout support applications, photo management applications, digital camera applications, digital video camera applications, web browsing applications, digital music player applications Program, and/or digital video player application.
可在终端上执行的各种应用程序可使用至少一个共用的物理用户接口设备,诸如触敏表面。触敏表面的一种或多种功能以及显示在终端上的相应信息可从一种应用程序调整和/或变化至下一种应用程序和/或在相应应用程序内被调整和/或变化。这样,终端的共用物理架构(诸如触敏表面)可利用对于用户而言直观清楚的用户界面来支持各种应用程序。The various applications that can be executed on the terminal can use at least one shared physical user interface device, such as a touch-sensitive surface. One or more functions of the touch-sensitive surface and corresponding information displayed on the terminal may be adjusted and/or changed from one application to the next and/or adjusted and/or varied within the respective application. In this way, the shared physical architecture of the terminal, such as a touch-sensitive surface, can support a variety of applications with a user interface that is intuitive to the user.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的程序可存储于一计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,所述的存储介质可为磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)或随机存储记忆体(Random Access Memory,RAM)等。One of ordinary skill in the art can understand that all or part of the process of implementing the foregoing embodiments can be completed by a computer program to instruct related hardware, and the program can be stored in a computer readable storage medium. When executed, the flow of an embodiment of the methods as described above may be included. The storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
以上所揭露的仅为本发明一种较佳实施例而已,当然不能以此来限定本发明之权利范围,本领域普通技术人员可以理解实现上述实施例的全部或部分流程,并依本发明权利要求所作的等同变化,仍属于发明所涵盖的范围。 The above disclosure is only a preferred embodiment of the present invention, and of course, the scope of the present invention is not limited thereto, and those skilled in the art can understand all or part of the process of implementing the above embodiments, and according to the present invention. The equivalent changes required are still within the scope of the invention.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2017/084267 WO2018209465A1 (en) | 2017-05-15 | 2017-05-15 | Webpage access control method and gateway device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2017/084267 WO2018209465A1 (en) | 2017-05-15 | 2017-05-15 | Webpage access control method and gateway device |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2018209465A1 true WO2018209465A1 (en) | 2018-11-22 |
Family
ID=64273089
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2017/084267 WO2018209465A1 (en) | 2017-05-15 | 2017-05-15 | Webpage access control method and gateway device |
Country Status (1)
Country | Link |
---|---|
WO (1) | WO2018209465A1 (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109669819A (en) * | 2018-12-21 | 2019-04-23 | 努比亚技术有限公司 | Webpage open method, device, mobile terminal and computer readable storage medium |
CN112052422A (en) * | 2020-09-29 | 2020-12-08 | 微医云(杭州)控股有限公司 | Method and device for building internet hospital webpage, electronic equipment and storage medium |
CN112769792A (en) * | 2020-12-30 | 2021-05-07 | 绿盟科技集团股份有限公司 | ISP attack detection method and device, electronic equipment and storage medium |
CN113709148A (en) * | 2021-08-26 | 2021-11-26 | 天元大数据信用管理有限公司 | Website monitoring method, equipment and medium |
CN116055187A (en) * | 2023-01-28 | 2023-05-02 | 北京亿赛通科技发展有限责任公司 | Gateway rapid dynamic detection method, device, gateway equipment and storage medium |
Citations (4)
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 |
CN102685074A (en) * | 2011-03-14 | 2012-09-19 | 国基电子(上海)有限公司 | Anti-phishing network communication system and method |
CN103136251A (en) * | 2011-11-29 | 2013-06-05 | 星云融创(北京)科技有限公司 | Method and device of webpage identification |
CN103986731A (en) * | 2014-05-30 | 2014-08-13 | 北京奇虎科技有限公司 | Method and device for detecting phishing web pages through image matching |
-
2017
- 2017-05-15 WO PCT/CN2017/084267 patent/WO2018209465A1/en active Application Filing
Patent Citations (4)
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 |
CN102685074A (en) * | 2011-03-14 | 2012-09-19 | 国基电子(上海)有限公司 | Anti-phishing network communication system and method |
CN103136251A (en) * | 2011-11-29 | 2013-06-05 | 星云融创(北京)科技有限公司 | Method and device of webpage identification |
CN103986731A (en) * | 2014-05-30 | 2014-08-13 | 北京奇虎科技有限公司 | Method and device for detecting phishing web pages through image matching |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109669819A (en) * | 2018-12-21 | 2019-04-23 | 努比亚技术有限公司 | Webpage open method, device, mobile terminal and computer readable storage medium |
CN109669819B (en) * | 2018-12-21 | 2023-04-28 | 广东全通教育科技集团有限公司 | Webpage opening method and device, mobile terminal and computer readable storage medium |
CN112052422A (en) * | 2020-09-29 | 2020-12-08 | 微医云(杭州)控股有限公司 | Method and device for building internet hospital webpage, electronic equipment and storage medium |
CN112769792A (en) * | 2020-12-30 | 2021-05-07 | 绿盟科技集团股份有限公司 | ISP attack detection method and device, electronic equipment and storage medium |
CN112769792B (en) * | 2020-12-30 | 2023-05-02 | 绿盟科技集团股份有限公司 | ISP attack detection method and device, electronic equipment and storage medium |
CN113709148A (en) * | 2021-08-26 | 2021-11-26 | 天元大数据信用管理有限公司 | Website monitoring method, equipment and medium |
CN116055187A (en) * | 2023-01-28 | 2023-05-02 | 北京亿赛通科技发展有限责任公司 | Gateway rapid dynamic detection method, device, gateway equipment and storage medium |
CN116055187B (en) * | 2023-01-28 | 2023-06-16 | 北京亿赛通科技发展有限责任公司 | Gateway rapid dynamic detection method, device, gateway equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2018209465A1 (en) | Webpage access control method and gateway device | |
US20160364119A1 (en) | Predictive caching and fetch priority | |
US9449113B2 (en) | Browser storage management | |
US20130007895A1 (en) | Managing access control for a screen sharing session | |
US10572350B1 (en) | System and method for improved application consistency in a distributed environment | |
US10210172B1 (en) | File system integration and synchronization between client and server | |
US9047469B2 (en) | Modes for applications | |
JP6938983B2 (en) | Information processing system, information processing device and information processing method | |
CN109857573B (en) | Data sharing method, device, equipment and system | |
WO2018049879A1 (en) | Data migration method and device | |
CN114827634B (en) | Image transformation in a mixed source architecture | |
US12088656B2 (en) | Method and system for enforcing governance across multiple content repositories using a content broker | |
CN106547486A (en) | A data migration method and device | |
WO2018049880A1 (en) | Data migration method and device | |
CN107220388A (en) | A kind of method and apparatus of upper transmitting file | |
CN114969065A (en) | Session-level read-and-write consistency of digital data versions in distributed networks | |
CN111913774A (en) | Floating window management method and device | |
CN114615287B (en) | File backup method and device, computer equipment and storage medium | |
WO2013107032A1 (en) | Shortened network address linking to image representation of web page | |
CN116594724A (en) | Content presenting method, device, device and storage medium | |
CN113110846B (en) | A method and device for obtaining environment variables | |
US10015248B1 (en) | Syncronizing changes to stored data among multiple client devices | |
WO2018209462A1 (en) | Mail management method and mail server | |
WO2018217406A1 (en) | Providing instant preview of cloud based file | |
CN108536782A (en) | Information processing device and information processing method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 17909772 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 17909772 Country of ref document: EP Kind code of ref document: A1 |