CN106940719B - Page skipping method and device - Google Patents

Page skipping method and device Download PDF

Info

Publication number
CN106940719B
CN106940719B CN201710150474.8A CN201710150474A CN106940719B CN 106940719 B CN106940719 B CN 106940719B CN 201710150474 A CN201710150474 A CN 201710150474A CN 106940719 B CN106940719 B CN 106940719B
Authority
CN
China
Prior art keywords
tag
page
page number
user
function
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.)
Expired - Fee Related
Application number
CN201710150474.8A
Other languages
Chinese (zh)
Other versions
CN106940719A (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.)
Fujian Cnfol Information Technology Co Ltd
Original Assignee
Fujian Cnfol Information Technology 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 Fujian Cnfol Information Technology Co Ltd filed Critical Fujian Cnfol Information Technology Co Ltd
Priority to CN201710150474.8A priority Critical patent/CN106940719B/en
Publication of CN106940719A publication Critical patent/CN106940719A/en
Application granted granted Critical
Publication of CN106940719B publication Critical patent/CN106940719B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

本发明公开了一种页面跳转方法及装置,该方法包括:判断是否接收到用户对所述页码的点击操作;若是,响应于所述点击操作,调用与所述第一标签关联的第一函数,所述第一函数用于获取所述页码及搜索标签的标识;通过所述标识,获取所述搜索标签中的关键术语,所述关键术语为所述用户搜索所述页面时所输入的术语;将所述关键术语以及所述页码添加至HTTP包体中,并发送至服务器。本申请方案采用POST方式传输数据,将数据添加至HTTP包体传输,相比于通过HTTP协议传输数据,安全性更高。

Figure 201710150474

The invention discloses a page jumping method and device. The method includes: judging whether a user click operation on the page number is received; if so, in response to the click operation, calling a first tag associated with the first label. function, the first function is used to obtain the page number and the identifier of the search tag; through the identifier, the key term in the search tag is obtained, and the key term is input by the user when searching the page Term; add the key term and the page number to the HTTP packet body, and send it to the server. The solution of this application adopts the POST method to transmit data, adding the data to the HTTP packet body for transmission, which is more secure than transmitting data through the HTTP protocol.

Figure 201710150474

Description

一种页面跳转方法及装置Method and device for page jumping

技术领域technical field

本发明涉及网页技术领域,特别是涉及一种页面跳转方法及装置。The present invention relates to the technical field of web pages, and in particular, to a page jumping method and device.

背景技术Background technique

随着移动终端智能化程度的提高和移动互联网的迅速普及,越来越多的用户在移动终端上通过浏览器来进行网页访问,实现随时随地的资讯体验。With the improvement of the intelligence of mobile terminals and the rapid popularization of mobile Internet, more and more users access web pages through browsers on mobile terminals to realize information experience anytime, anywhere.

现有技术中,用户进行网页访问时,后台服务器通过a标签实现网页的页面跳转。如图1所示,与页码3对应的a标签为<a href=’……’>3</a>,当用户点击网页上的页码3时,a标签通过GET方式向后台服务器发送数据,所述GET方式指的是将传输数据添加至该页码所在的网页的URL之后,即HTTP协议头中,并向后台服务器发送添加之后的URL地址。In the prior art, when a user accesses a web page, the backend server realizes the page jump of the web page through the a tag. As shown in Figure 1, the a tag corresponding to page number 3 is <a href='...'>3</a>. When the user clicks page number 3 on the web page, the a tag sends data to the background server through GET. The GET method refers to adding the transmission data after the URL of the webpage where the page number is located, that is, in the HTTP protocol header, and sending the added URL address to the background server.

发明人在对现有技术的研究过程中发现,发送URL地址对所有用户都可见,所以,采用GET方式向后台服务器发送数据,容易造成信息泄露。During the research process of the prior art, the inventor found that the sending URL address is visible to all users. Therefore, sending data to the background server in the GET method is likely to cause information leakage.

发明内容SUMMARY OF THE INVENTION

为解决上述技术问题,本发明实施例提供了一种页面跳转方法及装置,以解决页面跳转时,容易造成信息泄露的问题,技术方案如下:In order to solve the above technical problems, the embodiments of the present invention provide a method and device for page jumping, so as to solve the problem that information leakage is easily caused during page jumping. The technical solutions are as follows:

一种页面跳转方法,所述页面上的页码采用第一标签表示,所述方法包括:A method for page jumping, wherein the page number on the page is represented by a first label, and the method includes:

判断是否接收到用户对所述页码的点击操作;Determine whether a click operation on the page number by the user is received;

若是,响应于所述点击操作,调用与所述第一标签关联的第一函数,所述第一函数用于获取所述页码及搜索标签的标识;If so, in response to the click operation, call a first function associated with the first label, where the first function is used to obtain the page number and the identifier of the search label;

通过所述标识,获取所述搜索标签中的关键术语,所述关键术语为所述用户搜索所述页面时所输入的术语;Obtaining key terms in the search tag through the identification, where the key terms are terms entered by the user when searching the page;

将所述关键术语以及所述页码添加至HTTP包体中,并发送至服务器。The key term and the page number are added to the HTTP packet body and sent to the server.

优选地,所述第一标签为div标签或去除href属性的a标签。Preferably, the first tag is a div tag or a tag with the href attribute removed.

优选地,其特征在于,所述第一函数为CiPageChange(url,id,pa),所述url为所述页面的地址,所述id为所述搜索标签的标识,所述pa为所述页码。Preferably, the first function is CiPageChange(url, id, pa), the url is the address of the page, the id is the identifier of the search tag, and the pa is the page number .

