CN108804618B - Database configuration method, device, computer equipment and storage medium - Google Patents

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

Info

Publication number
CN108804618B
CN108804618B CN201810546964.4A CN201810546964A CN108804618B CN 108804618 B CN108804618 B CN 108804618B CN 201810546964 A CN201810546964 A CN 201810546964A CN 108804618 B CN108804618 B CN 108804618B
Authority
CN
China
Prior art keywords
configuration
database
available
identifier
target
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
CN201810546964.4A
Other languages
Chinese (zh)
Other versions
CN108804618A (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.)
Kangjian Information Technology Shenzhen Co Ltd
Original Assignee
Kangjian Information Technology Shenzhen Co Ltd
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 Kangjian Information Technology Shenzhen Co Ltd filed Critical Kangjian Information Technology Shenzhen Co Ltd
Priority to CN201810546964.4A priority Critical patent/CN108804618B/en
Publication of CN108804618A publication Critical patent/CN108804618A/en
Application granted granted Critical
Publication of CN108804618B publication Critical patent/CN108804618B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The application relates to a database configuration method, a database configuration device, computer equipment and a storage medium. The method comprises the following steps: acquiring a database identifier and a corresponding data packet to be configured; analyzing the data packet to be configured to obtain a plurality of available configuration identifiers and available configuration information, wherein the available configuration identifiers and the available configuration information are in one-to-one correspondence; splicing each available configuration identifier and the corresponding available configuration information to obtain an available configuration item corresponding to each available configuration identifier; generating a configuration file according to the plurality of available configuration items obtained by splicing; and calling a configuration file to configure a target database corresponding to the database identifier. By adopting the method, the database configuration can be efficiently carried out.

Description

