WO2024000917A1 - Non-intrusive, pluggable front-end build transfer acceleration method and apparatus - Google Patents

Non-intrusive, pluggable front-end build transfer acceleration method and apparatus Download PDF

Info

Publication number
WO2024000917A1
WO2024000917A1 PCT/CN2022/124463 CN2022124463W WO2024000917A1 WO 2024000917 A1 WO2024000917 A1 WO 2024000917A1 CN 2022124463 W CN2022124463 W CN 2022124463W WO 2024000917 A1 WO2024000917 A1 WO 2024000917A1
Authority
WO
WIPO (PCT)
Prior art keywords
project
data
local
construction
build
Prior art date
Application number
PCT/CN2022/124463
Other languages
French (fr)
Chinese (zh)
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 WO2024000917A1 publication Critical patent/WO2024000917A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/44Encoding
    • G06F8/447Target code generation

Definitions

  • the present application relates to the field of computer information processing. Specifically, it relates to a non-intrusive and pluggable front-end construction transfer speed-up method, device, electronic equipment and computer-readable media.
  • the front-end is the front-end part of the website, which runs on PC, mobile and other browsers and displays the web pages for users to browse.
  • each platform will provide a front-end that can adapt to various screen resolutions and suitable motion design to bring users a very high user experience.
  • the front end of business products needs to be updated based on product activities or news hot spots.
  • developers first develop front-end code on the local platform, and then submit the development code to the business system to convert it into production code for use by the business front-end. Tools that can convert development code into production code are called build tools.
  • the present application provides a non-intrusive and pluggable front-end construction transfer speed-up method, device, electronic equipment and computer-readable medium, which is compatible with the front-end construction process in the existing technology and improves the speed without the user's perception. Front-end construction efficiency, reducing time costs and improving user satisfaction.
  • a non-intrusive and pluggable front-end construction transfer speed-up method includes: obtaining project information corresponding to the project to be built; and obtaining resources corresponding to the project through the project information. Address; use the resource address to obtain local resource data; generate front-end construction data according to the local resource data; store the front-end construction data in a predetermined location to complete the front-end construction of the project.
  • the project information corresponding to the project to be built on the front end it also includes: performing local construction of the project; after the local construction is completed, generating local construction data; transmitting the local construction data to the content distribution network .
  • performing local construction of the project includes: pulling the code of the project from a remote warehouse; installing dependency files of the project locally; performing local construction of the project based on the dependency files and the code. Construct.
  • transmitting the local construction data to the content distribution network includes: compressing the local construction data to generate local resource data; verifying the local resource data; and after passing the verification, sending the local resource data to the content distribution network.
  • Resource data is transmitted to the content distribution network.
  • obtaining project information corresponding to the project to be built on the front end includes: obtaining the project ID, project branch name, and submission ID corresponding to the project to be built on the front end through a predetermined interface.
  • obtaining the resource address corresponding to the project through the project information includes: obtaining the record file corresponding to the project information in the background server through the project identification, project branch name, and submission identification in the project information; Obtain the resource address corresponding to the project from the record file.
  • using the resource address to obtain local resource data includes: obtaining the local resource data from a content distribution network through the resource address; and storing the local resource data locally on the server of the project to be built on the front end.
  • generating front-end construction data according to the local resource data includes: decompressing the resource data locally on the server of the project to be front-end built, and generating the front-end construction data.
  • storing the front-end build data in a predetermined location to complete the front-end build of the project includes: determining the target platform and target directory according to the project information of the project; storing the front-end build data in the target platform's target directory to complete the front-end build of the project.
  • a non-intrusive and pluggable front-end construction transfer speed-up device includes: an information module, used to obtain project information corresponding to the project to be built; an address module, used to pass the required The project information obtains the resource address corresponding to the project; the resource module is used to obtain local resource data using the resource address; the data module is used to generate front-end construction data according to the local resource data; the building module is used to convert all The front-end build data is stored in a predetermined location to complete the front-end build of the project.
  • an electronic device includes: one or more processors; a storage device for storing one or more programs; when one or more programs are processed by one or more processors, Execution causes one or more processors to implement the method as above.
  • a computer-readable medium on which a computer program is stored.
  • the program is executed by a processor, the above method is implemented.
  • project information corresponding to the project to be built is obtained by obtaining the project information; the project is obtained through the project information The corresponding resource address; using the resource address to obtain local resource data; generating front-end construction data according to the local resource data; storing the front-end construction data in a predetermined location to complete the front-end construction of the project, which is compatible with modern
  • Figure 1 is a schematic diagram of a front-end construction method in the prior art.
  • Figure 2 is a system block diagram illustrating a non-intrusive and pluggable front-end construction transfer speed-up method and device according to an exemplary embodiment.
  • FIG. 3 is a flowchart illustrating a non-intrusive and pluggable front-end construction transfer speed-up method according to an exemplary embodiment.
  • FIG. 4 is a schematic diagram illustrating a non-intrusive and pluggable front-end construction transfer speed-up method according to an exemplary embodiment.
  • FIG. 5 is a schematic diagram illustrating a non-intrusive and pluggable front-end construction transfer speed-up method according to another exemplary embodiment.
  • FIG. 6 is a schematic diagram illustrating a non-intrusive and pluggable front-end construction transfer speed-up method according to another exemplary embodiment.
  • FIG. 7 is a block diagram of a non-invasive pluggable front-end construction transfer speed-up device according to an exemplary embodiment.
  • FIG. 8 is a block diagram of an electronic device according to an exemplary embodiment.
  • Figure 9 is a block diagram of a computer-readable medium according to an exemplary embodiment.
  • Example embodiments will now be described more fully with reference to the accompanying drawings.
  • Example embodiments may, however, be embodied in various forms and should not be construed as limited to the embodiments set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concepts of the example embodiments. To those skilled in the art.
  • the same reference numerals in the drawings represent the same or similar parts, and thus their repeated description will be omitted.
  • first, second, third, etc. may be used herein to describe various components, these components should not be limited by these terms. These terms are used to distinguish one component from another component. Accordingly, a first component discussed below may be referred to as a second component without departing from the teachings of the present concepts. As used herein, the term “and/or” includes any and all combinations of one or more of the associated listed items.
  • FIG 1 is a schematic diagram of a front-end construction method in the prior art. As shown in Figure 1, in the existing technology, front-end construction generally requires the following steps:
  • the packaging speed is slow when building the front-end.
  • the average packaging time of a simple front-end activity page project is about 500s. Due to the slow speed, the development experience is not good, and the test and verification cycle is prolonged; the slow speed is mainly reflected in two
  • the front-end construction of the existing technology is based on containers. When there are many packaging tasks at the same time, there will be resource grabbing, resulting in poor server performance. Secondly, it takes too long to install the front-end dependency packages. Moreover, due to fluctuations in network speed, timeouts often occur when installing dependent packages, which can lead to installation failure and ultimately the failure of the entire packaging process.
  • this application proposes a non-intrusive and pluggable method and device for speeding up front-end construction and transfer. It adopts a persistence solution that combines local construction and content distribution network.
  • the front-end is built and runs in the system. Pull resources from the application to avoid repeated installation of dependencies, and the overall front-end construction speed is increased by 2 to 6 times.
  • Figure 2 is a system block diagram illustrating a non-intrusive and pluggable front-end construction transfer speed-up method and device according to an exemplary embodiment.
  • the system architecture 20 may include local devices 201, 202, 203, a network 204 and a content distribution network server 205, and business platforms 206, 207, 208.
  • the network 204 is used between local devices 201, 202, 203 and content distribution network server 205; between local devices 201, 202, 203 and service platforms 206, 207, 208; between content distribution network server 205 and service platforms 206, 207 , 208 provides the medium for communication links.
  • Network 204 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
  • Developers can use local devices 201, 202, 203 to interact with the business platforms 206, 207, 208 through the network 204 and/or the content distribution network server 205 to receive or send data, etc.
  • Various development client applications can be installed on the local devices 201, 202, and 203, such as HTML development applications, CSS development applications, JavaScript development applications, ajax development applications, etc.
  • the local devices 201, 202, and 203 may, for example, perform local construction of the project; the local devices 201, 202, and 203 may, for example, generate local construction data after the local construction is completed; the local devices 201, 202, and 203 may, for example, convert the local
  • the build data is stored locally, and the local devices 201, 202, 203 can also transmit the local build data to the content distribution network server 205, for example.
  • the business platforms 206, 207, and 208 may be servers that provide various services, such as backend management servers that provide support for Internet service websites browsed by users.
  • the business platforms 206, 207, and 208 can analyze and process the received user data, and feed back the processing results to the administrator and/or the user of the Internet service website.
  • the business platforms 206, 207, and 208 can, for example, obtain the project information corresponding to the project to be built on the front end; the business platforms 206, 207, and 208 can, for example, obtain the resource address corresponding to the project through the project information; the business platforms 206, 207, 208 can, for example, use the resource address to obtain local resource data; the business platforms 206, 207, and 208 can, for example, generate front-end construction data according to the local resource data; the business platforms 206, 207, and 208 can, for example, store the front-end construction data in Book a spot to complete the front-end build for said project.
  • the business platform 206, 207, 208 may be an entity server, or may be composed of multiple servers. It should be noted that the non-intrusive and pluggable front-end construction transfer speed-up method provided by the embodiment of the present application can be The business platforms 206, 207, 208 and/or the content distribution network server 205 and/or the local devices 201, 202, 203 are executed. Correspondingly, the non-intrusive pluggable front-end construction transfer speed-up device can be set on the business platforms 206, 207, 208 and/or content distribution network server 205 and/or local devices 201, 202, 203.
  • FIG. 3 is a flowchart illustrating a non-intrusive and pluggable method for accelerating front-end build transfer according to another exemplary embodiment.
  • a non-intrusive and pluggable front-end construction transfer speed-up method 30 includes at least steps S302 to S310.
  • the preset port can be called through the plug-in, which can be, for example, Server Api, and the project information can be obtained from the preset port.
  • the project information can include: project identification, project branch name, and commit ID.
  • the method before obtaining the project information corresponding to the project to be built, the method further includes: performing local construction of the project; after the local construction is completed, generating local construction data; and transmitting the local construction data to the content. distribution network.
  • the code of the project may be pulled from a remote repository; the dependency files of the project may be installed locally; and the project may be built locally based on the dependency files and the code.
  • the local construction data may be compressed to generate local resource data; the local resource data may be verified; and after the verification passes, the local resource data may be transmitted to the content distribution network.
  • S304 obtain the resource address corresponding to the project through the project information.
  • the record file corresponding to the project information is obtained in the background server through the project identification, project branch name, and submission identification in the project information; the resource address corresponding to the project is obtained from the record file.
  • the resource address is used to obtain local resource data.
  • the local resource data can be obtained from the content distribution network through the resource address; and the local resource data can be stored locally on the server of the project to be built on the front end.
  • resources are downloaded from the content distribution network server to the local location of the business server to be built for front-end construction.
  • front-end construction data is generated according to the local resource data.
  • the resource data may be decompressed locally on the server of the project to be built to generate the front-end build data, where the front-end build data is generated based on decompression of the developer's local build data.
  • the front-end construction data is stored in a predetermined location to complete the front-end construction of the project.
  • the target platform and target directory can be determined according to the project information of the project; the front-end construction data is stored in the target directory of the target platform to complete the front-end construction of the project.
  • the project information corresponding to the project to be built is obtained; the resource address corresponding to the project is obtained through the project information; and the resource address is used Obtain local resource data; generate front-end construction data according to the local resource data; store the front-end construction data in a predetermined location to complete the front-end construction of the project, which can be compatible with the front-end construction process in the existing technology, and can be used by users Improve front-end construction efficiency without awareness, reduce time costs, and improve user satisfaction.
  • FIG. 4 is a schematic diagram illustrating a non-intrusive and pluggable front-end construction transfer speed-up method according to an exemplary embodiment.
  • different modules can be set up to assist in improving performance.
  • a performance statistics module can be set up to collect data.
  • a version comparison module (based on commit Id) can also be built in.
  • a Git (code) automation module can also be built-in, which can include functions such as automatic submission, automatic retrieval, automatic push, version conflict checking, and version pulling.
  • the method in this application can be implemented through the plug-in of the build tool.
  • the front-end construction method in this application is independent of the container machine and can be used by docker, node and gitlab ci.
  • this application can also provide enhanced functions such as compressed upload, which can be used alone or disabled during use; for access, the front-end construction method in this application can achieve pluggable functions, and you can choose Functions are assembled into specific pipelines and can also support the deployment of micro-applications.
  • FIG. 5 is a schematic diagram illustrating a non-intrusive and pluggable front-end construction transfer speed-up method according to another exemplary embodiment.
  • the system architecture corresponding to the non-intrusive and pluggable front-end construction and transfer speed-up method in this application may include two parts: local and business front-end.
  • the local end can undertake the construction of local projects, check the git version of the project before the current project is built, compress the build product after the build is completed, and then upload it.
  • the project configuration can also be checked through the version detection and project detection models to check whether the project configuration is correct.
  • the log module is used to record the log output during the process, as well as record the performance, speed, and resource size during the project construction process. Operator, version number and other information.
  • the business front-end is mainly used for business services. It can be applied in containers or other construction platforms to pull matched resource packages from the content distribution network and decompress them.
  • the business front-end performs calling functions through the externally exposed interface API.
  • the business platform calls the API exposed to the business front-end at runtime, passing in the required parameters (for example, project identification, branch name, submission identification), and the log module will go to the resource library ( A unique record is matched in the background service), and the resource address containing the project is extracted from this record.
  • the download module downloads the resources from the content distribution network to the local area of the business server based on the information in this record, and then decompresses the decompressed
  • the file is placed in the designated directory of the platform where it is located. From this point on, the process ends.
  • the local build results are placed in the designated location according to the requirements of the platform.
  • the remaining tasks are completed by the platform such as publishing and other subsequent steps.
  • the front-end construction method in the prior art can refer to the above description, and the construction method in this application can be as follows:
  • the business platform synchronizes resources into the platform.
  • the construction method in this application can It saves the installation and build steps, saves time for processing this project, and quickly releases server resources, allowing the server to handle other tasks;
  • FIG. 6 is a schematic diagram illustrating a non-intrusive and pluggable front-end construction transfer speed-up method according to another exemplary embodiment.
  • Figure 6 is a comparison between the front-end construction method in the prior art and the construction method in this application. It can be seen from Figure 6 that the more time-consuming steps of the process in the existing technology are to install dependencies in the image and build, and the dependencies will be installed every time the package is packaged. Due to intranet network reasons, the installation is very time-consuming, and at the same time, the construction is performed in the container. The efficiency is also low, because the performance of the container will decrease when there are many tasks. Combining the above two points, the original process will take a long time to package each time;
  • mainstream front-end projects include the build function when initializing the project, so there is no need to add additional configuration in this application , the construction can be realized. Since the build has been completed locally, you only need to compress the static resource package and upload it to the unified file service, and record it.
  • the average construction time of a project according to the existing technology process is about 500s. After using the technology of this application, the average construction time is within 60s, and the efficiency is greatly improved.
  • the non-intrusive and pluggable front-end construction and transfer speed-up method proposed in this application can reduce development costs, access costs, and technician understanding costs, and can also significantly improve system performance and realize automated processes.
  • FIG. 7 is a block diagram of a non-invasive pluggable front-end construction transfer speed-up device according to an exemplary embodiment.
  • the non-invasive and pluggable front-end construction and transfer speed-up device 70 includes: an information module 702 , an address module 704 , a resource module 706 , a data module 708 , and a construction module 710 .
  • the information module 702 is used to obtain the project information corresponding to the project to be built on the front end; the information module 702 is also used to obtain the project identification, project branch name, and submission identification corresponding to the project to be built on the front end through a predetermined interface.
  • the address module 704 is used to obtain the resource address corresponding to the project through the project information; the address module 704 is also used to obtain the project information in the background server through the project identification, project branch name, and submission identification in the project information.
  • the corresponding record file obtain the resource address corresponding to the project from the record file.
  • the resource module 706 is used to obtain the local resource data using the resource address; the resource module 706 is also used to obtain the local resource data from the content distribution network through the resource address; and store the local resource data in the to-be-built front-end Local to the project's server.
  • the data module 708 is used to generate front-end construction data according to the local resource data; the data module 708 is also used to decompress the resource data locally on the server of the project to be front-end built, and generate the front-end construction data.
  • the building module 710 is used to store the front-end building data in a predetermined location to complete the front-end building of the project.
  • the construction module 710 is also used to determine the target platform and target directory according to the project information of the project; store the front-end construction data in the target directory of the target platform to complete the front-end construction of the project.
  • the project information corresponding to the project to be built is obtained by obtaining the project information; the resource address corresponding to the project is obtained through the project information; and the local resource address is obtained using the resource address.
  • Resource data; generating front-end construction data according to the local resource data; storing the front-end construction data in a predetermined location to complete the front-end construction of the project, which is compatible with the front-end construction process in the existing technology and is invisible to the user Improve front-end construction efficiency, reduce time costs, and improve user satisfaction.
  • FIG. 8 is a block diagram of an electronic device according to an exemplary embodiment.
  • FIG. 8 An electronic device 800 according to this embodiment of the present application is described below with reference to FIG. 8 .
  • the electronic device 800 shown in FIG. 8 is only an example and should not impose any limitations on the functions and usage scope of the embodiments of the present application.
  • electronic device 800 is embodied in the form of a general computing device.
  • the components of the electronic device 800 may include, but are not limited to: at least one processing unit 810, at least one storage unit 820, a bus 830 connecting different system components (including the storage unit 820 and the processing unit 810), a display unit 840, and the like.
  • the storage unit stores program code, and the program code can be executed by the processing unit 810, so that the processing unit 810 performs the steps in this specification according to various exemplary embodiments of the present application.
  • the processing unit 810 may perform steps as shown in FIG. 3 .
  • the storage unit 820 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 8201 and/or a cache storage unit 8202, and may further include a read-only storage unit (ROM) 8203.
  • RAM random access storage unit
  • ROM read-only storage unit
  • the storage unit 820 may also include a program/utility 8204 having a set of (at least one) program modules 8205 including, but not limited to: an operating system, one or more applications, other program modules, and programs. Data, each of these examples or some combination may include an implementation of a network environment.
  • Bus 830 may be a local area representing one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, a graphics acceleration port, a processing unit, or using any of a variety of bus structures. bus.
  • the electronic device 800 may also communicate with one or more external devices 800' (e.g., keyboard, pointing device, Bluetooth device, etc.) so that the user can communicate with the device that the electronic device 800 interacts with, and/or the electronic device 800 can communicate with a Any device (such as a router, modem, etc.) with which multiple other computing devices communicate. This communication may occur through input/output (I/O) interface 850.
  • the electronic device 800 may also communicate with one or more networks (eg, a local area network (LAN), a wide area network (WAN), and/or a public network, such as the Internet) through a network adapter 860.
  • Network adapter 860 may communicate with other modules of electronic device 800 via bus 830.
  • electronic device 800 may be used in conjunction with electronic device 800, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives And data backup storage system, etc.
  • the technical solution according to the embodiment of the present application can be embodied in the form of a software product.
  • the software product can be stored in a non-volatile storage medium (which can be a CD-ROM, U disk, mobile hard disk etc.) or on a network, including several instructions to cause a computing device (which can be a personal computer, a server, a network device, etc.) to execute the above method according to an embodiment of the present application.
  • the software product may take the form of any combination of one or more readable media.
  • the readable medium may be a readable signal medium or a readable storage medium.
  • the readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination thereof. More specific examples (non-exhaustive list) of readable storage media include: electrical connection with one or more conductors, portable disk, hard disk, random access memory (RAM), read only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above.
  • the computer-readable storage medium may include a data signal propagated in baseband or as part of a carrier wave carrying readable program code therein. Such propagated data signals may take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above.
  • a readable storage medium may also be any readable medium other than a readable storage medium that can transmit, propagate, or transport the program for use by or in connection with an instruction execution system, apparatus, or device.
  • Program code contained on a readable storage medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the above.
  • Program code for performing the operations of the present application may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., as well as conventional procedural formulas. Programming language—such as "C” or a similar programming language.
  • the program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server execute on.
  • the remote computing device may be connected to the user computing device through any kind of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., provided by an Internet service). (business comes via Internet connection).
  • LAN local area network
  • WAN wide area network
  • Internet service e.g., provided by an Internet service
  • the above-mentioned computer-readable medium carries one or more programs.
  • the computer-readable medium realizes the following functions: perform local construction of the project; after the local construction is completed, the computer-readable medium carries one or more programs. , generate local build data; transmit the local build data to the content distribution network.
  • the computer-readable medium can also realize the following functions: obtain the project information corresponding to the project to be built on the front end; obtain the resource address corresponding to the project through the project information; obtain local resource data using the resource address; The local resource data generates front-end construction data; and the front-end construction data is stored in a predetermined location to complete the front-end construction of the project.
  • modules can be distributed in devices according to the description of the embodiments, or can be modified accordingly in one or more devices that are only different from this embodiment.
  • the modules of the above embodiments can be combined into one module, or further divided into multiple sub-modules.
  • the example embodiments described here can be implemented by software, or can be implemented by software combined with necessary hardware. Therefore, the technical solution according to the embodiment of the present application can be embodied in the form of a software product.
  • the software product can be stored in a non-volatile storage medium (which can be a CD-ROM, U disk, mobile hard disk, etc.) or on the network. , including several instructions to cause a computing device (which may be a personal computer, server, mobile terminal, or network device, etc.) to execute the method according to the embodiment of the present application.

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The present application relates to a non-intrusive, pluggable front-end build transfer acceleration method and apparatus, an electronic device and a computer-readable medium. The method comprises: obtaining project information corresponding to a project to be subjected to front-end build; obtaining a resource address corresponding to the project by means of the project information; obtaining local resource data by using the resource address; generating front-end build data according to the local resource data; and storing the front-end build data in a predetermined position to complete the front-end build of the project. According to the non-intrusive, pluggable front-end build transfer acceleration method and apparatus, the electronic device and the computer-readable medium, compatibility with a front-end build process in the prior art can be realized, and the front-end build efficiency is improved without user awareness, thereby reducing the time cost and improving the user satisfaction.

Description

一种无侵入可插拔的前端构建转移提速方法及装置A non-intrusive and pluggable method and device for speeding up front-end construction and transfer 技术领域Technical field
本申请涉及计算机信息处理领域,具体而言,涉及一种无侵入可插拔的前端构建转移提速方法、装置、电子设备及计算机可读介质。The present application relates to the field of computer information processing. Specifically, it relates to a non-intrusive and pluggable front-end construction transfer speed-up method, device, electronic equipment and computer-readable media.
背景技术Background technique
前端即网站前台部分,运行在PC端,移动端等浏览器上展现给用户浏览的网页。随着互联网技术的发展,各个平台的均会提供能够适应各种屏幕分辨率,合适的动效设计,给用户带来极高的用户体验的前端。业务产品的前端需要根据产品的活动或者新闻热点进行更新。一般情况中,开发人员先在本地平台进行前端代码的开发,然后将开发代码提交到业务系统中转换为生产代码以供业务前端使用,能够将开发代码转换为生产代码的工具称为构建工具。The front-end is the front-end part of the website, which runs on PC, mobile and other browsers and displays the web pages for users to browse. With the development of Internet technology, each platform will provide a front-end that can adapt to various screen resolutions and suitable motion design to bring users a very high user experience. The front end of business products needs to be updated based on product activities or news hot spots. In general, developers first develop front-end code on the local platform, and then submit the development code to the business system to convert it into production code for use by the business front-end. Tools that can convert development code into production code are called build tools.
但是,随着前端承载的业务复杂度的提升,开发代码想要正常运行时,所需的依赖文件也越来越多。这样就造成前端代码构建时长也随之增长,每次系统构建都需要花费较长时间安装依赖,且不易统计每个阶段构建性能数据。However, as the complexity of the business carried by the front end increases, more and more dependency files are required when the development code wants to run normally. This causes the front-end code construction time to also increase. Each system build takes a long time to install dependencies, and it is difficult to collect performance data for each stage of the build.
在所述背景技术部分公开的上述信息仅用于加强对本申请的背景的理解,因此它可以包括不构成对本领域普通技术人员已知的现有技术的信息。The above information disclosed in the Background section is only for enhancement of understanding of the context of the application and therefore it may contain information that does not form the prior art that is already known to a person of ordinary skill in the art.
发明内容Contents of the invention
有鉴于此,本申请提供一种无侵入可插拔的前端构建转移提速方法、装置、电子设备及计算机可读介质,能够兼容现有技术中的前端构建流程,在用户无感知的情况下提升前端构建效率,减少时间成本,提高用户满意度。In view of this, the present application provides a non-intrusive and pluggable front-end construction transfer speed-up method, device, electronic equipment and computer-readable medium, which is compatible with the front-end construction process in the existing technology and improves the speed without the user's perception. Front-end construction efficiency, reducing time costs and improving user satisfaction.
本申请的其他特性和优点将通过下面的详细描述变得显然,或部分地通过本申请的实践而习得。Additional features and advantages of the invention will be apparent from the detailed description which follows, or, in part, may be learned by practice of the invention.
根据本申请的一方面,提出一种无侵入可插拔的前端构建转移提速方法,该方法包括:获取待进行前端构建的项目对应的项目信息;通过所述项目信息获取所述项目对应的资源地址;利用所述资源地址获取本地资源数据;根据所述本地资源数据生成前端构建数据;将所述前端构建数据存储在预定位置以完成所述项目的前端构建。According to one aspect of the present application, a non-intrusive and pluggable front-end construction transfer speed-up method is proposed. The method includes: obtaining project information corresponding to the project to be built; and obtaining resources corresponding to the project through the project information. Address; use the resource address to obtain local resource data; generate front-end construction data according to the local resource data; store the front-end construction data in a predetermined location to complete the front-end construction of the project.
可选地,获取待进行前端构建的项目对应的项目信息之前,还包括: 进行所述项目的本地构建;在本地构建完成后,生成本地构建数据;将所述本地构建数据传输到内容分发网络。Optionally, before obtaining the project information corresponding to the project to be built on the front end, it also includes: performing local construction of the project; after the local construction is completed, generating local construction data; transmitting the local construction data to the content distribution network .
可选地,进行所述项目的本地构建,包括:从远程仓库拉取所述项目的代码;在本地安装所述项目的依赖文件;基于所述依赖文件和所述代码进行所述项目的本地构建。Optionally, performing local construction of the project includes: pulling the code of the project from a remote warehouse; installing dependency files of the project locally; performing local construction of the project based on the dependency files and the code. Construct.
可选地,将所述本地构建数据传输到内容分发网络,包括:将所述本地构建数据进行压缩,生成本地资源数据;对所述本地资源数据进行核验;在核验通过后,将所述本地资源数据传输到所述内容分发网络。Optionally, transmitting the local construction data to the content distribution network includes: compressing the local construction data to generate local resource data; verifying the local resource data; and after passing the verification, sending the local resource data to the content distribution network. Resource data is transmitted to the content distribution network.
可选地,获取待进行前端构建的项目对应的项目信息,包括:由预定的接口获取待进行前端构建的项目对应的项目标识、项目分支名称、提交标识。Optionally, obtaining project information corresponding to the project to be built on the front end includes: obtaining the project ID, project branch name, and submission ID corresponding to the project to be built on the front end through a predetermined interface.
可选地,通过所述项目信息获取所述项目对应的资源地址,包括:通过所述项目信息中的项目标识、项目分支名称、提交标识在后台服务器中获取所述项目信息对应的记录文件;由所述记录文件中获取所述项目对应的资源地址。Optionally, obtaining the resource address corresponding to the project through the project information includes: obtaining the record file corresponding to the project information in the background server through the project identification, project branch name, and submission identification in the project information; Obtain the resource address corresponding to the project from the record file.
可选地,利用所述资源地址获取本地资源数据,包括:通过所述资源地址由内容分发网络获取所述本地资源数据;将所述本地资源数据存储在待进行前端构建的项目的服务器本地。Optionally, using the resource address to obtain local resource data includes: obtaining the local resource data from a content distribution network through the resource address; and storing the local resource data locally on the server of the project to be built on the front end.
可选地,根据所述本地资源数据生成前端构建数据,包括:在待进行前端构建的项目的服务器本地将所述资源数据解压缩,生成所述前端构建数据。Optionally, generating front-end construction data according to the local resource data includes: decompressing the resource data locally on the server of the project to be front-end built, and generating the front-end construction data.
可选地,将所述前端构建数据存储在预定位置以完成所述项目的前端构建,包括:根据所述项目的项目信息确定目标平台和目标目录;将所述前端构建数据存储在所述目标平台的目标目录中以完成所述项目的前端构建。Optionally, storing the front-end build data in a predetermined location to complete the front-end build of the project includes: determining the target platform and target directory according to the project information of the project; storing the front-end build data in the target platform's target directory to complete the front-end build of the project.
根据本申请的一方面,提出一种无侵入可插拔的前端构建转移提速装置,该装置包括:信息模块,用于获取待进行前端构建的项目对应的项目信息;地址模块,用于通过所述项目信息获取所述项目对应的资源地址;资源模块,用于利用所述资源地址获取本地资源数据;数据模块,用于根据所述本地资源数据生成前端构建数据;构建模块,用于将所述前端构建数据存储在预定位置以完成所述项目的前端构建。According to one aspect of the present application, a non-intrusive and pluggable front-end construction transfer speed-up device is proposed. The device includes: an information module, used to obtain project information corresponding to the project to be built; an address module, used to pass the required The project information obtains the resource address corresponding to the project; the resource module is used to obtain local resource data using the resource address; the data module is used to generate front-end construction data according to the local resource data; the building module is used to convert all The front-end build data is stored in a predetermined location to complete the front-end build of the project.
根据本申请的一方面,提出一种电子设备,该电子设备包括:一个或多个处理器;存储装置,用于存储一个或多个程序;当一个或多个程序被一个或多个处理器执行,使得一个或多个处理器实现如上文的方法。According to one aspect of the present application, an electronic device is proposed. The electronic device includes: one or more processors; a storage device for storing one or more programs; when one or more programs are processed by one or more processors, Execution causes one or more processors to implement the method as above.
根据本申请的一方面,提出一种计算机可读介质,其上存储有计算机程序,该程序被处理器执行时实现如上文中的方法。According to one aspect of the present application, a computer-readable medium is proposed, on which a computer program is stored. When the program is executed by a processor, the above method is implemented.
根据本申请的一种无侵入可插拔的前端构建转移提速方法、装置、电 子设备及计算机可读介质,通过获取待进行前端构建的项目对应的项目信息;通过所述项目信息获取所述项目对应的资源地址;利用所述资源地址获取本地资源数据;根据所述本地资源数据生成前端构建数据;将所述前端构建数据存储在预定位置以完成所述项目的前端构建的方式,能够兼容现有技术中的前端构建流程,在用户无感知的情况下提升前端构建效率,减少时间成本,提高用户满意度。According to the non-intrusive and pluggable front-end construction transfer speed-up method, device, electronic equipment and computer-readable medium of the present application, project information corresponding to the project to be built is obtained by obtaining the project information; the project is obtained through the project information The corresponding resource address; using the resource address to obtain local resource data; generating front-end construction data according to the local resource data; storing the front-end construction data in a predetermined location to complete the front-end construction of the project, which is compatible with modern There is a front-end construction process in technology that improves front-end construction efficiency without users being aware of it, reduces time costs, and improves user satisfaction.
应当理解的是,以上的一般描述和后文的细节描述仅是示例性的,并不能限制本申请。It should be understood that the above general description and the following detailed description are only exemplary and do not limit the present application.
附图说明Description of drawings
通过参照附图详细描述其示例实施例,本申请的上述和其它目标、特征及优点将变得更加显而易见。下面描述的附图仅仅是本申请的一些实施例,对于本领域的普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。The above and other objects, features and advantages of the present application will become more apparent by describing in detail example embodiments thereof with reference to the accompanying drawings. The drawings described below are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without exerting creative efforts.
图1是现有技术中前端构建方法的示意图。Figure 1 is a schematic diagram of a front-end construction method in the prior art.
图2是根据一示例性实施例示出的一种无侵入可插拔的前端构建转移提速方法及装置的系统框图。Figure 2 is a system block diagram illustrating a non-intrusive and pluggable front-end construction transfer speed-up method and device according to an exemplary embodiment.
图3是根据一示例性实施例示出的一种无侵入可插拔的前端构建转移提速方法的流程图。FIG. 3 is a flowchart illustrating a non-intrusive and pluggable front-end construction transfer speed-up method according to an exemplary embodiment.
图4是根据一示例性实施例示出的一种无侵入可插拔的前端构建转移提速方法的示意图。FIG. 4 is a schematic diagram illustrating a non-intrusive and pluggable front-end construction transfer speed-up method according to an exemplary embodiment.
图5是根据另一示例性实施例示出的一种无侵入可插拔的前端构建转移提速方法的示意图。FIG. 5 is a schematic diagram illustrating a non-intrusive and pluggable front-end construction transfer speed-up method according to another exemplary embodiment.
图6是根据另一示例性实施例示出的一种无侵入可插拔的前端构建转移提速方法的示意图。FIG. 6 is a schematic diagram illustrating a non-intrusive and pluggable front-end construction transfer speed-up method according to another exemplary embodiment.
图7是根据一示例性实施例示出的一种无侵入可插拔的前端构建转移提速装置的框图。FIG. 7 is a block diagram of a non-invasive pluggable front-end construction transfer speed-up device according to an exemplary embodiment.
图8是根据一示例性实施例示出的一种电子设备的框图。FIG. 8 is a block diagram of an electronic device according to an exemplary embodiment.
图9是根据一示例性实施例示出的一种计算机可读介质的框图。Figure 9 is a block diagram of a computer-readable medium according to an exemplary embodiment.
具体实施方式Detailed ways
现在将参考附图更全面地描述示例实施例。然而,示例实施例能够以多种形式实施,且不应被理解为限于在此阐述的实施例;相反,提供这些实施例使得本申请将全面和完整,并将示例实施例的构思全面地传达给本领域的技术人员。在图中相同的附图标记表示相同或类似的部分,因而将省略对它们的重复描述。Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in various forms and should not be construed as limited to the embodiments set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concepts of the example embodiments. To those skilled in the art. The same reference numerals in the drawings represent the same or similar parts, and thus their repeated description will be omitted.
此外,所描述的特征、结构或特性可以以任何合适的方式结合在一个 或更多实施例中。在下面的描述中,提供许多具体细节从而给出对本申请的实施例的充分理解。然而,本领域技术人员将意识到,可以实践本申请的技术方案而没有特定细节中的一个或更多,或者可以采用其它的方法、组元、装置、步骤等。在其它情况下,不详细示出或描述公知方法、装置、实现或者操作以避免模糊本申请的各方面。Furthermore, the described features, structures or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to provide a thorough understanding of embodiments of the present application. However, those skilled in the art will appreciate that the technical solutions of the present application may be practiced without one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other instances, well-known methods, apparatus, implementations, or operations have not been shown or described in detail to avoid obscuring aspects of the present application.
附图中所示的方框图仅仅是功能实体,不一定必须与物理上独立的实体相对应。即,可以采用软件形式来实现这些功能实体,或在一个或多个硬件模块或集成电路中实现这些功能实体,或在不同网络和/或处理器装置和/或微控制器装置中实现这些功能实体。The block diagrams shown in the figures are functional entities only and do not necessarily correspond to physically separate entities. That is, these functional entities may be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and/or processor devices and/or microcontroller devices. entity.
附图中所示的流程图仅是示例性说明,不是必须包括所有的内容和操作/步骤,也不是必须按所描述的顺序执行。例如,有的操作/步骤还可以分解,而有的操作/步骤可以合并或部分合并,因此实际执行的顺序有可能根据实际情况改变。The flowcharts shown in the drawings are only illustrative, and do not necessarily include all contents and operations/steps, nor must they be performed in the order described. For example, some operations/steps can be decomposed, and some operations/steps can be merged or partially merged, so the actual order of execution may change according to the actual situation.
应理解,虽然本文中可能使用术语第一、第二、第三等来描述各种组件,但这些组件不应受这些术语限制。这些术语乃用以区分一组件与另一组件。因此,下文论述的第一组件可称为第二组件而不偏离本申请概念的教示。如本文中所使用,术语“及/或”包括相关联的列出项目中的任一个及一或多者的所有组合。It will be understood that, although the terms first, second, third, etc. may be used herein to describe various components, these components should not be limited by these terms. These terms are used to distinguish one component from another component. Accordingly, a first component discussed below may be referred to as a second component without departing from the teachings of the present concepts. As used herein, the term "and/or" includes any and all combinations of one or more of the associated listed items.
本领域技术人员可以理解,附图只是示例实施例的示意图,附图中的模块或流程并不一定是实施本申请所必须的,因此不能用于限制本申请的保护范围。Those skilled in the art can understand that the accompanying drawings are only schematic diagrams of exemplary embodiments, and the modules or processes in the accompanying drawings are not necessarily necessary to implement the present application, and therefore cannot be used to limit the protection scope of the present application.
图1是现有技术中前端构建方法的示意图。如图1所述,在现有技术中,进行前端构建一般需要如下步骤:Figure 1 is a schematic diagram of a front-end construction method in the prior art. As shown in Figure 1, in the existing technology, front-end construction generally requires the following steps:
1.首次从远程仓库拉取项目代码;1. Pull the project code from the remote warehouse for the first time;
2.本地安装项目依赖;2. Install project dependencies locally;
3.业务开发,手动同步代码,提交代码,然后到发布平台;(非自动)3. Business development, manually synchronize the code, submit the code, and then go to the publishing platform; (not automatic)
4.远端平台重新安装项目依赖(受限于项目依赖数量,网络等原因,此过程相对比较耗时);然后进行构建(受限于项目大小,服务器性能,任务排队等原因,此过程也很费时);4. Reinstall the project dependencies on the remote platform (limited by the number of project dependencies, network, etc., this process is relatively time-consuming); and then build (limited by project size, server performance, task queuing, etc., this process is also Very time consuming);
5.有新需求进行迭代时,重复步骤3和4,整体项目周期较长。5. When there are new requirements for iteration, repeat steps 3 and 4. The overall project cycle will be longer.
现有技术中前端构建的时候打包速度慢,一个简单前端活动页面项目平均打包时间在500s左右,由于速度慢带来开发体验不好,以及测试验证周期被拖长;速度慢主要体现在两个方面,一是现有技术的前端构建基于容器,当统一时间打包任务较多的时候存在抢资源的情况,导致服务器性能不佳,二是由于安装前端依赖包占用的时间过长。而且,由于网络速率的波动,在安装依赖包时,经常会发生超时问题,这会导致安装失败,最终导致整个打包流程失败。In the existing technology, the packaging speed is slow when building the front-end. The average packaging time of a simple front-end activity page project is about 500s. Due to the slow speed, the development experience is not good, and the test and verification cycle is prolonged; the slow speed is mainly reflected in two In terms of aspects, firstly, the front-end construction of the existing technology is based on containers. When there are many packaging tasks at the same time, there will be resource grabbing, resulting in poor server performance. Secondly, it takes too long to install the front-end dependency packages. Moreover, due to fluctuations in network speed, timeouts often occur when installing dependent packages, which can lead to installation failure and ultimately the failure of the entire packaging process.
为了解决现有技术中存在的问题,本申请提出了一种无侵入可插拔的前端构建转移提速方法及装置,采用本地构建和内容分发网络相结合的持久化方案,前端构建时运行在系统中拉取资源,避免重复安装依赖,整体前端构建速度提升了2至6倍。In order to solve the problems existing in the existing technology, this application proposes a non-intrusive and pluggable method and device for speeding up front-end construction and transfer. It adopts a persistence solution that combines local construction and content distribution network. The front-end is built and runs in the system. Pull resources from the application to avoid repeated installation of dependencies, and the overall front-end construction speed is increased by 2 to 6 times.
下面结合具体的实施例,对本申请的内容进行详细描述。The contents of this application will be described in detail below with reference to specific embodiments.
图2是根据一示例性实施例示出的一种无侵入可插拔的前端构建转移提速方法及装置的系统框图。Figure 2 is a system block diagram illustrating a non-intrusive and pluggable front-end construction transfer speed-up method and device according to an exemplary embodiment.
如图2所示,系统架构20可以包括本地设备201、202、203,网络204和内容分发网络服务器205、业务平台206、207、208。网络204用以在本地设备201、202、203和内容分发网络服务器205之间;本地设备201、202、203和业务平台206、207、208之间;内容分发网络服务器205和业务平台206、207、208之间提供通信链路的介质。网络204可以包括各种连接类型,例如有线、无线通信链路或者光纤电缆等等。As shown in Figure 2, the system architecture 20 may include local devices 201, 202, 203, a network 204 and a content distribution network server 205, and business platforms 206, 207, 208. The network 204 is used between local devices 201, 202, 203 and content distribution network server 205; between local devices 201, 202, 203 and service platforms 206, 207, 208; between content distribution network server 205 and service platforms 206, 207 , 208 provides the medium for communication links. Network 204 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
开发者可以使用本地设备201、202、203通过网络204和/或内容分发网络服务器205与业务平台206、207、208交互,以接收或发送数据等。本地设备201、202、203上可以安装有各种开发类的客户端应用,例如HTML开发类应用、CSS开发类应用、JavaScript开发类应用、ajax开发类应用等。Developers can use local devices 201, 202, 203 to interact with the business platforms 206, 207, 208 through the network 204 and/or the content distribution network server 205 to receive or send data, etc. Various development client applications can be installed on the local devices 201, 202, and 203, such as HTML development applications, CSS development applications, JavaScript development applications, ajax development applications, etc.
本地设备201、202、203可例如进行所述项目的本地构建;本地设备201、202、203可例如在本地构建完成后,生成本地构建数据;本地设备201、202、203可例如将所述本地构建数据存储在本地,本地设备201、202、203还可例如将所述本地构建数据传输到内容分发网络服务器205。The local devices 201, 202, and 203 may, for example, perform local construction of the project; the local devices 201, 202, and 203 may, for example, generate local construction data after the local construction is completed; the local devices 201, 202, and 203 may, for example, convert the local The build data is stored locally, and the local devices 201, 202, 203 can also transmit the local build data to the content distribution network server 205, for example.
业务平台206、207、208可以是提供各种服务的服务器,例如对用户所浏览的互联网服务类网站提供支持的后台管理服务器。业务平台206、207、208可以对接收到的用户数据进行分析等处理,并将处理结果反馈给互联网服务网站的管理员和/或用户。The business platforms 206, 207, and 208 may be servers that provide various services, such as backend management servers that provide support for Internet service websites browsed by users. The business platforms 206, 207, and 208 can analyze and process the received user data, and feed back the processing results to the administrator and/or the user of the Internet service website.
业务平台206、207、208可例如获取待进行前端构建的项目对应的项目信息;业务平台206、207、208可例如通过所述项目信息获取所述项目对应的资源地址;业务平台206、207、208可例如利用所述资源地址获取本地资源数据;业务平台206、207、208可例如根据所述本地资源数据生成前端构建数据;业务平台206、207、208可例如将所述前端构建数据存储在预定位置以完成所述项目的前端构建。The business platforms 206, 207, and 208 can, for example, obtain the project information corresponding to the project to be built on the front end; the business platforms 206, 207, and 208 can, for example, obtain the resource address corresponding to the project through the project information; the business platforms 206, 207, 208 can, for example, use the resource address to obtain local resource data; the business platforms 206, 207, and 208 can, for example, generate front-end construction data according to the local resource data; the business platforms 206, 207, and 208 can, for example, store the front-end construction data in Book a spot to complete the front-end build for said project.
业务平台206、207、208可以是一个实体的服务器,还可例如为多个服务器组成,需要说明的是,本申请实施例所提供的一种无侵入可插拔的前端构建转移提速方法可以由业务平台206、207、208和/或内容分发网络服务器205和/或本地设备201、202、203执行,相应地,无侵入可插 拔的前端构建转移提速装置可以设置于业务平台206、207、208和/或内容分发网络服务器205和/或本地设备201、202、203中。The business platform 206, 207, 208 may be an entity server, or may be composed of multiple servers. It should be noted that the non-intrusive and pluggable front-end construction transfer speed-up method provided by the embodiment of the present application can be The business platforms 206, 207, 208 and/or the content distribution network server 205 and/or the local devices 201, 202, 203 are executed. Correspondingly, the non-intrusive pluggable front-end construction transfer speed-up device can be set on the business platforms 206, 207, 208 and/or content distribution network server 205 and/or local devices 201, 202, 203.
图3是根据另一示例性实施例示出的一种无侵入可插拔的前端构建转移提速方法的流程图。一种无侵入可插拔的前端构建转移提速方法30至少包括步骤S302至S310。FIG. 3 is a flowchart illustrating a non-intrusive and pluggable method for accelerating front-end build transfer according to another exemplary embodiment. A non-intrusive and pluggable front-end construction transfer speed-up method 30 includes at least steps S302 to S310.
如图3所示,在S302中,获取待进行前端构建的项目对应的项目信息。由预定的接口获取待进行前端构建的项目对应的项目标识、项目分支名称、提交标识。As shown in Figure 3, in S302, project information corresponding to the project to be built on the front end is obtained. Obtain the project ID, project branch name, and submission ID corresponding to the project to be built on the front end through the predetermined interface.
可通过插件,调用预设的端口,可例如为Server Api,由预设端口获取项目信息,项目信息可包括:项目标识,项目分支名称,提交标识(commit Id)。The preset port can be called through the plug-in, which can be, for example, Server Api, and the project information can be obtained from the preset port. The project information can include: project identification, project branch name, and commit ID.
在一个实施例中,获取待进行前端构建的项目对应的项目信息之前,还包括:进行所述项目的本地构建;在本地构建完成后,生成本地构建数据;将所述本地构建数据传输到内容分发网络。In one embodiment, before obtaining the project information corresponding to the project to be built, the method further includes: performing local construction of the project; after the local construction is completed, generating local construction data; and transmitting the local construction data to the content. distribution network.
更具体的,可例如,从远程仓库拉取所述项目的代码;在本地安装所述项目的依赖文件;基于所述依赖文件和所述代码进行所述项目的本地构建。More specifically, for example, the code of the project may be pulled from a remote repository; the dependency files of the project may be installed locally; and the project may be built locally based on the dependency files and the code.
在一个实施例中,还可例如,将所述本地构建数据进行压缩,生成本地资源数据;对所述本地资源数据进行核验;在核验通过后,将所述本地资源数据传输到所述内容分发网络。In one embodiment, for example, the local construction data may be compressed to generate local resource data; the local resource data may be verified; and after the verification passes, the local resource data may be transmitted to the content distribution network.
“对所述本地资源数据进行核验”的相关内容将在图5对应的实施例中进行详细描述。The relevant content of "verifying the local resource data" will be described in detail in the embodiment corresponding to FIG. 5 .
在S304中,通过所述项目信息获取所述项目对应的资源地址。通过所述项目信息中的项目标识、项目分支名称、提交标识在后台服务器中获取所述项目信息对应的记录文件;由所述记录文件中获取所述项目对应的资源地址。In S304, obtain the resource address corresponding to the project through the project information. The record file corresponding to the project information is obtained in the background server through the project identification, project branch name, and submission identification in the project information; the resource address corresponding to the project is obtained from the record file.
在S306中,利用所述资源地址获取本地资源数据。可例如,通过所述资源地址由内容分发网络获取所述本地资源数据;将所述本地资源数据存储在待进行前端构建的项目的服务器本地。In S306, the resource address is used to obtain local resource data. For example, the local resource data can be obtained from the content distribution network through the resource address; and the local resource data can be stored locally on the server of the project to be built on the front end.
根据此记录的信息从内容分发网络服务器中下载资源到待进行前端构建的业务服务器的本地。Based on the information in this record, resources are downloaded from the content distribution network server to the local location of the business server to be built for front-end construction.
在S308中,根据所述本地资源数据生成前端构建数据。可例如,在待进行前端构建的项目的服务器本地将所述资源数据解压缩,生成所述前端构建数据,其中,前端构建数据是基于开发人员的本地构建数据解压缩生成的。In S308, front-end construction data is generated according to the local resource data. For example, the resource data may be decompressed locally on the server of the project to be built to generate the front-end build data, where the front-end build data is generated based on decompression of the developer's local build data.
在S310中,将所述前端构建数据存储在预定位置以完成所述项目的 前端构建。可根据所述项目的项目信息确定目标平台和目标目录;将所述前端构建数据存储在所述目标平台的目标目录中以完成所述项目的前端构建。In S310, the front-end construction data is stored in a predetermined location to complete the front-end construction of the project. The target platform and target directory can be determined according to the project information of the project; the front-end construction data is stored in the target directory of the target platform to complete the front-end construction of the project.
根据本申请的一种无侵入可插拔的前端构建转移提速方法,通过获取待进行前端构建的项目对应的项目信息;通过所述项目信息获取所述项目对应的资源地址;利用所述资源地址获取本地资源数据;根据所述本地资源数据生成前端构建数据;将所述前端构建数据存储在预定位置以完成所述项目的前端构建的方式,能够兼容现有技术中的前端构建流程,在用户无感知的情况下提升前端构建效率,减少时间成本,提高用户满意度。According to a non-intrusive and pluggable front-end construction transfer speed-up method of the present application, the project information corresponding to the project to be built is obtained; the resource address corresponding to the project is obtained through the project information; and the resource address is used Obtain local resource data; generate front-end construction data according to the local resource data; store the front-end construction data in a predetermined location to complete the front-end construction of the project, which can be compatible with the front-end construction process in the existing technology, and can be used by users Improve front-end construction efficiency without awareness, reduce time costs, and improve user satisfaction.
应清楚地理解,本申请描述了如何形成和使用特定示例,但本申请的原理不限于这些示例的任何细节。相反,基于本申请公开的内容的教导,这些原理能够应用于许多其它实施例。It should be clearly understood that this application describes how to make and use specific examples, but that the principles of this application are not limited to any details of these examples. Rather, these principles can be applied to many other embodiments based on the teachings of this disclosure.
图4是根据一示例性实施例示出的一种无侵入可插拔的前端构建转移提速方法的示意图。在本申请的本地资源数据的前端构建方法中,可设置不同的模块辅助提升性能,可例如,设置性能统计模块收集数据,为保证资源的一致性,还可内置了版本对比模块(基于commit Id),为提升开发的自动化,还可内置了Git(代码)自动化模块,可包含自动提交,自动取回,自动推送,版本冲突检查,版本拉取等功能。FIG. 4 is a schematic diagram illustrating a non-intrusive and pluggable front-end construction transfer speed-up method according to an exemplary embodiment. In the front-end construction method of local resource data in this application, different modules can be set up to assist in improving performance. For example, a performance statistics module can be set up to collect data. In order to ensure the consistency of resources, a version comparison module (based on commit Id) can also be built in. ), in order to improve the automation of development, a Git (code) automation module can also be built-in, which can include functions such as automatic submission, automatic retrieval, automatic push, version conflict checking, and version pulling.
可通过构建工具的插件实现本申请中的方法,本申请中的前端构建方法是和容器机器无关的,docker,node以及gitlab ci皆可使用。此外,本申请还可提供压缩上传等增强功能,此功能都是可以单独使用,也可在使用时禁止;对于接入来说,本申请中的前端构建方法可实现可插拔功能,可以选择功能组装成特定的流水线,还可支持微应用的部署。The method in this application can be implemented through the plug-in of the build tool. The front-end construction method in this application is independent of the container machine and can be used by docker, node and gitlab ci. In addition, this application can also provide enhanced functions such as compressed upload, which can be used alone or disabled during use; for access, the front-end construction method in this application can achieve pluggable functions, and you can choose Functions are assembled into specific pipelines and can also support the deployment of micro-applications.
图5是根据另一示例性实施例示出的一种无侵入可插拔的前端构建转移提速方法的示意图。如图5所示,本申请中一种无侵入可插拔的前端构建转移提速方法对应的系统架构可包括本地和业务前端两个部分。FIG. 5 is a schematic diagram illustrating a non-intrusive and pluggable front-end construction transfer speed-up method according to another exemplary embodiment. As shown in Figure 5, the system architecture corresponding to the non-intrusive and pluggable front-end construction and transfer speed-up method in this application may include two parts: local and business front-end.
本地端可承接本地项目的构建,在当前项目构建之前对项目的git版本进行检查,在完成构建之后对构建产物进行压缩,然后进行上传。The local end can undertake the construction of local projects, check the git version of the project before the current project is built, compress the build product after the build is completed, and then upload it.
在此过程中还可通过版本检测和项目检测模型对项目配置进行检查,检查项目配置是否正确,日志模块用于记录过程中的日志输出,以及记录项目构建过程中的性能,速度,资源大小,操作人,版本号等信息。During this process, the project configuration can also be checked through the version detection and project detection models to check whether the project configuration is correct. The log module is used to record the log output during the process, as well as record the performance, speed, and resource size during the project construction process. Operator, version number and other information.
业务前端主要用于进行业务服务。可应用在容器内或者其他的构建平台,用来从内容分发网络中拉取匹配到的资源包,并做解压缩。The business front-end is mainly used for business services. It can be applied in containers or other construction platforms to pull matched resource packages from the content distribution network and decompress them.
业务前端通过对外暴露的接口api执行调用功能。The business front-end performs calling functions through the externally exposed interface API.
在一个具体的应用实施例中,业务平台在运行时调用暴露给业务前端的AP I,传入需要的参数(可例如为:项目标识,分支名称,提交标识), 日志模块会到资源库(后台服务)里面匹配到唯一一条记录,由此记录中提取包含项目的资源地址,下载模块根据此记录的信息从内容分发网络中下载资源到业务服务器的本地,然后进行解压,并把解压后的文件放到所在平台的指定目录,自此流程结束,将本地构建的结果按照平台的要求放到指定位置剩下的任务由平台完成发布等后续步骤。In a specific application embodiment, the business platform calls the API exposed to the business front-end at runtime, passing in the required parameters (for example, project identification, branch name, submission identification), and the log module will go to the resource library ( A unique record is matched in the background service), and the resource address containing the project is extracted from this record. The download module downloads the resources from the content distribution network to the local area of the business server based on the information in this record, and then decompresses the decompressed The file is placed in the designated directory of the platform where it is located. From this point on, the process ends. The local build results are placed in the designated location according to the requirements of the platform. The remaining tasks are completed by the platform such as publishing and other subsequent steps.
本申请的一种无侵入可插拔的前端构建转移提速方法,只是承接了平台的一个步骤,并没有去改变平台的规则,而是去适配平台,这使得平台上开发者几乎不用特意在意这些动作是由其他插件完成的,因为从平台开始运行以及到发布整个过程和之前没有区别,开发者感受良好。This application's non-intrusive and pluggable front-end construction transfer speed-up method only takes over one step of the platform. It does not change the rules of the platform, but adapts to the platform. This makes developers on the platform almost do not need to pay special attention. These actions are completed by other plug-ins, because the entire process from the platform starting to running to publishing is no different from before, and developers feel good.
在一个具体的实施例中,现有技术中的前端构建方法可参考上文中的描述,本申请中的构建方法可如下:In a specific embodiment, the front-end construction method in the prior art can refer to the above description, and the construction method in this application can be as follows:
1.首次从远程仓库拉取项目代码;1. Pull the project code from the remote warehouse for the first time;
2.本地安装项目依赖;2. Install project dependencies locally;
3.业务开发,本地构建,然后把构建产物进行压缩上传到内容分发网络。这是因为绝大多数情况下本地构建的性能比发布平台的服务器性能好,构建所用时间大幅度减少,在构建完成后,发布到业务平台;3. Business development, local construction, and then compressing the built product and uploading it to the content distribution network. This is because in most cases the performance of the local build is better than the server performance of the publishing platform, and the construction time is greatly reduced. After the construction is completed, it is published to the business platform;
4.业务平台进行同步,把资源同步到平台内,在此过程中,由于省去了重新安装依赖,且资源是经过本地快速构建过的不用再次重新构建,所以,本申请中的构建方法可省去安装构建步骤,节省处理本项目的时间的同时可以快速释放服务器资源,让服务器得以处理其他的任务;4. The business platform synchronizes resources into the platform. In this process, since there is no need to reinstall dependencies, and the resources have been quickly built locally and do not need to be rebuilt again, the construction method in this application can It saves the installation and build steps, saves time for processing this project, and quickly releases server resources, allowing the server to handle other tasks;
5.有新需求进行迭代,重复步骤3和4。5. If there are new requirements, iterate and repeat steps 3 and 4.
整个开发流程步骤并没有增多,和现有技术中的步骤是一样的,开发人员不需要经过特殊的培训即可适应本申请中的方法,低感知的整合了开发过程中的各个步骤,整个流程是完全自动化且安全,保持原有的开发流程,更重要的是可插拔特性,为现有的前端构建方案提供了另外一种选择,There are no additional steps in the entire development process. They are the same as those in the existing technology. Developers do not need to undergo special training to adapt to the method in this application. Each step in the development process is integrated with low perception. The entire process It is completely automated and safe, maintaining the original development process, and more importantly, it is pluggable, providing another option for the existing front-end construction solution.
图6是根据另一示例性实施例示出的一种无侵入可插拔的前端构建转移提速方法的示意图。图6是现有技术中的前端构建方法和本申请中的构建方法的对比。从图6中可以看出现有技术中的流程比较耗时的步骤为镜像内安装依赖,构建,并且每次打包都会安装依赖,由于内网网络原因致使安装十分耗时,同时在容器内进行构建的效率也较低,因为容器在任务多的时候性能会降低,综合以上两点导致原有流程每次打包时间都比较长;FIG. 6 is a schematic diagram illustrating a non-intrusive and pluggable front-end construction transfer speed-up method according to another exemplary embodiment. Figure 6 is a comparison between the front-end construction method in the prior art and the construction method in this application. It can be seen from Figure 6 that the more time-consuming steps of the process in the existing technology are to install dependencies in the image and build, and the dependencies will be installed every time the package is packaged. Due to intranet network reasons, the installation is very time-consuming, and at the same time, the construction is performed in the container. The efficiency is also low, because the performance of the container will decrease when there are many tasks. Combining the above two points, the original process will take a long time to package each time;
在本申请中,将耗时步骤迁移到本地。在开发项目的时候,本地已经安装过,且不用每次都重新安装,这大量节省了时间;主流的前端项目在初始化项目的时候都是包含构建功能的,所以本申请中无须增加额外的配 置,便可以实现构建。由于在本地已经完成了构建,只需要将静态资源包进行压缩并上传到统一的文件服务,并做记录。In this application, time-consuming steps are migrated locally. When developing the project, it has been installed locally and there is no need to reinstall it every time, which saves a lot of time; mainstream front-end projects include the build function when initializing the project, so there is no need to add additional configuration in this application , the construction can be realized. Since the build has been completed locally, you only need to compress the static resource package and upload it to the unified file service, and record it.
在业务前端的构建时,根据业务处理命令中的项目信息匹配到唯一的资源包并下载,然后解压,经过以上功能的扩展,便可以完成原有流程一样的效果,且大幅度节省安装依赖包的时间,而且也节约网络资源。When building the business front-end, match the unique resource package based on the project information in the business processing command and download it, and then decompress it. After the expansion of the above functions, the same effect as the original process can be achieved, and the installation of dependent packages can be greatly saved. time and also save network resources.
在一个实际的应用场景中,某项目按照现有技术的流程进行构建的平均时间在500s左右,在使用本申请的技术之后,平均构建时间在60s以内,效率提升十分明。In an actual application scenario, the average construction time of a project according to the existing technology process is about 500s. After using the technology of this application, the average construction time is within 60s, and the efficiency is greatly improved.
所以,本申请的一种无侵入可插拔的前端构建转移提速方法,能够降低开发成本、接入成本、技术人员理解成本,还能够带来系统性能的显著提升,实现自动化流程。Therefore, the non-intrusive and pluggable front-end construction and transfer speed-up method proposed in this application can reduce development costs, access costs, and technician understanding costs, and can also significantly improve system performance and realize automated processes.
本领域技术人员可以理解实现上述实施例的全部或部分步骤被实现为由CPU执行的计算机程序。在该计算机程序被CPU执行时,执行本申请提供的上述方法所限定的上述功能。所述的程序可以存储于一种计算机可读存储介质中,该存储介质可以是只读存储器,磁盘或光盘等。Those skilled in the art can understand that all or part of the steps for implementing the above-described embodiments are implemented as computer programs executed by a CPU. When the computer program is executed by the CPU, the above-mentioned functions defined by the above-mentioned method provided by this application are executed. The program can be stored in a computer-readable storage medium, which can be a read-only memory, a magnetic disk or an optical disk.
此外,需要注意的是,上述附图仅是根据本申请示例性实施例的方法所包括的处理的示意性说明,而不是限制目的。易于理解,上述附图所示的处理并不表明或限制这些处理的时间顺序。另外,也易于理解,这些处理可以是例如在多个模块中同步或异步执行的。In addition, it should be noted that the above-mentioned drawings are only schematic illustrations of processes included in the methods according to the exemplary embodiments of the present application, and are not intended to be limiting. It is readily understood that the processes shown in the above figures do not indicate or limit the temporal sequence of these processes. In addition, it is also easy to understand that these processes may be executed synchronously or asynchronously in multiple modules, for example.
下述为本申请装置实施例,可以用于执行本申请方法实施例。对于本申请装置实施例中未披露的细节,请参照本申请方法实施例。The following are device embodiments of the present application, which can be used to execute method embodiments of the present application. For details not disclosed in the device embodiments of this application, please refer to the method embodiments of this application.
图7是根据一示例性实施例示出的一种无侵入可插拔的前端构建转移提速装置的框图。如图7所示,无侵入可插拔的前端构建转移提速装置70包括:信息模块702,地址模块704,资源模块706,数据模块708,构建模块710。FIG. 7 is a block diagram of a non-invasive pluggable front-end construction transfer speed-up device according to an exemplary embodiment. As shown in FIG. 7 , the non-invasive and pluggable front-end construction and transfer speed-up device 70 includes: an information module 702 , an address module 704 , a resource module 706 , a data module 708 , and a construction module 710 .
信息模块702用于获取待进行前端构建的项目对应的项目信息;信息模块702还用于由预定的接口获取待进行前端构建的项目对应的项目标识、项目分支名称、提交标识。The information module 702 is used to obtain the project information corresponding to the project to be built on the front end; the information module 702 is also used to obtain the project identification, project branch name, and submission identification corresponding to the project to be built on the front end through a predetermined interface.
地址模块704用于通过所述项目信息获取所述项目对应的资源地址;地址模块704还用于通过所述项目信息中的项目标识、项目分支名称、提交标识在后台服务器中获取所述项目信息对应的记录文件;由所述记录文件中获取所述项目对应的资源地址。The address module 704 is used to obtain the resource address corresponding to the project through the project information; the address module 704 is also used to obtain the project information in the background server through the project identification, project branch name, and submission identification in the project information. The corresponding record file; obtain the resource address corresponding to the project from the record file.
资源模块706用于利用所述资源地址获取本地资源数据;资源模块706还用于通过所述资源地址由内容分发网络获取所述本地资源数据;将所述本地资源数据存储在待进行前端构建的项目的服务器本地。The resource module 706 is used to obtain the local resource data using the resource address; the resource module 706 is also used to obtain the local resource data from the content distribution network through the resource address; and store the local resource data in the to-be-built front-end Local to the project's server.
数据模块708用于根据所述本地资源数据生成前端构建数据;数据模 块708还用于在待进行前端构建的项目的服务器本地将所述资源数据解压缩,生成所述前端构建数据。The data module 708 is used to generate front-end construction data according to the local resource data; the data module 708 is also used to decompress the resource data locally on the server of the project to be front-end built, and generate the front-end construction data.
构建模块710用于将所述前端构建数据存储在预定位置以完成所述项目的前端构建。构建模块710还用于根据所述项目的项目信息确定目标平台和目标目录;将所述前端构建数据存储在所述目标平台的目标目录中以完成所述项目的前端构建。The building module 710 is used to store the front-end building data in a predetermined location to complete the front-end building of the project. The construction module 710 is also used to determine the target platform and target directory according to the project information of the project; store the front-end construction data in the target directory of the target platform to complete the front-end construction of the project.
根据本申请的无侵入可插拔的前端构建转移提速装置,通过获取待进行前端构建的项目对应的项目信息;通过所述项目信息获取所述项目对应的资源地址;利用所述资源地址获取本地资源数据;根据所述本地资源数据生成前端构建数据;将所述前端构建数据存储在预定位置以完成所述项目的前端构建的方式,能够兼容现有技术中的前端构建流程,在用户无感知的情况下提升前端构建效率,减少时间成本,提高用户满意度。According to the non-intrusive and pluggable front-end construction transfer speed-up device of the present application, the project information corresponding to the project to be built is obtained by obtaining the project information; the resource address corresponding to the project is obtained through the project information; and the local resource address is obtained using the resource address. Resource data; generating front-end construction data according to the local resource data; storing the front-end construction data in a predetermined location to complete the front-end construction of the project, which is compatible with the front-end construction process in the existing technology and is invisible to the user Improve front-end construction efficiency, reduce time costs, and improve user satisfaction.
图8是根据一示例性实施例示出的一种电子设备的框图。FIG. 8 is a block diagram of an electronic device according to an exemplary embodiment.
下面参照图8来描述根据本申请的这种实施方式的电子设备800。图8显示的电子设备800仅仅是一个示例,不应对本申请实施例的功能和使用范围带来任何限制。An electronic device 800 according to this embodiment of the present application is described below with reference to FIG. 8 . The electronic device 800 shown in FIG. 8 is only an example and should not impose any limitations on the functions and usage scope of the embodiments of the present application.
如图8所示,电子设备800以通用计算设备的形式表现。电子设备800的组件可以包括但不限于:至少一个处理单元810、至少一个存储单元820、连接不同系统组件(包括存储单元820和处理单元810)的总线830、显示单元840等。As shown in Figure 8, electronic device 800 is embodied in the form of a general computing device. The components of the electronic device 800 may include, but are not limited to: at least one processing unit 810, at least one storage unit 820, a bus 830 connecting different system components (including the storage unit 820 and the processing unit 810), a display unit 840, and the like.
其中,所述存储单元存储有程序代码,所述程序代码可以被所述处理单元810执行,使得所述处理单元810执行本说明书中的根据本申请各种示例性实施方式的步骤。例如,所述处理单元810可以执行如图3中所示的步骤。Wherein, the storage unit stores program code, and the program code can be executed by the processing unit 810, so that the processing unit 810 performs the steps in this specification according to various exemplary embodiments of the present application. For example, the processing unit 810 may perform steps as shown in FIG. 3 .
所述存储单元820可以包括易失性存储单元形式的可读介质,例如随机存取存储单元(RAM)8201和/或高速缓存存储单元8202,还可以进一步包括只读存储单元(ROM)8203。The storage unit 820 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 8201 and/or a cache storage unit 8202, and may further include a read-only storage unit (ROM) 8203.
所述存储单元820还可以包括具有一组(至少一个)程序模块8205的程序/实用工具8204,这样的程序模块8205包括但不限于:操作系统、一个或者多个应用程序、其它程序模块以及程序数据,这些示例中的每一个或某种组合中可能包括网络环境的实现。The storage unit 820 may also include a program/utility 8204 having a set of (at least one) program modules 8205 including, but not limited to: an operating system, one or more applications, other program modules, and programs. Data, each of these examples or some combination may include an implementation of a network environment.
总线830可以为表示几类总线结构中的一种或多种,包括存储单元总线或者存储单元控制器、外围总线、图形加速端口、处理单元或者使用多种总线结构中的任意总线结构的局域总线。 Bus 830 may be a local area representing one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, a graphics acceleration port, a processing unit, or using any of a variety of bus structures. bus.
电子设备800也可以与一个或多个外部设备800’(例如键盘、指向设备、蓝牙设备等)通信,使得用户能与该电子设备800交互的设备通信, 和/或该电子设备800能与一个或多个其它计算设备进行通信的任何设备(例如路由器、调制解调器等等)通信。这种通信可以通过输入/输出(I/O)接口850进行。并且,电子设备800还可以通过网络适配器860与一个或者多个网络(例如局域网(LAN),广域网(WAN)和/或公共网络,例如因特网)通信。网络适配器860可以通过总线830与电子设备800的其它模块通信。应当明白,尽管图中未示出,可以结合电子设备800使用其它硬件和/或软件模块,包括但不限于:微代码、设备驱动器、冗余处理单元、外部磁盘驱动阵列、RAID系统、磁带驱动器以及数据备份存储系统等。The electronic device 800 may also communicate with one or more external devices 800' (e.g., keyboard, pointing device, Bluetooth device, etc.) so that the user can communicate with the device that the electronic device 800 interacts with, and/or the electronic device 800 can communicate with a Any device (such as a router, modem, etc.) with which multiple other computing devices communicate. This communication may occur through input/output (I/O) interface 850. Furthermore, the electronic device 800 may also communicate with one or more networks (eg, a local area network (LAN), a wide area network (WAN), and/or a public network, such as the Internet) through a network adapter 860. Network adapter 860 may communicate with other modules of electronic device 800 via bus 830. It should be understood that, although not shown in the figures, other hardware and/or software modules may be used in conjunction with electronic device 800, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives And data backup storage system, etc.
通过以上的实施方式的描述,本领域的技术人员易于理解,这里描述的示例实施方式可以通过软件实现,也可以通过软件结合必要的硬件的方式来实现。因此,如图9所示,根据本申请实施方式的技术方案可以以软件产品的形式体现出来,该软件产品可以存储在一个非易失性存储介质(可以是CD-ROM,U盘,移动硬盘等)中或网络上,包括若干指令以使得一台计算设备(可以是个人计算机、服务器、或者网络设备等)执行根据本申请实施方式的上述方法。Through the above description of the embodiments, those skilled in the art can easily understand that the example embodiments described here can be implemented by software, or can be implemented by software combined with necessary hardware. Therefore, as shown in Figure 9, the technical solution according to the embodiment of the present application can be embodied in the form of a software product. The software product can be stored in a non-volatile storage medium (which can be a CD-ROM, U disk, mobile hard disk etc.) or on a network, including several instructions to cause a computing device (which can be a personal computer, a server, a network device, etc.) to execute the above method according to an embodiment of the present application.
所述软件产品可以采用一个或多个可读介质的任意组合。可读介质可以是可读信号介质或者可读存储介质。可读存储介质例如可以为但不限于电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。可读存储介质的更具体的例子(非穷举的列表)包括:具有一个或多个导线的电连接、便携式盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。The software product may take the form of any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination thereof. More specific examples (non-exhaustive list) of readable storage media include: electrical connection with one or more conductors, portable disk, hard disk, random access memory (RAM), read only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above.
所述计算机可读存储介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了可读程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。可读存储介质还可以是可读存储介质以外的任何可读介质,该可读介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。可读存储介质上包含的程序代码可以用任何适当的介质传输,包括但不限于无线、有线、光缆、RF等等,或者上述的任意合适的组合。The computer-readable storage medium may include a data signal propagated in baseband or as part of a carrier wave carrying readable program code therein. Such propagated data signals may take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A readable storage medium may also be any readable medium other than a readable storage medium that can transmit, propagate, or transport the program for use by or in connection with an instruction execution system, apparatus, or device. Program code contained on a readable storage medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the above.
可以以一种或多种程序设计语言的任意组合来编写用于执行本申请操作的程序代码,所述程序设计语言包括面向对象的程序设计语言—诸如Java、C++等,还包括常规的过程式程序设计语言—诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算设备上执行、部分地在用户设备上执行、作为一个独立的软件包执行、部分在用户计算设备上部 分在远程计算设备上执行、或者完全在远程计算设备或服务器上执行。在涉及远程计算设备的情形中,远程计算设备可以通过任意种类的网络,包括局域网(LAN)或广域网(WAN),连接到用户计算设备,或者,可以连接到外部计算设备(例如利用因特网服务提供商来通过因特网连接)。Program code for performing the operations of the present application may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., as well as conventional procedural formulas. Programming language—such as "C" or a similar programming language. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server execute on. In situations involving remote computing devices, the remote computing device may be connected to the user computing device through any kind of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., provided by an Internet service). (business comes via Internet connection).
上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被一个该设备执行时,使得该计算机可读介质实现如下功能:进行所述项目的本地构建;在本地构建完成后,生成本地构建数据;将所述本地构建数据传输到内容分发网络。得该计算机可读介质还可实现如下功能:获取待进行前端构建的项目对应的项目信息;通过所述项目信息获取所述项目对应的资源地址;利用所述资源地址获取本地资源数据;根据所述本地资源数据生成前端构建数据;将所述前端构建数据存储在预定位置以完成所述项目的前端构建。The above-mentioned computer-readable medium carries one or more programs. When the above-mentioned one or more programs are executed by a device, the computer-readable medium realizes the following functions: perform local construction of the project; after the local construction is completed, the computer-readable medium carries one or more programs. , generate local build data; transmit the local build data to the content distribution network. The computer-readable medium can also realize the following functions: obtain the project information corresponding to the project to be built on the front end; obtain the resource address corresponding to the project through the project information; obtain local resource data using the resource address; The local resource data generates front-end construction data; and the front-end construction data is stored in a predetermined location to complete the front-end construction of the project.
本领域技术人员可以理解上述各模块可以按照实施例的描述分布于装置中,也可以进行相应变化唯一不同于本实施例的一个或多个装置中。上述实施例的模块可以合并为一个模块,也可以进一步拆分成多个子模块。Those skilled in the art can understand that the above-mentioned modules can be distributed in devices according to the description of the embodiments, or can be modified accordingly in one or more devices that are only different from this embodiment. The modules of the above embodiments can be combined into one module, or further divided into multiple sub-modules.
通过以上的实施例的描述,本领域的技术人员易于理解,这里描述的示例实施例可以通过软件实现,也可以通过软件结合必要的硬件的方式来实现。因此,根据本申请实施例的技术方案可以以软件产品的形式体现出来,该软件产品可以存储在一个非易失性存储介质(可以是CD-ROM,U盘,移动硬盘等)中或网络上,包括若干指令以使得一台计算设备(可以是个人计算机、服务器、移动终端、或者网络设备等)执行根据本申请实施例的方法。Through the description of the above embodiments, those skilled in the art can easily understand that the example embodiments described here can be implemented by software, or can be implemented by software combined with necessary hardware. Therefore, the technical solution according to the embodiment of the present application can be embodied in the form of a software product. The software product can be stored in a non-volatile storage medium (which can be a CD-ROM, U disk, mobile hard disk, etc.) or on the network. , including several instructions to cause a computing device (which may be a personal computer, server, mobile terminal, or network device, etc.) to execute the method according to the embodiment of the present application.
以上具体地示出和描述了本申请的示例性实施例。应可理解的是,本申请不限于这里描述的详细结构、设置方式或实现方法;相反,本申请意图涵盖包含在所附权利要求的精神和范围内的各种修改和等效设置。Exemplary embodiments of the present application have been specifically shown and described above. It is to be understood that the present application is not limited to the detailed structures, arrangements, or implementation methods described herein; on the contrary, the present application is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims.

