CN103268244B - The method and device of load document - Google Patents

The method and device of load document Download PDF

Info

Publication number
CN103268244B
CN103268244B CN201310224052.2A CN201310224052A CN103268244B CN 103268244 B CN103268244 B CN 103268244B CN 201310224052 A CN201310224052 A CN 201310224052A CN 103268244 B CN103268244 B CN 103268244B
Authority
CN
China
Prior art keywords
controller
php
file
loading
php files
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
CN201310224052.2A
Other languages
Chinese (zh)
Other versions
CN103268244A (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.)
Qax Technology Group Inc
Original Assignee
Beijing Qihoo Technology Co Ltd
Qizhi Software Beijing 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 Qihoo Technology Co Ltd, Qizhi Software Beijing Co Ltd filed Critical Beijing Qihoo Technology Co Ltd
Priority to CN201310224052.2A priority Critical patent/CN103268244B/en
Publication of CN103268244A publication Critical patent/CN103268244A/en
Application granted granted Critical
Publication of CN103268244B publication Critical patent/CN103268244B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

Embodiment of the invention discloses that a kind of method and device of load document, wherein this method include:Obtain the routing configuration information of controller and need the identification information of load document;According to routing configuration information, corresponding controller configuration information is found;According to controller configuration information, controller corresponding to loading;Controller finds the file corresponding with needing the identification information of load document according to the identification information of file and the corresponding relation of file;And the file that finds of controller loading, by above-mentioned file load mode, the efficiency of load document can be effectively improved.

Description

