Database data processing method and device, electronic equipment and storage medium

By introducing language type parameters into the database management tool, matching and executing SQL scripts with specified language types, the problem of internationalization of dictionary data is solved, and the technical effect of improving the efficiency of international application of dictionary data is achieved.

CN119719142AInactive Publication Date: 2025-03-28INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202510226393.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-27
Publication Date
2025-03-28
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing technology is difficult to achieve internationalization of dictionary data and cannot effectively process data in different locale environments.

Method used

By introducing language type parameters, the structured query language files of the specified language type are matched in the execution process of the database management tool, the corresponding SQL script is executed, and the dictionary data is processed into the specified language type.

Benefits of technology

The internationalization of dictionary data has been realized and the application efficiency of dictionary data in different language environments has been improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119719142A_ABST
    Figure CN119719142A_ABST
Patent Text Reader

Abstract

The invention discloses a data processing method and device of a database, electronic equipment and a storage medium, and relates to the technical field of management software, the method comprises the steps of introducing language type parameters, obtaining a to-be-executed structured query language file of a specified language type through language type parameter matching in an execution process of a database management tool, and storing the to-be-executed structured query language file in the database management tool; therefore, the technical problem of internationalization of the dictionary data can be solved, and the technical effect of improving the implementation efficiency of internationalization of the dictionary data is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of management software technology, and in particular to a database data processing method and device, electronic equipment and storage medium. Background Art

[0002] Artificial intelligence development platforms often need to process large amounts of data from different language environments. When performing tasks such as text classification, sentiment analysis, and machine translation, it is crucial to accurately understand the meaning of texts in different languages.

[0003] As a tool for storing key terms and concept definitions, data dictionaries provide accurate semantic support for multilingual data processing tasks. In order to enable artificial intelligence platforms to be widely used in different countries and regions and meet the language needs of different users, it is crucial to internationalize dictionary data. Summary of the invention

[0004] The present application provides a database data processing method and device, an electronic device and a storage medium, so as to at least solve the problem of internationalization of dictionary data in the related art.

[0005] The present application provides a method for processing database data, comprising: Get the target language type entered by the user; Based on the database management tool, searching for a first structured query language script matching the target language type in a structured query language file to be executed; wherein the structured query language file to be executed includes at least one structured query language script; The first structured query language script is executed to obtain dictionary data corresponding to the target language type, and the dictionary data is inserted into the target database; wherein the first structured query language script corresponds to the dictionary data one by one.

[0006] The present application also provides a database data processing device, comprising: An acquisition unit, used for acquiring a target language type input by a user; A search unit, configured to search, based on a database management tool, in a structured query language file to be executed for a first structured query language script that matches the target language type; wherein the structured query language file to be executed includes at least one structured query language script; The execution unit is used to execute the first structured query language script, obtain dictionary data corresponding to the target language type, and insert the dictionary data into the target database; wherein the first structured query language script corresponds to the dictionary data one by one.

[0007] The present application also provides an electronic device, comprising: a memory for storing a computer program; and a processor for implementing the steps of any of the above-mentioned database data processing methods when executing the computer program.

[0008] The present application also provides a computer-readable storage medium, in which a computer program is stored, wherein when the computer program is executed by a processor, the steps of any of the above-mentioned database data processing methods are implemented.

[0009] The present application also provides a computer program product, including a computer program, which implements the steps of any of the above-mentioned database data processing methods when the computer program is executed by a processor.

