Detailed Description
Reference will now be made in detail to exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numbers in different drawings refer to the same or similar elements, unless otherwise indicated. The implementations described in the following exemplary examples do not represent all implementations consistent with the invention. Rather, they are merely examples of apparatus and methods consistent with aspects of the invention as detailed in the accompanying claims.
The implementation environment of the database configuration system disclosed by the invention can be terminal equipment, such as a smart phone, a tablet computer and a desktop computer. Fig. 1 is a schematic diagram of an apparatus according to an example embodiment. The apparatus 100 may be the above-described terminal device. As shown in fig. 1, the apparatus 100 may include one or more of the following components: a processing component 102, a memory 104, a power supply component 106, a multimedia component 108, an audio component 110, a sensor component 114, and a communication component 116.
The processing component 102 generally controls overall operation of the device 100, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations, among others. The processing component 102 may include one or more processors 118 to execute instructions to perform all or part of the steps of the methods described below. Further, the processing component 102 can include one or more modules to facilitate interactions between the processing component 102 and other components. For example, the processing component 102 may include a multimedia module for facilitating interaction between the multimedia component 108 and the processing component 102.
The memory 104 is configured to store various types of data to support operations at the apparatus 100. Examples of such data include instructions for any application or method operating on the device 100. The Memory 104 may be implemented by any type of volatile or non-volatile Memory device or combination thereof, such as static random access Memory (Static Random Access Memory, SRAM), electrically erasable Programmable Read-Only Memory (ELECTRICALLY ERASABLE PROGRAMMABLE READ-Only Memory, EEPROM), erasable Programmable Read-Only Memory (Erasable Programmable Read Only Memory, EPROM), programmable Read-Only Memory (PROM), read-Only Memory (ROM), magnetic Memory, flash Memory, magnetic disk, or optical disk. Also stored in the memory 104 are one or more modules configured to be executed by the one or more processors 118 to perform all or part of the steps in the methods shown below.
The power supply assembly 106 provides power to the various components of the device 100. The power components 106 may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power for the device 100.
The multimedia component 108 includes a screen between the device 100 and the user that provides an output interface. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a touch panel. If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensor may sense not only the boundary of a touch or sliding action, but also the duration and pressure associated with the touch or sliding operation. The screen may also include an Organic LIGHT EMITTING DISPLAY (OLED for short).
The audio component 110 is configured to output and/or input audio signals. For example, the audio component 110 includes a Microphone (MIC) configured to receive external audio signals when the device 100 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may be further stored in the memory 104 or transmitted via the communication component 116. In some embodiments, the audio component 110 further comprises a speaker for outputting audio signals.
The sensor assembly 114 includes one or more sensors for providing status assessment of various aspects of the device 100. For example, the sensor assembly 114 may detect an on/off state of the device 100, a relative positioning of the assemblies, the sensor assembly 114 may also detect a change in position of the device 100 or a component of the device 100, and a change in temperature of the device 100. In some embodiments, the sensor assembly 114 may also include a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 116 is configured to facilitate communication between the apparatus 100 and other devices in a wired or wireless manner. The device 100 may access a Wireless network based on a communication standard, such as WiFi (Wireless-Fidelity). In one exemplary embodiment, the communication component 116 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, the Communication component 116 further includes a Near Field Communication (NFC) module for facilitating short range communications. For example, in the NFC module, it may be implemented based on radio frequency identification (Radio Frequency Identification, RFID) technology, infrared data Association (IrDA) technology, ultra Wideband (UWB) technology, bluetooth technology, and other technologies.
In an exemplary embodiment, the apparatus 100 may be implemented by one or more Application SPECIFIC INTEGRATED Circuits (ASICs), digital signal processors, digital signal processing devices, programmable logic devices, field programmable gate arrays, controllers, microcontrollers, microprocessors, or other electronic components for performing the methods described below.
FIG. 2 is a flowchart illustrating a database configuration method according to an exemplary embodiment. As shown in fig. 2, the method includes the following steps.
Step 210, determining a target database selected by a user.
Step 220, obtaining target system information and target version environment information of a target database from the mapping file; the mapping file stores mapping relations of database information, system information and version environment information.
In this exemplary embodiment, the database information mentioned in step 220 may include at least a database identifier having a uniqueness for identifying the database, so that acquiring the target system information and the target version environment information of the target database from the mapping file may include: and acquiring the database identification of the target database, and acquiring the target system information and the target version environment information of the target database from the mapping file according to the database identification of the target database. By implementing the method, the database identification can be utilized to realize efficient acquisition of the target system information and the target version environment information. The system information may include at least a system name and a system operating environment, and the version environment information may include at least a version number of the database.
Step 230, obtaining target configuration information of a target database from the configuration file according to the target system information and the target version environment information; the configuration file stores mapping relation of system information, version environment information and configuration information.
And step 240, outputting the target configuration information so that the user can configure the target database by using the target configuration information.
Optionally, in an exemplary embodiment, after the execution of step 240 is completed, it may further detect whether a method call instruction for the target database is received, and when the method call instruction is received, obtain the target method according to the method call instruction.
Further optionally, in this exemplary embodiment, obtaining the target method according to the above method call instruction may include:
Acquiring a first program code and a second program code which are matched with the method call instruction; the first program code is used for indicating the identification information of the target class, and the second program code is used for indicating the identification information of the target method;
The target class is obtained according to the first program code, and the target method is obtained from the target class according to the second program code.
In this exemplary embodiment, after the target method is obtained from the target class according to the second program code, whether a new class exists may be detected, and when the new class exists, whether the new class is included in the system encapsulation class library is determined, and when the new class is not included in the system encapsulation class library, the new class is included in the system encapsulation class library. By implementing the exemplary embodiment, the method class can be stored by using the system encapsulation class library, so that the user can conveniently call the method, and in addition, the method of recording the new class can realize continuous update of the system encapsulation class library.
In the exemplary embodiment, when the database creation instruction is detected, a database creation script matched with the database creation instruction can be obtained from the system script library, so that a user can quickly create a database by using the database creation script. The database creation instruction may include a database type and system information, and when the database creation instruction is detected, obtaining a database creation script matched with the database creation instruction from a system script library may include: when a database creation instruction is detected, acquiring a database type and system information indicated by the database creation instruction, determining a target version number of the database type from a database version set according to the database type and the system information, and acquiring a database creation script corresponding to the target version number of the database type from a system script library. By implementing the method, the user can realize efficient library construction operation, and the use experience of the user is further improved.
By implementing the method, the mapping file and the configuration file are preset on the system to realize the rapid acquisition of the configuration file of the target database, a user does not need to write the configuration file in the process of configuring the database, the configuration efficiency of the database can be greatly improved, the efficient acquisition of the target system information and the target version environment information can be realized, the continuous update of the system encapsulation class library can be realized by a method of recording new classes, and the efficient library establishment can be assisted by the user.
Fig. 3 is a flowchart illustrating a database configuration method according to another exemplary embodiment. As shown in fig. 3, steps 310 to 340 are the same as steps 210 to 240 shown in fig. 2, and are not repeated here, and in addition, the database configuration method in this embodiment may further include the following steps:
step 350, detecting whether an operation instruction for a target database is received, and if so, executing steps 360 to 370; if not, step 380 is performed.
In an embodiment of the present invention, the operation instruction in step 350 may be an operation for adding, deleting, updating, or querying a field of the target database.
Step 360, obtaining the target operation script matched with the operation instruction from the script file corresponding to the target database.
And step 370, controlling the target operation script to run.
Through executing steps 350-370, the operation on the operation target database can be quickly realized through the target operation script without writing sentences by a user, so that the operation efficiency on the target database can be greatly improved.
Step 380, detecting whether there is an newly added operation script for the target database, if so, executing step 390; if not, ending the journey.
Step 390, judging whether the script file contains the newly added operation script, if not, executing step 3100; if so, the process is ended.
Step 3100, writing the new operation script into a script file.
The script file may be an extensible markup language (Extensible Markup Language, xml) file, so that unified management and optimization are facilitated, and the script file corresponding to the target database may include a plurality of xml tags and an operation script set under each xml tag. Therefore, the writing the new operation script into the script file may include: obtaining an xml label corresponding to the new operation script, and writing the new operation script into an operation script set corresponding to the xml label.
Wherein, in the exemplary embodiment, a plurality of operation scripts for the target database and operation information of each operation script are stored in the script file; wherein the operation information at least comprises an operation time point of each operation and operator information of each operation. Writing the new operation script into the script file may then include: acquiring a creation time point and creator information of the newly added operation script; taking the creation time point and the creator information as operation information of a newly added operation script; writing the new operation script and the operation information of the new operation script into a script file.
It should be noted that, the operation for the operation script may include creating the operation script and calling the operation script, so the operation time point includes the creation time point of the operation script and the calling time point of the operation script, and the operator information includes the creator information of the operation script and the personnel information of each call.
The operator information may include information such as a name, a job number, and a contact manner of an operator, and optionally, in an exemplary embodiment, when an abnormality of the target database is detected, a user may input a query instruction for the operation information of the target database, when the query instruction is received, a query condition carried by the query instruction is obtained, an operation script meeting the query condition is searched for in a script file of the target database, and the operation script meeting the query condition is output for the user to perform abnormality analysis. The query conditions carried by the query instruction may be a single query condition, such as a time range or a job number of an operator, or may be a composite query condition, such as a combination of the time range and the job number of the operator. By implementing the method, the script file can be utilized to realize the efficient analysis of the database abnormality under the condition that the abnormality occurs in the target database, thereby effectively improving the processing efficiency of the abnormality of the target database.
By implementing the method, the mapping file and the configuration file are preset on the system to realize the rapid acquisition of the configuration file of the target database, a user does not need to write the configuration file in the process of configuring the database, the configuration efficiency of the database can be greatly improved, the efficient acquisition of the target system information and the target version environment information can be realized, the continuous update of the system encapsulation class library can be realized by a method of recording new classes, the efficient library establishment can be assisted by the user, the subsequent maintenance of the target database can be facilitated, the abnormal processing efficiency of the target database can be effectively improved, and the operation efficiency for the target database can be greatly improved.
The following are embodiments of the database configuration system of the present disclosure.
FIG. 4 is a block diagram illustrating a database configuration system according to an exemplary embodiment. As shown in fig. 4, the database configuration system may include:
a determining unit 401 for determining a target database selected by a user.
An obtaining unit 402, configured to obtain target system information and target version environment information of a target database from a mapping file; the mapping file stores mapping relation among database information, system information and version environment information, and obtains target configuration information of a target database from a configuration file according to the target system information and the target version environment information; the configuration file stores mapping relation of system information, version environment information and configuration information.
In this exemplary embodiment, the database information may include at least a database identifier, which has uniqueness and is used to identify the database, so the manner in which the obtaining unit 402 obtains the target system information and the target version environment information of the target database from the mapping file may specifically be:
The obtaining unit 402 is configured to obtain a database identifier of the target database, and obtain target system information and target version environment information of the target database from the mapping file according to the database identifier of the target database. By implementing the exemplary embodiment, efficient retrieval of target system information and target version environment information is achieved using database identification. The system information may include at least a system name and a system operating environment, and the version environment information may include at least a version number of the database.
And an output unit 403, configured to output the target configuration information, so that the user can implement configuration on the target database by using the target configuration information.
Optionally, in an exemplary embodiment, the output unit 403 may be further configured to detect whether a method call instruction for the target database is received after outputting the target configuration information;
the obtaining unit 402 may be further configured to obtain the target method according to the method call instruction when the method call instruction is received.
Further optionally, in this exemplary embodiment, the manner in which the obtaining unit 402 is configured to obtain, when receiving the method call instruction, the target method according to the method call instruction may specifically be:
The acquiring unit 402 is configured to acquire, when receiving the method call instruction, a first program code and a second program code that match the method call instruction; the first program code is used for indicating the identification information of the target class, and the second program code is used for indicating the identification information of the target method; and obtaining the target class according to the first program code, and obtaining the target method from the target class according to the second program code.
The obtaining unit 402 may be further configured to detect whether a new class exists after obtaining the target method from the target class according to the second program code, and determine whether the new class is included in the system encapsulation class library when the new class exists; and when the first detection unit judges that the system encapsulation class library does not contain the new class, the new class is recorded in the system encapsulation class library.
By implementing the exemplary embodiment, the method class can be stored by using the system encapsulation class library, so that the user can conveniently call the method, and in addition, the method of recording the new class can realize continuous update of the system encapsulation class library.
In another exemplary embodiment, the obtaining unit 402 may be further configured to obtain, when a database creation instruction is detected, a database creation script matched with the database creation instruction from a system script library, so that a user may use the database creation script to implement quick creation of a database. In this exemplary embodiment, the database creation instruction may include a database type and system information, and the manner for acquiring, by the acquiring unit 402, a database creation script matched with the database creation instruction from the system script library when the database creation instruction is detected may specifically be:
The obtaining unit 402 is configured to obtain, when a database creation instruction is detected, a database type and system information indicated by the database creation instruction, determine, according to the database type and the system information, a target version number of the database type from a database version set, and obtain, from a system script library, a database creation script corresponding to the target version number of the database type. By implementing the embodiment, the user can realize efficient library construction operation, and the use experience of the user is further improved.
By implementing the database configuration system, the mapping file and the configuration file are preset on the system to realize the rapid acquisition of the target database configuration file, a user does not need to write the configuration file in the process of configuring the database, the configuration efficiency of the database can be greatly improved, the efficient acquisition of the target system information and the target version environment information can be realized, the continuous update of the system encapsulation class library can be realized by a method of recording new classes, and the efficient database establishment can be assisted by the user.
Fig. 5 is a block diagram of a database configuration system, according to another example embodiment. The database configuration system shown in fig. 5 is optimized by the database configuration system shown in fig. 4, and the database configuration system shown in fig. 5 may further include:
a detection unit 404, configured to detect whether an operation instruction for the target database is received.
It should be noted that, the output unit 403 may be further configured to send a start instruction to the detection unit 404 after outputting the target configuration information, so as to trigger the detection unit 404 to execute the above operation of detecting whether the operation instruction for the target database is received.
The obtaining unit 402 may be further configured to obtain, when an operation instruction for the target database is received, a target operation script matched with the operation instruction from a script file corresponding to the target database, and control the target operation script to run.
The operation for the operation target database can be quickly realized through the target operation script, sentences are not required to be written by a user, and the operation efficiency for the target database can be greatly improved.
In this exemplary embodiment, the detecting unit 404 may be further configured to detect whether an additional operation script for the target database exists, and determine whether the additional operation script is included in the script file when the additional operation script exists; and writing the newly added operation script into the script file when judging that the script file does not contain the newly added operation script.
The script file may be an extensible markup language (Extensible Markup Language, xml) file, so that unified management and optimization are facilitated, and the script file corresponding to the target database may include a plurality of xml tags and an operation script set under each xml tag. The detection unit 404 may obtain an xml tag corresponding to the new operation script, and write the new operation script into the operation script set corresponding to the xml tag.
In this exemplary embodiment, a plurality of operation scripts for the target database and operation information of each operation script are stored in the script file; wherein the operation information at least comprises an operation time point of each operation and operator information of each operation. Therefore, when the detecting unit 404 determines that the script file does not include the new operation script, the method for writing the new operation script into the script file may specifically be:
And a detection unit 404, configured to, when it is determined that the script file does not include the new operation script, obtain a creation time point and creator information of the new operation script, use the creation time point and the creator information as operation information of the new operation script, and write the operation information of the new operation script and the new operation script into the script file.
It should be noted that, the operation for the operation script may include creating the operation script and calling the operation script, so the operation time point includes the creation time point of the operation script and the calling time point of the operation script, and the operator information includes the creator information of the operation script and the personnel information of each call.
The operator information may include information such as a name, a job number, and a contact manner of an operator, and optionally, in an exemplary embodiment, when an abnormality is detected in the target database, the user may input a query instruction for the operation information of the target database, and the detection unit 404 may be further configured to, when receiving the query instruction, obtain a query condition carried by the query instruction, search an operation script that meets the query condition from a script file of the target database, and output the operation script that meets the query condition for the user to perform abnormality analysis. The query conditions carried by the query instruction may be a single query condition, such as a time range or a job number of an operator, or may be a composite query condition, such as a combination of the time range and the job number of the operator. By implementing the exemplary embodiment, the script file can be utilized to realize the efficient analysis of the database abnormality under the condition that the abnormality occurs in the target database, thereby effectively improving the processing efficiency of the abnormality of the target database.
By implementing the database configuration system, the mapping file and the configuration file are preset on the system to realize the rapid acquisition of the target database configuration file, a user does not need to write the configuration file in the process of configuring the database, the configuration efficiency of the database can be greatly improved, the efficient acquisition of target system information and target version environment information can be realized, the continuous update of the system encapsulation class library can be realized by a method of recording new classes, the efficient library establishment can be assisted by the user, the subsequent maintenance of the target database can be facilitated, the abnormal processing efficiency of the target database can be effectively improved, and the operation efficiency of the target database can be greatly improved.
The invention also provides a terminal device, which comprises:
A processor;
And a memory having stored thereon computer readable instructions which, when executed by the processor, implement a database configuration method as previously described.
The terminal device may be the apparatus 100 shown in fig. 1.
In an exemplary embodiment, the invention also provides a computer-readable storage medium, on which a computer program is stored which, when executed by a processor, implements a database configuration method as previously indicated.
It is to be understood that the invention is not limited to the precise arrangements and instrumentalities shown in the drawings, which have been described above, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the invention is limited only by the appended claims.