CN104750728A - Method and device for controlling web page request mode - Google Patents

Method and device for controlling web page request mode Download PDF

Info

Publication number
CN104750728A
CN104750728A CN201310744366.5A CN201310744366A CN104750728A CN 104750728 A CN104750728 A CN 104750728A CN 201310744366 A CN201310744366 A CN 201310744366A CN 104750728 A CN104750728 A CN 104750728A
Authority
CN
China
Prior art keywords
web
page requests
processing unit
mode
access
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.)
Granted
Application number
CN201310744366.5A
Other languages
Chinese (zh)
Other versions
CN104750728B (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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201310744366.5A priority Critical patent/CN104750728B/en
Publication of CN104750728A publication Critical patent/CN104750728A/en
Application granted granted Critical
Publication of CN104750728B publication Critical patent/CN104750728B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Information Transfer Between Computers (AREA)

Abstract

The invention discloses a method and a device for controlling a web page request mode. By the method and the device, the development efficiency is improved, and the maintainability of a website can be improved. The method comprises the following steps of receiving a web page request command transmitted from a terminal; acquiring the web page request mode and a visited web page request processing unit from the web page request command; acquiring the web page request mode which can be processed by the visited web page request processing unit; judging whether the web page request mode in the web page request command belongs to the web page request mode which can be processed by the web page request processing unit or not; transmitting the web page request command to the web page request processing unit and processing the web page request command if the web page request mode in the web page request command belongs to the web page request mode which can be processed by the web page request processing unit; and refusing the web page request command if the web page request mode in the web page request command does not belong to the web page request mode which can be processed by the web page request processing unit.

Description

A kind of control method of web-page requests mode and device
Technical field
The present invention relates to Internet technical field, be specifically related to a kind of control method and device of web-page requests mode.
Background technology
When user uses a certain webpage of terminal access, web-page requests instruction request can be sent to Website server and access this webpage, webpage provides different functions to have different legal web-page requests modes, and such as, in webpage, realize registering functional needs to use POST web-page requests mode.
In the prior art, the processing logic of the web-page requests processing unit of each webpage function is corresponded in Website server, need first to judge that whether web-page requests mode is legal in the control realizing web-page requests mode, if web-page requests mode is legal, normally access, if web-page requests mode is illegal with regard to denied access.But, the processing logic of each web-page requests processing unit all needs to carry out the whether legal judgement of web-page requests mode, when there being a large amount of web-page requests processing units in a website, then realize this website can exist and repeat similar decision logic in a large number, cause development efficiency low and website is maintainable poor. 
Summary of the invention
In view of this, fundamental purpose of the present invention is to provide a kind of control method and device of web-page requests mode, the problem of the development efficiency caused with the control method solving web-page requests mode in prior art low and website maintainability difference.
For solving the problem, technical scheme provided by the invention is as follows:
A control method for web-page requests mode, described method comprises:
The web-page requests instruction that receiving terminal sends, the web-page requests processing unit obtaining web-page requests mode and will access from described web-page requests instruction;
Obtain the web-page requests mode that the described web-page requests processing unit that will access can process;
Judge the web-page requests mode whether the web-page requests mode obtained from described web-page requests instruction belongs to the described web-page requests processing unit that will access and can process, if, the described web-page requests processing unit that will access then described web-page requests instruction is sent to process, if not, then described web-page requests instruction is refused.
Accordingly, described method also comprises:
Pre-set the web-page requests mode that each web-page requests processing unit can process.
Accordingly, described in pre-set the web-page requests mode that each web-page requests processing unit can process, comprising:
By adding the instruction preamble comprising the web-page requests mode name that this web-page requests processing unit can process in each web-page requests processing unit, pre-set the web-page requests mode that each web-page requests processing unit can process.
Accordingly, the web-page requests mode that the described web-page requests processing unit that will access of described acquisition can process, comprising:
Read the instruction preamble in the described web-page requests processing unit that will access, resolve the described sequence of instructions of acquisition and call the turn the web-page requests mode name comprised, to obtain the web-page requests mode that the described web-page requests processing unit that will access can process.
Accordingly, described parsing obtains described sequence of instructions and calls the turn the web-page requests mode name comprised, and comprising:
Judge that described sequence of instructions calls the turn whether to comprise character string and directly measure, if so whether, judging that described character string is directly measured is web-page requests mode name, if, read the web-page requests mode name that described character string directly measures representative, obtain described sequence of instructions and call the turn the web-page requests mode name comprised.
Accordingly, described web-page requests mode comprises: upgrade request of data, acquisition/data query request, one or more the combination sent in request of data, the request of acquisition function choosing-item, disable access, the whole request method of permission.
A control device for web-page requests mode, described device comprises:
Receiving element, for the web-page requests instruction that receiving terminal sends, the web-page requests processing unit obtaining web-page requests mode and will access from described web-page requests instruction;
Obtain unit, for obtaining the web-page requests mode that the described web-page requests processing unit that will access can process;
Judging unit, for judging the web-page requests mode whether the web-page requests mode obtained from described web-page requests instruction belongs to the described web-page requests processing unit that will access and can process;
Transmitting element, if be yes for the judged result of described judging unit, then sends to the described web-page requests processing unit that will access to process by described web-page requests instruction;
Denied access unit, if be no for the judged result of described judging unit, then refuses described web-page requests instruction.
Accordingly, described device also comprises:
Setting unit, for pre-setting the web-page requests mode that each web-page requests processing unit can process.
Accordingly, described setting unit specifically for:
By adding the instruction preamble comprising the web-page requests mode name that this web-page requests processing unit can process in each web-page requests processing unit, pre-set the web-page requests mode that each web-page requests processing unit can process.
Accordingly, described acquisition unit comprises:
First reads subelement, for reading the instruction preamble in the described web-page requests processing unit that will access;
Resolving subelement, calling the turn the web-page requests mode name comprised, to obtain the web-page requests mode that the described web-page requests processing unit that will access can process for resolving the described sequence of instructions of acquisition.
Accordingly, described parsing subelement comprises:
Whether the first judgment sub-unit, comprise character string directly measure for judging that described sequence of instructions calls the turn;
Second judgment sub-unit, whether if be yes for the judged result of described first judgment sub-unit, judging that described character string is directly measured is web-page requests mode name;
Second reads subelement, if be yes for the judged result of described second judgment sub-unit, reads the web-page requests mode name that described character string directly measures representative, obtains described sequence of instructions and call the turn the web-page requests mode name comprised.
Accordingly, described web-page requests mode comprises: upgrade request of data, acquisition/data query request, one or more the combination sent in request of data, the request of acquisition function choosing-item, disable access, the whole request method of permission.
As can be seen here, the present invention has following beneficial effect:
The web-page requests mode that the web-page requests processing unit that the embodiment of the present invention will be accessed by the instruction of reading web-page requests can process, judge the web-page requests mode whether the web-page requests mode of this web-page requests instruction meets the web-page requests processing unit that will access and can process, web-page requests instruction corresponding for incongruent web-page requests mode is directly filtered out, the web-page requests instruction met is sent to web-page requests processing unit processes again.Namely before web-page requests instruction is sent to web-page requests processing unit, the control judgement of web-page requests mode is carried out in first unification, web-page requests processing unit only processes normal access, do not need to carry out other to judge, significantly can promote development efficiency and the maintainability of Website server.
Accompanying drawing explanation
Fig. 1 is the process flow diagram of the control method embodiment one of web-page requests mode in the embodiment of the present invention;
Fig. 2 is the schematic diagram of the control method process of web-page requests mode in prior art;
Fig. 3 is the schematic diagram of the control method process of embodiment of the present invention web-page requests mode;
Fig. 4 is the process flow diagram of the control method embodiment two of web-page requests mode in the embodiment of the present invention;
Fig. 5 is the schematic diagram of the control device embodiment one of web-page requests mode in the embodiment of the present invention;
Fig. 6 is the schematic diagram of the control device embodiment two of web-page requests mode in the embodiment of the present invention;
Fig. 7 is the schematic diagram of a kind of server in the embodiment of the present invention.
Embodiment
For enabling above-mentioned purpose of the present invention, feature and advantage become apparent more, are described in further detail the embodiment of the present invention below in conjunction with the drawings and specific embodiments.
The control method of the web-page requests mode that the embodiment of the present invention provides and device, all need to carry out the whether legal judgement of web-page requests mode for web-page requests processing unit each in prior art, cause Website server development efficiency low and the problem of maintainable difference, propose to add expanding element before web-page requests processing unit, by expanding element, unified judgement is carried out to the web-page requests mode that the web-page requests instruction received comprises, judge that whether this web-page requests mode is the web-page requests mode that web-page requests processing unit that this web-page requests instruction will be accessed can process, undesirable web-page requests mode is directly filtered out, web-page requests processing unit only needs the process carrying out normal access, no longer need to judge web-page requests mode, avoid judgement similar in a large amount of web-page requests processing unit, improve development efficiency and the maintainability of Website server, quick realization is to the control of web-page requests mode in each web-page requests instruction.
Based on above-mentioned thought, shown in Figure 1, control device angle from web-page requests mode is described by the embodiment of the present invention, the control device of this web-page requests mode specifically can be integrated in Website server, and in the embodiment of the present invention, the control method embodiment one of web-page requests mode can comprise the following steps:
Step 101: the web-page requests instruction that receiving terminal sends, the web-page requests processing unit obtaining web-page requests mode and will access from web-page requests instruction.
When user uses terminal to need to carry out web page access, need to send web-page requests instruction, the web-page requests mode that can comprise this web-page requests instruction in this web-page requests instruction and the web-page requests processing unit that will access to Website server.Each web-page requests processing unit corresponds to a web-page requests process function in Website server, and such as web-page requests processing unit can process the browse request, registration request etc. of a certain webpage.The web-page requests mode obtained from web-page requests instruction represents this web-page requests instruction in the web-page requests mode of asking the web-page requests processing unit that will access to use, the web-page requests mode obtained from web-page requests instruction may be meet the web-page requests mode that the web-page requests processing unit that will access requires, also may be do not meet the web-page requests mode that the web-page requests processing unit that will access requires, therefore, subsequent step in the embodiment of the present invention needs specifically to judge this, to realize the control to web-page requests mode.
Step 102: the web-page requests mode that the web-page requests processing unit that acquisition will be accessed can process.
In some embodiments of the invention, the control method of embodiment of the present invention web-page requests mode can also comprise:
Pre-set the web-page requests mode that each web-page requests processing unit can process.
By reading the web-page requests mode that the web-page requests processing unit that pre-sets can process, the web-page requests mode that web-page requests processing unit that the web-page requests instruction that receives will access can process can be obtained.
In some embodiments of the invention, web-page requests mode can include but not limited to upgrade request of data (POST request), acquisition/data query request (GET request), sends request of data (PUT request), obtain function choosing-item request (OPTIONS), disable access (DENY), one or more the combination allowed in whole request method (ALL).
Wherein, POST request can be understood as the request transmitting data to Website server, by HTTP(hypertext transfer protocol, POST mechanism in HTTP-Hypertext transfer protocol, each field in list and its Content placement are sent to together with in HTML (Hypertext Markup Language) HTML header file the URL(URL(uniform resource locator) of ACTION attribute indication, Uniform Resource Locator) address.GET request can be understood as the request obtaining data from Website server, is that supplemental characteristic queue is added in the URL of ACTION attribute indication of submission form, and value and list each field one_to_one corresponding interior, can see in URL.PUT request is generally used for sending request to server, if URI does not exist, then require that server is according to request establishing resource, if existed, server just accepts request content, and revises the prototype version of URI resource.
In addition, the web-page requests mode that can process by pre-setting each web-page requests processing unit can also realize more self-defining functions, such as, when the web-page requests mode that web-page requests processing unit can process is disable access DENY, web page access is forbidden in representative, like this with regard to just the access rights of this web-page requests processing unit being shielded without the need to deleting this web-page requests processing unit in Website server, further increase the maintainability of Website server.
Step 103: judge if so, to enter the web-page requests mode whether the web-page requests mode obtained from web-page requests instruction belongs to the web-page requests processing unit that will access and can process step 104, if not, enter step 105.
Step 104: web-page requests instruction sent to the web-page requests processing unit that will access to process.
Step 105: refusal web-page requests instruction.
First unifiedly judge the web-page requests mode whether the web-page requests mode obtained from web-page requests instruction belongs to web-page requests processing unit and can process, also namely judge whether the web-page requests mode obtained from web-page requests instruction meets the requirement of the web-page requests processing unit that will access, judge just web-page requests instruction to be sent to the web-page requests processing unit that will access if having passed, like this, web-page requests processing unit only processes normal access, no longer need to carry out other to judge, significantly can promote development efficiency and the maintainability of Website server.
Shown in Figure 2, it is the schematic diagram of prior art web-page requests mode control method process, the web-page requests instruction that Website server receiving terminal sends, again web-page requests instruction is distributed to different web-page requests processing units, need after each web-page requests processing unit receives web-page requests instruction to judge this web-page requests, judge whether its web-page requests mode is the mode that this webpage requesting processing meets, if met, then normally access, if do not met, then refuse this access.That is, if there is a large amount of web-page requests processing units in Website server, each web-page requests processing unit needs a set of decision logic, and often the many needs of cover decision logic are manually write, development amount is very huge, needs at substantial time-triggered protocol non-core services logic.Meanwhile, there is decision logic similar in a large number in Website server, maintainability also can reduce.
Shown in Figure 3 again, it is the schematic diagram of embodiment of the present invention web-page requests mode control method process, in the embodiment of the present invention, the control method of web-page requests mode is described from the control device angle of web-page requests mode, the control device of this web-page requests mode specifically can be integrated in Website server, the control device of web-page requests mode is equivalent in Website server, add an expanding element, whether the web-page requests mode of the web-page requests instruction that judgement receives is that the web-page requests processing unit that will access can process, if not then this web-page requests instruction directly being filtered out, corresponding web-page requests processing unit satisfactory web-page requests instruction is sent to process again.Namely the service logic that web-page requests processing unit only can be absorbed in core carries out the process of normal web page access and does not need to carry out the whether correct judgement of web-page requests mode again.Like this, improve the maintainability of development efficiency and Website server code.
Based on above-described embodiment, concrete, in some embodiments of the invention, can comprise in the specific implementation pre-setting the web-page requests mode that each web-page requests processing unit can process:
By adding the instruction preamble comprising the web-page requests mode name that this web-page requests processing unit can process in each web-page requests processing unit, pre-set the web-page requests mode that each web-page requests processing unit can process.
At present, Website server mainly uses JavaScript language to realize, a kind of metamessage form of presentation provided in JavaScript standard, it is several statements of each function body or program segment foremost, if all only there is a character string directly to measure in these several statements, it is exactly an instruction preamble.At present, instruction preamble in JavaScript standard only comprises this instruction preamble of use strict, effect is exactly tell that the current code of the interpreter of JavaScript runs under a kind of rigorous model, the constraint that this pattern will be made the coding of developer custom and behavior in some specifications, thus reduce all abnormal activity of developer between development stage, avoid expanding mistake to production environment.
Web-page requests mode name is used to further expand instruction preamble in embodiments of the present invention, also namely by adding the instruction preamble comprising the web-page requests mode name that this web-page requests processing unit can process in each web-page requests processing unit, the web-page requests mode that each web-page requests processing unit can process is pre-set.
In some embodiments of the invention, the specific implementation of the web-page requests mode that the web-page requests processing unit that acquisition will be accessed can process can comprise:
Read the instruction preamble in the web-page requests processing unit that will access, resolve acquisition sequence of instructions and call the turn the web-page requests mode name comprised, to obtain the web-page requests mode that the web-page requests processing unit that will access can process.
Wherein, resolve and obtain the specific implementation that sequence of instructions calls the turn the web-page requests mode name comprised and can comprise:
Whether comprise character string in decision instruction preamble directly to measure, whether if so, judging that character string is directly measured is web-page requests mode name, if so, reads the web-page requests mode name that character string directly measures representative, obtains sequence of instructions and call the turn the web-page requests mode name comprised.
Because the embodiment of the present invention is expanded instruction preamble, the web-page requests mode name that also can process by web-page requests processing unit is as instruction preamble, but, because current JavaScript interpreter does not support analyzing web page request method name, the mode provided in the embodiment of the present invention is therefore needed to resolve instruction preamble.Concrete, directly measure if namely find that there is character string, and this character string directly to measure be defined web-page requests mode name, then the web-page requests mode that the web-page requests processing unit that will access can process is set to the value that this instruction preamble is specified.
Shown in Figure 4, in the embodiment of the present invention, the control method embodiment two of web-page requests mode can comprise the following steps:
Step 401: by adding the instruction preamble comprising the web-page requests mode name that this web-page requests processing unit can process in each web-page requests processing unit, pre-set the web-page requests mode that each web-page requests processing unit can process.
One or more web-page requests mode name is added as instruction preamble in web-page requests processing unit, concrete, can call the turn in the sequence of instructions of web-page requests processing unit and add character string and directly measure: one or more in POST, GET, PUT, OPTIONS, DENY, ALL, these character strings are directly measured and are web-page requests mode name.Such as, the instruction preamble of web-page requests processing unit is POST, then representing the web-page requests mode that this web-page requests processing unit can process is POST request.
Step 402: the web-page requests instruction that receiving terminal sends, the web-page requests processing unit obtaining web-page requests mode and will access from web-page requests instruction.
Step 403: read the instruction preamble in the web-page requests processing unit that will access.
Step 404: whether comprise character string in decision instruction preamble and directly measure, if so, enter step 405, if not, enter step 409.
Step 405: whether be web-page requests mode name, if so, enter step 406, if not, enter step 409 if judging that character string is directly measured.
Step 406: read character string and directly measure the web-page requests mode name of representative, obtains sequence of instructions and calls the turn the web-page requests mode name comprised, to obtain the web-page requests mode that the web-page requests processing unit that will access can process.
Step 407: judge if so, to enter the web-page requests mode whether the web-page requests mode obtained from web-page requests instruction belongs to the web-page requests processing unit that will access and can process step 408, if not, enter step 409.
Such as, judge that the sequence of instructions read calls the turn and comprise POST character string and directly measure, and POST is also web-page requests mode name, then obtaining the web-page requests mode that the web-page requests processing unit that will access can process is that POST asks.If the web-page requests mode obtained from web-page requests instruction is also POST request, then the web-page requests processing unit will accessed can this web-page requests instruction, then send to web-page requests processing unit directly to process.
Step 408: web-page requests instruction sent to the web-page requests processing unit that will access to process.
Step 409: refusal web-page requests instruction.
In the present embodiment, the web-page requests mode that the web-page requests processing unit will accessed by reading web-page requests instruction can process, judge the web-page requests mode whether the web-page requests mode of this web-page requests instruction meets the web-page requests processing unit that will access and can process, web-page requests instruction corresponding for incongruent web-page requests mode is directly filtered out, the web-page requests instruction met is sent to web-page requests processing unit processes again.Namely before web-page requests instruction is sent to web-page requests processing unit, the control judgement of web-page requests mode is carried out in first unification, web-page requests processing unit only processes normal access, do not need to carry out other to judge, significantly can promote development efficiency and the maintainability of Website server.
Simultaneously, the embodiment of the present invention adopts the mode of extended instruction preamble to realize making control to web-page requests mode, can control each web-page requests mode fast, can also realize custom feature according to the actual requirements, this is not available for prior art.
Shown in Figure 5, a kind of control device embodiment one of web-page requests mode in the embodiment of the present invention, can comprise:
Receiving element 501, for the web-page requests instruction that receiving terminal sends, the web-page requests processing unit obtaining web-page requests mode and will access from web-page requests instruction.
Obtain unit 502, for obtaining the web-page requests mode that the web-page requests processing unit that will access can process.
When user uses terminal to need to carry out web page access, need to send web-page requests instruction, the web-page requests mode that can comprise this web-page requests instruction in this web-page requests instruction and the web-page requests processing unit that will access to Website server.Each web-page requests processing unit corresponds to a web-page requests process function in Website server, and such as web-page requests processing unit can process the browse request, registration request etc. of a certain webpage.The web-page requests mode obtained from web-page requests instruction represents this web-page requests instruction in the web-page requests mode of asking the web-page requests processing unit that will access to use, the web-page requests mode obtained from web-page requests instruction may be meet the web-page requests mode that the web-page requests processing unit that will access requires, also may be not meet the web-page requests mode that the web-page requests processing unit that will access requires.
Judging unit 503, for judging the web-page requests mode whether the web-page requests mode obtained from web-page requests instruction belongs to the web-page requests processing unit that will access and can process.
In some embodiments of the invention, the control device of embodiment of the present invention web-page requests mode can also comprise:
Setting unit, for pre-setting the web-page requests mode that each web-page requests processing unit can process.
In some embodiments of the invention, setting unit can be specifically for:
By adding the instruction preamble comprising the web-page requests mode name that this web-page requests processing unit can process in each web-page requests processing unit, pre-set the web-page requests mode that each web-page requests processing unit can process.
In some embodiments of the invention, web-page requests mode can include but not limited to upgrade request of data (POST request), acquisition/data query request (GET request), sends request of data (PUT request), obtain function choosing-item request (OPTIONS), disable access (DENY), one or more the combination allowed in whole request method (ALL).
Wherein, POST request can be understood as the request transmitting data to Website server, by HTTP(hypertext transfer protocol, POST mechanism in HTTP-Hypertext transfer protocol, each field in list and its Content placement are sent to together with in HTML (Hypertext Markup Language) HTML header file the URL(URL(uniform resource locator) of ACTION attribute indication, Uniform Resource Locator) address.GET request can be understood as the request obtaining data from Website server, is that supplemental characteristic queue is added in the URL of ACTION attribute indication of submission form, and value and list each field one_to_one corresponding interior, can see in URL.PUT request is generally used for sending request to server, if URI does not exist, then require that server is according to request establishing resource, if existed, server just accepts request content, and revises the prototype version of URI resource.
In addition, the web-page requests mode that can process by pre-setting each web-page requests processing unit can also realize more self-defining functions, such as, when the web-page requests mode that web-page requests processing unit can process is disable access DENY, web page access is forbidden in representative, like this with regard to just the access rights of this web-page requests processing unit being shielded without the need to deleting this web-page requests processing unit in Website server, further increase the maintainability of Website server.
Transmitting element 504, if be yes for the judged result of judging unit, then sends to the web-page requests processing unit that will access to process by web-page requests instruction.
Denied access unit 505, if be no for the judged result of judging unit, then refuses web-page requests instruction.
First unifiedly judge the web-page requests mode whether the web-page requests mode obtained from web-page requests instruction belongs to web-page requests processing unit and can process, also namely judge whether the web-page requests mode obtained from web-page requests instruction meets the requirement of the web-page requests processing unit that will access, judge just web-page requests instruction to be sent to the web-page requests processing unit that will access if having passed, like this, web-page requests processing unit only processes normal access, no longer need to carry out other to judge, significantly can promote development efficiency and the maintainability of Website server.
Shown in Figure 6, in some embodiments of the invention, obtaining unit can comprise:
First reads subelement 5021, for reading the instruction preamble in the web-page requests processing unit that will access;
Resolve subelement 5022, obtain sequence of instructions call the turn the web-page requests mode name comprised, to obtain the web-page requests mode that the web-page requests processing unit that will access can process for resolving.
In some embodiments of the invention, resolve subelement can comprise:
First judgment sub-unit 5023, for whether comprising character string in decision instruction preamble directly measures;
Second judgment sub-unit 5024, whether if be yes for the judged result of the first judgment sub-unit, judging that character string is directly measured is web-page requests mode name;
Second reads subelement 5025, if be yes for the judged result of the second judgment sub-unit, reads the web-page requests mode name that character string directly measures representative, obtains sequence of instructions and call the turn the web-page requests mode name comprised.
Like this, a kind of control device embodiment two of web-page requests mode in the embodiment of the present invention, can comprise:
Setting unit 506, for by adding the instruction preamble comprising the web-page requests mode name that this web-page requests processing unit can process in each web-page requests processing unit, pre-sets the web-page requests mode that each web-page requests processing unit can process.
Receiving element 501, for the web-page requests instruction that receiving terminal sends, the web-page requests processing unit obtaining web-page requests mode and will access from web-page requests instruction.
First reads subelement 5021, for reading the instruction preamble in the web-page requests processing unit that will access.
First judgment sub-unit 5023, for whether comprising character string in decision instruction preamble directly measures.
Second judgment sub-unit 5024, whether if be yes for the judged result of the first judgment sub-unit, judging that character string is directly measured is web-page requests mode name.
Second reads subelement 5025, if be yes for the judged result of the second judgment sub-unit, reads the web-page requests mode name that character string directly measures representative, obtains sequence of instructions and call the turn the web-page requests mode name comprised.
Judging unit 503, for judging the web-page requests mode whether the web-page requests mode obtained from web-page requests instruction belongs to the web-page requests processing unit that will access and can process.
Transmitting element 504, if be yes for the judged result of judging unit, then sends to the web-page requests processing unit that will access to process by web-page requests instruction.
Denied access unit 505, if be no for the judged result of judging unit or the judged result of the first judgment sub-unit is no or the judged result of the first judgment sub-unit is no, then refuses web-page requests instruction.
In the present embodiment, the web-page requests mode that the web-page requests processing unit will accessed by reading web-page requests instruction can process, judge the web-page requests mode whether the web-page requests mode of this web-page requests instruction meets the web-page requests processing unit that will access and can process, web-page requests instruction corresponding for incongruent web-page requests mode is directly filtered out, the web-page requests instruction met is sent to web-page requests processing unit processes again.Namely before web-page requests instruction is sent to web-page requests processing unit, the control judgement of web-page requests mode is carried out in first unification, web-page requests processing unit only processes normal access, do not need to carry out other to judge, significantly can promote development efficiency and the maintainability of Website server.
Simultaneously, the embodiment of the present invention adopts the mode of extended instruction preamble to realize making control to web-page requests mode, can control each web-page requests mode fast, can also realize custom feature according to the actual requirements, this is not available for prior art.
Accordingly, the embodiment of the present invention also provides a kind of server, shown in Figure 7, can comprise:
Processor 701, storer 702, input media 703 and output unit 704.The quantity of the processor 701 in browser server can be one or more, for a processor in Fig. 7.In some embodiments of the invention, processor 701, storer 702, input media 703 are connected by bus or alternate manner with output unit 704, wherein, to be connected by bus in Fig. 7.
Storer 702 can be used for storing software program and module, and processor 701 is stored in software program and the module of storer 702 by running, thus performs various function application and the data processing of browser server.Storer 702 mainly can comprise storage program district and store data field, and wherein, storage program district can store operating system, application program etc. needed at least one function.In addition, storer 702 can comprise high-speed random access memory, can also comprise nonvolatile memory, such as at least one disk memory, flush memory device or other volatile solid-state parts.Input media 703 can be used for the numeral or the character information that receive input, and generation arranges with the user of browser server and function controls the input of relevant key signals.
Specifically in the present embodiment, processor 701 can according to following instruction, executable file corresponding for the process of one or more application program is loaded in storer 702, and is run the application program be stored in storer 702 by processor 701, thus realize various function:
The web-page requests instruction that receiving terminal sends, the web-page requests processing unit obtaining web-page requests mode and will access from described web-page requests instruction;
Obtain the web-page requests mode that the described web-page requests processing unit that will access can process;
Judge the web-page requests mode whether the web-page requests mode obtained from described web-page requests instruction belongs to described web-page requests processing unit and can process, if, then described web-page requests processing unit is sent to process described web-page requests instruction, if not, then described web-page requests instruction is refused.
Accordingly, also comprise:
Pre-set the web-page requests mode that each web-page requests processing unit can process.
Accordingly, described in pre-set the web-page requests mode that each web-page requests processing unit can process, comprising:
By adding the instruction preamble comprising the web-page requests mode name that this web-page requests processing unit can process in each web-page requests processing unit, pre-set the web-page requests mode that each web-page requests processing unit can process.
Accordingly, the web-page requests mode that the described web-page requests processing unit that will access of described acquisition can process, comprising:
Read the instruction preamble in the described web-page requests processing unit that will access, resolve the described sequence of instructions of acquisition and call the turn the web-page requests mode name comprised, to obtain the web-page requests mode that the described web-page requests processing unit that will access can process.
Accordingly, described parsing obtains described sequence of instructions and calls the turn the web-page requests mode name comprised, and comprising:
Judge that described sequence of instructions calls the turn whether to comprise character string and directly measure, if so whether, judging that described character string is directly measured is web-page requests mode name, if, read the web-page requests mode name that described character string directly measures representative, obtain described sequence of instructions and call the turn the web-page requests mode name comprised.
In the present embodiment, the web-page requests mode that the web-page requests processing unit that processor 701 will be accessed by the instruction of reading web-page requests can process, judge the web-page requests mode whether the web-page requests mode of this web-page requests instruction meets the web-page requests processing unit that will access and can process, web-page requests instruction corresponding for incongruent web-page requests mode is directly filtered out, the web-page requests instruction met is sent to web-page requests processing unit processes again.Namely before web-page requests instruction is sent to web-page requests processing unit, the control judgement of web-page requests mode is carried out in first unification, web-page requests processing unit only processes normal access, do not need to carry out other to judge, significantly can promote development efficiency and the maintainability of Website server.
It should be noted that, in this instructions, each embodiment adopts the mode of going forward one by one to describe, and what each embodiment stressed is the difference with other embodiments, between each embodiment identical similar portion mutually see.For system disclosed in embodiment or device, because it corresponds to the method disclosed in Example, so description is fairly simple, relevant part illustrates see method part.
Also it should be noted that, in this article, the such as relational terms of first and second grades and so on is only used for an entity or operation to separate with another entity or operational zone, and not necessarily requires or imply the relation that there is any this reality between these entities or operation or sequentially.And, term " comprises ", " comprising " or its any other variant are intended to contain comprising of nonexcludability, thus make to comprise the process of a series of key element, method, article or equipment and not only comprise those key elements, but also comprise other key elements clearly do not listed, or also comprise by the intrinsic key element of this process, method, article or equipment.When not more restrictions, the key element limited by statement " comprising ... ", and be not precluded within process, method, article or the equipment comprising described key element and also there is other identical element.
The software module that the method described in conjunction with embodiment disclosed herein or the step of algorithm can directly use hardware, processor to perform, or the combination of the two is implemented.Software module can be placed in the storage medium of other form any known in random access memory (RAM), internal memory, ROM (read-only memory) (ROM), electrically programmable ROM, electrically erasable ROM, register, hard disk, moveable magnetic disc, CD-ROM or technical field.
To the above-mentioned explanation of the disclosed embodiments, professional and technical personnel in the field are realized or uses the present invention.To be apparent for those skilled in the art to the multiple amendment of these embodiments, General Principle as defined herein can without departing from the spirit or scope of the present invention, realize in other embodiments.Therefore, the present invention can not be restricted to these embodiments shown in this article, but will meet the widest scope consistent with principle disclosed herein and features of novelty.

Claims (12)

1. a control method for web-page requests mode, is characterized in that, described method comprises:
The web-page requests instruction that receiving terminal sends, the web-page requests processing unit obtaining web-page requests mode and will access from described web-page requests instruction;
Obtain the web-page requests mode that the described web-page requests processing unit that will access can process;
Judge the web-page requests mode whether the web-page requests mode obtained from described web-page requests instruction belongs to the described web-page requests processing unit that will access and can process, if, the described web-page requests processing unit that will access then described web-page requests instruction is sent to process, if not, then described web-page requests instruction is refused.
2. method according to claim 1, is characterized in that, described method also comprises:
Pre-set the web-page requests mode that each web-page requests processing unit can process.
3. method according to claim 2, is characterized in that, described in pre-set the web-page requests mode that each web-page requests processing unit can process, comprising:
By adding the instruction preamble comprising the web-page requests mode name that this web-page requests processing unit can process in each web-page requests processing unit, pre-set the web-page requests mode that each web-page requests processing unit can process.
4. method according to claim 3, is characterized in that, the web-page requests mode that the described web-page requests processing unit that will access of described acquisition can process, and comprising:
Read the instruction preamble in the described web-page requests processing unit that will access, resolve the described sequence of instructions of acquisition and call the turn the web-page requests mode name comprised, to obtain the web-page requests mode that the described web-page requests processing unit that will access can process.
5. method according to claim 4, is characterized in that, described parsing obtains described sequence of instructions and calls the turn the web-page requests mode name comprised, and comprising:
Judge that described sequence of instructions calls the turn whether to comprise character string and directly measure, if so whether, judging that described character string is directly measured is web-page requests mode name, if, read the web-page requests mode name that described character string directly measures representative, obtain described sequence of instructions and call the turn the web-page requests mode name comprised.
6. the method according to any one of claim 1-5, it is characterized in that, described web-page requests mode comprises: upgrade request of data, acquisition/data query request, one or more the combination sent in request of data, the request of acquisition function choosing-item, disable access, the whole request method of permission.
7. a control device for web-page requests mode, is characterized in that, described device comprises:
Receiving element, for the web-page requests instruction that receiving terminal sends, the web-page requests processing unit obtaining web-page requests mode and will access from described web-page requests instruction;
Obtain unit, for obtaining the web-page requests mode that the described web-page requests processing unit that will access can process;
Judging unit, for judging the web-page requests mode whether the web-page requests mode obtained from described web-page requests instruction belongs to the described web-page requests processing unit that will access and can process;
Transmitting element, if be yes for the judged result of described judging unit, then sends to the described web-page requests processing unit that will access to process by described web-page requests instruction;
Denied access unit, if be no for the judged result of described judging unit, then refuses described web-page requests instruction.
8. device according to claim 7, is characterized in that, described device also comprises:
Setting unit, for pre-setting the web-page requests mode that each web-page requests processing unit can process.
9. device according to claim 8, is characterized in that, described setting unit specifically for:
By adding the instruction preamble comprising the web-page requests mode name that this web-page requests processing unit can process in each web-page requests processing unit, pre-set the web-page requests mode that each web-page requests processing unit can process.
10. device according to claim 9, is characterized in that, described acquisition unit comprises:
First reads subelement, for reading the instruction preamble in the described web-page requests processing unit that will access;
Resolving subelement, calling the turn the web-page requests mode name comprised, to obtain the web-page requests mode that the described web-page requests processing unit that will access can process for resolving the described sequence of instructions of acquisition.
11. devices according to claim 10, is characterized in that, described parsing subelement comprises:
Whether the first judgment sub-unit, comprise character string directly measure for judging that described sequence of instructions calls the turn;
Second judgment sub-unit, whether if be yes for the judged result of described first judgment sub-unit, judging that described character string is directly measured is web-page requests mode name;
Second reads subelement, if be yes for the judged result of described second judgment sub-unit, reads the web-page requests mode name that described character string directly measures representative, obtains described sequence of instructions and call the turn the web-page requests mode name comprised.
12. methods according to any one of claim 7-11, it is characterized in that, described web-page requests mode comprises: upgrade request of data, acquisition/data query request, one or more the combination sent in request of data, the request of acquisition function choosing-item, disable access, the whole request method of permission.
CN201310744366.5A 2013-12-30 2013-12-30 A kind of control method and device of web-page requests mode Active CN104750728B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310744366.5A CN104750728B (en) 2013-12-30 2013-12-30 A kind of control method and device of web-page requests mode

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310744366.5A CN104750728B (en) 2013-12-30 2013-12-30 A kind of control method and device of web-page requests mode

Publications (2)

Publication Number Publication Date
CN104750728A true CN104750728A (en) 2015-07-01
CN104750728B CN104750728B (en) 2019-04-26

Family

ID=53590427

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310744366.5A Active CN104750728B (en) 2013-12-30 2013-12-30 A kind of control method and device of web-page requests mode

Country Status (1)

Country Link
CN (1) CN104750728B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105930735A (en) * 2016-04-22 2016-09-07 北京奇虎科技有限公司 File reinforcement method and device
CN109587240A (en) * 2018-12-03 2019-04-05 北京容联易通信息技术有限公司 A kind of request retransmission method and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030037253A1 (en) * 2001-04-27 2003-02-20 Arthur Blank Digital rights management system
CN101667115A (en) * 2008-09-02 2010-03-10 中国移动通信集团公司 Terminal, system and method for deploying client application
CN102685081A (en) * 2011-03-17 2012-09-19 腾讯科技(深圳)有限公司 Webpage request safe processing method and system
CN103166977A (en) * 2013-04-16 2013-06-19 福建伊时代信息科技股份有限公司 Method, terminal, server and system for accessing website
CN103475637A (en) * 2013-04-24 2013-12-25 携程计算机技术(上海)有限公司 Network access control method and system based on IP access behaviors

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030037253A1 (en) * 2001-04-27 2003-02-20 Arthur Blank Digital rights management system
CN101667115A (en) * 2008-09-02 2010-03-10 中国移动通信集团公司 Terminal, system and method for deploying client application
CN102685081A (en) * 2011-03-17 2012-09-19 腾讯科技(深圳)有限公司 Webpage request safe processing method and system
CN103166977A (en) * 2013-04-16 2013-06-19 福建伊时代信息科技股份有限公司 Method, terminal, server and system for accessing website
CN103475637A (en) * 2013-04-24 2013-12-25 携程计算机技术(上海)有限公司 Network access control method and system based on IP access behaviors

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105930735A (en) * 2016-04-22 2016-09-07 北京奇虎科技有限公司 File reinforcement method and device
CN105930735B (en) * 2016-04-22 2019-02-05 北京奇虎科技有限公司 A kind of file reinforcement means and device
CN109587240A (en) * 2018-12-03 2019-04-05 北京容联易通信息技术有限公司 A kind of request retransmission method and device

Also Published As

Publication number Publication date
CN104750728B (en) 2019-04-26

Similar Documents

Publication Publication Date Title
CN100440208C (en) A method and system for improving presentation of html pages in web devices
CN102567516B (en) Script loading method and device
CN109902247B (en) Page rendering method and device and electronic equipment
CN111782330B (en) Page data acquisition method, device and equipment based on Web application
CN102789470B (en) The method and apparatus of the picture in loading webpage
KR102090982B1 (en) How to identify malicious websites, devices and computer storage media
CN103383687B (en) A kind of page processing method and device
WO2017071189A1 (en) Webpage access method, apparatus, device and non-volatile computer storage medium
CN108845816A (en) Application program update method, system, computer equipment and storage medium
US8131753B2 (en) Apparatus and method for accessing and indexing dynamic web pages
CN108845950A (en) Test device, the method for test and storage medium
CN111444455B (en) Browser compatible method, system, computer device and storage medium
CN101465866B (en) Method for accessing WAP network based on Web terminal and transition module
CN108173839B (en) Authority management method and system
US9665732B2 (en) Secure Download from internet marketplace
CN110321503B (en) Web component caching method and device and electronic equipment
CN102214224A (en) Network resource access optimizing method, Web page browser and terminal
WO2020155765A1 (en) Data crawling method for mobile terminal, device, mobile terminal, and storage medium
CN107197000B (en) Static and dynamic hybrid caching method, device and system
CN104932910A (en) Method and system for application program interface extension
CN104750728A (en) Method and device for controlling web page request mode
CN109213950B (en) Data processing method and device for browser application of IPTV (Internet protocol television) intelligent set top box
CN103347069A (en) Method and device for realizing network access
CN103914479A (en) Resource request matching method and device
CN103914293A (en) Page generation method and server

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant