CN113420010B - Database management method, device, electronic equipment and storage medium - Google Patents

Database management method, device, electronic equipment and storage medium Download PDF

Info

Publication number
CN113420010B
CN113420010B CN202110697819.8A CN202110697819A CN113420010B CN 113420010 B CN113420010 B CN 113420010B CN 202110697819 A CN202110697819 A CN 202110697819A CN 113420010 B CN113420010 B CN 113420010B
Authority
CN
China
Prior art keywords
database
upgrading
test
file
version
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.)
Active
Application number
CN202110697819.8A
Other languages
Chinese (zh)
Other versions
CN113420010A (en
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.)
China Construction Bank Corp
Original Assignee
China Construction Bank Corp
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 China Construction Bank Corp filed Critical China Construction Bank Corp
Priority to CN202110697819.8A priority Critical patent/CN113420010B/en
Publication of CN113420010A publication Critical patent/CN113420010A/en
Application granted granted Critical
Publication of CN113420010B publication Critical patent/CN113420010B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases
    • G06F16/219Managing data history or versioning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3664Environments for testing or debugging software
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention discloses a database management method, a database management device, electronic equipment and a storage medium, and relates to the technical field of computers. One embodiment of the method comprises the following steps: acquiring a test environment and a test assembly to inquire a target version identifier of a corresponding database of the test assembly under the test environment; acquiring a current version identifier of a database corresponding to the test component to judge whether the current version identifier is a target version identifier; if yes, not executing operation on the database corresponding to the test component; if not, calling a nano-tube platform interface, and sending a target version identifier to the nano-tube platform so that the nano-tube platform can acquire a database file corresponding to the target version identifier, further checking the database file, and updating a database corresponding to the test component based on the database file after the checking is passed. The embodiment can solve the problems that in the prior art, version updating of the database can be performed only by personnel with a certain database foundation, so that the operating time of the personnel is spent, and the operating cost is increased.

Description