[0010] Through the present application, due to the introduction of the language type parameter, the structured query language file to be executed of the specified language type is obtained by matching the language type parameter in the execution process of the database management tool, so that the dictionary data can be processed into the specified language type. Therefore, the technical problem of internationalization of dictionary data can be solved, and the technical effect of improving the efficiency of implementing the internationalization of dictionary data can be achieved. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0012] Figure 1 A schematic diagram of a data processing method for a database provided in an embodiment of the present application; Figure 2 A matching logic schematic diagram provided in an embodiment of the present application; Figure 3 A schematic diagram of a processing flow of database internationalization provided in an embodiment of the present application; Figure 4 A schematic diagram of database internationalization processing provided in an embodiment of the present application; Figure 5 A schematic diagram of the structure of a data processing device for a database provided in an embodiment of the present application; Figure 6 A schematic diagram of the structure of another database data processing device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0013] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0014] It should be noted that, in the description of this application, the terms "include", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. The terms "first", "second", etc. in this application are used to distinguish similar objects, and are not used to describe a specific order or sequence.

[0015] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0016] Figure 1 A flowchart of a method for processing database data provided in an embodiment of the present application.

[0017] like Figure 1 As shown, the method comprises the following steps: Step 101: Obtain the target language type input by the user.

[0018] In some embodiments, the target language type input by the user may be obtained based on the user interaction interface, or one or more language type options may be provided to the user for selection. Specifically, the embodiment of the present application does not limit the method for obtaining the target language type.

[0019] Step 102: searching, based on a database management tool, for a first structured query language script matching the target language type in a structured query language file to be executed; wherein the structured query language file to be executed includes at least one structured query language script.

[0020] In some embodiments, the database management tool may be Flyway or other tools. The embodiment of the present application takes the database management tool Flyway as an example for explanation. However, it should be noted that this description is only an exemplary description and is not a specific limitation on the specific database management tool.