The method and device of load document
Technical field
The invention belongs to field of computer technology, more particularly to a kind of method and device of load document.
Background technology
PHP, i.e. " Professional Hypertext Preprocessor, HyperText Preprocessor ", it is a kind of wide The Common scripting languages of increasing income of general application, the Web that is particularly suitable for use in are developed and can be embedded in HTML(Hypertext Markup Language, HTML)In.PHP files are that PHP Web program development is swung on streamline, to help promotion Fast software development.
The technical scheme of existing loading PHP files is the parameter according to acquisition(Such as:action、option、label Deng)The filename that need to be loaded is spliced into, then the file according to needed for loading filename.However, due in existing loading PHP Loading can all carry out multiple loading judgement every time during file, such as judge whether parameter is empty, and judge the legal of parameter Property, thus cause the less efficient of existing loading PHP files.
The content of the invention
In order to solve the problems, such as the less efficient of above-mentioned existing loading PHP files, embodiments of the invention propose one The method and device of kind load document so that when requiring to look up file, can quickly be found by corresponding relation corresponding File, so as to effectively improve the efficiency of load document.
One side according to embodiments of the invention, there is provided a kind of method of load document, including:Obtain controller Routing configuration information and need the identification information of load document;According to routing configuration information, find corresponding controller and match somebody with somebody Confidence ceases;According to controller configuration information, controller corresponding to loading;Controller is according to the identification information of file and pair of file It should be related to, find the file corresponding with needing the identification information of load document;The file that controller loading is found.
Another aspect according to an embodiment of the invention, there is provided a kind of device of load document, device include:Obtain mould Block, for obtaining the routing configuration information of controller;First matching module, for according to routing configuration information, finding correspondingly Controller configuration information;First load-on module, for according to controller configuration information, controller corresponding to loading;Second With module, for the identification information and the corresponding relation of file according to file, the identification information of load document is found and needed Corresponding file;And second load-on module, for loading the file found.
The method of load document according to an embodiment of the invention and the device of load document, in file loading procedure, Controller can be found corresponding with needing the identification information of load document according to the identification information of file and the corresponding relation of file File, overcoming controller in the prior art needs to carry out the problem of multiple loading judges.By the mark thus according to file Know the corresponding relation locating file of information and file, when requiring to look up file, can quickly be found by corresponding relation pair The file answered, so as to effectively improve the efficiency of load document.
Described above is only the general introduction of technical solution of the present invention, in order to better understand the technological means of the present invention, And can be practiced according to the content of specification, and in order to allow above and other objects of the present invention, feature and advantage can Become apparent, below especially exemplified by the embodiment of the present invention.
Brief description of the drawings
By reading the detailed description of hereafter preferred embodiment, it is various other the advantages of and benefit it is common for this area Technical staff will be clear understanding.Accompanying drawing is only used for showing the purpose of preferred embodiment, and is not considered as to the present invention Limitation.And in whole accompanying drawing, identical part is denoted by the same reference numerals.In the accompanying drawings:
Fig. 1 shows the flow chart of the method for load document according to an embodiment of the invention;
Fig. 2 shows the schematic diagram of loading recording document middle according to one embodiment of present invention;And
Fig. 3 shows the schematic diagram of the device of the load document according to another embodiment of the invention.
Embodiment
The exemplary embodiment of the disclosure is more fully described below with reference to accompanying drawings.Although the disclosure is shown in accompanying drawing Exemplary embodiment, it being understood, however, that may be realized in various forms the disclosure without should be by embodiments set forth here Limited.On the contrary, these embodiments are provided to facilitate a more thoroughly understanding of the present invention, and can be by the scope of the present disclosure Completely it is communicated to those skilled in the art.
Existing file loading scheme is all to access index.php(Homepage)Afterwards, controller is entered directly into(Control Device processed), corresponding Model is then found by computing by Controller(Model)And View(View).However, Controller calculating process is the part that performance is most consumed during whole load document, and it needs to carry out multiple loading Judge, cause the less efficient of load document.
Therefore, the embodiment provides the routing configuration of a kind of method of load document, first acquisition controller Information;Then according to routing configuration information, corresponding controller configuration information is found;Further according to controller configuration information, add Controller corresponding to load;Then controller finds according to the identification information of file and the corresponding relation of file and needs to load File corresponding to the identification information of file;The file finally found by controller loading.
Illustrate with reference to Fig. 1 according to an embodiment of the invention, literary suitable for solving the loading of above-mentioned technical problem The flow chart of the method for part.
As shown in figure 1, the method for the present invention starts from step S110, in step s 110, the routing configuration of controller is obtained Information and the identification information for needing load document.Alternatively, routing configuration information includes:Customized route title and route Loading sequence.
For example, in load document, index.php is accessed first(Homepage), then obtain controller routing configuration letter Cease and need the identification information of load document.Alternatively, the identification information of file is the keyword of file, alternatively, keyword Match with the function of load document, such as during loading news file, keyword can be news.
Then, in step s 130, according to routing configuration information, corresponding controller configuration information is found.Alternatively, It is route by file(File route)Module controller according to corresponding to being found routing configuration information configures(Controller config)Information.Alternatively, controller configuration information includes:The loading sequence of customized controller title and controller.
Then, in step S150, according to controller configuration information, controller corresponding to loading.After the completion of loading, in step In rapid S170, controller finds and needed the mark of load document according to the identification information of file and the corresponding relation of file File corresponding to information.
In an embodiment of the present invention, the identification information of file and the corresponding relation of file can be pre-established.Such as file Identification information and the corresponding relation of file customized key can be used(Key)-value(Value)The pattern table of distributed storage Show, wherein key represents the identification information of file, and keyword value represents file.Due to key-value distributed memory systems Inquiry velocity is fast, when requiring to look up file, can quickly find corresponding file by above-mentioned customized corresponding relation.
Then, in step S190, controller loads the file found.Alternatively, file includes:Model and/or regard Figure.
It should be noted that although describing the operation of the method for load document with particular order in Fig. 1, still, this These operations must be performed according to the particular order by not requiring that or implying, or have to carry out the operation ability shown in whole Realize desired result.On the contrary, the step of describing in flow chart can change execution sequence.Additionally or alternatively, it is convenient to omit Some steps, multiple steps are merged into a step and performed, and/or a step is decomposed into execution of multiple steps.
All it is to access index.php in the scheme of existing load document(Homepage)Afterwards, enter directly into Controller(Controller).Then by Controller computings, corresponding Model is found(Model)And View(View), Then the loading of file is carried out.But Controller computing is that the part of performance is most consumed in whole file loading procedure. And in an embodiment of the present invention, as shown in Fig. 2 accessing index.php(Homepage)After 201, File route can be entered (File is route)Module 203, File route modules 203 read and include route(Route)The Route config of constant(Route Configuration)File 205, according to Route config files 205 and Controller config(Controller configures)File 207 is looked into Ask corresponding Controller(Controller)209, Controller209 use key(Key)>value(Value)Find correspondingly File, wherein key can represent the identification information of file, and value can represent file, then load this document, due to Controller209 uses key>Value modes, caused operand can be preferably minimized, effectively improve loading text The speed of service of part process.
Alternatively, realize that the code of file loading is as follows:
Index.php//homepage;
include“route.php”;// loading route
Route.config.php//configuration route
Route.php//route
include”route/route.config.php”;// loading routing configuration
$controller=$routeArr[$action][$do]?($action.’_’.$do):’ default.php’;// follow-up routing configuration finds controller controller files
Include($controller);// Loading Control device
Action_do.php//controller
Include‘controller.php’;// Loading Control device configures
Include’view.php’;// loading view
Finally return to implementing result.
Illustrate with reference to Fig. 3 according to one embodiment of the invention, suitable for solving a kind of loading text of above-mentioned technical problem The device of part.
As shown in figure 3, being the schematic diagram of the device of load document in embodiments of the invention, the device includes:Obtain mould Block 301, the first matching module 303, the first load-on module 305, the second matching module 307 and the second load-on module 309, wherein obtaining Modulus block 301 is used for the routing configuration information for obtaining controller;First matching module 303 is used for according to routing configuration information, looks into Find corresponding controller configuration information;First load-on module 305 is used for according to controller configuration information, loads corresponding control Device;Second matching module 307 is used for according to the identification information of file and the corresponding relation of file, finds and needs load document File corresponding to identification information;And second load-on module 309 be used to load the file that finds.Alternatively, file includes: Model and/or view.
In another embodiment of the invention, device also includes:Configuration module, for pre-establishing the identification information of file With the corresponding relation of file.Such as corresponding relation is represented with the pattern of key-value distributed storages, wherein key represents file Identification information, alternatively, the identification information of file is the keyword for the file to be loaded, and value represents file.
According to the method for load document and the device of load document of the present invention, in file loading procedure, controller can According to the identification information of file and the corresponding relation of file, the file corresponding with needing the identification information of load document is found, Overcoming controller in the prior art needs to carry out the problem of multiple loading judges.By the identification information thus according to file with The corresponding relation locating file of file, when requiring to look up file, corresponding file can quickly be found by corresponding relation, So as to effectively improve the efficiency of load document.
Algorithm and display be not inherently related to any certain computer, virtual system or miscellaneous equipment provided herein. Various general-purpose systems can also be used together with teaching based on this.As described above, required by constructing this kind of system Structure be obvious.In addition, the present invention is not also directed to any certain programmed language.It should be understood that it can utilize various Programming language realizes the content of invention described herein, and the description done above to language-specific is to disclose this hair Bright preferred forms.
In the specification that this place provides, numerous specific details are set forth.It is to be appreciated, however, that the implementation of the present invention Example can be put into practice in the case of these no details.In some instances, known method, structure is not been shown in detail And technology, so as not to obscure the understanding of this description.
Similarly, it will be appreciated that in order to simplify the disclosure and help to understand one or more of each inventive aspect, Above in the description to the exemplary embodiment of the present invention, each feature of the invention is grouped together into single implementation sometimes In example, figure or descriptions thereof.However, the method for the disclosure should be construed to reflect following intention:I.e. required guarantor The application claims of shield features more more than the feature being expressly recited in each claim.It is more precisely, such as following Claims reflect as, inventive aspect is all features less than single embodiment disclosed above.Therefore, Thus the claims for following embodiment are expressly incorporated in the embodiment, wherein each claim is in itself Separate embodiments all as the present invention.
Those skilled in the art, which are appreciated that, to be carried out adaptively to the module in the equipment in embodiment Change and they are arranged in one or more equipment different from the embodiment.Can be the module or list in embodiment Member or component be combined into a module or unit or component, and can be divided into addition multiple submodule or subelement or Sub-component.In addition at least some in such feature and/or process or unit exclude each other, it can use any Combination is to this specification(Including adjoint claim, summary and accompanying drawing)Disclosed in all features and so disclosed appoint Where all processes or unit of method or equipment are combined.Unless expressly stated otherwise, this specification(Including adjoint power Profit requirement, summary and accompanying drawing)Disclosed in each feature can be by providing the alternative features of identical, equivalent or similar purpose come generation Replace.
In addition, it will be appreciated by those of skill in the art that although some embodiments described herein include other embodiments In included some features rather than further feature, but the combination of the feature of different embodiments means in of the invention Within the scope of and form different embodiments.For example, in the following claims, embodiment claimed is appointed One of meaning mode can use in any combination.
The all parts embodiment of the present invention can be realized with hardware, or to be run on one or more processor Software module realize, or realized with combinations thereof.It will be understood by those of skill in the art that it can use in practice Microprocessor or digital signal processor(DSP)To realize some in the device of load document according to embodiments of the present invention Or some or all functions of whole parts.The present invention be also implemented as perform method as described herein one Partly or completely equipment or program of device(For example, computer program and computer program product).It is such to realize this The program of invention can store on a computer-readable medium, or can have the form of one or more signal.So Signal can download and obtain from internet website, either provide on carrier signal or provided in the form of any other.
It should be noted that the present invention will be described rather than limits the invention for above-described embodiment, and ability Field technique personnel can design alternative embodiment without departing from the scope of the appended claims.In the claims, Any reference symbol between bracket should not be configured to limitations on claims.Word "comprising" does not exclude the presence of not Element or step listed in the claims.Word "a" or "an" before element does not exclude the presence of multiple such Element.The present invention can be by means of including the hardware of some different elements and being come by means of properly programmed computer real It is existing.In if the unit claim of equipment for drying is listed, several in these devices can be by same hardware branch To embody.The use of word first, second, and third does not indicate that any order.These words can be explained and run after fame Claim.