优选地,还包括:Preferably, it also includes:

生成第三标签,所述第三标签用于触发所述HTTP包体至所述服务器。A third tag is generated, where the third tag is used to trigger the HTTP packet body to the server.

优选地,所述搜索标签与所述第三标签为form标签。Preferably, the search tag and the third tag are form tags.

一种页面跳转装置,所述页面上的页码采用第一标签表示,所述装置包括:A page jumping device, the page number on the page is represented by a first label, and the device includes:

判断单元,用于判断是否接收到用户对所述页码的点击操作;a judging unit for judging whether a user's click operation on the page number is received;

调用单元,用于但判断单元判断接收到用户对所述页码的点击操作时,响应于所述点击操作,调用与所述第一标签关联的第一函数,所述第一函数用于获取所述页码及搜索标签的标识;The calling unit is used to call the first function associated with the first label in response to the click operation when the judgment unit judges that the user click operation on the page number is received, and the first function is used to obtain the the page number and the identification of the search tag;

获取单元,用于通过所述标识,获取所述搜索标签中的关键术语,所述关键术语为所述用户搜索所述页面时所输入的术语;an obtaining unit, configured to obtain key terms in the search tag through the identification, where the key terms are terms input by the user when searching the page;

添加单元,用于将所述关键术语以及所述页码添加至HTTP包体中,并发送至服务器。The adding unit is used to add the key term and the page number to the HTTP packet body, and send it to the server.

优选地,其特征在于,所述第一标签为div标签或去除href属性的a标签。Preferably, the first tag is a div tag or a tag with the href attribute removed.

优选地,其特征在于,所述第一函数为CiPageChange(url,id,pa),所述url为所述页面的地址,所述id为所述搜索标签的标识,所述pa为所述页码。Preferably, the first function is CiPageChange(url, id, pa), the url is the address of the page, the id is the identifier of the search tag, and the pa is the page number .

优选地,还包括:Preferably, it also includes:

生成单元,用于生成第三标签,所述第三标签用于触发所述HTTP包体至所述服务器。A generating unit, configured to generate a third label, where the third label is used to trigger the HTTP packet body to the server.

优选地,所述搜索标签与所述第三标签为form标签。Preferably, the search tag and the third tag are form tags.

本实施例所提供的技术方案,页面中的页码采用第一标签表示,第一标签关联有第一函数,第一函数用于获取用户所点击的页码及关键术语,并将所述页码及关键术语添加至HTTP包体中,发送至服务器。由上可见,本申请方案采用POST方式传输数据,将数据添加至HTTP包体传输,相比于通过HTTP协议传输数据,安全性更高。In the technical solution provided by this embodiment, the page number in the page is represented by a first label, the first label is associated with a first function, and the first function is used to obtain the page number and key terms clicked by the user, and use the page number and key terms. The term is added to the HTTP body and sent to the server. It can be seen from the above that the solution of the present application adopts the POST method to transmit data, and adds the data to the HTTP packet body for transmission, which is more secure than transmitting data through the HTTP protocol.

附图说明Description of drawings

为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单的介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the accompanying drawings used in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only These are some embodiments of the present invention, and for those of ordinary skill in the art, other drawings can also be obtained from these drawings without any creative effort.

图1为本发明实施例所提供的一种页面跳转方法的一种流程示意图;1 is a schematic flowchart of a method for page jumping provided by an embodiment of the present invention;

图2为本发明实施例所提供的一种页面跳转方法的另一种流程示意图;FIG. 2 is another schematic flowchart of a page jumping method provided by an embodiment of the present invention;

图3为本发明实施例所提供的一种页面跳转装置的一种结构示意图;3 is a schematic structural diagram of a page jumping device provided by an embodiment of the present invention;

图4为本发明实施例所提供的一种页面跳转装置的另一种结构示意图。FIG. 4 is another schematic structural diagram of a page jumping device according to an embodiment of the present invention.

具体实施方式Detailed ways

下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

请参阅图2,图2为本申请实施例提供的页面跳转方法的一种实现流程图,所述方法包括:Please refer to FIG. 2. FIG. 2 is a flowchart of an implementation of a method for page jumping provided by an embodiment of the present application. The method includes:

步骤S201、判断是否接收到用户对页码的点击操作,若是,执行步骤S202;Step S201, judging whether the user's click operation on the page number is received, if so, go to step S202;

为了实现对页面的跳转,所以,当前显示的页面上具有待跳转至页面的页码,如图1所示,页码包括1、2、3、4等。In order to realize the page jump, the currently displayed page has the page number to be jumped to. As shown in FIG. 1 , the page number includes 1, 2, 3, 4 and so on.

由于现有技术中采用a标签表示页码,a标签具有href属性,所以a标签在传输数据时,自动使用GET方式进行传输,本方案中为了不使用GET方式传输数据,所以,采用第一标签表示页码,第一标签为div标签或去除href属性的a标签。Since the a tag is used to represent the page number in the prior art, and the a tag has the href attribute, the a tag automatically uses the GET method to transmit data when transmitting data. In this scheme, in order not to use the GET method to transmit data, the first tag is used to represent Page number, the first tag is a div tag or a tag with the href attribute removed.

当用户需要浏览待跳转页面上的内容时,点击与待跳转页面对应的页码,该点击操作用于触发第一标签启动数据传输功能。When the user needs to browse the content on the page to be jumped, the user clicks the page number corresponding to the page to be jumped, and the click operation is used to trigger the first tag to start the data transmission function.