Database configuration method, device, computer equipment and storage medium
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a database configuration method, a database configuration device, a computer device, and a storage medium.
Background
In the application development business, an application developer needs to apply for deployment of a database to a database manager. Firstly, application developers need to submit database deployment requirements to a database manager for approval, and after the approval is passed, the database manager can manually allocate servers and deploy databases for application side developers according to the database deployment requirements. Before the deployed database is applied to the actual application service, the application developer also needs to submit configuration requirements to the database manager, which can execute further database configuration. In the traditional mode, an application developer needs to participate in the configuration of the database for many times, and a database manager needs to perform the configuration of the database in a whole-process manual operation, so that the period of the configuration of the database is long, and the configuration efficiency of the database is low.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a database configuration method, apparatus, computer device, and storage medium that enable efficient database configuration.
A database configuration method, the method comprising: acquiring a database identifier and a corresponding data packet to be configured; analyzing the data packet to be configured to obtain a plurality of available configuration identifiers and available configuration information, wherein the available configuration identifiers and the available configuration information are in one-to-one correspondence; splicing each available configuration identifier and the corresponding available configuration information to obtain an available configuration item corresponding to each available configuration identifier; generating a configuration file according to the plurality of available configuration items obtained by splicing; and calling the configuration file to configure the target database corresponding to the database identifier.
In one embodiment, the generating a configuration file according to the plurality of configuration items obtained by splicing includes: acquiring a configuration environment identifier and a plurality of target configuration identifiers corresponding to the configuration environment identifier; according to a plurality of target configuration identifiers corresponding to the configuration environment identifiers, selecting target configuration items corresponding to a plurality of target configuration identifiers from a plurality of available configuration items obtained through assembly; and combining the screened multiple target configuration items to generate a configuration file corresponding to the configuration environment identifier.
In one embodiment, the calling the configuration file to configure the target database corresponding to the database identifier includes: receiving a database test request; the database test request carries a configuration environment identifier to be tested; acquiring a configuration file corresponding to the configuration environment identifier to be tested; searching a target database corresponding to the database identifier; and running the obtained configuration file in the target database, and configuring the target database.
In one embodiment, the method further comprises: receiving a configuration change request; the configuration change request carries a configuration identifier to be updated and information to be updated; searching a configuration item to be updated corresponding to the configuration identifier to be updated and a corresponding configuration file to be updated; the configuration file to be updated contains the searched configuration items to be updated; updating the configuration items to be updated according to the information to be updated to obtain updated configuration items; and updating the configuration file to be updated according to the updated configuration item to obtain an updated configuration file.
In one embodiment, before the parsing the to-be-configured data packet to obtain a plurality of available configuration identifiers and available configuration information, the method further includes: detecting the format of the data packet to be configured; when the format of the data packet to be configured is not a preset format, performing format conversion processing on the data packet to be configured to obtain the data packet to be configured with the preset format; and when the format of the data packet to be configured is a preset format, executing the step of analyzing the data packet to be configured to obtain a plurality of available configuration identifiers and available configuration information.
In one embodiment, before the acquiring the database identifier and the corresponding data packet to be configured, the method further includes: acquiring a deployment request uploaded by a terminal; the deployment request carries a database application work order; extracting database attribute information from the database application worksheet; creating a database instance based on the database application worksheet and an initial database corresponding to the database instance; deploying the initial database according to the database attribute information to obtain a target database; when the completion of the deployment of the target database is detected, creating an authorized account corresponding to the target database; and sending the authorized account number to a terminal so that the terminal accesses the target database through the authorized account number.
A database configuration apparatus, the apparatus comprising: the acquisition module is used for acquiring the database identifier and the corresponding data packet to be configured; the analysis module is used for analyzing the data packet to be configured to obtain a plurality of available configuration identifiers and available configuration information, wherein the available configuration identifiers and the available configuration information are in one-to-one correspondence; the assembly module is used for assembling each available configuration identifier and the corresponding available configuration information to obtain an available configuration item corresponding to each available configuration identifier; generating a configuration file according to the plurality of available configuration items obtained by splicing; and the configuration module is used for calling the configuration file to configure the target database corresponding to the database identifier.
In one embodiment, the assembly module is further configured to obtain a configuration environment identifier and a plurality of target configuration identifiers corresponding to the configuration environment; according to a plurality of target configuration identifiers corresponding to the configuration environment identifiers, selecting target configuration items corresponding to a plurality of target configuration identifiers from a plurality of available configuration items obtained through assembly; and combining the screened multiple target configuration items to generate a configuration file corresponding to the configuration environment identifier.
A computer device comprising a memory storing a computer program and a processor implementing the steps of the database configuration method described in the various embodiments above when the computer program is executed.
A computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the database configuration method described in the respective embodiments above.
According to the database configuration method, the database configuration device, the computer equipment and the storage medium, after the operation and maintenance server obtains the database identifiers and the corresponding data packets to be configured, the data packets to be configured can be analyzed, and a plurality of available configuration identifiers and configuration information corresponding to each available configuration identifier are obtained. The operation and maintenance server can assemble each available configuration identifier and the corresponding available configuration information to obtain the available configuration item corresponding to each available configuration identifier. After the operation and maintenance server combines a plurality of available configuration items to generate a configuration file, a target database which is deployed on the storage server and corresponds to the database identifier can be configured based on the configuration file. The method has the advantages that the obtained data packets to be configured are processed to obtain a plurality of available configuration items, so that the available configuration items can be flexibly combined, the configuration file can be quickly generated, the target database can be automatically configured according to the configuration file, and the database configuration can be efficiently performed.
Drawings
FIG. 1 is an application scenario diagram of a database configuration method in one embodiment;
FIG. 2 is a flow diagram of a database configuration method in one embodiment;
FIG. 3 is a schematic diagram of a set of script files in a three-layer structure in one embodiment;
FIG. 4 is a flow chart of a database configuration method in another embodiment;
FIG. 5 is a block diagram of a database configuration apparatus in one embodiment;
fig. 6 is an internal structural diagram 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 will be further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application.
The database configuration method provided by the application can be applied to an application environment shown in fig. 1. Wherein the terminal 102 communicates with the server 104 via a network. The operation and maintenance server 104 may be in network communication with a plurality of storage servers 106. The storage server 106 has a target database deployed thereon. The terminal 102 may be, but not limited to, various personal computers, notebook computers, smartphones, tablet computers, and portable wearable devices, and the operation server 104 may be implemented by a stand-alone server or a server cluster formed by a plurality of servers. After the operation and maintenance server 104 obtains the database identifier and the corresponding data packet to be configured, the data packet to be configured can be parsed, so as to obtain a plurality of available configuration identifiers and available configuration information, wherein the available configuration identifiers and the available configuration information are in one-to-one correspondence. After the operation and maintenance server 104 assembles each available configuration identifier and the corresponding available configuration information, an available configuration item corresponding to each available configuration identifier can be obtained. The operation and maintenance server 104 generates a configuration file from the plurality of available configuration items obtained by splicing. The operation and maintenance server 104 may call a configuration file to configure a target database deployed on the storage server 106 and corresponding to the database identifier, so that the terminal 102 may access the configured target database.
In one embodiment, as shown in fig. 2, a database configuration method is provided, and the method is applied to the operation and maintenance server 104 in fig. 1 for illustration, and includes the following steps:
step 202, obtaining a database identifier and a corresponding data packet to be configured.
Database identification refers to an identification used to distinguish one database from other databases. The database identifier may be formed of one or more of letters, numbers, punctuation marks, etc. For example, the database identification may be a database name, a database number, etc. A database is a repository built on a computer storage device that organizes, stores, and manages data according to a data structure. The data packet to be configured refers to a data packet formed by related information for configuring a database. The data packet to be configured may be a compressed file generated by compressing various relevant information, or may be an encrypted file generated by encrypting various relevant information.
Relevant information for configuring the database includes, but is not limited to, database instance identification, master server identification, slave server identification, authorized account number, etc. configuration environment variables. Where a database instance (instance) refers to a series of processes in an operating system and memory blocks allocated for those processes. Database instance identifications include, but are not limited to, database instance names, numbers, and the like. The main server is used for the storage server to which the database belongs in the normal operation state. After the database is authorized, the user can access the database on the main server through the terminal, and add, delete, change and query the data in the database. A secondary server refers to a storage server that is used to backup data in a database on a primary server. The master server identification and the slave server identification refer to server IP (Internet Protocol Address ) addresses or port numbers of the master server and the slave server, respectively. The authorized account number refers to a credential that allows the corresponding terminal to access the target database. The authorized account number includes, but is not limited to, the IP address of the terminal.
In one embodiment, the operation and maintenance server comprises a deployment server and a configuration server. The deployment server may obtain a database configuration request uploaded by the terminal, where the database configuration request carries a database identifier and related information for configuring the database. The deployment server can package the related information to generate a data packet to be configured. The deployment server may send the data packet to be configured to the configuration server for further database configuration. The deployment server refers to an operation and maintenance server for database deployment. The configuration server refers to an operation and maintenance server for performing database configuration. By decoupling the database deployment and the database configuration and processing the database deployment and the database configuration by the two servers respectively, the database deployment and the database configuration can be executed in parallel for different databases, and the efficiency of the database configuration is improved.
In one embodiment, the data packet to be configured also carries information to be verified, including but not limited to user name, terminal IP address, signature, etc. After the information to be verified passes verification, the operation and maintenance server executes a further database configuration step.
And 204, analyzing the data packet to be configured to obtain a plurality of available configuration identifiers and available configuration information, wherein the available configuration identifiers and the available configuration information are in one-to-one correspondence.
The available configuration information refers to configuration information contained in the data packet to be configured, which can be used to generate a configuration item. The configuration information refers to a description code for configuring the target database. The description code may be JSON (JavaScript Object Notation, JS object tag, a lightweight data interchange format) format, XML (extensible markup language) format, or INI (a file extension), but is not limited thereto. The configuration information includes various types such as software configuration parameters, hardware configuration parameters, operating system configuration parameters, version information, server parameters, network devices, links, application systems, communication protocols, and the like. The available configuration identifier refers to a configuration identifier corresponding to the available configuration information. The configuration identification refers to a primary key for identifying corresponding configuration information. Keywords in the available configuration information can be extracted and combined to be used as the available configuration identification of the available configuration information. For example, the available configuration information includes the data source type and the related information of the main server, such as the user name, domain name, password, port, database name, etc. The data source type refers to the source of the data required to be stored in the target database, and can be application service identification. The available configuration identification may be based on a combination of one or more of data source type, user name, database name, etc.
In one embodiment, before parsing the data packet to be configured to obtain a plurality of available configuration identifiers and available configuration information, the method further includes: detecting the format of a data packet to be configured; when the format of the data packet to be configured is not the preset format, performing format conversion processing on the data packet to be configured to obtain the data packet to be configured with the preset format; when the format of the data packet to be configured is a preset format, executing the step of analyzing the data packet to be configured to obtain a plurality of available configuration identifiers and available configuration information.
The conversion tool can be called to perform format conversion processing on the data packet to be configured, and then a parser matched with a preset format is called to parse the data packet to be configured. For example, after converting the XML data packet into the JSON data packet, the JSON parser may be called to parse the data packet to be configured.
And 206, splicing each available configuration identifier and the corresponding available configuration information to obtain an available configuration item corresponding to each available configuration identifier.
The available configuration item refers to a sub-item which is composed of an available configuration identifier and available configuration information and is included in a configuration management category. A configuration file may be generated from a plurality of available configuration items.
In one embodiment, when generating the available configuration items, further comprising: and acquiring a configuration environment identifier, and constructing a mapping relation between the configuration environment identifier and the generated available configuration items. Wherein, the configuration environment identifier refers to an identifier corresponding to the configuration environment. Configuration environments include, but are not limited to, development environments, testing environments, production environments, pre-release environments, and the like. The pre-release environment is an operating environment which is configured identically to the production environment and is connected to a production environment database, and simulates the production environment.
And step 208, generating a configuration file according to the plurality of available configuration items obtained by splicing.
A configuration file is a collection of configuration items that are used to load a desired configuration environment when a configuration target database is assigned.
In one embodiment, after the configuration file is generated, the setting state of the configuration item of the generated configuration file may be updated. For example, "0" represents set and "1" represents unset, the setting status of the configuration item generating the configuration file needs to be updated to "1". The configuration items which are assembled can be processed in time to generate the configuration file by marking the setting state of the configuration items, and the configuration items which are not used for a long time can be deleted to reduce the occupied memory.
In one embodiment, generating a configuration file according to the plurality of available configuration items obtained by splicing comprises: acquiring a configuration environment identifier and a plurality of target configuration identifiers corresponding to the configuration environment identifier; screening target configuration items corresponding to the plurality of target configuration identifiers from the plurality of available configuration items obtained through assembly according to the plurality of target configuration identifiers corresponding to the configuration environment identifiers; and combining the plurality of screened target configuration items to generate a configuration file corresponding to the configuration environment identifier.
When the target database needs to be configured as a different configuration environment, a different configuration file needs to be invoked. For example, for a test environment and a production environment, a target database deployed on different storage servers needs to be configured, and then configuration items for server addresses in configuration files corresponding to the two configuration environments are different.
In one embodiment, the configuration items may be filtered for dimensions with the available configuration identifications and the available configuration information, respectively. By providing a plurality of modes, the configuration items can be screened more flexibly. When the number of the configuration items is quite large, the workload of searching the corresponding configuration items can be reduced through the preliminary screening modes of different dimensions.
Step 210, calling a configuration file to configure a target database corresponding to the database identifier.
The target database is a database which is deployed on a storage server and needs to be configured. Such as configuring the target database according to software configuration parameters, hardware configuration parameters, operating system configuration parameters, version information, server parameters, network devices, links, application systems, communication protocols, and the like. By configuring the target database, the terminal can access and use the target database according to the access mode and the access path corresponding to the configuration file. Configuration tools such as ZooKeeper (ZooKeeper is a distributed application coordination service) can be called to configure the target database.
In one embodiment, invoking the configuration file to configure the target database corresponding to the database identifier includes: receiving a database test request; the database test request carries a configuration environment identifier to be tested; acquiring a configuration file corresponding to a configuration environment identifier to be tested; searching a target database corresponding to the database identifier; and running the obtained configuration file in the target database, and configuring the target database.
Because the response speed, the storage capacity and other performances of the target database may be different under different configuration environments, the performance of the target database can be optimized by testing the configuration environments. The configuration environment identifier to be tested refers to the configuration environment identifier corresponding to the configuration environment to be tested. Database test requests refer to requests for configuration environment testing of data. And obtaining a configuration file for constructing a corresponding configuration environment when receiving a database test request carrying the configuration environment identifier through the mapping relation between the configuration environment identifier and the configuration file, and obtaining a target database of the configuration environment with required test by being configurable in the configuration file.
In the database configuration method, after the operation and maintenance server obtains the database identifiers and the corresponding data packets to be configured, the data packets to be configured can be analyzed to obtain a plurality of available configuration identifiers and available configuration information corresponding to each available configuration identifier. The operation and maintenance server can assemble each available configuration identifier and the corresponding available configuration information to obtain the available configuration item corresponding to each available configuration identifier. After the operation and maintenance server combines a plurality of available configuration items to generate a configuration file, a target database which is deployed on the storage server and corresponds to the database identifier can be configured based on the configuration file. The method has the advantages that the obtained data packets to be configured are processed to obtain a plurality of available configuration items, so that the available configuration items can be flexibly combined, the configuration file can be quickly generated, the target database can be automatically configured according to the configuration file, and the database configuration can be efficiently performed.
In one embodiment, the method further comprises: receiving a configuration change request; the configuration change request carries a configuration identifier to be updated and information to be updated; searching a configuration item to be updated corresponding to the configuration identifier to be updated and a corresponding configuration file to be updated; the configuration file to be updated contains the searched configuration items to be updated; updating the configuration items to be updated according to the information to be updated to obtain updated configuration items; and updating the configuration file to be updated according to the updated configuration item to obtain an updated configuration file.
The configuration change request refers to a request for changing the configuration identification or configuration information of the configuration item to be updated. The configuration identifier to be updated refers to a configuration identifier corresponding to the configuration item to be updated. For example, when a storage server originally configured as a main server fails, high availability switching is required, and other storage servers which normally operate are used as the switched main servers, then a configuration item corresponding to the main server information is a configuration item to be updated, and the information to be updated includes a server identifier of the storage server used for switching. By changing the configuration items to be updated, the configuration files to be updated containing the configuration items to be updated are automatically updated, so that the updated configuration files can be efficiently obtained. When the configuration environment needs to be optimized, the target database can be rapidly configured according to the updated configuration file, and the optimized configuration environment is obtained.
In one embodiment, before acquiring the database identifier and the corresponding data packet to be configured, the method further comprises: acquiring a deployment request uploaded by a terminal; the deployment request carries a database application work order; extracting database attribute information from a database application work order; creating a database instance based on the database application work order and an initial database corresponding to the database instance; deploying the initial database according to the attribute information of the database to obtain a target database; when the completion of the deployment of the target database is detected, creating an authorized account corresponding to the target database; and sending the authorized account number to the terminal so that the terminal accesses the target database through the authorized account number.
The deployment request refers to a request for applying for deploying the database, which is uploaded by the terminal. For example, the deployment request may be a request uploaded by the terminal 102 in fig. 1. The database application work order refers to an electronic bill carrying information related to database application. The database application related information includes, but is not limited to, one or more of database applicant information, application service information, database attribute information, and the like. The applicant information includes, but is not limited to, a user identifier corresponding to an application developer, a user identifier corresponding to an upper level leader of the application developer, and the like. The application information includes, but is not limited to, application service identification and application service class, etc. Database attribute information includes, but is not limited to, database capacity, database version, database backup mode, etc. The authorized account number refers to a credential that allows the corresponding terminal to access the target database. The authorized account number includes, but is not limited to, the IP address of the terminal.
In one embodiment, a work order system may be deployed on the terminal, and the work order system may provide a database application interface, which may include input boxes, including but not limited to text boxes, selection boxes, drop-down boxes, and the like. The application developer can input the database attribute information of the applied database into the work order system through the database application interface. The database application interface may also include a database application control. When the terminal detects the clicking operation acting on the database application control, the terminal indicates that the input of the application developer is completed, and the terminal can generate a database application work order according to the database attribute information input by the user through the work order system and display the database application work order to the application developer for confirmation. When the database application work order is confirmed without errors, the terminal can generate a deployment request aiming at the database according to the database application work order and send the deployment request to the operation and maintenance server.
In one embodiment, deploying the initial database according to the database attribute information to obtain the target database comprises: generating a plurality of deployment subtasks according to the attribute information of the database, and identifying the subtask type corresponding to each deployment subtask; acquiring script files corresponding to each deployment subtask according to the identified subtask type; and executing the acquired script file in the initial database to obtain a target database.
The deployment subtask refers to a subtask for implementing database data, including but not limited to deploying a master-slave server, deploying a high availability cluster, configuring a service notification mode, and the like. The pre-constructed script files can be obtained according to the subtask types, and each script file can be executed to complete the corresponding deployment subtask, so that the corresponding function of the database is realized.
The initial database can be deployed according to the library attribute information through a pre-constructed script file set with a three-layer structure. As shown in fig. 3, a schematic diagram of a set of script files in a three-layer structure is provided. The three-layer script file set includes a service layer 302, a base layer 304, and an underlying support layer 306.
The service layer 302 includes, but is not limited to, a database deployment script file for database deployment, and an API service script file for making calls to external systems to provide APIs ((Application Programming Interface, application programming interface)).
The base layer 304 includes, but is not limited to, a deployment master-slave script file for deploying a master-slave server for a database instance, a deployment high-availability script file for deploying a high-availability cluster, a service notification script file for sending a message to a database manager or the like, a docking external script file for docking an external system, a data collection script file for collecting metadata corresponding to data stored in a database, and a cluster switch script file for high-availability switching. Where a high availability cluster refers to a set of computer nodes that, as a whole, provide a set of network resources to a user. The high availability switching refers to automatically switching the primary server to a high availability cluster when the primary server is detected to be faulty.
The underlying support layer 306 includes, but is not limited to, SSH (Secure Shell protocol) protocol SSH script files for configuring connections with servers, MAIL script files for sending MAIL, config script files for configuring parameters, SMS script files for sending short messages, MSG script files for sending system messages, LOG script files for generating system LOGs, MYDB script files for connecting databases, interface script files for interacting with external system interfaces, meta script files for maintaining metadata.
When the script file in the script file set with the pre-built three-layer structure is called, the script file in the first service layer 302 is called first, then the script file in the second base layer 304 is called through the script file in the service layer 302, and then the script file in the third base layer 306 is called through the script file in the base layer 304. And sequentially deploying the initial database by calling the script file from top to bottom, so as to obtain a target database corresponding to the attribute information of the database.
The task to be executed in the database deployment process is split into a plurality of deployment subtasks, and corresponding script files in the pre-constructed three-layer script file set are called to execute the deployment subtasks respectively, so that decoupling of the database deployment is realized, the database deployment can be more flexibly and rapidly carried out, and the success rate and the efficiency of the database deployment are improved.
In one embodiment, when the completion of the deployment of the target database is detected, database configuration information is extracted from the database attribute information; and generating a data packet to be configured according to the authorized account number and the database configuration information. Both the authorized account number and the database configuration information are relevant information for configuring the database.
In one embodiment, as shown in fig. 4, another database configuration method is provided, and the method is applied to the operation and maintenance server 104 in fig. 1 for illustration, and includes the following steps:
step 402, obtaining a database identifier and a corresponding data packet to be configured.
Step 404, detecting the format of the data packet to be configured.
And step 406, when the format of the data packet to be configured is not the preset format, performing format conversion processing on the data packet to be configured to obtain the data packet to be configured in the preset format.
And step 408, when the format of the data packet to be configured is a preset format, analyzing the data packet to be configured to obtain a plurality of available configuration identifiers and available configuration information, wherein the available configuration identifiers and the available configuration information are in one-to-one correspondence.
And 410, assembling each available configuration identifier and the corresponding available configuration information to obtain an available configuration item corresponding to each available configuration identifier.
Step 412, obtaining a configuration environment identifier and a plurality of target configuration identifiers corresponding to the configuration environment identifier.
Step 414, selecting the target configuration items corresponding to the plurality of target configuration identifiers from the plurality of available configuration items obtained by splicing according to the plurality of target configuration identifiers corresponding to the configuration environment identifiers.
And 416, combining the plurality of screened target configuration items to generate a configuration file corresponding to the configuration environment identifier.
Step 418, receiving a database test request; the database test request carries the configuration environment identifier to be tested.
Step 420, obtain the configuration file corresponding to the configuration environment identifier to be tested.
Step 422, a target database corresponding to the database identification is looked up.
And step 424, running the obtained configuration file in the target database to configure the target database.
In the database configuration method, after the operation and maintenance server acquires the database identifiers and the corresponding data packets to be configured, when the format of the data packets to be configured is a preset format, the data packets to be configured are analyzed to obtain a plurality of available configuration identifiers and available configuration information corresponding to each available configuration identifier. The operation and maintenance server can assemble each available configuration identifier and the corresponding available configuration information to obtain the available configuration item corresponding to each available configuration identifier. The operation and maintenance server can also screen out a plurality of target configuration items in a plurality of available configuration items according to the requirements of the configuration environment, combine the configuration items to generate configuration files, and configure a target database which is deployed on the storage server and corresponds to the database identifier based on the configuration files, so that the corresponding configuration environment is constructed. The method has the advantages that the obtained data packets to be configured are processed to obtain a plurality of available configuration items, so that the available configuration items can be flexibly combined, the configuration file can be quickly generated, the target database can be automatically configured according to the configuration file, and the database configuration can be efficiently performed.
It should be understood that, although the steps in the flowcharts of fig. 2 and 4 are shown in order as indicated by the arrows, these steps are not necessarily performed in order as indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in fig. 2 and 4 may include multiple sub-steps or stages that are not necessarily performed at the same time, but may be performed at different times, nor do the order in which the sub-steps or stages are performed necessarily occur sequentially, but may be performed alternately or alternately with at least a portion of the sub-steps or stages of other steps or other steps.
In one embodiment, as shown in fig. 5, there is provided a database configuration apparatus 500 comprising: the acquiring module 502 is configured to acquire a database identifier and a corresponding data packet to be configured; the parsing module 504 is configured to parse the data packet to be configured to obtain a plurality of available configuration identifiers and available configuration information, where the available configuration identifiers and the available configuration information are in one-to-one correspondence; the assembling module 506 is configured to assemble each available configuration identifier and the corresponding available configuration information to obtain an available configuration item corresponding to each available configuration identifier; generating a configuration file according to the plurality of available configuration items obtained by splicing; and the configuration module 508 is used for calling the configuration file to configure the target database corresponding to the database identifier.
In one embodiment, the assembling module 506 is further configured to obtain a configuration environment identifier and a plurality of target configuration identifiers corresponding to the configuration environment identifier; according to a plurality of target configuration identifiers corresponding to the configuration environment identifiers, a plurality of target configuration items corresponding to the plurality of target configuration identifiers are screened out from a plurality of available configuration items obtained through assembly; and combining the plurality of screened target configuration items to generate a configuration file corresponding to the configuration environment identifier.
In one embodiment, the configuration module 508 is further configured to receive a database test request; the database test request carries a configuration environment identifier to be tested; acquiring a configuration file corresponding to a configuration environment identifier to be tested; searching a target database corresponding to the database identifier; and running the obtained configuration file in the target database, and configuring the target database.
In one embodiment, the apparatus further comprises an update module for receiving a configuration change request; the configuration change request carries a configuration identifier to be updated and information to be updated; searching a configuration item to be updated corresponding to the configuration identifier to be updated and a corresponding configuration file to be updated; the configuration file to be updated contains the searched configuration items to be updated; updating the configuration items to be updated according to the information to be updated to obtain updated configuration items; and updating the configuration file to be updated according to the updated configuration item to obtain an updated configuration file.
In one embodiment, the parsing module 504 is further configured to detect a format of a data packet to be configured; when the format of the data packet to be configured is not the preset format, performing format conversion processing on the data packet to be configured to obtain the data packet to be configured with the preset format; when the format of the data packet to be configured is a preset format, executing the step of analyzing the data packet to be configured to obtain a plurality of available configuration identifiers and available configuration information.
In one embodiment, the device further comprises a deployment module, configured to obtain a deployment request uploaded by the terminal; the deployment request carries a database application work order; extracting database attribute information from a database application work order; creating a database instance based on the database application work order and an initial database corresponding to the database instance; deploying the initial database according to the attribute information of the database to obtain a target database; when the completion of the deployment of the target database is detected, creating an authorized account corresponding to the target database; and sending the authorized account number to the terminal so that the terminal accesses the target database through the authorized account number.
For specific limitations of the database configuration device, reference may be made to the above limitation of the database configuration method, and no further description is given here. The respective modules in the database configuration apparatus described above may be implemented in whole or in part by software, hardware, or a combination thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In one embodiment, a computer device is provided, which may be a server, the internal structure of which may be as shown in fig. 6. The computer device includes a processor, a memory, a network interface, and a database 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 includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database of the computer device is used for storing data such as configuration files. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a database configuration method.
It will be appreciated by those skilled in the art that the structure shown in fig. 6 is merely a block diagram of some of the structures associated with the present application and is not limiting of the computer device to which the present application may be applied, and that a particular computer device may include more or fewer components than shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided comprising a memory storing a computer program and a processor that when executing the computer program performs the steps of: acquiring a database identifier and a corresponding data packet to be configured; analyzing the data packet to be configured to obtain a plurality of available configuration identifiers and available configuration information, wherein the available configuration identifiers and the available configuration information are in one-to-one correspondence; splicing each available configuration identifier and the corresponding available configuration information to obtain an available configuration item corresponding to each available configuration identifier; generating a configuration file according to the plurality of available configuration items obtained by splicing; and calling a configuration file to configure a target database corresponding to the database identifier.
In one embodiment, the step of generating a configuration file according to the assembled configuration items when the processor executes the computer program includes the following steps: acquiring a configuration environment identifier and a plurality of target configuration identifiers corresponding to the configuration environment identifier; screening target configuration items corresponding to the plurality of target configuration identifiers from the plurality of available configuration items obtained through assembly according to the plurality of target configuration identifiers corresponding to the configuration environment identifiers; and combining the plurality of screened target configuration items to generate a configuration file corresponding to the configuration environment identifier.
In one embodiment, when the processor executes the computer program, the step of configuring the target database corresponding to the database identifier by the implemented calling configuration file includes the following steps: receiving a database test request; the database test request carries a configuration environment identifier to be tested; acquiring a configuration file corresponding to a configuration environment identifier to be tested; searching a target database corresponding to the database identifier; and running the obtained configuration file in the target database, and configuring the target database.
In one embodiment, the processor when executing the computer program further performs the steps of: receiving a configuration change request; the configuration change request carries a configuration identifier to be updated and information to be updated; searching a configuration item to be updated corresponding to the configuration identifier to be updated and a corresponding configuration file to be updated; the configuration file to be updated contains the searched configuration items to be updated; updating the configuration items to be updated according to the information to be updated to obtain updated configuration items; and updating the configuration file to be updated according to the updated configuration item to obtain an updated configuration file.
In one embodiment, when the processor executes the computer program, before the step of analyzing the data packet to be configured to obtain a plurality of available configuration identifiers and available configuration information, the method further includes the following steps: detecting the format of a data packet to be configured; when the format of the data packet to be configured is not the preset format, performing format conversion processing on the data packet to be configured to obtain the data packet to be configured with the preset format; when the format of the data packet to be configured is a preset format, executing the step of analyzing the data packet to be configured to obtain a plurality of available configuration identifiers and available configuration information.
In one embodiment, the processor, when executing the computer program, further comprises the following steps before the step of obtaining the database identifier and the corresponding data packet to be configured is implemented: acquiring a deployment request uploaded by a terminal; the deployment request carries a database application work order; extracting database attribute information from a database application work order; creating a database instance based on the database application work order and an initial database corresponding to the database instance; deploying the initial database according to the attribute information of the database to obtain a target database; when the completion of the deployment of the target database is detected, creating an authorized account corresponding to the target database; and sending the authorized account number to the terminal so that the terminal accesses the target database through the authorized account number.
In one embodiment, a computer readable storage medium is provided having a computer program stored thereon, which when executed by a processor, performs the steps of: acquiring a database identifier and a corresponding data packet to be configured; analyzing the data packet to be configured to obtain a plurality of available configuration identifiers and available configuration information, wherein the available configuration identifiers and the available configuration information are in one-to-one correspondence; splicing each available configuration identifier and the corresponding available configuration information to obtain an available configuration item corresponding to each available configuration identifier; generating a configuration file according to the plurality of available configuration items obtained by splicing; and calling a configuration file to configure a target database corresponding to the database identifier.
In one embodiment, the step of generating a configuration file from the assembled plurality of configuration items is implemented when the computer program is executed by a processor, comprising the steps of: acquiring a configuration environment identifier and a plurality of target configuration identifiers corresponding to the configuration environment identifier; screening target configuration items corresponding to the plurality of target configuration identifiers from the plurality of available configuration items obtained through assembly according to the plurality of target configuration identifiers corresponding to the configuration environment identifiers; and combining the plurality of screened target configuration items to generate a configuration file corresponding to the configuration environment identifier.
In one embodiment, the step of configuring the target database corresponding to the database identifier by the implemented call configuration file when the computer program is executed by the processor includes the steps of: receiving a database test request; the database test request carries a configuration environment identifier to be tested; acquiring a configuration file corresponding to a configuration environment identifier to be tested; searching a target database corresponding to the database identifier; and running the obtained configuration file in the target database, and configuring the target database.
In one embodiment, the computer program when executed by the processor further performs the steps of: receiving a configuration change request; the configuration change request carries a configuration identifier to be updated and information to be updated; searching a configuration item to be updated corresponding to the configuration identifier to be updated and a corresponding configuration file to be updated; the configuration file to be updated contains the searched configuration items to be updated; updating the configuration items to be updated according to the information to be updated to obtain updated configuration items; and updating the configuration file to be updated according to the updated configuration item to obtain an updated configuration file.
In one embodiment, when the computer program is executed by the processor, before the step of parsing the data packet to be configured to obtain a plurality of available configuration identifiers and available configuration information, the method further includes the following steps: detecting the format of a data packet to be configured; when the format of the data packet to be configured is not the preset format, performing format conversion processing on the data packet to be configured to obtain the data packet to be configured with the preset format; when the format of the data packet to be configured is a preset format, executing the step of analyzing the data packet to be configured to obtain a plurality of available configuration identifiers and available configuration information.
In one embodiment, the computer program, when executed by the processor, further comprises, prior to the step of obtaining the database identification and the corresponding data packet to be configured, the steps of: acquiring a deployment request uploaded by a terminal; the deployment request carries a database application work order; extracting database attribute information from a database application work order; creating a database instance based on the database application work order and an initial database corresponding to the database instance; deploying the initial database according to the attribute information of the database to obtain a target database; when the completion of the deployment of the target database is detected, creating an authorized account corresponding to the target database; and sending the authorized account number to the terminal so that the terminal accesses the target database through the authorized account number.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the various embodiments provided herein may include non-volatile and/or volatile memory. The nonvolatile memory can include Read Only Memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), memory bus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), among others.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The above examples merely represent a few embodiments of the present application, which are described in more detail and are not to be construed as limiting the scope of the invention. It should be noted that it would be apparent to those skilled in the art that various modifications and improvements could be made without departing from the spirit of the present application, which would be within the scope of the present application. Accordingly, the scope of protection of the present application is to be determined by the claims appended hereto.