Claims (10)

  1. A kind of 1. method of loading PHP files, it is characterised in that methods described includes:
    Obtain the routing configuration information of controller and need to load the identification information of PHP files, the routing configuration information includes The loading sequence of customized route title and route;
    According to the routing configuration information, corresponding controller configuration information is found, the controller configuration information includes control The loading sequence of device processed;
    According to the controller configuration information, controller corresponding to loading;
    The controller finds according to the identification information of PHP files and the corresponding relation of PHP files and needs to load PHP texts PHP files corresponding to the identification information of part;
    The PHP files that the controller is found according to loading sequence loading.
  2. 2. according to the method for claim 1, it is characterised in that the file is PHP files, wherein the PHP files bag Include:Model and/or view.
  3. 3. according to the method for claim 1, it is characterised in that methods described also includes:
    Pre-establish the identification information of PHP files and the corresponding relation of PHP files.
  4. 4. according to the method for claim 3, it is characterised in that the corresponding relation is with key-value distributed storages Pattern represents that wherein key represents the identification information of PHP files, and value represents PHP files.
  5. 5. the method according to any one of claims 1 to 4, it is characterised in that the identification information of the PHP files is PHP The keyword of file.
  6. 6. a kind of device of loading PHP files, it is characterised in that described device includes:
    Acquisition module, for obtaining the routing configuration information of controller, the routing configuration information includes customized route name The loading sequence for claiming and routeing;
    First matching module, for according to the routing configuration information, finding corresponding controller configuration information, the control Device configuration information includes the loading sequence of controller;
    First load-on module, for according to the controller configuration information, controller corresponding to loading;
    Second matching module, for the identification information according to PHP files and the corresponding relation of PHP files, find with needing to add Carry PHP files corresponding to the identification information of PHP files;
    Second load-on module, for the PHP files found according to loading sequence loading.
  7. 7. device according to claim 6, it is characterised in that the PHP files include:Model and/or view.
  8. 8. device according to claim 6, it is characterised in that described device also includes:
    Configuration module, for pre-establishing the identification information of PHP files and the corresponding relation of PHP files.
  9. 9. device according to claim 8, it is characterised in that the corresponding relation is with key-value distributed storages Pattern represents that wherein key represents the identification information of PHP files, and value represents PHP files.
  10. 10. according to any described device in claim 6~9, it is characterised in that the identification information of the PHP files is PHP The keyword of file.
