Software system deployment method and device, electronic equipment and computer program product

By using incremental comparison strategies to generate incremental deployment packages in software system deployment, the reliability and efficiency of incremental update solutions in the existing technology are solved, and more efficient and accurate software system deployment is achieved.

CN120104170APending Publication Date: 2025-06-06中国邮政储蓄银行股份有限公司
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411913670.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-24
Publication Date
2025-06-06

AI Technical Summary

Technical Problem

When the existing incremental update solutions take into account both versatility and flexibility, there are problems of low reliability and low update efficiency, and the degree of automation of the deployment process needs to be further improved and optimized.

Method used

By obtaining the project deployment package, using the preset incremental comparison strategy to incremental comparison files in the latest deployment package and files in the last deployment package, generate incremental deployment packages, and transfer them to the target deployment path for incremental deployment.

Benefits of technology

This method can accurately identify file changes, reduce the amount of data transmitted and stored, reduce the possibility of deployment errors, and improve deployment accuracy and efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120104170A_ABST
    Figure CN120104170A_ABST
Patent Text Reader

Abstract

The invention discloses a software system deployment method and device, electronic equipment and a computer program product, and the method comprises the steps: obtaining a project deployment package, and the project deployment comprises a latest deployment package and a last deployment package of a project; performing incremental comparison on the files in the latest deployment package and the files in the last deployment package by using a preset incremental comparison strategy to obtain an incremental comparison result; generating an increment deployment package according to the increment comparison result, wherein the increment deployment package comprises at least one of modified file content, newly added file content and deleted file information; and transmitting the incremental deployment packet to the target deployment path for incremental deployment. According to the software system deployment method, the change condition of the file can be accurately recognized through a strict increment comparison strategy, the change content is packaged into the increment deployment package, the refined processing mode not only reduces the amount of data transmitted and stored, but also reduces the possibility of deployment errors, and the deployment efficiency is improved. And the deployment precision and efficiency are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of software system deployment, and in particular to a software system deployment method, device, electronic device, and computer program product. Background Art

[0002] In the release process of software systems, full deployment is a common practice. By packaging the entire project and replacing it in the target environment, the stability and consistency of the upgrade can be guaranteed. However, for large applications, each full deployment not only consumes a lot of network bandwidth and storage space, but also has a long release cycle, which affects the system update speed and user experience. In the actual project upgrade process, often only some source files need to be modified. If the compiled files corresponding to the changed parts of the source files are packaged and redeployed online (i.e. incremental deployment), it can effectively improve efficiency.

[0003] However, existing incremental update solutions usually rely on programmers to complete the work manually, such as recording the modified source files, data structure script files, compiled files, etc. Existing automated incremental deployment solutions fail to take into account both versatility and flexibility, and still have problems such as low reliability and low update efficiency. The degree of automation of the deployment process also needs to be further improved and optimized. Summary of the invention

[0004] The embodiments of the present application provide a software system deployment method, device, electronic device, and computer program product to reduce resource consumption in transmitting software system deployment packages and improve software system deployment efficiency.

[0005] The present application embodiment adopts the following technical solutions:

[0006] In a first aspect, an embodiment of the present application provides a software system deployment method, the software system deployment method comprising:

[0007] Obtain a project deployment package, wherein the project deployment includes the latest deployment package and the last deployment package of the project;

[0008] Performing an incremental comparison on the files in the latest deployment package and the files in the last deployment package using a preset incremental comparison strategy to obtain an incremental comparison result;

[0009] Generate an incremental deployment package according to the incremental comparison result, wherein the incremental deployment package includes at least one of information of modified file content, newly added file content, and deleted file;

[0010] The incremental deployment package is transferred to the target deployment path for incremental deployment.

[0011] Optionally, after obtaining the project deployment package, the software system deployment method further includes:

[0012] Setting the files in the latest deployment package as files in the source folder, and setting the files in the previous deployment package as files in the target folder;

[0013] All files in the source folder and the target folder are traversed respectively, and corresponding path information is generated and stored for each file in the source folder and the target folder.

[0014] Optionally, performing an incremental comparison on the files in the latest deployment package and the files in the last deployment package using a preset incremental comparison strategy to obtain an incremental comparison result includes:

[0015] Obtain path information and MD5 values ​​of files in the latest deployment package and files in the last deployment package;

[0016] An incremental comparison is performed on the files in the latest deployment package and the files in the last deployment package according to the path information and MD5 value of the files and a file difference comparison algorithm to obtain an incremental comparison result.

[0017] Optionally, performing incremental comparison on the files in the latest deployment package and the files in the last deployment package according to the path information and MD5 value of the files and a file difference comparison algorithm to obtain the incremental comparison result includes:

[0018] Compare the path information of the file in the latest deployment package with the path information of the file in the previous deployment package to obtain a file path comparison result;

[0019] If the file path comparison result is that the file corresponding to the path information only exists in the latest deployment package, then determine the change type as a new file and record the new file content and the corresponding path information;

[0020] If the file path comparison result is that the file corresponding to the path information only exists in the last deployment package, then determine that the change type is file deletion and record the path information corresponding to the deleted file;

