CN107566550A - A kind of website URL dynamic creation methods - Google Patents

A kind of website URL dynamic creation methods Download PDF

Info

Publication number
CN107566550A
CN107566550A CN201710960873.0A CN201710960873A CN107566550A CN 107566550 A CN107566550 A CN 107566550A CN 201710960873 A CN201710960873 A CN 201710960873A CN 107566550 A CN107566550 A CN 107566550A
Authority
CN
China
Prior art keywords
url
initial
web server
website
request
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.)
Pending
Application number
CN201710960873.0A
Other languages
Chinese (zh)
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.)
Beijing Zhong Jiao Online Technology Co Ltd
Original Assignee
Beijing Zhong Jiao Online 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 Beijing Zhong Jiao Online Technology Co Ltd filed Critical Beijing Zhong Jiao Online Technology Co Ltd
Priority to CN201710960873.0A priority Critical patent/CN107566550A/en
Publication of CN107566550A publication Critical patent/CN107566550A/en
Pending legal-status Critical Current

Links

Landscapes

  • Information Transfer Between Computers (AREA)

Abstract

The present invention relates to a kind of website URL dynamic creation methods, (1) establishes page address and initial access URL mapping relations on Web server;(2) initial URL is obtained;(3) by Web server obtain needed for initial URL corresponding to source code file;(4) request event is issued, it is URL corresponding to source code file to change initial URL;(5) Web server obtains the new URL addresses of current request change;(6) Web server finds the address value of source code file corresponding to this request, returns to the resource of this request.Pass through the collocation method and programmed logic of the present invention, the programmed logic and website structure in not more new procedures can be realized, simply configure and pack by using regular expression, it is possible to quickly change URL access rules, using our pages of complete customized URL, simple and fast.

Description