Claims (10)

1. A database configuration method, the method comprising:
acquiring a database identifier and a corresponding data packet to be configured; the data packet to be configured refers to a data packet formed by related information for configuring a database;
analyzing the data packet to be configured to obtain a plurality of available configuration identifiers and available configuration information, wherein the available configuration identifiers and the available configuration information are in one-to-one correspondence; wherein the available configuration identifier is one or more of a data source type, a user name, a database name and the like;
Splicing each available configuration identifier and the corresponding available configuration information to obtain an available configuration item corresponding to each available configuration identifier;
generating a configuration file according to the plurality of available configuration items obtained by splicing;
and calling the configuration file to configure the target database corresponding to the database identifier.
2. The method of claim 1, wherein generating a configuration file from the assembled plurality of configuration items comprises:
acquiring a configuration environment identifier and a plurality of target configuration identifiers corresponding to the configuration environment identifier;
according to a plurality of target configuration identifiers corresponding to the configuration environment identifiers, selecting target configuration items corresponding to a plurality of target configuration identifiers from a plurality of available configuration items obtained through assembly;
and combining the screened multiple target configuration items to generate a configuration file corresponding to the configuration environment identifier.
3. The method of claim 2, wherein the invoking the configuration file to configure the target database corresponding to the database identification comprises:
receiving a database test request; the database test request carries a configuration environment identifier to be tested;
Acquiring a configuration file corresponding to the configuration environment identifier to be tested;
searching a target database corresponding to the database identifier;
and running the obtained configuration file in the target database, and configuring the target database.
4. The method according to claim 2, wherein the method further comprises:
receiving a configuration change request; the configuration change request carries a configuration identifier to be updated and information to be updated;
searching a configuration item to be updated corresponding to the configuration identifier to be updated and a corresponding configuration file to be updated; the configuration file to be updated contains the searched configuration items to be updated;
updating the configuration items to be updated according to the information to be updated to obtain updated configuration items;
and updating the configuration file to be updated according to the updated configuration item to obtain an updated configuration file.
5. The method of claim 1, further comprising, prior to parsing the data packet to be configured to obtain a plurality of available configuration identifiers and available configuration information:
detecting the format of the data packet to be configured;
When the format of the data packet to be configured is not a preset format, performing format conversion processing on the data packet to be configured to obtain the data packet to be configured with the preset format;
and when the format of the data packet to be configured is a preset format, executing the step of analyzing the data packet to be configured to obtain a plurality of available configuration identifiers and available configuration information.
6. The method according to any one of claims 1 to 5, further comprising, prior to said obtaining the database identification and the corresponding data packet to be configured:
acquiring a deployment request uploaded by a terminal; the deployment request carries a database application work order;
extracting database attribute information from the database application worksheet;
creating a database instance based on the database application worksheet and an initial database corresponding to the database instance;
deploying the initial database according to the database attribute information to obtain a target database;
when the completion of the deployment of the target database is detected, creating an authorized account corresponding to the target database;
and sending the authorized account number to a terminal so that the terminal accesses the target database through the authorized account number.
7. A database configuration apparatus, the apparatus comprising:
the acquisition module is used for acquiring the database identifier and the corresponding data packet to be configured; the data packet to be configured refers to a data packet formed by related information for configuring a database;
the analysis module is used for analyzing the data packet to be configured to obtain a plurality of available configuration identifiers and available configuration information, wherein the available configuration identifiers and the available configuration information are in one-to-one correspondence; wherein the available configuration identifier is one or more of a data source type, a user name, a database name and the like;
the assembly module is used for assembling each available configuration identifier and the corresponding available configuration information to obtain an available configuration item corresponding to each available configuration identifier; generating a configuration file according to the plurality of available configuration items obtained by splicing;
and the configuration module is used for calling the configuration file to configure the target database corresponding to the database identifier.
8. The apparatus of claim 7, wherein the assembly module is further configured to obtain a configuration environment identifier and a plurality of target configuration identifiers corresponding to the configuration environment identifier; according to a plurality of target configuration identifiers corresponding to the configuration environment identifiers, selecting target configuration items corresponding to a plurality of target configuration identifiers from a plurality of available configuration items obtained through assembly; and combining the screened multiple target configuration items to generate a configuration file corresponding to the configuration environment identifier.
9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any of claims 1 to 6 when the computer program is executed.
10. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 6.
CN201810546964.4A 2018-05-31 2018-05-31 Database configuration method, device, computer equipment and storage medium Active CN108804618B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810546964.4A CN108804618B (en) 2018-05-31 2018-05-31 Database configuration method, device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810546964.4A CN108804618B (en) 2018-05-31 2018-05-31 Database configuration method, device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN108804618A CN108804618A (en) 2018-11-13
CN108804618B true CN108804618B (en) 2023-07-28