[0021] If the file path comparison result is that the path information is the same, an incremental comparison is performed on the files in the latest deployment package and the files in the previous deployment package according to the MD5 value of the file and a file difference comparison algorithm to obtain an incremental comparison result.

[0022] Optionally, performing an incremental comparison on the files in the latest deployment package and the files in the last deployment package according to the MD5 value of the file and a file difference comparison algorithm to obtain an incremental comparison result includes:

[0023] Compare the MD5 value of the file in the latest deployment package with the MD5 value of the file in the previous deployment package;

[0024] If the MD5 values ​​are different, the change type is determined to be a modified file and the modified file content and corresponding path information are recorded;

[0025] If the MD5 values ​​are the same, the file difference comparison algorithm is used to perform an incremental comparison on the files in the latest deployment package and the files in the last deployment package to obtain an incremental comparison result.

[0026] Optionally, performing an incremental comparison on the files in the latest deployment package and the files in the last deployment package using the file difference comparison algorithm to obtain an incremental comparison result includes:

[0027] Determine the file types in the latest deployment package and the last deployment package;

[0028] An incremental comparison is performed on the files in the latest deployment package and the files in the last deployment package using a file difference comparison algorithm corresponding to the file type to obtain an incremental comparison result.

[0029] Optionally, generating an incremental deployment package according to the incremental comparison result includes:

[0030] Determining a change type according to the incremental comparison result;

[0031] If the change type is file modification, the modified file content and corresponding path information are added to the incremental deployment package;

[0032] If the change type is adding a new file, then the new file content and corresponding path information are added to the incremental deployment package;

[0033] If the change type is file deletion, the file marking information of the deleted file is added to the incremental deployment package.

[0034] In a second aspect, an embodiment of the present application further provides a software system deployment device, the software system deployment device comprising:

[0035] An acquisition unit, used to acquire a project deployment package, wherein the project deployment includes the latest deployment package and the last deployment package of the project;

[0036] An incremental comparison unit, used to perform an incremental comparison on the files in the latest deployment package and the files in the last deployment package using a preset incremental comparison strategy to obtain an incremental comparison result;

[0037] A generating unit, configured to generate an incremental deployment package according to the incremental comparison result, wherein the incremental deployment package includes at least one of information of modified file content, newly added file content, and deleted file;

[0038] The transmission unit is used to transmit the incremental deployment package to the target deployment path for incremental deployment.

[0039] In a third aspect, an embodiment of the present application further provides an electronic device, including:

[0040] A processor; and a memory arranged to store computer executable instructions, which, when executed, cause the processor to perform any of the software system deployment methods described above.

[0041] In a fourth aspect, an embodiment of the present application further provides a computer program product, including a computer program or instructions, which, when executed by a processor, implements any of the aforementioned software system deployment methods.

[0042] At least one of the above technical solutions adopted in the embodiments of the present application can achieve the following beneficial effects: the software system deployment method of the embodiments of the present application first obtains the project deployment package, and the project deployment includes the latest deployment package and the last deployment package of the project; then the files in the latest deployment package and the files in the last deployment package are incrementally compared using a preset incremental comparison strategy to obtain an incremental comparison result; then an incremental deployment package is generated according to the incremental comparison result, and the incremental deployment package includes at least one of the information of modifying file content, adding new file content, and deleting files; finally, the incremental deployment package is transmitted to the target deployment path for incremental deployment. The software system deployment method of the embodiments of the present application can accurately identify the changes of files through a strict incremental comparison strategy, and package these changes into an incremental deployment package for incremental deployment at the file level. This refined processing method not only reduces the amount of data transmitted and stored, but also reduces the possibility of deployment errors, and improves the accuracy and efficiency of deployment. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0044] Figure 1 A flowchart of a software system deployment method in an embodiment of the present application;

[0045] Figure 2 A schematic diagram of a software system deployment process in an embodiment of the present application;

[0046] Figure 3This is a structural diagram of a software system deployment device in an embodiment of the present application;

[0047] Figure 4 This is a schematic diagram of the structure of an electronic device in an embodiment of the present application. DETAILED DESCRIPTION

[0048] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in combination with the specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.

[0049] The technical solutions provided by various embodiments of the present application are described in detail below in conjunction with the accompanying drawings.

[0050] The main technical terms involved in this application are as follows:

[0051] 1) JAVA project deployment package: In the software system, the JAVA project deployment package (also called release package or distribution package) is a collection of files in a specific format. A typical JAVA project deployment package usually contains the following necessary components: dependency libraries, that is, third-party libraries (Jar files) required for project operation; resource files, property files (.properties), XML configuration files, log configuration files (log4j.properties or logback.xml), images and other media resources, etc.; scripts, that is, Shell files required to run or manage applications (such as start and stop scripts); configuration files, usually including configuration files for different environments, such as development environment, test environment, production environment database connection settings, API keys, etc. By building and deploying JAVA project deployment packages, JAVA applications can run stably in a production environment.

[0052] 2) Full deployment: This deployment method requires all the contents of the JAVA application (including all jar packages, library files, resource files, and configurations, etc.) to be deployed to the target server. Both newly added functions and unchanged parts will be redeployed.

