CN115687375A - Database updating method and device, computer equipment and storage medium - Google Patents

Database updating method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN115687375A
CN115687375A CN202211032433.6A CN202211032433A CN115687375A CN 115687375 A CN115687375 A CN 115687375A CN 202211032433 A CN202211032433 A CN 202211032433A CN 115687375 A CN115687375 A CN 115687375A
Authority
CN
China
Prior art keywords
version
target
database
updated
package
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211032433.6A
Other languages
Chinese (zh)
Inventor
周满园
张海明
徐昕
侯晓勇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202211032433.6A priority Critical patent/CN115687375A/en
Publication of CN115687375A publication Critical patent/CN115687375A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application relates to a database updating method, a database updating device, computer equipment, a storage medium and a computer program product, and relates to the field of databases or intelligent operation and maintenance. The method comprises the following steps: acquiring current version information and target version information of a database to be updated in a target server; acquiring a target update version package and corresponding installation information required by a database to be updated from preset storage equipment according to the current version information and the target version information; the target update version package is a version package required by updating the database to be updated from the current version to the target version; the storage device stores a plurality of updated version packages and corresponding installation information used by a plurality of updated databases in the version updating process; and pushing the target update version package and the corresponding installation information to the target server, so that the target server performs required version update on the database to be updated. By adopting the method, the labor and time consumed by repeatedly compiling the installation information in different servers can be reduced.

Description

