CN109408107B - Method for improving retrieval speed based on education system and electronic equipment - Google Patents

Method for improving retrieval speed based on education system and electronic equipment Download PDF

Info

Publication number
CN109408107B
CN109408107B CN201811172315.9A CN201811172315A CN109408107B CN 109408107 B CN109408107 B CN 109408107B CN 201811172315 A CN201811172315 A CN 201811172315A CN 109408107 B CN109408107 B CN 109408107B
Authority
CN
China
Prior art keywords
file
matching
party library
folder
converter
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
CN201811172315.9A
Other languages
Chinese (zh)
Other versions
CN109408107A (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.)
Shenzhen Dianmao Technology Co Ltd
Original Assignee
Shenzhen Dianmao 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 Shenzhen Dianmao Technology Co Ltd filed Critical Shenzhen Dianmao Technology Co Ltd
Priority to CN201811172315.9A priority Critical patent/CN109408107B/en
Publication of CN109408107A publication Critical patent/CN109408107A/en
Application granted granted Critical
Publication of CN109408107B publication Critical patent/CN109408107B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Abstract

The invention discloses a method for improving retrieval speed based on an education system and electronic equipment, wherein the method comprises the following steps: A. reading the converter configuration of a module packer in advance, and setting file matching information through the converter configuration; B. designating a folder directory of the third party library as a folder under the root directory, and designating a priority matching entry file of the third party library as main. The method adds a plurality of optimized query modes for the imported file, skips some additional recursive analysis operations, and reduces the pause feeling of the card and the performance consumption. And meanwhile, a matched folder is designated, the matching range is narrowed, and the purpose of optimizing the performance is achieved.

Description