步骤S202、响应于所述点击操作,调用与所述第一标签关联的第一函数;Step S202, calling the first function associated with the first label in response to the click operation;

所述第一函数用于获取所述页码及搜索标签的标识。The first function is used to obtain the page number and the identifier of the search tag.

本实施例将第一标签与第一函数关联,从而通过第一函数选择传输数据时所使用的传输方式。In this embodiment, the first tag is associated with the first function, so that the transmission mode used when transmitting the data is selected by the first function.

由于后台服务器向用户提供每一页面时,都需要根据用户原始输入的关键术语从数据库中检索,所以,当用户点击页面上的页码时,除了向后台服务器传输用户所点击的页码外,还需要获得关键术语,该关键术语包括关键词或关键字。以图1举例说明,当用户在百度的首页面中输入“专利”这一关键词时,在跳转出的页面会出现页码1、2、3、4等,当用户点击页码3时,浏览器向后台服务器所传输的除了页码3这一参数外,还需要将“专利”这一关键词一并传输至后台服务器。Since the background server provides each page to the user, it needs to be retrieved from the database according to the key terms originally input by the user. Therefore, when the user clicks the page number on the page, in addition to transmitting the page number clicked by the user to the background server, it is also necessary to Get key terms that include keywords or keywords. Taking Figure 1 as an example, when the user enters the keyword "patent" on the first page of Baidu, page numbers 1, 2, 3, 4, etc. will appear on the jumped out page. In addition to the parameter of page number 3 transmitted from the server to the background server, the keyword "patent" also needs to be transmitted to the background server.

由于用户输入关键术语都是从页面中的搜索标签中输入,所以,在获得关键术语之前,首先要获得用于输入关键术语的搜索标签,搜索标签可以为form标签。Since the key terms entered by the user are all input from the search tags on the page, before obtaining the key terms, the search tags for inputting the key terms must be obtained first, and the search tags can be form tags.

步骤S203、通过所述标识,获取所述搜索标签中的关键术语;Step S203, obtaining key terms in the search tag through the identification;

所述关键术语为所述用户搜索所述页面时所输入的术语;The key term is the term entered by the user when searching the page;

步骤S204、将所述关键术语以及所述页码添加至HTTP包体中,并发送至服务器。Step S204: Add the key term and the page number to the HTTP packet body, and send it to the server.

本实施例中,第一标签关联的第一函数采用POST方式传输数据,所谓POST方式指的是将传输数据添加至该页码所在的网页的URL对应的HTTP包体中,并向后台服务器发送添加之后的HTTP包体。In this embodiment, the first function associated with the first tag uses the POST method to transmit data. The so-called POST method refers to adding the transmission data to the HTTP packet body corresponding to the URL of the webpage where the page number is located, and sending the added data to the background server. The following HTTP body.

Http(即网页)定义了与服务器(后台)交互的不同方法,最基本的方法有4种,分别是GET,POST,PUT,DELETE。URL全称是资源描述符,用于描述网络上的资源,而HTTP中的GET,POST,PUT,DELETE四种方式就对应着对这个资源的查,改,增,删4个操作。GET一般用于获取/查询资源信息,而POST一般用于更新资源信息。Http (ie web page) defines different methods for interacting with the server (background). There are four most basic methods, namely GET, POST, PUT, and DELETE. The full name of the URL is the resource descriptor, which is used to describe the resources on the network, and the four methods of GET, POST, PUT, and DELETE in HTTP correspond to the four operations of querying, modifying, adding, and deleting this resource. GET is generally used to obtain/query resource information, while POST is generally used to update resource information.

网页使用GET与POST方式的发送数据主要有两点不同:There are two main differences between sending data using GET and POST methods on web pages:

一是容量:One is capacity:

GET方式提交的数据最多只能是1024字节,理论上POST没有限制,可传较大量的数据,IIS4中最大为80KB,IIS5中为100KB。虽然描述不太准确,不过实际情况大致如此。The data submitted by the GET method can only be up to 1024 bytes. In theory, there is no limit to POST, and a large amount of data can be transmitted. The maximum size is 80KB in IIS4 and 100KB in IIS5. Although the description is not accurate, but the actual situation is roughly the same.

二是安全性:The second is security:

GET请求的数据会附在URL之后(就是把数据放置在HTTP协议头中),以?分割URL和传输数据,参数之间以&相连,如:login.action?name=hyddd&password=idontknow&verify=%E4%BD%A0%E5%A5%BD。如果数据是英文字母/数字,原样发送,如果是空格,转换为+,如果是中文/其他字符,则直接把字符串用BASE64加密,得出如:%E4%BD%A0%E5%A5%BD,其中%XX中的XX为该符号以16进制表示的ASCII。The data of the GET request will be appended to the URL (that is, the data will be placed in the HTTP protocol header), with ? Split the URL and transfer data, and connect the parameters with &, such as: login.action? name=hyddd&password=idontknow&verify=%E4%BD%A0%E5%A5%BD. If the data is English letters/numbers, send it as it is, if it is a space, convert it to +, if it is Chinese/other characters, directly encrypt the string with BASE64, and get such as: %E4%BD%A0%E5%A5% BD, where XX in %XX is the ASCII hex representation of the symbol.

POST把提交的数据则放置在是HTTP包的包体中。POST places the submitted data in the body of the HTTP packet.