A kind of website URL dynamic creation methods
Technical field
The invention belongs to field of computer technology, and in particular to a kind of website URL dynamic creation methods.
Background technology
In the Web page service under using http protocol, Web server is asked by URL (domain name+resource address), Server receives request, the resource according to corresponding to returning to parsing URL addresses, so as to browse info web.Developed in traditional Web In, the corresponding interconnection in a URL address takes the html pages of a physical presence on Web business devices, the name in the URL paths of website The frame structure and design of website are directly connected to, the name in a good URL path, which can not only be reduced, to be optimized In difficulty, while can quickly improve the weight of website, be advantageous to the crawl of search engine, user can be by observing URL's Structure semanticses more easily remember network address.
But website is developed under using traditional server back end language mode, URL addresses corresponding to a page exist After program issue, often fix immutable, it is impossible to which the demand in actual use changes reference address and parameter in time Rule, if necessary to change, then need developer write again code, change programming structure after renewal website can be only achieved effect Fruit.The problem of current website URL is present has 2 points of deficiencies:
General URL is the title of the physical file address of corresponding Web server, when the URL naming rules on website not When being necessarily completely suitable for the naming rule of file when programming framework, it is impossible to easily realize that the relation between both is reflected Penetrate, reach and both take into account.
After website orientation, the access rule that traditional development mode is wanted to change URL is not a simple thing, meaning Taste, which, needs reprogramming logical sum code architecture, then issuing web site program again, could realize the URL before changing.
In now universal backstage development process, configuration route (URL access rules) is regular in a program, it is possible to achieve The simple fuzzy matching of URL and simple custom rule, but once after program issue, it is impossible to arbitrarily change rule, such as Fruit needs to change website URL access rules after distribution, needs reprogramming code again, again issuing web site.
The content of the invention
In view of this, it is an object of the invention to overcome the deficiencies of the prior art and provide a kind of website URL dynamic generation sides Method.
To realize object above, the present invention adopts the following technical scheme that:
A kind of website URL dynamic creation methods, it is theed improvement is that:
(1) page address and initial access URL mapping relations on Web server are established;
(2) initial URL is obtained;
(3) by Web server obtain needed for initial URL corresponding to source code file;
(4) request event is issued, it is URL corresponding to source code file to change initial URL;
(5) Web server obtains the new URL addresses of current request change;
(6) Web server finds the address value of source code file corresponding to this request, returns to the resource of this request.
Preferably, the step (1) is established page address and initial URL mapping relations on Web server and included
Analysis has page address on the Web server of mapping relations with the initial URL, draws analysis result;It is described Analysis result includes at least one of following:The initial URL information of request;Or requesting method information;Or required parameter information.
Preferably, the step (2) is included in after the initial URL for getting user's input is put into URL teams to be climbed by the URL In row, the initial URL is obtained from URL queues to be climbed as its initial static URL.
Preferably, the step (3) includes the architectural features according to Web server, obtains initial URL, and pass through mapping Relation finds its correspondingly initial URL corresponding to the source code file needed for webpage.
Preferably, the step (4) includes issue request event, will be initial according to different identification parameter and specifications parameter URL is changed to URL corresponding to required source code file.
Further, the initial URL is according to the specifications parameter of the request, with initial corresponding to the identification parameter Generation meets the new URL of the specifications parameter based on URL.
Preferably, the step (5) includes the request event that Web server program monitors website in real time, currently please obtain Ask the new URL addresses of change.
Preferably, the step (6) is retrieved including Web server using regular expression from the configuration file of record, The address value of the source code file of the webpage corresponding to this request initial URL is found, the new URL for asking change is provided Source, it is forwarded in the source code file resource of webpage.
Further, the Web server is back to requestor, by new URL reference address, may have access to initial URL The source code file of corresponding webpage.
Further, the requestor can issue request event to Web server in real time.
The present invention uses above technical scheme,
By the collocation method and programmed logic of the present invention, can realize in the not programmed logic of more new procedures and website knot Structure, simply configure and pack by using regular expression, it is possible to quickly change URL access rules, using completely certainly Our pages of the URL of definition, simple and fast!
Brief description of the drawings
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, below will be to embodiment or existing There is the required accompanying drawing used in technology description to be briefly described, it should be apparent that, drawings in the following description are only this Some embodiments of invention, for those of ordinary skill in the art, on the premise of not paying creative work, can be with Other accompanying drawings are obtained according to these accompanying drawings.
Fig. 1 is a kind of website URL dynamic creation method flow charts provided by the invention.
Embodiment
To make the object, technical solutions and advantages of the present invention clearer, technical scheme will be carried out below Detailed description.Obviously, described embodiment is only part of the embodiment of the present invention, rather than whole embodiments.Base Embodiment in the present invention, those of ordinary skill in the art are resulting on the premise of creative work is not made to be owned Other embodiment, belong to the scope that the present invention is protected.
Resource in the resource and Web server of URL request is done mapping relations by the present invention, is changed so as to reach dynamic URL addresses can normally access the scheme of website service.Specially:
The mapping of page address and initial access URL on Web server are established in a kind of website URL dynamic creation methods, (1) Relation;(2) initial URL is obtained;(3) by Web server obtain needed for initial URL corresponding to source code file;(4) issue please Event is sought, it is URL corresponding to source code file to change initial URL;(5) Web server obtains the new URL of current request change Address;(6) Web server finds the address value of source code file corresponding to this request, returns to the resource of this request.
Such as:Station address:http://www.zjzx.cn/news/info-183.html, the traditional net in news address Address, easily efficiently can be made into http by inconvenience of standing at will change by the present invention://www.zjzx.cn/ TodayNews/info-183.html, also can correctly it access, without developing program again.
In above-mentioned technical proposal, the step (1) establishes page address and initial URL mapping relations on Web server Including
Analysis has page address on the Web server of mapping relations with the initial URL, draws analysis result;It is described Analysis result includes at least one of following:The initial URL information of request;Or requesting method information;Or required parameter information.
In above-mentioned technical proposal, the URL is put into by the step (2) after being included in the initial URL for getting user's input In URL queues to be climbed, the initial URL is obtained from URL queues to be climbed as its initial static URL.
In above-mentioned technical proposal, the step (3) includes the architectural features according to Web server, obtains initial URL, and Initial URL corresponding to source code file needed for its corresponding webpage is found by mapping relations.
In above-mentioned technical proposal, the step (4) includes issue request event, is joined according to different identification parameter and specification Number, initial URL is changed to URL corresponding to required source code file.
In above-mentioned technical proposal, the initial URL is according to the specifications parameter of the request, with corresponding to the identification parameter Generation meets the new URL of the specifications parameter based on initial URL.
In above-mentioned technical proposal, the step (5) includes the request event that Web server program monitors website in real time, obtains The new URL addresses for taking current request to change.
In above-mentioned technical proposal, the step (6) utilizes configuration file of the regular expression from record including Web server Middle retrieval, the address value of this request initially source code file of the webpage corresponding to URL is found, the new of change will be asked URL resources, be forwarded in the source code file resource of webpage.
In above-mentioned technical proposal, the Web server is back to requestor, by new URL reference address, may have access to just The source code file of webpage corresponding to beginning URL.
In above-mentioned technical proposal, the requestor can issue request event to Web server in real time.
It is of the invention compared with the URL rules generated after present Website development, it is more flexible, website can not updated, do not changed On the premise of becoming programmed logic, arbitrarily configuration, easily change URL access rules.Can be with the page address of a website By the allocation plan of the present invention, allow page address to change, make new address into come the Website page before accessing, without Need from new issuing web site and more new procedures.
Embodiment
Can not dynamically it be changed at any time for current URL naming rules, and the programming language and program knot for being difficult to and using The shortcomings of structure departs from, the present invention propose a kind of URL generation allocation plans based on configuration file, mainly included the following steps that:
Step 1:Having configured the actual file address on Web server and we needs the mapping of the URL addresses after changing Relation!Such as:http://www.taobao.com/shopping/detailed.html the URL point to the detailed of commodity Information page, but during activity, it is desirable to this kind of commodity are divided into the commodity of ' promotion ' class, access and chain in URL Embody the meaning of ' promotion ', then we just need to change URL access rule to realize this demand, and specific URL is visited Ask that form is as follows:http://www.taobao.com/sales/shopping/detailed.htmlId=1, at it On the basis of preceding URL, " sales " this character string has been increased newly, by configuring, the corresponding relation between them is set and is stored in In program.
Step 2:In Web server program, the request event of website is monitored, current request URL addresses are obtained, using just Then expression formula is retrieved from the configuration file of our record, finds the address value of actual file corresponding to this request, please The URL resources asked, are forwarded in actual file resource corresponding to the URL, are then returned to requestor, reach and change URL access Address, the purpose of the URL before accessing.
The foregoing is only a specific embodiment of the invention, but protection scope of the present invention is not limited thereto, any Those familiar with the art the invention discloses technical scope in, change or replacement can be readily occurred in, should all be contained Cover within protection scope of the present invention.Therefore, protection scope of the present invention should be based on the protection scope of the described claims.

