CN110505253B - Method, device and storage medium for requesting webpage information - Google Patents

Method, device and storage medium for requesting webpage information Download PDF

Info

Publication number
CN110505253B
CN110505253B CN201810468003.6A CN201810468003A CN110505253B CN 110505253 B CN110505253 B CN 110505253B CN 201810468003 A CN201810468003 A CN 201810468003A CN 110505253 B CN110505253 B CN 110505253B
Authority
CN
China
Prior art keywords
url
request
target
specified length
parameters
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810468003.6A
Other languages
Chinese (zh)
Other versions
CN110505253A (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.)
Hangzhou Hikvision System Technology Co Ltd
Original Assignee
Hangzhou Hikvision System 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 Hangzhou Hikvision System Technology Co Ltd filed Critical Hangzhou Hikvision System Technology Co Ltd
Priority to CN201810468003.6A priority Critical patent/CN110505253B/en
Publication of CN110505253A publication Critical patent/CN110505253A/en
Application granted granted Critical
Publication of CN110505253B publication Critical patent/CN110505253B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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]

Abstract

The application discloses a method for requesting webpage information, and belongs to the technical field of the Internet. The method comprises the following steps: generating a target URL based on target request parameters, wherein the target request parameters are parameters related to webpage information needing to pass an HTTP request in an HTTPS webpage, and the target URL comprises the target request parameters; when the length of the target URL is larger than the specified length, determining at least two URLs conforming to the specified length based on the target URL; at least two HTTP requests are generated and sent based on at least two URLs that conform to a specified length to request web page information. Therefore, when the target URL exceeds the specified length, at least two URLs meeting the specified length can be determined according to the target URL, and the specified length refers to the maximum length allowed by the URL, so that at least two HTTP requests generated according to the at least two URLs meeting the specified length cannot be limited by the maximum length of the URL.

Description

Method, device and storage medium for requesting webpage information
Technical Field
The present application relates to the field of internet technologies, and in particular, to a method, an apparatus, and a storage medium for requesting web page information.
Background
HTTPS (Hyper Text Transfer Protocol over Secure Socket Layer) is a Secure data Transfer Protocol formed by adding SSL (Secure Socket Layer) Protocol based on HTTP (Hyper Text Transfer Protocol). Compared with HTTP, HTTPS can encrypt the transmission information through SSL protocol, thereby ensuring the security of the transmission information.
Based on this, currently, on the world wide web, when a terminal accesses a web page through an installed browser, if the web page contains sensitive information, the terminal and the server generally transmit all the information in the web page based on HTTPS, and such a web page may be referred to as an HTTPS web page. However, some of the information contained in the HTTPS web page may not be sensitive information, i.e., the information may be transmitted over HTTP. In this case, the terminal may send an HTTP request to the server through HTTP under an HTTPS page through the installed browser to request web page information.
Disclosure of Invention
The embodiment of the application provides a method and a device for requesting webpage information and a computer-readable storage medium, which can be used for sending an HTTP request under an HTTPS page to request the webpage information. The technical scheme is as follows:
in a first aspect, a method for requesting web page information is provided, the method including:
generating a target Uniform Resource Locator (URL) based on a target request parameter, wherein the target request parameter is a parameter related to webpage information required to be requested through a hypertext transfer protocol (HTTP) in a hypertext transfer protocol (HTTPS) webpage of a secure socket layer, and the target URL comprises the target request parameter;
when the length of the target URL is greater than a specified length, determining at least two URLs meeting the specified length based on the target URL, wherein the specified length is the maximum length allowed by the URL, the at least two URLs meeting the specified length both comprise request parameters, and the target request parameters consist of the request parameters contained in the at least two URLs meeting the specified length;
and generating at least two HTTP requests based on the at least two URLs conforming to the specified length, and sending the at least two HTTP requests to a server to request the webpage information.
Optionally, the determining, based on the target URL, at least two URLs that conform to a specified length includes:
taking the target URL as an ith URL, intercepting the ith URL based on the specified length to obtain an intercepted URL and ith residual parameters, wherein the intercepted URL comprises partial parameters in the target request parameters and an interception identifier i, the ith residual parameters refer to the residual parameters after intercepting the ith URL, the interception identifier i is used for indicating that the intercepted URL is obtained by intercepting the ith URL, and i is a positive integer greater than or equal to 1;
generating an i +1 th URL based on the ith part of remaining parameters, judging whether the length of the i +1 th URL is greater than the specified length, if so, making i +1, returning to the step of intercepting the ith URL based on the specified length, and adding an interception end identifier in the last generated URL until the length of the i +1 th URL is not greater than the specified length, and determining at least one intercepted URL and the last generated URL as the at least two URLs meeting the specified length, wherein the interception end identifier is used for indicating that the target request parameters are all contained in the at least two URLs meeting the specified length.
Optionally, before the intercepting the ith URL based on the specified length, the method further includes:
if the target request parameter is a request parameter needing to be compressed and the request parameter contained in the ith URL does not carry a compression identifier, compressing the request parameter contained in the ith URL, wherein the compression identifier is used for indicating that the request parameter is already compressed;
accordingly, the generating of the i +1 th URL based on the i part remaining parameters includes:
and adding the compression identifier in the second part of the residual parameters, and generating an i +1 th URL based on the ith part of the residual parameters added with the compression identifier.
Optionally, after generating the target uniform resource locator URL based on the target request parameter, the method further includes:
and if the target request parameter is a request parameter needing to be compressed, compressing the target request parameter contained in the target URL.
Optionally, after the sending the at least two HTTP requests to the server, the method further includes:
receiving an image sent by the server, wherein the image is determined and obtained based on the webpage information after the server obtains the webpage information based on the at least two URLs meeting the specified length;
loading the image and acquiring pixel data of each pixel point in the image;
determining the web page information based on the pixel data.
In a second aspect, a method for requesting web page information is provided, the method comprising:
receiving a hypertext transfer protocol (HTTP) request sent by a terminal, wherein the HTTP request is a request which is sent by the terminal in a hypertext transfer protocol over secure socket layer (HTTPS) webpage and is used for requesting webpage information through HTTP;
determining target request parameters based on request parameters contained in a Uniform Resource Locator (URL) in the HTTP request, wherein the target request parameters refer to parameters related to the webpage information;
acquiring the webpage information based on the target request parameter;
and generating an image based on the webpage information, and sending the image to the terminal so that the terminal determines the webpage information based on the image.
Optionally, the determining target request parameters based on the request parameters contained in the uniform resource locator URL in the HTTP request includes:
analyzing the URL in the HTTP request;
judging whether the analyzed URL comprises an interception mark or an interception ending mark, wherein the interception mark is used for indicating that the analyzed URL is the ith URL containing partial parameters of the target request parameters, the interception mark is sequentially increased according to the sequence of the URL determined by the terminal, the interception ending mark is used for indicating that the HTTP request is the last request containing the partial parameters of the target request parameters, and i is a positive integer greater than or equal to 1;
if the URL includes the interception identification but does not include the interception ending identification, storing the URL;
and if the URL comprises the interception ending identifier but does not comprise the interception identifier, combining the request parameters contained in the URL with the stored request parameters contained in the URL according to the sequence of the URL determined by the terminal to obtain the target request parameters.
Optionally, after determining the target request parameter based on the request parameter contained in the uniform resource locator URL in the HTTP request, the method further includes:
and if the request parameters contained in the URL in the HTTP request also comprise a compression identifier, decompressing the target request parameters.
Optionally, the generating an image based on the web page information includes:
determining pixel data of a plurality of pixel points based on the webpage information;
and generating the image based on the pixel data of the plurality of pixel points.
In a third aspect, an apparatus for requesting web page information is provided, the apparatus comprising:
the generation module is used for generating a target Uniform Resource Locator (URL) based on a target request parameter, wherein the target request parameter is a parameter related to webpage information which needs to be requested through a hypertext transfer protocol (HTTP) in a hypertext transfer protocol over secure socket layer (HTTPS) webpage, and the target URL comprises the target request parameter;
the determining module is used for determining at least two URLs meeting the specified length based on the target URL when the length of the target URL is greater than the specified length, wherein the specified length is the maximum length allowed by the URL, the at least two URLs meeting the specified length both comprise request parameters, and the target request parameters consist of the request parameters contained in the at least two URLs meeting the specified length;
and the sending module is used for generating at least two HTTP requests based on the at least two URLs meeting the specified length and sending the at least two HTTP requests to a server so as to request the webpage information.
Optionally, the determining module includes:
the intercepting submodule is used for enabling i to be 1, taking the target URL as an ith URL, intercepting the ith URL based on the specified length to obtain an intercepted URL and ith part of residual parameters, wherein the intercepted URL comprises part of parameters in the target request parameters and an intercepting identifier i, the ith part of residual parameters are the parameters left after intercepting the ith URL, the intercepting identifier i is used for indicating that the intercepted URL is obtained by intercepting for the ith time, and i is a positive integer greater than or equal to 1;
and the judging submodule is used for generating an i +1 th URL based on the ith part of remaining parameters, judging whether the length of the i +1 th URL is greater than the specified length, if so, enabling the i to be i +1, returning to the step of intercepting the ith URL based on the specified length, adding an interception ending identifier in the last generated URL until the length of the i +1 th URL is not greater than the specified length, determining the obtained at least one intercepted URL and the last generated URL as the at least two URLs meeting the specified length, wherein the interception ending identifier is used for indicating that the target request parameters are all contained in the at least two URLs meeting the specified length.
Optionally, the determining module further comprises:
a compressing submodule, configured to compress the request parameter included in the ith URL if the target request parameter is a request parameter that needs to be compressed and the request parameter included in the ith URL does not carry a compression identifier, where the compression identifier is used to indicate that the request parameter has been compressed;
correspondingly, the judgment sub-module is further configured to:
and adding the compression identifier in the ith part of residual parameters, and generating the (i + 1) th URL based on the ith part of residual parameters added with the compression identifier.
Optionally, the apparatus is further configured to:
and if the target request parameter is a request parameter needing to be compressed, compressing the target request parameter contained in the target URL.
Optionally, the apparatus further comprises:
the receiving module is used for receiving the image sent by the server, and the image is determined and obtained based on the webpage information after the server obtains the webpage information based on the at least two URLs meeting the specified length;
the acquisition module is used for loading the image and acquiring the pixel data of each pixel point in the image;
the determining module is further configured to determine the web page information based on the pixel data.
In a fourth aspect, an apparatus for requesting web page information is provided, the apparatus comprising:
the system comprises a receiving module, a sending module and a processing module, wherein the receiving module is used for receiving a hypertext transfer protocol (HTTP) request sent by a terminal, and the HTTP request is a request which is sent by the terminal in a hypertext transfer protocol over secure socket layer (HTTPS) webpage and is used for requesting webpage information through HTTP;
a determining module, configured to determine a target request parameter based on a request parameter included in a uniform resource locator URL in the HTTP request, where the target request parameter is a parameter related to the web page information;
the acquisition module is used for acquiring the webpage information based on the target request parameter;
the generating module is used for generating an image based on the webpage information;
and the sending module is used for sending the image to the terminal so that the terminal determines the webpage information based on the image.
Optionally, the determining module includes:
the analysis submodule is used for analyzing the URL in the HTTP request;
a determining submodule, configured to determine whether the parsed URL includes an interception identifier or an interception end identifier, where the interception identifier is used to indicate that the parsed URL is an ith URL including partial parameters of the target request parameter, the interception identifiers sequentially increase according to an order in which the terminal determines the URLs, the interception end identifier is used to indicate that the HTTP request is a last request including partial parameters of the target request parameter, and i is a positive integer greater than or equal to 1;
a storage submodule, configured to store the URL if the URL includes the interception identifier but does not include the interception end identifier;
and the combining submodule is used for combining the request parameters contained in the URL with the stored request parameters contained in the URL according to the sequence of the URL determined by the terminal to obtain the target request parameters if the URL includes the interception ending identifier but does not include the interception identifier.
Optionally, the apparatus further comprises:
and the decompression module is used for decompressing the target request parameter if the request parameter contained in the URL in the HTTP request also comprises a compression identifier.
Optionally, the generating module is specifically configured to:
determining pixel data of a plurality of pixel points based on the webpage information;
and generating the image based on the pixel data of the plurality of pixel points.
In a fifth aspect, an apparatus for requesting web page information is provided, the apparatus comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor executes executable instructions in the memory to perform any of the methods of the first or second aspects described above.
The sixth aspect provides a system for requesting web page information, which includes a terminal and a server;
the terminal is configured to perform any of the methods of the first aspect above;
the server is configured to perform any of the methods of the second aspect described above.
In a seventh aspect, a computer-readable storage medium is provided, in which a computer program is stored, which, when executed by a processor, implements the method of any of the first or second aspects.
The technical scheme provided by the embodiment of the application has the following beneficial effects: generating a target URL based on the target request parameters, determining at least two URLs conforming to the specified length based on the target URL when the length of the target URL is greater than the specified length, generating at least two HTTP requests based on the at least two URLs conforming to the specified length, and sending the at least two HTTP requests to the server to request webpage information. Therefore, in the embodiment of the application, when the URL generated according to the target request parameter exceeds the specified length, at least two URLs meeting the specified length can be determined according to the target URL, because the specified length refers to the maximum length allowed by the URL, at least two HTTP requests generated according to the at least two URLs meeting the specified length will not be limited by the maximum length of the URL, that is, the terminal can successfully transmit the at least two HTTP requests, and because the target request parameter is composed of the request parameters included in each of the at least two URLs meeting the specified length, the server can request the web page information according to the at least two HTTP requests, thereby solving the problem that the HTTP requests cannot be successfully transmitted and the web page information cannot be requested due to the overlong request parameters in the related art.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a flowchart of a method for requesting web page information according to an embodiment of the present disclosure;
FIG. 2 is a flowchart of a method for requesting web page information according to an embodiment of the present disclosure;
FIG. 3 is a flowchart of a method for requesting web page information according to an embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of an apparatus for requesting web page information according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of an apparatus for requesting web page information according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of an apparatus for requesting web page information according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of a determination module provided in an embodiment of the present application;
fig. 8 is a schematic structural diagram of a terminal for requesting web page information according to an embodiment of the present application;
fig. 9 is a schematic structural diagram of a server for requesting web page information according to an embodiment of the present application.
Detailed Description
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
Before explaining the embodiments of the present application in detail, an application scenario related to the embodiments of the present application will be described.
HTTP (HyperText Transfer Protocol) is the most widely used network Protocol on the internet. When the terminal accesses a web page through the installed browser, an HTTP request may be sent to the server through an HTTP protocol to request web page information. After receiving the HTTP request, the server may process the HTTP request and return a processing result to the terminal according to the HTTP protocol. The data transmission is carried out in a plaintext mode no matter whether the terminal sends the HTTP request in the HTTP or the server returns the processing result through the HTTP, namely, the HTTP does not provide any mode of data encryption. However, with the development of internet technology, there is currently a portion of the web page on the world wide web that contains sensitive information, such as transaction payment pages, personal identification information pages, and the like. For such web pages, in order to prevent information leakage during transmission, the information can be transmitted through HTTPS in general. When the terminal and the server transmit all information in the web page based on HTTPS, the web page may be referred to as an HTTPS web page. In an HTTPS web page, generally, not all web page information is sensitive information, that is, part of information in the HTTPS web page can be transmitted through HTTP. The method for requesting the webpage information provided by the embodiment of the application can be applied to a scene that the terminal and the server transmit the webpage information through the HTTP under the HTTPS webpage.
Currently, under an HTTPS webpage, a terminal may generate a URL (Uniform Resource Locator) according to a request parameter, and generate an img tag according to the URL. Wherein the request parameter is a relevant parameter for requesting web page information. Thereafter, the terminal may generate an HTTP request according to the img tag and transmit the HTTP request to the server. The server processes the HTTP request after receiving the HTTP request. When the webpage information requested by the HTTP request is an image, if the processing is successful, the server can return the corresponding image through the HTTP, and if the processing is failed, the server can return an image used for indicating the processing failure of the request through the HTTP. When the web page information requested by the HTTP request is not an image, if the processing is successful, the server may return an image indicating that the processing of the request is successful through HTTP, and if the processing is failed, an image indicating that the processing of the request is failed may be returned through HTTP.
However, the URL has a predetermined maximum length, and when the terminal generates the URL based on the request parameter, if the request parameter is too long, the length of the generated URL exceeds the maximum length, and the HTTP request transmission fails. In this case, the server cannot receive the HTTP request, and naturally cannot process the HTTP request, that is, the terminal cannot request the web page information. The method for requesting the webpage information provided by the embodiment of the application can be used for solving the problem that the webpage information cannot be requested due to the fact that the length of the URL exceeds the maximum length in the related art. Next, a method for requesting web page information provided by an embodiment of the present application will be explained with reference to the accompanying drawings.
Fig. 1 is a flowchart of a method for requesting web page information according to an embodiment of the present application, where the method may be applied to a terminal, and as shown in fig. 1, the method includes the following steps:
step 101: and generating a target Uniform Resource Locator (URL) based on the target request parameter, wherein the target URL comprises the target request parameter.
The target request parameter is a parameter related to webpage information which needs to be requested through a hypertext transfer protocol (HTTP) in a hypertext transfer protocol (HTTPS) webpage of a secure socket layer.
Step 102: when the length of the target URL is larger than the specified length, at least two URLs conforming to the specified length are determined based on the target URL.
Wherein the specified length is the maximum length allowed by the URL. At least two URLs meeting the specified length all comprise request parameters, and the target request parameters consist of the request parameters contained in the at least two URLs meeting the specified length.
Step 103: at least two HTTP requests are generated based on at least two URLs meeting the specified length, and the at least two HTTP requests are sent to the server to request webpage information.
In the embodiment of the application, the terminal can generate a target URL based on target request parameters, determine at least two URLs meeting the specified length based on the target URL when the length of the target URL is greater than the specified length, generate at least two HTTP requests based on the at least two URLs meeting the specified length, and send the at least two HTTP requests to the server to request webpage information. Therefore, in the embodiment of the application, if the target URL generated according to the target request parameter exceeds the specified length, at least two URLs meeting the specified length can be determined according to the target URL, because the specified length refers to the maximum length allowed by the URL, at least two HTTP requests generated according to the at least two URLs meeting the specified length will not be limited by the maximum length of the URL, that is, the terminal can successfully transmit the at least two HTTP requests, and because the target request parameter is composed of the request parameters included in each of the at least two URLs meeting the specified length, the server can request the web page information according to the at least one HTTP request, thereby solving the problem that the HTTP requests cannot be successfully transmitted and the web page information cannot be requested due to the overlong request parameters in the related art.
Fig. 2 is a flowchart of a method for requesting web page information according to an embodiment of the present application, where the method may be used in a server, as shown in fig. 2, and the method includes the following steps:
step 201: and receiving a hypertext transfer protocol (HTTP) request sent by the terminal.
The HTTP request is a request which is sent by the terminal in a hypertext transfer protocol over secure socket layer (HTTPS) webpage and is used for requesting webpage information through HTTP.
Step 202: the target request parameters are determined based on the request parameters contained in the uniform resource locator, URL, in the HTTP request.
The target request parameter refers to a parameter related to webpage information requested by the terminal.
Step 203: and acquiring webpage information based on the target request parameters.
Step 204: an image is generated based on the web page information and the image is transmitted to the terminal so that the terminal determines the web page information based on the image.
In the embodiment of the application, the server may receive an HTTP request sent by the terminal in an HTTP webpage, and determine target request parameters for the terminal to request webpage information based on the request parameters contained in the URL in the HTTP request, and then, the server may obtain webpage information based on the target request parameters, generate an image based on the webpage information, and send the image to the terminal, so that the terminal may determine the webpage information according to the image. Therefore, in the embodiment of the application, even if the webpage information requested by the terminal is not an image but other data, the server can generate the image according to the acquired webpage information, so that the terminal can determine to acquire the webpage information according to the image.
Fig. 3 is a flowchart of a method for requesting web page information according to an embodiment of the present application, and as shown in fig. 3, the method includes the following steps:
step 301: and the terminal generates a target Uniform Resource Locator (URL) based on the target request parameter.
In the embodiment of the application, when the terminal accesses the HTTPS webpage, the webpage information in the HTTPS webpage needs to be acquired, and the acquired webpage information is displayed. The terminal can first obtain a target request parameter related to the webpage information to be requested, and generate a target URL according to the target request parameter.
The target URL may have a basic format as follows: transport protocol:// server address or domain name server port/path/destination request parameter to access a resource. That is, the target URL contains target request parameters.
Step 302: when the length of the target URL is larger than the specified length, the terminal determines at least two URLs conforming to the specified length based on the target URL.
After generating the target URL, the terminal may determine whether the length of the target URL is greater than a specified length, and when the length of the target URL is greater than the specified length, the terminal may determine at least two URLs that conform to the specified length based on the target URL.
Wherein, the specified length refers to the maximum length allowed by the URL. Specifically, in a URL, the sum of the transmission protocol, the server address or domain name, the server port, and the path of the access resource does not exceed a specified length. However, if the target request parameter is too long, the length of the URL may be larger than the specified length. If the length of the URL is greater than the specified length, the HTTP request generated according to the URL cannot be successfully sent to the server, and based on this, in this embodiment of the application, after the terminal generates the target URL, the terminal may compare the length of the target URL with a maximum length allowed by the URL, and if the length of the target URL exceeds the maximum length allowed to be reached, the terminal may determine at least two URLs meeting the specified length based on the target URL, so as to request the web page information according to the determined at least two URLs meeting the specified length. Thus, since the at least two URLs determined from the target URL are of a specified length, i.e., the length of the at least two URLs is not greater than the specified length, the at least two HTTP requests generated from the at least two URLs will not fail to be sent because the URL length exceeds the limit. Of course, if the length of the target URL is not greater than the specified length, it indicates that the target URL itself conforms to the specified length, and at this time, an HTTP request may be directly generated according to the target URL, and the HTTP request may be sent to the server to request the web page information.
Specifically, in a possible implementation manner, when the length of the target URL is greater than the specified length, the terminal may set i as 1, use the target URL as an ith URL, intercept the ith URL based on the specified length to obtain an intercepted URL and an ith residual parameter, where the intercepted URL includes a partial parameter in the target request parameter and an interception identifier i, the ith residual parameter is a parameter remaining after the interception of the ith URL, the interception identifier i is used to indicate that the intercepted URL is obtained by the ith interception, the interception identifier i is sequentially increased according to an order of the intercepted URLs obtained by the interception, and i is a positive integer greater than or equal to 1; generating an i +1 th URL based on the i part of remaining parameters, judging whether the length of the i +1 th URL is greater than a specified length, if so, making i equal to i +1, returning to the step of intercepting the i th URL based on the specified length, adding an interception end identifier in the last generated URL until the length of the i +1 th URL is not greater than the specified length, determining the obtained at least one intercepted URL and the last generated URL as at least two URLs conforming to the specified length, wherein the interception end identifier is used for indicating that target request parameters are all contained in the at least one URL conforming to the specified length.
It should be noted that, in this embodiment of the application, when the terminal determines that the length of the target URL is greater than the specified length, the terminal may set i to 1, regard the target URL as a 1 st URL, and then cut the 1 st URL into two parts from the position where the request parameter is included based on the specified length, so as to obtain the cut URL and the remaining parameters of the 1 st part. Since the URL is intercepted according to the specified length, the length of the intercepted URL will be equal to or less than the specified length, that is, the intercepted URL obtained by the 1 st interception will be the 1 st URL conforming to the specified length. At this time, the interception flag 1 may be added to the URL obtained by the 1 st interception, and the interception flag 1 may not only indicate that the URL is the URL obtained by interception by the user, but also indicate that the URL is the 1 st intercepted URL obtained by the first interception.
After the first URL meeting the designated length is obtained, for another part obtained in the intercepting process, that is, the 1 st part residual parameter, the terminal may generate a 2 nd URL according to the 1 st part residual parameter, and determine whether the length of the 2 nd URL is greater than the designated length, if the length of the 2 nd URL is still greater than the designated length, the terminal may continue to intercept the 2 nd URL into two parts according to the designated length, so as to obtain the 2 nd URL meeting the designated length and the 2 nd part residual parameter. For the remaining parameters in part 2, the terminal may continue to generate the 3 rd URL, and determine whether the length of the 3 rd URL is greater than the specified length, and so on, until the length of the generated ith URL is not greater than the specified length, the terminal may stop the interception operation, determine the last generated URL as the last URL conforming to the specified length, and add an interception end identifier in the last URL conforming to the specified length, the interception end identifier being used to indicate that the interception has ended, and the target request parameters are all contained in the URLs conforming to the specified length. And the interception marks carried by the URLs conforming to the specified length are increased along with the increase of the interception times.
It should be noted that, in this embodiment of the application, each time a URL meeting the specified length is obtained by interception, an interception identifier may be added to the URL meeting the specified length, so that, in order to prevent the length of the URL after the interception identifier is added from exceeding the specified length, when the terminal intercepts each URL according to the specified length, the length that the interception identifier needs to occupy may be reserved. That is, the terminal may intercept the URL according to a length smaller than the specified length, so that after the interception identifier is added, the length of the URL to which the interception identifier is added still conforms to the specified length and does not exceed the specified length.
Next, the implementation of determining at least two URLs that conform to a specified length will be described by way of a specific example.
Assume that the target URL is: http:// www.AAA.com/BBB/123456789, and the length of the target URL is greater than the specified length, wherein the target request parameter is 123456789, the terminal may regard the target URL as the 1 st URL, and cut the target URL into two parts according to the specified length from the position where the target request parameter is located, assuming that according to the specified length, considering the number of bits reserved for the interception flag until 3 in the target request parameter, and adding the specified length that the interception flag will reach, then the terminal may cut the target URL into two parts from a position between 3 and 4, and after cutting, one part is the intercepted URL: http:// www.AAA.com/BBB/123, and the other part is part 1 remaining parameters 456789. At this time, the intercepted URL: http:// www.AAA.com/BBB/123 is the first obtained URL with the specified length, and since the length occupied by the interception identifier is taken into consideration in the process of interception, the length of the URL without the interception identifier is smaller than the specified length. Then, a truncated id 1 may be added to the URL, where the truncated id 1 is used to indicate that the URL is the first URL that meets the specified length, and at this time, the length of the URL after the truncated id is added will still meet the specified length, that is, the length does not exceed the specified length.
For the first part remaining parameters 456789, the terminal may generate the 2 nd URL according to the first part remaining parameters: http:// www.AAA.com/BBB/456789. Next, the terminal may continue to determine whether the length of the 2 nd URL is greater than the specified length, and if the length of the 2 nd URL is still greater than the specified length, the terminal may segment the 2 nd URL into two parts according to the specified length and the length occupied by the capturing identifier, so as to obtain the 2 nd URL meeting the specified length: http:// www.AAA.com/BBB/456, and part 2 remaining parameters 789. At this time, the 2 nd URL with the specified length carries the capture id 2.
For the remaining parameters 789, the terminal may continue to generate the 3 rd URL from the remaining parameters: http:// www.AAA.com/BBB/789, and continuously determining whether the length of the 3 rd URL is greater than the specified length, if the 3 rd URL is not greater than the specified length, the terminal may determine whether the total length of the 3 rd URL plus the length occupied by the interception end identifier is greater than the specified length, if not, the 3 rd URL is the last URL meeting the specified length, and at this time, the interception end identifier may be added to the 3 rd URL. So far, according to the determined 3 URLs meeting the specified length in the target URL, the target URLs are http:// www.AAA.com/BBB/123, http:// www.AAA.com/BBB/456 and http:// www.AAA.com/BBB/789, and the target request parameters consist of the request parameters contained in the 3 URLs meeting the specified length.
Alternatively, in another possible implementation, when the length of the target URL is greater than the specified length, the terminal may determine a difference between the length of the portion of the target URL other than the target request parameter and the specified length. And then, the terminal can divide the target request parameter into a plurality of sections according to the difference value and the length occupied by the intercepting mark. After dividing the target request parameter into multiple segments, the terminal may generate a URL meeting the specified length according to each segment of the request parameter, and add an interception flag to the URL meeting the specified length according to the position of each segment of the request parameter in the target request parameter.
Optionally, in this embodiment of the present application, when the target request parameter is too long, the interception by the foregoing method may need to be performed multiple times, so to reduce the number of times of interception as much as possible, after determining that the length of the target URL is greater than the specified length and before intercepting the target URL, the terminal may further determine whether the target request parameter included in the target URL is a request parameter that needs to be compressed, and if the target request parameter is a request parameter that needs to be compressed, the terminal may compress the target request parameter in the target URL. After compression, in order to avoid that the terminal repeatedly compresses the remaining parameters of the compressed target request parameters in the subsequent interception process, the terminal may add a compression identifier to the target request parameters included in the target URL to indicate that the target request parameters are already compressed, so that in the subsequent interception process, when an ith URL is generated according to the remaining parameters and the length of the ith URL is greater than a specified length, if the terminal detects the compression identifier in the ith URL, the request parameters included in the ith URL may not be compressed, but the ith URL is directly intercepted.
It should be noted that a database of request parameters to be compressed may be stored in the terminal, and the database is set by a technician as needed. The terminal can search whether the target request parameter exists in the database, and if the target request parameter exists, the terminal can determine that the target request parameter is the request parameter needing to be compressed. If not, the target request parameter may be determined to be a request parameter that does not require compression.
In addition, in this embodiment of the application, after the terminal generates the target URL and determines that the length of the target URL is greater than the specified length, the terminal may also directly segment the target URL into two parts without compressing the target request parameter included in the target URL, and then the terminal may determine whether the request parameter included in the ith URL carries a compression identifier when determining that the length of the ith URL is greater than the specified length, and if not, compress the request parameter included in the ith URL, so that after the ith URL is intercepted to obtain the remaining parameters, the compression identifier may be added to the (i + 1) th URL generated according to the remaining parameters, so as to avoid subsequent repeated compression of the remaining parameters in the target request parameter.
Optionally, in this embodiment of the application, the terminal may also determine whether the target request parameter in the target URL is a request parameter that needs to be compressed after the target URL is generated, and if so, the terminal may compress the target request parameter in the target URL. Then, the terminal may determine whether the length of the target URL after the target request parameter is compressed is greater than a specified length. Therefore, for the target URL with the length just exceeding the specified length, after the target request parameter is compressed, the length of the target URL may be smaller than the specified length, so that the terminal does not need to intercept the target URL any more, and the operation is simplified.
It should be noted that, in the process of intercepting a URL, adding an interception identifier to the intercepted URL is only an optional implementation manner in the embodiment of the present application. If the communication network between the terminal and the server is stable, it can be ensured that the order in which the server receives the HTTP request is consistent with the order in which the terminal sends the HTTP request, in this embodiment of the present application, the interception flag may not be added.
Step 303: the terminal generates at least two HTTP requests based on the at least two URLs conforming to the specified length and sends the at least two HTTP requests to the server.
In this embodiment, after determining that the at least two URLs have the specified length according to the target URL, the terminal may generate at least two HTTP requests based on the determined order of the at least two URLs having the specified length, and send the at least two HTTP requests to the server according to the generated order of the at least two HTTP requests.
Optionally, in a possible implementation manner, in the process of determining at least two URLs meeting the specified length, each URL meeting the specified length is generated, that is, an HTTP request is generated according to the URL meeting the specified length, and the HTTP request is sent to the server until the last URL meeting the specified length is sent.
Since the terminal is an HTTP request transmitted under an HTTPS web page, the terminal can generate an HTTP request by carrying the URL in an img tag for any URL having a predetermined length and using the img tag as the request line content of the HTTP request.
Step 304: the server receives the HTTP request sent by the terminal.
As can be seen from the foregoing description of step 303, in the embodiment of the present application, regardless of whether the terminal determines at least two URLs meeting the specified length according to the target URL and then generates an HTTP request to transmit, or generates an HTTP request to transmit each URL meeting the specified length accordingly, the HTTP requests transmitted by the terminal are transmitted sequentially. In this case, the server may sequentially receive HTTP requests transmitted by the terminal, and each time the HTTP request transmitted by the terminal is received, process the HTTP request according to the method described in step 305 below to obtain the target request parameters.
Step 305: the server determines the target request parameters based on the request parameters contained in the URL in the HTTP request.
When the server receives an HTTP request, the server can analyze the URL in the HTTP request and judge whether the analyzed URL comprises an interception mark or an interception ending mark, wherein the interception mark is used for indicating that the analyzed URL is the ith URL containing partial parameters of target request parameters, the interception marks are sequentially increased according to the sequence of the URLs determined by the terminal, the interception ending mark is used for indicating that the HTTP request is the last request containing the partial parameters of the target request parameters, and i is a positive integer greater than or equal to 1; if the URL includes the interception mark but does not include the interception end mark, storing the URL; and if the URL includes the interception ending identifier but does not include the interception identifier, combining the request parameters included by the URL with the request parameters included by the stored URL according to the sequence of the URL determined by the terminal to obtain the target request parameters.
Specifically, as can be seen from the introduction in step 302, when the terminal determines at least two URLs meeting the specified length according to the target URL, each URL meeting the specified length is obtained by adding an interception flag indicating that the URL is the URL meeting the specified length obtained by the interception for the second time to the URL meeting the specified length, and the last URL meeting the specified length is also added with an interception end flag.
If the parsed URL includes the interception identifier but does not include the interception end identifier, it indicates that the URL included in the HTTP request is not the last URL conforming to the specified length, that is, the request parameters included in the URL conforming to the specified length currently received by the server may not be able to form the target request parameters, at this time, the server may store the URL in the HTTP request, so that when the last URL conforming to the specified length is subsequently received, the target request parameters are determined according to the request parameters included in each URL conforming to the specified length.
If the parsed URL includes the interception end identifier but does not include the interception identifier, it indicates that the URL included in the HTTP request is the last URL that conforms to the specified length, that is, the terminal sends at least two URLs that conform to the specified length, which are obtained by resolving according to the target URL, to the server through the HTTP request, and at this time, the server may combine the request parameters included in the URL in the HTTP request and the request parameters included in the previously stored URLs according to the order in which the terminal determines the URLs, so as to obtain the target request parameters. The size of the interception mark in each previously stored URL can be used to indicate the terminal to determine the sequence of the URLs, and the URL included in the HTTP request is the last URL determined by the terminal and conforming to the specified length.
Next, the implementation of the above-mentioned target request parameter determination will be described by a specific example.
Assuming that the URL of the HTTP request received by the server includes the request parameter 456 and includes the interception identifier 2 but does not include the interception end identifier, at this time, it may be determined that the URL is the 2 nd URL conforming to the specified length determined by the terminal. Since the URL does not include the interception end identifier, it indicates that there may be other URLs containing the remaining parameters of the target request parameters that have not yet been received by the server, and at this time, the server may store the URL and wait for the arrival of the subsequent URLs containing the remaining parameters of the target request parameters.
Assuming that the server receives an HTTP request after that, the URL in the HTTP request contains the request parameter 789, and the URL includes the interception end identifier but does not include the interception identifier, at this time, the server may determine that the URL is the last URL with the specified length. In this case, the server may retrieve the previously stored URLs and combine them by the size of the truncated identifications of the previously stored URLs. That is, the server may obtain the URL including the interception flag 1 and the URL including the interception flag 2, and assuming that the URL including the interception flag 1 includes the request parameter 123, according to the size of the interception flag, the URL including the interception flag 1 is the first determined URL having the specified length, the URL including the interception flag 2 is the 2 nd determined URL having the specified length, and the URL including the interception end flag is the last determined URL having the specified length, the request parameters included in the URLs are combined in the order determined by the URLs, so as to obtain the target request parameter 123456789.
Optionally, in a possible implementation manner, when the server determines that the parsed URL includes the interception identifier but does not include the interception end identifier, the server may further obtain, according to the interception identifier carried in the URL, URLs with a specified length and determined by the terminal before the URL, and combine the request parameters included in the URLs according to a sequence determined by the terminal to obtain the combined request parameters. If the next URL still comprises the interception identification but does not comprise the interception end identification, adding the request parameters contained in the URL after the previously combined request parameters, and adding the request parameters contained in the URL comprising the interception end identification as the last part of request parameters after the previously combined request parameters when the URL comprising the interception end identification is received, thereby obtaining the target request parameters.
Optionally, in this embodiment of the application, after parsing the URL in the received HTTP request, the server may further determine whether a request parameter included in the parsed URL includes a compression identifier, and if the request parameter includes the compression identifier, after determining the target request parameter by combining, the server may decompress the target request parameter.
In addition, based on the foregoing description, if in the embodiment of the present application, the communication network between the server and the terminal is stable, and it can be ensured that the order in which the server receives the HTTP requests and the order in which the terminal transmits the HTTP requests coincide, the terminal may not add the interception flag, and in this case, the server may combine the request parameters included in the URL in the HTTP requests according to the order in which the HTTP requests are received.
Step 306: the server obtains the web page information based on the target request parameter.
Step 307: the server generates an image based on the web page information and transmits the image to the terminal.
After the server acquires the web page information, the server may generate an image based on the web page information and transmit the image to the terminal.
In the related art, after the server processes the HTTP request to obtain the web page information, if the web page information itself is the image data, the server may directly generate an image from the image data and send the image to the terminal. At this time, the image is actually the webpage information requested by the terminal, and the terminal only needs to load the received image. However, if the web page information itself is not image data, that is, the web page requested by the terminal is not an image, in this case, because the HTTP request sent by the terminal on the HTTPS web page carries the URL by the img tag, and the server can only return the image when processing the HTTP request carrying the img tag, the server cannot return the web page information that is not image data to the terminal, but only returns the web page information to the terminal for indicating that the request processing is successful, and the image does not include any web page information. That is, in the related art, if the terminal requests the web page through the HTTP without an image in the HTTPS web page, the server cannot return a processing result for the web page display by the terminal, and only returns an invalid image indicating whether the request is successfully responded.
Based on this, in the embodiment of the present application, if the webpage information acquired by the server is non-image data for webpage display, the server may convert the webpage information into pixel data according to the ASCII code of the webpage information through a mapping relationship between the ASCII code and the pixel data, and then generate an image according to the pixel data, and send the image to the terminal. Therefore, the webpage information is carried in the image, and the webpage information carried in the image can be acquired by analyzing the image after the subsequent terminal receives the image, so that the problem that the server returns the content of non-image data in the related technology is solved.
The pixel data may include RGB values and transparency values, among others.
Step 308: and the terminal receives the image sent by the server.
Step 309: and the terminal loads the image and acquires the pixel data of each pixel point in the image.
After receiving the image sent by the server, the terminal may load the image. If the web page information itself requested by the terminal is image data, the terminal may display the image in the web page. If the webpage information requested by the terminal is not image data, the terminal can insert the image into a Canvas after the image is loaded, and then the terminal can obtain the pixel data of each pixel point in the image through the Canvas.
Step 310: the terminal determines web page information based on the pixel data.
After the pixel data of each pixel point is obtained, the terminal may map the pixel data in the image to the ASCII code through a mapping relationship between the ASCII code and the pixel data based on the pixel data to obtain a character string, where the character string is the webpage information requested by the terminal.
In the embodiment of the application, the terminal can generate a target URL based on target request parameters, determine at least two URLs meeting the specified length based on the target URL when the length of the target URL is greater than the specified length, generate at least two HTTP requests based on the at least two URLs meeting the specified length, and send the at least two HTTP requests to the server to request webpage information. Therefore, in the embodiment of the application, if the target URL generated according to the target request parameter exceeds the specified length, at least two URLs meeting the specified length can be determined according to the target URL, because the specified length refers to the maximum length allowed by the URL, at least two HTTP requests generated according to the at least two URLs meeting the specified length will not be limited by the maximum length of the URL, that is, the terminal can successfully transmit the at least two HTTP requests, and because the target request parameter is composed of the request parameters included in each of the at least two URLs meeting the specified length, the server can request the web page information according to the at least one HTTP request, thereby solving the problem that the HTTP requests cannot be successfully transmitted and the web page information cannot be requested due to the overlong request parameters in the related art.
After receiving the HTTP request, the server may combine the request parameters included in at least two URLs meeting the specified length to obtain target request parameters, and then obtain the web page information according to the target request parameters. Thereafter, the server may generate an image based on the web page information and transmit the image to the terminal. Therefore, even if the webpage information is not image data, the server can convert the webpage information into pixel data and then carry the pixel data in the image to send the image to the terminal, and therefore after the terminal receives the image, the terminal can obtain the requested webpage information by analyzing the pixel data of each pixel point in the image, and the problem that the server cannot return the requested webpage information correctly if the terminal requests the image through HTTP under an HTTPS webpage in the related art is solved.
Next, a device for requesting web page information provided in an embodiment of the present application will be described.
Fig. 4 is a block diagram of an apparatus 400 for requesting web page information according to an embodiment of the present application, where the apparatus 400 may be integrated in a terminal, and referring to fig. 4, the apparatus 400 includes:
a generating module 401, configured to generate a target uniform resource locator URL based on a target request parameter, where the target request parameter is a parameter related to web information that needs to be requested by a hypertext transfer protocol HTTP in a secure socket layer hypertext transfer protocol HTTPS web page, and the target URL includes a target request parameter;
a determining module 402, configured to determine, based on a target URL, at least two URLs meeting the specified length when the length of the target URL is greater than the specified length, where the specified length is a maximum length allowed by the URL, and the at least two URLs meeting the specified length both include request parameters, and the target request parameters are composed of request parameters included in the at least two URLs meeting the specified length;
a sending module 403, configured to generate at least two HTTP requests based on the at least two URLs meeting the specified length, and send the at least two HTTP requests to the server to request the web page information.
Optionally, the determining module 402 is specifically configured to:
the intercepting submodule is used for enabling i to be 1, taking the target URL as the ith URL, intercepting the ith URL based on the specified length to obtain the intercepted URL and the ith residual parameter, wherein the intercepted URL comprises a partial parameter in the target request parameter and an intercepting identifier i, the ith residual parameter refers to the residual parameter after intercepting the ith URL, the intercepting identifier i is used for indicating that the intercepted URL is obtained by intercepting the ith time, and i is a positive integer greater than or equal to 1;
and the judging submodule is used for generating an i +1 th URL based on the ith part of residual parameters, judging whether the length of the i +1 th URL is greater than a specified length, if so, making i equal to i +1, returning to the step of intercepting the ith URL based on the specified length, adding an interception ending mark in the last generated URL until the length of the i +1 th URL is not greater than the specified length, determining the obtained at least one intercepted URL and the last generated URL as at least two URLs meeting the specified length, wherein the interception ending mark is used for indicating that the target request parameters are all contained in the at least two URLs meeting the specified length.
Optionally, the determining module 402 is further configured to:
the compression submodule is used for compressing the request parameter contained in the ith URL if the target request parameter is the request parameter needing to be compressed and the request parameter contained in the ith URL does not carry a compression identifier, and the compression identifier is used for indicating that the request parameter is already compressed;
correspondingly, the judgment sub-module is further configured to:
and adding a compression identifier in the ith part of the rest parameters, and generating an (i + 1) th URL based on the ith part of the rest parameters added with the compression identifier.
Optionally, referring to fig. 5, the apparatus 400 further comprises:
a receiving module 404, configured to receive an image sent by a server, where the image is determined by the server based on at least two URLs with specified lengths and then obtained based on the web page information;
an obtaining module 405, configured to load an image and obtain pixel data of each pixel point in the image;
the determining module 402 is further configured to determine web page information based on the pixel data.
In the embodiment of the application, a target URL is generated based on target request parameters, when the length of the target URL is greater than a specified length, at least two URLs meeting the specified length are determined based on the target URL, at least two HTTP requests are generated based on the at least two URLs meeting the specified length, and the at least two HTTP requests are sent to a server to request webpage information. Therefore, in the embodiment of the application, if the target URL generated according to the target request parameter exceeds the specified length, at least two URLs meeting the specified length can be determined according to the target URL, because the specified length refers to the maximum length allowed by the URL, at least two HTTP requests generated according to the at least two URLs meeting the specified length will not be limited by the maximum length of the URL, that is, the terminal can successfully transmit the at least two HTTP requests, and because the target request parameter is composed of the request parameters included in each of the at least two URLs meeting the specified length, the server can request the web page information according to the at least one HTTP request, thereby solving the problem that the HTTP requests cannot be successfully transmitted and the web page information cannot be requested due to the overlong request parameters in the related art.
Fig. 6 is an apparatus 600 for requesting web page information according to an embodiment of the present application, where the apparatus 600 is integrated in a server, and referring to fig. 6, the apparatus 600 includes:
the receiving module 601 is configured to receive a hypertext transfer protocol HTTP request sent by a terminal, where the HTTP request is a request sent by the terminal in a secure socket layer hypertext transfer protocol HTTPs webpage and used for requesting webpage information through HTTP;
a determining module 602, configured to determine a target request parameter based on a request parameter included in a uniform resource locator URL in an HTTP request, where the target request parameter is a parameter related to web page information;
an obtaining module 603, configured to obtain web page information based on the target request parameter;
a generating module 604 for generating an image based on the web page information;
a sending module 605, configured to send the image to the terminal, so that the terminal determines the web page information based on the image.
Optionally, referring to fig. 7, the determining module 602 includes:
the analysis submodule 6021 is used for analyzing the URL in the HTTP request;
the determining submodule 6022 is configured to determine whether the parsed URL includes an interception identifier or an interception end identifier, where the interception identifier is used to indicate that the parsed URL is an ith URL including partial parameters of the target request parameter, the interception identifiers are sequentially increased according to an order in which the terminal determines the URLs, the interception end identifier is used to indicate that the HTTP request is a last request including partial parameters of the target request parameter, and i is a positive integer greater than or equal to 1;
the storage submodule 6023 is configured to store the URL if the URL includes the interception flag but does not include the interception end flag;
the combining submodule 6024 is configured to, if the URL includes the interception end identifier but does not include the interception identifier, combine the request parameter included in the URL with the request parameter included in the stored URL according to the sequence of the URL determined by the terminal, so as to obtain the target request parameter.
Optionally, the apparatus 600 further comprises:
and the decompression module is used for decompressing the target request parameter if the request parameter contained in the URL in the HTTP request also comprises a compression identifier.
Optionally, the generating module 604 is specifically configured to:
determining pixel data of a plurality of pixel points based on the webpage information;
and generating an image based on the pixel data of the plurality of pixel points.
In the embodiment of the application, an HTTP request sent by a terminal in an HTTP webpage is received, target request parameters used by the terminal for requesting webpage information are determined based on request parameters contained in a URL in the HTTP request, and then, a server may obtain webpage information based on the target request parameters, generate an image based on the webpage information, and send the image to the terminal, so that the terminal may determine the webpage information according to the image. Therefore, in the embodiment of the application, even if the webpage information requested by the terminal is not an image but other data, the server can generate the image according to the acquired webpage information, so that the terminal can determine to acquire the webpage information according to the image.
It should be noted that: in the device for requesting web page information provided in the above embodiment, when the device requests web page information, only the division of the above functional modules is taken as an example, and in practical applications, the above function distribution may be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules, so as to complete all or part of the above described functions. In addition, the apparatus for requesting web page information and the method embodiment for requesting web page information provided by the above embodiments belong to the same concept, and specific implementation processes thereof are detailed in the method embodiment and are not described herein again.
Fig. 8 is a block diagram illustrating a terminal 800 for requesting web page information according to an exemplary embodiment of the present application. The terminal 800 may be: a smart phone, a tablet computer, an MP3 player (Moving Picture Experts Group Audio Layer III, motion video Experts compression standard Audio Layer 3), an MP4 player (Moving Picture Experts Group Audio Layer IV, motion video Experts compression standard Audio Layer 4), a notebook computer, or a desktop computer. The terminal 800 may also be referred to by other names such as user equipment, portable terminal, laptop terminal, desktop terminal, etc.
In general, the terminal 800 includes: a processor 801 and a memory 802.
The processor 801 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and so forth. The processor 801 may be implemented in at least one hardware form of a DSP (Digital Signal Processing), an FPGA (Field-Programmable Gate Array), and a PLA (Programmable Logic Array). The processor 801 may also include a main processor and a coprocessor, where the main processor is a processor for Processing data in an awake state, and is also called a Central Processing Unit (CPU); a coprocessor is a low power processor for processing data in a standby state. In some embodiments, the processor 801 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content required to be displayed on the display screen. In some embodiments, the processor 801 may further include an AI (Artificial Intelligence) processor for processing computing operations related to machine learning.
Memory 802 may include one or more computer-readable storage media, which may be non-transitory. Memory 802 may also include high speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In some embodiments, a non-transitory computer readable storage medium in memory 802 is used to store at least one instruction for execution by processor 801 to implement a method of requesting web page information as provided by method embodiments herein.
In some embodiments, the terminal 800 may further include: a peripheral interface 803 and at least one peripheral. The processor 801, memory 802 and peripheral interface 803 may be connected by bus or signal lines. Various peripheral devices may be connected to peripheral interface 803 by a bus, signal line, or circuit board. Specifically, the peripheral device includes: at least one of a radio frequency circuit 804, a touch screen display 805, a camera 806, an audio circuit 807, a positioning component 808, and a power supply 809.
The peripheral interface 803 may be used to connect at least one peripheral related to I/O (Input/Output) to the processor 801 and the memory 802. In some embodiments, the processor 801, memory 802, and peripheral interface 803 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 801, the memory 802, and the peripheral interface 803 may be implemented on separate chips or circuit boards, which are not limited by this embodiment.
The Radio Frequency circuit 804 is used for receiving and transmitting RF (Radio Frequency) signals, also called electromagnetic signals. The radio frequency circuitry 804 communicates with communication networks and other communication devices via electromagnetic signals. The rf circuit 804 converts an electrical signal into an electromagnetic signal to be transmitted, or converts a received electromagnetic signal into an electrical signal. Optionally, the radio frequency circuit 804 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a subscriber identity module card, and so forth. The radio frequency circuit 804 may communicate with other terminals via at least one wireless communication protocol. The wireless communication protocols include, but are not limited to: the world wide web, metropolitan area networks, intranets, generations of mobile communication networks (2G, 3G, 4G, and 5G), Wireless local area networks, and/or WiFi (Wireless Fidelity) networks. In some embodiments, the radio frequency circuit 804 may further include NFC (Near Field Communication) related circuits, which are not limited in this application.
The display screen 805 is used to display a UI (User Interface). The UI may include graphics, text, icons, video, and any combination thereof. When the display 805 is a touch display, the display 805 also has the ability to capture touch signals on or above the surface of the display 805. The touch signal may be input to the processor 801 as a control signal for processing. At this point, the display 805 may also be used to provide virtual buttons and/or a virtual keyboard, also referred to as soft buttons and/or a soft keyboard. In some embodiments, the display 805 may be one, providing the front panel of the terminal 800; in other embodiments, the display 805 may be at least two, respectively disposed on different surfaces of the terminal 800 or in a folded design; in still other embodiments, the display 805 may be a flexible display disposed on a curved surface or a folded surface of the terminal 800. Even further, the display 805 may be arranged in a non-rectangular irregular pattern, i.e., a shaped screen. The Display 805 can be made of LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode), and other materials.
The camera assembly 806 is used to capture images or video. Optionally, camera assembly 806 includes a front camera and a rear camera. Generally, a front camera is disposed at a front panel of the terminal, and a rear camera is disposed at a rear surface of the terminal. In some embodiments, the number of the rear cameras is at least two, and each rear camera is any one of a main camera, a depth-of-field camera, a wide-angle camera and a telephoto camera, so that the main camera and the depth-of-field camera are fused to realize a background blurring function, and the main camera and the wide-angle camera are fused to realize panoramic shooting and VR (Virtual Reality) shooting functions or other fusion shooting functions. In some embodiments, camera assembly 806 may also include a flash. The flash lamp can be a monochrome temperature flash lamp or a bicolor temperature flash lamp. The double-color-temperature flash lamp is a combination of a warm-light flash lamp and a cold-light flash lamp, and can be used for light compensation at different color temperatures.
The audio circuit 807 may include a microphone and a speaker. The microphone is used for collecting sound waves of a user and the environment, converting the sound waves into electric signals, and inputting the electric signals to the processor 801 for processing or inputting the electric signals to the radio frequency circuit 804 to realize voice communication. For the purpose of stereo sound collection or noise reduction, a plurality of microphones may be provided at different portions of the terminal 800. The microphone may also be an array microphone or an omni-directional pick-up microphone. The speaker is used to convert electrical signals from the processor 801 or the radio frequency circuit 804 into sound waves. The loudspeaker can be a traditional film loudspeaker or a piezoelectric ceramic loudspeaker. When the speaker is a piezoelectric ceramic speaker, the speaker can be used for purposes such as converting an electric signal into a sound wave audible to a human being, or converting an electric signal into a sound wave inaudible to a human being to measure a distance. In some embodiments, the audio circuitry 807 may also include a headphone jack.
The positioning component 808 is used to locate the current geographic position of the terminal 800 for navigation or LBS (Location Based Service). The Positioning component 808 may be a Positioning component based on the Global Positioning System (GPS) in the united states, the beidou System in china, or the galileo System in russia.
Power supply 809 is used to provide power to various components in terminal 800. The power supply 809 can be ac, dc, disposable or rechargeable. When the power supply 809 includes a rechargeable battery, the rechargeable battery may be a wired rechargeable battery or a wireless rechargeable battery. The wired rechargeable battery is a battery charged through a wired line, and the wireless rechargeable battery is a battery charged through a wireless coil. The rechargeable battery may also be used to support fast charge technology.
Those skilled in the art will appreciate that the configuration shown in fig. 8 is not intended to be limiting of terminal 800 and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components may be used.
The memory further includes one or more programs, and the one or more programs are stored in the memory and configured to be executed by the CPU. The one or more programs include instructions for performing the method for requesting web page information for a terminal provided by the embodiments of the present application.
Embodiments of the present application also provide a non-transitory computer-readable storage medium, where instructions in the storage medium, when executed by a processor of a terminal, enable the terminal to perform relevant steps in the method for requesting web page information provided in the embodiments shown in fig. 1 or 3.
Embodiments of the present application further provide a computer program product containing instructions, which when run on a computer, cause the computer to perform the steps performed by the terminal in the method for requesting web page information provided in the embodiments shown in fig. 1 or 3.
Fig. 9 is a schematic diagram illustrating a server structure for requesting web page information according to an exemplary embodiment. The functions of the server in the embodiments shown in fig. 2-3 described above can be implemented by the server shown in fig. 9. The server may be a server in a cluster of background servers. Specifically, the method comprises the following steps:
the server 900 includes a Central Processing Unit (CPU)901, a system memory 904 including a Random Access Memory (RAM)902 and a Read Only Memory (ROM)903, and a system bus 905 connecting the system memory 904 and the central processing unit 901. The server 900 also includes a basic input/output system (I/O system) 906, which facilitates the transfer of information between devices within the computer, and a mass storage device 907 for storing an operating system 913, application programs 914, and other program modules 915.
The basic input/output system 906 includes a display 908 for displaying information and an input device 909 such as a mouse, keyboard, etc. for user input of information. Wherein a display 908 and an input device 909 are connected to the central processing unit 901 through an input-output controller 910 connected to the system bus 905. The basic input/output system 906 may also include an input/output controller 910 for receiving and processing input from a number of other devices, such as a keyboard, mouse, or electronic stylus. Similarly, input-output controller 910 also provides output to a display screen, a printer, or other type of output device.
The mass storage device 907 is connected to the central processing unit 901 through a mass storage controller (not shown) connected to the system bus 905. The mass storage device 907 and its associated computer-readable media provide non-volatile storage for the server 900. That is, mass storage device 907 may include a computer-readable medium (not shown) such as a hard disk or CD-ROM drive.
Without loss of generality, computer readable media may comprise computer storage media and communication media. Computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Computer storage media includes RAM, ROM, EPROM, EEPROM, flash memory or other solid state memory technology, CD-ROM, DVD, or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices. Of course, those skilled in the art will appreciate that computer storage media is not limited to the foregoing. The system memory 904 and mass storage device 907 described above may be collectively referred to as memory.
The server 900 may also operate as a remote computer connected to a network via a network, such as the internet, in accordance with various embodiments of the present application. That is, the server 900 may be connected to the network 912 through the network interface unit 911 connected to the system bus 905, or the network interface unit 911 may be used to connect to other types of networks or remote computer systems (not shown).
The memory further includes one or more programs, and the one or more programs are stored in the memory and configured to be executed by the CPU. The one or more programs include instructions for performing the method for requesting web page information for a server provided by the embodiments of the present application.
Embodiments of the present application also provide a non-transitory computer-readable storage medium, and when executed by a processor of a server, the instructions in the storage medium enable the server to perform relevant steps in the method for requesting web page information provided in the embodiments shown in fig. 2 to 3.
Embodiments of the present application further provide a computer program product containing instructions, which when executed on a computer, cause the computer to perform the steps performed by the server in the method for requesting web page information provided in the embodiments of fig. 2 to 3.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only exemplary of the present application and should not be taken as limiting the present application, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims (18)