[0053] 3) Incremental deployment: In contrast to full deployment, incremental deployment only updates the parts that have been added or modified since the last deployment. Usually, only the modified Jar package, some updated resource files, and necessary configuration files need to be replaced.

[0054] 4) File MD5 value: Each file has a unique MD5 hash value. Even a small change, such as changing a character in the file, will produce a completely different MD5 value.

[0055] For small or simple application systems, full deployment is a suitable choice. When the project scale is small, replacing the entire application usually does not bring too much risk or complexity. However, for large or complex application systems, if the scope of change is not large, choosing full deployment may introduce greater potential risks and challenges. The main disadvantages are as follows:

[0056] 1) High resource consumption and long time consumption: Replacing the entire application usually involves a large amount of file transfer and configuration, which consumes a lot of bandwidth, storage and computing resources, takes a long time, and leads to inefficient upgrades.

[0057] 2) Large impact and high risk: Full deployment requires updating all application files. The upgrade process will introduce more potential problems and risks. Any small error or conflict may cause the entire application to become unstable or crash. If problems or errors occur, serious consequences such as data loss and service interruption may occur.

[0058] 3) Limiting technological innovation: Full deployment usually requires the entire application or system to use a unified technology platform and solution. This may limit the team's ability to introduce new technologies or frameworks, hindering technological innovation and flexibility.

[0059] 4) Difficulty in rolling back: Although full deployment can be rolled back with the backup strategy, rolling back the entire application is still a complex and time-consuming process, especially when multiple versions or multiple components are involved. Rolling back is very difficult.

[0060] For application upgrades, an automated incremental deployment method is a more appropriate choice. Incremental deployment only updates the changed files, which can reduce deployment time, impact scope, and resource consumption, while reducing risks and increasing flexibility.

[0061] The prior art provides some automated incremental deployment methods, but these methods fail to take into account both versatility and flexibility, and still have problems such as low reliability and low update efficiency. In addition, the degree of automation of the deployment process also needs to be further improved and optimized.

[0062] Based on this, the present application embodiment provides a software system deployment method, such as Figure 1 As shown, a flowchart of a software system deployment method in an embodiment of the present application is provided, and the software system deployment method at least includes the following steps S110 to S140:

[0063] Step S110, obtaining a project deployment package, wherein the project deployment includes the latest deployment package and the last deployment package of the project.

[0064] Combination Figure 2 , a schematic diagram of a software system deployment process in an embodiment of the present application is provided. The software system deployment method in the embodiment of the present application is an automated incremental deployment method. The principle of incremental deployment is to only update the changed parts since the last deployment. Therefore, it is necessary to first obtain a project deployment package from a version management system (such as Git), etc. The project deployment package can be a Jar package or a War package, including the latest version of the project deployment package and the last successfully deployed package, as the basis for subsequent incremental comparison.

[0065] Step S120, performing an incremental comparison on the files in the latest deployment package and the files in the last deployment package using a preset incremental comparison strategy to obtain an incremental comparison result.

[0066] When performing an incremental comparison, it is necessary to use the set incremental comparison strategy to perform an incremental comparison of the files in the latest deployment package and the files in the previous deployment package, compare the changes in the latest version of the deployment package compared to the previous version of the deployment package, and obtain the incremental comparison results. The incremental comparison results may include the type of file changes between the latest deployment package and the previous deployment package, such as modified files, new files, deleted files, and file renamed.

[0067] The above incremental comparison strategy is a multi-dimensional step-by-step comparison strategy. By setting the multi-dimensional step-by-step comparison strategy, on the one hand, the accuracy of the incremental comparison can be improved through multi-dimensional strict comparison rules, and on the other hand, the efficiency of the incremental comparison can be improved through the step-by-step comparison rules and reduce resource consumption.

[0068] Step S130, generating an incremental deployment package according to the incremental comparison result, wherein the incremental deployment package includes at least one of information of modified file content, newly added file content, and deleted file.

[0069] After obtaining the incremental comparison results, the changed files that need to be deployed and their related information can be packaged into an incremental deployment package in combination with the specific deployment strategy and configuration information of the software system. The incremental deployment package can be, for example, a ZIP file or other compressed format, which can contain copies of the changed files and metadata information (such as file lists, change types, source version and target version information, etc.). The metadata information is used to verify the integrity and correctness of the files during the deployment process.

[0070] Step S140: transmitting the incremental deployment package to the target deployment path for incremental deployment.

[0071] You can enable the incremental synchronization mode to achieve automatic synchronization of incremental deployment packages. When the incremental synchronization mode detects the generation of incremental deployment packages, the incremental deployment packages can be automatically synchronized to the deployment path specified by the target server. The specified deployment path can be one computing node or multiple computing nodes. When transmitting incremental packages, you can also use secure transmission protocols (such as HTTPS, SSH, etc.) to protect data security.

[0072] After receiving the incremental deployment package, the target deployment path can first parse the deployment parameters provided by the user, generate automated deployment commands, then decompress the incremental deployment package in the target environment, use scripts or automated tools to perform deployment operations, complete backup operations and go offline, and start new applications to ensure consistency and repeatability. Finally, the automated tool executes successfully and the deployment is completed.

