Database updating method and device, computer device and storage medium
By pre-storing the version packages and installation information during the database update process, the time and manpower costs of traditional methods are solved, achieving efficient database version updates.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-26
- Publication Date
- 2026-04-14
AI Technical Summary
Traditional database version update methods consume a lot of time and manpower, especially when multiple servers need to be updated, the workload increases exponentially.
The version packages and installation information used during the database update process are pre-stored on the storage device, and the target server directly retrieves and installs them from the storage device, reducing the steps of repeatedly writing installation information.
This reduces the manpower and time spent repeatedly writing installation information on different servers and improves the efficiency of database version updates.
Smart Images

Figure CN115687375B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of database or intelligent operation and maintenance technology, and in particular to a database update method, apparatus, computer equipment, storage medium and computer program product. Background Technology
[0002] For testing environments across various business scenarios, data is a crucial testing resource. Servers need to periodically perform database cleanups (i.e., roll back the database version to a historical version). After using the cleaned database, it needs to be restored to the latest version. Therefore, quickly updating the database to the latest version after restoring it to a version prior to the current date becomes a pressing issue.
[0003] In traditional methods, each database version that needs updating on a server is manually installed iteratively, repeating this process multiple times. If multiple different servers require database version updates, the workload increases exponentially, consuming a significant amount of time and manpower. Summary of the Invention
[0004] Therefore, it is necessary to provide a database update method, apparatus, computer equipment, computer-readable storage medium, and computer program product to address the technical problem that the above-mentioned database update methods consume a lot of time and manpower.
[0005] Firstly, this application provides a database update method. The method includes:
[0006] Obtain the current version information and target version information of the database to be updated in the target server; the target server is the server where the database version update is to be performed.
[0007] Based on the current version information and the target version information, the target update version package required by the database to be updated and the installation information of the target update version package are obtained from the preset storage device; the target update version package is the version package required for the database to be updated from the current version to the target version; the storage device stores multiple update version packages used by various updated databases in the version update process and the installation information of each update version package;
[0008] The target update package and its installation information are pushed to the target server, enabling the target server to update the database to be updated based on the target update package and the installation information.
[0009] In one embodiment, before obtaining the target update package required for the database to be updated and the installation information of the target update package from a preset storage device based on the current version information and the target version information, the method further includes:
[0010] For each updated database, determine the server corresponding to the updated database and designate it as the updated server;
[0011] From the updated server, obtain the update packages and installation information of each update package in the version update process of the updated database;
[0012] Store each updated version package and installation information of each updated version package for each updated database to the storage device, and establish a mapping relationship between each updated database and its corresponding updated version package and installation information.
[0013] In one embodiment, obtaining from the updated server the various update packages and installation information of each update package during the version update process of the updated database includes:
[0014] Obtain the complete version package of the updated server from the updated server; the complete version package includes the update version packages and installation information of each application deployed on the updated server;
[0015] From the complete version package, extract each updated version package and its installation information during the version update process of the updated database.
[0016] In one embodiment, before pushing the target update package and its installation information to the target server, the method further includes:
[0017] Obtain the target server identifier of the target server, and replace the server identifier in the target update version package with the target server identifier to obtain the replaced update version package;
[0018] The step of pushing the target update package and its installation information to the target server, enabling the target server to update the database to be updated based on the target update package and the installation information, includes:
[0019] The replaced update package and the installation information are pushed to the target server, so that the target server can update the database to be updated based on the replaced update package and the installation information.
[0020] In one embodiment, before obtaining the target update package required for the database to be updated and the installation information of the target update package from a preset storage device based on the current version information and the target version information, the method further includes:
[0021] Obtain the database identifier of the database to be updated;
[0022] The step of obtaining the target update package required for the database to be updated and the installation information of the target update package from a preset storage device based on the current version information and the target version information includes:
[0023] Based on the database identifier, the current version information, and the target version information, the target update version package required for the database to be updated and the installation information of the target update version package are obtained from the preset storage device.
[0024] In one embodiment, the installation information includes version manifest information of the target update package;
[0025] Before pushing the target update package and its installation information to the target server, the method further includes:
[0026] The integrity of the target update package is verified based on the version manifest information.
[0027] If the verification result is incomplete, a prompt message will be output.
[0028] In one embodiment, the installation information further includes the installation script for the target update package and the execution instructions for the installation script.
[0029] Secondly, this application also provides a database updating apparatus. The apparatus includes:
[0030] The information acquisition module is used to acquire the current version information and target version information of the database to be updated in the target server; the target server is the server where the database version update is to be performed.
[0031] The installation content acquisition module is used to acquire, based on the current version information and the target version information, the target update version package required by the database to be updated and the installation information of the target update version package from a preset storage device; the target update version package is the version package required to update from the current version to the target version; the storage device stores multiple update version packages used by the database that has completed the version update during the update process and the installation information of each update version package;
[0032] The installation content push module is used to push the target update version package and the installation information of the target update version package to the target server, so that the target server updates the version of the database to be updated based on the target update version package and the installation information.
[0033] Thirdly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to perform the following steps:
[0034] Obtain the current version information and target version information of the database to be updated in the target server; the target server is the server where the database version update is to be performed.
[0035] Based on the current version information and the target version information, the target update version package required by the database to be updated and the installation information of the target update version package are obtained from the preset storage device; the target update version package is the version package required for the database to be updated from the current version to the target version; the storage device stores multiple update version packages used by various updated databases in the version update process and the installation information of each update version package;
[0036] The target update package and its installation information are pushed to the target server, enabling the target server to update the database to be updated based on the target update package and the installation information.
[0037] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, performs the following steps:
[0038] Obtain the current version information and target version information of the database to be updated in the target server; the target server is the server where the database version update is to be performed.
[0039] Based on the current version information and the target version information, the target update version package required by the database to be updated and the installation information of the target update version package are obtained from the preset storage device; the target update version package is the version package required for the database to be updated from the current version to the target version; the storage device stores multiple update version packages used by various updated databases in the version update process and the installation information of each update version package;
[0040] The target update package and its installation information are pushed to the target server, enabling the target server to update the database to be updated based on the target update package and the installation information.
[0041] Fifthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, performs the following steps:
[0042] Obtain the current version information and target version information of the database to be updated in the target server; the target server is the server where the database version update is to be performed.
[0043] Based on the current version information and the target version information, the target update version package required by the database to be updated and the installation information of the target update version package are obtained from the preset storage device; the target update version package is the version package required for the database to be updated from the current version to the target version; the storage device stores multiple update version packages used by various updated databases in the version update process and the installation information of each update version package;
[0044] The target update package and its installation information are pushed to the target server, enabling the target server to update the database to be updated based on the target update package and the installation information.
[0045] In the aforementioned database update method, by pre-storing the update package and corresponding installation information used during the database update process to a storage device, when the target server needs to update a database of the same type that stores the same data, the update package and installation information can be directly retrieved from the storage device and pushed to the target server. The target server can then install the update package based on the installation information without rewriting the installation information, thereby reducing the manpower and time spent on repeatedly writing installation information on different servers. Attached Figure Description
[0046] Figure 1 This is a diagram illustrating the application environment of a database update method in one embodiment.
[0047] Figure 2 This is a flowchart illustrating a database update method in one embodiment;
[0048] Figure 3 This is a flowchart illustrating the database update method in another embodiment;
[0049] Figure 4 A system architecture block diagram illustrating the database update method of this application in one embodiment;
[0050] Figure 5 This is a flowchart illustrating the system executing the database update method of this application in one embodiment;
[0051] Figure 6 This is a structural block diagram of a database update device in one embodiment;
[0052] Figure 7 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0053] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0054] The database update method provided in this application embodiment can be applied to, for example, Figure 1 In the application environment shown, terminal 102 communicates with target server 104 and storage device 106 via the network. In the application scenario of this application, terminal 102 obtains the current version information and target version information of the database to be updated in target server 104. Based on the current version information and target version information, it obtains the target update version package and its installation information from the preset storage device 106, and pushes the target update version package and its installation information to target server 106, enabling target server 106 to update the database version based on the target update version package and its installation information.
[0055] The terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, and smart in-vehicle systems. Portable wearable devices can include smartwatches, smart bracelets, and head-mounted devices. The server 104 can be implemented using a standalone server or a server cluster consisting of multiple servers.
[0056] In one embodiment, such as Figure 2 As shown, a database update method is provided, which can be applied to... Figure 1 Taking terminal 102 as an example, the explanation includes the following steps:
[0057] Step 201: Obtain the current version information and target version information of the database to be updated on the target server; the target server is the server on which the database version update is to be performed.
[0058] Among them, the database to be updated refers to the database whose content needs to be restored.
[0059] In this context, the target version information corresponds to a higher version level than the current version information corresponds to a higher version level. In other words, the target version can be obtained by iterating and updating the current version a certain number of times.
[0060] The versions in the target version information and the current version information represent databases from different periods, and the content stored in the databases differs between these periods.
[0061] The target version information and the current version information can be represented in the form of version time. For example, the target version information is version 202207, and the current version information is version 202228.
[0062] It should be noted that, since the application scenario of this application is to update the version of the database after the database is cleaned up, that is, to roll back the version of the database to a historical version (i.e., the current version) and then restore it from the historical version to the latest version (i.e., the target version), the version level of the target version is higher than that of the current version.
[0063] In a specific implementation, terminal 102 can receive the server identifier of the target server input by the user through the terminal page, and determine the current version information of the database to be updated in the target server based on the server identifier. At the same time, terminal 102 can also receive the target version information of the database to be updated input by the user through the terminal page, thereby obtaining the current version information and target version information of the database to be updated in the target server.
[0064] Step 202: Based on the current version information and the target version information, retrieve the target update version package and the installation information of the target update version package required by the database to be updated from the preset storage device; the target update version package is the version package required for the database to be updated from the current version to the target version; the storage device stores multiple update version packages used by various updated databases during the version update process and the installation information of each update version package.
[0065] Here, "current version" refers to the database version corresponding to the current version information.
[0066] The target version refers to the database version corresponding to the target version information.
[0067] The target update package can contain multiple update packages, each with corresponding installation information. This installation information represents the information used during the installation of the update package to the server. The installation information can include the installation script for the update package and the execution instructions for the installation script. Each installation script is used to execute the installation operation of the corresponding update package. The target server 104 completes the execution of the corresponding installation script according to the execution instructions of each installation script.
[0068] In practice, multiple update packages used by various updated databases during the version update process, along with their installation information, can be pre-acquired and stored in storage device 106. When terminal 102 obtains the current version information and target version information of the database to be updated from target server 104, it can determine the update package information required to update the database from its current version to the target version. Furthermore, based on the required update package information, it retrieves the target update package and its installation information from storage device 106.
[0069] It should be noted that the updated version packages of the updated database stored in storage device 106 include all updated version packages and installation information of all updated version packages during the process of iterating the updated database from the initial version to the latest version. Therefore, the update packages and installation information of the database to be updated from the current version to any version can be obtained from storage device 106, so as to realize the update of the database to be updated from the current version to any version.
[0070] Step 203: Push the target update package and its installation information to the target server, so that the target server can update the database to be updated based on the target update package and its installation information.
[0071] In the specific implementation, the terminal 102 pushes the target update version package and the corresponding installation information to the target server 104. After receiving the target update version package and the corresponding installation information, the target server 104 can install the target update version package into the target server 104 through the installation script of the target update version package and the execution instructions of the installation script in the installation information, thereby realizing the version update of the database to be updated in the target server 104.
[0072] In the aforementioned database update method, by pre-storing the update package and corresponding installation information used during the database update process to a storage device, when the target server needs to update the same type of database later, the update package and installation information of that database can be directly retrieved from the storage device and pushed to the target server. The target server can then install the update package based on the installation information without rewriting the installation information, thereby reducing the manpower and time spent on repeatedly writing installation information on different servers.
[0073] In one embodiment, before step 202 above, which retrieves the target update package and its installation information from a preset storage device based on the current version information and the target version information, the following steps are further included:
[0074] Step 2021: For each updated database, determine the server corresponding to the updated database and designate it as the updated server;
[0075] Step 2022: Obtain from the updated server the update package and installation information of each update package in the version update process of the updated database;
[0076] Step 2023: Store each update version package and installation information of each update version package for each updated database to the storage device, and establish a mapping relationship between each updated database and the corresponding update version package and installation information.
[0077] The updated databases can include databases of different types or databases of the same type but storing different data. Furthermore, each database corresponds to only one server, and each server corresponds to only one database.
[0078] It should be noted that different databases have different types or store different data, so the deployment content and methods for different databases are different, and therefore the update packages for different databases are also different.
[0079] In the specific implementation, for different updated databases in various updated servers, the update packages and installation information of each updated database used in the update process from the initial version to the latest version are obtained, and a mapping relationship between each update package and installation information and the corresponding different updated databases is established. The storage device stores the obtained update packages and corresponding installation information of each updated database and the above mapping relationship, so as to obtain the update packages and corresponding installation information of various databases that can be called at any time.
[0080] In this embodiment, various update version packages and corresponding installation information of various updated databases are pre-stored. Servers that need to update the same type of database can call the corresponding update version package and corresponding installation information at any time to update the corresponding database version, reducing the time spent on repeatedly writing installation information when updating the same database.
[0081] In one embodiment, step 2022 above obtains the various update packages and installation information of each update package in the version update process of the updated database from the updated server. This can be further implemented through the following steps:
[0082] Step 2022A: Obtain the complete version package of the updated server from the updated server; the complete version package includes the update version packages and installation information of each application deployed on the updated server;
[0083] Step 2022B: Extract the update packages and installation information of each update package from the complete version package during the version update process of the updated database.
[0084] It should be noted that "database cleanup" on the server refers to the operation of rolling back the database to a previous version. Therefore, only the updated version package of the database needs to be extracted, and it is not necessary to extract the full version package or the contents of the full version package other than the updated version package of the database.
[0085] In the specific implementation, the complete version package of the updated server is obtained. The complete version package includes all the update data of the update server, including database update data, program update data, and system update data. From the complete version package, the update data required by the updated database in the previous update process is extracted, that is, each update version package and its corresponding installation information, and each update version package and its corresponding installation information are stored in the storage device.
[0086] In this embodiment, the updated version package of the updated database and the corresponding installation information are extracted from the complete version package of the updated server and stored separately. When the target server needs to update the database, it only needs to call the updated version package of the updated database and the corresponding installation information (without calling the complete version package), which reduces the storage space required.
[0087] In one embodiment, before step 202 above, which retrieves the target update package and its installation information from a preset storage device based on the current version information and the target version information, the following steps are further included:
[0088] Step 2024: Obtain the database identifier of the database to be updated;
[0089] Based on the current version information and target version information, retrieve the target update package and its installation information from the preset storage device, including:
[0090] Step 2025: Based on the database identifier, current version information, and target version information, retrieve the target update version package and installation information of the target update version package required for the database to be updated from the preset storage device.
[0091] The database identifier includes the database type, the stored data, and the identifier of the corresponding server.
[0092] In the specific implementation, it is necessary to obtain the database identifier of the database to be updated, that is, to obtain the type of the database to be updated and the stored data content. Based on the database identifier and the current version information and target version information of the database to be updated, the target update version package and corresponding installation information of the corresponding type and stored data are obtained from the preset storage device, so that the database to be updated can be updated based on the update version package and corresponding installation information that match the type and stored data.
[0093] In this embodiment, databases of different types or the same type but storing different data are identified by database identifiers. Based on the database identifier of the database to be updated, the matching update package and corresponding installation information are obtained, which can realize the version update of databases of different types or the same type but storing different data.
[0094] In one embodiment, the installation information includes a version list of the target update package; before step 203 above, which pushes the target update package and its installation information to the target server, the following steps are also included:
[0095] Step 2031: Perform integrity verification on the target update package based on the version manifest information;
[0096] Step 2032: If the verification result is incomplete, output a prompt message.
[0097] The version list information records the specific contents of the corresponding update version package.
[0098] In practice, the terminal obtains the version list information corresponding to each update package from the storage device. Based on the specific content list of the corresponding update package recorded in the version list information, it performs a content integrity check on the update package in the storage device to determine the completeness of the content in the update package. If the update package content is incomplete, a prompt message is output to help the user make a decision on how to handle the incomplete update package.
[0099] In this embodiment, the installation information corresponding to the update version package obtained by the storage device includes version list information. The version list information is used to verify the integrity of the update version package, ensure the correctness of the database version update, and reduce the possibility of errors and the maintenance costs incurred.
[0100] In one embodiment, before step 203 above, which pushes the target update package and its installation information to the target server, the following steps are also included:
[0101] Step 2033: Obtain the target server identifier of the target server, replace the server identifier in the target update package with the target server identifier, and obtain the replaced update package;
[0102] Push the target update package and its installation information to the target server, enabling the target server to update the database based on the target update package and installation information, including:
[0103] Step 2034: Push the replaced update package and installation information to the target server, so that the target server can update the database to be updated based on the replaced update package and installation information.
[0104] The server identifier in the target update package indicates the server to which the target update package needs to be pushed. The server identifier in the initial target update package indicates the updated server from which the target update package is obtained.
[0105] The server identifier can be represented by the server's IP address.
[0106] In the specific implementation, when the storage device obtains the update version package, the server identifier of the update version package is the source of the acquisition (i.e., the server identifier of the updated server). When the target server needs the corresponding update version package, the server identifier of the target update version package in the storage device will be replaced with the server identifier of the target server. Therefore, the terminal can push the target update version package to the corresponding target server according to the server identifier, and the target server can perform database version update based on the target update version package.
[0107] In this embodiment, by replacing the server identifier in the update package, it can be pushed to different servers for version updates, realizing the reuse of update package and reducing the time spent writing installation information when updating the version on each server.
[0108] In one embodiment, the installation information also includes the installation script for the target update package and the execution instructions for the installation script.
[0109] The installation script contains database installation instructions for each update package within the target update package.
[0110] The execution instructions for the installation scripts are specific to the operating system for each installation script.
[0111] In the specific implementation, the installation information corresponding to the target update package obtained by the terminal includes the installation script of the target update package and the execution instructions of the installation script; this enables the target server to have the operating system execute the installation script based on the execution instructions of the installation script, and the installation script then performs the installation operation of the corresponding update package in the database.
[0112] In this embodiment, by obtaining the installation script and execution instructions corresponding to the target installation version package, the time and manpower required to rewrite the installation script and execution instructions when updating the database can be reduced.
[0113] In another embodiment, such as Figure 3 As shown, a method for updating a database is provided. In this embodiment, the method includes the following steps:
[0114] Step 301: For each updated database, determine the server corresponding to the updated database and designate it as the updated server.
[0115] Step 302: Obtain the complete version package of the updated server from the updated server; the complete version package includes the updated version packages and installation information of each application deployed on the updated server.
[0116] Step 303: Extract the update packages and installation information of each update package from the complete version package during the version update process of the updated database.
[0117] Step 304: Store each update version package and installation information of each update version package for each updated database to the storage device, and establish a mapping relationship between each updated database and the corresponding update version package and installation information.
[0118] Step 305: Perform integrity verification on the updated version package based on the version manifest information.
[0119] Step 306: If the verification result is incomplete, output a prompt message.
[0120] Step 307: Obtain the database identifier of the database to be updated in the target server, and obtain the current version information and target version information of the database to be updated; the target server is the server where the database version update is to be performed.
[0121] Step 308: Based on the database identifier, current version information, and target version information, retrieve the target update version package and installation information of the target update version package required for the database to be updated from the preset storage device.
[0122] Step 309: Obtain the target server identifier of the target server, replace the server identifier in the target update package with the target server identifier, and obtain the replaced update package.
[0123] Step 310: Push the replaced update package and installation information to the target server, so that the target server can update the database to be updated based on the replaced update package and installation information.
[0124] In the specific implementation, for various updated databases that have been updated from the initial version to the latest version, the corresponding updated server is determined. The storage device obtains the complete version package used by the updated database during the update process. The complete version package includes the application in the update server, the operating system of the update server, and various update version packages and corresponding installation information for the database corresponding to the update server. From the complete version package, each update version package (each version update package can be identified by a version number) and the installation information of each update version package are extracted from the updated database during the version update process. The installation information includes version list information, a version installation strategy table (each version installation strategy table records the specific update content of the corresponding update version package), the installation script of the update version package, and the execution instructions of the installation script. Based on a preset directory structure, and according to the version number order of the extracted update version packages and corresponding installation information, corresponding folders are created, and the extracted update version packages and corresponding installation information are placed in the corresponding folders and then stored in the storage device. Furthermore, the mapping relationship between each different type of database or the same type but storing different storage data and the corresponding update version package and installation information is recorded. At the same time, the integrity of the update package is checked based on the version list information in the installation information. If the check result is incomplete, a prompt message is output, and the user can obtain the incomplete update package again according to the prompt message.
[0125] When a database on a server needs an update, the terminal obtains the server identifier (which may be the server's IP address) of the target server input by the user. Based on the server identifier, it queries the database identifier and current version information of the database to be updated on the target server. Simultaneously, it obtains the target version information of the database version the user inputs needs to update to. Based on the database identifier, current version information, and target version information, it retrieves the required target update package and its installation information from a pre-set storage device. The target update package contains at least one update package, representing all the necessary update packages for updating the database from its current version to the target version. The terminal replaces the server identifier in the target update package with the target server identifier, resulting in a replaced update package. Based on the server identifier in the replaced update package, the terminal pushes the replaced update package and its installation information to the target server. The target server then runs the installation script and its execution instructions from the installation information to complete the database update.
[0126] In this embodiment, by pre-extracting the database update package and corresponding installation information from the complete version packages required for updating various servers from their initial versions to the latest versions, the update packages and corresponding installation information required for updating various databases for various servers from their initial versions to the latest versions are stored in a storage device. When the same database needs to be updated to one of the version nodes, the corresponding database update package and corresponding installation information can be directly called, and the database version update can be completed based on the required update package and corresponding installation information. This reduces the space occupied by the update package when a server needs to update its database; and it reduces the time consumed by repeatedly writing the corresponding installation information during the database update process. Furthermore, each server can be personalized to update to the required version.
[0127] To facilitate understanding of the embodiments of this application by those skilled in the art, the following will use a system providing the database update method of this application as an example, and describe the application in conjunction with specific examples in the accompanying drawings, such as... Figure 4 As shown, the system in this embodiment includes an initial termination module 401, a version tracking module 402, a variable retrieval module 403, an installation module 404, a log module 405, and a front-end display module 406.
[0128] The initialization / termination module 401 receives "initialization" and "termination" commands from the user input in the front-end display module 406. If the "initialization" command is received, a relative root folder is created on the server executing the database update method. The root folder name is input by the front-end display module 406, and the default is IP address + date (assumed to be 12.34.56.78_20220216), where the IP address is the IP address of the updated server for obtaining the updated version package, input by the user in the front-end display module 406. If the "termination" command is received, this application packages and archives the 12.34.56.78_20220216 folder for later use (assumed to be named 12.34.56.78_20220216.zip).
[0129] The version tracking module 402 can receive "Start" and "Stop" commands from the user input in the front-end display module 406. If a "Start" command is received, a folder named after the version number input by the user in the front-end display module 406 will be created under the folder 12.34.56.78_20220216 (we assume the folder name is version202201a01). Simultaneously, this module will retrieve the version package containing the database content from the 12.34.56.78 server via binary mode and store it under version202201a01. Generally, the installation directory for versions is standardized, so there is no need to input the directory structure for retrieving the version package separately. This module also needs to retrieve the installation strategy table (an Excel file with the .xls extension) and the version list table vsersion.txt from the 12.34.56.78 server. The process involves generating the `start.sh` script (an operating system script, i.e., the execution instructions for the installation script) based on the `.xls` table. Simultaneously, the system checks `vserssion.txt` to verify the completeness of the database version package obtained by this module; if incomplete, a log message is output to alert the user. If the database version content, `start.sh` script, installation strategy table, and version manifest table are all retrieved from the storage device and the manifest is successfully verified, a 406 success message is returned to the front end. If a "End" command is received, no further operations will be performed on `version202201a01`. Within the same initialization and termination cycle, if a "End" command is received followed by a "Start" command, the `version202201a02` folder will be created under `12.34.56.78_20220216`, and so on.
[0130] The variable retrieval module 403 can perform variable replacement on the IP information content in the large time period version packet obtained from the initialization and termination module 401. This module filters out the IP information based on shell commands and transmits it to the front-end display module 406. For each IP sent to the front-end display module 406, it will receive a command from the front-end indicating whether to replace it. If "yes" is received, the IP information will be replaced with the IP entered by the user in the front-end display module 406; if "no" is received, no processing will be performed on this IP.
[0131] The installation module 404 can install the database update version of the 12.34.56.78_20220216.zip package on various servers. The server IP address for this update is input by the front-end display module 406. The version package pushed to the server by this module is the one with the new IP address. Furthermore, for each of the multiple minor version period packages (version202201a01) contained in 12.34.56.78_20220216.zip, the front-end display module 406 can, according to the user's selection, choose which minor version package to install and which not to install.
[0132] The log module 405 receives log information from the various modules during their operation.
[0133] The front-end display module 406 can respond to user input such as "Initial," "Start," "End," "Terminate," "Search Variables," "Replace Variable Input," and "Installation Server IP Input." "Initial" refers to the initial creation of a large-scale version package. "Terminate" refers to the termination of a large-scale version package creation process. Before starting an initial version, the "Initial IP" and "Root Folder Name" must be entered and sent to the Initial / Terminate module 401. Each initial version contains multiple smaller version packages within each large-scale version package. Each smaller version package is identified by "Start" and "End." Clicking "Search Variables" sends a search to the variable retrieval module 403 to check if the large-scale version package contains the target IP information. The variable retrieval module 403 returns the search results to the front-end display module 406. If IP information is found and needs to be replaced with a variable, the "Replace Variable Input" function must be used. "Installation Server IP Input" refers to entering the IP address on the server where the version package needs to run when multiple environments exist.
[0134] The steps of this system in executing the database update method of this application are as follows: Figure 5 As shown, this includes two parts: obtaining the update package and updating the database. Among them,
[0135] Obtaining the update package includes the following steps:
[0136] Step 501: Initialize the large cycle.
[0137] Step 502: Obtain information such as the IP address and version package name of the updated server.
[0138] Step 503, begin the small cycle.
[0139] Step 504: Obtain the updated version package from the server corresponding to the IP address of the updated server.
[0140] Step 505: Generate script files, minor version packages, etc.
[0141] Step 506: End the small cycle. If a termination command is received, proceed to step 507; otherwise, return to step 503 to continue a new small cycle.
[0142] Step 507, terminate the large cycle.
[0143] Database updates include the following steps:
[0144] Step 508: Retrieve and display IP variables.
[0145] Step 509: Enter multiple IP addresses to be installed and the required version and other variable information.
[0146] Step 510: Perform the installation.
[0147] In this embodiment, by pre-storing the update package and corresponding installation information used during the database update process to the storage device, when the target server needs to update the same type of database later, the update package and installation information of the database can be directly retrieved from the storage device and pushed to the target server. The target server can then install the update package based on the installation information without rewriting the installation information, thereby reducing the manpower and time spent on repeatedly writing installation information on different servers.
[0148] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0149] Based on the same inventive concept, this application also provides a database update apparatus for implementing the database update method described above. The solution provided by this apparatus is similar to the implementation described in the above method; therefore, the specific limitations in one or more database update apparatus embodiments provided below can be found in the limitations of the database update method described above, and will not be repeated here.
[0150] In one embodiment, such as Figure 6 As shown, a database update device is provided, including: an information acquisition module, an installation content acquisition module, and an installation data push module, wherein:
[0151] The information acquisition module 601 is used to acquire the current version information and target version information of the database to be updated in the target server; the target server is the server where the database version update is to be performed.
[0152] The installation content acquisition module 602 is used to acquire the target update version package and the installation information of the target update version package required by the database to be updated from a preset storage device according to the current version information and the target version information; the target update version package is the version package required for the database to be updated from the current version to the target version; the storage device stores multiple update version packages used by various updated databases in the version update process and the installation information of each update version package;
[0153] The installation content push module 603 is used to push the target update version package and the installation information of the target update version package to the target server, so that the target server can update the version of the database to be updated based on the target update version package and the installation information.
[0154] In one embodiment, the installation content acquisition module 602 is further configured to: determine the server corresponding to each updated database as the updated server; obtain from the updated server the update version packages and installation information of each update version package during the version update process of the updated database; store the update version packages and installation information of each updated database to a storage device; and establish a mapping relationship between each updated database and its corresponding update version package and installation information.
[0155] In one embodiment, the installation content acquisition module 602 is further configured to acquire the complete version package of the updated server from the updated server; the complete version package includes the update version packages and installation information of each application deployed on the update server; and extract the update version packages and installation information of each update version package in the version update process of the updated database from the complete version package.
[0156] In one embodiment, the installation content push module 603 is further configured to: retrieve the target server identifier of the target server; replace the server identifier in the target update version package with the target server identifier to obtain the replaced update version package; push the replaced update version package and installation information to the target server, so that the target server performs a version update of the database to be updated based on the replaced update version package and installation information.
[0157] In one embodiment, the installation content acquisition module 602 is further configured to acquire the database identifier of the database to be updated; and, based on the database identifier, current version information, and target version information, acquire the target update version package and installation information of the target update version package required for the database to be updated from a preset storage device.
[0158] In one embodiment, the installation information includes version list information of the target update package. The installation content push module 603 is further configured to perform integrity verification on the target update package based on the version list information; and output a prompt message if the verification result is incomplete.
[0159] In one embodiment, the installation information also includes the installation script for the target update package and the execution instructions for the installation script.
[0160] Each module in the aforementioned database update device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can invoke and execute the operations corresponding to each module.
[0161] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 7As shown, the computer device includes a processor, memory, communication interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements a database update method. The display screen can be an LCD screen or an e-ink screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad located on the computer device casing, or an external keyboard, touchpad, or mouse.
[0162] Those skilled in the art will understand that Figure 7 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0163] In one embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above method embodiments.
[0164] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above method embodiments.
[0165] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.
[0166] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
[0167] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0168] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0169] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A database update method, characterized in that, The method includes: Obtain the current version information and target version information of the database to be updated in the target server; the target server is the server where the database version is to be updated; the database to be updated is the database that has been rolled back to a historical version after a database cleanup operation and is to be restored. Based on the current version information and the target version information, the target update version package required by the database to be updated and the installation information of the target update version package are obtained from a preset storage device; the target update version package is the version package required for the database to be updated from the current version to the target version; the storage device stores multiple update version packages used by various updated databases during the version update process and the installation information of each update version package; the installation information includes version list information; The integrity of the target update package is verified based on the version manifest information. If the verification result is incomplete, a prompt message will be output; Obtain the target server identifier of the target server, and replace the server identifier in the target update version package with the target server identifier to obtain the replaced update version package; The replaced update package and the installation information are pushed to the target server, so that the target server can update the database to be updated based on the replaced update package and the installation information.
2. The method according to claim 1, characterized in that, Before obtaining the target update package required for the database to be updated and the installation information of the target update package from a preset storage device based on the current version information and the target version information, the method further includes: For each updated database, determine the server corresponding to the updated database and designate it as the updated server; From the updated server, obtain the update packages and installation information of each update package in the version update process of the updated database; Store each updated version package and installation information of each updated version package for each updated database to the storage device, and establish a mapping relationship between each updated database and its corresponding updated version package and installation information.
3. The method according to claim 2, characterized in that, The step of obtaining from the updated server the various update packages and installation information of each update package in the version update process of the updated database includes: Obtain the complete version package of the updated server from the updated server; the complete version package includes the update version packages and installation information of each application deployed on the updated server; From the complete version package, extract each updated version package and its installation information during the version update process of the updated database.
4. The method according to claim 1, characterized in that, Before obtaining the target update package required for the database to be updated and the installation information of the target update package from a preset storage device based on the current version information and the target version information, the method further includes: Obtain the database identifier of the database to be updated; The step of obtaining the target update package required for the database to be updated and the installation information of the target update package from a preset storage device based on the current version information and the target version information includes: Based on the database identifier, the current version information, and the target version information, the target update version package required for the database to be updated and the installation information of the target update version package are obtained from a preset storage device.
5. The method according to claim 1, characterized in that, The installation information also includes the installation script for the target update package and the execution instructions for the installation script.
6. A database update device, characterized in that, The device includes: The information acquisition module is used to acquire the current version information and target version information of the database to be updated in the target server; the target server is the server where the database version is to be updated; the database to be updated is the database that has been rolled back to a historical version after a database cleanup operation and is to be restored. The installation content acquisition module is used to acquire, based on the current version information and the target version information, the target update version package required by the database to be updated and the installation information of the target update version package from a preset storage device; the target update version package is the version package required for the database to be updated from the current version to the target version; the storage device stores multiple update version packages used by various updated databases during the version update process and the installation information of each update version package; the installation information includes version list information; The installation content push module is used to push the target update version package and the installation information of the target update version package to the target server, so that the target server updates the version of the database to be updated based on the target update version package and the installation information; The installation content push module is also used to perform integrity verification on the target update version package based on the version list information; if the verification result is incomplete, a prompt message is output. The installation content push module is also used to obtain the target server identifier of the target server, and replace the server identifier in the target update version package with the target server identifier to obtain the replaced update version package; The replaced update package and the installation information are pushed to the target server, so that the target server can update the database to be updated based on the replaced update package and the installation information.
7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 5.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 5.
9. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Synchronous upgrading method and device
CN106909429A
Application server version deployment method, device and system
CN107908414A