以上可以看出POST的安全性要比GET的安全性高。比如:通过GET提交数据,用户名和密码将明文出现在URL上,因为(1)登录页面有可能被浏览器缓存,(2)其他人查看浏览器的历史纪录,那么别人就可以获取你的账号和密码了,除此之外,使用GET提交数据还可能会造成Cross-site request forgery攻击。因此,本实施例采用POST方式传输数据安全性更高。It can be seen from the above that the security of POST is higher than that of GET. For example, if you submit data via GET, the username and password will appear on the URL in plain text, because (1) the login page may be cached by the browser, and (2) others can view the browser's history, so others can get your account. In addition, using GET to submit data may also cause a Cross-site request forgery attack. Therefore, in this embodiment, the POST method is used to transmit data with higher security.

本实施例所提供的技术方案,页面中的页码采用第一标签表示,第一标签关联有第一函数,第一函数用于获取用户所点击的页码及关键术语,并将所述页码及关键术语添加至HTTP包体中,发送至服务器。由上可见,本申请方案采用POST方式传输数据,将数据添加至HTTP包体传输,相比于通过HTTP协议传输数据,安全性更高。In the technical solution provided by this embodiment, the page number in the page is represented by a first label, the first label is associated with a first function, and the first function is used to obtain the page number and key terms clicked by the user, and use the page number and key terms. The term is added to the HTTP body and sent to the server. It can be seen from the above that the solution of the present application adopts the POST method to transmit data, and adds the data to the HTTP packet body for transmission, which is more secure than transmitting data through the HTTP protocol.

请参阅图3,图3为本申请实施例提供的页面跳转方法的一种实现流程图,所述方法包括:Please refer to FIG. 3. FIG. 3 is an implementation flowchart of a method for page jumping provided by an embodiment of the present application. The method includes:

步骤S301、判断是否接收到用户对所述页码的点击操作,若是,执行步骤S302;Step S301, judging whether a user's click operation on the page number is received, if yes, perform step S302;

为了实现对页面的跳转,所以,当前显示的页面上具有待跳转至页面的页码,如图1所示,页码包括1、2、3、4等。In order to realize the page jump, the currently displayed page has the page number to be jumped to. As shown in FIG. 1 , the page number includes 1, 2, 3, 4 and so on.

所述页面上的页码采用div标签或去除href属性的a标签表示。The page number on the page is represented by a div tag or a tag with the href attribute removed.

由于现有技术中采用a标签表示页码,a标签具有href属性,所以a标签在传输数据时,自动使用GET方式进行传输,本方案中为了不使用GET方式传输数据,所以,采用div标签或去除href属性的a标签表示页码。Since the a tag is used to represent the page number in the prior art, and the a tag has the href attribute, the a tag automatically uses the GET method to transmit data when transmitting data. In this scheme, in order not to use the GET method to transmit data, the div tag or remove The a tag of the href attribute represents the page number.

当用户需要浏览待跳转页面上的内容时,点击与待跳转页面对应的页码,该点击操作用于触发div标签或去除href属性的a标签启动数据传输功能。When the user needs to browse the content on the page to be jumped, click the page number corresponding to the page to be jumped, and the click operation is used to trigger the div tag or remove the a tag of the href attribute to start the data transmission function.

步骤S302、响应于所述点击操作,调用与所述div标签或去除href属性的a标签关联的函数CiPageChange(url,id,pa),所述函数用于获取所述页码及第一form标签的标识;Step S302, in response to the click operation, call the function CiPageChange(url, id, pa) associated with the div tag or the a tag with the href attribute removed, and the function is used to obtain the page number and the first form tag. identification;

所述url为所述页面的地址,所述id为所述搜索标签的标识,所述pa为所述页码。The url is the address of the page, the id is the identifier of the search tag, and the pa is the page number.

本实施例将div标签或去除href属性的a标签与函数CiPageChange(url,id,pa)关联,从而通过函数CiPageChange(url,id,pa)选择传输数据时所使用的传输方式。In this embodiment, the div tag or the a tag with the href attribute removed is associated with the function CiPageChange(url, id, pa), so that the transmission mode used for data transmission is selected through the function CiPageChange(url, id, pa).

由于后台服务器向用户提供每一页面时,都需要根据用户原始输入的关键术语从数据库中检索,所以,当用户点击页面上的页码时,除了向后台服务器传输用户所点击的页码外,还需要获得关键术语,该关键术语包括关键词或关键字。以图1举例说明,当用户在百度的首页面中输入“专利”这一关键词时,在跳转出的页面会出现页码1、2、3、4等,当用户点击页码3时,浏览器向后台服务器所传输的除了页码3这一参数外,还需要将“专利”这一关键词一并传输至后台服务器。Since the background server provides each page to the user, it needs to be retrieved from the database according to the key terms originally input by the user. Therefore, when the user clicks the page number on the page, in addition to transmitting the page number clicked by the user to the background server, it is also necessary to Get key terms that include keywords or keywords. Taking Figure 1 as an example, when the user enters the keyword "patent" on the first page of Baidu, page numbers 1, 2, 3, 4, etc. will appear on the jumped out page. In addition to the parameter of page number 3 transmitted from the server to the background server, the keyword "patent" also needs to be transmitted to the background server.

由于用户输入关键术语都是从页面中的form标签中输入,所以,在获得关键术语之前,首先要获得用于输入关键术语的form标签Since the key terms entered by the user are input from the form tag in the page, before obtaining the key terms, the form tag for inputting the key terms must be obtained first.

步骤S303、通过所述标识,获取所述第一form标签中的关键术语,所述关键术语为所述用户搜索所述页面时所输入的术语;Step S303, obtaining key terms in the first form tag through the identification, where the key terms are terms input by the user when searching the page;

步骤S304、将所述关键术语以及所述页码添加至HTTP包体中;Step S304, adding the key term and the page number to the HTTP package body;

步骤S305、生成第二form标签,所述第二form标签用于触发所述HTTP包体至所述服务器。Step S305 , generating a second form tag, where the second form tag is used to trigger the HTTP packet body to the server.

Http(即网页)定义了与服务器(后台)交互的不同方法,最基本的方法有4种,分别是GET,POST,PUT,DELETE。URL全称是资源描述符,用于描述网络上的资源,而HTTP中的GET,POST,PUT,DELETE四种方式就对应着对这个资源的查,改,增,删4个操作。GET一般用于获取/查询资源信息,而POST一般用于更新资源信息。Http (ie web page) defines different methods for interacting with the server (background). There are four most basic methods, namely GET, POST, PUT, and DELETE. The full name of the URL is the resource descriptor, which is used to describe the resources on the network, and the four methods of GET, POST, PUT, and DELETE in HTTP correspond to the four operations of querying, modifying, adding, and deleting this resource. GET is generally used to obtain/query resource information, while POST is generally used to update resource information.

网页使用GET与POST方式的发送数据主要有两点不同:There are two main differences between sending data using GET and POST methods on web pages:

一是容量:One is capacity:

GET方式提交的数据最多只能是1024字节,理论上POST没有限制,可传较大量的数据,IIS4中最大为80KB,IIS5中为100KB。虽然描述不太准确,不过实际情况大致如此。The data submitted by the GET method can only be up to 1024 bytes. In theory, there is no limit to POST, and a large amount of data can be transmitted. The maximum size is 80KB in IIS4 and 100KB in IIS5. Although the description is not accurate, but the actual situation is roughly the same.

二是安全性:The second is security:

GET请求的数据会附在URL之后(就是把数据放置在HTTP协议头中),以?分割URL和传输数据,参数之间以&相连,如:login.action?name=hyddd&password=idontknow&verify=%E4%BD%A0%E5%A5%BD。如果数据是英文字母/数字,原样发送,如果是空格,转换为+,如果是中文/其他字符,则直接把字符串用BASE64加密,得出如:%E4%BD%A0%E5%A5%BD,其中%XX中的XX为该符号以16进制表示的ASCII。The data of the GET request will be appended to the URL (that is, the data will be placed in the HTTP protocol header), with ? Split the URL and transfer data, and connect the parameters with &, such as: login.action? name=hyddd&password=idontknow&verify=%E4%BD%A0%E5%A5%BD. If the data is English letters/numbers, send it as it is, if it is a space, convert it to +, if it is Chinese/other characters, directly encrypt the string with BASE64, and get such as: %E4%BD%A0%E5%A5% BD, where XX in %XX is the ASCII hex representation of the symbol.

POST把提交的数据则放置在是HTTP包的包体中。POST places the submitted data in the body of the HTTP packet.

以上可以看出POST的安全性要比GET的安全性高。比如:通过GET提交数据,用户名和密码将明文出现在URL上,因为(1)登录页面有可能被浏览器缓存,(2)其他人查看浏览器的历史纪录,那么别人就可以获取你的账号和密码了,除此之外,使用GET提交数据还可能会造成Cross-site request forgery攻击。因此,本实施例采用POST方式传输数据安全性更高。It can be seen from the above that the security of POST is higher than that of GET. For example, if you submit data via GET, the username and password will appear on the URL in plain text, because (1) the login page may be cached by the browser, and (2) others can view the browser's history, so others can get your account. In addition, using GET to submit data may also cause a Cross-site request forgery attack. Therefore, in this embodiment, the POST method is used to transmit data with higher security.

本实施例所提供的技术方案,页面中的页码采用第一标签表示,第一标签关联有第一函数,第一函数用于获取用户所点击的页码及关键术语,并将所述页码及关键术语添加至HTTP包体中,发送至服务器。由上可见,本申请方案采用POST方式传输数据,将数据添加至HTTP包体传输,相比于通过HTTP协议传输数据,安全性更高。In the technical solution provided by this embodiment, the page number in the page is represented by a first label, the first label is associated with a first function, and the first function is used to obtain the page number and key terms clicked by the user, and use the page number and key terms. The term is added to the HTTP body and sent to the server. It can be seen from the above that the solution of the present application adopts the POST method to transmit data, and adds the data to the HTTP packet body for transmission, which is more secure than transmitting data through the HTTP protocol.

请参阅图4,图4为本申请实施例提供的页面跳转装置的一种结构示意图,该装置结构示意图中的各单元的工作过程参照图2对应的实施例中方法的执行过程,该装置包括:Please refer to FIG. 4 . FIG. 4 is a schematic structural diagram of a page jumping device provided by an embodiment of the present application. For the working process of each unit in the structural schematic diagram of the device, refer to the execution process of the method in the embodiment corresponding to FIG. 2 . include:

判断单元401,用于判断是否接收到用户对所述页码的点击操作;Judging unit 401, for judging whether a user's click operation on the page number is received;

为了实现对页面的跳转,所以,当前显示的页面上具有待跳转至页面的页码,如图1所示,页码包括1、2、3、4等。In order to realize the page jump, the currently displayed page has the page number to be jumped to. As shown in FIG. 1 , the page number includes 1, 2, 3, 4 and so on.

由于现有技术中采用a标签表示页码,a标签具有href属性,所以a标签在传输数据时,自动使用GET方式进行传输,本方案中为了不使用GET方式传输数据,所以,采用第一标签表示页码,第一标签为div标签或去除href属性的a标签。Since the a tag is used to represent the page number in the prior art, and the a tag has the href attribute, the a tag automatically uses the GET method to transmit data when transmitting data. In this scheme, in order not to use the GET method to transmit data, the first tag is used to represent Page number, the first tag is a div tag or a tag with the href attribute removed.

当用户需要浏览待跳转页面上的内容时,点击与待跳转页面对应的页码,该点击操作用于触发第一标签启动数据传输功能。When the user needs to browse the content on the page to be jumped, the user clicks the page number corresponding to the page to be jumped, and the click operation is used to trigger the first tag to start the data transmission function.

调用单元402,用于但判断单元判断接收到用户对所述页码的点击操作时,响应于所述点击操作,调用与所述第一标签关联的第一函数;The calling unit 402 is used to call the first function associated with the first label in response to the click operation when the judgment unit judges that a click operation on the page number is received by the user;

所述第一函数用于获取所述页码及搜索标签的标识。The first function is used to obtain the page number and the identifier of the search tag.

本实施例将第一标签与第一函数关联,从而通过第一函数选择传输数据时所使用的传输方式。In this embodiment, the first tag is associated with the first function, so that the transmission mode used when transmitting the data is selected by the first function.

由于后台服务器向用户提供每一页面时,都需要根据用户原始输入的关键术语从数据库中检索,所以,当用户点击页面上的页码时,除了向后台服务器传输用户所点击的页码外,还需要获得关键术语,该关键术语包括关键词或关键字。以图1举例说明,当用户在百度的首页面中输入“专利”这一关键词时,在跳转出的页面会出现页码1、2、3、4等,当用户点击页码3时,浏览器向后台服务器所传输的除了页码3这一参数外,还需要将“专利”这一关键词一并传输至后台服务器。Since the background server provides each page to the user, it needs to be retrieved from the database according to the key terms originally input by the user. Therefore, when the user clicks the page number on the page, in addition to transmitting the page number clicked by the user to the background server, it is also necessary to Get key terms that include keywords or keywords. Taking Figure 1 as an example, when the user enters the keyword "patent" on the first page of Baidu, page numbers 1, 2, 3, 4, etc. will appear on the jumped out page. In addition to the parameter of page number 3 transmitted from the server to the background server, the keyword "patent" also needs to be transmitted to the background server.

由于用户输入关键术语都是从页面中的搜索标签中输入,所以,在获得关键术语之前,首先要获得用于输入关键术语的搜索标签,搜索标签可以为form标签。Since the key terms entered by the user are all input from the search tags on the page, before obtaining the key terms, the search tags for inputting the key terms must be obtained first, and the search tags can be form tags.

获取单元403,用于通过所述标识,获取所述搜索标签中的关键术语,所述关键术语为所述用户搜索所述页面时所输入的术语;Obtaining unit 403, configured to obtain key terms in the search tag through the identification, where the key terms are terms input by the user when searching the page;

添加单元404,用于将所述关键术语以及所述页码添加至HTTP包体中,并发送至服务器。The adding unit 404 is configured to add the key term and the page number to the HTTP packet body, and send it to the server.

本实施例中,第一标签关联的第一函数采用POST方式传输数据,所谓POST方式指的是将传输数据添加至该页码所在的网页的URL对应的HTTP包体中,并向后台服务器发送添加之后的HTTP包体。In this embodiment, the first function associated with the first tag uses the POST method to transmit data. The so-called POST method refers to adding the transmission data to the HTTP packet body corresponding to the URL of the webpage where the page number is located, and sending the added data to the background server. The following HTTP body.

Http(即网页)定义了与服务器(后台)交互的不同方法,最基本的方法有4种,分别是GET,POST,PUT,DELETE。URL全称是资源描述符,用于描述网络上的资源,而HTTP中的GET,POST,PUT,DELETE四种方式就对应着对这个资源的查,改,增,删4个操作。GET一般用于获取/查询资源信息,而POST一般用于更新资源信息。Http (ie web page) defines different methods for interacting with the server (background). There are four most basic methods, namely GET, POST, PUT, and DELETE. The full name of the URL is the resource descriptor, which is used to describe the resources on the network, and the four methods of GET, POST, PUT, and DELETE in HTTP correspond to the four operations of querying, modifying, adding, and deleting this resource. GET is generally used to obtain/query resource information, while POST is generally used to update resource information.

网页使用GET与POST方式的发送数据主要有两点不同:There are two main differences between sending data using GET and POST methods on web pages:

一是容量:One is capacity:

GET方式提交的数据最多只能是1024字节,理论上POST没有限制,可传较大量的数据,IIS4中最大为80KB,IIS5中为100KB。虽然描述不太准确,不过实际情况大致如此。The data submitted by the GET method can only be up to 1024 bytes. In theory, there is no limit to POST, and a large amount of data can be transmitted. The maximum size is 80KB in IIS4 and 100KB in IIS5. Although the description is not accurate, but the actual situation is roughly the same.

二是安全性:The second is security:

GET请求的数据会附在URL之后(就是把数据放置在HTTP协议头中),以?分割URL和传输数据,参数之间以&相连,如:login.action?name=hyddd&password=idontknow&verify=%E4%BD%A0%E5%A5%BD。如果数据是英文字母/数字,原样发送,如果是空格,转换为+,如果是中文/其他字符,则直接把字符串用BASE64加密,得出如:%E4%BD%A0%E5%A5%BD,其中%XX中的XX为该符号以16进制表示的ASCII。The data of the GET request will be appended to the URL (that is, the data will be placed in the HTTP protocol header), with ? Split the URL and transfer data, and connect the parameters with &, such as: login.action? name=hyddd&password=idontknow&verify=%E4%BD%A0%E5%A5%BD. If the data is English letters/numbers, send it as it is, if it is a space, convert it to +, if it is Chinese/other characters, directly encrypt the string with BASE64, and get such as: %E4%BD%A0%E5%A5% BD, where XX in %XX is the ASCII hex representation of the symbol.

