WO2020010724A1 - 前端静态资源的管理方法、装置、计算机设备及存储介质 - Google Patents

前端静态资源的管理方法、装置、计算机设备及存储介质 Download PDF

Info

Publication number
WO2020010724A1
WO2020010724A1 PCT/CN2018/108775 CN2018108775W WO2020010724A1 WO 2020010724 A1 WO2020010724 A1 WO 2020010724A1 CN 2018108775 W CN2018108775 W CN 2018108775W WO 2020010724 A1 WO2020010724 A1 WO 2020010724A1
Authority
WO
WIPO (PCT)
Prior art keywords
file
storage path
injected
static
project
Prior art date
Application number
PCT/CN2018/108775
Other languages
English (en)
French (fr)
Inventor
吴俊强
Original Assignee
平安科技(深圳)有限公司
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 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2020010724A1 publication Critical patent/WO2020010724A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Definitions

  • the present application relates to the field of information processing technology, and in particular, to a method, an apparatus, a computer device, and a storage medium for managing front-end static resources.
  • the purpose of the present application is to provide a method, a device, a computer device, and a storage medium for managing front-end static resources, which are used to solve the foregoing problems in the prior art.
  • the present application provides a method for managing front-end static resources, including the following steps: obtaining a storage path of the static resources to be injected according to a name identifier of the static resources to be injected to obtain a first storage path; and according to the first storage path Read the file; form the read file into a file stream, and combine and compress the file stream to obtain the file to be injected; find the project file in the target folder corresponding to the static resource to be injected to obtain the first project file; Inject the start mark, first storage path, and end mark into the first project file; read the first project file, find the start mark and end mark in the first project file, and obtain the interval between the start mark and the end mark A first storage path; obtaining a file to be injected according to the first storage path; and outputting the file to be injected to a target folder.
  • the present application further provides a front-end static resource management device, which includes: an obtaining module, configured to obtain a storage path of the static resource to be injected according to a name identifier of the static resource to be injected to obtain a first storage path; A reading module for reading a file according to the first storage path; a processing module for forming the read file into a file stream, and merging and compressing the file stream to obtain a file to be injected; a finding module for Search for a project file in a target folder corresponding to the static resource to be injected to obtain a first project file; a first injection module for injecting a start flag, a first storage path, and an end flag in the first project file; and Two injection modules are used to read the first project file, find the start mark and end mark in the first project file, and obtain the first storage path between the start mark and the end mark. Inject the file and output the file to be injected to the destination folder.
  • an obtaining module configured to obtain a storage path of the static resource to be injected
  • the present application further provides a computer device including a memory, a processor, and a computer program stored on the memory and executable on the processor.
  • the processor implements management of front-end static resources when the processor executes the program. The following steps of the method:
  • the storage path of the static resource to be injected is obtained according to the name identifier of the static resource to be injected to obtain the first storage path; the file is read according to the first storage path; the read file is formed into a file stream, and the file stream is merged and Compress to get the file to be injected; find the project file in the target folder corresponding to the static resource to be injected to get the first project file; inject the start flag, the first storage path, and the end flag into the first project file; read A first project file, searching for a start mark and an end mark in the first project file, and obtaining a first storage path between the start mark and the end mark; obtaining a file to be injected according to the first storage path; and Output to the destination folder.
  • the present application also provides a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, the following steps of a method for managing front-end static resources are implemented:
  • the storage path of the static resource to be injected is obtained according to the name identifier of the static resource to be injected to obtain the first storage path; the file is read according to the first storage path; the read file is formed into a file stream, and the file stream is merged and Compress to get the file to be injected; find the project file in the target folder corresponding to the static resource to be injected to get the first project file; inject the start flag, the first storage path, and the end flag into the first project file; read A first project file, searching for a start mark and an end mark in the first project file, and obtaining a first storage path between the start mark and the end mark; obtaining a file to be injected according to the first storage path; and Output to the destination folder.
  • the front-end static resource management method, device, computer equipment, and storage medium provided in this application.
  • a static resource that is, a static resource to be injected
  • the static resource name identifies its storage path, then reads the file according to the obtained storage path, and processes the file, including forming a file stream and merging and compressing the file stream to obtain the file to be injected; then in the target folder Look for a project file in each of which a project file is set in the target folder.
  • This project file is used to maintain the injection and deletion of static resources in the target folder. There are multiple pairs of start and end labels in the project file.
  • FIG. 1 is a flowchart of a front-end static resource management method according to a first embodiment of the present application
  • FIG. 2 is a block diagram of a front-end static resource management apparatus provided in Embodiment 2 of the present application.
  • FIG. 3 is a hardware structural diagram of a computer device provided in Embodiment 3 of the present application.
  • FIG. 1 is a flowchart of a front-end static resource management method provided in Embodiment 1 of the present application. As shown in FIG. 1, this embodiment includes the following steps.
  • Step S102 Obtain a storage path of the static resource to be injected according to a name identifier of the static resource to be injected, and obtain a first storage path.
  • the static resources to be injected include external plug-in resources and the project's own resources.
  • the static resource is the static resource to be injected.
  • external plug-in resources after obtaining the external plug-in resources, they are usually stored in a folder of the project, and for the project's own resources, it is also stored in a folder of the project.
  • a list of static resource storage paths may be maintained, and all static resource storage paths are stored in the list.
  • Each static resource storage path includes the name identifier of the static resource. Therefore, in determining the static resource to be injected, After the resource, the storage path of the static resource to be injected can be found from this list according to the name identifier of the static resource to be injected. For convenience of description and differentiation, the storage path of the static resource to be injected is defined as the first storage path.
  • a general directory of all static resources can be maintained, and a total system directory of all static resources is obtained through a preset system configuration file, and then a storage path of the static resources to be injected is found in the general directory according to the name identifier of the static resources to be injected That is, the storage path of each static resource in the general directory is matched with the name identifier of the static resource to be injected. For example, if the static resource to be injected is a js static resource, the matching storage path is "/ app / ** / * .js ".
  • Step S103 Read the file according to the first storage path.
  • a data reading function may be preset.
  • the input parameter of the data reading function is a storage path.
  • the function is to read files stored in the storage path. Specifically, if the operating system provides reading files according to the storage path, Data read interface, the data read function can call the data read interface to complete file reading.
  • the static resource to be injected belongs to the external plug-in resource or the project's own resource according to the storage path of the static resource to be injected, for example, for externally referenced static Resources, that is, external plug-in resources, set up a package.json file for maintenance.
  • This file has a corresponding version using external plug-in resources.
  • package.json is the root directory of each project and is used to define the items required by the project.
  • Files, and project configuration information (such as name, version, license, and other metadata) files.
  • External plug-in resources are maintained by the package.json file as one of the modules required by the project.
  • Bower is a client-side software package manager that can be used to search, install and uninstall network resources such as JavaScript, HTML, CSS, etc.
  • the bower_components folder is A folder created by the package manager; the project's own resources, that is, the internal static resources are placed under the asset folder, so they can be distinguished by reading the path.
  • a predetermined file reading command is used to read the file according to the first storage path of the static resource to be injected, for example, fs.readfile () is used to follow the first storage path of the static resource to be injected.
  • fs.readfile is a file reading function in node.js and belongs to the fs module.
  • the receiving parameters of fs.readfile () include the file path. Therefore, the first storage path is used as fs.readfile.
  • the receiving parameter of () can read the file under the first storage path through fs.readfile ().
  • a predetermined script configuration rule is used to read the file according to the first storage path of the static resource to be injected, for example, a javascript script is used to read the file according to the first storage path of the static resource to be injected.
  • the javascript script is a script written in the javascript language. Because the storage location of the project's own resources is usually placed in a certain folder, it is possible to write a script in advance to quickly read the files in the folder. JavaScript scripts are simple to implement and easy to apply.
  • Step S104 Form the read file into a file stream, and merge and compress the file stream to obtain a file to be injected.
  • the read file may include multiple files of the same static resource type to form a file stream, which can be understood as a cache, and then the file stream, that is, the cache is merged and compressed, to obtain the file to be injected. Specifically, the file to be injected can be obtained.
  • Gulp-uglify tools such as: file compression, while generating resource mapping files, automatically identified in the browser, you can see the uncompressed code content, of which Gulp-uglify is a third-party file compression tool, Ability to reduce file size.
  • Step S105 Find a project file in a target folder corresponding to the static resource to be injected to obtain a first project file.
  • a project file is set in each folder capable of loading static resources.
  • the project file is used to maintain the injection and deletion of static resources in the folder.
  • the project file includes multiple pairs of start and end annotations. Each pair There is a storage path between the start tag and the end tag.
  • a pair of start flags and end tags are used to indicate the storage path of a file to be injected. For example, the injection start flags such as / * injector * / and the end flags / * endinjector * / .
  • Step S106 Read the first project file, find the start flag and end flag in the first project file, obtain a first storage path between the start flag and the end flag, and obtain the file to be injected according to the first storage path.
  • the project Every time the project releases a version or upgrades, it reads the project files in each folder of the project to get the latest configuration in the project file, and implements the loading of static resources according to the latest configuration in the project file. Therefore, when the first storage path and After the corresponding start mark and end mark are injected into the first project file, when reading the first project file, the first storage path between the start mark and the end mark can be found, and then the first storage can be passed through the first storage. Path to get the file to be injected.
  • a file reading function of the operating system or a file reading script may be written to obtain the file, for example, the first storage path is used as a parameter of the reading function or the reading script and returned to the first storage path. Stored files.
  • Step S107 Output the file to be injected to the target folder.
  • step S104 the files integrated in step S104 are input to a corresponding target directory (that is, a target folder).
  • a static resource that is, a static resource to be injected
  • a certain folder that is, a target folder
  • it is first obtained according to the name identifier of the static resource to be injected. Its storage path, then read the file according to the obtained storage path, and process the file, including forming a file stream and merging and compressing the file stream to get the file to be injected; then find the project file in the target folder, where A project file is set in each target folder.
  • the project file is used to maintain the injection and deletion of static resources in the target folder. There are multiple pairs of start and end labels in the project file.
  • Each pair of start labels There is a storage path between the end annotation and the end annotation.
  • When loading read the storage path between each pair of the start annotation and the end annotation in the project file, and obtain the file to be injected according to the read storage path, and inject it to Target folder, so when you need to inject static resources to be injected into the target folder, find the target folder
  • the start flag, the storage path of the static resource to be injected, and the end flag are injected into the project file, so that when the static resource is loaded, by reading the The storage path can complete the loading of static resources. Therefore, static resources can be automatically injected into the target folder. Developers do not need to manually introduce file resources. They can uniformly manage the static resources of the project and upgrade all plug-in versions.
  • Version changes are maintained uniformly. Each time you execute a command, read the project file, and inject static resources into the target folder, you only need to execute a simple command during the development process to read the information in the project file.
  • the static resources that the entire project depends on can be automatically injected into the target folder, reducing development work and improving development efficiency. In this way, the overall project structure is clearer, the system is more maintainable, and the system complexity is reduced. Improved system performance.
  • deletion of static resources may also be performed.
  • the management method further includes: obtaining a storage path of the static resources to be deleted according to a name identifier of the static resources to be deleted to obtain a second storage path. Searching for a project file in a folder where a static resource to be deleted is located to obtain a second project file; finding a second storage path in the second project file; and in the second project file, setting the second storage path The start and end flags corresponding to the second storage path are deleted. Therefore, when the static resource is loaded again, because the second storage path no longer exists in the second project file, the second storage path is not restored. The static resource loading under the storage path realizes the deletion of the static resource.
  • the front-end static resource management device includes a determination module 201, an acquisition module 202, a reading module 203, a processing module 204, The search module 205, the first injection module 206, and the second injection module 207.
  • the determining module 201 is configured to determine a name identifier of a static resource to be injected.
  • the determining module 201 receives the name identifier of the static resource as a static resource to be injected.
  • the search module 205 is configured to find a project file in a target folder corresponding to the static resource to be injected to obtain a first file.
  • Project file the first injection module 206 is used to inject the start flag, the first storage path and the end flag into the first project file;
  • the second injection module 207 is used to read the first project file and find the Start flag and end flag, and obtain the first storage path between the start flag and the end flag, and follow the first storage path Obtaining documents to be injected, will be injected into the output file to the target folder.
  • the front-end static resource management device when injecting a static resource (that is, a static resource to be injected) into a certain folder (that is, a target folder) of the project, first obtain the name of the module according to the static resource to be injected.
  • a static resource that is, a static resource to be injected
  • a certain folder that is, a target folder
  • the identifier obtains its storage path, and then the reading module reads the file according to the obtained storage path, and the processing module processes the file, including forming a file stream and merging and compressing the file stream to obtain the file to be injected; and then finding the module at the target Look for a project file in the folder, where a project file is set in each target folder, the project file is used to maintain the injection and deletion of static resources in the target folder, and multiple pairs of initial annotations and End callout, there is a storage path between each pair of start callouts and end callouts.
  • When loading read the storage path between each pair of start callouts and end callouts in the project file, and obtain according to the read storage path
  • the file to be injected is injected into the target folder.
  • the first injection module injects the start flag, the storage path of the static resource to be injected, and the end flag in the project file, thereby performing static resource loading.
  • the second injection module reads the storage path between the start annotation and the end annotation in the project file, it can complete the loading of the static resources. Therefore, the static resources can be automatically injected into the target folder, and the developer no longer needs to Introduce file resources manually, and can uniformly manage the static resources of the project. All plug-in version upgrades and version changes are uniformly maintained. Each time you execute the command, read the project file, and inject the static resources into the target folder.
  • the specific steps include: obtaining a total directory of all static resources through a preset system configuration file; and identifying according to the name Find the storage path of the static resources to be injected in the general directory.
  • the specific steps include: determining whether the static resource to be injected belongs to an external plug-in resource or the project's own resource according to the first storage path; when the static resource to be injected is When it belongs to the external plug-in resource, the file is read according to the first storage path by using a predetermined file reading command; when the static resource to be injected belongs to the project's own resources, the file is read according to the first storage path by using a predetermined script configuration rule.
  • the reading module 203 uses fs.readfile () to read the file according to the first storage path.
  • the reading module 203 uses a javascript script to read the file according to the first storage path.
  • the processing module 204 uses the Gulp-uglify tool to form the read file into a file stream, and combines and compresses the file stream to obtain a file to be injected.
  • the apparatus further includes a deletion processing module, configured to obtain a storage path of the static resource to be deleted according to a name identifier of the static resource to be deleted, to obtain a second storage path; and to search in a folder where the static resource to be deleted is located.
  • a project file to obtain a second project file ; find a second storage path in the second project file; and in the second project file, compare the second storage path with a start flag and an end flag corresponding to the second storage path delete.
  • This embodiment also provides a computer device, such as a smart phone, tablet computer, notebook computer, desktop computer, rack server, blade server, tower server, or rack server (including a stand-alone server, or Server cluster consisting of multiple servers) and so on.
  • the computer device 20 of this embodiment includes, but is not limited to, a memory 21 and a processor 22 that can be communicatively connected to each other through a system bus, as shown in FIG. 3.
  • FIG. 3 only shows the computer device 20 with components 21-22, but it should be understood that it is not required to implement all the illustrated components, and more or fewer components may be implemented instead.
  • the memory 21 (ie, a readable storage medium) includes a flash memory, a hard disk, a multimedia card, a card-type memory (for example, SD or DX memory, etc.), a random access memory (RAM), a static random access memory (SRAM), Read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disks, optical disks, etc.
  • the memory 21 may be an internal storage unit of the computer device 20, such as a hard disk or a memory of the computer device 20.
  • the memory 21 may also be an external storage device of the computer device 20, for example, a plug-in hard disk, a smart memory card (SMC), and a secure digital (Secure Digital, SD) card, Flash card, etc.
  • the memory 21 may also include both the internal storage unit of the computer device 20 and its external storage device.
  • the memory 21 is generally used to store an operating system and various types of application software installed in the computer device 20, for example, program code of the front-end static resource management device of Embodiment 2.
  • the memory 21 may also be used to temporarily store various types of data that have been output or are to be output.
  • the processor 22 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chip in some embodiments.
  • the processor 22 is generally used to control the overall operation of the computer device 20.
  • the processor 22 is configured to run program code or process data stored in the memory 21, such as a front-end static resource management device.
  • This embodiment also provides a computer-readable storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory (for example, SD or DX memory, etc.), a random access memory (RAM), a static random access memory (SRAM), Read memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disks, optical disks, servers, App application stores, etc., which have computer programs stored on them, When the program is executed by the processor, the corresponding function is realized.
  • the computer-readable storage medium of this embodiment is used for a front-end static resource management device, and when executed by a processor, implements the front-end static resource management method of the first embodiment.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本申请提供了一种前端静态资源的管理方法、装置、计算机设备及存储介质。该方法包括根据待注入静态资源的名称标识获取待注入静态资源的存储路径,以得到第一存储路径;按照第一存储路径读取文件;将读取到的文件形成文件流,并对文件流进行合并和压缩,得到待注入文件;在待注入静态资源对应的目标文件夹中查找项目文件,以得到第一项目文件;在第一项目文件中注入起始标志、第一存储路径和结束标志;读取第一项目文件,查找第一项目文件中的起始标志和结束标志,并获取起始标志和结束标志之间的第一存储路径;按照第一存储路径获取待注入文件;将待注入文件输出至目标文件夹下。通过本申请,能够实现将静态资源文件自动注入到项目的文件夹中。