[0021] See also Figure 2 , Figure 2 A matching logic diagram provided in an embodiment of the present application, such as Figure 2As shown, Flyway obtains the target language type (i.e. Figure 2 In some embodiments, the target language type may be one or more, indicating that one or more language environments are supported at the same time. The embodiment of the present application does not limit the number of language types included in the target language type.

[0022] Match the Structured Query Language (SQL) files to be executed according to the target language type. For example, for English language type, match the files whose file names contain English language type marks; for Chinese language type, match the files whose file names contain Chinese language type marks.

[0023] In some embodiments, when the target language type includes multiple language types (such as English and Chinese at the same time), it is necessary to match and execute the corresponding SQL script for each language type separately to ensure that the script of each language type can be executed correctly and that data conflicts or repeated insertions will not occur due to different language types.

[0024] Step 103, execute the first structured query language script, obtain dictionary data corresponding to the target language type, and insert the dictionary data into the target database; wherein the first structured query language script corresponds to the dictionary data one by one.

[0025] The first SQL script is executed according to the target language type so that the dictionary data after the execution is completed conforms to the system environment of the target language type. In some embodiments, an exception handling mechanism is added during the matching and execution process. For example, if the SQL script of a certain language type does not exist, the execution of the language type is skipped and a log is recorded. If the execution of a SQL script of a certain language type fails, the execution of the current language type is interrupted and an error message is recorded.

[0026] Insert dictionary data into the target database to initialize or upgrade the database.

[0027] In the embodiment of the present application, due to the introduction of the language type parameter, the structured query language file to be executed of the specified language type is obtained by matching the language type parameter in the execution process of Flyway, and the initialization of the structured query language file to be executed of the specified language type is realized. Therefore, the technical problem of internationalization of dictionary data can be solved, and the technical effect of improving the efficiency of implementing internationalization of dictionary data can be achieved.

[0028] In some embodiments, step 102 may be performed according to the following steps: A preset algorithm is called to search for a first structured query language script matching the target language type in the structured query language file to be executed, wherein the preset algorithm is configured in a database management tool and is used to perform matching using the target language type as a matching parameter.

[0029] In some embodiments, the preset algorithm includes a core processing algorithm refresh() or other algorithms that can implement a search function. Taking core processing as an example, the core processing algorithm will accept one or more target language types. All SQL files to be executed are traversed. For the SQL script in each SQL file, the core processing algorithm will check the script name, script content or other data to determine whether the SQL script matches the input target language type.

[0030] If the SQL script matches the target language type, it is added to the list of SQL scripts to be executed; if it does not match, the SQL script is ignored and not included in the execution list.

[0031] After all SQL files are matched, only those SQL scripts that have passed the match will be executed, that is, only SQL scripts that meet the requirements of the target language type will be executed.

[0032] In a possible implementation, before step 102, the following steps are further included: Initialize the configuration information of the database management tool; wherein the configuration information includes the target database configuration and the structured query language script configuration.

[0033] Specify the location where Flyway scans SQL migration scripts. In some embodiments, the SQL script storage location of Flyway can be defined as classpath:db / migration. It should be noted that this description is only an exemplary description and is not a specific limitation on the storage location of specific scripts.

[0034] In some embodiments, if a customized script storage location is required, this can be achieved by configuring a location parameter. The embodiment of the present application does not limit the storage location of the Flyway SQL script file.

[0035] Determine the supported language environments and define a clear identifier for the language type corresponding to each language environment, such as en (for Chinese), es (for Spanish), or fr (for French). Specifically, the language type identifier can be included in the SQL script name, such as V1_create_table_en.sql, which means that the SQL script corresponds to the Chinese environment.

[0036] A second structured query language script for the dictionary data is created according to different language types.

[0037] According to different language types, a corresponding second SQL script is created. In some embodiments, the SQL script file naming rule is: V<version number>_<description>sql, such as V1_Create_user_table.sql. For example, for English, a script named V1.0_initdict_en-US.sql is created, and for Chinese, a script named V1.0_initdict_zh-CN.sql is created. These second SQL scripts are used for initialization during platform deployment or version upgrade to complete the processing of platform database data.

[0038] In some embodiments, one dictionary data may correspond to multiple second SQL scripts. For example, the dictionary data may correspond to English, Chinese, and Korean respectively. Then, the dictionary data has a second SQL script corresponding to the English type, a second SQL script corresponding to the Chinese type, and a second SQL script corresponding to the Korean type. Each second SQL script is used to process the dictionary data when the target language type is the corresponding language type. It should be noted that this description is only an exemplary description and is not a specific limitation on the number and type of languages ​​corresponding to specific dictionary data. The embodiments of the present application do not limit this.

[0039] In a possible implementation, initializing the database management tool configuration further includes: The dependency of the database management tool is introduced into the target database, and the database connection parameters of the target database are stored in the database management tool, so that the database management tool performs management on the target database according to the database connection parameters; wherein the database connection parameters include at least one of a database uniform resource locator, a user name and a password.

[0040] Introduce Flyway's dependency configuration file into the target database's build configuration file and configure Flyway's database connection parameters. At least the following parameters need to be configured: the database's uniform resource locator, the database connection user name, and the database connection password.

[0041] In some embodiments, after configuration is completed, Flyway will automatically perform database migration. If you need to manually trigger migration, you can call Flyway's application programming interface (Application Programming Interface, API) or use other command line tools. Specifically, this embodiment of the application does not limit this.

[0042] By introducing Flyway dependencies in the target database and configuring database connection parameters, you can easily achieve version control and automated migration of the target database.

[0043] In some embodiments, creating structured query language scripts according to different language types further includes: Based on the table structure of the target database, dictionary data of the corresponding language type is inserted into each second structured query language script so that the structure of the second structured query language script matches the table structure of the target database.

[0044] Dictionary data is usually a set of key-value pairs, where the key is the identifier of the data and the value is the corresponding language type description. Determine the table structure where the data will be inserted, including the table name, column name, data type, whether it is allowed to be empty, and any other constraints (such as primary key, foreign key, uniqueness, etc.).

[0045] In some embodiments, an insert statement is written using SQL statements to insert dictionary data into a database table, and the insertion can be performed based on a general SQL insert statement template; in some embodiments, the insertion method can also be determined based on actual needs, which is not limited in the embodiments of the present application.

[0046] In some embodiments, after initializing the Flyway configuration, it also includes: setting a language type parameter of a database management tool in a configuration center.

[0047] In some embodiments, the configuration center is different according to different application architectures, such as Spring Cloud Config, Apollo Configuration Center, Naming and Configuration Service (Nacos), Consul, etcd, etc. Specifically, the embodiments of the present application do not limit this.

[0048] The configuration center is used to centrally store and manage language type parameters. Define one or more parameters in the configuration center to specify the language type of Flyway. After obtaining user input or the specified target language type, Flyway reads the language type parameter in the configuration center and determines the running language environment based on the language type parameter, ensuring that Flyway can perform information exchange and operation execution in the correct language during subsequent database version control and migration.

[0049] In some embodiments, after inserting dictionary data of a corresponding language type into each second structured query language script based on the table structure of the target database, the method further includes: storing the second structured query language script in the target database.

[0050] In some embodiments, after the dictionary data of the corresponding language type is inserted into the second SQL script, the structure of the second SQL script matches the table structure of the target database, so the second SQL script can be stored in the target database.

[0051] In some embodiments, before step 102, the following steps are also included: Determine whether there is a database management tool metadata table in the target database; wherein the database management tool metadata table contains the execution progress of each second structured query language script; the execution progress includes at least one of completed execution and unexecuted; When it is determined that the database management tool metadata table exists, a second structured query language script whose execution progress is not executed in the database management tool metadata table is read to generate a structured query language file to be executed.

[0052] The Flyway metadata table stores the execution details of the SQL script corresponding to each database version change, including key information such as script identification, execution time, and execution status. This information constitutes a complete history of database version migration and provides data support for database version tracing, rollback, and incremental updates.

[0053] See also Figure 3 , Figure 3 A schematic diagram of a processing flow for database internationalization provided in an embodiment of the present application. When determining whether a Flyway metadata table exists in the database to be processed, a corresponding query mechanism can be used according to the characteristics of the database management system. For example, for a relational database, a system view or a metadata query interface is used to search for a table that complies with the Flyway metadata table naming rules in the table directory information of the database.

[0054] Specifically, conditional matching is performed on the execution status field in the metadata table to accurately locate and extract all structured query language script information marked as unexecuted.

[0055] Please continue reading Figure 3 After successfully obtaining the unexecuted SQL script information, the scripts to be executed are selected in order and executed. In some embodiments, the first SQL scripts can be arranged according to the version number, execution order and other information of the SQL scripts. Subsequently, the specific SQL statements of each first SQL script are sequentially written into a new file in the arrangement order to obtain the SQL file to be executed. The generated SQL file to be executed follows a unified format specification to ensure that it can be correctly identified and executed in different environments.

[0056] The SQL file will serve as the key input for subsequent database version migration operations, guiding the execution of each script in a predetermined order.

[0057] Please continue reading Figure 3 In some embodiments, if it is determined that the database management tool metadata table does not exist, a database management tool metadata table is created.

[0058] The specific method of creating the Flyway metadata table may vary depending on the database management system (DBMS) used, such as a relational database (such as a MySQL database, a PostgreSQL database), etc. Specifically, this embodiment of the application does not limit this.

[0059] For relational databases, when Flyway detects that the Flyway metadata table does not exist, it creates the Flyway metadata table based on the SQL statements preset in the target database. These preset SQL statements are designed according to the database syntax specifications and can ensure that the metadata table structure that meets Flyway's requirements is created. The following example is used to illustrate: During the creation process, Flyway will use the configured database connection parameters to send a request to create a metadata table to the target database. After receiving the request, the target database will create a table named "flyway_schema_history" according to the definition of the SQL statement, and define various fields, such as "installed_rank" (used to record the order of SQL script execution), "version" (SQL script version number), "description" (SQL script description information), "type" (SQL script type), "script" (SQL script file name), "checksum" (SQL script checksum), "installed_by" (the user who executes the SQL script), "installed_on" (SQL script execution time), "execution_time" (SQL script execution time), "success" (a sign of whether the SQL script is successfully executed), etc. It should be noted that this description is only an exemplary description and is not a specific limitation on a specific metadata table.

[0060] For some non-relational databases, Flyway cannot directly create metadata tables because their data storage and management methods are different from those of relational databases. Developers need to manually design and create metadata tables based on the working principle of Flyway and metadata recording requirements. For example, you can use the document storage function provided by the database to create a document collection specifically for storing version migration information, and store the execution information of each SQL script in the collection in the form of a document.

[0061] After the Flyway metadata table is created, you need to verify and confirm to ensure that the table is created successfully and the structure meets the requirements. You can connect to the database through the database management tool to check whether there is a metadata table with the specified name and check whether the field definition of the table is consistent with your expectations. In addition, you can also write a simple SQL query statement to try to query data from the metadata table.

[0062] In some embodiments, before step 103, the following step is also included: adding the first structured query language script to the to-be-executed list.

[0063] In some embodiments, a to-be-executed list is created to store the matched first SQL script. The to-be-executed list may be arranged in a first-in-first-out manner or in order of version numbers. Specifically, this embodiment of the present application does not limit this.

[0064] In some embodiments, if a certain SQL script has been executed, the SQL script is skipped to avoid repeated execution; if a certain SQL script has not been executed, it is matched.

[0065] In some embodiments, step 103 further includes: executing the first structured query language script in the to-be-executed list in the order in which the first structured query language script is stored, obtaining dictionary data corresponding to the target language type, and inserting the dictionary data into the target database; wherein the first structured query language script corresponds to the dictionary data one by one.

[0066] In some embodiments, if there are multiple language-type SQL scripts, the execution priority can be determined according to business needs; for example, if you want to prioritize the execution of a certain language-type SQL script, you can put the SQL script of that language-type in the front when matching. The execution order can also be determined according to the version number of the SQL script (which can be reflected in the name); for example, if there are both V1 and V2 versions, V1 version will be executed first.

[0067] In some embodiments, creating the second SQL scripts for dictionary data according to different language types also includes: generating suffixes of the second structured query language scripts corresponding to the different language types; the structured query language files of different language type parameters have different suffixes. Step 102 also includes: Based on the database management tool, a first structured query language script whose suffix of the second structured query language script matches the target language type is searched in the second structured query language script to be executed.

[0068] In international scenarios, in order to meet the data processing requirements in different language environments, specific suffixes are usually set for SQL files of different language types. When a database operation needs to be performed, the SQL script that matches the current language environment can be matched from the many SQL files to be executed based on the specific language type parameters.

[0069] Different language type parameters correspond to different SQL script suffixes. For example, for an English environment, the file suffix can be en-US; for a Chinese environment, the file suffix can be zh-CN. This association is set to quickly and accurately identify SQL scripts related to a specific language environment among a large number of SQL files. It should be noted that this description is only an exemplary description and is not a limitation on specific suffixes, and the embodiments of the present application do not limit this.

[0070] Please continue reading Figure 2 ,like Figure 2 As shown in the figure, before matching the SQL file, you first need to read the language type parameter (that is, the target language type). When performing database operations, the value of the parameter is read from the specified configuration location. For example, in a Spring Boot-based project, you can set the flyway.lang parameter through the configuration file, and Flyway will read this parameter at runtime to obtain the currently required language type.

[0071] For each SQL script traversed, the suffix part of its SQL script name is extracted and matched with the language type parameter read. The specific matching logic is to check whether the SQL script name contains the same suffix as the language type parameter. For example, if the language type parameter is zh-CN, the system will search for files with the zh-CN suffix in the file name.

[0072] If the suffix of a SQL script matches the language type parameter successfully, then the SQL script will be matched and used as a SQL script that conforms to the current language environment. Conversely, if the SQL script suffix does not match the language type parameter, then the SQL script will be excluded from the current execution scope. In this way, the system can accurately match the SQL script related to the current language environment from a large number of SQL scripts, ensuring that the target database is operated according to specific language requirements.

[0073] The qualified SQL scripts obtained after matching will be used for subsequent database operations. In some embodiments, Flyway will execute these scripts in sequence according to the version number or execution order of the scripts to complete the initialization or upgrade of the database. In this way, in different language environments, the database can accurately process and store data in the corresponding language, realizing the internationalization of database operations. In this way, it can be ensured that the database can accurately execute the corresponding SQL scripts in different language environments to meet diverse business needs.

[0074] See also Figure 4 , Figure 4 A schematic diagram of database internationalization processing provided in an embodiment of the present application is as follows: Figure 4 As shown, it includes: configuration center service, which is used to introduce Flyway dependency in the target database. Here is the implementation of Flyway integration based on springboot, and configures the connection parameters between Flyway and the target database and the SQL script storage location in the target database.

[0075] The SQL script definition module creates and manages corresponding SQL scripts according to the language types of different language environments. These SQL scripts are used to initialize dictionary data in different language environments and to define SQL statements that meet the database initialization requirements of different versions.

[0076] The basic module configures the global language types corresponding to different language environments in the cluster configuration center. After the user determines or specifies the target language type parameters, the target language type of the configuration center is introduced in the business module through the flyway.lang parameter and passed to Flyway for execution.

[0077] Execution module: Flyway selects and executes the corresponding SQL script from the script storage location according to the obtained target language type.

[0078] The embodiment of the present application optimizes the Flyway execution process, introduces the language type, and optimizes the Flyway execution process, so that during the Flyway execution process, according to the target language type, the SQL script with the specified language parameter suffix is ​​filtered as the first SQL script to initialize or upgrade the database.

[0079] The dictionary data application module is used to read the dictionary data and display the dictionary data after initialization according to different language types.

[0080] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method.

[0081] The embodiment of the present application also provides a data processing device for a database, Figure 5 A schematic diagram of a data processing device for a database provided in an embodiment of the present application is shown in FIG. Figure 5 As shown, including: An acquisition unit 21 is used to acquire a target language type input by a user; The searching unit 22 is used to search, based on a database management tool, for a first structured query language script matching the target language type in a structured query language file to be executed; wherein the structured query language file to be executed records unexecuted structured query language scripts, and the structured query language file to be executed contains at least one structured query language script; The execution unit 23 is used to execute the first structured query language script, obtain dictionary data corresponding to the target language type, and insert the dictionary data into the target database; wherein the first structured query language script corresponds to the dictionary data one by one.

[0082] Due to the introduction of the language type parameter, the structured query language file to be executed of the specified language type is obtained by filtering through the language type parameter in the execution process of the database management tool, so that the dictionary data can be processed into the specified language type. Therefore, the technical problem of realizing the internationalization of dictionary data can be solved, and the technical effect of improving the efficiency of realizing the internationalization of dictionary data can be achieved.

[0083] Furthermore, in a possible implementation of the embodiment of the present application, as Figure 6 As shown, the search unit 22 is also used for: A preset algorithm is called to search for a first structured query language script matching the target language type in the structured query language file to be executed, wherein the preset algorithm is configured in a database management tool and is used to perform matching using the target language type as a matching parameter.

[0084] Furthermore, in a possible implementation of the embodiment of the present application, as Figure 6 As shown, the device also includes: The processing unit 24 is used to initialize the configuration information of the database management tool before the search unit 22 searches for the first structured query language script matching the target language type in the structured query language file to be executed based on the database management tool; wherein the configuration information includes the target database configuration and the structured query language script configuration; The first creating unit 25 is used to create second structured query language scripts of dictionary data according to different language types.

[0085] Furthermore, in a possible implementation of the embodiment of the present application, the processing unit 24 is further configured to: The dependency of the database management tool is introduced into the target database, and the database connection parameters of the target database are stored in the database management tool, so that the database management tool performs management on the target database according to the database connection parameters; wherein the database connection parameters include at least one of a database uniform resource locator, a user name and a password.

[0086] Furthermore, in a possible implementation of the embodiment of the present application, the first creating unit 25 is further configured to: Based on the table structure of the target database, dictionary data of the corresponding language type is inserted into each second structured query language script so that the structure of the second structured query language script matches the table structure of the target database.

[0087] Furthermore, in a possible implementation of the embodiment of the present application, as Figure 6 As shown, the device also includes: The first storage unit 26 is configured to store the second structured query language script in the target database after the first creation unit 25 inserts dictionary data of a corresponding language type into each second structured query language script based on the table structure of the target database.

[0088] Furthermore, in a possible implementation of the embodiment of the present application, as Figure 6 As shown, the device also includes: The determining unit 27 is used to determine whether there is a database management tool metadata table in the target database before the searching unit 22 searches for the first structured query language script matching the target language type in the structured query language file to be executed based on the database management tool; wherein the database management tool metadata table includes the progress of each second structured query language script; the execution progress includes at least one of execution completion and non-execution; The reading unit 28 is used to read the second structured query language script whose execution progress is not executed in the database management tool metadata table when it is determined that the database management tool metadata table exists, and generate a structured query language file to be executed.

[0089] Furthermore, in a possible implementation of the embodiment of the present application, as Figure 6 As shown, the device also includes: The second creating unit 29 is configured to create a database management tool metadata table if it is determined that the database management tool metadata table does not exist after the determining unit 27 determines whether the database management tool metadata table exists in the target database.

[0090] Furthermore, in a possible implementation of the embodiment of the present application, as Figure 6 As shown, the device also includes: The second storage unit 210 is used for executing the first structured query language script in the execution unit 23 to obtain dictionary data corresponding to the target language type, and before inserting the dictionary data into the target database, adding the first structured query language script to the to-be-executed list; The execution unit 23 is also used for: The first structured query language script is executed according to the storage order of the first structured query language script in the to-be-executed list to obtain dictionary data corresponding to the target language type, and the dictionary data is inserted into the target database.

[0091] Furthermore, in a possible implementation of the embodiment of the present application, the first creating unit 25 is further configured to: The suffixes of the second structured query language scripts corresponding to the different language types are generated.

[0092] Furthermore, in a possible implementation of the embodiment of the present application, the searching unit 22 is further configured to: Based on the database management tool, a first structured query language script whose suffix of the second structured query language script matches the target language type is searched in the second structured query language script to be executed.

[0093] For the description of the features in the embodiment corresponding to the data processing device of the database, reference can be made to the relevant description of the embodiment corresponding to the data processing method of the database, which will not be described in detail here.

[0094] An embodiment of the present application further provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any of the above-mentioned database data processing method embodiments.

[0095] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above-mentioned database data processing method embodiments when running.

[0096] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.

[0097] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps in any of the above-mentioned database data processing method embodiments are implemented.

[0098] An embodiment of the present application also provides another computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in any of the above-mentioned XX method embodiments are implemented.

[0099] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0100] The above is a detailed introduction to the data processing method and device, electronic device and storage medium of a database provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and core idea of ​​the present application. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the claims of the present application.

Claims

1. A method for processing data in a database, characterized in that: include: Get the target language type entered by the user; Based on a database management tool, searching for a first structured query language script matching the target language type in a structured query language file to be executed; wherein the structured query language file to be executed includes at least one structured query language script; The first structured query language script is executed to obtain dictionary data corresponding to the target language type, and the dictionary data is inserted into a target database; wherein the first structured query language script corresponds to the dictionary data one by one.

2. The method for processing database data according to claim 1, characterized in that: The step of searching, based on the database management tool, for a first structured query language script matching the target language type in a structured query language file to be executed comprises: A preset algorithm is called to search the first structured query language script matching the target language type in the structured query language file to be executed, wherein the preset algorithm is configured in the database management tool and is used to perform matching with the target language type as a matching parameter.

3. The method for processing database data according to claim 1, characterized in that: Before searching the structured query language file to be executed for a first structured query language script matching the target language type based on the database management tool, the method further includes: Initializing the configuration information of the database management tool; wherein the configuration information includes the target database configuration and the structured query language script configuration; A second structured query language script of the dictionary data is created according to different language types.

4. The method for processing database data according to claim 3, characterized in that: The configuration information for initializing the database management tool also includes: The dependency of the database management tool is introduced into the target database, and the database connection parameters of the target database are stored in the database management tool, so that the database management tool performs management of the target database according to the database connection parameters; wherein the database connection parameters include at least one of a database uniform resource locator, a user name and a password.