CN201310224052.2A 2013-06-06 2013-06-06 The method and device of load document Active CN103268244B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310224052.2A CN103268244B (en) 2013-06-06 2013-06-06 The method and device of load document

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310224052.2A CN103268244B (en) 2013-06-06 2013-06-06 The method and device of load document

Publications (2)

Publication Number Publication Date
CN103268244A CN103268244A (en) 2013-08-28
CN103268244B true CN103268244B (en) 2017-12-26

Family

ID=49011877

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310224052.2A Active CN103268244B (en) 2013-06-06 2013-06-06 The method and device of load document

Country Status (1)

Country Link
CN (1) CN103268244B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110874211A (en) * 2018-09-04 2020-03-10 北京奇虎科技有限公司 PHP file access method and device
CN109600311B (en) * 2018-11-28 2022-01-04 武汉斗鱼网络科技有限公司 Routing method, device, server, terminal and readable medium based on PHP language

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1741532A (en) * 2005-09-12 2006-03-01 林兴陆 Intelligent network frame apparatus
CN102364891A (en) * 2011-09-13 2012-02-29 杭州华三通信技术有限公司 Method for upgrading software of embedded Ethernet equipment and embedded Ethernet equipment
CN102916836A (en) * 2012-10-18 2013-02-06 北京奇虎科技有限公司 Method and system for carrying out safety monitoring on monitored terminals

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2184688A1 (en) * 2008-11-06 2010-05-12 Amadeus s.a.s Method of integrating in real time large volumes of updates in a database
US9418169B2 (en) * 2009-10-14 2016-08-16 Blackberry Limited Extracting document data from multiple sources for display on a mobile communication device using HTTP request headers having XML strings therein
CN101872305B (en) * 2010-06-08 2013-01-09 用友软件股份有限公司 UI (User Interface) performance and service logic separation method and system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1741532A (en) * 2005-09-12 2006-03-01 林兴陆 Intelligent network frame apparatus
CN102364891A (en) * 2011-09-13 2012-02-29 杭州华三通信技术有限公司 Method for upgrading software of embedded Ethernet equipment and embedded Ethernet equipment
CN102916836A (en) * 2012-10-18 2013-02-06 北京奇虎科技有限公司 Method and system for carrying out safety monitoring on monitored terminals