Claims (10)

  1. A kind of 1. website URL dynamic creation methods, it is characterised in that:
    (1) page address and initial access URL mapping relations on Web server are established;
    (2) initial URL is obtained;
    (3) by Web server obtain needed for initial URL corresponding to source code file;
    (4) request event is issued, it is URL corresponding to source code file to change initial URL;
    (5) Web server obtains the new URL addresses of current request change;
    (6) Web server finds the address value of source code file corresponding to this request, returns to the resource of this request.
  2. A kind of 2. website URL dynamic creation methods according to claim 1, it is characterised in that:The step (1) is established Page address and initial URL mapping relations include on Web server
    Analysis has page address on the Web server of mapping relations with the initial URL, draws analysis result;The analysis As a result include at least one of following:The initial URL information of request;Or requesting method information;Or required parameter information.
  3. A kind of 3. website URL dynamic creation methods according to claim 1, it is characterised in that:The step (2) is included in The URL is put into URL queues to be climbed after getting the initial URL of user's input, obtained from URL queues to be climbed described initial URL is as its initial static URL.
  4. A kind of 4. website URL dynamic creation methods according to claim 1, it is characterised in that:The step (3) includes root According to the architectural features of Web server, initial URL is obtained, and the source code text needed for its corresponding webpage is found by mapping relations Initial URL corresponding to part.
  5. A kind of 5. website URL dynamic creation methods according to claim 1, it is characterised in that:The step (4) includes hair Cloth request event, according to different identification parameter and specifications parameter, initial URL is changed to URL corresponding to required source code file.
  6. A kind of 6. website URL dynamic creation methods according to claim 5, it is characterised in that:The initial URL is according to institute State the specifications parameter of request, based on initial URL corresponding to the identification parameter generation meet the new of the specifications parameter URL。
  7. A kind of 7. website URL dynamic creation methods according to claim 1, it is characterised in that:The step (5) includes Web server program monitors the request event of website in real time, obtains the new URL addresses of current request change.
  8. A kind of 8. website URL dynamic creation methods according to claim 1, it is characterised in that:The step (6) includes Web server is retrieved using regular expression from the configuration file of record, is found corresponding to this request initial URL The address value of the source code file of webpage, the new URL resources of change will be asked, be forwarded to the source code file resource of webpage In.
  9. A kind of 9. website URL dynamic creation methods according to claim 8, it is characterised in that:The Web server returns To requestor, by new URL reference address, the source code file of webpage corresponding to initial URL may have access to.
  10. A kind of 10. website URL dynamic creation methods according to claim 9, it is characterised in that:The requestor can be real-time Request event is issued to Web server.
CN201710960873.0A 2017-10-13 2017-10-13 A kind of website URL dynamic creation methods Pending CN107566550A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710960873.0A CN107566550A (en) 2017-10-13 2017-10-13 A kind of website URL dynamic creation methods

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710960873.0A CN107566550A (en) 2017-10-13 2017-10-13 A kind of website URL dynamic creation methods