[0073] The software system deployment method of the embodiment of the present application can accurately identify file changes through a strict incremental comparison strategy, and package these changes into an incremental deployment package. This refined processing method not only reduces the amount of data transmitted and stored, but also reduces the possibility of deployment errors, thereby improving the accuracy and efficiency of deployment.

[0074] In some embodiments of the present application, after obtaining the project deployment package, the software system deployment method also includes: setting the files in the latest deployment package as files in the source folder, and setting the files in the previous deployment package as files in the target folder; traversing all files in the source folder and the target folder respectively, and generating and storing corresponding path information for each file in the source folder and the target folder.

[0075] The incremental deployment process is to deploy the differences between the current latest version of the deployment package and the previous version of the deployment package to the target node. Therefore, you can unzip the files in the latest deployment package into a folder, which is set as the source folder, and unzip the files in the previous deployment package into another folder, which is set as the target folder.

[0076] For the source folder and the target folder, the directory structure of the folder is traversed respectively, and the file list of the source folder and the file list of the target folder are extracted. For example, a recursive function or a file system API can be used to traverse all the folders and subfolders in the source folder and the target folder respectively, and then a unique path identifier is generated for each file in the source folder, which can be a relative path relative to the source folder, and a unique path identifier is generated for each file in the target folder, which can be a relative path relative to the target folder. Therefore, for files existing in the same directory location of the source folder and the target folder, the corresponding file path information is the same. Finally, all the file path information of the generated source folder and the target folder is uniformly stored as the basis for subsequent incremental comparison.

[0077] In addition, an empty list may be created to store the difference file information obtained in the subsequent incremental comparison process, which may include, for example, the file path information and the corresponding change type such as deletion, addition, renaming, modification, etc.

[0078] The embodiment of the present application generates unique path information for each file in the source folder and the target folder, thereby providing a basis for subsequent incremental comparison and achieving preliminary identification of file changes in the two folders.

[0079] In some embodiments of the present application, the incremental comparison of the files in the latest deployment package and the files in the previous deployment package using a preset incremental comparison strategy to obtain the incremental comparison result includes: obtaining the path information and MD5 values ​​of the files in the latest deployment package and the files in the previous deployment package; performing an incremental comparison of the files in the latest deployment package and the files in the previous deployment package according to the path information and MD5 values ​​of the files and a file difference comparison algorithm to obtain an incremental comparison result.

[0080] The incremental comparison strategy designed in the embodiment of the present application is mainly composed of three dimensions: the path information of the file, the MD5 value, and the file difference comparison algorithm. The path information of the file can be generated based on the aforementioned embodiment. The MD5 value of the file is a hash value generated based on the content of the file. After the MD5 value of the file is calculated for the first time, the MD5 value of the calculated file can be stored using a cache mechanism. The subsequent comparison process does not need to be recalculated, thereby accelerating the subsequent comparison process. Of course, how to calculate the MD5 value of the file can be flexibly determined by those skilled in the art in combination with the prior art, and other hash value calculation methods such as SHA-1, SHA-256, etc. can also be used according to demand, which are not listed here one by one.

[0081] The file difference comparison algorithm is an algorithm for file content comparison that is further set up based on the above two dimensions. Since the operation of the file difference comparison algorithm consumes more resources than the comparison of file path information and MD5 values, the file difference comparison algorithm can be used as a backup comparison strategy. When the file content changes cannot be determined based on the file path information and MD5 value, the file difference comparison algorithm needs to be further used for judgment, thereby improving the accuracy of incremental comparison and the accuracy of software system deployment.

[0082] In some embodiments of the present application, the incremental comparison of the files in the latest deployment package and the files in the previous deployment package is performed according to the path information and MD5 value of the files and the file difference comparison algorithm to obtain the incremental comparison result, which includes: comparing the path information of the files in the latest deployment package with the path information of the files in the previous deployment package to obtain the file path comparison result; if the file path comparison result is that the file corresponding to the path information only exists in the latest deployment package, then determining the change type as a new file and recording the new file content and the corresponding path information; if the file path comparison result is that the file corresponding to the path information only exists in the previous deployment package, then determining the change type as a deleted file and recording the path information corresponding to the deleted file; if the file path comparison result is that the path information is the same, then performing an incremental comparison of the files in the latest deployment package and the files in the previous deployment package according to the MD5 value of the file and the file difference comparison algorithm to obtain the incremental comparison result.

[0083] Based on the above embodiment, the file path information represents the specific location of a file in the folder directory structure. Therefore, when performing incremental comparison, the path information of each file in the two folders can be compared first. If the file path information in the two folders has the following two situations, the change type of added files and deleted files can be identified:

[0084] 1) The file path information only appears in the source folder: that is, the file corresponding to the file path information only exists in the source folder but not in the target folder, indicating that the file belongs to the source folder, that is, the file newly added in the latest deployment package. The path information of the file and the complete content of the newly added file can be recorded in the difference list created above.

