Automatic patch generation method and device for multiple environments and medium
Through the method of automatically generating patches, we solve the problems of low efficiency and poor reusability of traditional manual patch production, realize fast and accurate patch generation, meet the needs of rapid iteration and update of modern software, and enhance the security and maintainability of the system. sex.
Patent Information
- Application Number
- CN202410699049.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-31
- Publication Date
- 2024-08-30
AI Technical Summary
The traditional manual patch production method has problems such as low production efficiency, duplication of labor, and poor reusability, and is difficult to meet the needs of rapid iteration and update of modern software.
Provides a multi-environment automated patch generation method that obtains the user's patch generation request information, determines the module information and type information of the patch to be generated, identifies database change items, sets data export rules and filtering conditions, and automatically generates patch physical files. Implement automatic generation of patches.
It improves the efficiency and accuracy of patch generation, reduces manual intervention, ensures that the generated patches match user needs, and enhances the security and maintainability of the system.
Smart Images

Figure CN118567697A
Abstract
Description
Technical Field
[0001] The present specification relates to the field of patch generation technology, and in particular to a method, device and medium for automatically generating patches for multiple environments. Background Art
[0002] With the rapid development of the software industry, the scale and complexity of software systems are increasing, resulting in an increase in errors and vulnerabilities in the software. These errors and vulnerabilities may not only affect the normal operation of software functions, but also pose a serious threat to system security. Therefore, timely and effective repair of these errors and vulnerabilities is crucial to ensure the stability and security of software systems. In addition, the continuous update of user needs has also brought changes in software requirements.
[0003] The traditional manual patching method requires developers to manually analyze the code, locate errors, write repair code and test it. The process is usually time-consuming and inefficient, and it is difficult to meet the needs of rapid iteration and updating of modern software. Manual operations are easily affected by subjective factors, such as fatigue and negligence, which may lead to the introduction of new errors or omission of certain key steps in the process of patching, increasing the risk and instability of the software system; for the same error or similar vulnerability, developers may need to repeatedly perform the same analysis and repair work. This repetitive work not only wastes development resources, but also may reduce the enthusiasm and work efficiency of developers. Therefore, the traditional manual patching method has problems such as low production efficiency, repetitive work, and poor reusability, which is difficult to meet the needs of rapid iteration and updating of modern software. Summary of the invention
[0004] One or more embodiments of this specification provide a method, device and medium for automatic patch generation for multiple environments, which are used to solve the following technical problems: the traditional manual patch production method has problems such as low production efficiency, repetitive work, and poor reusability, and it is difficult to meet the needs of rapid iteration and updating of modern software.
[0005] One or more embodiments of this specification adopt the following technical solutions:
[0006] One or more embodiments of the present specification provide a method for automatic patch generation for multiple environments, the method comprising: obtaining patch generation request information triggered by a user in a front-end page, and determining patch information to be generated corresponding to the patch to be generated based on the patch generation request information, wherein the patch information to be generated includes patch module information and patch type information; identifying a database change item corresponding to the patch to be generated through the patch information to be generated corresponding to the patch to be generated, and determining a data export rule corresponding to the patch to be generated, wherein the data export rule includes data export information and a filtering condition; determining a patch physical file corresponding to the data change item of the patch to be generated in a predetermined shared database according to the data export rule corresponding to the patch to be generated and the filtering condition; and automatically generating a patch based on the patch physical file corresponding to the data change item of the patch to be generated and the patch module information and patch type information in the patch information to be generated.
[0007] Furthermore, through the patch information to be generated corresponding to the patch to be generated, the database change items corresponding to the patch to be generated are identified, and the data export rules corresponding to the patch to be generated are determined, which specifically includes: determining the current database version and the patch target version corresponding to the patch to be generated according to the patch information to be generated corresponding to the patch to be generated; obtaining the current database information of the current database version and the target patch database information of the patch target version through the current database version and the patch target version; comparing the current database information with the target patch database information of the patch target version to determine the database change items corresponding to the patch to be generated; and setting the data export rules corresponding to the patch to be generated according to the database change items corresponding to the patch to be generated.
[0008] Furthermore, according to the database change items corresponding to the patch to be generated, data export rules corresponding to the patch to be generated are set, specifically including: analyzing the database change items to determine at least one corresponding change database table, and setting data export information of the patch to be generated based on the at least one change database table; based on each of the change database tables, determining the change column information of each of the database tables, wherein the change column information includes a database table identifier and a change column identifier; and setting filtering conditions corresponding to the patch to be generated through the change column information of each of the database tables.
[0009] Furthermore, according to the data export rules corresponding to the patch to be generated and the filtering conditions, in a predetermined shared database, the patch physical files corresponding to the data change items of the patch to be generated are determined, specifically including: according to the data export rules corresponding to the patch to be generated, determining the data storage identifier set of the data change items of the patch to be generated in the shared database; through the data storage identifier set and a preset API interface, determining the database data, table structure and constraint data in a predetermined shared database; according to the database data, table structure and constraint data, determining the database data file, table structure and constraint data file; based on the database data file, table structure and constraint data file and a predetermined application data file, generating the patch physical files in the patch to be generated.
[0010] Furthermore, according to the data export rules corresponding to the patch to be generated, before determining the data storage identifier set of the data change items of the patch to be generated in the shared database, the method also includes: exporting the corresponding database data through a pre-set first API interface according to the data export information and the filtering conditions in the data export rules; storing the database data in a shared database, and generating a data data storage identifier for the database data in the shared database; obtaining the corresponding table structure and constraint data through a pre-set second API interface according to at least one database table information in the database data; storing the table structure and constraint data in a shared database, and generating a table structure and constraint data storage identifier for the table structure and constraint data in the shared database.
[0011] Further, according to the data export rule corresponding to the patch to be generated, a set of data storage identifiers of the data change items of the patch to be generated in the shared database is determined, specifically including: determining the data data storage identifier of the database data in the shared database and the table structure and constraint data storage identifier of the table structure and constraint data in the shared database according to the data export information and the filtering condition corresponding to the patch to be generated; determining a data data storage identifier set based on the data data storage identifier; determining a table structure and constraint data storage identifier set according to the table structure and constraint data storage identifier; determining a set of data storage identifiers of the data change items of the patch to be generated in the shared database through the data data storage identifier set and the table structure and constraint data storage identifier set.
[0012] Furthermore, based on the patch physical file corresponding to the data change item of the patch to be generated and the patch module information and patch type information in the patch information to be generated, a patch is automatically generated, specifically including: obtaining the database data file, table structure and constraint data file and application data file in the patch physical file corresponding to the data change item of the patch to be generated; organizing the application directory based on the application data file, and determining the application path information; determining the patch file information through the database data file, the table structure and constraint data file; supplementing other basic information of the patch to be generated according to the patch module information and patch type information in the patch information to be generated, and determining the patch display information, wherein the patch display information includes a patch display identifier and a patch display label; and automatically generating a patch based on the application path information, the patch file information and the patch display information.
[0013] Furthermore, based on at least one database table information in the database data, the corresponding table structure and constraint data are obtained through a pre-set second API interface, specifically including: taking the database table identifier in the at least one database table information as an input parameter, and obtaining the corresponding table structure and constraint data through the second API interface according to the patch installation record or physical table.
[0014] One or more embodiments of this specification provide a patch automatic generation device for multiple environments, including:
[0015] at least one processor; and,
[0016] a memory communicatively connected to the at least one processor; wherein,
[0017] The memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to:
[0018] Obtain patch generation request information triggered by the user in the front-end page, and determine the patch information to be generated corresponding to the patch to be generated based on the patch generation request information, wherein the patch information to be generated includes patch module information and patch type information; identify the database change item corresponding to the patch to be generated through the patch information to be generated corresponding to the patch to be generated, and determine the data export rule corresponding to the patch to be generated, wherein the data export rule includes data export information and filtering conditions; determine the patch physical file corresponding to the data change item of the patch to be generated in a predetermined shared database according to the data export rule corresponding to the patch to be generated and the filtering conditions; automatically generate a patch based on the patch physical file corresponding to the data change item of the patch to be generated and the patch module information and patch type information in the patch information to be generated.
[0019] One or more embodiments of this specification provide a non-volatile computer storage medium storing computer executable instructions, wherein the computer executable instructions are configured to:
[0020] Obtain patch generation request information triggered by the user in the front-end page, and determine the patch information to be generated corresponding to the patch to be generated based on the patch generation request information, wherein the patch information to be generated includes patch module information and patch type information; identify the database change item corresponding to the patch to be generated through the patch information to be generated corresponding to the patch to be generated, and determine the data export rule corresponding to the patch to be generated, wherein the data export rule includes data export information and filtering conditions; determine the patch physical file corresponding to the data change item of the patch to be generated in a predetermined shared database according to the data export rule corresponding to the patch to be generated and the filtering conditions; automatically generate a patch based on the patch physical file corresponding to the data change item of the patch to be generated and the patch module information and patch type information in the patch information to be generated.
[0021] At least one of the above technical solutions adopted in the embodiments of this specification can achieve the following beneficial effects: through the above technical solution, the user can directly trigger the patch generation request on the front-end page without going through other complicated steps or contacting the administrator, thereby improving the convenience of user experience; the automated process reduces the user waiting time, the patch generation is faster, and the response speed of the user experience is improved; according to the patch generation request information triggered by the user, the module information and type information of the patch to be generated can be accurately determined, thereby ensuring that the generated patch is highly matched with the user's needs; the setting of data export rules and filtering conditions can ensure that only data related to the patch is exported, avoiding unnecessary data migration or backup, and improving the accuracy of the patch; the automated process reduces manual intervention and improves the efficiency of patch generation, and the predetermined shared database and patch physical file positioning make the patch generation process faster and reduce the consumption of system resources. Through accurate data export and filtering conditions, unnecessary data leakage or misoperation is avoided, and the security of the system is enhanced; the generated patch contains complete module information and type information, which is convenient for subsequent patch management and maintenance; the automatic generation and storage of patch physical files make the storage and distribution of patches more convenient, and improve the maintainability of the system. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the technical solutions in the embodiments of this specification or the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art description. Obviously, the drawings described below are only some embodiments recorded in this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative labor. In the drawings:
[0023] Figure 1 A flowchart of a method for automatically generating patches for multiple environments provided in an embodiment of this specification;
[0024] Figure 2 A schematic diagram of the structure of a patch automatic generation device for multiple environments provided in an embodiment of this specification. DETAILED DESCRIPTION
[0025] In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments of this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this specification.
[0026] With the rapid development of the software industry, the scale and complexity of software systems are increasing, resulting in an increase in errors and vulnerabilities in the software. These errors and vulnerabilities may not only affect the normal operation of software functions, but also pose a serious threat to system security. Therefore, timely and effective repair of these errors and vulnerabilities is crucial to ensure the stability and security of software systems. In addition, the continuous update of user needs has also brought changes in software requirements.
[0027] The traditional manual patching method requires developers to manually analyze the code, locate errors, write repair code and test it. The process is usually time-consuming and inefficient, and it is difficult to meet the needs of rapid iteration and updating of modern software. Manual operations are easily affected by subjective factors, such as fatigue and negligence, which may lead to the introduction of new errors or omission of certain key steps in the process of patching, increasing the risk and instability of the software system; for the same error or similar vulnerability, developers may need to repeatedly perform the same analysis and repair work. This repetitive work not only wastes development resources, but also may reduce the enthusiasm and work efficiency of developers. Therefore, the traditional manual patching method has problems such as low production efficiency, repetitive work, and poor reusability, which is difficult to meet the needs of rapid iteration and updating of modern software.
[0028] The embodiment of this specification provides a method for automatically generating patches for multiple environments. It should be noted that the execution subject in the embodiment of this specification can be a server or any device with data processing capabilities. Figure 1 A flowchart of a method for automatically generating patches for multiple environments provided in an embodiment of this specification is shown in FIG. Figure 1 As shown, it mainly includes the following steps:
[0029] Step S101, obtaining patch generation request information triggered by a user in a front-end page, and determining patch information to be generated corresponding to the patch to be generated based on the patch generation request information.
[0030] The patch information to be generated includes patch module information and patch type information;
[0031] In one embodiment of the present specification, when a user needs to generate a patch, a patch generation request is sent to the server by triggering actions such as clicking a button or selecting a button in the front-end page. The patch generation request includes key information such as the patch identifier and timestamp to be generated. Under the triggering of the patch generation request, the patch information to be generated corresponding to the patch to be generated is determined. The patch information to be generated here includes identification information such as the patch name, as well as patch module information and patch type information. The patch module information and patch type information can be obtained through a pre-set Restful API interface for obtaining the patch module and a Restful API interface for obtaining the patch type. The patch module information includes the patch module number, the patch module name and the patch module version. The patch type information includes the patch type number and the patch type name. For example, the patch type is a problem-solving patch.
[0032] Step S102 , identifying the database change item corresponding to the patch to be generated through the patch information to be generated corresponding to the patch to be generated, and determining the data export rule corresponding to the patch to be generated.
[0033] The data export rules include data export information and filtering conditions;
[0034] In one embodiment of the present specification, the database change items corresponding to the patch to be generated are automatically identified through the patch information to be generated corresponding to the patch to be generated, and the data export information and filtering conditions corresponding to the patch to be generated are determined. By accurately identifying and exporting data related to the patch, unnecessary data leakage risks can be reduced and data security can be improved. With clear data export rules and filtering conditions, it can be ensured that only data related to the patch is exported, thereby reducing the time and cost of data migration and processing.
[0035] The database change items corresponding to the patch to be generated are identified through the patch information to be generated corresponding to the patch to be generated, and the data export rules corresponding to the patch to be generated are determined, which specifically includes: determining the current database version and the patch target version corresponding to the patch to be generated according to the patch information to be generated corresponding to the patch to be generated; obtaining the current database information of the current database version and the target patch database information of the patch target version through the current database version and the patch target version; comparing the current database information with the target patch database information of the patch target version to determine the database change items corresponding to the patch to be generated; and setting the data export rules corresponding to the patch to be generated according to the database change items corresponding to the patch to be generated.
[0036] In one embodiment of the present specification, it is necessary to parse the generated patch information, which generally includes the target module of the patch, the patch type (such as fixing errors, adding new functions, optimizing performance, etc.), and some additional metadata that may be included (such as version number, change description, etc.). Based on the patch information to be generated, the system needs to identify which database objects (such as tables, views, indexes, stored procedures, etc.) will be affected by the patch, which generally involves comparing the database object definitions and data contents between the current database version and the patch target version. According to the database change items corresponding to the patch to be generated, the data export rules corresponding to the patch to be generated are set. For example, the data export information in the data export rule is set to the data table ID corresponding to the data change item, that is, which table needs to be exported; the filtering condition is set to the changed column information in this data table, so as to facilitate filtering according to the table name and column identifier.
[0037] According to the database change item corresponding to the patch to be generated, the data export rules corresponding to the patch to be generated are set, specifically including: analyzing the database change item to determine at least one corresponding change database table, and setting the data export information of the patch to be generated based on the at least one change database table; based on each of the change database tables, determining the change column information of each of the database tables, wherein the change column information includes a database table identifier and a change column identifier; and setting the filtering conditions corresponding to the patch to be generated through the change column information of each of the database tables.
[0038] In one embodiment of the present specification, first, the database change items mentioned in the patch to be generated are analyzed one by one. The change items may include the addition, deletion, modification of tables, and the addition, deletion, and modification of fields (columns) in the tables; all database tables involved in the changes are identified, and these tables will be the main objects of subsequent data export and filtering. For each changed database table, the corresponding data export information is set, including identification information such as the table name. For each changed database table, further analyze which specific columns (fields) in the table have changed. For each changed column, create a record containing the following information: database table identifier (usually table name), changed column identifier (column name), change type (such as added column, modified column, deleted column, etc.). Based on the changed column information of each database table, set the filtering conditions corresponding to the patch to be generated. The design of the filtering conditions should ensure that only data related to the patch is exported to reduce unnecessary data migration or backup.
[0039] By conducting in-depth analysis of database changes, we can accurately determine which tables and columns have changed, thereby ensuring that only patch-related data is exported and filtered, improving the accuracy of data migration and patch application. Exporting and filtering only patch-related data can greatly reduce the time and cost of data migration and processing, and reduce unnecessary computing and storage resource consumption; accurate data export and filtering rules can reduce the risk of data loss or damage. Processing only patch-related data also reduces the impact on system stability; recording the changed column information of each database table helps with subsequent database maintenance and upgrades, and improves the reusability of information.
[0040] Step S103, according to the data export rules and filtering conditions corresponding to the patch to be generated, the patch physical file corresponding to the data change item of the patch to be generated is determined in a predetermined shared database.
[0041] Before determining the data storage identifier set of the data change items of the patch to be generated in the shared database according to the data export rule corresponding to the patch to be generated, the method also includes: exporting the corresponding database data through a preset first API interface according to the data export information and the filtering condition in the corresponding data export rule; storing the database data in the shared database, and generating a data storage identifier of the database data in the shared database; obtaining the corresponding table structure and constraint data through a preset second API interface according to at least one database table information in the database data; storing the table structure and constraint data in the shared database, and generating a table structure and constraint data storage identifier of the table structure and constraint data in the shared database.
[0042] According to at least one database table information in the database data, the corresponding table structure and constraint data are obtained through a pre-set second API interface, specifically including: taking the database table identifier in the at least one database table information as an input parameter, and obtaining the corresponding table structure and constraint data according to the patch installation record or the physical table through the second API interface.
[0043] In one embodiment of the present specification, a Restful API interface for exporting database data, a Restful API interface for exporting table structure and constraints, and a Restful API interface for automatically making patches are pre-set. Among them, the Restful API interface for exporting database data is hereinafter referred to as the first API interface, and the interface input parameters of this interface include export rules, data table IDs, and filtering conditions. It should be noted that the export rules support customization, support multi-table joint query formulated by a single table and the association between tables. The filtering conditions support filtering according to table names, column ids, etc. Through the first API interface, according to the data export information (data table ID) in the data export rules and the filtering conditions, the corresponding database data is exported, and the database data is stored separately in a shared database, and a data data storage identifier of the database data in the shared database is generated, and the data data storage identifier of the database data in the shared database is returned through the interface. It should be noted that the database data can be exported according to the pre-established export rules and conditions. The exported data can be stored in the data storage in a document to ensure data consistency under multi-load conditions. The export rules support customization, and a single table or multiple tables and the relationship between tables can be selected.
[0044] The restful API interface for exporting table structure, constraint and other data is referred to as the second API interface below. The input parameter is one or more table names, that is, the table name set corresponding to the database table. It supports obtaining table structure and constraint data in two ways: according to the patch installation record content and the physical table. The exported results are directly stored in the database storage. According to at least one database table information in the database data, the table name set of the second API interface is determined, and the table name set is input as an input parameter to the second API interface to obtain the corresponding table structure and constraint data, and the table structure and constraint data are stored in the shared database, and the table structure and constraint data storage identifier of the table structure and constraint data in the shared database is generated.
[0045] The Restful API interface for automatically making patches, the basic input information includes patch name, patch module, patch type, patch category, etc.; the input data and application include data data storage identifier, table structure and constraint data storage identifier set, application storage path, and the generated incremental physical file can be stored in the database storage, that is, the shared database.
[0046] According to the data export rules corresponding to the patch to be generated and the filtering conditions, in a predetermined shared database, the patch physical files corresponding to the data change items of the patch to be generated are determined, specifically including: according to the data export rules corresponding to the patch to be generated, a data storage identifier set of the data change items of the patch to be generated in the shared database is determined; through the data storage identifier set and a preset API interface, in a predetermined shared database, the database data, table structure and constraint data are determined; according to the database data, the table structure and the constraint data, the database data file, the table structure and the constraint data file are determined; based on the database data file, the table structure and the constraint data file and a predetermined application data file, the patch physical files in the patch to be generated are generated.
[0047] In one embodiment of the present specification, the data storage identifier set of the data change items of the patch to be generated in the shared database is determined by the data export rules corresponding to the patch to be generated, the data storage identifier set includes the data data storage identifier set and the table structure and constraint data storage identifier set, the data data storage identifier set includes the storage identifier of the data of the generated patch in the shared database, and the table structure and constraint data storage identifier set includes the storage identifier of the table structure and constraint data of the generated patch in the shared database. The Restful API interface for automatic patch generation is used to obtain the database data, table structure and constraint data through the storage identifier of the data in the shared database and the table structure and constraint data in the shared database, and generate the database data file and table structure and constraint data file from the database data, table structure and constraint data. The physical file of the patch in the patch to be generated is generated through the database data file, table structure and constraint data file and the predetermined application data file.
[0048] According to the data export rule corresponding to the patch to be generated, determine the data storage identifier set of the data change items of the patch to be generated in the shared database, specifically including: determining the data storage identifier of the database data in the shared database and the table structure and constraint data storage identifier of the table structure and constraint data in the shared database according to the data export information corresponding to the patch to be generated and the filtering condition; based on the data data storage identifier, determine the data data storage identifier set; according to the table structure and constraint data storage identifier, determine the table structure and constraint data storage identifier set, and determine the data storage identifier set of the data change items of the patch to be generated in the shared database through the data data storage identifier set and the table structure and constraint data storage identifier set.
[0049] Through the above technical solution, through a clear data storage identifier set (including data data storage identifier and table structure and constraint data storage identifier), it can be ensured that only data change items related to the patch are included in the patch generation process, avoiding unnecessary data or structure from being erroneously included, thereby improving the accuracy and pertinence of the patch; with a clear data storage identifier, the data, table structure and constraint data that need to be exported and generated for the patch can be quickly located, greatly simplifying the patch generation process and improving efficiency; the generated patch physical file contains database data, table structure and constraint data and application data files, which can be recognized and used by different database environments or systems, thereby enhancing the portability and compatibility of the patch; by accurately controlling the content of the patch, the risk of data loss, system crash, etc. caused by improper patching during system upgrades or maintenance is reduced, ensuring the stability and security of the system; the generated patch physical file can be used as part of version control to facilitate the management and maintenance of different versions of the system or application; if the system fails or data is lost, the corresponding patch file can be used to quickly restore the data to the specified version, thereby improving the efficiency of data recovery; when a problem occurs, by comparing the data files before and after the patch, it is easier to locate and troubleshoot the problem, thereby shortening the troubleshooting time.
[0050] Step S104: automatically generate a patch based on the patch physical file corresponding to the data change item of the patch to be generated and the patch module information and patch type information in the patch information to be generated.
[0051] Automatically generate a patch based on the patch physical file corresponding to the data change item of the patch to be generated and the patch module information and patch type information in the patch information to be generated, specifically including: obtaining the database data file, table structure and constraint data file and application data file in the patch physical file corresponding to the data change item of the patch to be generated; organizing the application directory based on the application data file, and determining the application path information; determining the patch file information through the database data file, the table structure and the constraint data file; supplementing other basic information of the patch to be generated according to the patch module information and patch type information in the patch information to be generated, and determining the patch display information, wherein the patch display information includes a patch display identifier and a patch display label; and automatically generate a patch based on the application path information, the patch file information and the patch display information.
[0052] In one embodiment of the present specification, the corresponding patch physical files are extracted from the data change items of the patch to be generated, including the database data file, the table structure and constraint data file and the application data file. Through the Restful API interface for automatically making patches, the directory structure of the application is organized or rebuilt according to the application data file, and the path information of the application is determined, which usually includes the storage location of the file in the system, access rights, etc. By analyzing the database data file, the table structure and the constraint data file, the file information required for the patch, such as file size, modification time, dependencies, etc., is extracted. According to the patch module information and patch type information in the patch information to be generated, other basic information related to the patch is supplemented to determine the patch display information. The patch display information includes a patch display identifier, such as a name, and also includes a patch display label, which is used to display the patch type to the user, so that the user can decide whether to install it and improve the user experience. The correct application path is input through the Restful API interface for automatically making patches to automatically generate patches, and the patch files are automatically packaged and generated. The generated patch file usually contains all necessary files and data, as well as metadata and scripts for installing or applying patches. The automated process reduces manual operations and improves the efficiency and accuracy of patch generation; the generated patch files contain complete file information and metadata, which facilitates subsequent patch management and tracking.
[0053] Through the above technical solution, users can directly trigger patch generation requests on the front-end page without going through other complicated steps or contacting the administrator, which improves the convenience of user experience; the automated process reduces user waiting time, patches are generated more quickly, and the response speed of user experience is improved; according to the patch generation request information triggered by the user, the module information and type information of the patch to be generated can be accurately determined, thereby ensuring that the generated patch is highly matched with user needs; the setting of data export rules and filtering conditions can ensure that only data related to the patch is exported, avoiding unnecessary data migration or backup, and improving the accuracy of the patch; the automated process reduces manual intervention and improves the efficiency of patch generation, and the predetermined shared database and patch physical file positioning make the patch generation process faster and reduce the consumption of system resources. Through accurate data export and filtering conditions, unnecessary data leakage or misoperation is avoided, and the security of the system is enhanced; the generated patch contains complete module information and type information, which is convenient for subsequent patch management and maintenance; the automatic generation and storage of patch physical files make the storage and distribution of patches more convenient, and improve the maintainability of the system.
[0054] The embodiment of this specification also provides a patch automatic generation device for multiple environments, such as Figure 2As shown, the device includes: at least one processor; and a memory connected to the at least one processor in communication; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to:
[0055] Acquire patch generation request information triggered by the user in the front-end page, and determine the patch information to be generated corresponding to the patch to be generated based on the patch generation request information, wherein the patch information to be generated includes patch module information and patch type information; identify the database change item corresponding to the patch to be generated through the patch information to be generated corresponding to the patch to be generated, and determine the data export rule corresponding to the patch to be generated, wherein the data export rule includes data export information and filtering conditions; determine the patch physical file corresponding to the data change item of the patch to be generated in a predetermined shared database according to the data export rule corresponding to the patch to be generated and the filtering conditions; automatically generate a patch based on the patch physical file corresponding to the data change item of the patch to be generated and the patch module information and patch type information in the patch information to be generated.
[0056] The embodiment of the present specification also provides a non-volatile computer storage medium storing computer executable instructions, wherein the computer executable instructions are configured as follows:
[0057] Acquire patch generation request information triggered by the user in the front-end page, and determine the patch information to be generated corresponding to the patch to be generated based on the patch generation request information, wherein the patch information to be generated includes patch module information and patch type information; identify the database change item corresponding to the patch to be generated through the patch information to be generated corresponding to the patch to be generated, and determine the data export rule corresponding to the patch to be generated, wherein the data export rule includes data export information and filtering conditions; determine the patch physical file corresponding to the data change item of the patch to be generated in a predetermined shared database according to the data export rule corresponding to the patch to be generated and the filtering conditions; automatically generate a patch based on the patch physical file corresponding to the data change item of the patch to be generated and the patch module information and patch type information in the patch information to be generated.
[0058] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device, equipment, and non-volatile computer storage medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0059] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0060] The devices and media provided in the embodiments of this specification correspond one-to-one to the methods. Therefore, the devices and media also have similar beneficial technical effects as the corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the devices and media will not be repeated here.
[0061] Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems, or computer program products. Therefore, this specification may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, this specification 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.) that contain computer-usable program code.
[0062] This specification is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of this specification. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0063] 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.
[0064] 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 in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0065] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0066] 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.
[0067] 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 magnetic 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.
[0068] 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.
[0069] The above description is only one or more embodiments of this specification and is not intended to limit this specification. For those skilled in the art, one or more embodiments of this specification may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of one or more embodiments of this specification shall be included in the scope of the claims of this specification.
Claims
1. A method for automatically generating patches for multiple environments, characterized in that: The method comprises: Acquire patch generation request information triggered by the user in the front-end page, and determine the patch information to be generated corresponding to the patch to be generated based on the patch generation request information, wherein the patch information to be generated includes patch module information and patch type information; Identify the database change item corresponding to the patch to be generated through the patch information to be generated corresponding to the patch to be generated, and determine the data export rule corresponding to the patch to be generated, wherein the data export rule includes the data export information and the filtering condition; Determining, in a predetermined shared database, a patch physical file corresponding to the data change item of the patch to be generated according to the data export rule corresponding to the patch to be generated and the filtering condition; A patch is automatically generated based on the patch physical file corresponding to the data change item of the patch to be generated and the patch module information and patch type information in the patch information to be generated.
2. The method for automatically generating patches for multiple environments according to claim 1, characterized in that: The method further comprises: identifying a database change item corresponding to the patch to be generated by using the patch information to be generated corresponding to the patch to be generated, and determining a data export rule corresponding to the patch to be generated. Specifically, the method comprises: Determine the current database version and the patch target version corresponding to the patch to be generated according to the patch information to be generated corresponding to the patch to be generated; Obtaining the current database information of the current database version and the target patch database information of the patch target version through the current database version and the patch target version; Comparing the current database information with the target patch database information of the patch target version to determine the database change item corresponding to the patch to be generated; According to the database change item corresponding to the patch to be generated, a data export rule corresponding to the patch to be generated is set.
3. The method for automatically generating patches for multiple environments according to claim 2, characterized in that: According to the database change item corresponding to the patch to be generated, setting the data export rule corresponding to the patch to be generated specifically includes: Analyze the database change item to determine at least one corresponding change database table, and set data export information of the patch to be generated based on the at least one change database table; Based on each of the changed database tables, determining the changed column information of each of the database tables, wherein the changed column information includes a database table identifier and a changed column identifier; The filter condition corresponding to the patch to be generated is set according to the change column information of each database table.
4. The method for automatically generating patches for multiple environments according to claim 1, characterized in that: Determining the patch physical file corresponding to the data change item of the patch to be generated in a predetermined shared database according to the data export rule corresponding to the patch to be generated and the filtering condition, specifically includes: Determine, according to the data export rule corresponding to the patch to be generated, a data storage identifier set of the data change items of the patch to be generated in the shared database; Determine the database data, table structure and constraint data in a predetermined shared database through the data storage identifier set and the preset API interface; Determine the database data file and the table structure and constraint data file according to the database data and the table structure and constraint data; Based on the database data file and table structure and constraint data file and the predetermined application data file, a patch physical file in the patch to be generated is generated.
5. The method for automatically generating patches for multiple environments according to claim 4, characterized in that: According to the data export rule corresponding to the patch to be generated, before determining the data change item of the patch to be generated in the data storage identifier set in the shared database, the method further includes: Exporting corresponding database data according to the data export information and the filtering condition in the data export rule through a preset first API interface; The database data is stored in a shared database, and a data storage identifier of the database data in the shared database is generated; According to at least one database table information in the database data, obtain the corresponding table structure and constraint data through a preset second API interface; The table structure and constraint data are stored in a shared database, and table structure and constraint data storage identifiers for the table structure and constraint data in the shared database are generated.
6. The method for automatically generating patches for multiple environments according to claim 5, characterized in that: Determining, according to the data export rule corresponding to the patch to be generated, a data storage identifier set of the data change items of the patch to be generated in the shared database specifically includes: Determine, according to the data export information corresponding to the patch to be generated and the filtering condition, a data data storage identifier of the database data in the shared database and a table structure and constraint data storage identifier of the table structure and constraint data in the shared database; Based on the data data storage identifier, determine a data data storage identifier set; Determine a table structure and a set of constraint data storage identifiers according to the table structure and constraint data storage identifiers; The data storage identifier set of the data change item of the patch to be generated in the shared database is determined by using the data data storage identifier set and the table structure and constraint data storage identifier set.
7. The method for automatically generating patches for multiple environments according to claim 1, characterized in that: Automatically generating a patch based on the patch physical file corresponding to the data change item of the patch to be generated and the patch module information and the patch type information in the patch information to be generated, specifically includes: Obtaining the database data file, table structure and constraint data file, and application data file in the patch physical file corresponding to the data change item of the patch to be generated; Organizing an application directory based on the application data file and determining application path information; Determine patch file information through the database data file, the table structure and the constraint data file; According to the patch module information and patch type information in the patch information to be generated, other basic information of the patch to be generated is supplemented to determine patch display information, wherein the patch display information includes a patch display identifier and a patch display label; A patch is automatically generated based on the application path information, the patch file information and the patch presentation information.
8. The method for automatically generating patches for multiple environments according to claim 5, characterized in that: According to at least one database table information in the database data, the corresponding table structure and constraint data are obtained through a preset second API interface, specifically including: The database table identifier in the at least one database table information is used as an input parameter, and the corresponding table structure and constraint data are obtained according to the patch installation record or the physical table through the second API interface.
9. A patch automatic generation device for multiple environments, characterized in that: The device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to: Acquire patch generation request information triggered by the user in the front-end page, and determine the patch information to be generated corresponding to the patch to be generated based on the patch generation request information, wherein the patch information to be generated includes patch module information and patch type information; Identify the database change item corresponding to the patch to be generated through the patch information to be generated corresponding to the patch to be generated, and determine the data export rule corresponding to the patch to be generated, wherein the data export rule includes the data export information and the filtering condition; Determining, in a predetermined shared database, a patch physical file corresponding to the data change item of the patch to be generated according to the data export rule corresponding to the patch to be generated and the filtering condition; A patch is automatically generated based on the patch physical file corresponding to the data change item of the patch to be generated and the patch module information and patch type information in the patch information to be generated.
10. A non-volatile computer storage medium storing computer executable instructions, characterized in that: The computer executable instructions are configured to: Acquire patch generation request information triggered by the user in the front-end page, and determine the patch information to be generated corresponding to the patch to be generated based on the patch generation request information, wherein the patch information to be generated includes patch module information and patch type information; Identify the database change item corresponding to the patch to be generated through the patch information to be generated corresponding to the patch to be generated, and determine the data export rule corresponding to the patch to be generated, wherein the data export rule includes the data export information and the filtering condition; Determining, in a predetermined shared database, a patch physical file corresponding to the data change item of the patch to be generated according to the data export rule corresponding to the patch to be generated and the filtering condition; A patch is automatically generated based on the patch physical file corresponding to the data change item of the patch to be generated and the patch module information and patch type information in the patch information to be generated.
