IIS website automatic updating method, device and medium

Through the IIS website automation update method, the automation problem of IIS website backend data update is solved, efficient and accurate website updates are achieved, operation and maintenance costs are reduced, and different websites are adapted to different websites and database needs, and detailed logs and rollbacks are provided. mechanism to ensure the security and reliability of the website.

CN118885198BActive Publication Date: 2024-12-24SUZHOU RUIYUN INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411354727.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-27
Publication Date
2024-12-24
Estimated Expiration
2044-09-27

AI Technical Summary

Technical Problem

The existing technology lacks automated solutions in the updating of back-end data dictionary and data content of IIS sites. It requires human operation and has high deployment and operation costs, making it difficult to adapt to different network environments. Tools use solution scripts in multiple types of formats. Inadequate support, lack of rollback mechanism and exception handling.

Method used

Provide an IIS website automation update method, including site integrity detection, synchronizing new site files, granting directory permissions through file ACL inheritance, establishing connections with databases and reading solution files to execute update instructions, realizing automatic backup and deleting original files , synchronize new files, configure ACL inheritance rules, record operation logs and exception information, and trigger the rollback mechanism.

Benefits of technology

It enables one-click update of the website without the need for additional platforms and professional operation and maintenance personnel, improves update efficiency and accuracy, reduces costs, enhances flexibility and scalability, and ensures the security and reliability of the update process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118885198B_ABST
    Figure CN118885198B_ABST
Patent Text Reader

Abstract

The present invention discloses an IIS website automatic update method, device and medium, including: detecting site integrity; synchronizing new site files according to the detection results; granting directory permissions by setting file ACL inheritance; extracting configuration file information in the new site file and establishing a connection with a database; and reading a solution file to execute an update instruction by establishing a connection with the database. The beneficial effect is that the IIS website automatic update method reduces the possibility of human error in automatic program execution, ensures that each step in the update process is executed according to predetermined rules and standards, and improves the accuracy of the overall update compared with the prior art.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] The present invention belongs to the technical field of computer programs, and in particular relates to an IIS website automatic updating method, device and medium. Background Art

[0002] Although the patent No. CN202010944377, a method for publishing and managing IIS sites and Windows services, an operation and maintenance system and platform, supports one-click publishing of sites, it focuses on the static resource level of the site and realizes the update of static resources at the front and back ends of the IIS site. For the data dictionary needed by the back end and the data content provided by the corresponding site, including solutions such as menus, SQL scripts for repairing data, and database table data dictionary modifications, there is no synchronous update, and manual operation and maintenance and changes are required. In addition, the patent is in a platform-based manner, which requires the platform to be deployed in the server network and the server to be connected to the platform, which requires higher hardware resources, deployment and operation and maintenance costs, and has great limitations for rapid deployment in different network environments.

[0003] The Web Deploy tool mainly focuses on file and configuration synchronization. It lacks certain support for solution scripts in various formats and relies more on predefined scripts and configurations. The tool mainly uses command lines and scripts for automated deployment, but scripts need to be written and maintained manually, which is relatively complex and requires certain skills. In the automated process and exception handling, only basic error handling is provided, there is no rollback mechanism, and it relies more on manual intervention. Summary of the invention

[0004] In order to solve the problems raised in the above background technology, the present invention provides an automatic updating method for IIS website.

[0005] To achieve the above object, the present invention provides the following technical solution: an IIS website automatic update method comprising:

[0006] Check site integrity;

[0007] Synchronize new site files based on the detection results;

[0008] Grant directory permissions by setting file ACL inheritance;

[0009] Establish a connection with the database based on the configuration file information in the new site file;

[0010] By establishing a connection with the database, reading the solution file and executing the update instructions.

[0011] Further: Among them, the site integrity detection includes:

[0012] When locating and accessing the configuration file of the IIS site, verifying the existence of the configuration file, and judging whether the configuration file actually exists in the predetermined directory based on the verification result;

[0013] If the configuration file exists: verify the format of the configuration file; determine whether the structure and content of the configuration file are correct based on the verification result;