Database management method, device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and apparatus for managing a database, an electronic device, and a storage medium.
Background
The current data processing framework comprises components with functions, each component corresponds to a respective database, and different components have different requirements on the versions of the databases in different application environments, so that when each component is tested, the versions of the corresponding databases are required to be matched with the testing environments, and then the components can be accurately tested. In the prior art, when testing a component, the required useful information needs to be found out from the version and patch information of the database, and the required useful information is logged into a corresponding database server to update the version of the database so as to be matched with the tested component. However, the types and versions of the databases corresponding to the components are not uniform, and the versions and patch information of the databases corresponding to the components are very complex, so that a person with a certain database foundation is required to perform the version updating operation of the databases, the operation time of the staff is spent, and the operation cost is increased.
Disclosure of Invention
In view of the above, embodiments of the present invention provide a method, an apparatus, an electronic device, and a storage medium for managing a database, which can solve the problem in the prior art that version update of a database needs to be performed by a person with a certain database base, so that the operation time of the person is spent, and the operation cost is increased.
To achieve the above object, according to an aspect of an embodiment of the present invention, there is provided a method for managing a database.
The method for managing the database comprises the following steps: acquiring a test environment and a test assembly to inquire a target version identifier of a corresponding database of the test assembly under the test environment; acquiring a current version identifier of a database corresponding to the test component to judge whether the current version identifier is the target version identifier; if yes, not executing operation on the database corresponding to the test component; and if not, calling a nano-tube platform interface, and sending the target version identification to a nano-tube platform so that the nano-tube platform obtains a database file corresponding to the target version identification, further checking the database file, and upgrading a database corresponding to the test assembly based on the database file after the checking is passed, so as to execute the test on the test assembly under the test environment based on the upgraded database.
In one embodiment, before performing the verification on the database file, the method further comprises:
and inquiring address information of a server where the database corresponding to the test component is located, sending the database file to the database server based on the address information so that the database server can execute verification on the database file, and upgrading the database corresponding to the test component based on the database file.
In yet another embodiment, the upgrading the database corresponding to the test component based on the database file includes:
inquiring the version identifier of the database corresponding to the test component in the database server to judge whether the version identifier is the current version identifier;
if yes, upgrading the database corresponding to the test component based on the database file; if not, returning a prompt message comprising the version identification, and upgrading the database corresponding to the test component based on the database file.
In yet another embodiment, after the invoking the nanotube platform interface, the invoking further comprises:
receiving a prompt message of the version identifier, and acquiring the version identifier in the prompt message so as to inquire whether a database upgrading record corresponding to the version identifier is stored in the database upgrading record;
If yes, ignoring the prompt message; if not, generating and storing the upgrade record corresponding to the version identification.
In yet another embodiment, after the invoking the nanotube platform interface, the invoking further comprises:
receiving a database upgrading result sent by the database server to generate a corresponding database upgrading record;
and displaying the database upgrading record.
In yet another embodiment, sending the database file to a database server based on the address information includes:
and inquiring a routing table corresponding to the address information to acquire an address of a transfer gateway corresponding to the address information, and further sending the address information and the database file to the transfer gateway based on the address of the transfer gateway so that the transfer gateway sends the database file based on the address information.
In yet another embodiment, performing a check on the database file includes:
acquiring a database file identifier from the database file to generate a corresponding first check value, and inquiring the database identifier of the database to generate a corresponding second check value by combining the target version identifier;
judging whether the first check value is consistent with the second check value;
If yes, determining that the database file is successfully checked; if not, determining that the database file verification fails.
In yet another embodiment, the acquiring test environment and test component includes:
receiving an upgrade request input by a user, wherein the upgrade request comprises the test environment and the test component;
sending approval prompt information corresponding to the upgrading request to prompt approval of the upgrading request;
and receiving a corresponding approval result of the upgrading request, and acquiring the test environment and the test assembly in the upgrading request after the approval result is confirmed to be approved.
To achieve the above object, according to another aspect of the embodiments of the present invention, there is provided a database management apparatus.
The management device of the database of the embodiment of the invention comprises: the acquisition unit is used for acquiring a test environment and a test assembly to inquire a target version identifier of a corresponding database of the test assembly under the test environment; the upgrading unit is used for acquiring the current version identifier of the database corresponding to the test component so as to judge whether the current version identifier is the target version identifier; if yes, not executing operation on the database corresponding to the test component; and if not, calling a nano-tube platform interface, and sending the target version identification to a nano-tube platform so that the nano-tube platform obtains a corresponding database file based on the target version identification, further checking the database file, and upgrading a database corresponding to the test component based on the database file after the checking is passed, so as to execute the test on the test component under the test environment based on the upgraded database.
In one embodiment, the upgrade unit is specifically configured to:
and inquiring address information of a server where the database corresponding to the test component is located, sending the database file to the database server based on the address information so that the database server can execute verification on the database file, and upgrading the database corresponding to the test component based on the database file.
In yet another embodiment, the upgrade unit is specifically configured to:
inquiring the version identifier of the database corresponding to the test component in the database server to judge whether the version identifier is the current version identifier;
if yes, upgrading the database corresponding to the test component based on the database file; if not, returning a prompt message comprising the version identification, and upgrading the database corresponding to the test component based on the database file.
In yet another embodiment, the apparatus further comprises:
the receiving unit is used for receiving the prompt message of the version identifier, acquiring the version identifier in the prompt message, and inquiring whether the database upgrading record corresponding to the version identifier is stored in the database upgrading record;
The generating unit is used for ignoring the prompt message if yes; if not, generating and storing the upgrade record corresponding to the version identification.
In a further embodiment, the upgrade unit is further configured to:
receiving a database upgrading result sent by the database server to generate a corresponding database upgrading record;
and displaying the database upgrading record.
In yet another embodiment, the upgrade unit is specifically configured to:
and inquiring a routing table corresponding to the address information to acquire an address of a transfer gateway corresponding to the address information, and further sending the address information and the database file to the transfer gateway based on the address of the transfer gateway so that the transfer gateway sends the database file based on the address information.
In yet another embodiment, the upgrade unit is specifically configured to:
acquiring a database file identifier from the database file to generate a corresponding first check value, and inquiring the database identifier of the database to generate a corresponding second check value by combining the target version identifier;
judging whether the first check value is consistent with the second check value;
If yes, determining that the database file is successfully checked; if not, determining that the database file verification fails
In a further embodiment, the acquiring unit is specifically configured to:
receiving an upgrade request input by a user, wherein the upgrade request comprises the test environment and the test component;
sending approval prompt information corresponding to the upgrading request to prompt approval of the upgrading request;
and receiving a corresponding approval result of the upgrading request, and acquiring the test environment and the test assembly in the upgrading request after the approval result is confirmed to be approved.
To achieve the above object, according to still another aspect of an embodiment of the present invention, there is provided an electronic apparatus.
An electronic device according to an embodiment of the present invention includes: one or more processors; and the storage device is used for storing one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors are enabled to realize the database management method provided by the embodiment of the invention.
To achieve the above object, according to still another aspect of an embodiment of the present invention, a computer-readable medium is provided.
A computer readable medium of an embodiment of the present invention stores a computer program thereon, which when executed by a processor implements a method for managing a database provided by the embodiment of the present invention.
One embodiment of the above invention has the following advantages or benefits: in the embodiment of the invention, the version control platform of the database can acquire the test assembly and the test environment to inquire out the version required by the database of the test assembly under the test environment, namely the target version identifier; then, the current version identification of the database corresponding to the test component can be inquired out, so that whether the version of the database is the version required by the test component in the test environment is determined by judging whether the current version identification is the target version identification; if so, the database may not be processed; if the database version is not updated, the interface of the nano-tube platform is called, and the target version identification is sent to the nano-tube platform, so that the nano-tube platform can acquire the corresponding database file based on the target version identification, further the verification is carried out on the database file, and after the verification is passed, the database corresponding to the test component is updated based on the database file, and the database is updated to the version corresponding to the target version identification. In the embodiment of the invention, the version control platform can realize the upgrade management of the database by calling the nano-tube platform without the operation of staff, so that the version update of the database can be executed without the need of staff with a certain database foundation, thereby reducing the management and operation cost of the database and saving the operation time of the staff.
Further effects of the above-described non-conventional alternatives are described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
FIG. 1 is a schematic diagram of one main flow of a database management method according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of yet another main flow of a database management method according to an embodiment of the present invention;
fig. 3 is a schematic diagram of main units of a management apparatus of a database according to an embodiment of the present invention;
FIG. 4 is a diagram of an exemplary system architecture in which embodiments of the present invention may be applied;
FIG. 5 is a schematic diagram of a computer system suitable for use in implementing embodiments of the present invention.
Detailed Description
Exemplary embodiments of the present invention will now be described with reference to the accompanying drawings, in which various details of the embodiments of the present invention are included to facilitate understanding, and are to be considered merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
It is noted that embodiments of the invention and features of the embodiments may be combined with each other without conflict.
The embodiment of the invention provides a database management system which can be used for managing the database corresponding to each component in a data processing frame, and particularly can be used for upgrading and managing the version of the database.
In the embodiment of the invention, a version control platform and a nano-tube platform of the database can be arranged. The version control platform can store upgrade and version information of each database, such as current version identification of the database, upgrade records of the database, and the like. The user can inquire the version information and the upgrade information of each database through logging in the version control platform, and then can input a database upgrade instruction or an operation instruction for the version information and the upgrade information of the database to the version control platform, and the like. The nano-tube platform can store scripts of different versions corresponding to the databases, so that files required for upgrading the databases can be provided. The nano-tube platform can also execute the upgrade of the database, and specifically, the database server side is a server where the database is located, on one hand, the nano-tube platform can be arranged together with the database server side, so that the nano-tube platform can directly execute the upgrade operation on the database after determining the files required by the database, on the other hand, the nano-tube platform can be independently arranged with the database server side, so that after determining the files upgraded by the database, the nano-tube platform can send the files to the database server side, and further, the database server side can execute the upgrade operation on the database. In the embodiment of the invention, the version control platform and the nano-tube platform can communicate with each other, so that the version control platform can call the nano-tube platform to determine files required by database upgrading, and further the database upgrading is executed. In addition, when the nano-management platform and the database server are independently arranged, the database server can communicate with the version management and control platform so as to return an upgrading result to the version management and control platform, so that the version management and control platform can store upgrading information of the database.
The embodiment of the invention provides a method for managing a database, which can be executed by a version control platform, as shown in fig. 1, and comprises the following steps:
s101: and acquiring the test environment and the test assembly to inquire the target version identification of the corresponding database of the test assembly under the test environment.
In the embodiment of the invention, the database is upgraded to meet the test requirement of the corresponding component, so that the test environment and the test component can be acquired first to inquire the target version identification of the corresponding database of the test component under the test environment.
The test component represents the component that needs to be tested. The test environment represents the running environment of the component, for example, pipeline environment, version check environment, development environment, etc., and it is further possible that the versions of the database required by the same test environment at different times are also different, so that the test environment may also represent the running environment of the component at a certain time. The target version identifier is a database version identifier required by the test component in the test environment.
Because the versions of the databases required by the test components in different test environments are different, the version identifiers of the databases corresponding to the test environments of the components can be stored in advance in the step, and thus, the target version identifiers of the databases corresponding to the test components in the test environments can be directly inquired after the test environments and the test components are obtained in the step.
In the embodiment of the invention, the version control platform can receive the instruction input by the user, so that the test component and the test environment acquired in the step can be acquired from the upgrade request input by the user. Specifically, the acquiring the test environment and the test component in this step may be performed as follows: receiving an upgrade request input by a user, wherein the upgrade request comprises a test environment and a test component; transmitting approval prompt information corresponding to the upgrade request to prompt approval of the upgrade request; and receiving an approval result corresponding to the upgrading request, and acquiring a testing environment and a testing component in the upgrading request after the approval result is confirmed to be approval passing.
In the embodiment of the invention, in order to improve the accuracy of the database upgrade, each operation process of the database upgrade can be firstly applied for approval, namely, approval prompt information corresponding to the upgrade request can be sent after the upgrade request is received so as to prompt a database manager (DBA) to approve the upgrade request, and after the approval is passed, the step is executed, namely, the test environment and the test component in the upgrade request are obtained after the approval result is confirmed to be the approval is passed.
It should be noted that, in the embodiment of the present invention, a database administrator may log in a version control platform to examine and approve an upgrade application, and after receiving an upgrade request, the version control platform may send examination and approval prompt information corresponding to the upgrade request to the database administrator.
S102: and acquiring the current version identifier of the database corresponding to the test component to judge whether the current version identifier is the target version identifier.
The version control platform can store information of each database, such as a current version identifier of the database, and in this step, the current version identifier of the database corresponding to the test component can be obtained, so as to determine whether the current version of the database is a target version identifier, that is, whether the current version of the database is a target version required by the test component in the test environment.
S103: if yes, not executing operation on the database corresponding to the test component; if not, calling a nano-tube platform interface, sending a target version identifier to the nano-tube platform, so that the nano-tube platform obtains a database file corresponding to the target version identifier, further executing verification on the database file, updating a database corresponding to the test component based on the database file after the verification is passed, and executing test on the test component under a test environment based on the updated database.
If yes, the current version identification of the database is the target version identification, namely the current version of the database corresponding to the test component is the version of the database required by the test component in the test environment, and no operation is required to be executed on the database corresponding to the test component at the moment. If not, the current version identification of the database is not the target version identification, and the database needs to be updated, a nano-tube platform interface can be called to update the database corresponding to the test component through the nano-tube platform.
Specifically, the version management and control platform can send the target version identifier, the current version identifier and the database identifier to the nano-tube platform by calling the nano-tube platform. The version control platform can query out the corresponding database identification based on the test component. After the nano-tube platform is called, a database file corresponding to the target version identification can be obtained, the database file is checked, and then the database corresponding to the test assembly is updated based on the database file after the checking is passed, so that the test assembly can be tested in a test environment based on the updated database.
In the embodiment of the invention, the nano-tube platform can be independently arranged with the database server, and before checking the database file, the nano-tube platform can also execute: and inquiring address information of a server where the test component corresponds to the database, transmitting the database file to the database server based on the address information so that the database server can execute verification on the database file, and upgrading the database corresponding to the test component based on the database file.
After the database file is obtained by the nano-tube platform, the database file can be sent to the database server, so that the address information of the server where the test component corresponds to the database can be queried first, then the database file is sent to the database server based on the address information, and the database server can conveniently execute the process of checking the database file and upgrading the database corresponding to the test component based on the database file.
It should be noted that, in the embodiment of the present invention, the nanotube platform may communicate with the database server through the transit gateway, and the nanotube platform may pre-store the routing table, where the address information of the transit gateway required for communication with the database server is recorded, so the nanotube platform may query the routing table corresponding to the query address information of the database server to obtain the address of the corresponding transit gateway, and further send the address information of the database server and the database file to the transit gateway based on the address of the transit gateway, so that the transit gateway sends the database file based on the address information of the database server.
In the embodiment of the invention, after the database server side performs the update of the database, the database server side can send the database update result to the version control platform, wherein the database update result can comprise a database identifier, a version identifier after the database update, success or failure of the database update, and the like. The version control platform receives a database upgrading result sent by the database server side, and further can generate a database upgrading record based on a preset format, and store and display the database upgrading record so as to be convenient for a user to check. At this time, if the database upgrading result includes that the database is successfully upgraded, the version control platform can update the current version identifier of the database into the version identifier of the database after being upgraded in the database upgrading result.
After the version control platform generates the database upgrading record, the version control platform can also firstly inquire whether the database upgrading record which is the same as the record is stored or not, if so, the database upgrading record is not stored and displayed; if not, the database upgrading records are stored and displayed so as to avoid repeated storage of the database upgrading records. The version control platform can also limit the storage and display quantity of the corresponding database upgrade records of each database, for example, the latest 50 database upgrade records can be set and stored, and the latest 10 database upgrade records can be displayed.
It should be noted that, since the database server may upgrade the database by itself, the database upgrade result is not sent to the version control platform at this time, that is, the current version identifier and the database upgrade record of the database in the version control platform are not necessarily accurate, so the database server may also determine the current version of the database in advance when upgrading the database, and may specifically be executed as follows: inquiring the version identification of the database corresponding to the test component in the database server to judge whether the version identification is the current version identification; if yes, upgrading a database corresponding to the test component based on the database file; if not, returning a prompt message comprising the version identification, and upgrading a database corresponding to the test component based on the database file. The version identifier of the database corresponding to the test component in the database server is the current version identifier, which indicates that the database corresponding to the test component can be upgraded based on the database file if the database is not upgraded by itself in the database server; the version identification of the database corresponding to the test component in the database server is not the current version identification, and the database server is automatically updated, so that a prompt message comprising the version identification needs to be returned to the version control platform, the database corresponding to the test component is updated based on the database file, and the version control platform can generate a corresponding data update record and store and display after receiving the prompt message comprising the version identification returned by the database server, so that the version of the database is updated to the version identification in the prompt message, and the accuracy of the version information and the database update information is ensured.
In the embodiment of the invention, in order to ensure the accurate determination of the database upgrade file, the database file can be checked before the database upgrade, and the specific mode can be as follows: acquiring a database file identifier from a database file to generate a corresponding first check value, and querying the database identifier of the database to generate a corresponding second check value by combining the target version identifier; judging whether the first check value is consistent with the second check value; if yes, determining that the database file is successfully checked; if not, determining that the verification of the database file fails.
The data file identifiers of the database are usually generated by combining the database identifier and the version identifier according to a preset rule, for example, the database identifier and the version identifier are spliced. Therefore, in the step, the database file identifier can be acquired to generate a corresponding first check value, and after the database identifier and the target version identifier are combined according to a preset rule, a corresponding second check value is generated. Thus, if the database file is error-free, the first check value is the same as the second check value; if the database file is wrong, the first check value and the second check value are not the same. Therefore, if the first check value is consistent with the second check value, the successful check of the database file can be determined, and the database upgrading can be further executed; if the first check value is inconsistent with the second check value, determining that the database file fails to check, and then, re-indicating the nano-tube platform to acquire the database file.
In the embodiment of the invention, the version control platform can realize the upgrade management of the database by calling the nano-tube platform without the operation of staff, so that the version update of the database can be executed without the need of staff with a certain database foundation, thereby reducing the management and operation cost of the database and saving the operation time of the staff.
It should be noted that, in the embodiment of the present invention, the version control platform may also manage and control the rights of the user and the database administrator, for example, configure the user and can only perform information viewing and operation on databases corresponding to a certain or some components, and the database administrator may perform information viewing and operation on all databases. And when the user operates the information of a certain database for the first time, the connection string corresponding to the database can be input first, the version control platform can inquire whether the information of the database is stored or not based on the connection string, if so, the subsequent operation of the user is allowed, and if not, the information of the database is required to be acquired first and then the operation of the user is allowed. Specifically, the user can query, modify, add/delete, upgrade, etc. the information of the database through the version control platform, and each time the user flourishing operation can be executed after the DBA audit.
When the database server side executes the database upgrade, the upgrade progress can be sent to the version control platform in real time, and the version control platform can display the database upgrade progress in a task flow mode so as to be convenient for a user to check.
In the following, referring to the embodiment shown in fig. 1, in the embodiment of the present invention, a method for upgrading a database is specifically described by taking independent setting of a nanotube platform and a database server, as shown in fig. 2, where the method includes:
s201: and the version control platform receives an upgrading request input by a user, and acquires the test environment and the test assembly so as to inquire the target version identification of the corresponding database of the test assembly under the test environment.
S202: and the version control platform acquires the current version identifier of the database corresponding to the test component, calls a nano-tube platform interface after determining the current version identifier as the target version identifier, and sends the target version identifier to the nano-tube platform.
In the embodiment of the present invention, the current version identifier is taken as the target version identifier as an example.
S203: the nano-tube platform acquires a database file corresponding to the target version identifier, inquires address information of a server side where the database corresponding to the test component is located, and sends the database file to the database server side based on the address information.
The database file may specifically be a database script.
S204: and the database server side performs verification on the database file, upgrades the database corresponding to the test component based on the database file after the verification is passed, and sends a database upgrading result to the version control platform.
The database server side can also pre-check the database when upgrading the database, such as whether the database is opened or not, and can execute the upgrading operation after being approved by the DBA.
S205: receiving a database upgrading result sent by a database server to generate a corresponding database upgrading record, and storing and displaying the corresponding database upgrading record.
In the embodiment of the invention, the testing requirements of all components in the data processing frame are met, and various database version management can be supported, for example, a oracle, mysql, goldenDB, oceanBase database and various databases possibly added later can be included; and through interaction with the nano-tube platform, the processing flow of the related database can be called in a script mode, and the user operation can be reduced as much as possible.
In order to solve the problems in the prior art, an embodiment of the present invention provides a database management apparatus 300, as shown in fig. 3, the apparatus 300 includes:
The acquiring unit 301 is configured to acquire a test environment and a test component, so as to query a target version identifier of a database corresponding to the test component in the test environment;
the upgrading unit 302 is configured to obtain a current version identifier of the database corresponding to the test component, so as to determine whether the current version identifier is the target version identifier; if yes, not executing operation on the database corresponding to the test component; and if not, calling a nano-tube platform interface, and sending the target version identification to a nano-tube platform so that the nano-tube platform obtains a corresponding database file based on the target version identification, further checking the database file, and upgrading a database corresponding to the test component based on the database file after the checking is passed, so as to execute the test on the test component under the test environment based on the upgraded database.
It should be understood that the manner of implementing the embodiment of the present invention is the same as that of implementing the embodiment shown in fig. 1, and will not be described herein.
In one implementation manner of the embodiment of the present invention, the upgrade unit 302 is specifically configured to:
and inquiring address information of a server where the database corresponding to the test component is located, sending the database file to the database server based on the address information so that the database server can execute verification on the database file, and upgrading the database corresponding to the test component based on the database file.
In yet another implementation manner of the embodiment of the present invention, the upgrade unit 302 is specifically configured to:
inquiring the version identifier of the database corresponding to the test component in the database server to judge whether the version identifier is the current version identifier;
if yes, upgrading the database corresponding to the test component based on the database file; if not, returning a prompt message comprising the version identification, and upgrading the database corresponding to the test component based on the database file.
In yet another implementation manner of the embodiment of the present invention, the apparatus 300 further includes:
the receiving unit is used for receiving the prompt message of the version identifier, acquiring the version identifier in the prompt message, and inquiring whether the database upgrading record corresponding to the version identifier is stored in the database upgrading record;
the generating unit is used for ignoring the prompt message if yes; if not, generating and storing the upgrade record corresponding to the version identification.
In another implementation manner of the embodiment of the present invention, the upgrade unit 302 is further configured to:
receiving a database upgrading result sent by the database server to generate a corresponding database upgrading record;
And displaying the database upgrading record.
In yet another implementation manner of the embodiment of the present invention, the upgrade unit 302 is specifically configured to:
and inquiring a routing table corresponding to the address information to acquire an address of a transfer gateway corresponding to the address information, and further sending the address information and the database file to the transfer gateway based on the address of the transfer gateway so that the transfer gateway sends the database file based on the address information.
In yet another implementation manner of the embodiment of the present invention, the upgrade unit 302 is specifically configured to:
acquiring a database file identifier from the database file to generate a corresponding first check value, and inquiring the database identifier of the database to generate a corresponding second check value by combining the target version identifier;
judging whether the first check value is consistent with the second check value;
if yes, determining that the database file is successfully checked; if not, determining that the database file verification fails
In yet another implementation manner of the embodiment of the present invention, the obtaining unit 301 is specifically configured to:
receiving an upgrade request input by a user, wherein the upgrade request comprises the test environment and the test component;
Sending approval prompt information corresponding to the upgrading request to prompt approval of the upgrading request;
and receiving a corresponding approval result of the upgrading request, and acquiring the test environment and the test assembly in the upgrading request after the approval result is confirmed to be approved.
It should be understood that the manner of implementing the embodiment of the present invention is the same as that of implementing the embodiment shown in fig. 2, and will not be described herein.
In the embodiment of the invention, the version control platform can realize the upgrade management of the database by calling the nano-tube platform without the operation of staff, so that the version update of the database can be executed without the need of staff with a certain database foundation, thereby reducing the management and operation cost of the database and saving the operation time of the staff.
According to an embodiment of the present invention, an electronic device and a readable storage medium are also provided.
The electronic equipment of the embodiment of the invention comprises: at least one processor; and a memory communicatively coupled to the at least one processor; the memory stores instructions executable by the one processor, and the instructions are executed by the at least one processor, so that the at least one processor executes the database management method provided by the embodiment of the invention.
Fig. 4 illustrates an exemplary system architecture 400 of a database management method or database management apparatus to which embodiments of the present invention may be applied.
As shown in fig. 4, the system architecture 400 may include terminal devices 401, 402, 403, a network 404, and a server 405. The network 404 is used as a medium to provide communication links between the terminal devices 401, 402, 403 and the server 405. The network 404 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others. In the embodiment of the invention, the terminal equipment can be provided with a version control platform, and the server can be provided with a nano-tube platform.
A user may interact with the server 405 via the network 404 using the terminal devices 401, 402, 403 to receive or send messages or the like. Various client applications may be installed on the terminal devices 401, 402, 403.
The terminal devices 401, 402, 403 may be, but are not limited to, smartphones, tablets, laptop and desktop computers, etc.
The server 405 may be a server providing various services, and the server may perform processing such as analysis on received data such as a product information query request, and feed back processing results (e.g., product information—merely as an example) to the terminal device.
It should be noted that, the method for managing a database according to the embodiment of the present invention is generally executed by the server 405, and accordingly, the device for managing a database is generally disposed in the server 405.
It should be understood that the number of terminal devices, networks and servers in fig. 4 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 5, there is illustrated a schematic diagram of a computer system 500 suitable for use in implementing embodiments of the present invention. The computer system illustrated in fig. 5 is merely an example, and should not be construed as limiting the functionality and scope of use of embodiments of the present invention.
As shown in fig. 5, the computer system 500 includes a Central Processing Unit (CPU) 501, which can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 502 or a program loaded from a storage section 508 into a Random Access Memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the system 500 are also stored. The CPU 501, ROM 502, and RAM 503 are connected to each other through a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
The following components are connected to the I/O interface 505: an input section 506 including a keyboard, a mouse, and the like; an output portion 507 including a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker, and the like; a storage portion 508 including a hard disk and the like; and a communication section 509 including a network interface card such as a LAN card, a modem, or the like. The communication section 509 performs communication processing via a network such as the internet. The drive 510 is also connected to the I/O interface 505 as needed. A removable medium 511 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 510 as needed so that a computer program read therefrom is mounted into the storage section 508 as needed.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication portion 509, and/or installed from the removable media 511. The above-described functions defined in the system of the present invention are performed when the computer program is executed by a Central Processing Unit (CPU) 501.
The computer readable medium shown in the present invention may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a unit, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units involved in the embodiments of the present invention may be implemented in software or in hardware. The described units may also be provided in a processor, for example, described as: a processor includes an acquisition unit and an upgrade unit. The names of these units do not constitute a limitation on the unit itself in some cases, and for example, the acquisition unit may also be described as "a unit that acquires the function of the unit".
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be present alone without being fitted into the device. The computer-readable medium carries one or more programs which, when executed by one of the devices, cause the device to perform the database management method provided by the present invention.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives can occur depending upon design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.

Claims (16)

1. The method for managing the databases is characterized by being used for a version management and control platform, wherein the version management and control platform stores the current version identification of each database and the upgrading record of the database, and comprises the following steps:
acquiring a test environment and a test component to inquire a target version identifier of a database corresponding to the test component in the test environment, wherein the test environment represents the running environment of the component;
Acquiring a current version identifier of a database corresponding to the test component to judge whether the current version identifier is the target version identifier;
if yes, not executing operation on the database corresponding to the test component; if not, calling a nano-tube platform interface, sending the target version identification to a nano-tube platform, so that the nano-tube platform obtains a database file corresponding to the target version identification, sending the file to a database server, enabling the database server to execute verification on the database file, upgrading the database corresponding to the test assembly based on the database file after verification is passed, and returning an upgrading result to a version control platform, so that test is executed on the test assembly in the test environment based on the upgraded database, wherein the nano-tube platform can store scripts of different versions corresponding to each database.
2. The method of claim 1, further comprising, prior to performing the verification on the database file:
and inquiring address information of a database server corresponding to the test component, sending the database file to the database server based on the address information so that the database server performs verification on the database file, and upgrading the database corresponding to the test component based on the database file.
3. The method of claim 2, wherein the upgrading the database corresponding to the test component based on the database file comprises:
inquiring the version identifier of the database corresponding to the test component in the database server to judge whether the version identifier is the current version identifier;
if yes, upgrading the database corresponding to the test component based on the database file; if not, returning a prompt message comprising the version identification, and upgrading the database corresponding to the test component based on the database file.
4. The method of claim 3, further comprising, after said invoking the nanotube platform interface:
receiving a prompt message of the version identifier, and acquiring the version identifier in the prompt message to inquire whether a database upgrading record corresponding to the version identifier is stored in the database upgrading record;
if yes, ignoring the prompt message; if not, generating and storing the upgrade record corresponding to the version identification.
5. The method of claim 2, further comprising, after said invoking the nanotube platform interface:
receiving a database upgrading result sent by the database server to generate a corresponding database upgrading record;
And displaying the database upgrading record.
6. The method of claim 2, wherein sending the database file to a database server based on the address information comprises:
and inquiring a routing table corresponding to the address information to acquire an address of a transfer gateway corresponding to the address information, and further sending the address information and the database file to the transfer gateway based on the address of the transfer gateway so that the transfer gateway sends the database file based on the address information.
7. The method of claim 1, wherein performing a check on the database file comprises:
acquiring a database file identifier from the database file to generate a corresponding first check value, and inquiring the database identifier of the database to generate a corresponding second check value by combining the target version identifier;
judging whether the first check value is consistent with the second check value;
if yes, determining that the database file is successfully checked; if not, determining that the database file verification fails.
8. The method of claim 1, wherein the acquiring test environment and test component comprises:
Receiving an upgrade request input by a user, wherein the upgrade request comprises the test environment and the test component;
sending approval prompt information corresponding to the upgrading request to prompt approval of the upgrading request;
and receiving a corresponding approval result of the upgrading request, and acquiring the test environment and the test assembly in the upgrading request after the approval result is confirmed to be approved.
9. The database management device is characterized by being used for a version management and control platform, wherein the version management and control platform stores the current version identification of each database and the upgrading record of the database, and comprises the following components:
the acquisition unit is used for acquiring a test environment and a test assembly so as to inquire a target version identifier of a database corresponding to the test assembly under the test environment;
the upgrading unit is used for acquiring the current version identifier of the database corresponding to the test component so as to judge whether the current version identifier is the target version identifier, wherein the test environment represents the running environment of the component; if yes, not executing operation on the database corresponding to the test component; if not, calling a nano-tube platform interface, sending the target version identification to a nano-tube platform, so that the nano-tube platform obtains a corresponding database file based on the target version identification, further sending the file to a database server, enabling the database server to execute verification on the database file, upgrading the database corresponding to the test component based on the database file after verification is passed, and returning an upgrading result to a version control platform, so that the test component is tested in the test environment based on the upgraded database, wherein the nano-tube platform can store scripts of different versions corresponding to each database.
10. The apparatus according to claim 9, wherein the upgrade unit is specifically configured to:
and inquiring address information of a server where the database corresponding to the test component is located, sending the database file to the database server based on the address information so that the database server can execute verification on the database file, and upgrading the database corresponding to the test component based on the database file.
11. The apparatus according to claim 10, wherein the upgrade unit is specifically configured to:
inquiring the version identifier of the database corresponding to the test component in the database server to judge whether the version identifier is the current version identifier;
if yes, upgrading the database corresponding to the test component based on the database file; if not, returning a prompt message comprising the version identification, and upgrading the database corresponding to the test component based on the database file.
12. The apparatus of claim 11, wherein the apparatus further comprises:
the receiving unit is used for receiving the prompt message of the version identifier, acquiring the version identifier in the prompt message, and inquiring whether the database upgrading record corresponding to the version identifier is stored in the database upgrading record;
The generating unit is used for ignoring the prompt message if yes; if not, generating and storing the upgrade record corresponding to the version identification.
13. The apparatus of claim 10, wherein the upgrade unit is further configured to:
receiving a database upgrading result sent by the database server to generate a corresponding database upgrading record;
and displaying the database upgrading record.
14. The apparatus according to claim 10, wherein the upgrade unit is specifically configured to:
and inquiring a routing table corresponding to the address information to acquire an address of a transfer gateway corresponding to the address information, and further sending the address information and the database file to the transfer gateway based on the address of the transfer gateway so that the transfer gateway sends the database file based on the address information.
15. An electronic device, comprising:
one or more processors;
storage means for storing one or more programs,
when executed by the one or more processors, causes the one or more processors to implement the method of any of claims 1-8.
16. A computer readable medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements the method according to any of claims 1-8.
CN202110697819.8A 2021-06-23 2021-06-23 Database management method, device, electronic equipment and storage medium Active CN113420010B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110697819.8A CN113420010B (en) 2021-06-23 2021-06-23 Database management method, device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110697819.8A CN113420010B (en) 2021-06-23 2021-06-23 Database management method, device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113420010A CN113420010A (en) 2021-09-21
CN113420010B true CN113420010B (en) 2023-05-26