5. The method for processing database data according to claim 4, characterized in that: The second structured query language script for creating the dictionary data according to different language types also includes: Based on the table structure of the target database, dictionary data of a corresponding language type is inserted into each of the second structured query language scripts, so that the structure of the second structured query language script matches the table structure of the target database.

6. The method for processing database data according to claim 5, characterized in that: After inserting dictionary data of a corresponding language type into each of the second structured query language scripts based on the table structure of the target database, the method further includes: The second structured query language script is stored in the target database.

7. The method for processing database data according to claim 3, characterized in that: Before searching the structured query language file to be executed for a first structured query language script matching the target language type based on the database management tool, the method further includes: Determine whether there is a database management tool metadata table in the target database; wherein the database management tool metadata table contains the execution progress of each second structured query language script; the execution progress includes at least one of completed execution and unexecuted; When it is determined that the database management tool metadata table exists, a second structured query language script whose execution progress is not executed in the database management tool metadata table is read to generate the structured query language file to be executed.

8. The method for processing database data according to claim 7, characterized in that: After determining whether a database management tool metadata table exists in the target database, the method further includes: If it is determined that the database management tool metadata table does not exist, the database management tool metadata table is created.

9. The method for processing database data according to claim 1, characterized in that: Before executing the first structured query language script to obtain dictionary data corresponding to the target language type and inserting the dictionary data into the target database, the method further includes: Adding the first structured query language script to a to-be-executed list; The executing the first structured query language script to obtain dictionary data corresponding to the target language type and inserting the dictionary data into the target database comprises: The first structured query language script is executed according to the storage order of the first structured query language script in the to-be-executed list to obtain dictionary data corresponding to the target language type, and the dictionary data is inserted into the target database.