Also Published As

Publication number Publication date
CN103268244A (en) 2013-08-28

Similar Documents

Publication Publication Date Title
US10162738B2 (en) System, method, and computer readable medium for universal software testing
Buels et al. JBrowse: a dynamic web platform for genome visualization and analysis
US8370799B2 (en) Provision of code base modification using automatic learning of code changes
TWI364677B (en) Method, system, and apparatus for discovering and connecting to data sources
CN103632100B (en) A kind of website vulnerability detection method and device
US20160306612A1 (en) Determining errors and warnings corresponding to a source code revision
US7904809B2 (en) Model-based editors for dynamic validation
CN104915595A (en) Virtualization bug fixing method and device through cloud platform
CN101770365A (en) Method and system for collaborative development of visualization dashboards
CN105183760A (en) Webpage component loading method and apparatus
US8312048B2 (en) Database application navigation
US11354341B2 (en) System and method for translating a software query in an automated integration process into natural language
CN112947960A (en) Risk model deployment method and system based on machine learning
CN103268244B (en) The method and device of load document
Hussain et al. Approaches for simulation model reuse in systems design—A review
CN110069455B (en) File merging method and device
US9679092B1 (en) Constraint handling for parameterizable hardware description language
Kaleeswaran et al. A domain specific language to support HAZOP studies of SysML models
Lazarus et al. Creating reusable tools from scripts: the Galaxy Tool Factory
Henzinger et al. The BLAST software verification system
US10949327B2 (en) Manipulation of complex variables in orchestration applications
CN109697141B (en) Method and device for visual testing
CN105653513A (en) Pig farm management based form input method and system
Hasanagić et al. Formalising and Validating the Interface Description in the FMI standard
US10120968B1 (en) System and method for hierarchical library searching

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
CP01 Change in the name or title of a patent holder
CP01 Change in the name or title of a patent holder

Address after: 100088 room 112, block D, 28 new street, new street, Xicheng District, Beijing (Desheng Park)

Co-patentee after: Beijing Qizhi Business Consulting Co.,Ltd.

Patentee after: BEIJING QIHOO TECHNOLOGY Co.,Ltd.

Address before: 100088 room 112, block D, 28 new street, new street, Xicheng District, Beijing (Desheng Park)

Co-patentee before: Qizhi software (Beijing) Co.,Ltd.

Patentee before: BEIJING QIHOO TECHNOLOGY Co.,Ltd.

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20190116

Address after: 100015 15, 17 floor 1701-26, 3 building, 10 Jiuxianqiao Road, Chaoyang District, Beijing.

Patentee after: BEIJING QIANXIN TECHNOLOGY Co.,Ltd.

Address before: 100088 room 112, block D, 28 new street, new street, Xicheng District, Beijing (Desheng Park)

Co-patentee before: Beijing Qizhi Business Consulting Co.,Ltd.

Patentee before: BEIJING QIHOO TECHNOLOGY Co.,Ltd.

CP03 Change of name, title or address
CP03 Change of name, title or address

Address after: 100032 NO.332, 3rd floor, Building 102, 28 xinjiekouwai street, Xicheng District, Beijing

Patentee after: QAX Technology Group Inc.

Address before: 100015 15, 17 floor 1701-26, 3 building, 10 Jiuxianqiao Road, Chaoyang District, Beijing.

Patentee before: BEIJING QIANXIN TECHNOLOGY Co.,Ltd.