Family

ID=77717526

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110697819.8A Active CN113420010B (en) 2021-06-23 2021-06-23 Database management method, device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113420010B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA2799001A1 (en) * 2011-12-29 2013-06-29 Tata Consultancy Services Limited Database version management system
CN104104527A (en) * 2013-04-03 2014-10-15 华为终端有限公司 Upgrade method for access terminal device and access terminal device
CN106502883A (en) * 2016-10-09 2017-03-15 武汉斗鱼网络科技有限公司 The database synchronization method and system of client and service end during automatic test
CN107861737A (en) * 2017-11-06 2018-03-30 国云科技股份有限公司 A kind of database version moving method of large scale system
CN110389903A (en) * 2019-07-19 2019-10-29 中国工商银行股份有限公司 Test environment dispositions method and device, electronic equipment and readable storage medium storing program for executing
CN111142899A (en) * 2019-12-12 2020-05-12 东软集团股份有限公司 Database script execution method and device, storage medium and electronic equipment
CN111367893A (en) * 2020-03-31 2020-07-03 中国建设银行股份有限公司 Method and device for database version iteration
CN112579568A (en) * 2020-12-15 2021-03-30 中国建设银行股份有限公司 Database version processing method and system

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8527460B2 (en) * 2010-02-19 2013-09-03 Jason Laurence Noble Method for carrying out database version control
CN108804618B (en) * 2018-05-31 2023-07-28 康键信息技术(深圳)有限公司 Database configuration method, device, computer equipment and storage medium
CN110221967A (en) * 2019-05-20 2019-09-10 深圳壹账通智能科技有限公司 Test data building method, device, computer equipment and storage medium
CN110413522A (en) * 2019-07-25 2019-11-05 江苏满运软件科技有限公司 A kind of determination method, apparatus, storage medium and the electronic equipment of test database
CN110543469B (en) * 2019-08-28 2020-09-11 贝壳找房(北京)科技有限公司 Database version management method and server
CN111857796A (en) * 2020-06-24 2020-10-30 苏州浪潮智能科技有限公司 Database version control system and method
CN112100194A (en) * 2020-10-10 2020-12-18 苏州浪潮智能科技有限公司 Database version management method and system

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA2799001A1 (en) * 2011-12-29 2013-06-29 Tata Consultancy Services Limited Database version management system
CN104104527A (en) * 2013-04-03 2014-10-15 华为终端有限公司 Upgrade method for access terminal device and access terminal device
CN106502883A (en) * 2016-10-09 2017-03-15 武汉斗鱼网络科技有限公司 The database synchronization method and system of client and service end during automatic test
CN107861737A (en) * 2017-11-06 2018-03-30 国云科技股份有限公司 A kind of database version moving method of large scale system
CN110389903A (en) * 2019-07-19 2019-10-29 中国工商银行股份有限公司 Test environment dispositions method and device, electronic equipment and readable storage medium storing program for executing
CN111142899A (en) * 2019-12-12 2020-05-12 东软集团股份有限公司 Database script execution method and device, storage medium and electronic equipment
CN111367893A (en) * 2020-03-31 2020-07-03 中国建设银行股份有限公司 Method and device for database version iteration
CN112579568A (en) * 2020-12-15 2021-03-30 中国建设银行股份有限公司 Database version processing method and system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
Modular Synchronization in Distributed, Multiversion Databases: Version Control and Concurrency Control;Divyakant Agrawal;《 IEEE Transactions on Knowledge and Data Engineering》;第5卷(第1期);全文 *