POST把提交的数据则放置在是HTTP包的包体中。POST places the submitted data in the body of the HTTP packet.

以上可以看出POST的安全性要比GET的安全性高。比如:通过GET提交数据,用户名和密码将明文出现在URL上,因为(1)登录页面有可能被浏览器缓存,(2)其他人查看浏览器的历史纪录,那么别人就可以获取你的账号和密码了,除此之外,使用GET提交数据还可能会造成Cross-site request forgery攻击。因此,本实施例采用POST方式传输数据安全性更高。It can be seen from the above that the security of POST is higher than that of GET. For example, if you submit data via GET, the username and password will appear on the URL in plain text, because (1) the login page may be cached by the browser, and (2) others can view the browser's history, so others can get your account. In addition, using GET to submit data may also cause a Cross-site request forgery attack. Therefore, in this embodiment, the POST method is used to transmit data with higher security.

本实施例所提供的技术方案,页面中的页码采用第一标签表示,第一标签关联有第一函数,第一函数用于获取用户所点击的页码及关键术语,并将所述页码及关键术语添加至HTTP包体中,发送至服务器。由上可见,本申请方案采用POST方式传输数据,将数据添加至HTTP包体传输,相比于通过HTTP协议传输数据,安全性更高。In the technical solution provided by this embodiment, the page number in the page is represented by a first label, the first label is associated with a first function, and the first function is used to obtain the page number and key terms clicked by the user, and use the page number and key terms. The term is added to the HTTP body and sent to the server. It can be seen from the above that the solution of the present application adopts the POST method to transmit data, and adds the data to the HTTP packet body for transmission, which is more secure than transmitting data through the HTTP protocol.

对于装置或系统实施例而言,由于其基本相应于方法实施例,所以相关之处参见方法实施例的部分说明即可。以上所描述的装置或系统实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性劳动的情况下,即可以理解并实施。With regard to the apparatus or system embodiments, since they basically correspond to the method embodiments, reference may be made to the partial descriptions of the method embodiments for related parts. The apparatus or system embodiments described above are only illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, It can be located in one place, or it can be distributed over multiple network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution in this embodiment. Those of ordinary skill in the art can understand and implement it without creative effort.

在本发明所提供的几个实施例中,应该理解到,所揭露的系统,装置和方法,在没有超过本申请的精神和范围内,可以通过其他的方式实现。当前的实施例只是一种示范性的例子,不应该作为限制,所给出的具体内容不应该限制本申请的目的。例如,所述单元或子单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或多个子单元结合一起。另外,多个单元可以或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。In the several embodiments provided by the present invention, it should be understood that the disclosed system, apparatus and method may be implemented in other manners without exceeding the spirit and scope of the present application. The current embodiment is an illustrative example and should not be taken as a limitation, and the specific content given should not limit the purpose of this application. For example, the division of the units or sub-units is only a logical function division, and in actual implementation, there may be other division methods, for example, multiple units or multiple sub-units are combined together. Additionally, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not implemented.

另外,所描述系统,装置和方法以及不同实施例的示意图,在不超出本申请的范围内,可以与其它系统,模块,技术或方法结合或集成。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In addition, the described systems, apparatus and methods, and schematic diagrams of various embodiments, may be combined or integrated with other systems, modules, techniques or methods without departing from the scope of this application. On the other hand, the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.

以上所述仅是本发明的具体实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本发明的保护范围。The above are only specific embodiments of the present invention. It should be pointed out that for those skilled in the art, without departing from the principles of the present invention, several improvements and modifications can also be made. It should be regarded as the protection scope of the present invention.

最后,还需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。本说明书中各个实施例采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似部分互相参见即可。Finally, it should also be noted that in this document, relational terms such as first and second are used only to distinguish one entity or operation from another, and do not necessarily require or imply these entities or that there is any such actual relationship or sequence between operations. Moreover, the terms "comprising", "comprising" or any other variation thereof are intended to encompass a non-exclusive inclusion such that a process, method, article or device that includes a list of elements includes not only those elements, but also includes not explicitly listed or other elements inherent to such a process, method, article or apparatus. The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same and similar parts between the various embodiments can be referred to each other.

对所公开的实施例的上述说明,使本领域专业技术人员能够实现或使用本申请。对这些实施例的多种修改对本领域的专业技术人员来说将是显而易见的,本文中所定义的一般原理可以在不脱离本申请的精神或范围的情况下,在其它实施例中实现。因此,本申请将不会被限制于本文所示的这些实施例,而是要符合与本文所公开的原理和新颖特点相一致的最宽的范围。The above description of the disclosed embodiments enables any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, this application is not intended to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (6)