1. A method of requesting web page information, the method comprising:
generating a target Uniform Resource Locator (URL) based on a target request parameter, wherein the target request parameter is a parameter related to webpage information required to be requested through a hypertext transfer protocol (HTTP) in a hypertext transfer protocol (HTTPS) webpage of a secure socket layer, and the target URL comprises the target request parameter;
when the length of the target URL is greater than a specified length, determining at least two URLs conforming to the specified length based on the target URL, wherein the specified length is the maximum length allowed by the URL, the at least two URLs conforming to the specified length both comprise request parameters, and the URLs conforming to the specified length comprise interception marks or interception ending marks, the interception marks and the interception ending marks are used for indicating the sequence of determining the at least two URLs conforming to the specified length, the interception ending marks are used for indicating that the corresponding URL is the last determined URL conforming to the specified length, and the target request parameters are composed of the request parameters contained by the at least two URLs conforming to the specified length;
and generating at least two HTTP requests based on the at least two URLs conforming to the specified length, and sending the at least two HTTP requests to a server to request the webpage information.
2. The method of claim 1, wherein determining at least two URLs that match a specified length based on the target URL comprises:
taking the target URL as an ith URL, intercepting the ith URL based on the specified length to obtain an intercepted URL and ith residual parameters, wherein the intercepted URL comprises partial parameters in the target request parameters and an interception identifier i, the ith residual parameters are the residual parameters after intercepting the ith URL, the interception identifier i is used for indicating that the intercepted URL is obtained by intercepting the ith URL, and i is a positive integer greater than or equal to 1;
generating an i +1 th URL based on the i part of remaining parameters, judging whether the length of the i +1 th URL is greater than the specified length, if so, making the i +1 th URL, returning to the step of intercepting the i th URL based on the specified length, and adding the interception end identifier in the last generated URL until the length of the i +1 th URL is not greater than the specified length, and determining the obtained at least one intercepted URL and the last generated URL as the at least two URLs meeting the specified length, wherein the interception end identifier is used for indicating that the target request parameters are all contained in the at least two URLs meeting the specified length.
3. The method of claim 2, wherein prior to intercepting the ith URL based on the specified length, further comprising:
if the target request parameter is a request parameter needing to be compressed and the request parameter contained in the ith URL does not carry a compression identifier, compressing the request parameter contained in the ith URL, wherein the compression identifier is used for indicating that the request parameter is already compressed;
accordingly, the generating of the i +1 th URL based on the i part remaining parameters includes:
and adding the compression identifier in the ith part of residual parameters, and generating the (i + 1) th URL based on the ith part of residual parameters added with the compression identifier.
4. The method of claim 1, wherein after generating the target uniform resource locator URL based on the target request parameter, further comprising:
and if the target request parameter is a request parameter needing to be compressed, compressing the target request parameter contained in the target URL.
5. The method according to any of claims 1-4, wherein after sending the at least two HTTP requests to the server, further comprising:
receiving an image sent by the server, wherein the image is determined and obtained based on the webpage information after the server obtains the webpage information based on the at least two URLs meeting the specified length;
loading the image and acquiring pixel data of each pixel point in the image;
determining the web page information based on the pixel data.
6. A method of requesting web page information, the method comprising:
receiving a hypertext transfer protocol (HTTP) request sent by a terminal, wherein the HTTP request is a request which is sent by the terminal in a hypertext transfer protocol over secure socket layer (HTTPS) webpage and is used for requesting webpage information through HTTP;
analyzing a Uniform Resource Locator (URL) in the HTTP request;
if the URL includes an interception mark but does not include an interception end mark, storing the URL; if the URL includes the interception end identifier but does not include the interception identifier, combining request parameters included in the URL with request parameters included in a stored URL according to the sequence of the terminal determining the URL to obtain target request parameters, wherein the interception identifier is used for indicating that the corresponding URL is the ith URL including partial parameters of the target request parameters, the interception identifier is sequentially increased according to the sequence of the terminal determining the URL, the interception end identifier is used for indicating that the HTTP request is the last request including the partial parameters of the target request parameters, i is a positive integer greater than or equal to 1, and the target request parameters are parameters related to the webpage information;
acquiring the webpage information based on the target request parameter;
and generating an image based on the webpage information, and sending the image to the terminal so that the terminal determines the webpage information based on the image.
7. The method according to claim 6, wherein after determining the target request parameter based on the request parameter contained in the uniform resource locator URL in the HTTP request, further comprising:
and if the request parameters contained in the URL in the HTTP request also comprise a compression identifier, decompressing the target request parameters.
8. The method of claim 6 or 7, wherein generating an image based on the web page information comprises:
determining pixel data of a plurality of pixel points based on the webpage information;
and generating the image based on the pixel data of the plurality of pixel points.
9. An apparatus for requesting information of a web page, the apparatus comprising:
the generation module is used for generating a target Uniform Resource Locator (URL) based on a target request parameter, wherein the target request parameter is a parameter related to webpage information which needs to be requested through a hypertext transfer protocol (HTTP) in a hypertext transfer protocol over secure socket layer (HTTPS) webpage, and the target URL comprises the target request parameter;
a determining module, configured to determine, based on the target URL, at least two URLs meeting a specified length when the length of the target URL is greater than a specified length, where the specified length is a maximum length that the URL is allowed to reach, where the at least two URLs meeting the specified length both include a request parameter, and the URL meeting the specified length includes a capture flag or a capture end flag, where the capture flag and the capture end flag are used to indicate an order in which the at least two URLs meeting the specified length are determined, and the capture end flag is used to indicate that a corresponding URL is a last determined URL meeting the specified length, where the target request parameter is composed of request parameters included in the at least two URLs meeting the specified length;
and the sending module is used for generating at least two HTTP requests based on the at least two URLs meeting the specified length and sending the at least two HTTP requests to a server so as to request the webpage information.
10. The apparatus of claim 9, wherein the determining module comprises:
the intercepting submodule is used for enabling i to be 1, taking the target URL as an ith URL, intercepting the ith URL based on the specified length to obtain an intercepted URL and ith part of residual parameters, wherein the intercepted URL comprises part of parameters in the target request parameters and an intercepting identifier i, the ith part of residual parameters are the parameters left after intercepting the ith URL, the intercepting identifier i is used for indicating that the intercepted URL is obtained by intercepting for the ith time, and i is a positive integer greater than or equal to 1;
and the judging submodule is used for generating an i +1 th URL based on the ith part of remaining parameters, judging whether the length of the i +1 th URL is greater than the specified length, if so, enabling the i to be i +1, returning to the step of intercepting the ith URL based on the specified length, and adding an interception end identifier in the last generated URL until the length of the i +1 th URL is not greater than the specified length, determining the obtained at least one intercepted URL and the last generated URL as the at least two URLs meeting the specified length, wherein the interception end identifier is used for indicating that the target request parameters are all contained in the at least two URLs meeting the specified length.
11. The apparatus of claim 10, wherein the determining module further comprises:
a compressing submodule, configured to compress the request parameter included in the ith URL if the target request parameter is a request parameter that needs to be compressed and the request parameter included in the ith URL does not carry a compression identifier, where the compression identifier is used to indicate that the request parameter has been compressed;
correspondingly, the judgment sub-module is further configured to:
and adding the compression identifier in the ith part of residual parameters, and generating the (i + 1) th URL based on the ith part of residual parameters added with the compression identifier.
12. The apparatus of claim 9, wherein the apparatus is further configured to:
and if the target request parameter is a request parameter needing to be compressed, compressing the target request parameter contained in the target URL.
13. The apparatus of any of claims 9-12, further comprising:
the receiving module is used for receiving the image sent by the server, and the image is determined and obtained based on the webpage information after the server obtains the webpage information based on the at least two URLs meeting the specified length;
the acquisition module is used for loading the image and acquiring the pixel data of each pixel point in the image;
the determining module is further configured to determine the web page information based on the pixel data.
14. An apparatus for requesting information of a web page, the apparatus comprising:
the system comprises a receiving module, a sending module and a processing module, wherein the receiving module is used for receiving a hypertext transfer protocol (HTTP) request sent by a terminal, and the HTTP request is a request which is sent by the terminal in a hypertext transfer protocol over secure socket layer (HTTPS) webpage and is used for requesting webpage information through HTTP;
the determining module is used for analyzing the URL in the HTTP request; if the URL includes an interception mark but does not include an interception end mark, storing the URL; if the URL includes the interception end identifier but does not include the interception identifier, combining request parameters included in the URL with request parameters included in a stored URL according to the sequence of the terminal determining the URL to obtain target request parameters, wherein the interception identifier is used for indicating that the corresponding URL is the ith URL including partial parameters of the target request parameters, the interception identifier is sequentially increased according to the sequence of the terminal determining the URL, the interception end identifier is used for indicating that the HTTP request is the last request including the partial parameters of the target request parameters, i is a positive integer greater than or equal to 1, and the target request parameters are parameters related to the webpage information;
the acquisition module is used for acquiring the webpage information based on the target request parameter;
the generating module is used for generating an image based on the webpage information;
and the sending module is used for sending the image to the terminal so that the terminal determines the webpage information based on the image.
15. The apparatus of claim 14, further comprising:
and the decompression module is used for decompressing the target request parameter if the request parameter contained in the URL in the HTTP request also comprises a compression identifier.
16. The apparatus according to claim 14 or 15, wherein the generating module is specifically configured to:
determining pixel data of a plurality of pixel points based on the webpage information;
and generating the image based on the pixel data of the plurality of pixel points.
17. A system for requesting webpage information is characterized by comprising a terminal and a server;
the terminal is configured to perform any of the methods of claims 1-5;
the server is configured to perform any of the methods of claims 6-8.
18. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the method of any one of the preceding claims 1 to 5, or which, when being executed by a processor, carries out the method of any one of the preceding claims 6 to 8.
CN201810468003.6A 2018-05-16 2018-05-16 Method, device and storage medium for requesting webpage information Active CN110505253B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810468003.6A CN110505253B (en) 2018-05-16 2018-05-16 Method, device and storage medium for requesting webpage information

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810468003.6A CN110505253B (en) 2018-05-16 2018-05-16 Method, device and storage medium for requesting webpage information

