WEB offline update package upgrading method based on script technology, medium and equipment
Through the WEB offline update package upgrade method based on scripting technology, the problem of lack of unified standards for packaging in offline scenarios and inefficient manual copy updates is solved, and efficient and accurate software updates and version management are achieved.
Patent Information
- Application Number
- CN202411807482.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-10
- Publication Date
- 2025-03-18
AI Technical Summary
In offline scenarios, WEB project packaging lacks unified standards, manual copy and update methods are inefficient and prone to errors, resulting in missed file updates, replacement errors, configuration modification errors, and file errors.
The WEB offline update package upgrade method based on scripting technology includes configuration and preparation, source code processing and comparison, packaging and archiving, and performing upgrades. This method automatically completes the upgrade copy through scripts, generates differential packages, and compresses and archives to ensure the accuracy and efficiency of the upgrade process.
It improves the efficiency of software updates and reduces the error rate, providing a new update strategy for offline updates of WEB projects, ensuring the accuracy of version management and the convenience of distribution.
Smart Images

Figure CN119645474A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of software development, and in particular relates to a WEB offline update package upgrade method, medium and equipment based on script technology. Background Art
[0002] In the field of software development, software package creation is a crucial step. The software package not only creates an installer for the application, but also integrates the system resources necessary for the program to run properly. The realization of this process relies on software packaging technology, which can be roughly divided into two ways: one is to start from scratch and comprehensively collect and integrate all necessary files; the other is to customize existing software packages to meet specific application needs.
[0003] Software packaging technology brings many benefits. First, it ensures the stability and standardization of the software installation and upgrade process, thereby significantly reducing compatibility issues and potential conflicts. In addition, by simplifying the upgrade process, this technology also helps to reduce support costs. More importantly, carefully packaged upgrade packages can be distributed more conveniently, greatly facilitating the installation and upgrade of software by R&D personnel, operation and maintenance personnel, and technical support teams.
[0004] In the software development process, packaging is indispensable. It integrates the source code and all dependent resources into one installation package, which greatly facilitates the distribution and installation of software. It is already quite mature for packaging tools for executable files (such as EXE). However, for WEB projects, packaging software has not yet formed a unified standard. Especially in offline scenarios, file updates currently rely mainly on manual copying, which is not only inefficient but also prone to errors. Specifically, manual copying requires replacing files or modifying configurations one by one according to specific S. In this process, problems such as missing file updates, replacement errors, configuration modification errors, and accidental file deletion may occur.
[0005] Therefore, the problem to be solved by the present invention is to develop a technical method or tool that can achieve efficient and accurate program packaging by standardizing the packaging format, file structure and installation process. Summary of the invention
[0006] In order to solve the pain points that the WEB project packaging lacks a unified standard in offline scenarios, and the manual copy update method is inefficient and prone to errors, the present invention comes into being. According to one aspect of the present invention, a WEB offline update package upgrade method based on script technology is provided, which is characterized by comprising the following steps:
[0007] S1: Configuration and preparation, used to configure packaging information and test the basic environment;
[0008] S2: Source code processing and comparison, used to obtain and process source code, compare between versions to determine differences; S3: Packaging and archiving, used to generate difference packages based on the comparison results, and compress and archive them;
[0009] S4: Execute upgrade, used to execute version upgrade operation.
[0010] The above-mentioned WEB offline update package upgrade method based on script technology also includes: configuring packaging information including: version number specification, warehouse label management, warehouse address configuration, warehouse address for saving labels, and custom update package name.
[0011] The above-mentioned WEB offline update package upgrade method based on script technology also includes: obtaining and processing source code including injecting corresponding compilation instructions according to the relevant technology used in the source code to perform compilation operations, realizing the separation of dependent libraries and resource configuration files during the compilation process, and packaging and storing the compilation results in the compilation result directory as the basic data for subsequent version comparison.
[0012] The above-mentioned WEB offline update package upgrade method based on script technology also includes: the comparison between versions to determine the differences includes performing a difference comparison between the compilation results of the basic version and the current packaged version to generate a differential comparison result file; parsing the differential comparison result file, packaging the newly added and changed files into a comparison result directory, and constructing a deletion script based on the extracted deletion file list, and packaging this script into the comparison result directory; after the comparison results are packaged, all temporary and process files are deleted.
[0013] The above-mentioned WEB offline update package upgrade method based on script technology also includes: S3 includes generating a difference package according to the difference package directory structure based on the comparison results, and compressing it into a compressed package format of the specified version difference package; dynamically creating a label of the current packaged version according to the configuration information, and archiving it in the warehouse.
[0014] The above-mentioned WEB offline update package upgrade method based on script technology also includes: generating a difference package according to the difference package directory structure in S3 includes:
[0015] S31: Build a script directory to store differential scripts for performing differential update operations during version upgrades;
[0016] S32: Build a template directory, which contains the template files that need to be updated in the new version;
[0017] S33: Build a backend service code directory to store the full code, incremental dependency packages, difference deletion scripts, and configuration files of the backend project;
[0018] S34: Build a front-end service code directory to store the front-end engineering code.
[0019] The above-mentioned WEB offline update package upgrade method based on script technology also includes: S4 includes completing the version update by executing a series of predefined upgrade operations, or triggering the entire upgrade process through one operation.
[0020] The above-mentioned script-based WEB offline update package upgrade method further includes: predefined upgrade operations include:
[0021] S41: Automatically modify the system basic configuration files and template files through the upgrade script;
[0022] S42: Automatically detect the consistency between the database address to be upgraded and the system service configuration address, and execute script updates in sequence after the addresses are consistent, including executing script updates that do not need to be upgraded for subsequent versions, backing up and archiving historical scripts, executing current version scripts and customized scripts, and saving execution logs to a specified log file, and printing unknown error logs;
[0023] S43: When upgrading the system service code, first stop the service, create a backup directory for backup, then delete the files not needed for the current version, update the service code, and restart the service after the update is complete;
[0024] S44: When upgrading the front-end project, first back up the production environment code, then update the front-end project code, and restore the backed-up front-end code production environment configuration file after the update to ensure that the updated front-end project has the production environment configuration.
[0025] According to another aspect of the present invention, there is provided a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the method according to any one of claims 1 to 8 when executed.
[0026] According to another aspect of the present invention, there is provided a computer device, comprising a processor, a memory and a computer program stored in the memory, wherein the processor implements the method described in any one of claims 1 to 8 when executing the computer program.
[0027] The present invention provides a method for making a WEB offline update package based on script technology. Compared with the traditional method, a method and tool are realized that can make a software update package with one-key upgrade and WEB service characteristics based on configuration and script. This method and tool not only improves the efficiency of software update, but also greatly reduces the error rate, and provides a new update strategy for offline update of WEB projects. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] The accompanying drawings, which are incorporated into the specification and constitute a part of the specification, illustrate embodiments of the present invention and are used to explain the principles of the present invention together with the relevant text description. In these drawings, similar reference numerals are used to represent similar elements. The drawings described below are some embodiments of the present invention, but not all embodiments. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without paying creative work.
[0029] Figure 1 A flow chart of a method for de-identifying numerical data provided by an embodiment of the present invention is shown.
[0030] Figure 2 A flow chart of a method for de-identifying and reversely restoring numerical data provided by an embodiment of the present invention is shown.
[0031] Figure 3 The invention is a block diagram of a computer device according to an exemplary embodiment. DETAILED DESCRIPTION
[0032] In order to make the purpose, technical scheme and advantages of the embodiments of the present invention clearer, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention. It should be noted that the embodiments in this application and the features in the embodiments can be combined with each other arbitrarily without conflict.
[0033] For executable software such as EXE, packaging tools are relatively mature. For WEB projects, there is no unified standard for packaging software. In offline scenarios, manual copying is more often used to replace files or modify configurations one by one according to specific steps, which may lead to omissions in file updates, replacement errors, configuration modification errors, and accidental deletion of files. In order to solve the pain point of manual copying, this embodiment aims to form a solution that automatically completes the upgrade copy by scripts, and solves the problem of automatic generation of offline update packages.
[0034] An embodiment of the present invention provides a method for preparing a WEB offline update package based on script technology, comprising:
[0035] Step 1: Configuration and preparation, used to configure packaging information and test the basic environment. The purpose of this step is to perform configuration and preparation work before packaging, including configuring the information required for packaging and testing to ensure that the basic environment meets the packaging requirements, laying the foundation for the subsequent software packaging process.
[0036] Since making an offline update package requires comparison and archiving backup, multiple strategies are needed to determine the packaging result. In this step, preferably, the configuration packaging information includes: version number specification, warehouse label management, warehouse address configuration, warehouse address for saving labels, and custom update package name. Users who interact with it clearly specify the new and old version numbers, whether warehouse labels need to be created after packaging, the front-end and back-end warehouse addresses of the packaging, the warehouse address where the labels need to be saved, the name of the update package after packaging, and other related packaging configuration information through configuration. This not only improves the accuracy and efficiency of offline update package production, but also optimizes version control and management processes, enhances the convenience and accuracy of the distribution and installation process, and reduces the cost of software maintenance and updates.
[0037] Next, after the user has clarified the relevant packaging configuration information, the packaging tool will start executing, and its primary task is to check the status of the basic environment. Basic environment detection includes checking the source code checkout directory, packaging directory, compilation result directory, comparison result directory, etc. The purpose is to detect whether the source code checkout directory is clean and ensure the correctness of the packaging code; check whether the compilation result directory exists, whether there are hidden files in the packaging directory, and whether the comparison result directory exists. If it exists, it needs to be deleted first. These steps are designed to ensure the accuracy of subsequent packaging operations and produce pure results. If the environment detection finds an abnormality, the packaging process will be terminated immediately.
[0038] Step 2: Source code processing and comparison, used to obtain and process source code, compare between versions to determine differences.
[0039] After confirming that there is no abnormality in the basic environment, start this step, that is, the detection and comparison process of the source code. This process first injects the corresponding compilation instructions according to the relevant technologies used in the source code. First, the system needs to identify the programming language, framework and library used by the source code. For example, if the source code is written in Java and the Spring framework is used, then the compilation instructions need to be related to Java and Spring. Based on the identified technology stack, the system will automatically select or generate suitable compilation instructions. For Java, this may be the javac command plus a series of parameters, such as classpath, output directory, etc.
[0040] Separating dependency libraries from resource configuration files during compilation means that compilation instructions can correctly handle external dependencies in source code and manage them separately from source code. At the same time, resource configuration files (such as database connection information, application server settings, etc.) will be separated from source code so that they can be flexibly configured during deployment.
[0041] Finally, the source code is compiled using the selected compilation instructions. This process converts the source code into executable files or library files and stores these files in a specific directory (the "compilation result directory") for subsequent version comparison and difference package generation.
[0042] In another embodiment of the present invention, Gradle is preferably used as a building tool, and the source code compilation task is efficiently completed with the help of a customized build.gradle configuration file and bootJar instructions.
[0043] Preferably, after the compilation is completed, the system will automatically package the compilation results into a preset compilation result directory as a benchmark for subsequent version difference comparisons. Whenever the system executes a new download and compilation task, a new base version will be generated. Subsequently, the system will perform a detailed comparison of the compilation results of the current packaged version with the base version to accurately identify the differences between the versions.
[0044] During the comparison process, the system will generate a differential comparison result file, which records the newly added and changed file information in detail. By deeply parsing this file, the system can accurately package the differential files into the comparison result directory and build a deletion script based on the deleted file list to facilitate subsequent operations.
[0045] Finally, to ensure the accuracy and continuity of the comparison, the system will thoroughly clean up the process files to prevent residual files from interfering with subsequent comparisons. The refined operation of this step not only significantly improves the accuracy of version comparison, but also lays a solid foundation for subsequent version management, distribution and installation processes.
[0046] In order to explain the actual operation process of the present invention in detail, a key code will be introduced below and its function will be explained.
[0047]
[0048]
[0049] This code mainly implements the functions of comparing, parsing and packaging file differences between versions. By executing this code, the system can automatically complete the tedious version difference comparison work, greatly improving the efficiency and accuracy of version management. Specifically, the code first compares the files in the two version directories through the diff command to quickly generate a differential comparison result file. This step improves the efficiency and accuracy of version difference identification. Next, the file is parsed to accurately identify the newly added and changed files and copy them to a specially established comparison result directory, thereby simplifying the complexity of file management. In addition, a special deletion script is constructed based on the extracted deletion file list, and this script will then be packaged into the comparison result directory, so that after the comparison results are packaged, the system automatically deletes all temporary and process files, thereby effectively saving storage space and ensuring the clarity, neatness and efficiency of the entire version management process.
[0050] Step 3: Packaging and archiving, which is used to generate a difference package based on the comparison results, and then compress and archive it. This step is to generate a difference package based on the comparison results, and then compress and archive it to facilitate subsequent version management and upgrade operations.
[0051] Preferably, the comparison results are generated into a difference package according to the difference package directory structure, and compressed into a compressed package format of a specified version difference package; a label of the current packaged version is dynamically created according to the configuration information, and archived in the warehouse. This step significantly improves the efficiency and accuracy of version management. By accurately comparing the compilation results, the system can identify and extract the difference between the front-end project and the back-end project, and then generate a compact and efficient difference package. This difference package not only reduces the demand for storage space, but also accelerates the process of version upgrade and rollback. Further, compressing these difference packages into a compressed package format of a specified version difference package not only effectively reduces the time and cost of data transmission, but also enhances the security of data. In a distributed system or cloud computing environment, this compressed package can be transmitted and deployed faster, thereby improving the response speed and flexibility of the overall system. In addition, by dynamically creating a label of the current packaged version according to the configuration information, a specific packaged version can be easily identified and retrieved, and archived in the warehouse, ensuring the security and traceability of the data, and providing great convenience for version tracking and auditing as a whole.
[0052] Preferably, during the packaging process, the server caches the compilation results so that when performing version updates and difference comparisons, these cached results can be used to reduce repeated compilation work, thereby improving comparison efficiency. When the server receives a packaging request, it first checks whether there is a cache of previous compilation results. If there is cached data related to the current request, the server will directly use this cached data for subsequent comparison and packaging operations without recompiling. This process not only saves compilation time, but also reduces the computing load on the server.
[0053] In addition, to ensure the accuracy and consistency of cached data, the server will periodically verify and update the cache. When the source code changes, the server will recompile and update the corresponding cache data. This dynamic update mechanism ensures the consistency of cached data with the latest source code, thereby ensuring the accuracy of version updates and difference comparisons.
[0054] By introducing the compilation result cache mechanism, this embodiment not only improves the efficiency of the packaging process, but also brings significant performance improvements for version updates and difference comparisons. This improvement makes the entire system more efficient and flexible, and can better adapt to the fast-iterative software development environment.
[0055] Preferably, generating a difference package according to the difference package directory structure includes:
[0056] S31: Build a script directory to store differential scripts for performing differential update operations during version upgrades;
[0057] S32: Build a template directory, which contains the template files that need to be updated in the new version;
[0058] S33: Build a backend service code directory to store the full code, incremental dependency packages, difference deletion scripts, and configuration files of the backend project;
[0059] S34: Build a front-end service code directory to store the front-end engineering code.
[0060] The composition and structure of the difference package are described in detail below.
[0061] First, the script directory of the difference package contains the difference scripts between the current version and the comparison version. These scripts are the key to version upgrades. They can automatically identify and apply the differences between the two versions, thus ensuring the accuracy and efficiency of the upgrade process.
[0062] Secondly, the template directory contains the template files that need to be updated. These template files play a vital role in the upgrade process. They provide the necessary framework and structure for the system so that the upgraded system can maintain a consistent appearance and function.
[0063] Furthermore, the backend service code directory is another important part of the difference package. This directory stores the full code of the backend project, incremental dependency packages, difference deletion scripts, and configuration files. These elements together ensure the integrity and consistency of the backend service, so that the backend service can transition smoothly during the upgrade process without service interruption or data loss.
[0064] In addition, the front-end service code directory is also an indispensable part. It stores the front-end engineering code, which is responsible for presenting the user interface and handling user interactions. During the upgrade process, the files in the front-end service code directory will be updated to provide new features and improved user experience.
[0065] The ingenious design and structure of the difference package provide great convenience and efficiency for version upgrades. The script directory, template directory, backend service code directory, and frontend service code directory in the difference package each play a key role and work together to ensure that the version upgrade is carried out efficiently and accurately.
[0066] Step 4: Execute the upgrade, which is used to execute the version upgrade operation. Preferably, the version update can be completed by executing a series of predefined upgrade operations, or the entire upgrade process can be triggered by one operation. This design not only provides flexibility, but also ensures the controllability of the upgrade process. Users can perform the upgrade operation step by step according to the specific situation, so as to better monitor and debug the execution of each step. At the same time, the function of triggering the entire upgrade process with one click provides great convenience for users and greatly simplifies the complexity of the upgrade operation.
[0067] Preferably, the predefined upgrade operations include: S41: automatically executing the modification of the system basic configuration file and template file through the upgrade script; S42: automatically detecting the consistency of the database address to be upgraded and the system service configuration address, and executing the script update in sequence after the address is consistent, including executing the script update that does not need to be upgraded in the subsequent version, backing up the historical script, executing the current version script and the customized script, and saving the execution log to the specified log file, and printing the unknown error log; S43: when upgrading the system service code, first stop the service, create a backup directory for backup, then delete the files that are not needed in the current version, update the service code, and restart the service after the update is completed; S44: when upgrading the front-end project, first back up the production environment code, then update the front-end project code, and restore the backed-up front-end code production environment configuration file after the update to ensure that the updated front-end project has the production environment configuration. It is worth mentioning that the upgrade process is recorded in detail in the log file to ensure the efficiency and reliability of the deployment, which is particularly suitable for offline environments. When executing these predefined upgrade operations, the system will automatically check the execution status of each step to ensure that each step is correct.
[0068] Figure 2 is a schematic diagram of a template directory structure according to an exemplary embodiment. It can be seen that the difference package also includes relevant scripts for executing update1_config.sh, update2 db.sh, update3 service.sh, and update4 web.sh. These scripts allow users to choose to execute corresponding upgrade operations as needed, thereby realizing a flexible version upgrade method.
[0069] To further improve the upgrade efficiency, the difference package also provides a one-click update script update_al l l.sh. With this script, users can complete all upgrade operations at one time without having to execute the update1 to update4 scripts one by one. This greatly simplifies the upgrade process, reduces the complexity of operations, and improves the productivity of R&D and operation and maintenance personnel.
[0070] The embodiment of the present invention constructs a highly customizable packaging system by adopting template technology and script technology, which not only simplifies the upgrade operation, but also greatly improves the upgrade efficiency through incremental difference packages and one-click upgrade functions, and achieves wide applicability in various server platforms and cloud environments, reducing the complexity of migration and deployment between systems.
[0071] Furthermore, the present invention also implements a one-click packaging function based on configuration, reduces manual intervention, and automatically creates version backups, ensuring the security and reliability of the upgrade process. This automation mechanism not only improves production efficiency, but also provides support for rapid troubleshooting of production environment problems. The present invention also significantly optimizes the process of code difference comparison by introducing a server-side compilation cache mechanism, making it more efficient and friendly, which not only improves the comparison efficiency, but also provides strong support for a fast-iterative software development environment.
[0072] In summary, the present invention has achieved remarkable technical effects in terms of cross-platform versatility, ease of operation, automation and reliability. With the rise of front-end and back-end separation technology, this solution, with its lightweight, templated and automated characteristics, is closely connected with cutting-edge technologies and shows broad application prospects. Not only that, its versatility and abstractness mean that it can be widely used in product development in various industries, bringing more efficient and flexible work experience to software technology practitioners. It has now been successfully implemented in multiple products, and its effectiveness has been fully verified.
[0073] An embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed, implements the steps of the method for de-identifying and reversely restoring numerical data provided by an embodiment of the present invention.
[0074] Figure 3 3 is a block diagram of a computer device 300 for a method of de-identifying and reversing numerical data according to an exemplary embodiment. For example, the computer device 300 may be provided as a server. Figure 3 The computer device 300 includes a processor 301, and the number of processors can be set to one or more as needed. The computer device 300 also includes a memory 302 for storing instructions that can be executed by the processor 301, such as application programs. The number of memories can be set to one or more as needed. The application programs stored therein can be one or more. The processor 301 is configured to execute instructions to execute the above-mentioned numerical data de-identification and reverse restoration method.
[0075] Those skilled in the art will appreciate that the embodiments herein can be provided as methods, devices (equipment), or computer program products. Therefore, this paper can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, this paper can adopt the form of a computer program product implemented on one or more computer-usable storage media in which a computer-usable program code is included. Computer storage media include volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules or other data), including but not limited to RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disk (DVD) or other optical disk storage, magnetic cassette, magnetic tape, disk storage or other magnetic storage device, or any other medium that can be used to store desired information and can be accessed by a computer, etc. In addition, it is well known to those of ordinary skill in the art that communication media generally include computer-readable instructions, data structures, program modules or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium.
[0076] This document is described with reference to flowcharts and / or block diagrams of methods, apparatuses (devices) and computer program products according to the embodiments of this document. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0077] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 Functions specified in one or more boxes
[0078] These computer program instructions may also be loaded onto a computer or other programmable data processing device so that a series of operations S are performed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 S of functions specified in one or more boxes.
[0079] In this article, the term "comprises", "comprising" or any other variation thereof is intended to cover non-exclusive inclusion, so that an article or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such article or device. In the absence of more restrictions, the elements defined by the sentence "comprising..." do not exclude the presence of other identical elements in the article or device comprising the elements.
[0080] Although the preferred embodiments of this invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of this invention.
[0081] Obviously, those skilled in the art can make various changes and modifications to this article without departing from the spirit and scope of this article. Thus, if these modifications and variations of this article fall within the scope of the claims and their equivalents, then the intention of this article also includes these modifications and variations.
Claims
1. A WEB offline update package upgrade method based on script technology, characterized in that: The following steps are involved: S1: Configuration and preparation, used to configure packaging information and test the basic environment; S2: Source code processing and comparison, used to obtain and process source code, compare versions and determine differences; S3: Packaging and archiving, used to generate a difference package based on the comparison results, and compress and archive it; S4: Execute upgrade, used to execute version upgrade operation.
2. According to the method of claim 1, the configuration packaging information comprises: Version number specification, warehouse tag management, warehouse address configuration, warehouse address for saving tags, and custom update package name.
3. The method according to claim 1, wherein obtaining and processing source code comprises: According to the relevant technology used in the source code, the corresponding compilation instructions are injected to perform the compilation operation. During the compilation process, the dependent library and the resource configuration file are separated, and the compilation results are packaged and stored in the compilation result directory as the basic data for subsequent version comparison.
4. According to the method of claim 1, the comparing between versions to determine the differences comprises: Compare the compilation results of the base version and the current packaged version to generate a differential comparison result file; Parse the differential comparison result file, package the newly added and changed files into the comparison result directory, and build a deletion script according to the extracted deletion file list, and package the script into the comparison result directory; After the comparison results are packaged, delete all temporary and process files.
5. The method according to claim 1, wherein: S3 includes: generating a difference package based on the comparison results according to the difference package directory structure, and compressing it into the compressed package format of the specified version difference package; dynamically creating a label for the current packaged version based on the configuration information, and archiving it to the warehouse.
6. The method according to claim 1, wherein: The difference packages generated in S3 according to the difference package directory structure include: S31: Build a script directory to store differential scripts for performing differential update operations during version upgrades; S32: Build a template directory, which contains the template files that need to be updated in the new version; S33: Build a backend service code directory to store the full code, incremental dependency packages, difference deletion scripts, and configuration files of the backend project; S34: Build a front-end service code directory to store the front-end engineering code.
7. The method according to claim 1, wherein: S4 includes: completing the version update by executing a series of predefined upgrade operations, or triggering the entire upgrade process through a single operation.
8. The method according to claim 7, wherein the predefined upgrade operation comprises: S41: Automatically modify the system basic configuration files and template files through the upgrade script; S42: Automatically detect the consistency between the database address to be upgraded and the system service configuration address, and execute script updates in sequence after the addresses are consistent, including executing script updates that do not need to be upgraded for subsequent versions, backing up and archiving historical scripts, executing current version scripts and customized scripts, and saving execution logs to a specified log file, and printing unknown error logs; S43: When upgrading the system service code, first stop the service, create a backup directory for backup, then delete the files not needed for the current version, update the service code, and restart the service after the update is complete; S44: When upgrading the front-end project, first back up the production environment code, then update the front-end project code, and restore the backed-up front-end code production environment configuration file after the update to ensure that the updated front-end project has the production environment configuration.
9. A computer-readable storage medium having a computer program stored thereon, wherein: When the computer program is executed, the method according to any one of claims 1 to 8 is implemented.
10. A computer device comprising a processor, a memory and a computer program stored in the memory, wherein: When the processor executes the computer program, the method according to any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Method, device and server for upgrading multi-component software based on git
CN109144548A
Software version management method and device
CN109426516A
Upgrading method and device, electronic equipment and medium
CN114625473A
Code publishing method and related equipment
CN116243958A
Application deployment method and device in offline environment, electronic equipment and storage medium
CN117931214A