Claims (12)

  1. 一种无侵入可插拔的前端构建转移提速方法,其特征在于,包括:A non-intrusive and pluggable front-end construction transfer speed-up method, which is characterized by including:
    获取待进行前端构建的项目对应的项目信息;Obtain the project information corresponding to the project to be built on the front end;
    通过所述项目信息获取所述项目对应的资源地址;Obtain the resource address corresponding to the project through the project information;
    利用所述资源地址获取本地资源数据;Use the resource address to obtain local resource data;
    根据所述本地资源数据生成前端构建数据;Generate front-end build data according to the local resource data;
    将所述前端构建数据存储在预定位置以完成所述项目的前端构建。The front-end build data is stored in a predetermined location to complete the front-end build of the project.
  2. 如权利要求1所述的方法,其特征在于,获取待进行前端构建的项目对应的项目信息之前,还包括:The method according to claim 1, characterized in that before obtaining the project information corresponding to the project to be built on the front end, it further includes:
    进行所述项目的本地构建;Do a local build of said project;
    在本地构建完成后,生成本地构建数据;After the local build is completed, local build data is generated;
    将所述本地构建数据传输到内容分发网络。Transmit the locally built data to a content delivery network.
  3. 如权利要求2所述的方法,其特征在于,进行所述项目的本地构建,包括:The method of claim 2, wherein performing local construction of the project includes:
    从远程仓库拉取所述项目的代码;Pull the code of said project from the remote repository;
    在本地安装所述项目的依赖文件;Install the dependency files of the project locally;
    基于所述依赖文件和所述代码进行所述项目的本地构建。Perform a local build of the project based on the dependency files and the code.
  4. 如权利要求2所述的方法,其特征在于,将所述本地构建数据传输到内容分发网络,包括:The method of claim 2, wherein transmitting the locally constructed data to a content distribution network includes:
    将所述本地构建数据进行压缩,生成本地资源数据;Compress the local construction data to generate local resource data;
    对所述本地资源数据进行核验;Verify the local resource data;
    在核验通过后,将所述本地资源数据传输到所述内容分发网络。After passing the verification, the local resource data is transmitted to the content distribution network.
  5. 如权利要求1所述的方法,其特征在于,获取待进行前端构建的项目对应的项目信息,包括:The method according to claim 1, characterized in that obtaining project information corresponding to the project to be built on the front end includes:
    由预定的接口获取待进行前端构建的项目对应的项目标识、项目分支名称、提交标识。Obtain the project ID, project branch name, and submission ID corresponding to the project to be built on the front end through the predetermined interface.
  6. 如权利要求5所述的方法,其特征在于,通过所述项目信息获取所述项目对应的资源地址,包括:The method of claim 5, wherein obtaining the resource address corresponding to the project through the project information includes:
    通过所述项目信息中的项目标识、项目分支名称、提交标识在后台服务器中获取所述项目信息对应的记录文件;Obtain the record file corresponding to the project information from the backend server through the project identification, project branch name, and submission identification in the project information;
    由所述记录文件中获取所述项目对应的资源地址。Obtain the resource address corresponding to the project from the record file.
  7. 如权利要求1所述的方法,其特征在于,利用所述资源地址获取本地资源数据,包括:The method of claim 1, wherein using the resource address to obtain local resource data includes:
    通过所述资源地址由内容分发网络获取所述本地资源数据;Obtain the local resource data from the content distribution network through the resource address;
    将所述本地资源数据存储在待进行前端构建的项目的服务器本地。The local resource data is stored locally on the server of the project to be built as a front-end.
  8. 如权利要求7所述的方法,其特征在于,根据所述本地资源数据 生成前端构建数据,包括:The method of claim 7, wherein generating front-end construction data according to the local resource data includes:
    在待进行前端构建的项目的服务器本地将所述资源数据解压缩,生成所述前端构建数据。The resource data is decompressed locally on the server of the project to be built for front-end construction to generate the front-end construction data.
  9. 如权利要求1所述的方法,其特征在于,将所述前端构建数据存储在预定位置以完成所述项目的前端构建,包括:The method of claim 1, wherein storing the front-end construction data in a predetermined location to complete the front-end construction of the project includes:
    根据所述项目的项目信息确定目标平台和目标目录;Determine the target platform and target directory based on the project information of the project;
    将所述前端构建数据存储在所述目标平台的目标目录中以完成所述项目的前端构建。The front-end build data is stored in the target directory of the target platform to complete the front-end build of the project.
  10. 一种无侵入可插拔的前端构建转移提速装置,其特征在于,包括:A non-intrusive and pluggable front-end construction transfer speed-up device, which is characterized by including:
    信息模块,用于获取待进行前端构建的项目对应的项目信息;Information module, used to obtain project information corresponding to the project to be built on the front end;
    地址模块,用于通过所述项目信息获取所述项目对应的资源地址;The address module is used to obtain the resource address corresponding to the project through the project information;
    资源模块,用于利用所述资源地址获取本地资源数据;A resource module, used to obtain local resource data using the resource address;
    数据模块,用于根据所述本地资源数据生成前端构建数据;A data module used to generate front-end construction data based on the local resource data;
    构建模块,用于将所述前端构建数据存储在预定位置以完成所述项目的前端构建。A building module is used to store the front-end building data in a predetermined location to complete the front-end building of the project.
  11. 一种电子设备,其特征在于,包括:An electronic device, characterized by including:
    一个或多个处理器;one or more processors;
    存储装置,用于存储一个或多个程序;A storage device for storing one or more programs;
    当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现如权利要求1-9中任一所述的方法。When the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the method as described in any one of claims 1-9.
  12. 一种计算机可读介质,其上存储有计算机程序,其特征在于,所述程序被处理器执行时实现如权利要求1-9中任一所述的方法。A computer-readable medium on which a computer program is stored, characterized in that when the program is executed by a processor, the method according to any one of claims 1-9 is implemented.