Description

前端静态资源的管理方法、装置、计算机设备及存储介质
本申请申明享有2018年7月13日递交的申请号为CN 2018107671772、名称为“前端静态资源的管理方法、装置、计算机设备及存储介质”的中国专利申请的优先权,该中国专利申请的整体内容以参考的方式结合在本申请中。
技术领域
本申请涉及信息处理技术领域,尤其涉及一种前端静态资源的管理方法、装置、计算机设备及存储介质。
背景技术
随着互联网行业的发展,网页提供的内容越来越丰富。在项目开发过程中,通常需要引用一些静态资源,比如:JavaScript脚本文件、层叠样式表(Casacding Style Sheets,CSS)资源或图片等。随着版本的升级、变更,所引用的静态资源也在不断更新、变化,在后期维护项目中的静态资源时,工作量大。
目前在项目开发中,引入静态资源都需要开发者手动的通过代码的方式引入到项目中,随着项目的发展,累积的静态文件越来越多,在不同页面都引入文件,同时在协作开发时,会出现引入类似的插件,或同类插件不同版本,或同个文件在整个项目不同页面都引入,造成系统复杂度越来越大。这样也容易出现代码的冲突,定位问题复杂度增加。系统性能越来越差,同时造成文件只增不减的情况,不敢轻易清除。
因此,提供一种前端静态资源的管理方法、装置、计算机设备及存储介质,以实现将静态资源文件自动注入到项目的文件夹中,是本领域需要解决的技术问题。
发明内容
本申请的目的是提供一种前端静态资源的管理方法、装置、计算机设备及存储介质,用于解决现有技术存在的上述问题。
为实现上述目的,本申请提供一种前端静态资源的管理方法,包括以下步骤:根据待注入静态资源的名称标识获取待注入静态资源的存储路径,以得到第一存储路径;按照第一存储路径读取文件;将读取到的文件形成文件流,并对文件流进行合并和压缩,得到待注入文件;在待注入静态资源对应的目标文件夹中查找项目文件,以得到第一项目文件;在第一项目文件中注入起始标志、第一存储路径和结束标志;读取第一项目文件,查找第一项目文件中的起始标志和结束标志,并获取起始标志和结束标志之间的第一存储路径;按照第一存储路径获取待注入文件;以及将待注入文件输出至目标文件夹下。
为实现上述目的,本申请还提供一种前端静态资源的管理装置,其包括:获取模块,用于根据待注入静态资源的名称标识获取待注入静态资源的存储路径,以得到第一存储路径;读取模块,用于按照第一存储路径读取文件;处理模块,用于将读取到的文件形成文件流,并对文件流进行合并和压缩,得到待注入文件;查找模块,用于在待注入的静态资源对应的目标文件夹中查找项目文件,以得到第一项目文件;第一注入模块,用于在第一项目文件中注入起始标志、第一存储路径和结束标志;以及第二注入模块,用于读取第一项目文件,查找第一项目文件中的起始标志和结束标志,并获取起始标志和结束标志之间的第一存储路径,按照第一存储路径获取待注入文件,将待注入文件输出至目标文件夹下。
为实现上述目的,本申请还提供一种计算机设备,包括存储器、处理器以及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现前端静态资源的管理方法的以下步骤:
根据待注入静态资源的名称标识获取待注入静态资源的存储路径,以得到第一存储路径;按照第一存储路径读取文件;将读取到的文件形成文件流,并对文件流进行合并和压缩,得到待注入文件;在待注入静态资源对应的目标文件夹中查找项目文件,以得到第一项目文件;在第一项目文件中注入起始标志、第一存储路径和结束标志;读取第一项目文件,查找第一项目文件中的起始标志和结束标志,并获取起始标志和结束标志之间的第一存储路径;按照第一存储路径获取待注入文件;以及将待注入文件输出至目标文件夹下。
为实现上述目的,本申请还提供计算机可读存储介质,其上存储有计算机程序,所述程序被处理器执行时实现前端静态资源的管理方法的以下步骤:
根据待注入静态资源的名称标识获取待注入静态资源的存储路径,以得到第一存储路径;按照第一存储路径读取文件;将读取到的文件形成文件流,并对文件流进行合并和压缩,得到待注入文件;在待注入静态资源对应的目标文件夹中查找项目文件,以得到第一项目文件;在第一项目文件中注入起始标志、第一存储路径和结束标志;读取第一项目文件,查找第一项目文件中的起始标志和结束标志,并获取起始标志和结束标志之间的第一存储路径;按照第一存储路径获取待注入文件;以及将待注入文件输出至目标文件夹下。
本申请提供的前端静态资源的管理方法、装置、计算机设备及存储介质,将静态资源(即待注入静态资源)注入到项目的某个文件夹(即目标文件夹)中时,首先根据待注入静态资源的名称标识获取其存储路径,然后按照获取到的存储路径读取文件,并将文件进行处理,包括形成文件流以及对文件流合并和压缩,得到待注入的文件;然后在目标文件夹中查找项目文件,其中,每个目标文件夹中均设置有一个项目文件,该项目文件用于维护该目标文件夹下静态资源的注入和删除,项目文件中设置多对起始标注和结束标注,每对起始标注和结束标注之间具有存储路径,在加载时,读取该项目文件中每对起始标注与结束标注之间的存储路径,并按照读取到的存储路径获取待注入的文件,再注入至目标文件夹,因而,当需要将待注入静态资源注入到该 目标文件夹中时,查找到目标文件夹中的项目文件后,在项目文件中注入起始标志、待注入静态资源的存储路径以及结束标志,从而,在进行静态资源加载时,通过读取项目文件中起始标注和结束标注之间的存储路径,即可完成静态资源的加载,因此,能够将静态资源自动注入到目标文件夹中,开发者无需再手动引入文件资源,可以针对项目的静态资源进行统一的管理,所有插件版本的升级,版本的变更统一维护,每次都是通过执行命令,读取项目文件,将静态资源注入到目标文件夹中,在开发过程中只需要执行一个简单命令,读取项目文件中的信息,就可以将整个项目依赖的静态资源自动的注入到目标文件夹中,减少开发的工作,提升开发的效率,通过这种方式整个项目结构更加清晰,系统的可维护性更好,系统复杂度降低,系统性能提升。
附图说明
图1为本申请实施例一提供的前端静态资源的管理方法的流程图;
图2为本申请实施例二提供的前端静态资源的管理装置的框图。
图3为本申请实施例三提供的计算机设备的硬件结构图。
具体实施方式
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅用以解释本申请,并不用于限定本申请。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
实施例一
图1为本申请实施例一提供的前端静态资源的管理方法的流程图,如图1所示,该实施例包括如下的步骤。
步骤S102:根据待注入静态资源的名称标识获取待注入静态资源的存储 路径,得到第一存储路径。
具体地,待注入静态资源包括外部插件资源以及项目自身资源,在项目开发过程中,引入静态资源的开发者需要将某个静态资源引入到项目中时,该静态资源即为待注入静态资源。对于外部插件资源,在获取到外部插件资源后,通常会存储在项目的某个文件夹下,对于项目自身资源,也会存储在项目的某个文件夹下。
例如,可维护一个静态资源存储路径的列表,在该列表中存储有所有静态资源的存储路径,每个静态资源的存储路径中均包括有静态资源的名称标识,因而,在确定待注入的静态资源后,即可根据该待注入静态资源的名称标识从此列表中查找出待注入静态资源的存储路径,该处为方便描述和区分,将待注入静态资源的存储路径定义为第一存储路径。
又如,可维护一个全部静态资源的总目录,通过预设的系统配置文件获取该全部静态资源的总目录,然后根据待注入静态资源的名称标识在总目录中查找待注入静态资源的存储路径,也即,将总目录中的各个静态资源的存储路径与待注入静态资源的名称标识进行匹配,例如待注入静态资源为js静态资源,则匹配搭配的存储路径为“/app/**/*.js”。
步骤S103:按照第一存储路径读取文件。
例如,可预置一个数据读取函数,该数据读取函数的输入参数为存储路径,功能为将存储路径中存储的文件读取出来,具体地,若操作系统提供有根据存储路径读取文件的数据读取接口,则该数据读取函数可调用该数据读取接口完成文件读取。
又如,当外部插件资源和项目自身资源的存储路径不同时,可根据待注入的静态资源的存储路径,判断待注入的静态资源属于外部插件资源还是项目自身资源,例如,对于外部引用的静态资源,也即外部插件资源,设置package.json文件来维护,这个文件中有使用外部插件资源相应的版本,其中,package.json是每个项目的根目录下面用于定义该项目所需要的各种模块,以 及项目的配置信息(比如名称、版本、许可证等元数据)的文件,外部插件资源作为该项目所需的模块之一,由package.json文件维护。同时,设置bower_components文件夹来存放这些静态资源,其中,Bower是一个客户端技术的软件包管理器,它可用于搜索、安装和卸载如JavaScript、HTML、CSS之类的网络资源,bower_components文件夹为该软件包管理器建立的一个文件夹;项目自身资源,也即内部的静态资源统一放在asset文件夹下,因此,通过读取路径即可进行区分。
当待注入的静态资源属于外部插件资源时,采用预定的文件读取命令按照待注入静态资源的第一存储路径读取文件,例如采用fs.readfile()按照待注入静态资源的第一存储路径读取文件,其中,fs.readfile()为node.js中的一个文件读取函数,属于fs模块,fs.readfile()的接收参数包括文件路径,因而,将第一存储路径作为fs.readfile()的接收参数,通过fs.readfile()即可读取到第一存储路径下的文件。
当待注入的静态资源属于项目自身资源时,采用预定的脚本配置规则按照待注入静态资源的第一存储路径读取文件,例如通过javascript脚本按照待注入静态资源的第一存储路径读取文件,其中,javascript脚本为通过javascript语言编写的脚本,由于项目自身资源的存储位置通常会统一放在某个文件夹下,因而,能够预先编写脚本快速读取到该文件夹下的文件,并且,通过javascript脚本实现简单,应用方便。
步骤S104:将读取到的文件形成文件流,并对文件流进行合并和压缩,得到待注入文件。
读取到的文件可包括同一静态资源类型的多个文件,形成一个文件流,可以理解为一个缓存,再对文件流,也即缓存进行合并和压缩,能够得到待注入文件,具体地,可通过Gulp-uglify工具进行处理,如:文件压缩,同时生成资源映射文件,在浏览器中自动识别,可以看到非压缩后的代码内容,其中,Gulp-uglify为一种第三方文件压缩工具,能够减小文件的大小。
步骤S105:在待注入静态资源对应的目标文件夹中查找项目文件,以得到第一项目文件。
其中,每个能够加载静态资源的文件夹中均设置有一个项目文件,该项目文件用于维护该文件夹下静态资源的注入和删除,项目文件包括多对起始标注和结束标注,每对起始标注和结束标注之间具有存储路径,一对起始标志和结束标志用于指示一个待注入文件的存储路径,例如注入起始标志如/*injector*/,结束标志/*endinjector*/。在加载时,读取该项目文件中每对起始标注与结束标注之间的存储路径,并按照读取到的存储路径获取待注入的文件,再注入至文件夹。
步骤S106:读取第一项目文件,查找第一项目文件中的起始标志和结束标志,并获取起始标志和结束标志之间的第一存储路径,按照第一存储路径获取待注入文件。
在项目每次发布版本或升级时,读取项目各文件夹中的项目文件,得到项目文件中最新的配置,根据项目文件中的最新配置实现静态资源的加载,因此,当第一存储路径及其对应的起始标志和结束标志被注入之第一项目文件后,在读取第一项目文件时,能够查找到起始标志和结束标志之间的第一存储路径,进而能够通过第一存储路径去获取待注入文件。在获取待注入文件时,可调用操作系统的文件读取函数或者编写文件读取脚本进行获取,例如,将第一存储路径作为读取函数或读取脚本的传递参数,返回第一存储路径中存储的文件。
步骤S107:将待注入文件输出至目标文件夹下。
在该步骤中,将步骤S104整合后的文件输入到相应的目标目录(即目标文件夹)下。
在进行文件输出时,可调用操作系统的文件输出函数或者编写文件输出脚本进行输出,例如,将目标文件夹的存储路径作为输出函数或输出脚本的传递参数,将待注入文件输出至目标文件夹下。
采用该实施例提供的前端静态资源的管理方法,将静态资源(即待注入静态资源)注入到项目的某个文件夹(即目标文件夹)中时,首先根据待注入静态资源的名称标识获取其存储路径,然后按照获取到的存储路径读取文件,并将文件进行处理,包括形成文件流以及对文件流合并和压缩,得到待注入的文件;然后在目标文件夹中查找项目文件,其中,每个目标文件夹中均设置有一个项目文件,该项目文件用于维护该目标文件夹下静态资源的注入和删除,项目文件中设置多对起始标注和结束标注,每对起始标注和结束标注之间具有存储路径,在加载时,读取该项目文件中每对起始标注与结束标注之间的存储路径,并按照读取到的存储路径获取待注入的文件,再注入至目标文件夹,因而,当需要将待注入静态资源注入到该目标文件夹中时,查找到目标文件夹中的项目文件后,在项目文件中注入起始标志、待注入静态资源的存储路径以及结束标志,从而,在进行静态资源加载时,通过读取项目文件中起始标注和结束标注之间的存储路径,即可完成静态资源的加载,因此,能够将静态资源自动注入到目标文件夹中,开发者无需再手动引入文件资源,可以针对项目的静态资源进行统一的管理,所有插件版本的升级,版本的变更统一维护,每次都是通过执行命令,读取项目文件,将静态资源注入到目标文件夹中,在开发过程中只需要执行一个简单命令,读取项目文件中的信息,就可以将整个项目依赖的静态资源自动的注入到目标文件夹中,减少开发的工作,提升开发的效率,通过这种方式整个项目结构更加清晰,系统的可维护性更好,系统复杂度降低,系统性能提升。
可选地,除了实现静态资源的注入,还可进行静态资源的删除,具体地该管理方法还包括:根据待删除静态资源的名称标识获取待删除静态资源的存储路径,以得到第二存储路径;在待删除静态资源的所在的文件夹中查找项目文件,以得到第二项目文件;在第二项目文件中查找第二存储路径;以及在所述第二项目文件中,将第二存储路径和与第二存储路径相对应的起始标志和结束标志删除,从而,当再次进行静态资源的加载时,由于第二项目 文件中不再有第二存储路径,因而,也不会再第二存储路径下的静态资源加载,实现了静态资源的删除。
实施例二
图2为本申请实施例二提供的前端静态资源的管理装置的框图,如图2所示,该前端静态资源的管理装置包括确定模块201、获取模块202、读取模块203、处理模块204、查找模块205、第一注入模块206和第二注入模块207。
其中,确定模块201用于确定待注入静态资源的名称标识,可选地,项目开发者需要将某个静态资源注入项目时,确定模块201接收该静态资源的名称标识,作为待注入静态资源的名称标识;获取模块202用于根据待注入静态资源的名称标识获取待注入静态资源的存储路径,作为第一存储路径;读取模块203用于按照第一存储路径读取文件;处理模块204用于将读取到的文件形成文件流,并对文件流进行合并和压缩,得到待注入文件;查找模块205用于在待注入的静态资源对应的目标文件夹中查找项目文件,以得到第一项目文件;第一注入模块206用于在第一项目文件中注入起始标志、第一存储路径和结束标志;第二注入模块207用于读取第一项目文件,查找第一项目文件中的起始标志和结束标志,并获取起始标志和结束标志之间的第一存储路径,按照第一存储路径获取待注入文件,将待注入文件输出至目标文件夹下。
采用该实施例提供的前端静态资源的管理装置,将静态资源(即待注入静态资源)注入到项目的某个文件夹(即目标文件夹)中时,首先获取模块根据待注入静态资源的名称标识获取其存储路径,然后读取模块按照获取到的存储路径读取文件,处理模块将文件进行处理,包括形成文件流以及对文件流合并和压缩,得到待注入的文件;然后查找模块在目标文件夹中查找项目文件,其中,每个目标文件夹中均设置有一个项目文件,该项目文件用于维护该目标文件夹下静态资源的注入和删除,项目文件中设置多对起始标注和结束标注,每对起始标注和结束标注之间具有存储路径,在加载时,读取 该项目文件中每对起始标注与结束标注之间的存储路径,并按照读取到的存储路径获取待注入的文件,再注入至目标文件夹,因而,当需要将待注入静态资源注入到该目标文件夹中时,查找模块查找到目标文件夹中的项目文件后,第一注入模块在项目文件中注入起始标志、待注入静态资源的存储路径以及结束标志,从而,在进行静态资源加载时,第二注入模块通过读取项目文件中起始标注和结束标注之间的存储路径,即可完成静态资源的加载,因此,能够将静态资源自动注入到目标文件夹中,开发者无需再手动引入文件资源,可以针对项目的静态资源进行统一的管理,所有插件版本的升级,版本的变更统一维护,每次都是通过执行命令,读取项目文件,将静态资源注入到目标文件夹中,在开发过程中只需要执行一个简单命令,读取项目文件中的信息,就可以将整个项目依赖的静态资源自动的注入到目标文件夹中,减少开发的工作,提升开发的效率,通过这种方式整个项目结构更加清晰,系统的可维护性更好,系统复杂度降低,系统性能提升。
可选地,获取模块202在根据待注入静态资源的名称标识获取待注入静态资源的存储路径时,具体执行的步骤包括:通过预设的系统配置文件获取全部静态资源的总目录;根据名称标识在总目录中查找待注入静态资源的存储路径。
可选地,读取模块203按照第一存储路径读取文件时,具体执行的步骤包括:根据第一存储路径判断待注入的静态资源属于外部插件资源还是项目自身资源;当待注入的静态资源属于外部插件资源时,采用预定的文件读取命令按照第一存储路径读取文件;当待注入的静态资源属于项目自身资源时,采用预定的脚本配置规则按照第一存储路径读取文件。
可选地,当待注入的静态资源属于外部插件资源时,读取模块203采用fs.readfile()按照第一存储路径读取文件。
可选地,当待注入的静态资源属于项目自身资源时,读取模块203采用javascript脚本按照第一存储路径读取文件。
可选地,处理模块204通过Gulp-uglify工具将读取到的文件形成文件流,并对文件流进行合并和压缩,得到待注入文件。
可选地,该装置还包括删除处理模块,用于根据待删除静态资源的名称标识获取待删除静态资源的存储路径,以得到第二存储路径;在待删除静态资源的所在的文件夹中查找项目文件,以得到第二项目文件;在第二项目文件中查找第二存储路径;以及在第二项目文件中,将第二存储路径和与第二存储路径相对应的起始标志和结束标志删除。
实施例三
本实施例还提供一种计算机设备,如可以执行程序的智能手机、平板电脑、笔记本电脑、台式计算机、机架式服务器、刀片式服务器、塔式服务器或机柜式服务器(包括独立的服务器,或者多个服务器所组成的服务器集群)等。如图3所示,本实施例的计算机设备20至少包括但不限于:可通过系统总线相互通信连接的存储器21、处理器22,如图3所示。需要指出的是,图3仅示出了具有组件21-22的计算机设备20,但是应理解的是,并不要求实施所有示出的组件,可以替代的实施更多或者更少的组件。
本实施例中,存储器21(即可读存储介质)包括闪存、硬盘、多媒体卡、卡型存储器(例如,SD或DX存储器等)、随机访问存储器(RAM)、静态随机访问存储器(SRAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、可编程只读存储器(PROM)、磁性存储器、磁盘、光盘等。在一些实施例中,存储器21可以是计算机设备20的内部存储单元,例如该计算机设备20的硬盘或内存。在另一些实施例中,存储器21也可以是计算机设备20的外部存储设备,例如该计算机设备20上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。当然,存储器21还可以既包括计算机设备20的内部存储单元也包括其外部存储设备。本实施例中,存储器21通常用于存储安装于计算机设备20的操作系统和各类应用软件,例如实施例2的前端静态资源的 管理装置的程序代码等。此外,存储器21还可以用于暂时地存储已经输出或者将要输出的各类数据。
处理器22在一些实施例中可以是中央处理器(Central Processing Unit,CPU)、控制器、微控制器、微处理器、或其他数据处理芯片。该处理器22通常用于控制计算机设备20的总体操作。本实施例中,处理器22用于运行存储器21中存储的程序代码或者处理数据,例如前端静态资源的管理装置等。
实施例四
本实施例还提供一种计算机可读存储介质,如闪存、硬盘、多媒体卡、卡型存储器(例如,SD或DX存储器等)、随机访问存储器(RAM)、静态随机访问存储器(SRAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、可编程只读存储器(PROM)、磁性存储器、磁盘、光盘、服务器、App应用商城等等,其上存储有计算机程序,程序被处理器执行时实现相应功能。本实施例的计算机可读存储介质用于前端静态资源的管理装置,被处理器执行时实现实施例一的前端静态资源的管理方法。
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。
以上仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。

Claims (20)

  1. 一种前端静态资源的管理方法,其特征在于,包括:
    根据待注入静态资源的名称标识获取所述待注入静态资源的存储路径,以得到第一存储路径;
    按照所述第一存储路径读取文件;
    将读取到的文件形成文件流,并对所述文件流进行合并和压缩,得到待注入文件;
    在所述待注入静态资源对应的目标文件夹中查找项目文件,以得到第一项目文件;
    在所述第一项目文件中注入起始标志、所述第一存储路径和结束标志;
    读取所述第一项目文件,查找所述第一项目文件中的所述起始标志和所述结束标志,并获取所述起始标志和所述结束标志之间的所述第一存储路径;
    按照所述第一存储路径获取所述待注入文件;以及
    将所述待注入文件输出至所述目标文件夹下。
  2. 根据权利要求1所述的前端静态资源的管理方法,其特征在于,所述根据待注入静态资源的名称标识获取所述待注入静态资源的存储路径的步骤包括:
    通过预设的系统配置文件获取全部静态资源的总目录;
    根据所述名称标识在所述总目录中查找所述第一存储路径。
  3. 根据权利要求1所述的前端静态资源的管理方法,其特征在于,所述按照所述第一存储路径读取文件的步骤包括:
    根据所述第一存储路径判断所述待注入的静态资源属于外部插件资源还是项目自身资源;
    当所述待注入的静态资源属于所述外部插件资源时,采用预定的文件读取命令按照所述第一存储路径读取文件;
    当所述待注入的静态资源属于所述项目自身资源时,采用预定的脚本配置规则按照所述第一存储路径读取文件。
  4. 根据权利要求3所述的前端静态资源的管理方法,其特征在于,所述采用预定的文件读取命令按照所述第一存储路径读取文件的步骤包括:采用fs.readfile()按照所述第一存储路径读取文件。
  5. 根据权利要求3所述的前端静态资源的管理方法,其特征在于,采用预定的脚本配置规则按照所述第一存储路径读取文件的步骤包括:采用javascript脚本按照所述第一存储路径读取文件。
  6. 根据权利要求1所述的前端静态资源的管理方法,其特征在于,所述将读取到的文件形成文件流,并对所述文件流进行合并和压缩,得到待注入文件的步骤包括:
    通过Gulp-uglify工具将读取到的文件形成文件流,并对所述文件流进行合并和压缩,得到待注入文件。
  7. 根据权利要求1所述的前端静态资源的管理方法,其特征在于,还包括:
    根据待删除静态资源的名称标识获取所述待删除静态资源的存储路径,以得到第二存储路径;
    在所述待删除静态资源的所在的文件夹中查找项目文件,以得到第二项目文件;
    在所述第二项目文件中查找所述第二存储路径;以及
    在所述第二项目文件中,将所述第二存储路径和与所述第二存储路径相 对应的所述起始标志和所述结束标志删除。
  8. 一种前端静态资源的管理装置,其特征在于,包括:
    获取模块,用于根据待注入静态资源的名称标识获取所述待注入静态资源的存储路径,以得到第一存储路径;
    读取模块,用于按照所述第一存储路径读取文件;
    处理模块,用于将读取到的文件形成文件流,并对所述文件流进行合并和压缩,得到待注入文件;
    查找模块,用于在所述待注入静态资源对应的目标文件夹中查找项目文件,以得到第一项目文件;
    第一注入模块,用于在所述第一项目文件中注入起始标志、所述第一存储路径和结束标志;
    第二注入模块,用于读取所述第一项目文件,查找所述第一项目文件中的所述起始标志和所述结束标志,并获取所述起始标志和所述结束标志之间的所述第一存储路径,并按照所述第一存储路径获取所述待注入文件,将所述待注入文件输出至所述目标文件夹下。
  9. 根据权利要求8所述的前端静态资源的管理装置,其特征在于,所述获取模块在根据待注入静态资源的名称标识获取待注入静态资源的存储路径时,具体执行的步骤包括:通过预设的系统配置文件获取全部静态资源的总目录;根据所述名称标识在所述总目录中查找所述第一存储路径。
  10. 根据权利要求8所述的前端静态资源的管理装置,其特征在于,读取模块按照第一存储路径读取文件时,具体执行的步骤包括:根据所述第一存储路径判断所述待注入的静态资源属于外部插件资源还是项目自身资源;当所述待注入的静态资源属于所述外部插件资源时,采用预定的文件读取命令 按照所述第一存储路径读取文件;当所述待注入的静态资源属于所述项目自身资源时,采用预定的脚本配置规则按照所述第一存储路径读取文件。
  11. 根据权利要求10所述的前端静态资源的管理装置,其特征在于,当待注入的静态资源属于外部插件资源时,所述读取模块采用fs.readfile()按照所述第一存储路径读取文件。
  12. 根据权利要求10所述的前端静态资源的管理装置,其特征在于,当待注入的静态资源属于项目自身资源时,所述读取模块采用javascript脚本按照所述第一存储路径读取文件。
  13. 根据权利要求8所述的前端静态资源的管理装置,其特征在于,所述处理模块将读取到的文件形成文件流,并对所述文件流进行合并和压缩,得到待注入文件时,具体执行的步骤包括:通过Gulp-uglify工具将读取到的文件形成文件流,并对所述文件流进行合并和压缩,得到待注入文件。
  14. 根据权利要求8所述的前端静态资源的管理装置,其特征在于,所述装置还包括:
    删除处理模块,用于根据待删除静态资源的名称标识获取所述待删除静态资源的存储路径,以得到第二存储路径;在所述待删除静态资源的所在的文件夹中查找项目文件,以得到第二项目文件;在所述第二项目文件中查找所述第二存储路径;以及在所述第二项目文件中,将所述第二存储路径和与所述第二存储路径相对应的所述起始标志和所述结束标志删除。
  15. 一种计算机设备,所述计算机设备包括存储器、处理器以及存储在存储器上并可在处理器上运行的计算机程序,其特征在于,所述处理器执行所 述程序时实现前端静态资源的管理方法的以下步骤:
    根据待注入静态资源的名称标识获取所述待注入静态资源的存储路径,以得到第一存储路径;
    按照所述第一存储路径读取文件;
    将读取到的文件形成文件流,并对所述文件流进行合并和压缩,得到待注入文件;
    在所述待注入静态资源对应的目标文件夹中查找项目文件,以得到第一项目文件;
    在所述第一项目文件中注入起始标志、所述第一存储路径和结束标志;
    读取所述第一项目文件,查找所述第一项目文件中的所述起始标志和所述结束标志,并获取所述起始标志和所述结束标志之间的所述第一存储路径;
    按照所述第一存储路径获取所述待注入文件;以及
    将所述待注入文件输出至所述目标文件夹下。
  16. 根据权利要求15所述的计算机设备,其特征在于,所述根据待注入静态资源的名称标识获取所述待注入静态资源的存储路径的步骤包括:
    通过预设的系统配置文件获取全部静态资源的总目录;
    根据所述名称标识在所述总目录中查找所述第一存储路径。
  17. 根据权利要求15所述的计算机设备,其特征在于,所述按照所述第一存储路径读取文件的步骤包括:
    根据所述第一存储路径判断所述待注入的静态资源属于外部插件资源还是项目自身资源;
    当所述待注入的静态资源属于所述外部插件资源时,采用预定的文件读取命令按照所述第一存储路径读取文件;
    当所述待注入的静态资源属于所述项目自身资源时,采用预定的脚本配 置规则按照所述第一存储路径读取文件。
  18. 一种计算机可读存储介质,其上存储有计算机程序,其特征在于:所述程序被处理器执行时实现前端静态资源的管理方法的以下步骤:
    根据待注入静态资源的名称标识获取所述待注入静态资源的存储路径,以得到第一存储路径;
    按照所述第一存储路径读取文件;
    将读取到的文件形成文件流,并对所述文件流进行合并和压缩,得到待注入文件;
    在所述待注入静态资源对应的目标文件夹中查找项目文件,以得到第一项目文件;
    在所述第一项目文件中注入起始标志、所述第一存储路径和结束标志;
    读取所述第一项目文件,查找所述第一项目文件中的所述起始标志和所述结束标志,并获取所述起始标志和所述结束标志之间的所述第一存储路径;
    按照所述第一存储路径获取所述待注入文件;以及
    将所述待注入文件输出至所述目标文件夹下。
  19. 根据权利要求18所述的计算机可读存储介质,其特征在于,所述根据待注入静态资源的名称标识获取所述待注入静态资源的存储路径的步骤包括:
    通过预设的系统配置文件获取全部静态资源的总目录;
    根据所述名称标识在所述总目录中查找所述第一存储路径。
  20. 根据权利要求18所述的计算机可读存储介质,其特征在于,所述按照所述第一存储路径读取文件的步骤包括:
    根据所述第一存储路径判断所述待注入的静态资源属于外部插件资源还是项目自身资源;
    当所述待注入的静态资源属于所述外部插件资源时,采用预定的文件读取命令按照所述第一存储路径读取文件;
    当所述待注入的静态资源属于所述项目自身资源时,采用预定的脚本配置规则按照所述第一存储路径读取文件。
PCT/CN2018/108775 2018-07-13 2018-09-29 前端静态资源的管理方法、装置、计算机设备及存储介质 WO2020010724A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810767177.2 2018-07-13
CN201810767177.2A CN108920691B (zh) 2018-07-13 2018-07-13 前端静态资源的管理方法、装置、计算机设备及存储介质

Publications (1)

Publication Number Publication Date
WO2020010724A1 true WO2020010724A1 (zh) 2020-01-16

Family

ID=64410689

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/108775 WO2020010724A1 (zh) 2018-07-13 2018-09-29 前端静态资源的管理方法、装置、计算机设备及存储介质

Country Status (2)

Country Link
CN (1) CN108920691B (zh)
WO (1) WO2020010724A1 (zh)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111367673A (zh) * 2020-03-05 2020-07-03 山东中创软件商用中间件股份有限公司 一种静态资源获取方法、装置及其相关设备
CN113515328A (zh) * 2020-04-09 2021-10-19 北京沃东天骏信息技术有限公司 页面渲染的方法、装置、电子设备和存储介质
WO2022267178A1 (zh) * 2021-06-22 2022-12-29 深圳壹账通智能科技有限公司 项目文件的管理方法、装置、电子设备及存储介质
CN116361279A (zh) * 2023-06-02 2023-06-30 北京麟卓信息科技有限公司 一种跨平台的人工智能数据标注方法

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111124539B (zh) * 2019-12-20 2023-08-15 腾讯科技(深圳)有限公司 初始场景资源文件查找方法、装置、设备及存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104915387A (zh) * 2015-05-25 2015-09-16 成都视达科信息技术有限公司 一种互联网网站静态页面处理系统及方法
CN104978194A (zh) * 2015-06-25 2015-10-14 北京京东尚科信息技术有限公司 一种网页前端开发方法及装置
CN106790687A (zh) * 2017-02-17 2017-05-31 和创(北京)科技股份有限公司 网页呈现方法、网页数据处理方法和服务器
EP3229148A1 (en) * 2015-12-28 2017-10-11 Huawei Technologies Co., Ltd. Website access method and device, and website system
CN107885540A (zh) * 2016-09-28 2018-04-06 腾讯科技(深圳)有限公司 一种加载应用程序静态资源的方法、装置及终端

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107402788B (zh) * 2017-07-25 2020-09-25 网易(杭州)网络有限公司 资源打包管理方法与装置

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104915387A (zh) * 2015-05-25 2015-09-16 成都视达科信息技术有限公司 一种互联网网站静态页面处理系统及方法
CN104978194A (zh) * 2015-06-25 2015-10-14 北京京东尚科信息技术有限公司 一种网页前端开发方法及装置
EP3229148A1 (en) * 2015-12-28 2017-10-11 Huawei Technologies Co., Ltd. Website access method and device, and website system
CN107885540A (zh) * 2016-09-28 2018-04-06 腾讯科技(深圳)有限公司 一种加载应用程序静态资源的方法、装置及终端
CN106790687A (zh) * 2017-02-17 2017-05-31 和创(北京)科技股份有限公司 网页呈现方法、网页数据处理方法和服务器

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111367673A (zh) * 2020-03-05 2020-07-03 山东中创软件商用中间件股份有限公司 一种静态资源获取方法、装置及其相关设备
CN113515328A (zh) * 2020-04-09 2021-10-19 北京沃东天骏信息技术有限公司 页面渲染的方法、装置、电子设备和存储介质
WO2022267178A1 (zh) * 2021-06-22 2022-12-29 深圳壹账通智能科技有限公司 项目文件的管理方法、装置、电子设备及存储介质
CN116361279A (zh) * 2023-06-02 2023-06-30 北京麟卓信息科技有限公司 一种跨平台的人工智能数据标注方法

Also Published As

Publication number Publication date
CN108920691B (zh) 2023-04-18
CN108920691A (zh) 2018-11-30

Similar Documents

Publication Publication Date Title
WO2020010724A1 (zh) 前端静态资源的管理方法、装置、计算机设备及存储介质
US10120672B2 (en) Method for offline updating virtual machine images
US20170124103A1 (en) Method and Apparatus for Creating System Disk Snapshot of Virtual Machine
KR20200093597A (ko) 콘텐츠 아이템의 동기화를 위한 고유 식별자의 할당 및 재할당
CN109032662B (zh) 代码文件生成方法、装置、计算机设备和存储介质
US20180060414A1 (en) Language tag management on international data storage
CN108536745B (zh) 基于Shell的数据表提取方法、终端、设备及存储介质
WO2019095667A1 (zh) 数据库数据采集方法、应用服务器及计算机可读存储介质
US10346150B2 (en) Computerized system and method for patching an application by separating executables and working data using different images
CN109739828B (zh) 一种数据处理方法、设备及计算机可读存储介质
US20150261766A1 (en) Method and apparatus for determining a range of files to be migrated
CN111177113B (zh) 数据迁移方法、装置、计算机设备和存储介质
KR101674176B1 (ko) 파일 단위 순서 모드 저널링 기법을 이용한 fsync 시스템 호출 처리 장치 및 방법
CN113835713B (zh) 源码包下载方法、装置、计算机设备和存储介质
US8856740B2 (en) Implementing multiple versions of a plug-in concurrently
CN113138757B (zh) 前端代码自动生成方法、装置、服务器、系统及介质
CN111881150A (zh) 一种web应用程序离线数据的处理方法及装置
CN111737227A (zh) 数据修改方法及系统
WO2019148657A1 (zh) 关联环境测试方法、电子装置及计算机可读存储介质
US8539048B2 (en) Electronic device and method for loading configuration files using the same
CN111796855B (zh) 一种增量版本更新方法、装置、存储介质及计算机设备
CN111176901B (zh) 一种hdfs删除文件恢复方法、终端设备及存储介质
CN109947739B (zh) 数据源管理方法及装置
CN112328272A (zh) 算法升级方法、装置、设备及存储介质
CN114090502A (zh) 一种资源管理方法、装置、设备及存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18926288

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 17.05.2021)

122 Ep: pct application non-entry in european phase

Ref document number: 18926288

Country of ref document: EP

Kind code of ref document: A1