Database updating method and device, computer equipment and storage medium
Technical Field
The present application relates to the field of database or intelligent operation and maintenance technologies, and in particular, to a database updating method, apparatus, computer device, storage medium, and computer program product.
Background
For the test environment of each service scene, data is an important test resource, a server needs to shovel the database periodically (i.e. the database version is returned to a historical version), and when the database after the shovel is used, the latest version of the database needs to be restored. After the database is restored to a certain version before the current date, how to quickly update the database version to the latest version becomes an urgent problem to be solved.
In the conventional technology, database versions to be updated by a server are manually and iteratively installed one by one, and similar operations are repeated for many times. If a plurality of different servers need to update the database version, the workload will be doubled, and a lot of time and labor will be consumed.
Disclosure of Invention
In view of the above, it is necessary to provide a database updating method, an apparatus, a computer device, a computer readable storage medium, and a computer program product for solving the technical problem that the database updating method described above consumes a lot of time and labor.
In a first aspect, the present application provides a database updating method. The method comprises the following steps:
acquiring current version information and target version information of a database to be updated in a target server; the target server is a server to be subjected to database version updating;
acquiring a target update version package and 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 a version package required by updating the database to be updated from the current version to the target version; the storage device stores a plurality of update version packages used by a plurality of updated databases in the version updating process and installation information of each update version package;
and pushing 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.
In one embodiment, before the acquiring, from a preset storage device, a target update version package and installation information of the target update version package required by the database to be updated according to the current version information and the target version information, the method further includes:
for each updated database, determining a server corresponding to the updated database as an updated server;
acquiring each update version package and installation information of each update version package of the updated database in the version updating process from the updated server;
and storing each updated version package of each updated database and the installation information of each updated version package to the storage device, and establishing a mapping relation between each updated database and the corresponding updated version package and installation information.
In one embodiment, the obtaining, from the updated server, each update version package and installation information of each update version package of the updated database in the version update process includes:
acquiring a complete version package of the updated server from the updated server; the complete version package comprises update version packages and installation information of all applications deployed in the update server;
and extracting each update version package and the installation information of each update version package of the updated database in the version updating process from the complete version package.
In one embodiment, before the pushing the target update version package and the installation information of the target update version package to the target server, the method further includes:
acquiring a target server identifier of the target server, and replacing the server identifier in the target update version package by the target server identifier to obtain a replaced update version package;
the pushing the target update version package and the installation information of the target update version package to the target server so that the target server performs the version update of the database to be updated based on the target update version package and the installation information includes:
and pushing the replaced updated version package and the installation information to the target server, so that the target server updates the version of the database to be updated based on the replaced updated version package and the installation information.
In one embodiment, before the acquiring, according to the current version information and the target version information, installation information of a target update version package and the target update version package required by the database to be updated from a preset storage device, the method further includes:
acquiring a database identifier of the database to be updated;
the acquiring, from a preset storage device, a target update version package and installation information of the target update version package required by the database to be updated according to the current version information and the target version information includes:
and acquiring a target update version package and installation information of the target update version package required by the database to be updated from a preset storage device according to the database identification, the current version information and the target version information.
In one embodiment, the installation information includes version manifest information of the target update version package;
before the pushing the target update version package and the installation information of the target update version package to the target server, the method further includes:
performing integrity check on the target update version package based on the version list information;
and outputting prompt information under the condition that the verification result is incomplete.
In one embodiment, the installation information further includes an installation script of the target update version package and an execution instruction of the installation script.
In a second aspect, the present application further provides a database updating apparatus. The device comprises:
the information acquisition module is used for acquiring current version information and target version information of a database to be updated in the target server; the target server is a server to be subjected to database version updating;
the installation content acquisition module is used for acquiring a target update version package and 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 a version package required by updating from a current version to a target version; the storage device stores a plurality of update version packages used by the database with the updated version in the updating process and installation information of each update version package;
and the installation content pushing module is used for pushing 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.
In a third aspect, the present application also provides a computer device. The computer device comprises a memory storing a computer program and a processor implementing the following steps when executing the computer program:
acquiring current version information and target version information of a database to be updated in a target server; the target server is a server to be subjected to database version updating;
acquiring a target update version package and 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 a version package required by updating the database to be updated from the current version to the target version; the storage device stores a plurality of update version packages used by a plurality of updated databases in the version updating process and installation information of each update version package;
and pushing 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.
In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of:
acquiring current version information and target version information of a database to be updated in a target server; the target server is a server to be subjected to database version updating;
acquiring a target update version package and 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 a version package required by updating the database to be updated from the current version to the target version; the storage device stores a plurality of update version packages used by a plurality of updated databases in the version updating process and installation information of each update version package;
and pushing 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.
In a fifth aspect, the present application further provides a computer program product. The computer program product comprising a computer program which when executed by a processor performs the steps of:
acquiring current version information and target version information of a database to be updated in a target server; the target server is a server to be subjected to database version updating;
acquiring a target update version package and 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 a version package required by updating the database to be updated from the current version to the target version; the storage device stores a plurality of update version packages used by a plurality of updated databases in the version updating process and installation information of each update version package;
and pushing 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.
In the database updating method, the update version package and the corresponding installation information used in the process of updating the database are stored in the storage device in advance, so that the update version package and the installation information of the database can be directly extracted from the storage device and pushed to the target server when the target server needs to update the database which is of the same type and stores the same storage data, the target server is enabled to install the update version package based on the installation information, the installation information does not need to be rewritten, and the labor and time consumed by repeatedly writing the installation information in different servers can be reduced.
Drawings
FIG. 1 is a diagram of an application environment of a database update method in one embodiment;
FIG. 2 is a flow diagram illustrating a database update method according to one embodiment;
FIG. 3 is a flow chart illustrating a database update method according to another embodiment;
FIG. 4 is a block diagram of a system architecture in one embodiment that provides the database update method of the present application;
FIG. 5 is a schematic flow chart diagram illustrating a system configured to perform a database update method of the present application in one embodiment;
FIG. 6 is a block diagram showing the structure of a database updating apparatus according to an embodiment;
FIG. 7 is a diagram of the internal structure of a computer device in one embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of and not restrictive on the broad application.
The database updating method provided by the embodiment of the application can be applied to the application environment shown in fig. 1. Wherein the terminal 102 communicates with the target server 104 and the storage device 106, respectively, via a network. In the application scenario of the present application, the terminal 102 obtains current version information and target version information of a database to be updated in the target server 104, obtains, from the preset storage device 106, installation information of a target update version package and a target update version package required by the database to be updated according to the current version information and the target version information, and pushes the installation information of the target update version package and the target update version package to the target server 106, so that the target server 106 performs version update of the database to be updated based on the target update version package and the installation information.
The terminal 102 may be, but not limited to, various personal computers, notebook computers, smart phones, tablet computers, internet of things devices and portable wearable devices, and the internet of things devices may be smart speakers, smart televisions, smart air conditioners, smart car-mounted devices, and the like. The portable wearable device can be a smart watch, a smart bracelet, a head-mounted device, and the like. The server 104 may be implemented as a stand-alone server or a server cluster comprised of multiple servers.
In one embodiment, as shown in fig. 2, a database updating method is provided, which is described by taking the method as an example applied to the terminal 102 in fig. 1, and includes the following steps:
step 201, acquiring current version information and target version information of a database to be updated in a target server; the target server is a server to be subjected to database version update.
The database to be updated represents the database to be subjected to content recovery.
The version level of the target version corresponding to the target version information is higher than the version level of the current version corresponding to the current version information, that is, the target version can be obtained after the current version is iteratively updated for a certain number of times.
The versions in the target version information and the current version information represent databases in different periods, and the contents stored in the databases in different periods are different.
The representation form of the target version information and the current version information may be version time, for example, the target version information is 202207 version, and the current version information is 202228 version.
It should be noted that, in the application scenario of the present application, the version of the database is updated after the database is shoveled, that is, after the version of the database is rolled back to the historical version (i.e., the current version), the rolled-back historical version is restored to the latest version (i.e., the target version), and therefore, the version level of the target version is higher than that of the current version.
In specific implementation, the terminal 102 may receive, through the terminal page, the server identifier of the target server input by the user, and determine, based on the server identifier, the current version information of the database to be updated in the target server, and meanwhile, the terminal 102 may also receive, through the terminal page, the target version information of the database to be updated input by the user, so as to obtain the current version information and the target version information of the database to be updated in the target server.
Step 202, acquiring a target update version package and 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 a version package required by updating the database to be updated from the current version to the target version; the storage device stores a plurality of update version packages used by a plurality of types of updated databases in the version updating process and installation information of each update version package.
And the current version represents the database version corresponding to the current version information.
And the target version represents a database version corresponding to the target version information.
The target update version package may include a plurality of update version packages, each update version package having corresponding installation information, and the installation information indicates information used in the process of installing the update version package to the server. The installation information may include an installation script updating the version package and an execution instruction of the installation script; each installation script is used for executing installation operation of the corresponding update version package; the target server 104 completes the execution of the corresponding installation script according to the execution instruction of each installation script.
In a specific implementation, a plurality of update version packages and installation information of each update version package used in the version updating process of the plurality of updated databases may be obtained in advance, and each update version package and installation information of each update version package of the plurality of updated databases may be stored in the storage device 106. After the terminal 102 obtains the current version information and the target version information of the database to be updated in the target server 104, update version package information required by updating the database to be updated from the current version to the target version may be determined according to the current version information and the target version information of the database to be updated, and further, according to the required update version package information, the target update version package required by the database to be updated and the installation information of the target update version package may be obtained from the storage device 106.
It should be noted that the update version packages of the updated database stored in the storage device 106 are all update version packages and installation information of all update version packages in the process that the updated database iterates from the initial version to the latest version, so that the version update packages and installation information of the database to be updated from the current version to any version can be acquired from the storage device 106, and the update of the database to be updated from the current version to any version is realized.
And step 203, pushing 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.
In specific implementation, the terminal 102 pushes the target update version package and the corresponding installation information to the target server 104, and after the target server 104 receives the target update version package and the corresponding installation information, the target update version package may be installed in the target server 104 through an installation script of the target update version package in the installation information and an execution instruction of the installation script, so as to implement version update of the database to be updated in the target server 104.
In the database updating method, the update version package and the corresponding installation information used in the process of updating the database are stored in the storage device in advance, so that the update version package and the installation information of the database can be directly extracted from the storage device and pushed to the target server when the target server needs to update the database of the same type subsequently, the target server is enabled to install the update version package based on the installation information, the installation information does not need to be rewritten, and the labor and time consumed by repeatedly writing the installation information in different servers can be reduced.
In one embodiment, before the step 202 acquires the installation information of the target update version package and the target update version package required by the database to be updated from the preset storage device according to the current version information and the target version information, the method specifically includes the following steps:
step 2021, determining, for each updated database, a server corresponding to the updated database as an updated server;
step 2022, obtaining each update version package and installation information of each update version package of the updated database in the version updating process from the updated server;
step 2023, storing each updated version package of each updated database and the installation information of each updated version package to a storage device, and establishing a mapping relationship between each updated database and the corresponding updated version package and installation information.
The updated database may include different types of databases or the same type of database but storing different stored data. Meanwhile, each database corresponds to only one server, and each server also corresponds to only one database.
It should be noted that different databases have different types or store different data, and therefore deployment contents and manners corresponding to the different databases are different, and therefore update version packages of the different databases are also different.
In specific implementation, for different updated databases in various updated servers, acquiring installation information of each updated version package and each updated version package used by each updated database in an updating process from an initial version to a latest version, establishing a mapping relation between each updated version package and the installation information and the corresponding different updated databases, and storing each updated version package, the corresponding installation information and the mapping relation of each acquired updated database by a storage device to obtain each updated version package and the corresponding installation information of each database which can be called at any time.
In the embodiment, each update version package and corresponding installation information of various updated databases are stored in advance, and a server needing to update the same type of database can call the corresponding update version package and the corresponding installation information at any time to update the version of the corresponding database, so that the time consumed by repeatedly writing the installation information during updating the same database is reduced.
In one embodiment, the step 2022 obtains, from the updated server, each update version package and installation information of each update version package in the version update process of the updated database, and may be specifically implemented by the following steps:
step 2022A, acquiring a complete version package of the updated server from the updated server; the complete version package comprises update version packages and installation information of all applications deployed in the update server;
step 2022B, extracting each updated version package and installation information of each updated version package in the version updating process of the updated database from the complete version package.
It should be noted that the database shoveling of the server refers to an operation of rolling back the historical version of the database, and therefore, only the update version packet of the database needs to be extracted, and the complete version packet or contents except the update version packet of the database in the complete version packet do not need to be extracted.
In specific implementation, a complete version package of the updated server is obtained, where the complete version package includes all update data of the updated server, including database update data, program update data, system update data, and the like. And extracting the data which needs to be updated in the previous updating process of the updated database, namely each updating version package and the corresponding installation information, from the complete version package, and storing each updating version package and the corresponding installation information in the storage device.
In the embodiment, the update version package and the corresponding installation information of the updated database in the complete version package of the updated server are extracted and stored separately, and when the target server needs to update the database, only the update version package and the corresponding installation information of the update database need to be called (the complete version package does not need to be called), so that the storage space needed to be used is reduced.
In one embodiment, before the step 202 acquires the installation information of the target update version package and the target update version package required by the database to be updated from the preset storage device according to the current version information and the target version information, the method specifically includes the following steps:
step 2024, acquiring a database identifier of the database to be updated;
acquiring a target update version package and installation information of the target update version package required by a database to be updated from a preset storage device according to the current version information and the target version information, wherein the installation information comprises the following steps:
step 2025, acquiring 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 according to the database identifier, the current version information and the target version information.
The database identification comprises a database type, stored data and an identification of a corresponding server.
In the specific implementation, a database identifier of the database to be updated, that is, the type and the stored data content of the database to be updated, is acquired, and according to the database identifier and the current version information and the target version information of the database to be updated, a target update version package and corresponding installation information of corresponding types and stored data are acquired from a preset storage device, so that the database to be updated performs database version updating based on the update version package and corresponding installation information conforming to the type and the stored data.
In this embodiment, databases of different types or the same type but storing different storage data are identified by the database identifier, and based on the database identifier of the database to be updated, the update version package and the corresponding installation information that are matched with each other are obtained, so that updating of database versions of different types or the same type but storing different storage data can be realized.
In one embodiment, the installation information includes version manifest information for the target update version package; before the step 203 of pushing the target update version package and the installation information of the target update version package to the target server, the method specifically includes the following steps:
step 2031, performing integrity check on the target update version package based on the version list information;
and step 2032, outputting prompt information under the condition that the checking result is incomplete.
The version list information records a specific content list corresponding to the updated version package.
In specific implementation, the terminal acquires version list information corresponding to each update version package in the storage device, and performs content integrity check on the update version package in the storage device according to a specific content list corresponding to the update version package recorded in the version list information to determine the integrity of the content in the update version package. And if the content of the update version package is incomplete, outputting prompt information to help a user to make a processing decision on the incomplete update version package.
In this embodiment, the installation information corresponding to the update version package acquired by the storage device includes version list information, and the version list information is used to verify the integrity of the update version package, ensure the correctness of updating the database version to be updated, and reduce the possibility of errors and the maintenance cost brought by the errors.
In one embodiment, before the step 203 pushes the target update version package and the installation information of the target update version package to the target server, the method specifically includes the following steps:
step 2033, acquiring a target server identifier of the target server, and replacing the server identifier in the target update version package with the target server identifier to obtain a replaced update version package;
pushing the target update version package and the installation information of the target update version package to a target server, so that the target server performs version update of the database to be updated based on the target update version package and the installation information, and the method comprises the following steps:
step 2034, pushing the replaced update version package and installation information to the target server, so that the target server updates the version of the database to be updated based on the replaced update version package and installation information.
Wherein the server identification of the target update version package is used for indicating the server to which the target update version package needs to be pushed. The server identification in the initial target update version package represents the updated server that obtained the target update version package.
Wherein, the server identification can be represented by the IP information of the server.
In a specific implementation, when the storage device acquires the update version package, the server identifier of the update version package is an acquisition source (i.e., the server identifier of the updated server), and when the target server needs the corresponding update version package, the server identifier of the target update version package in the storage device is replaced with the server identifier of the target server, so that the terminal can push the target update version package to the corresponding target server according to the server identifier, and the target server can update the database version based on the target update version package.
In the embodiment, the server identifier in the update version package is replaced, so that the server identifier can be pushed to different servers for version update, the reuse of the update version package is realized, and the time consumed for compiling installation information when each server updates the version is reduced.
In one embodiment, the installation information further includes an installation script of the target update version package and an execution instruction of the installation script.
Wherein the installation script is a database installation instruction for each of the target update version packages.
Wherein the execution instruction of the installation script is an operating system execution instruction for each installation script.
In specific implementation, the installation information corresponding to the target update version package acquired by the terminal comprises an installation script of the target update version package and an execution instruction of the installation script; and enabling the target server to enable the operating system to execute the installation script based on the execution instruction of the installation script, wherein the installation script executes the installation operation of the corresponding updated version package in the database.
In this embodiment, by acquiring the installation script corresponding to the target installation version package and the execution instruction of the installation script, time and labor required for rewriting the installation script and the execution instruction when updating the database can be reduced.
In another embodiment, as shown in fig. 3, a method for updating a database is provided, and in this embodiment, the method includes the following steps:
step 301, for each updated database, determining a server corresponding to the updated database as an updated server.
Step 302, acquiring a complete version package of the updated server from the updated server; the full version package includes update version packages and installation information for each application deployed in the update server.
Step 303, extracting each update version package and installation information of each update version package of the updated database in the version updating process from the complete version package.
And step 304, storing each updated version package of each updated database and the installation information of each updated version package to a storage device, and establishing a mapping relation between each updated database and the corresponding updated version package and installation information.
And 305, performing integrity check on the updated version package based on the version list information.
And step 306, outputting prompt information under the condition that the verification result is incomplete.
Step 307, acquiring a database identifier of a database to be updated in the target server, and acquiring current version information and target version information of the database to be updated; the target server is a server to be subjected to database version update.
And 308, acquiring a target update version package and installation information of the target update version package required by the database to be updated from a preset storage device according to the database identifier, the current version information and the target version information.
Step 309, acquiring the target server identifier of the target server, and replacing the server identifier in the target update version package by the target server identifier to obtain a replaced update version package.
And 310, pushing the replaced update version package and the installation information to the target server, so that the target server updates the version of the database to be updated based on the replaced update version package and the installation information.
In specific implementation, for a plurality of updated databases which are updated from an initial version to a latest version, an updated server corresponding to the updated database is determined, and a storage device acquires a complete version package used by the updated database in an updating process, wherein the complete version package comprises various update version packages and corresponding installation information of an application program in the updated server, an operating system of the updated server and the database corresponding to the updated server. And extracting each update version package (the update version package of each version can be identified by a version number) and installation information of each update version package in the version updating process of the updated database from the complete version package. The installation information includes version list information, version installation policy tables (specific update contents of update version packages corresponding to records of each version installation policy table), installation scripts of the update version packages, and execution instructions of the installation scripts. And establishing corresponding folders according to the sequence of the version numbers based on a preset directory structure and the extracted updated version package and corresponding installation information, putting the extracted updated version package and the corresponding installation information into the corresponding folders, and then storing the folders in a storage device. And records a mapping relationship between each different type or the same type of database but storing different stored data and the corresponding update version package and installation information. Meanwhile, integrity check is carried out on the updated version package according to version list information in the installation information, if the check result is incomplete, prompt information is output, and a user can obtain the incomplete updated version package again according to the prompt information.
When a database corresponding to a server needs to update a version, a terminal acquires a server identifier (which may be IP information of the server) of a target server of the database needing to be updated, which is input by a user; inquiring the database identification of the database to be updated and the current version information of the database to be updated in the target server according to the server identification; simultaneously acquiring target version information of a database version to be updated, which is input by a user and needs to be updated; and acquiring a target update version package and installation information of the target update version package required by the database to be updated from a preset storage device according to the database identifier, the current version information and the target version information, wherein the target update version package comprises at least one update version package which is an update version package required by the database to be updated from the current version to the target version. And replacing the server identifier in the target update version package by the target server identifier according to the target server identifier to obtain a replaced update version package. And pushing the replaced update version package and the installation information to the target server according to the server identifier in the replaced update version package, so that the target server runs the installation script of the update version package in the installation information and the execution instruction of the installation script to complete the version update of the database to be updated based on the replaced update version package.
In this embodiment, the database update version packages and the corresponding installation information in the complete version packages required by the multiple servers in the process of updating the initial version to the latest version are extracted in advance, the update version packages and the corresponding installation information required by the multiple databases corresponding to the multiple servers in the process of updating the initial version to the latest version are stored in the storage device, when the same database needs to be updated to one of the version nodes, the corresponding database update version packages and the corresponding installation information can be directly called, and the version update of the database is completed based on the required update version packages and the corresponding installation information. When a server needing to update the database calls the update version package, the space occupied by the update version package can be reduced; and in the process of updating the database, the time consumed by repeatedly writing the corresponding installation information can be reduced. Meanwhile, each server can update the corresponding server to the required version in a personalized mode.
To facilitate those skilled in the art to understand the embodiment of the present application, the following will take a system for providing a database updating method of the present application as an example, and the system is described with reference to specific examples of the accompanying drawings, as shown in fig. 4, the system in the embodiment includes an initial termination module 401, a version dotting module 402, a variable retrieval module 403, an installation module 404, a logging module 405, and a foreground display module 406, where,
the initial termination module 401 receives the "initialize" command and the "terminate" command from the user input in the foreground presentation module 406. If an "initialize" 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 foreground display module 406, and the default is IP + date name (assumed to be 12.34.56.78_20220220216), where IP is the IP of the updated server that is input by the user in the foreground display module 406 to obtain the update version package. If the command of "finalize" is received, the present application packages and archives the 12.34.56.78 _20220216folder for convenient subsequent calling (assuming that the packaged version package is called 12.34.56.78_20220216. Zip).
Version dotting module 402 may receive 406 user-entered "start" and "stop" commands from a foreground presentation module. If a "start" command is received, a folder named by default with the version number input from the user in the foreground display module 406 (we assume that the folder is named version202201a 01) is created under the 12.34.56.78_20216 folder, and the module goes to the 12.34.56.78 server to obtain the version package containing the database contents in a binary manner and stores the version package under the version202201a 01. Meanwhile, the module needs to acquire an installation policy table (an excel table with a suffix xls) and a version list table vsense of the version packet in the 12.34.56.78 server. And meanwhile, the system searches whether a database version packet acquired by the module is complete or not according to the vservion.txt, and if the database version packet is incomplete, a log is output to remind a user. If the database version content + start sh script + install policy table + version list table are all acquired into the storage device and the list is successfully verified, the successful information is returned to the foreground display module 406. If an "end" command is received, then version202201a01 will not be operated. Within the same cycle of initialization and termination, if an "end" command is received, and then a "start" command is received again, the creation of the version202201a02 folder continues at 12.34.56.78 \/20220216, and so on.
The variable retrieval module 403 can implement variable replacement of the content of the IP information related to the large time period version packet obtained in the initial termination module 401, and this module screens out the IP information based on the shell command and transmits the IP information to the foreground display module 406, and for each IP transmitted to the foreground display module 406, receives a command whether to replace the IP transmitted from the foreground. If yes, the IP information is replaced by the IP input by the user in the foreground display module 406; if no, the IP is not processed.
The installation module 404 may enable database update version installation on various servers for the 12.34.56.78 _20216. Zip package. The server IP in which this updated version is installed is input by the foreground presentation module 406. The version packet pushed to the server by the module is the version packet after the new IP is replaced. Meanwhile, for each of the plurality of minor version period versions 202201a01 contained in 12.34.56.78 \/20216. Zip, the foreground display module 406 may execute which minor version package installation and which minor version package is not installed corresponding to the selection of the user.
The log module 405 receives log information from the various modules during their operation.
The foreground display module 406 may correspond to the information input by the user, such as "initial", "start", "end", "search variable", "replace variable input", and "install server IP input". Where "initial" is the beginning of a large time period production of a version package. "terminate" is the termination of the production of a version package for a large period of time. The "initial IP" and the "root folder name" are entered before the initial start and passed to the initial termination module 401. Each large time period version packet before the initial start contains a plurality of small version period version packets. Each small version periodic version package is identified by a "start" and an "end". After the "search variable" is clicked, it is sent to the variable retrieval module 403 to determine whether the version packet with a large retrieval time period contains the target IP information, and the retrieval result of the variable retrieval module 403 is returned to the foreground display module 406, and if the version packet contains the IP information and the IP needs to be replaced by the variable, a "replace variable input" function needs to be used. "install server IP entry" refers to which IP is entered for which server the version packet needs to run on when multiple sets of environments exist.
The flow of steps of the database updating method of the present application executed by the present system is shown in fig. 5, which includes two parts, namely, update version package acquisition and database updating. Wherein, the first and the second end of the pipe are connected with each other,
the update version package acquisition includes the steps of:
step 501, initialize a large cycle.
Step 502, information such as the IP of the updated server, the version packet name, etc. is obtained.
Step 503, a small cycle is started.
Step 504, an update version package is obtained from the server corresponding to the IP of the updated server.
Step 505, generating script files, small version packages, and the like.
Step 506, end small cycle. If the termination command is received, step 507 is executed, and if not, step 503 is returned to continue the new small cycle.
Step 507, terminating the large period.
The database update comprises the following steps:
in step 508, the IP variables are retrieved and presented.
In step 509, a plurality of IP information to be installed and variable information such as a version to be installed are input.
At step 510, installation is performed.
In this embodiment, by storing the update version package and the corresponding installation information used in the process of completing update of the database in the storage device in advance, when the target server needs to update the database of the same type subsequently, the update version package and the installation information of the database can be directly extracted from the storage device and pushed to the target server, so that the target server performs installation of the update version package based on the installation information, and the installation information does not need to be rewritten, thereby reducing the labor and time consumed by repeatedly writing the installation information in different servers.
It should be understood that, although the steps in the flowcharts related to the embodiments described above are shown in sequence as indicated by the arrows, the steps are not necessarily performed in sequence as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a part of the steps in the flowcharts related to the embodiments described above may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, and the execution order of the steps or stages is not necessarily sequential, but may be rotated or alternated with other steps or at least a part of the steps or stages in other steps.
Based on the same inventive concept, the embodiment of the present application further provides a database updating apparatus for implementing the above related database updating method. The implementation scheme for solving the problem provided by the apparatus is similar to the implementation scheme described in the method, so the specific limitations in one or more embodiments of the database updating apparatus provided below may refer to the limitations on the database updating method provided above, and are not described herein again.
In one embodiment, as shown in fig. 6, there is provided a database updating apparatus including: the device comprises an information acquisition module, an installation content acquisition module and an installation data push module, wherein:
an information obtaining module 601, configured to obtain current version information and target version information of a database to be updated in a target server; the target server is a server to be subjected to database version updating;
an installation content obtaining module 602, configured to obtain, from a preset storage device, a target update version package and installation information of the target update version package that are required by a database to be updated according to the current version information and the target version information; the target update version package is a version package required by updating the database to be updated from the current version to the target version; the storage device stores a plurality of update version packages used by a plurality of updated databases in the version updating process and installation information of each update version package;
the installation content pushing module 603 is configured 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 performs version update on the database to be updated based on the target update version package and the installation information.
In an embodiment, the installation content obtaining module 602 is further configured to, for each updated database, determine a server corresponding to the updated database as an updated server; acquiring each update version package and installation information of each update version package of an updated database in the version updating process from an updated server; and storing the update version packages of each updated database and the installation information of the update version packages to a storage device, and establishing a mapping relation between each updated database and the corresponding update version packages and installation information.
In an embodiment, the installation content obtaining module 602 is further configured to obtain, from the updated server, a complete version package of the updated server; the complete version package comprises update version packages and installation information of all applications deployed in the update server; and extracting each update version package and the installation information of each update version package of the updated database in the version updating process from the complete version package.
In an embodiment, the installation content pushing module 603 is further configured to obtain a 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 a replaced update version package; and pushing the replaced update version package and the installation information to the target server, so that the target server updates the version of the database to be updated based on the replaced update version package and the installation information.
In an embodiment, the installation content obtaining module 602 is further configured to obtain a database identifier of a database to be updated; and acquiring a target update version package and installation information of the target update version package required by the database to be updated from a preset storage device according to the database identification, the current version information and the target version information.
In an embodiment, the installation information includes version list information of the target update version package, and the installation content pushing module 603 is further configured to perform integrity check on the target update version package based on the version list information; and outputting prompt information under the condition that the verification result is incomplete.
In one embodiment, the installation information further includes an installation script of the target update version package and an execution instruction of the installation script.
The modules in the database updating apparatus can be implemented in whole or in part by software, hardware, and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as shown in fig. 7. The computer device includes a processor, a memory, a communication interface, a display screen, and an input device connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operating system and the computer program to run on the non-volatile storage medium. The communication interface of the computer device is used for carrying out wired or wireless communication with an external terminal, and the wireless communication can be realized through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. The computer program is executed by a processor to implement a database update method. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on a shell of the computer equipment, an external keyboard, a touch pad or a mouse and the like.
It will be appreciated by those skilled in the art that the configuration shown in fig. 7 is a block diagram of only a portion of the configuration associated with the present application, and is not intended to limit the computing device to which the present application may be applied, and that a particular computing device may include more or fewer components than shown, or may combine certain components, or have a different arrangement of components.
In an embodiment, a computer device is further provided, which includes a memory and a processor, the memory stores a computer program, and the processor implements the steps of the above method embodiments when executing the computer program.
In an embodiment, a computer-readable storage medium is provided, on which a computer program is stored which, when being executed by a processor, carries out the steps of the above-mentioned method embodiments.
In an embodiment, a computer program product is provided, comprising a computer program which, when being executed by a processor, carries out the steps of the above-mentioned method embodiments.
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 for analysis, stored data, displayed data, etc.) referred to in the present application are information and data authorized by the user or sufficiently authorized by each party.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above may be implemented by hardware instructions of a computer program, which may be stored in a non-volatile computer-readable storage medium, and when executed, may include the processes of the embodiments of the methods described above. Any reference to memory, database, or other medium used in the embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, high-density embedded nonvolatile Memory, resistive Random Access Memory (ReRAM), magnetic Random Access Memory (MRAM), ferroelectric Random Access Memory (FRAM), phase Change Memory (PCM), graphene Memory, and the like. Volatile Memory can include Random Access Memory (RAM), external cache Memory, and the like. 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), among others. The databases referred to in various embodiments provided herein may include at least one of relational and non-relational databases. The non-relational database may include, but is not limited to, a block chain based distributed database, and the like. The processors referred to in the embodiments provided herein may be general purpose processors, central processing units, graphics processors, digital signal processors, programmable logic devices, quantum computing based data processing logic devices, etc., without limitation.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the present application. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.