PCT/CN2022/124463 2022-07-01 2022-10-10 Non-intrusive, pluggable front-end build transfer acceleration method and apparatus WO2024000917A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210773480.X 2022-07-01
CN202210773480.XA CN115291879A (en) 2022-07-01 2022-07-01 Non-intrusive pluggable front-end construction transfer acceleration method and device

Publications (1)

Publication Number Publication Date
WO2024000917A1 true WO2024000917A1 (en) 2024-01-04

Family

ID=83821922

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/124463 WO2024000917A1 (en) 2022-07-01 2022-10-10 Non-intrusive, pluggable front-end build transfer acceleration method and apparatus

Country Status (2)

Country Link
CN (1) CN115291879A (en)
WO (1) WO2024000917A1 (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090125874A1 (en) * 2007-11-12 2009-05-14 Abdelhadi Sanaa F Method and system for creating projects in a rational application developer workspace
CN111966390A (en) * 2020-07-08 2020-11-20 深圳市科脉技术股份有限公司 Project construction method, system, terminal device and storage medium
CN113760303A (en) * 2021-11-10 2021-12-07 杭州安恒信息技术股份有限公司 Processing method, device and equipment of micro front-end application resource and storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090125874A1 (en) * 2007-11-12 2009-05-14 Abdelhadi Sanaa F Method and system for creating projects in a rational application developer workspace
CN111966390A (en) * 2020-07-08 2020-11-20 深圳市科脉技术股份有限公司 Project construction method, system, terminal device and storage medium
CN113760303A (en) * 2021-11-10 2021-12-07 杭州安恒信息技术股份有限公司 Processing method, device and equipment of micro front-end application resource and storage medium

Also Published As

Publication number Publication date
CN115291879A (en) 2022-11-04

Similar Documents

Publication Publication Date Title
US9928050B2 (en) Automatic recognition of web application
KR20180122019A (en) Tools and methods for real-time data flow programming languages
US8826297B2 (en) Creating web services from an existing web site
CN112685029B (en) Method, device, equipment and storage medium for generating visual template
CN110858172A (en) Automatic test code generation method and device
CN111221572B (en) Method, device, medium and equipment for automatically adapting to running environment
CN109873735B (en) Performance test method and device for H5 page and computer equipment
CN112685035A (en) Project development method and device, computer-readable storage medium and electronic device
CN108984202B (en) Electronic resource sharing method and device and storage medium
CN110895471A (en) Installation package generation method, device, medium and electronic equipment
CN111324833A (en) Page display method, device, electronic design and computer readable medium
CN110795649A (en) Target page display method, device and system and electronic equipment
CN111338623A (en) Method, device, medium and electronic equipment for developing user interface
CN110928571A (en) Business program development method and device
CN114398673A (en) Application compliance detection method and device, storage medium and electronic equipment
CN110868324A (en) Service configuration method, device, equipment and storage medium
CN112631590A (en) Component library generation method and device, electronic equipment and computer readable medium
CN111414154A (en) Method and device for front-end development, electronic equipment and storage medium
CN113778897A (en) Automatic test method, device, equipment and storage medium of interface
CN112491940B (en) Request forwarding method and device of proxy server, storage medium and electronic equipment
CN112394907A (en) Container-based delivery system construction method, application delivery method and delivery system
CN111597059A (en) Interface calling request processing method and device and electronic equipment
WO2024000917A1 (en) Non-intrusive, pluggable front-end build transfer acceleration method and apparatus
CN114238831A (en) HTML code fragment processing method, system, electronic equipment and storage medium
CN113760706B (en) Webpage debugging method and device

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: 22949002

Country of ref document: EP

Kind code of ref document: A1