[0085] 2) The file path information only appears in the target folder: that is, the file corresponding to the file path information only exists in the target folder but not in the source folder, indicating that the file belongs to the source folder, that is, the file deleted in the latest deployment package. The path information and other file information of the file can be recorded in the difference list.

[0086] If the path information of each file in two folders is consistent, on the one hand, it means that the two folders have the same total number of files, that is, the situation of newly added and deleted files is excluded. On the other hand, it means that the number of files contained in each directory location of the two folders is also the same, that is, the directory structure of the folders is consistent.

[0087] Although the same file path information can confirm the above content, it cannot directly determine that the content of each corresponding file in the two folders is the same. Therefore, it is necessary to further combine the MD5 value of the file and the file difference comparison algorithm to perform incremental comparison on the corresponding files in the two folders to obtain the final incremental comparison result.

[0088] In some embodiments of the present application, the incremental comparison of the files in the latest deployment package and the files in the previous deployment package is performed based on the MD5 value of the file and the file difference comparison algorithm to obtain the incremental comparison result, which includes: comparing the MD5 value of the file in the latest deployment package with the MD5 value of the file in the previous deployment package; if the MD5 values ​​are different, determining the change type as file modification and recording the modified file content and corresponding path information; if the MD5 values ​​are the same, using the file difference comparison algorithm to perform an incremental comparison of the files in the latest deployment package and the files in the previous deployment package to obtain an incremental comparison result.

[0089] In the case of the same file path information, it is necessary to further combine the file's MD5 value and the file difference comparison algorithm to perform an incremental comparison of the files in the two folders. The file's MD5 value and the file difference comparison algorithm are both difference comparison strategies for the file content, but the MD5 algorithm itself has certain limitations, because the hash value generated by MD5 is limited in length (128 bits), and theoretically there are infinite different inputs that can generate the same hash value. The file difference comparison algorithm needs to compare the entire content of the two files to determine whether there is a difference, which consumes relatively more resources.

[0090] Based on this, in order to further reduce the consumption of comparison resources and improve the comparison efficiency on the basis of improving the accuracy of incremental comparison, the embodiment of the present application can first compare the MD5 values ​​of two files with the same file path in two folders. If the MD5 values ​​of the two files are different, it must mean that the contents of the two files are inconsistent, indicating that the file in the source folder has been modified. The file path information and the complete content of the modified file can be recorded in the difference list.

[0091] If the MD5 values ​​of two files with the same file path in two folders are also the same, considering the limitations of the MD5 algorithm itself, it is necessary to further use the file difference comparison algorithm to perform a detailed comparison of the two file contents to determine whether the file contents have changed.

[0092] Through a multi-dimensional, progressive comparison process based on the path information, MD5 value and file difference comparison algorithm of the above files, the accuracy of incremental comparison is improved, while the efficiency of incremental comparison is improved and resource consumption is reduced.

[0093] In some embodiments of the present application, the use of the file difference comparison algorithm to perform an incremental comparison on the files in the latest deployment package and the files in the previous deployment package to obtain the incremental comparison result includes: determining the file types in the latest deployment package and the previous deployment package; using the file difference comparison algorithm corresponding to the file type to perform an incremental comparison on the files in the latest deployment package and the files in the previous deployment package to obtain the incremental comparison result.

[0094] Since the file contents of project deployment packages are obviously different, different file comparison algorithms can be selected for different file types, and file types can be distinguished based on file names. For example, for pom.xml files, a line-based difference comparison algorithm can be used. The line-based difference comparison algorithm can handle changes in structured text, and the file content can be split by line and compared line by line. For a.class files, a block-based difference comparison algorithm can be used. The block-based difference comparison algorithm can handle changes in binary data, and the file content can be divided into a series of fixed-size or dynamic-size blocks and compared in blocks.

[0095] In addition, in order to ignore irrelevant differences, a filtering algorithm can be added before the difference comparison algorithm to process special characters such as spaces, line breaks, comments, etc. to reduce false positives and unnecessary deployment operations.

[0096] By selecting the appropriate comparison algorithm based on the file type, the differences between files can be identified more accurately, reducing the possibility of false positives and false negatives, improving the accuracy of incremental comparison, and making the deployment process more flexible.

[0097] In some embodiments of the present application, generating an incremental deployment package based on the incremental comparison result includes: determining the change type based on the incremental comparison result; if the change type is file modification, adding the modified file content and corresponding path information to the incremental deployment package; if the change type is new file addition, adding the new file content and corresponding path information to the incremental deployment package; if the change type is file deletion, adding the file marker information of the deleted file to the incremental deployment package.

[0098] After obtaining the incremental comparison results based on the aforementioned embodiments, the corresponding incremental deployment packaging operation can be performed according to the compared file change types. Here, you need to first create a new compressed file (such as a compressed file format such as ZIP) to store the incremental deployment package. For each modified file, the entire modified file can be directly added to the compressed file, and the file path information is attached. There is no need to identify and add the specific modified file content here. This is mainly to reduce the possibility of subsequent deployment errors and to facilitate rollback after deployment errors. In the actual incremental deployment scenario, file-level incremental deployment can significantly reduce the amount of data transmitted compared to full deployment or folder-level incremental deployment.

[0099] For each newly added file, its complete contents can be added to the compressed file along with the file path information. For each deleted file, a special file marker or record can be added to the compressed file indicating that the file has been deleted.

[0100] Finally, the compressed file is created and saved as an incremental deployment package, which contains information about all changed parts for subsequent incremental deployment.

[0101] In some embodiments of the present application, an automation script can be written to automatically monitor folder changes and synchronization processes, and a trigger mechanism can be set in the automation script, such as a scheduled task (cron job) or file system event monitoring (Inotify), which automatically triggers the synchronization of the incremental deployment package when the folder content changes.

[0102] Continue to refer Figure 2 In some embodiments of the present application, the incremental comparison process can also be recorded in a log record. For example, detailed information of the file comparison process can be monitored, including file comparison results, conflict handling, etc. When an error is encountered during the file comparison process, the error information is recorded and appropriate error handling is performed. According to preset conditions (such as successful comparison, error, conflict, or reaching a specific threshold, etc.), a notification and alarm mechanism can be set to notify relevant personnel to proceed to the next step through a scheduled task.

[0103] Continue to refer Figure 2 In some embodiments of the present application, after the incremental deployment is completed, the deployed target node can also perform a verification step to ensure that the application runs normally in the target environment. Perform manual checks and performance tests to ensure that the performance and functionality of the application meet the requirements, run automated test suites, and check the application logs to find potential errors or warnings.

[0104] Continue to refer Figure 2In some embodiments of the present application, some performance optimization strategies are also designed during the incremental deployment of the target node. For example, access rights to the target environment can be restricted to ensure that only authorized users can perform deployment operations; when traversing folders and comparing files, possible errors such as file transfer failure, file access rights, insufficient disk space, etc. can be handled. A rollback mechanism can also be provided to back up all key files and databases by backing up the target environment, recording deployment steps and status, and when a problem occurs in the deployment, a rollback script is triggered by an automated tool, including restoring files, configurations, and databases, so that the previous state can be restored when a problem occurs.

[0105] In summary, the key points and technical effects of the software system deployment method of this application mainly include:

[0106] 1) Versatility

[0107] This application can be applied to a variety of scenarios and meet a variety of needs. Whether it is an individual user or an enterprise organization, as long as there is a need to upgrade the software program, this application can be used to complete automated rapid incremental deployment. File types, folder sizes, synchronization frequency and strategies, etc. can be flexibly adjusted by writing configuration scripts. In addition, it can also be integrated with other systems, such as version control systems (git), backup systems, continuous integration / continuous deployment processes, etc., to achieve more extensive automation.

[0108] 2) Security

[0109] This application has taken a variety of measures to ensure the security and integrity of the data. First, through a strict file comparison mechanism, only files that have changed are synchronized, avoiding unnecessary data transmission and exposure risks. Secondly, encryption technology is used during the synchronization process to protect the security of data during transmission and prevent data from being intercepted or tampered with. In addition, access rights and authentication mechanisms are added to limit access and operations to synchronized folders to ensure that only authorized personnel can perform synchronization tasks. Finally, through logging and error handling mechanisms, potential security issues can be discovered and handled in a timely manner to ensure the integrity and reliability of data.

[0110] 3) Accurate file difference identification and incremental package generation

[0111] Traditional incremental deployment solutions often only focus on adding, deleting, and modifying files, but do not do in-depth processing of specific changes within the files. This application uses a strict file comparison algorithm and automated deployment process to accurately identify file differences and package these differences into incremental packages. This refined processing method not only reduces the amount of data transmitted and stored, but also improves the accuracy of deployment and reduces the possibility of errors.

[0112] 4) Lightweight incremental package design and transmission

[0113] In the generation of incremental packages, a lightweight compression format is used, which helps to reduce the size of incremental packages, reduce network bandwidth consumption, speed up transmission, and reduce downtime. At the same time, lightweight incremental packages are also easier to manage and store, which improves the efficiency of development iterations and facilitates the deployment of large-scale projects.

[0114] 5) Highly automated and configurable

[0115] In terms of implementation, the automation and configurability of the incremental deployment process are achieved by combining automation tools and scripts. This allows the team to manage application versions and updates more flexibly, and to selectively update specific components as needed, making the deployment process more convenient and efficient, reducing the risk of human error and intervention, while also improving the consistency and repeatability of deployment, and being able to accurately track the change history of each component, which helps to quickly locate and resolve problems when they arise.

[0116] The present application embodiment also provides a software system deployment device 300, such as Figure 3 As shown, a schematic diagram of the structure of a software system deployment device in an embodiment of the present application is provided, wherein the software system deployment device 300 includes: an acquisition unit 310, an incremental comparison unit 320, a generation unit 330, and a transmission unit 340, wherein:

[0117] An acquisition unit 310 is used to acquire a project deployment package, where the project deployment includes the latest deployment package and the last deployment package of the project;

[0118] The incremental comparison unit 320 is used to perform an incremental comparison on the files in the latest deployment package and the files in the last deployment package using a preset incremental comparison strategy to obtain an incremental comparison result;