Claims (11)

1. A database update method, the method comprising:
acquiring current version information and target version information of a database to be updated in a target server; the target server is a server to be subjected to database version updating;
acquiring a target update version package and 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 a version package required by updating the database to be updated from the current version to the target version; the storage device stores a plurality of update version packages used by a plurality of updated databases in the version updating process and installation information of each update version package;
and pushing 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.
2. The method according to claim 1, before the obtaining, from a preset storage device, the installation information of the target update version package and the target update version package required by the database to be updated according to the current version information and the target version information, further comprising:
for each updated database, determining a server corresponding to the updated database as an updated server;
acquiring each update version package and installation information of each update version package of the updated database in the version updating process from the updated server;
and storing each updated version package of each updated database and the installation information of each updated version package to the storage device, and establishing a mapping relation between each updated database and the corresponding updated version package and installation information.
3. The method according to claim 2, wherein the obtaining, from the updated server, each update version package and installation information of each update version package of the updated database in the version update process comprises:
acquiring a complete version package of the updated server from the updated server; the complete version package comprises update version packages and installation information of all applications deployed in the update server;
and extracting each update version package and the installation information of each update version package of the updated database in the version updating process from the complete version package.
4. The method according to claim 1, further comprising, before the pushing the target update version package and the installation information of the target update version package to the target server:
acquiring a target server identifier of the target server, and replacing the server identifier in the target update version package by the target server identifier to obtain a replaced update version package;
the pushing the target update version package and the installation information of the target update version package to the target server to enable the target server to update the version of the database to be updated based on the target update version package and the installation information includes:
and pushing the replaced updated version package and the installation information to the target server, so that the target server updates the version of the database to be updated based on the replaced updated version package and the installation information.
5. The method according to claim 1, before the obtaining, from a preset storage device, the installation information of the target update version package and the target update version package required by the database to be updated according to the current version information and the target version information, further comprising:
acquiring a database identifier of the database to be updated;
the acquiring, from a preset storage device, a target update version package and installation information of the target update version package required by the database to be updated according to the current version information and the target version information includes:
and acquiring a target update version package and installation information of the target update version package required by the database to be updated from a preset storage device according to the database identifier, the current version information and the target version information.
6. The method of claim 1, wherein the installation information comprises version manifest information for the target update version package;
before the pushing the target update version package and the installation information of the target update version package to the target server, the method further includes:
performing integrity check on the target update version package based on the version list information;
and outputting prompt information under the condition that the verification result is incomplete.
7. The method according to claim 1, wherein the installation information further includes an installation script of the target update version package and an execution instruction of the installation script.
8. A database update apparatus, the apparatus comprising:
the information acquisition module is used for acquiring current version information and target version information of a database to be updated in the target server; the target server is a server to be subjected to database version updating;
the installation content acquisition module is used for acquiring a target update version package and 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 a version package required by updating the database to be updated from the current version to the target version; the storage device stores a plurality of update version packages used by a plurality of updated databases in the version updating process and installation information of each update version package;
and the installation content pushing module is used for pushing 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.
9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor, when executing the computer program, implements the steps of the method of any of claims 1 to 7.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 7.
11. A computer program product comprising a computer program, characterized in that the computer program, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 7.
CN202211032433.6A 2022-08-26 2022-08-26 Database updating method and device, computer equipment and storage medium Pending CN115687375A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211032433.6A CN115687375A (en) 2022-08-26 2022-08-26 Database updating method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211032433.6A CN115687375A (en) 2022-08-26 2022-08-26 Database updating method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115687375A true CN115687375A (en) 2023-02-03

Family

ID=85061259

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211032433.6A Pending CN115687375A (en) 2022-08-26 2022-08-26 Database updating method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115687375A (en)

Similar Documents

Publication Publication Date Title
CN110069264A (en) Construct method, apparatus, computer equipment and the storage medium of resource packet
CN109240727A (en) Application program update method, apparatus, computer equipment and storage medium
CN112882729A (en) Application image upgrading method and device, computer equipment and storage medium
CN102612023A (en) Mobile terminal and application updating method and server thereof
CN111897846A (en) Cache data verification method, device, equipment and storage medium
US20150242282A1 (en) Mechanism to update software packages
CN110989986B (en) Software template-based software generation method and device and computer equipment
CN110597552B (en) Configuration method, device, equipment and storage medium of project continuous integrated pipeline
CN113918437A (en) User behavior data analysis method and device, computer equipment and storage medium
US20230351050A1 (en) Method and apparatus for custom development of payment application, computer device, and storage medium
CN116048609A (en) Configuration file updating method, device, computer equipment and storage medium
CN115687375A (en) Database updating method and device, computer equipment and storage medium
CN114816470A (en) Metadata database management method and device, electronic equipment and medium
CN114185566A (en) Containerized deployment method, apparatus, computer device and storage medium
CN111400243B (en) Development management system based on pipeline service and file storage method and device
CN108008984A (en) A kind of resource file downloading updating method and device
CN114237871A (en) Arranging method and device of cloud resources, computer equipment and storage medium
US20170168793A1 (en) Split installation of a software product
CN108614838B (en) User group index processing method, device and system
CN110647331A (en) Development tool acquisition method and device, storage medium and electronic equipment
CN111079199B (en) Enterprise credit data screenshot tamper-proofing method based on block chain technology
CN115617580B (en) Incremental backup and recovery method and system based on Shared SST (SST) file
CN113641449B (en) Mirror image downloading control method and device, equipment and storage medium
CN114328405A (en) File processing method, file processing device, computer equipment, storage medium and program product
CN118276902A (en) Automatic updating method and device of application program and computer equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination