Building industry portal website efficient packaging deployment method and system, server and medium
Through a one-pack-to-end strategy, the packaging and deployment process of the construction industry portal website is optimized into one package, solving the problems of long packaging time and high server configuration, and achieving efficient packaging and deployment and stable operation.
Patent Information
- Application Number
- CN202510319255.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-18
- Publication Date
- 2025-08-01
AI Technical Summary
The construction industry portals have too long packaging and deployment time, high server configuration requirements and error-prone problems.
Using a one-pack-to-end strategy, we reduce the four sets of environmental release packages for development, testing, pre-release and formal operation into one package. By extracting environmental difference information and injecting it at runtime, we transform the reference variables in the source code, and set the environment variable injection point and injector to ensure the dynamic injection of environmental difference information at different stages.
Save server resources and packaging time, avoid packaging errors caused by environmental factors, and reduce testing costs.
Smart Images

Figure CN120406965A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to an efficient packaging and deployment method, system, server and medium for a portal website in the construction industry. Background Art
[0002] In the traditional website development process, when deploying website code, large-scale compilation work is not required. Only simple obfuscation and manual upload to the server are needed to complete the online deployment. With the popularization of modern website development models, the packaging and deployment of websites play an increasingly important role in development work. Usually, frameworks using various new technology solutions need to go through processes such as code inspection, external dependency introduction, framework layer compilation, language layer compilation, page unpacking, code hardening and obfuscation, static resource deployment, code finished product deployment, and gray-scale online. Especially for large and extra-large websites, the time consumed for packaging and deployment during the online process is getting longer and longer, and the server configuration required for packaging and deployment is also getting higher and higher. This has led to a sharp increase in the economic cost and time cost occupied by the packaging and deployment process in the application of large and extra-large websites.
[0003] Portal websites in the construction industry are a typical type of large and extra-large website applications, which are usually common in leading enterprises in the industry. As a typical means, they integrate digital resources within the industry and provide closed-loop digital and information data circulation within the industry. In the actual construction process, the packaging and deployment costs of portal websites in the construction industry remain high, which not only brings an economic burden to enterprises but also causes obstacles and time pressure to the actual delivery of projects. Summary of the Invention
[0004] To solve the problems of too long packaging time for portal websites in the construction industry, too high server configuration requirements for packaging and deployment, and easy errors in packaging and deployment results, the present invention provides an efficient packaging and deployment method for portal websites in the construction industry. Through an all-in-one strategy, the four sets of environment release packages for development, testing, pre-release, and formal operation are reduced to one package, saving server resources and packaging time, and avoiding packaging error problems introduced by environmental factors.
[0005] According to one aspect of the specification of the present invention, an efficient packaging and deployment method for a portal website in the construction industry is provided, including: Extracting environment difference information and mounting it into the global variables during page runtime, and modifying the parts in the source code that reference variables; Based on the modified code, setting environment difference information injection points; Setting an environment variable injector, injecting environment difference information at the injection points according to preset injection conditions, and completing the packaging and deployment of the portal website.
[0006] As a further technical solution, modify the part of the source code that references variables, including: Change the variables introduced in the code to variables obtained from the runtime global object.
[0007] As a further technical solution, set the environmental difference information injection points, including: Set global environmental variable injection, data injection of the page nodes rendered by the browser, and dynamic injection of the storage of environmental difference information on the server side.
[0008] As a further technical solution, set an environmental variable injector to inject environmental difference information at the injection points according to the preset injection conditions, including: In the initial stage of the operation of the portal website, use the global environmental variables as the first priority and the data of the page nodes rendered by the browser as the secondary priority.
[0009] As a further technical solution, set an environmental variable injector to inject environmental difference information at the injection points according to the preset injection conditions, including: After the portal website is started, use the environmental variable data obtained from the server side as the first priority and the global environmental variables as the secondary priority.
[0010] As a further technical solution, the method further includes: Add a script to the configuration file for packaging to modify the one - package - runs - through mechanism.
[0011] According to one aspect of the specification of the present invention, provide an efficient packaging and deployment system for a construction industry portal website, including: An environmental difference information extraction module, which is used to extract environmental difference information and mount it to the global variables during page runtime, and modify the part of the source code that references variables; An injection point setting module, which is used to set environmental difference information injection points based on the modified code; An injection module, which is used to set an environmental variable injector to inject environmental difference information at the injection points according to the preset injection conditions to complete the packaging and deployment of the portal website.
[0012] As a further technical solution, the system further includes: A one - package - runs - through deployment module, which is used to add a script to the configuration file for packaging to modify the one - package - runs - through mechanism.
[0013] According to one aspect of the specification of the present invention, provide a server, the server includes a processor and a memory; the memory stores at least one instruction, and the at least one instruction is used to be executed by the processor to implement the steps of the efficient packaging and deployment method for the construction industry portal website.
[0014] According to one aspect of the specification of the present invention, there is provided a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the efficient packaging and deployment method for a construction industry portal website as described above.
[0015] Compared with the prior art, the beneficial effects of the present invention are as follows: 1. Through the strategy of "one package for all", the present invention reduces the four sets of environment release packages for development, testing, pre-release, and formal operation to one package, so that the packaged finished product of the portal website changes from four packages in four environments originally to one package in four environments, saving 75% of storage resources, 75% of computing resources, and 75% of packaging time.
[0016] 2. The "one package for all" portal packaging and deployment method of the present invention ensures that the packaged finished product running in the formal environment must have been continuously tested in the development, testing, and pre-release environments, avoiding problems caused by packaging different packages due to environment differentiation and also saving testing costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings used in the description of the embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0018] Figure 1 FIG. is a schematic flow chart of an efficient packaging and deployment method for a construction industry portal website according to an embodiment of the present invention.
[0019] Figure 2 FIG. is a flow chart of an efficient packaging and deployment method for a construction industry portal website according to another embodiment of the present invention.
[0020] Figure 3 FIG. is a schematic structural diagram of an efficient packaging and deployment system for a construction industry portal website according to an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0021] In some processes described in the specification, claims, and the above-mentioned drawings of the present invention, there are multiple operations that appear in a specific order. However, it should be clearly understood that these operations may not be executed in the order in which they appear in this document or may be executed in parallel. For example, step 1, step 2, etc. are only used to distinguish different operations, and the serial numbers themselves do not represent any execution order. In addition, these processes may include more or fewer operations, and these operations may be executed in sequence or in parallel.
[0022] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts belong to the scope protected by the present invention.
[0023] The construction industry portal website is a typical large-scale or extra-large-scale website application, and there are the following problems in its packaging and deployment: 1. The packaging time is too long, resulting in high time costs; 2. The configuration requirements of the packaging and deployment machines are high, resulting in high economic costs; the packaging and deployment results are prone to errors, resulting in high human testing costs.
[0024] To solve the above problems, the present invention provides a method for efficient packaging and deployment of a construction industry portal website. Through the strategy of "one package to the end", the four sets of environment release packages for development, testing, pre-release, and formal operation are reduced to one package, saving server resources and packaging time, and at the same time avoiding the problem of packaging errors introduced by environmental factors.
[0025] The core idea of the present invention is: "one package to the end". That is, regardless of the development, testing, pre-release, and formal operation environments, the same website packaging finished product is used, and only the environmental difference information is injected during operation, rather than injecting it during packaging as in the traditional case. In this way, the release packages of the original 4 sets of environments are reduced to one package, saving server resources and packaging time. Using the same package for development, testing, and pre-release testing can avoid the problem of packaging errors caused by environmental factors.
[0026] The method for efficient packaging and deployment of a construction industry portal website described in the embodiments of the present invention, as Figure 1 , specifically includes the following steps: Step 1, extract environmental difference information.
[0027] Normally, this information is maintained in the configuration files, environment variables, etc. of the project. Mount these variables to the global variables (Window) during page runtime, and modify the parts of the source code that reference variables, changing the variables introduced in the code to variables obtained from the runtime global object.
[0028] Step 2, environmental variable injection method.
[0029] After the code transformed in Step 1 is compiled, it cannot run directly and needs to inject the environmental difference information before it can be used. To enhance the stability of the program, the embodiments of the present invention have set a total of three injection methods: global variable injection and data attribute injection of the page nodes rendered by the browser. In addition, dynamic injection of the storage of environmental difference information is also set on the server side. The three methods assist each other to jointly ensure the normal operation of the construction industry portal website.
[0030] Step 3, Environment Variable Injection Judger.
[0031] Set an environment variable injection judger in the portal website to ensure that the three mechanisms designed in Step 2 do not conflict with each other and at the same time play the role of dynamic arrangement of environment variables.
[0032] The specific mechanism can be briefly summarized as follows: In the initial stage of the operation of the portal website, since the data of the server needs to be transmitted through the network at this time, the global environment variable is given the highest priority, and the data of the page nodes rendered by the browser is given the second priority. After the portal website is started, the server environment variable data is obtained, and the server environment variable data is given the highest priority. If some environment variables are not obtained by the server, the global variables and the variables of the page nodes rendered by the browser are taken.
[0033] In summary, through the above three steps, the transformation work of the portal website applicable to the construction industry with "one package to the end" can be basically completed. This solution can save server space and the number of packaging times, save server resources, and at the same time ensure that the packages released online must have been tested in different environments through the "one package to the end" process, greatly reducing the testing investment.
[0034] As a preferred embodiment, taking an open portal of China State Construction Third Engineering Bureau as an example, first find four files, namely.env.dev.,.env.test.,.env.pre, and.env.prod, which are used to store environment variables in the code. Before the transformation, the packaging and deployment process needs to read information from 4 environment variable files and package 4 times respectively. As Figure 2 shown, the present invention makes the following transformation to this project (taking the service address gaodeURL of Amap as an example): Step 1, transform the code that obtains information from the env file in the project to obtain it from the window global variable.
[0035] Before transformation: import gaodeURL from “env”; After transformation: const gaodeURL = window.gaodeURL.
[0036] Step 2, set the injection point.
[0037] The global variable injection point is set as follows: Add the following code to index.html: <script>window.gaodeURL=@gaodeURL;< / script> .
[0038] The page label data injection point is set as follows: Add the following code to the page label body of index.html: 。
[0039] The server - side data injection points are to be handled by the back - end personnel.
[0040] Step 3, add a variable injection judge at the page running entry.
[0041] The specific code is not elaborated. The basic logic is as follows: Initial run: Global variable > Page label data > Server - side data; Successful startup: Server - side data > Global variable > Page label data.
[0042] Step 4, transform the all - in - one running mechanism.
[0043] Add a section of shell script in the Dockerfile (configuration file for packaging) of the project to dynamically modify the value of the placeholder @gaodeURL when docker run (running and starting).
[0044] The implementation basis of each embodiment of the present invention is achieved through programmed processing by a device with processor functions. Therefore, in engineering practice, the technical solutions and functions of each embodiment of the present invention are encapsulated into various modules. Based on this actual situation, on the basis of the above - mentioned embodiments, an embodiment of the present invention provides an efficient packaging and deployment system for a construction industry portal website, which is used to execute an efficient packaging and deployment method for a construction industry portal website in the above - mentioned method embodiments.
[0045] See Figure 3 , the system includes: an environment difference information extraction module, which is used to extract environment difference information and mount it into the global variables during page running, and transform the part of the source code that references variables; an injection point setting module, which is used to set environment difference information injection points based on the transformed code; an injection module, which is used to set an environment variable injector to inject environment difference information at the injection points according to the pre - set injection conditions to complete the packaging and deployment of the portal website.
[0046] An efficient packaging and deployment system for a construction industry portal website provided by an embodiment of the present invention aims at the problems of too long packaging time for a construction industry portal website, too high server configuration requirements for packaging and deployment, and easy errors in the packaging and deployment results. It adopts Figure 3 several modules among them, and through the all - in - one strategy, reduces the four sets of environment release packages for development, testing, pre - release, and formal operation to one package, saving server resources and packaging time, and avoiding packaging error problems caused by environmental factors.
[0047] It should be noted that the system embodiments provided by the present invention are used not only to implement the methods in the above method embodiments, but also to implement the methods in other method embodiments provided by the present invention. The difference lies only in setting corresponding functional modules, and its principle is basically the same as that of the above system embodiments provided by the present invention. As long as those skilled in the art, based on the above system embodiments, refer to the specific technical solutions in other method embodiments, obtain corresponding technical means by combining technical features, and the technical solutions constituted by these technical means, and on the premise of ensuring the practicability of the technical solutions, improve the modules in the above system embodiments to obtain corresponding system-like embodiments for implementing the methods in other method-like embodiments. For example: Based on the content of the above device embodiments, as a preferred embodiment, a high-efficiency packaging and deployment system for a construction industry portal website provided in the embodiments of the present invention further includes: A one-pack deployment module, which is used to add scripts to the configuration file for packaging and transform the one-pack operation mechanism.
[0048] Based on the same inventive concept as the above embodiments, the embodiments of the present invention further provide a server, which includes a processor and a memory; the memory stores at least one instruction, and the at least one instruction is used to be executed by the processor to implement the steps of the high-efficiency packaging and deployment method for the construction industry portal website.
[0049] In the embodiments of the present invention, the memory can be a non-volatile memory, such as a hard disk drive (HDD) or a solid-state drive (SSD), etc., or a volatile memory, such as a random-access memory (RAM). The memory is any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory in the embodiments of the present invention can also be a circuit or any other device capable of implementing a storage function, for storing program instructions and / or data.
[0050] In the embodiments of the present invention, the processor can be a general-purpose processor, a digital signal processor, an application-specific integrated circuit, a field-programmable gate array or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, and can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiments of the present invention. The general-purpose processor can be a microprocessor or any conventional processor, etc. The steps of the method disclosed in combination with the embodiments of the present invention can be directly embodied as being executed by a hardware processor, or executed by a combination of hardware and software modules in the processor.
[0051] Based on the same inventive concept as the above embodiments, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the efficient packaging and deployment method for a construction industry portal website are as follows: Extract the environmental difference information and mount it into the global variables during page runtime, and transform the parts in the source code that reference variables; Based on the transformed code, set the environmental difference information injection points; Set up an environmental variable injector, and inject the environmental difference information at the injection points according to the preset injection conditions to complete the packaging and deployment of the portal website.
[0052] In summary of the above embodiments, the key technical points of the present invention are: 1. Transforming the environmental variables of local compilation into a method of runtime injection; 2. The design of three injection points during runtime; 3. The design of a variable injection judge; 4. The "one-package-for-all" portal packaging and deployment method.
[0053] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements on some or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the technical solutions of the embodiments of the present invention.
Claims
1. An efficient packaging and deployment method for a construction industry portal website, characterized in that Including: Extract environmental difference information and mount it to the global variable during page runtime, and modify the part of the source code that references variables; Based on the modified code, set the injection points for environmental difference information; Set up an environment variable injector to inject environmental difference information at the injection points according to pre-set injection conditions, and complete the packaging and deployment of the portal website.
2. The efficient packaging and deployment method of the construction industry portal website according to claim 1, characterized in that Modify the part of the source code that references variables, including: Change the variables introduced in the code to variables obtained from the runtime global object.
3. The efficient packaging and deployment method of the construction industry portal website according to claim 1, wherein, Set the injection points for environmental difference information, including: Set global environmental variable injection, data injection for page nodes rendered by the browser, and dynamic injection of storage of environmental difference information on the server side.
4. The efficient packaging and deployment method of the construction industry portal website according to claim 1, characterized in that Set up an environment variable injector to inject environmental difference information at the injection points according to pre-set injection conditions, including: In the initial stage of the portal website operation, use the global environmental variable as the first priority and the data of the page nodes rendered by the browser as the secondary priority.
5. The efficient packaging and deployment method of the construction industry portal website according to claim 1, characterized in that, Set up an environment variable injector to inject environmental difference information at the injection points according to pre-set injection conditions, including: After the portal website starts, use the environmental variable data obtained from the server as the first priority and the global environmental variable as the secondary priority.
6. The method for efficient packaging and deployment of a construction industry portal website according to claim 1, wherein The method further includes: Add a script to the configuration file for packaging and modify the one-pack run mechanism.
7. An efficient packaging and deployment system for construction industry portal websites, characterized in that, Including: An environmental difference information extraction module for extracting environmental difference information and mounting it to the global variable during page runtime, and modifying the part of the source code that references variables; An injection point setting module for setting the injection points for environmental difference information based on the modified code; An injection module for setting up an environment variable injector to inject environmental difference information at the injection points according to pre-set injection conditions and complete the packaging and deployment of the portal website.
8. The efficient packaging and deployment system for the construction industry portal website according to claim 7, characterized in that, The system further includes: A one-pack deployment module for adding a script to the configuration file for packaging and modifying the one-pack run mechanism.
9. A server, characterized in that, The server includes a processor and a memory; the memory stores at least one instruction, and the at least one instruction is used to be executed by the processor to implement the steps of the method for efficient packaging and deployment of a construction industry portal website as described in any one of claims 1 to 6.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the method for efficient packaging and deployment of a construction industry portal website as described in any one of claims 1 - 6.