1. A page jump method, wherein a page number on a page is represented by a first tag, the method comprising:
judging whether a click operation of a user on the page number is received;
if so, responding to the click operation, and calling a first function associated with the first tag, wherein the first function is used for acquiring the page number and the identifier of the search tag; wherein, the first label is a div label or an a label without href attribute; a first function associated with the first tag transmits data in a POST mode;
acquiring key terms in the search tag through the identification, wherein the key terms are terms input when the user searches the page;
adding the key terms and the page numbers into an HTTP (hyper text transport protocol) packet body, and sending the HTTP packet body to a server;
the first function is CiPageChange (url, id, pa), the url is an address of the page, the id is an identifier of the search tag, and the pa is the page number.
2. The method of claim 1, further comprising:
generating a third tag, wherein the third tag is used for triggering the HTTP packet to the server.
3. The method of claim 2, wherein the search tag and the third tag are form tags.
4. A page jump apparatus, wherein a page number on a page is represented by a first tag, the apparatus comprising:
the judging unit is used for judging whether the clicking operation of the user on the page number is received or not;
the calling unit is used for calling a first function associated with the first tag in response to the click operation when the judging unit judges that the click operation of the user on the page number is received, wherein the first function is used for acquiring the page number and the identifier of the search tag; wherein, the first label is a div label or an a label without href attribute; a first function associated with the first tag transmits data in a POST mode;
an obtaining unit, configured to obtain, through the identifier, a key term in the search tag, where the key term is a term input when the user searches the page;
the adding unit is used for adding the key terms and the page numbers into the HTTP packet body and sending the key terms and the page numbers to the server;
the first function is CiPageChange (url, id, pa), the url is an address of the page, the id is an identifier of the search tag, and the pa is the page number.
5. The apparatus of claim 4, further comprising:
a generating unit, configured to generate a third tag, where the third tag is used to trigger the HTTP packet to the server.
6. The apparatus of claim 5, wherein the search tag and the third tag are form tags.
CN201710150474.8A 2017-03-14 2017-03-14 Page skipping method and device Expired - Fee Related CN106940719B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710150474.8A CN106940719B (en) 2017-03-14 2017-03-14 Page skipping method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710150474.8A CN106940719B (en) 2017-03-14 2017-03-14 Page skipping method and device

Publications (2)

Publication Number Publication Date
CN106940719A CN106940719A (en) 2017-07-11
CN106940719B true CN106940719B (en) 2020-09-08

Family

ID=59469895

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710150474.8A Expired - Fee Related CN106940719B (en) 2017-03-14 2017-03-14 Page skipping method and device

Country Status (1)

Country Link
CN (1) CN106940719B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109426535B (en) * 2017-08-24 2021-11-09 武汉斗鱼网络科技有限公司 Method, storage medium, equipment and system for jumping to specified position of page
CN111984346B (en) * 2020-08-12 2023-10-27 八维通科技有限公司 Method, system, device and storage medium for calling chain tracking in micro-service environment

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102902661A (en) * 2012-10-24 2013-01-30 广东欧珀移动通信有限公司 Method for realizing hyperlinks of electronic books

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070136255A1 (en) * 2005-11-25 2007-06-14 Ineomarketing, Inc. System and method for generating, maintaining, and rendering landing and web pages
CN101599089B (en) * 2009-07-17 2011-05-04 中国科学技术大学 Method and system for automatically searching and extracting update information on content of video service website
JP5518112B2 (en) * 2011-03-31 2014-06-11 株式会社デジタルマックス Digital book provision system
CN103780409B (en) * 2012-10-19 2017-04-05 任子行网络技术股份有限公司 A kind of network log-in management method and apparatus
CN104077041A (en) * 2013-03-29 2014-10-01 腾讯科技(深圳)有限公司 Page turning method, device and terminal
US20150169587A1 (en) * 2013-12-13 2015-06-18 Openpage Labs Inc. d/b/a CrowdTangle Identifying trending content on a social networking platform
CN103927383B (en) * 2014-04-29 2018-01-09 车智互联(北京)科技有限公司 A kind of webpage display device and method

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102902661A (en) * 2012-10-24 2013-01-30 广东欧珀移动通信有限公司 Method for realizing hyperlinks of electronic books

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
基于无线传感器网络的物流信息系统查询处理技术研究与应用;季海宁;《中国优秀硕士学位论文全文数据库信息科技辑》;20160515(第05期);第I140-131页 *
基于本体的Web页面结构化信息抽取;岳国伟;《中国优秀硕士学位论文全文数据库信息科技辑》;20080415(第04期);第I139-54页 *

Also Published As

Publication number Publication date
CN106940719A (en) 2017-07-11

Similar Documents

Publication Publication Date Title
CN102393857B (en) Method and system for local call based on web page
US8898738B2 (en) Apparatus, system and method for accessing internet webpage
US10298654B2 (en) Automatic uniform resource locator construction
US10693858B2 (en) CDN-based access control method and related device
CN106874471B (en) Information push method and device
CN106649446B (en) Information pushing method and device
WO2015074459A1 (en) Method and apparatus for opening webpage, invoking client, and creating light app
CN102541853A (en) A method and device for obtaining application information by using browser address bar
US10810256B1 (en) Per-user search strategies
CN104767747A (en) Click-jacking security detection method and device
CN102982117A (en) Information search method and device
CN103810268A (en) Search result recommendation information loading method, device and system and URL detection method, device and system
CN103793508B (en) A kind of loading recommendation information, the methods, devices and systems of network address detection
WO2015109928A1 (en) Method, device and system for loading recommendation information and detecting url
US20140074954A1 (en) Method, system and device for implementing reposting to microblog
US20180337930A1 (en) Method and apparatus for providing website authentication data for search engine
CN108063833A (en) HTTP dns resolutions message processing method and device
CN106940719B (en) Page skipping method and device
US20140074814A1 (en) Method and apparatus for switching search engine to repeat search
KR20130072907A (en) Method and system for shortening url
CN103716419B (en) The domain name processing method and system of a kind of cross-terminal
CN112528178A (en) Advertisement putting method, device and system and client
CN103023908B (en) A kind of website information acquisition, equipment and system
CN106919600A (en) One kind failure network address access method and terminal
CN103618777A (en) Method and device for calling client side

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
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20200908