[0014] When locating and accessing the authorization file of the IIS site, verify the existence of the authorization file, and determine whether the authorization information and authorization permissions in the authorization file are valid based on the verification result;

[0015] If the verification result passes: the program creates a resource list;

[0016] If the verification result fails: record the operation log during program execution and the abnormal stack information when the error occurs; notify the user through the message notification method configured in the configuration file; at the same time, automatically trigger the rollback mechanism to roll back the system to the state before the update.

[0017] Further: wherein, according to the verification result, synchronizing the new site file includes:

[0018] When the configuration file and authorization file verification results are passed, the original site files are automatically backed up to the backup directory through the program and named in time format;

[0019] The original site files include static resources, dynamic resources, configuration files, and authorization files;

[0020] When the backup of the original site files is complete: the program deletes the original site files; during the deletion process, the program reads and retains the configuration files and authorization files;

[0021] After the original site files are deleted: extract the new site files from the update package and synchronize them to the IIS site directory.

[0022] Further: Among them, by setting file ACL inheritance, the directory permissions granted include:

[0023] When the new site file synchronization is completed: read the updated site directory, configuration file, and authorization file; use the file system API to grant access rights to the site directory;

[0024] Configure the ACL inheritance rules for the site directory based on the site directory access rights to ensure that all subdirectories and newly created files automatically inherit the permission settings of the parent directory and that the IIS service can read and write files smoothly during the update process.

[0025] Further: Among them, according to the configuration file information in the new site file, a connection is established with the database:

[0026] When reading the updated configuration file, the configuration file is parsed and configuration information is extracted using the configuration file parser;

[0027] Obtain database connection information by parsing and extracting configuration information;

[0028] Establish a connection with the database by using the database connection information.

[0029] Further: wherein, by establishing a connection with a database, reading a solution file and executing an update instruction comprises:

[0030] Sort the solution files by their prefix numbers and time.

[0031] If the solution file name does not conform to the expected format: an exception will be thrown, and the user will be prompted to check the file name and reorganize it through the message notification method configured in the configuration file;

[0032] By querying the execution records stored in the database, determine whether the solution file is executed;

[0033] If not executed: start executing the solution file for cyclic update;

[0034] Skip the solution file if it has already been executed;

[0035] In the case of a cyclic update of the solution file, determining whether the cyclic update is successful;

[0036] In case of successful cycle update: end the update;

[0037] In case of a failed cyclic update: the rollback mechanism is automatically triggered to roll back the system to the state before the update.

[0038] Further: An IIS website automatic updating device comprises:

[0039] Site integrity detection module: used to detect the existence, format and content correctness of the configuration files and authorization files of the IIS site, as well as the validity of the authorization information and permissions;

[0040] Backup and synchronization module: used to automatically back up the original site files, delete the original site files after the backup is completed, and synchronize the new site files to the IIS site directory;

[0041] Directory permission granting module: used to read the updated site directory, configuration files, and authorization files after the new site file synchronization is completed, and use the file system API to grant site directory access rights and configure ACL inheritance rules.

[0042] Database module: used to read the updated configuration file, parse and extract configuration information, obtain database connection information, and establish a connection with the database.

[0043] Solution file execution module: used to sort solution files, check the file name format, query the execution records in the database, execute or skip solution files, and determine whether the update is successful in the loop update, and trigger the rollback mechanism in case of failure;

[0044] The log module is used to record operation logs during program execution, including logs of script execution, SQL records, slow SQL, and exception stack information when errors occur.

[0045] Further: A computer-readable storage medium stores program instructions therein, and the program instructions implement the above method when executed by a processor.

[0046] The present invention solves the defects existing in the background technology and has the following beneficial effects:

[0047] The IIS website automatic update method does not require the construction of an additional platform in the user's network, nor does it require professional operation and maintenance personnel. Ordinary users or consultants can update the website with one click by obtaining the update package. The automated program reduces the need for manual operation; compared with the existing technology, it improves the efficiency of website updates and reduces costs.

[0048] The IIS website automatic update method reduces the possibility of human error through automatic program execution, ensures that each step in the update process is executed according to predetermined rules and standards; and improves the accuracy of the overall update compared with the prior art.

[0049] The IIS website automatic update method can adapt to the update requirements of different websites and databases through the flexible configuration of the configuration file. In addition, the solution can support more types of solution files and database operations by extending different modules; compared with the existing technology, it has higher flexibility and scalability.

[0050] In the IIS website automatic update method, during the update process, the program will record detailed operation logs, including executed scripts, SQL records, slow SQL and abnormal stack information. These log information helps to track and solve problems, and improves the security and reliability of the update process. At the same time, if a failure occurs during the update process, the program can provide a reliable backup and rollback mechanism to ensure that the website can be restored to the state before the update; compared with the existing technology, the security of website data and services is guaranteed. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:

[0052] Figure 1 It is a schematic diagram of the system flow of the present invention;

[0053] Figure 2 It is a schematic diagram of the system flow in the present invention;

[0054] Figure 3 It is a schematic diagram of the system flow in the present invention; DETAILED DESCRIPTION

[0055] The present invention will now be further described in detail with reference to the accompanying drawings and embodiments. These drawings are simplified schematic diagrams that only illustrate the basic structure of the present invention in a schematic manner, and therefore only show the components related to the present invention.

[0056] Application Overview:

[0057] IIS website automated updates mainly use scripts to automatically perform configuration and deployment tasks on the IIS server. IIS website automated updates have the following update paths:

[0058] Automate the deployment and update of IIS websites by writing PowerShell scripts. Use commands such as New-Website and Set-ItemProperty to create websites, set application pools, and bind domain names. Scripts can include steps such as creating sites, updating files, and setting permissions to achieve one-click deployment. Use the SetupSiteForPublish.ps1 script to create a default publishing site or enable Web Deploy publishing for specific sites and users.

[0059] Configure build tasks and deployment processes through CI / CD tools to automatically build and deploy to IIS after code submission. Jenkins can be integrated with the source code management system to monitor code changes, automatically execute build scripts, and then deploy the build products to the IIS server.

[0060] This application uses a combination of PowerShell scripts and CI / CD tools to automatically update IIS websites, reduce human intervention, improve deployment consistency, and improve the efficiency and accuracy of website updates.

[0061] like Figures 1 to 3 The method for automatically updating an IIS website includes:

[0062] Check site integrity;

[0063] Synchronize new site files based on the detection results;

[0064] Grant directory permissions by setting file ACL inheritance;

[0065] Establish a connection with the database based on the configuration file information in the new site file;

[0066] By establishing a connection with the database, reading the solution file and executing the update instructions.

[0067] Further: Among them, the site integrity detection includes:

[0068] When the configuration file of the IIS site is located and accessed, the existence of the configuration file is verified, and based on the verification result, it is determined whether the configuration file actually exists in the predetermined directory; the configuration file includes web.config.

[0069] If the configuration file exists: perform format verification on the configuration file using predefined XML Schema or JSON Schema format rules; determine whether the structure and content of the configuration file are correct based on the verification result;

[0070] When locating and accessing the authorization file of the IIS site, verify the existence of the authorization file, and determine whether the authorization information and authorization permissions in the authorization file are valid based on the verification result; that is, parse the date information in the authorization file to confirm whether the current date is within the authorization validity period;

[0071] If the verification result passes: the program creates a resource list; the resource list includes database connection information, API keys, and third-party service credentials;

[0072] If the verification result fails: record the operation log during program execution and the abnormal stack information when the error occurs; notify the user through the message notification method configured in the configuration file; at the same time, automatically trigger the rollback mechanism to roll back the system to the state before the update.

[0073] Further: wherein, according to the verification result, synchronizing the new site file includes:

[0074] When the configuration file and authorization file verification results are passed, the original site files are automatically backed up to the backup directory through the program and named in time format;

[0075] The original site files include static resources such as HTML, CSS, JavaScript files, dynamic resources such as ASP.NET pages, configuration files, and authorization files;

[0076] When the backup of the original site files is complete: the program deletes the original site files; during the deletion process, the program reads and retains the configuration files and authorization files;

[0077] After the original site files are deleted: extract the new site files from the update package and synchronize them to the IIS site directory to ensure the consistency of the new and old version resources.

[0078] Further: Among them, by setting file ACL inheritance, the directory permissions granted include:

[0079] When the new site file synchronization is completed: read the updated site directory, configuration file, and authorization file; the site directory includes assets, LanguagePack, and log directories; use the file system API to grant site directory access rights; that is, add full access rights for the Everyone and Users user groups to the asset, LanguagePack, and log directories.

[0080] Configure the ACL inheritance rules for the site directory based on the site directory access rights. When new files or subdirectories are created, they automatically receive the permission settings from their parent directory, thus avoiding access problems caused by inconsistent permissions. Ensure that all subdirectories and newly created files automatically inherit the permission settings of the parent directory, and that the IIS service can read and write files smoothly during the update process.

[0081] Further: Among them, according to the configuration file information in the new site file, a connection is established with the database:

[0082] When reading the updated configuration file, the configuration file is parsed and configuration information is extracted using the configuration file parser;

[0083] Obtain database connection information by parsing and extracting configuration information;

[0084] Establish a connection with the database by using the database connection information.

[0085] Further: wherein, by establishing a connection with a database, reading a solution file and executing an update instruction comprises:

[0086] Sort the solution files by their prefix numbers and time.

[0087] If the solution file name does not conform to the expected format: an exception will be thrown, and the user will be prompted to check the file name and reorganize it through the message notification method configured in the configuration file;

[0088] By querying the execution records stored in the database, determine whether the solution file is executed;

[0089] If not executed: start executing the solution file for cyclic update;

[0090] Skip the solution file if it has already been executed;

[0091] In the case of a cyclic update of the solution file, determining whether the cyclic update is successful;

[0092] In case of successful cycle update: end the update;

[0093] In case of a failed cyclic update: the rollback mechanism is automatically triggered to roll back the system to the state before the update.

[0094] Further: An IIS website automatic updating device comprises:

[0095] Site integrity detection module: used to detect the existence, format and content correctness of the configuration files and authorization files of the IIS site, as well as the validity of the authorization information and permissions;

[0096] Backup and synchronization module: used to automatically back up the original site files, delete the original site files after the backup is completed, and synchronize the new site files to the IIS site directory;

[0097] Directory permission granting module: used to read the updated site directory, configuration files, and authorization files after the new site file synchronization is completed, and use the file system API to grant site directory access rights and configure ACL inheritance rules.

[0098] Database module: used to read the updated configuration file, parse and extract configuration information, obtain database connection information, and establish a connection with the database.

[0099] Solution file execution module: used to sort solution files, check the file name format, query the execution records in the database, execute or skip solution files, and determine whether the update is successful in the loop update, and trigger the rollback mechanism in case of failure;

[0100] The log module is used to record operation logs during program execution, including logs of script execution, SQL records, slow SQL, and exception stack information when errors occur.

[0101] Further: A computer-readable storage medium stores program instructions therein, and the program instructions implement the above method when executed by a processor.

[0102] In addition to the above-mentioned methods and devices, an embodiment of the present application may also be a computer program product, which includes computer program instructions, which, when executed by a processor, enable the processor to execute the steps in the automatic update of the IIS website according to various embodiments of the present application described in the above-mentioned method section of this specification.

[0103] The computer program product may be written in any combination of one or more programming languages ​​to write program codes for performing the operations of the embodiments of the present application, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" language or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.

[0104] In addition, an embodiment of the present application may also be a computer-readable storage medium on which computer program instructions are stored. When the computer program instructions are executed by a processor, the processor executes the steps for automatically updating the IIS website according to various embodiments of the present application described in the above method section of this specification.

[0105] Computer readable storage media can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can include, for example, but is not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0106] In the description of the present invention, it should be understood that the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.

[0107] In the description of this specification, the terms "one embodiment", "some embodiments", "embodiment", "example", "specific example" or "some examples" refer to the specific features, structures, materials or characteristics described in combination with the embodiment or example being included in at least one embodiment or example of the present invention.

[0108] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may alter, modify, replace and modify the above embodiments within the scope of the present invention.