[0119] A generating unit 330 is configured to generate an incremental deployment package according to the incremental comparison result, wherein the incremental deployment package includes at least one of information of modified file content, newly added file content, and deleted file;

[0120] The transmission unit 340 is used to transmit the incremental deployment package to the target deployment path for incremental deployment.

[0121] In some embodiments of the present application, the software system deployment device 300 also includes: a setting unit, which is used to set the files in the latest deployment package as files in the source folder and the files in the previous deployment package as files in the target folder after obtaining the project deployment package; a traversal unit, which is used to traverse all files in the source folder and the target folder respectively, and generate and store corresponding path information for each file in the source folder and the target folder.

[0122] In some embodiments of the present application, the incremental comparison unit 320 is specifically used to: obtain the path information and MD5 values ​​of the files in the latest deployment package and the files in the previous deployment package; perform an incremental comparison on the files in the latest deployment package and the files in the previous deployment package according to the path information and MD5 values ​​of the files and the file difference comparison algorithm to obtain an incremental comparison result.

[0123] In some embodiments of the present application, the incremental comparison unit 320 is specifically used to: compare the path information of the file in the latest deployment package with the path information of the file in the previous deployment package to obtain a file path comparison result; if the file path comparison result is that the file corresponding to the path information only exists in the latest deployment package, then determine the change type as a new file and record the new file content and the corresponding path information; if the file path comparison result is that the file corresponding to the path information only exists in the previous deployment package, then determine the change type as a deleted file and record the path information corresponding to the deleted file; if the file path comparison result is that the path information is the same, then perform an incremental comparison on the files in the latest deployment package and the files in the previous deployment package according to the MD5 value of the file and the file difference comparison algorithm to obtain an incremental comparison result.

[0124] In some embodiments of the present application, the incremental comparison unit 320 is specifically used to: compare the MD5 value of the file in the latest deployment package with the MD5 value of the file in the previous deployment package; if the MD5 values ​​are different, determine that the change type is a modified file and record the modified file content and the corresponding path information; if the MD5 values ​​are the same, use the file difference comparison algorithm to perform an incremental comparison on the files in the latest deployment package and the files in the previous deployment package to obtain an incremental comparison result.

[0125] In some embodiments of the present application, the incremental comparison unit 320 is specifically used to: determine the file types in the latest deployment package and the last deployment package; use the file difference comparison algorithm corresponding to the file type to perform incremental comparison on the files in the latest deployment package and the files in the last deployment package to obtain an incremental comparison result.

[0126] In some embodiments of the present application, the generation unit 330 is specifically used to: determine the change type based on the incremental comparison result; if the change type is file modification, add the modified file content and the corresponding path information to the incremental deployment package; if the change type is new file addition, add the new file content and the corresponding path information to the incremental deployment package; if the change type is file deletion, add the file marking information of the deleted file to the incremental deployment package.

[0127] It can be understood that the above-mentioned software system deployment device can implement each step of the software system deployment method provided in the above-mentioned embodiment, and the relevant explanations about the software system deployment method are applicable to the software system deployment device, which will not be repeated here.

[0128] Figure 4 This is a schematic diagram of the structure of an electronic device according to an embodiment of the present application. Figure 4 At the hardware level, the electronic device includes a processor, and optionally also includes an internal bus, a network interface, and a memory. The memory may include a memory, such as a high-speed random access memory (RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk storage. Of course, the electronic device may also include hardware required for other services.

[0129] The processor, network interface and memory can be interconnected through an internal bus, which can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 4 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0130] The memory is used to store the program. Specifically, the program may include a program code, and the program code includes a computer operation instruction. The memory may include a memory and a non-volatile memory, and provides instructions and data to the processor.

[0131] The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it, forming a software system deployment device at the logical level. The processor executes the program stored in the memory and is specifically used to perform the following operations:

[0132] Obtain a project deployment package, wherein the project deployment includes the latest deployment package and the last deployment package of the project;

[0133] Performing an incremental comparison on the files in the latest deployment package and the files in the last deployment package using a preset incremental comparison strategy to obtain an incremental comparison result;

[0134] Generate an incremental deployment package according to the incremental comparison result, wherein the incremental deployment package includes at least one of information of modified file content, newly added file content, and deleted file;

[0135] The incremental deployment package is transferred to the target deployment path for incremental deployment.

[0136] The above application Figure 1 The method performed by the software system deployment device disclosed in the illustrated embodiment can be applied to a processor or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in the processor or an instruction in software form. The above processor may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The steps of the method disclosed in conjunction with the embodiments of the present application can be directly embodied as being executed by a hardware decoding processor, or executed by a combination of hardware and software modules in a decoding processor. The software module can be located in a storage medium mature in the art, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.

[0137] The present application also provides a computer program product, including a computer program or an instruction, which is executed by a processor to implement Figure 1 The software system deployment method in the illustrated embodiment is specifically used to execute:

[0138] Obtain a project deployment package, wherein the project deployment includes the latest deployment package and the last deployment package of the project;

[0139] Performing an incremental comparison on the files in the latest deployment package and the files in the last deployment package using a preset incremental comparison strategy to obtain an incremental comparison result;

[0140] Generate an incremental deployment package according to the incremental comparison result, wherein the incremental deployment package includes at least one of information of modified file content, newly added file content, and deleted file;

[0141] The incremental deployment package is transferred to the target deployment path for incremental deployment.

[0142] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0143] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks 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.

[0144] 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 A function specified in one or more boxes.

[0145] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0146] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0147] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0148] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0149] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0150] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.

[0151] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims

1. A software system deployment method, characterized in that: The software system deployment method comprises: Obtain a project deployment package, wherein the project deployment includes the latest deployment package and the last deployment package of the project; Performing an incremental comparison on the files in the latest deployment package and the files in the last deployment package using a preset incremental comparison strategy to obtain an incremental comparison result; Generate an incremental deployment package according to the incremental comparison result, wherein the incremental deployment package includes at least one of information of modified file content, newly added file content, and deleted file; The incremental deployment package is transferred to the target deployment path for incremental deployment.

2. The software system deployment method according to claim 1, characterized in that: After obtaining the project deployment package, the software system deployment method further includes: Setting the files in the latest deployment package as files in the source folder, and setting the files in the previous deployment package as files in the target folder; All files in the source folder and the target folder are traversed respectively, and corresponding path information is generated and stored for each file in the source folder and the target folder.

3. The software system deployment method according to claim 1, characterized in that: The incremental comparison of the files in the latest deployment package and the files in the last deployment package using a preset incremental comparison strategy to obtain the incremental comparison result includes: Obtain path information and MD5 values ​​of files in the latest deployment package and files in the last deployment package; An incremental comparison is performed on the files in the latest deployment package and the files in the last deployment package according to the path information and MD5 value of the files and a file difference comparison algorithm to obtain an incremental comparison result.

4. The software system deployment method according to claim 3, characterized in that: The incremental comparison of the files in the latest deployment package and the files in the last deployment package is performed according to the path information and MD5 value of the files and the file difference comparison algorithm, and the incremental comparison result obtained includes: Compare the path information of the file in the latest deployment package with the path information of the file in the previous deployment package to obtain a file path comparison result; If the file path comparison result is that the file corresponding to the path information only exists in the latest deployment package, then determine the change type as a new file and record the new file content and the corresponding path information; If the file path comparison result is that the file corresponding to the path information only exists in the last deployment package, then determine that the change type is file deletion and record the path information corresponding to the deleted file; If the file path comparison result is that the path information is the same, an incremental comparison is performed on the files in the latest deployment package and the files in the previous deployment package according to the MD5 value of the file and a file difference comparison algorithm to obtain an incremental comparison result.

5. The software system deployment method according to claim 4, characterized in that: The incremental comparison of the files in the latest deployment package and the files in the last deployment package is performed according to the MD5 value of the file and the file difference comparison algorithm, and the incremental comparison result obtained includes: Compare the MD5 value of the file in the latest deployment package with the MD5 value of the file in the previous deployment package; If the MD5 values ​​are different, the change type is determined to be a modified file and the modified file content and corresponding path information are recorded; If the MD5 values ​​are the same, the file difference comparison algorithm is used to perform an incremental comparison on the files in the latest deployment package and the files in the last deployment package to obtain an incremental comparison result.

6. The software system deployment method according to claim 4, characterized in that: The incremental comparison of the files in the latest deployment package and the files in the last deployment package using the file difference comparison algorithm to obtain the incremental comparison result includes: Determine the file types in the latest deployment package and the last deployment package; An incremental comparison is performed on the files in the latest deployment package and the files in the last deployment package using a file difference comparison algorithm corresponding to the file type to obtain an incremental comparison result.

7. The software system deployment method according to claim 1, characterized in that: Generating an incremental deployment package according to the incremental comparison result includes: Determining a change type according to the incremental comparison result; If the change type is file modification, the modified file content and corresponding path information are added to the incremental deployment package; If the change type is adding a new file, then the new file content and corresponding path information are added to the incremental deployment package; If the change type is file deletion, the file marking information of the deleted file is added to the incremental deployment package.

8. A software system deployment device, characterized in that: The software system deployment device comprises: An acquisition unit, used to acquire a project deployment package, wherein the project deployment includes the latest deployment package and the last deployment package of the project; An incremental comparison unit, used to perform an incremental comparison on the files in the latest deployment package and the files in the last deployment package using a preset incremental comparison strategy to obtain an incremental comparison result; A generating unit, configured to generate an incremental deployment package according to the incremental comparison result, wherein the incremental deployment package includes at least one of information of modified file content, newly added file content, and deleted file; The transmission unit is used to transmit the incremental deployment package to the target deployment path for incremental deployment.

9. An electronic device, comprising: processor; and a memory arranged to store computer executable instructions, wherein when the executable instructions are executed, the processor executes the software system deployment method according to any one of claims 1 to 7.

10. A computer program product, comprising a computer program or instructions, wherein when the computer program or instructions are executed by a processor, the software system deployment method according to any one of claims 1 to 7 is implemented.

Citation Information

Cited By

  • Software maintenance method and device

    CN121680927A