Publications (1)

Publication Number Publication Date
CN107566550A true CN107566550A (en) 2018-01-09

Family

ID=60986188

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710960873.0A Pending CN107566550A (en) 2017-10-13 2017-10-13 A kind of website URL dynamic creation methods

Country Status (1)

Country Link
CN (1) CN107566550A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108595666A (en) * 2018-04-28 2018-09-28 中译语通科技股份有限公司 Dynamic calculates the method for news collection Service Source, information data processing terminal
CN112398736A (en) * 2020-10-20 2021-02-23 南京欣网互联网络科技有限公司 Method and system for realizing dynamic selection of service route according to service parameters

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101163161A (en) * 2007-11-07 2008-04-16 福建星网锐捷网络有限公司 United resource localizer address filtering method and intermediate transmission equipment
CN101662464A (en) * 2008-08-26 2010-03-03 阿里巴巴集团控股有限公司 System for realizing HTTP request service and method thereof
US20130325919A1 (en) * 2012-05-30 2013-12-05 International Business Machines Corporation Resolving a dead shortened uniform resource locator
CN104580540A (en) * 2013-10-09 2015-04-29 腾讯科技(深圳)有限公司 Method and device for achieving website access
CN105681476A (en) * 2016-03-31 2016-06-15 郑州悉知信息科技股份有限公司 Page skipping method, device and system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101163161A (en) * 2007-11-07 2008-04-16 福建星网锐捷网络有限公司 United resource localizer address filtering method and intermediate transmission equipment
CN101662464A (en) * 2008-08-26 2010-03-03 阿里巴巴集团控股有限公司 System for realizing HTTP request service and method thereof
US20130325919A1 (en) * 2012-05-30 2013-12-05 International Business Machines Corporation Resolving a dead shortened uniform resource locator
CN104580540A (en) * 2013-10-09 2015-04-29 腾讯科技(深圳)有限公司 Method and device for achieving website access
CN105681476A (en) * 2016-03-31 2016-06-15 郑州悉知信息科技股份有限公司 Page skipping method, device and system

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108595666A (en) * 2018-04-28 2018-09-28 中译语通科技股份有限公司 Dynamic calculates the method for news collection Service Source, information data processing terminal
CN108595666B (en) * 2018-04-28 2022-03-29 中译语通科技股份有限公司 Method for dynamically calculating news acquisition service resources and information data processing terminal
CN112398736A (en) * 2020-10-20 2021-02-23 南京欣网互联网络科技有限公司 Method and system for realizing dynamic selection of service route according to service parameters
CN112398736B (en) * 2020-10-20 2023-02-21 南京欣网互联网络科技有限公司 Method and system for realizing dynamic selection of service route according to service parameters

Similar Documents

Publication Publication Date Title
He et al. A smart web service based on the context of things
US10942708B2 (en) Generating web API specification from online documentation
CN106445484B (en) The method and system of data tracking are realized by Software Development Kit
Paganelli et al. A web of things framework for restful applications and its experimentation in a smart city
CN105989523B (en) Policy-based data collection processing and negotiation method and system for analytics
US20190190977A1 (en) System and method of automatic generation and insertion of analytic tracking codes
WO2017125020A1 (en) Message processing method, device and system
US20150254328A1 (en) Methods and systems that categorize and summarize instrumentation-generated events
CN103383687B (en) A kind of page processing method and device
CN109194714B (en) File pushing method and device, terminal device and storage medium
CN101937439A (en) Method and system for collecting user access related information
JP2020502610A (en) Allow Semantic Mashups on the Internet of Things
CN106464584A (en) Providing router information according to a programmatic interface
CN108494860A (en) WEB accesses system, WEB access methods and device for client
CN108228796A (en) Management method, device, system, server and the medium of MPP databases
WO2011115471A1 (en) Integrated service delivery platform system and method thereof
Wong et al. Design of a crawler for online social networks analysis
JP4913360B2 (en) Profile management apparatus and computer program
CN107566550A (en) A kind of website URL dynamic creation methods
Shetty et al. An XML based data representation model to discover infrastructure services
JP2006209650A (en) Use right issuing method and use right issuing device
JP2013033333A (en) Business process/business rule execution system, business process/business rule execution method and program
Omrana et al. Template-based matching algorithm for dynamic web services discovery
JP2004334274A (en) Server
Huaranga-Junco et al. From cloud and fog computing to federated-fog computing: A comparative analysis of computational resources in real-time IoT applications based on semantic interoperability

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20180109