Claims

1. A method for automatically updating an IIS website, characterized in that include: Check site integrity; Synchronize new site files based on the detection results; Grant directory permissions by setting file ACL inheritance; Establish a connection with the database based on the configuration file information in the new site file; By establishing a connection with the database, the solution file is read and the update instructions are executed; Among them, according to the verification results, the synchronization of new site files includes: When the configuration file and authorization file verification results are passed, the original site files are automatically backed up to the backup directory through the program and named in time format; The original site files include static resources, dynamic resources, configuration files, and authorization files; When the backup of the original site files is complete: the program deletes the original site files; during the deletion process, the program reads and retains the configuration files and authorization files; After the original site files have been deleted: extract the new site files from the update package and synchronize them to the IIS site directory; Among them, by setting file ACL inheritance, the directory permissions granted include: When the new site file synchronization is completed: read the updated site directory, configuration file, and authorization file; use the file system API to grant access rights to the site directory; Configure the ACL inheritance rules for the site directory based on the site directory access rights to ensure that all subdirectories and newly created files automatically inherit the permission settings of the parent directory, and that the IIS service can read and write files smoothly during the update process; The steps of establishing a connection with a database and reading a solution file to execute an update instruction include: Sort the solution files by their prefix numbers and time. If the solution file name does not conform to the expected format: an exception will be thrown, and the user will be prompted to check the file name and reorganize it through the message notification method configured in the configuration file; By querying the execution records stored in the database, determine whether the solution file is executed; If not executed: start executing the solution file for cyclic update; Skip the solution file if it has already been executed; In the case of a cyclic update of the solution file, determining whether the cyclic update is successful; In case of successful cycle update: end the update; In case of a failed cyclic update: the rollback mechanism is automatically triggered to roll back the system to the state before the update.

2. The method for automatically updating an IIS website according to claim 1, characterized in that: in, Site integrity testing includes: When locating and accessing the configuration file of the IIS site, verifying the existence of the configuration file, and judging whether the configuration file actually exists in the predetermined directory based on the verification result; If the configuration file exists: verify the format of the configuration file; determine whether the structure and content of the configuration file are correct based on the verification result; When locating and accessing the authorization file of the IIS site, verify the existence of the authorization file, and determine whether the authorization information and authorization permissions in the authorization file are valid based on the verification result; If the verification result passes: the program creates a resource list; If the verification result fails: record the operation log during program execution and the abnormal stack information when the error occurs; notify the user through the message notification method configured in the configuration file; at the same time, automatically trigger the rollback mechanism to roll back the system to the state before the update.

3. The method for automatically updating an IIS website according to claim 1, characterized in that: in, Establish a connection with the database based on the configuration file information in the new site file: When reading the updated configuration file, the configuration file is parsed and configuration information is extracted using the configuration file parser; Obtain database connection information by parsing and extracting configuration information; Establish a connection with the database by using the database connection information.

4. An IIS website automatic updating device, based on an IIS website automatic updating method according to any one of claims 1 to 3, characterized in that: The device includes: Site integrity detection module: used to detect the existence, format and content correctness of the configuration files and authorization files of the IIS site, as well as the validity of the authorization information and permissions; Backup and synchronization module: used to automatically back up the original site files, delete the original site files after the backup is completed, and synchronize the new site files to the IIS site directory; Directory permission granting module: used to read the updated site directory, configuration files, and authorization files after the new site file synchronization is completed, and use the file system API to grant site directory access rights and configure ACL inheritance rules; Database module: used to read the updated configuration file, parse and extract configuration information, obtain database connection information, and establish a connection with the database; Solution file execution module: used to sort solution files, check the file name format, query the execution records in the database, execute or skip solution files, and determine whether the update is successful in the loop update, and trigger the rollback mechanism in case of failure; The log module is used to record operation logs during program execution, including logs of script execution, SQL records, slow SQL, and exception stack information when errors occur.

5. A computer-readable storage medium having program instructions stored therein, characterized in that: When the program instructions are executed by a processor, the method as claimed in any one of claims 1 to 3 is implemented.