Family

ID=64089647

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810546964.4A Active CN108804618B (en) 2018-05-31 2018-05-31 Database configuration method, device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN108804618B (en)

Families Citing this family (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110097341A (en) * 2019-04-29 2019-08-06 重庆天蓬网络有限公司 A kind of automation O&M management-control method, device, medium and electronic equipment
CN112306568A (en) * 2019-07-26 2021-02-02 广州虎牙科技有限公司 Service instance configuration method and device, electronic equipment and storage medium
CN110716914A (en) * 2019-09-02 2020-01-21 平安普惠企业管理有限公司 Database configuration method, system, computer readable storage medium and terminal equipment
CN110598107A (en) * 2019-09-09 2019-12-20 恩亿科(北京)数据科技有限公司 Management method of query system and computer storage medium
CN110825795B (en) * 2019-09-18 2023-10-13 平安科技(深圳)有限公司 Method, apparatus, device and computer readable storage medium for accessing database
CN111008023B (en) * 2019-12-06 2024-01-09 无锡华云数据技术服务有限公司 Instance deployment method and system
CN111159162B (en) * 2019-12-31 2023-07-25 中国联合网络通信集团有限公司 Database configuration method and equipment
CN111277432B (en) * 2020-01-10 2023-05-23 腾讯科技(深圳)有限公司 Configuration information updating method and device, electronic equipment and storage medium
CN111464419B (en) * 2020-04-13 2021-08-27 中国人民解放军国防科技大学 Data transmission control method based on bus network communication
CN112152841B (en) * 2020-09-03 2023-06-20 锐捷网络股份有限公司 Verification method, verification device, switch, equipment and storage medium
CN112445576B (en) * 2020-11-30 2024-04-16 中国人寿保险股份有限公司 Equipment calling method for shielding service difference and related equipment
CN113420010B (en) * 2021-06-23 2023-05-26 中国建设银行股份有限公司 Database management method, device, electronic equipment and storage medium
CN113806176A (en) * 2021-09-22 2021-12-17 中国建设银行股份有限公司 Data object identification method and device based on configuration management
CN115470043B (en) * 2022-09-14 2023-04-25 广州鼎甲计算机科技有限公司 Database backup method, device, computer equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107122297A (en) * 2017-04-18 2017-09-01 上海雷腾软件股份有限公司 The method and apparatus that request message for test interface is generated
CN107294750A (en) * 2016-04-01 2017-10-24 阿里巴巴集团控股有限公司 A kind of distribution configuring management method and device for converging group energy self-identifying

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106610853A (en) * 2015-10-26 2017-05-03 阿里巴巴集团控股有限公司 Application deployment method and device
CN107959580A (en) * 2016-10-17 2018-04-24 中兴通讯股份有限公司 The method and apparatus of configuration service
CN106844772A (en) * 2017-02-28 2017-06-13 东软集团股份有限公司 The update method and device of application database
CN107168726B (en) * 2017-03-30 2021-04-27 武汉斗鱼网络科技有限公司 Method and device for dynamically configuring application program
CN107733708B (en) * 2017-10-16 2020-09-18 平安科技(深圳)有限公司 Equipment parameter configuration method and device, computer equipment and storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107294750A (en) * 2016-04-01 2017-10-24 阿里巴巴集团控股有限公司 A kind of distribution configuring management method and device for converging group energy self-identifying
CN107122297A (en) * 2017-04-18 2017-09-01 上海雷腾软件股份有限公司 The method and apparatus that request message for test interface is generated

Also Published As

Publication number Publication date
CN108804618A (en) 2018-11-13

Similar Documents

Publication Publication Date Title
CN108804618B (en) Database configuration method, device, computer equipment and storage medium
US10618137B2 (en) Automated constructing method of cloud manufacturing service and cloud manufacturing system
CN109032824B (en) Database verification method, database verification device, computer equipment and storage medium
CN108959385B (en) Database deployment method, device, computer equipment and storage medium
CN112910945B (en) Request link tracking method and service request processing method
WO2020147419A1 (en) Monitoring method and apparatus, computer device and storage medium
US8793660B2 (en) Automated testing of programming code for a web service
CN108197200B (en) Log tracking method and device, computer equipment and storage medium
CN111310427A (en) Service data configuration processing method and device, computer equipment and storage medium
CN107241315B (en) Access method and device of bank gateway interface and computer readable storage medium
CN110569035A (en) Code compiling method, device, equipment and storage medium of software development project
US11061669B2 (en) Software development tool integration and monitoring
US9229758B2 (en) Passive monitoring of virtual systems using extensible indexing
US20130111018A1 (en) Passive monitoring of virtual systems using agent-less, offline indexing
CN110688598A (en) Service parameter acquisition method and device, computer equipment and storage medium
CN110955600A (en) Interface test method and device
CN113220431A (en) Cross-cloud distributed data task scheduling method, device and storage medium
CN113419818B (en) Basic component deployment method, device, server and storage medium
CN114327374A (en) Business process generation method and device and computer equipment
CN113407511A (en) Log aggregation method, log aggregation equipment and computer program product
CN113342767A (en) Log generation method, device, equipment and storage medium
CN110531984B (en) Code compiling method, device, system, computer equipment and storage medium
CN116662126A (en) RPA-based system abnormality prompting method, device, equipment and medium
CN114443294B (en) Big data service component deployment method, system, terminal and storage medium
CN113900670B (en) Cluster server application deployment system

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
GR01 Patent grant
GR01 Patent grant