Publications (2)

Publication Number Publication Date
CN110505253A CN110505253A (en) 2019-11-26
CN110505253B true CN110505253B (en) 2022-04-05

Family

ID=68584451

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810468003.6A Active CN110505253B (en) 2018-05-16 2018-05-16 Method, device and storage medium for requesting webpage information

Country Status (1)

Country Link
CN (1) CN110505253B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112822237B (en) * 2020-12-28 2022-07-15 北京奇艺世纪科技有限公司 Network request transmission method and device

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2004110027A1 (en) * 2003-06-06 2004-12-16 Computer Associates Think, Inc. System and method for compressing url request parameters
US7886043B1 (en) * 2007-03-29 2011-02-08 Trend Micro Inc Hybrid method and apparatus for URL filtering
CN102033926B (en) * 2010-12-15 2013-09-04 百度在线网络技术(北京)有限公司 Page content processing method and device
CN102291324A (en) * 2011-06-28 2011-12-21 北京神州泰岳软件股份有限公司 Highly concurrent service request processing method
CN102629938B (en) * 2012-03-14 2015-05-06 网宿科技股份有限公司 Method for carrying out video acceleration on network video loading and system thereof
US20160036883A1 (en) * 2014-07-30 2016-02-04 Qualcomm Incorporated Systems and methods for selective transport accelerator operation
CN105491078B (en) * 2014-09-15 2019-01-22 阿里巴巴集团控股有限公司 Data processing method and device, SOA system in SOA system
CN107436873B (en) * 2016-05-25 2021-05-07 北京奇虎科技有限公司 Website jumping method, device and transfer device
CN106230788A (en) * 2016-07-22 2016-12-14 上海斐讯数据通信技术有限公司 The reorientation method of a kind of portal certification, radio reception device, portal server

Also Published As

Publication number Publication date
CN110505253A (en) 2019-11-26

Similar Documents

Publication Publication Date Title
US9602286B2 (en) Electronic device and method for extracting encrypted message
CN104869305B (en) Method and apparatus for processing image data
US11934352B2 (en) Card rendering method and electronic device
CN105094861A (en) Webpage application program loading method, device and system
EP3493113B1 (en) Image processing method, computer device, and computer readable storage medium
CN108804130B (en) Program installation package generation method and device
CN109040339B (en) Cross-domain request processing method, device and equipment based on AJAX
KR20150027934A (en) Apparatas and method for generating a file of receiving a shoot image of multi angle in an electronic device
CN114416723B (en) Data processing method, device, equipment and storage medium
CN111625315A (en) Page display method and device, electronic equipment and storage medium
KR20150019813A (en) Method for controlling an content integrity and an electronic device
CN113905258B (en) Video playing method, network device and storage medium
CN116418795A (en) Processing method of user access request, electronic device, electronic equipment and medium
CN110505253B (en) Method, device and storage medium for requesting webpage information
CN113220366A (en) Sub-application starting method and device, terminal and server
CN111694521B (en) Method, device and system for storing file
CN110390065B (en) Webpage acquisition method, device and system
US11522870B2 (en) Method for URL analysis and electronic device thereof
CN112784201A (en) Webpage display method, device, terminal and storage medium
CN113220396B (en) Embedded page management method and device, electronic equipment and storage medium
CN112905328A (en) Task processing method and device and computer readable storage medium
KR20150104898A (en) Apparatas and method for improving a loading time in an electronic device
KR20150045560A (en) Apparatas and method for sorting a contents using for updated post information in an electronic device
CN112948108B (en) Request processing method and device and electronic equipment
KR102154324B1 (en) Apparatas and method for improving a quality of telephone call for charging in an electronic device

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