10. The method for processing database data according to claim 7, characterized in that: The second structured query language script for creating the dictionary data according to different language types includes: The corresponding suffixes of the second structured query language scripts are generated based on the different language types.

11. The method for processing database data according to claim 10, characterized in that: The step of searching, based on the database management tool, for a first structured query language script matching the target language type in a structured query language file to be executed comprises: The database management tool is called to search the second structured query language script to be executed for the first structured query language script whose suffix of the second structured query language script matches the target language type.

12. A data processing device for a database, characterized in that: include: An acquisition unit, used for acquiring a target language type input by a user; A searching unit, configured to search, based on a database management tool, in a structured query language file to be executed for a first structured query language script that matches the target language type; wherein the structured query language file to be executed includes at least one structured query language script; The execution unit is configured to execute the first structured query language script, obtain dictionary data corresponding to the target language type, and insert the dictionary data into a target database; wherein the first structured query language script corresponds to the dictionary data one by one.

13. An electronic device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the database data processing method according to any one of claims 1 to 11 when executing the computer program.

14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the steps of the database data processing method according to any one of claims 1 to 11.

15. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method for processing database data according to any one of claims 1 to 11 are implemented.

Citation Information

Patent Citations

  • Structured query statement detection method and device, equipment and medium

    CN117216095A

  • Data exporting method and related device

    CN117370308A

  • International information retrieval method and device, electronic equipment and readable storage medium

    CN117743498A

  • Method and device for constructing SQL (Structured Query Language) editor

    CN118484200A