Also Published As

Publication number Publication date
CN113420010A (en) 2021-09-21

Similar Documents

Publication Publication Date Title
CN108897691B (en) Data processing method, device, server and medium based on interface simulation service
US11550599B2 (en) Method and apparatus for running applet
CN111400061A (en) Data processing method and system
CN111221727B (en) Test method, test device, electronic equipment and computer readable medium
CN108011949B (en) Method and apparatus for acquiring data
CN110659206A (en) Simulation architecture establishing method, device, medium and electronic equipment based on microservice
CN108959102B (en) Method and device for generating test data and testing application to be tested
CN116737662A (en) Method, device, electronic equipment and storage medium for processing business data
CN112559024A (en) Method and device for generating transaction code change list
CN113420010B (en) Database management method, device, electronic equipment and storage medium
CN107247661B (en) Method and system for supporting automatic verification of installation package of application
CN112948195B (en) Interface testing method, device, electronic equipment and storage medium
CN110580216A (en) application extraction and detection method and device
CN111435306A (en) Code management method and device
CN112783903B (en) Method and device for generating update log
CN116185806A (en) Digital currency system testing method and device
CN108287792B (en) Method and apparatus for outputting information
CN114722108A (en) Customer service data processing method and device, electronic equipment and storage medium
CN114625458A (en) Page data processing method and device, electronic equipment and storage medium
CN114428815A (en) Data storage method and device, electronic equipment and computer readable medium
CN113312900A (en) Data verification method and device
CN109889402B (en) Method and apparatus for generating information
CN112835962A (en) Information display method and device, electronic equipment and storage medium
CN112084114A (en) Method and apparatus for testing an interface
CN109298831B (en) Information storage method and device

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
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20221008

Address after: 25 Financial Street, Xicheng District, Beijing 100033

Applicant after: CHINA CONSTRUCTION BANK Corp.

Address before: 12 / F, 15 / F, No. 99, Yincheng Road, Shanghai pilot Free Trade Zone, 200120

Applicant before: Jianxin Financial Science and Technology Co.,Ltd.

GR01 Patent grant
GR01 Patent grant