Method for improving retrieval speed based on education system and electronic equipment
Technical Field
The invention relates to the technical field of computers, in particular to a method for improving retrieval speed based on an education system and electronic equipment.
Background
Webpack is a front-end resource loading/packaging tool, which performs static analysis according to the dependency relationship of modules, and then generates corresponding static resources according to specified rules by the modules. Webpack can convert multiple static resources js, css and less into a static file, and reduces page requests. That is, Webpack analyzes the project structure, finds out the development language (Scss, TypeScript, etc.) that the JavaScript module and some other browsers cannot directly run, and converts and packages the development language into a suitable format for the browser to use. However, when the existing webpack imports a file, the webpack searches for corresponding directories from an upper level in sequence according to the imported file, and after a project is large, the performance consumption and the click feeling are obvious. For example, in the field of education, the operation of importing files by webpack is very common, so a scheme for improving the retrieval speed is urgently needed.
Accordingly, the prior art is yet to be improved and developed.
Disclosure of Invention
In view of the above disadvantages of the prior art, an object of the present invention is to provide a method for improving a search speed by an educational system and an electronic device, which are intended to solve the problems of the prior art, such as easy jamming and high performance consumption when a module wrapper imports a file.
The technical scheme of the invention is as follows:
a method for improving retrieval speed based on an education system, which comprises the following steps:
A. reading the converter configuration of a module packer in advance, and setting file matching information through the converter configuration;
B. designating a folder directory of the third party library as a folder under the root directory, and designating a priority matching entry file of the third party library as main.
The method for improving retrieval speed based on the education system, wherein the setting file matching information comprises a cacheDirectory option for setting the converter, enabling the converter to support cache conversion, and modifying an include parameter of the converter to narrow a matching range.
The method for improving retrieval speed based on the education system, wherein the setting of the file matching information further comprises removing the multi-file matching configuration.
In the method for improving the retrieval speed based on the educational system, in the step B, the folder directory of the third party library is designated as the folder under the root directory by configuring the solve.
The method for improving the retrieval speed based on the education system, wherein the step B further comprises the following steps: suffixes are omitted when modules that import the same suffix are provided.
The method for improving the retrieval speed based on the education system, wherein the step B further comprises the following steps: the arrangement is such that the matching is performed using a relatively short suffix at the matching module.
The method for improving the retrieval speed based on the education system, wherein the step B further comprises the following steps: setting to not parse a predetermined third party library.
An electronic device, comprising:
a processor adapted to implement the instructions, an
A storage device adapted to store a plurality of instructions, the instructions adapted to be loaded and executed by a processor to:
reading the converter configuration of a module packer in advance, and setting file matching information through the converter configuration;
designating a folder directory of the third party library as a folder under the root directory, and designating a priority matching entry file of the third party library as main.
A non-transitory computer-readable storage medium having stored thereon computer-executable instructions that, when executed by one or more processors, cause the one or more processors to perform the method of improving retrieval speed based on an educational system.
A computer program product, wherein the computer program product comprises a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions which, when executed by a processor, cause the processor to perform the method of improving the speed of retrieval based on an educational system.
Has the advantages that: the method adds a plurality of optimized query modes for the imported file, skips some additional recursive analysis operations, and reduces the pause feeling of the card and the performance consumption. And meanwhile, a matched folder is designated, the matching range is narrowed, and the purpose of optimizing the performance is achieved.
Drawings
FIG. 1 is a flowchart of a method for increasing search speed according to an embodiment of the present invention.
Fig. 2 is a block diagram of an electronic device according to a preferred embodiment of the invention.
Detailed Description
The present invention provides a method for improving search speed based on an educational system and an electronic device, and the present invention is further described in detail below in order to make the purpose, technical solution and effect of the present invention clearer and clearer. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Referring to fig. 1, fig. 1 is a flowchart illustrating a method for increasing a search speed according to a preferred embodiment of the present invention, which includes the steps of:
s1, reading the converter configuration of the module packer in advance, and setting file matching information through the converter configuration;
s2, designating the folder directory of the third party library as the folder under the root directory, and designating the priority matching entry file of the third party library as main.
The method adds a plurality of optimized query modes for the imported file, skips some additional recursive analysis operations, and reduces the pause feeling of the card and the performance consumption. And meanwhile, a matched folder is designated, the matching range is narrowed, and the purpose of optimizing the performance, namely the purpose of improving the retrieval speed of the module packer is achieved.
In step S1, the converter configuration of the module packer is read first. The file matching information is set by the converter configuration.
The setting of the file matching information specifically comprises setting a cacheDirectory option of the converter, enabling the converter to support cache conversion, and modifying an include parameter of the converter to narrow a matching range.
The converter is a loader (or a loader), and the loader is used for converting the source code of the module, so that the file is preprocessed when the module is imported or "loaded". loaders are similar to "tasks" in other build tools and provide a powerful way to handle front-end build steps.
For example, vue-loader is a Webpack loader that can convert Vue components written in a specified format into JavaScript modules.
The characteristics of the loader are: the loaders can be connected in series and applied to pipeline resources, the last loader returns javascript, and other loaders can return any format (transmitted to the next loader); loaders can be synchronous or asynchronous; loaders run under nodejs and can be used as all possible loader acceptance parameters for configuration; loaders can bind to extension/RegExps configurations; loaders can publish and install normal modules at npm, one at a time; loaders can access configuration plugins besides loaders to give loaders more features; loaders may release any additional files.
The loader mainly comprises: loader for preprocessing and loader for js processing. Wherein the preprocessed loader comprises: the css-loader can solve the problems of path reference and the like in the css; style-loader, which can dynamically write the style into cs; sass-loader, scss compiler; less-loader, less compiler; postcss-loader, scss reprocessing.
The loader processed by js mainly comprises the following steps: babel-loader, which can convert ES6 code; jsx-loader can recognize jsx syntax in js
Other loader loaders mainly include: the url-loader is used for processing an npm install-save-dev url-loader; the file-loader is used for loading an npm instance-save-dev file-loader; the json-loader is used for json processing npm install-save-dev json-loader; raw-loader for html processing npm install-save-dev raw-loader
loaders is an array, each object in the array uses a regular expression, and a pairing scheme is corresponding to the regular expression. The loader is used for loading different files into the js file, for example, the url-loader is used for loading the png/jpg format picture file in js; the css/style loader is used for loading css files; the less-loader compiles less into cs files; different processors pass! Separated and connected in series.
The cacheDirectory option of the converter is set because the cache is performed in the loader conversion process, the cache is read before each conversion, and if the cache result exists, the cache result is directly fetched without extra repeated calculation.
The cacheDirectory default is false. If this parameter is set, the converted result will be buffered.
When webpack is compiled again, it will first try to read the translation result (i.e. the cached result) from the cache, thereby avoiding wasting resources.
If the value is null (loader: 'babel-loader directory'), the loader will use the system default temporary file directory.
And modifying the include parameter of the converter to narrow the matching range so as to only match the specified folder, but directly ignore other folders, narrow the matching range and accelerate the matching speed. Files (folders) which have to be processed can be added through an include parameter, and files (folders) which do not need to be processed can be shielded through an include parameter.
In addition, setting the file matching information further includes removing the multi-file matching configuration. For example, in the case of a match jsx, if there is no jsx file, then only js needs to be matched, thus removing jsx the compatible settings of the match.
In the step S2, the folder directory of the third party library is designated as the folder under the root directory, and the priority matching entry file of the third party library is designated as main.
Modules, in particular, specify the folder directory of the third party library as the folder under the root directory by configuring the reset. Thus, when the third-party module is loaded, the folder under the root directory can be directly searched without extra query time.
Modules are directories that should be searched when telling the webpack resolution module. Both absolute and relative paths can be used, but there is also a difference: by looking at the current directory and ancestor paths (i.e./Node _ modules,./Node _ modules, etc.), the relative paths will be looked up in a manner similar to Node looking up 'Node _ modules'. Using absolute paths, only a given directory will be searched.
The method comprises the steps that the prior matching entry file of the third-party library is designated as main.js, so when the third-party module is loaded, the webpack can find the main.js preferentially, the file is tried to be matched as the entry file, the module is loaded if the matching is successful, the real entry file is continuously and recursively inquired if the matching is failed, and a great deal of time can be saved by adopting the method because most of the entry files of the third-party library are main.js. Js is the entry provided to webpack, which packages the files used to retrieve by main. Js, for example, imported vue, then webpack would find vue files to pack.
Further, the step S2 further includes: suffixes are omitted when modules that import the same suffix are provided.
Further, the step S2 further includes: the arrangement is such that the matching is performed using a relatively short suffix at the matching module. For example, for js and json, js matching can be used directly, and when a module is introduced, js and json are not introduced, but directly introduced, so that repeated matching is not caused during matching, and the matching time is reduced.
Further, the step S2 further includes: setting to not parse a predetermined third party library.
Some third party libraries are already mature, such as exact. js and jquery. js, and compressed files do not use modularization, so webpack requires additional parsing time, sets it to be unresolved, and reads the file directly by the browser, thereby reducing the additional parsing time.
Act is a JAVASCRIPT library used to construct user interfaces. React is mainly used to construct UIs, and many consider React as V (view) in MVC. The act originates from the Facebook's internal project, is used to set up the Instagram's website, and is sourced 5 months in 2013. The act has higher performance and the code logic is very simple, and more people have started to pay attention to and use the act.
jquery is a fast, compact JavaScript frame, which is another excellent JavaScript code base (or JavaScript frame) after Prototype. The aim of jQuery design is "write Less, Do More", i.e. advocate writing Less code and doing More. The method encapsulates functional codes commonly used by JavaScript, provides a simple JavaScript design mode, and optimizes html document operation, event processing, animation design and Ajax interaction. The core characteristics of jQuery can be summarized as: the multifunctional interface has unique chain grammar and short and clear multifunction; the CSS selector is efficient and flexible, and the CSS selector can be expanded; the method has a convenient plug-in extension mechanism and abundant plug-ins. The jQuery is compatible with various mainstream browsers, such as IE 6.0+, FF 1.5+, Safari 2.0+, Opera 9.0+, and the like.
The present invention also provides an electronic device 10, as shown in fig. 2, comprising:
a processor 110 adapted to implement instructions, an
A storage device 120 adapted to store a plurality of instructions adapted to be loaded and executed by the processor 110:
reading the converter configuration of a module packer in advance, and setting file matching information through the converter configuration;
designating a folder directory of the third party library as a folder under the root directory, and designating a priority matching entry file of the third party library as main.
The processor 110 may be a general purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA), a single chip, an arm (acorn RISC machine) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or any combination of these components. Also, the processor may be any conventional processor, microprocessor, or state machine. A processor may also be implemented as a combination of computing devices, e.g., a combination of a DSP and a microprocessor, a plurality of microprocessors, one or more microprocessors in conjunction with a DSP core, or any other such configuration.
The storage device 120, which is a non-volatile computer-readable storage medium, may be used to store non-volatile software programs, non-volatile computer-executable programs, and modules, such as program instructions corresponding to the method for improving the retrieval speed based on the educational system in the embodiment of the present invention. The processor implements the above-described method embodiments by executing the nonvolatile software programs, instructions, and units stored in the storage device to perform various functional applications and data processing of the educational system-based method for improving a retrieval speed.
Further, the setting file matching information comprises a cacheDirectory option for setting the converter, enabling the converter to support cache conversion, and modifying an include parameter of the converter to narrow a matching range.
Further, setting the file matching information further comprises removing the multi-file matching configuration.
Modules further specify the folder directory of the third-party library as a folder under the root directory by configuring the reset.
Further, the instructions are also adapted to be loaded and executed by the processor 110: suffixes are omitted when modules that import the same suffix are provided.
Further, the instructions are also adapted to be loaded and executed by the processor 110: the arrangement is such that the matching is performed using a relatively short suffix at the matching module.
Further, the instructions are also adapted to be loaded and executed by the processor 110: setting to not parse a predetermined third party library.
The details of the electronic device 10 are described in the above method, and thus will not be described in detail.
The present invention also provides a non-transitory computer-readable storage medium having stored thereon computer-executable instructions that, when executed by one or more processors, cause the one or more processors to perform the method for improving retrieval speed based on an educational system.
The present invention also provides a computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions which, when executed by a processor, cause the processor to perform the method of improving the speed of retrieval based on an educational system.
It is to be understood that the invention is not limited to the examples described above, but that modifications and variations may be effected thereto by those of ordinary skill in the art in light of the foregoing description, and that all such modifications and variations are intended to be within the scope of the invention as defined by the appended claims.

Claims (3)

1. A method for increasing search speed based on an educational system, comprising the steps of:
A. reading the converter configuration of a module packer in advance, and setting file matching information through the converter configuration;
B. designating a folder directory of a third party library as a folder under a root directory, and designating a priority matching entry file of the third party library as main.js;
the step B further comprises the following steps: omitting suffixes when setting modules that import identical suffixes; the arrangement at the matching module uses a relatively short suffix for matching; setting a predetermined third party library without analysis;
the setting file matching information comprises a cacheDirectory option of the converter, so that the converter supports cache conversion, and an include parameter of the converter is modified to narrow a matching range;
setting file matching information and removing multi-file matching configuration;
in the step B, the folder directory of the third-party library is designated as the folder under the root directory by configuring the reset.
2. An electronic device, comprising:
a processor adapted to implement the instructions, an
A storage device adapted to store a plurality of instructions, the instructions adapted to be loaded and executed by a processor to:
reading the converter configuration of a module packer in advance, and setting file matching information through the converter configuration;
designating a folder directory of a third party library as a folder under a root directory, and designating a priority matching entry file of the third party library as main.js;
the designating the folder directory of the third party library as a folder under the root directory and designating the priority matching entry file of the third party library as main. Omitting suffixes when setting modules that import identical suffixes; the arrangement at the matching module uses a relatively short suffix for matching; setting a predetermined third party library without analysis;
the setting file matching information comprises a cacheDirectory option for setting the converter, so that the converter supports cache conversion, and an include parameter of the converter is modified to narrow a matching range;
setting file matching information and removing multi-file matching configuration;
and in the file folder directory of the appointed third-party library is a file folder under a root directory, and in the file of the priority matching entry of the appointed third-party library is main.js, the file folder directory of the appointed third-party library is a file folder under the root directory by configuring reset.modules.
3. A non-transitory computer-readable storage medium storing computer-executable instructions that, when executed by one or more processors, cause the one or more processors to perform the method for improving retrieval speed based on an educational system of claim 1.
CN201811172315.9A 2018-10-09 2018-10-09 Method for improving retrieval speed based on education system and electronic equipment Active CN109408107B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811172315.9A CN109408107B (en) 2018-10-09 2018-10-09 Method for improving retrieval speed based on education system and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811172315.9A CN109408107B (en) 2018-10-09 2018-10-09 Method for improving retrieval speed based on education system and electronic equipment

Publications (2)

Publication Number Publication Date
CN109408107A CN109408107A (en) 2019-03-01
CN109408107B true CN109408107B (en) 2022-06-21

Family

ID=65466823

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811172315.9A Active CN109408107B (en) 2018-10-09 2018-10-09 Method for improving retrieval speed based on education system and electronic equipment

Country Status (1)

Country Link
CN (1) CN109408107B (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5977977A (en) * 1995-08-04 1999-11-02 Microsoft Corporation Method and system for multi-pass rendering
CN104679481A (en) * 2013-11-27 2015-06-03 上海芯豪微电子有限公司 Instruction set transition system and method
CN106445519A (en) * 2016-09-23 2017-02-22 郑州云海信息技术有限公司 Method for managing multiple sets of big data clusters through Ambari
CN107038045A (en) * 2017-03-30 2017-08-11 腾讯科技(深圳)有限公司 Load the method and device of library file
CN107168704A (en) * 2017-05-11 2017-09-15 金蝶软件(中国)有限公司 A kind of multi-page resource file method for implanting and device
CN107506483A (en) * 2017-09-15 2017-12-22 广州优视网络科技有限公司 Page loading method, device, electronic equipment and storage medium
CN107632842A (en) * 2017-09-26 2018-01-26 携程旅游信息技术(上海)有限公司 Rule configuration and dissemination method, system, equipment and storage medium
CN108021809A (en) * 2017-12-19 2018-05-11 北京明朝万达科技股份有限公司 A kind of data processing method and system
CN108388454A (en) * 2018-01-24 2018-08-10 广州市动景计算机科技有限公司 Dynamic provides the method, apparatus and terminal device of compatible JS content for script
CN108491236A (en) * 2018-03-23 2018-09-04 努比亚技术有限公司 A kind of plug-in loading method, device and computer readable storage medium

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8291169B2 (en) * 2009-05-28 2012-10-16 International Business Machines Corporation Cache line use history based done bit modification to D-cache replacement scheme
US10635420B2 (en) * 2016-07-12 2020-04-28 Oracle International Corporation Overriding a migrated method in an updated type
US10078500B2 (en) * 2016-09-23 2018-09-18 Dspace Digital Signal Processing And Control Engineering Gmbh Method and system for automatic code generation
US10268460B2 (en) * 2017-01-25 2019-04-23 Walmart Apollo, Llc Systems, method, and non-transitory computer-readable storage media for generating code for displaying a webpage
US10839041B2 (en) * 2017-01-25 2020-11-17 Walmart Apollo, Llc Systems, method, and non-transitory computer-readable storage media for a partial-render operation generating code for displaying a webpage

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5977977A (en) * 1995-08-04 1999-11-02 Microsoft Corporation Method and system for multi-pass rendering
CN104679481A (en) * 2013-11-27 2015-06-03 上海芯豪微电子有限公司 Instruction set transition system and method
CN106445519A (en) * 2016-09-23 2017-02-22 郑州云海信息技术有限公司 Method for managing multiple sets of big data clusters through Ambari
CN107038045A (en) * 2017-03-30 2017-08-11 腾讯科技(深圳)有限公司 Load the method and device of library file
CN107168704A (en) * 2017-05-11 2017-09-15 金蝶软件(中国)有限公司 A kind of multi-page resource file method for implanting and device
CN107506483A (en) * 2017-09-15 2017-12-22 广州优视网络科技有限公司 Page loading method, device, electronic equipment and storage medium
CN107632842A (en) * 2017-09-26 2018-01-26 携程旅游信息技术(上海)有限公司 Rule configuration and dissemination method, system, equipment and storage medium
CN108021809A (en) * 2017-12-19 2018-05-11 北京明朝万达科技股份有限公司 A kind of data processing method and system
CN108388454A (en) * 2018-01-24 2018-08-10 广州市动景计算机科技有限公司 Dynamic provides the method, apparatus and terminal device of compatible JS content for script
CN108491236A (en) * 2018-03-23 2018-09-04 努比亚技术有限公司 A kind of plug-in loading method, device and computer readable storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Webpack 打包优化之速度篇;https://blog.csdn.net/sinat_17775997/article/details/78454300;《https://blog.csdn.net/sinat_17775997/article/details/78454300》;20171106;全文 *
webpack之傻瓜式教程及前端自动化入门;https://www.cnblogs.com/liqiyuan/p/6246870.html;《https://www.cnblogs.com/liqiyuan/p/6246870.html》;20170105;全文 *

Also Published As

Publication number Publication date
CN109408107A (en) 2019-03-01

Similar Documents

Publication Publication Date Title
CN109614569B (en) Page rendering method and device and intelligent terminal
US8156471B2 (en) Multi-language execution method
US20130159981A1 (en) Extension mechanism for scripting language compiler
KR20180122017A (en) Efficient state machine for real-time data flow programming
CN106462406B (en) Interactive viewer for intermediate representation of client-side code
US20110161840A1 (en) Performance of template based javascript widgets
KR100892191B1 (en) Method for integrating multiple object files from heterogeneous architectures into a set of files
CN110888645A (en) Method, device and storage medium for converting into small program
Rischpater JavaScript JSON Cookbook
JP2004341671A (en) Information processing system, control method, control program and recording medium
CN114153459A (en) Interface document generation method and device
CN111913741B (en) Object interception method, device, medium and electronic equipment
CN107766036B (en) Module construction method and device and terminal equipment
WO2024041301A1 (en) Method and apparatus for generating unified abstract syntax tree, and program analysis method and apparatus
CN109408107B (en) Method for improving retrieval speed based on education system and electronic equipment
CN110457013B (en) Program component configuration device and method
CN112379885B (en) Applet compiling method, device, equipment and readable storage medium
CN107643892B (en) Interface processing method, device, storage medium and processor
CN111273940B (en) Method and device for uploading program file to code warehouse
CN109947420B (en) Method for realizing shortcut key mechanism of code editor and electronic equipment
CN113568678A (en) Method and device for dynamically loading resources and electronic equipment
JP2019179383A (en) Api processing method, terminal, and api processing program
CN117075912B (en) Method for program language conversion, compiling method and related equipment
Nellaiyapen Practical WebAssembly: Explore the fundamentals of WebAssembly programming using Rust
CN111273944B (en) Method and device for generating program file and uploading program file to code warehouse

Legal Events

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