Automatic database construction method and device, electronic equipment and computer readable medium
By extracting data semantics and generating interface configuration in automatic database construction, the automatic construction and optimization of database and interface are solved, and the problem of time-consuming and resource consumption of adjustment operations after database construction is solved, improving construction efficiency and security.
Patent Information
- Application Number
- CN202411778733.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-05
- Publication Date
- 2025-03-28
- Estimated Expiration
- 2044-12-05
AI Technical Summary
After the database is automatically built, it is necessary to re-regulate fields, data table adjustments and other adjustment operations according to the needs of different users, resulting in extended construction cycle, increased resource consumption, and difficulty in connecting to the database operation interface, which is prone to data storage errors, which leads to data resource leakage.
By receiving database construction requests issued by the user terminal, data semantic extraction is performed, database construction configuration files and database interface configuration information are generated, database construction and interface configuration information are automatically constructed based on these configuration files, database structure is optimized, and data detection module is established based on preset data detection scripts, and database operation interface deployment files are sent to user terminal.
It reduces the consumption of database resources, reduces the risk of data resource leakage, improves the efficiency and accuracy of database construction, and avoids docking errors caused by separate construction of database and database interfaces.
Smart Images

Figure CN119719071A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present disclosure relate to the field of database technology, and in particular to a method, device, electronic device, and computer-readable medium for automatically constructing a database. Background Art
[0002] A database is a data warehouse used to store data. At present, when establishing automatic database construction, the commonly used method is to build the database through a construction script set by a programmer.
[0003] However, in practice, it is found that when the above method is used to build a database, the following technical problems often occur:
[0004] After the database is automatically built, it is necessary to readjust the fields and data tables according to the needs of different users. This not only takes a longer construction cycle, but also consumes more database resources. At the same time, it is difficult to connect to the database operation interface, and data storage errors are prone to occur, thus leading to data resource leakage.
[0005] The above information disclosed in this Background section is only for enhancement of understanding of the background of the inventive concept and therefore it may contain information that does not form the prior art that is already known in this country to a person of ordinary skill in the art. Summary of the invention
[0006] The content of this disclosure is used to introduce concepts in a brief form, which will be described in detail in the detailed implementation section below. The content of this disclosure is not intended to identify the key features or essential features of the technical solution claimed for protection, nor is it intended to limit the scope of the technical solution claimed for protection.
[0007] Some embodiments of the present disclosure propose a method, device, electronic device and computer-readable medium for automatically constructing a database to solve the technical problems mentioned in the above background technology section.
[0008] In a first aspect, some embodiments of the present disclosure provide a method for automatically building a database, the method comprising: in response to receiving a database building request sent by a user through a user terminal, performing data semantic extraction on the above-mentioned database building request to generate a database building configuration file and database interface configuration information, wherein the above-mentioned database building configuration file includes a database type identifier, a data table type identifier and a field name list required for building the database; based on the above-mentioned database building configuration file, automatically building the database to obtain a constructed database, wherein the automatic database building process includes building a corresponding database according to the above-mentioned database type identifier, setting up a data table in the database according to the above-mentioned data table type identifier and establishing corresponding field names in the data table; based on the above-mentioned database interface configuration information, establishing a database operation interface corresponding to the above-mentioned optimized database, wherein the above-mentioned database operation interface includes a method for performing data operations; performing data structure optimization on the above-mentioned constructed database to generate an optimized database, and establishing a data detection module corresponding to the above-mentioned optimized database according to a preset data detection script; sending the deployment file corresponding to the above-mentioned database operation interface to the user terminal to complete the automatic construction of the database.
[0009] In a second aspect, some embodiments of the present disclosure provide a database automatic construction device, the device comprising: a data semantic extraction unit, configured to perform data semantic extraction on the database construction request in response to receiving a database construction request sent by a user through a user terminal, so as to generate a database construction configuration file and a database interface configuration information, wherein the database construction configuration file comprises a database type identifier, a data table type identifier and a field name list required for constructing the database; a database construction unit, configured to perform database automatic construction based on the database construction configuration file to obtain a constructed database, wherein the database automatic construction process comprises constructing a corresponding database according to the database type identifier, constructing a data table in the database according to the data table type identifier, and establishing corresponding field names in the data table; an interface construction unit, configured to establish a database operation interface corresponding to the optimized database based on the database interface configuration information, wherein the database operation interface comprises a data operation; a data structure optimization unit, configured to perform data structure optimization on the constructed database to generate an optimized database, and to establish a data detection module corresponding to the optimized database according to a preset data detection script; a sending unit, configured to send the deployment file corresponding to the database operation interface to the user terminal to complete the database automatic construction.
[0010] In a third aspect, some embodiments of the present disclosure provide an electronic device comprising: one or more processors; a storage device on which one or more programs are stored, and when the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any implementation manner of the above-mentioned first aspect.
[0011] In a fourth aspect, some embodiments of the present disclosure provide a computer-readable medium having a computer program stored thereon, wherein when the program is executed by a processor, the method described in any implementation manner of the above-mentioned first aspect is implemented.
[0012] The above-mentioned various embodiments of the present disclosure have the following beneficial effects: through the database automatic construction method of some embodiments of the present disclosure, the consumption of database resources can be reduced and the leakage of data resources can be greatly reduced. Specifically, the reason for the need to consume more database resources and the leakage of data resources is that after the database is automatically constructed, it is necessary to re-adjust the fields and data tables according to the needs of different users. Therefore, it not only takes a longer construction cycle, but also consumes more database resources. At the same time, it is difficult to connect to the database operation interface, and data storage errors are prone to occur, thereby causing data resource leakage. Based on this, the database automatic construction method of some embodiments of the present disclosure, first, by receiving a database construction request issued by a user terminal, can be used to start the automatic construction of the database. Here, through data semantic extraction, the demand information of the database that the user needs to build can be extracted from the database construction request, and a database construction configuration file and a database interface configuration information can be established. As a result, the constructed database can greatly meet the user's needs and reduce the situation of re-adjusting the database after construction. Then, based on the above-mentioned database construction configuration file, the database is automatically constructed to obtain the constructed database. Based on the above-mentioned database interface configuration information, a database operation corresponding to the above-mentioned optimized database is established
[0013] In this way, not only can the automatic construction of the database be completed, but also the automatic construction of the database operation interface can be completed according to the generated database interface configuration information. In this way, a complete database system is built. Also, because the database and the database operation interface can be constructed at the same time according to user information, data parameters can be synchronized. Thus, the docking errors existing in the separate construction of the database and the database interface can be greatly avoided. Then, by optimizing the data structure of the constructed database, the operating efficiency of the database can be further improved, and the jamming and large memory usage can be reduced. The purpose of reducing database resource consumption is achieved. At the same time, the leakage of database resources is greatly avoided. Finally, the deployment file corresponding to the above-mentioned database operation interface can be sent to the user terminal for download and installation by the user terminal to complete the automatic construction of the database. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and that components and elements are not necessarily drawn to scale.
[0015] Figure 1 is a flowchart of some embodiments of the method for automatically constructing a database according to the present disclosure;
[0016] Figure 2 It is a schematic diagram of the structure of some embodiments of the automatic database construction device according to the present disclosure;
[0017] Figure 3 It is a schematic diagram of the structure of an electronic device suitable for implementing some embodiments of the present disclosure. DETAILED DESCRIPTION
[0018] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments set forth herein. On the contrary, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0019] It should also be noted that, for ease of description, only the parts related to the invention are shown in the drawings. In the absence of conflict, the embodiments and features in the embodiments of the present disclosure can be combined with each other.
[0020] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0021] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0022] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0023] With regard to the collection, storage, and use of user data involved in this disclosure, before performing the corresponding operations, the relevant organizations or individuals shall fulfill their obligations, including conducting personal information security impact assessments, fulfilling the obligation to inform the personal information subject, and obtaining the authorization and consent of the personal information subject in advance.
[0024] The present disclosure will be described in detail below with reference to the accompanying drawings and in conjunction with embodiments.
[0025] Figure 1 The process 100 of some embodiments of the method for automatically constructing a database according to the present disclosure is shown. The method for automatically constructing a database includes the following steps:
[0026] Step 101 , in response to receiving a database building request sent by a user through a user terminal, extracting data semantics from the database building request to generate a database building configuration file and database interface configuration information.
[0027] In some embodiments, the execution subject of the database automatic construction method can perform data semantic extraction on the database construction request in response to receiving a database construction request issued by a user through a user terminal to generate a database construction configuration file and database interface configuration information. The database construction configuration file may include a database type identifier, a data table type identifier, and a field name list required to construct the database. The database construction request is text data issued by the user.
[0028] In practice, the database building request can be audio data or text data.
[0029] In the process of adopting technical solutions to solve the problems mentioned in the background technology, the following technical problem 2 is often accompanied: since the construction requirements of the database, the construction requirements of the data table, the table fields, and the construction requests of the table structure are all in one text, the keywords are relatively messy, making it difficult to extract specific keywords, and it is difficult to distinguish the relationship between the keywords in the database construction, resulting in the missing of the constructed database structure (for example, the lack of data tables, the lack of key fields, etc.), or even construction errors. As a result, more computing resources need to be consumed to re-identify keywords for database construction. In response to the above technical problem 2, the inventor decided to adopt the following solution:
[0030] Optionally, the database construction request may include database construction description information and management interface description information. And the data semantic extraction of the database construction request to generate a database construction configuration file and database interface configuration information may include the following steps:
[0031] In the first step, first-category construction request keywords are extracted from the database construction description information in the above database construction request to obtain a first-category construction request keyword set. The first-category request keyword in the above first-category request keyword set may be an identifier that characterizes the database type. Here, the database type may include but is not limited to at least one of the following: a relational database, a non-relational database, and a key-value database.
[0032] In practice, if the database construction description information is audio data, the audio data can be converted into text data through a speech recognition algorithm (or a large language model). Then, the text data can be recognized by a preset large language model or text recognition algorithm to extract text words about database type, database access address, port number, user name and user password from the text as the first type of construction request keywords.
[0033] As an example, the text recognition algorithm may include but is not limited to at least one of the following: a CTC (Connectionist Temporal Classification) algorithm for sequence data annotation, and a CRNN (Convolutional Recurrent Neural Network) algorithm.
[0034] The second step is to delete the text corresponding to the first type of construction request keyword set to obtain the deleted description information. The text sentence containing each first type of construction request keyword in the first type of construction request keyword set can be deleted from the database construction description information.
[0035] The third step is to extract data table information from the above-mentioned description information after deletion to obtain a data table information set. The data table information in the above-mentioned data table information set may include data table type and data field group. Here, the data table type may include but is not limited to at least one of the following: relational table, object table type, temporary table type, partition table type, view table type, index organization table type, external table type, etc. The data field may include but is not limited to at least one of the following: item serial number, item name, item sales, item value, item transfer value, item inventory, etc.
[0036] As an example, the data table information may be extracted by a preset text word extraction algorithm. For example, the text word extraction algorithm may include but is not limited to at least one of the following: a bag-of-words model, a RAKE (Rapid Automatic Keyword Extraction, keyword extraction) algorithm.
[0037] The fourth step is to select a database template that matches the above-mentioned first-category construction request keyword set from the preset database template library, and fill the above-mentioned data table information set into the configuration file corresponding to the matching database template to generate a database construction configuration file. Among them, each database template in the preset database template library corresponds to a unique identifier. Secondly, a unique identifier that matches the first-category construction request keyword that characterizes the database type can be selected from the database template to select the database template corresponding to the unique identifier. In addition, the database template includes the code framework required for database settings. Therefore, the first-category construction request keywords that characterize information such as database access address, port number, user name and user password can be matched to the corresponding position in the form of key-value pairs for filling. Thus, a database construction configuration file is obtained.
[0038] Step 5: extract the second type of construction request keywords from the management interface description information in the above database construction request to obtain a second type of construction request keyword set. The second type of request keywords in the above second type of request keyword set may be identifiers that characterize database interface functions. The second type of construction request keywords may be extracted from the management interface description information in the above database construction request by the above text recognition algorithm to obtain the second type of construction request keyword set.
[0039] As an example, the second type of construction request keywords may be, but are not limited to, at least one of the following: "add data", "delete data", "modify data", "query data", "data statistics" and other related words. Here, by selecting the second type of construction request keywords, it can be used to automatically determine the interface functions required by the database interface, so as to build a database operation interface that meets user needs.
[0040] In the sixth step, according to the database identifier corresponding to the above database construction configuration file, a database interface template component matching the database identifier and the above second type construction request keyword set is selected from the preset database interface template library. Among them, the database interface template library may include a plurality of pre-set database interface panels. Different database interface panels have different functions or interface styles. Secondly, each second type construction request keyword in the database construction configuration file can correspond to a database identifier respectively, so as to select a database interface template with the same identifier.
[0041] The seventh step is to determine the interface configuration files corresponding to each database interface template component as database interface configuration information.
[0042] The above seven steps and their related contents, as an inventive point of the embodiment of the present disclosure, solve the above technical problem 2: "Since the construction requirements of the database, the construction requirements of the data table, the table fields, and the construction requests of the table structure are all in one text, the keywords are relatively messy, it is difficult to extract specific keywords, and it is difficult to distinguish the relationship between the keywords in the database construction, which leads to the missing of the constructed database structure (for example, the lack of data tables, the lack of key fields, etc.), or even the construction error. As a result, it is necessary to consume more computing resources to re-identify the keywords for database construction." The factors that lead to the need to consume more computing resources to re-identify the keywords for database construction are often as follows: Since the construction requirements of the database, the construction requirements of the data table, the table fields, and the construction requests of the table structure are all in one text, the keywords are relatively messy, it is difficult to extract specific keywords, and it is difficult to distinguish the relationship between the keywords in the database construction, which leads to the missing of the constructed database structure (for example, the lack of data tables, the lack of key fields, etc.), or even the construction error. If the above factors are solved, the number of database reconstructions can be reduced, so as to reduce the consumption of computing resources. In order to achieve this effect, first of all, considering the problem that keywords are difficult to distinguish, the core keywords are first extracted. For example, extract the first type of construction request keywords. This can be used to locate information such as the type of database to be constructed. Because this type of information text is short and has obvious features, it is easy to extract. Therefore, it is also possible to preferentially extract the construction of the overall framework of the database, such as selecting a database template. Then, by deleting the text corresponding to the first type of construction request keywords, the text length can be reduced, interference items can be reduced, and the word frequency of other keywords can be increased. Therefore, it is convenient to extract the data table information. Therefore, the accuracy of data table information extraction can be improved. In addition, because different types of keywords are extracted separately, the connection characteristics between keywords can also be strengthened. Therefore, the association relationship between each keyword can be located in combination with the database template. Therefore, it can be used to accurately construct the required database. In addition, the keywords corresponding to the database management interface required by the user can be determined by the management interface description information. Therefore, it is convenient to select a matching template from the database interface template component for the construction of the database management interface. At the same time, because the database interface template components are all matched with the database corresponding to the first type of construction request keywords, the conflict between the database and the database management interface can be avoided. Therefore, it can be used to quickly build a database, reduce the number of database reconstructions, and reduce the consumption of computing resources.
[0043] Optionally, after receiving the database building request sent by the user through the user terminal, the above execution subject may further perform the following steps:
[0044] The first step is to send a list display link and a data saving interface to the above user terminal. The list display link can be a link address for displaying an initial configuration file. The data saving interface can be an interface for transmitting data to a database on the server side. Here, the database configuration file for building a database can be obtained through the list display link.
[0045] The second step is to read the above database configuration file to determine the data table generation data and data fields in the above database configuration file. The data table generation data may include but is not limited to at least one of the following: data table type, data table generation parameters, data table generation script, and operation interface construction script.
[0046] The third step is to use a preset function configuration algorithm to add corresponding field functions and data formats to each data field. The function configuration algorithm may be an algorithm for adding field functions to a data field. For example, an automatic update field function may be added to a data field.
[0047] In the fourth step, in response to determining that the data generated by the data table is configuration data, a data table is constructed according to the data generated by the data table. Among them, whether it is configuration data can be determined according to the data table type. Secondly, first, a data table can be constructed using a data table generation script. Then, a script for constructing an operation interface can be used to construct an operation interface. Here, the operation interface can include a list interface and an editing interface of the data table. Finally, a data table access interface can be generated for data retrieval. Thus, the construction of the database is completed.
[0048] In step 5, in response to determining that the data generated by the data table is non-configuration data, a fixed data table is constructed for data storage. First, a pre-set fixed data table can be used as the constructed data table. Second, a fixed interface corresponding to the fixed data table can be used as an operation interface. At the same time, an access interface of the fixed data table can be associated with the operation interface.
[0049] Step 102, based on the database construction configuration file, automatically construct the database to obtain a constructed database.
[0050] In some embodiments, the execution subject may automatically construct a database based on the database construction configuration file to obtain a constructed database. The automatic database construction process may include constructing a corresponding database according to the database type identifier, building a data table in the database according to the data table type identifier, and establishing corresponding field names in the data table.
[0051] In some optional implementations of some embodiments, the above-mentioned database construction configuration file may include a database creation script file and a data table creation script file set. And the above-mentioned execution subject automatically constructs the database based on the above-mentioned database construction configuration file to obtain the constructed database, which may include the following steps:
[0052] The first step is to run the database creation script file in the above database construction configuration file to create an initial database. The above database construction configuration file can automatically build a database to create an initial database by running.
[0053] The second step is to run the data table creation script files in the data table creation script file set in the initial database environment to create data tables and obtain a constructed database.
[0054] Step 103: Based on the database interface configuration information, a database operation interface corresponding to the optimized database is established.
[0055] In some embodiments, the execution entity may establish a database operation interface corresponding to the optimized database based on the database interface configuration information.
[0056] In some optional implementations of some embodiments, the execution subject establishes a database operation interface corresponding to the optimized database based on the database interface configuration information, which may include the following steps:
[0057] The first step is to allocate interface positions for each interface configuration file included in the above database interface configuration information according to the preset interface construction conditions to generate an interface allocation data group. Among them, the interface construction conditions can be pre-set rule conditions for typesetting interface components. Secondly, the interface allocation data in the interface allocation data group can be the interface position area coordinates corresponding to each database template. Here, the interface configuration file can be a code file for interface display. For example, (Hyper Text Markup Language) is a markup language file used to create web pages.
[0058] As an example, the interface construction condition may include but is not limited to at least one of the following: the condition of layout according to the preset section order, the condition of limiting the area size of each interface section, etc. Here, the interface position allocation is to layout the database template corresponding to each configuration file according to the interface construction condition to obtain an interface allocation data group.
[0059] The second step is to determine the database access address corresponding to each interface configuration file included in the above database interface configuration information. The database access address can be extracted from the database interface configuration information.
[0060] The third step is to integrate the interface configuration files and the corresponding database access addresses included in the above-mentioned database interface configuration information according to the above-mentioned interface allocation data group to generate an overall interface configuration file. First, according to the interface allocation data in the interface allocation data group, the data of each interface configuration file included in the database interface configuration information can be adjusted. That is, the parameters of the interface display area in the interface configuration file are adjusted. Here, the database interface framework can be a code file for interface construction. Then, the adjusted interface configuration file can be written into the database interface framework to generate an overall interface configuration file.
[0061] The fourth step is to run the above-mentioned overall interface configuration file to generate a database operation interface. Among them, running the above-mentioned overall interface configuration file can be used to display the database operation interface on the display terminal. In addition, the interface can be refined or rendered manually or in other automated ways through the display. For example, the page style can be adjusted.
[0062] Step 104, optimizing the data structure of the constructed database to generate an optimized database, and establishing a data detection module corresponding to the optimized database according to a preset data detection script.
[0063] In some embodiments, the execution subject may optimize the data structure of the constructed database to generate an optimized database, and establish a data detection module corresponding to the optimized database according to a preset data detection script. The database detection module may be a module for detecting operation data during database operation.
[0064] In the process of adopting technical solutions to solve the problems mentioned in the background technology, the following technical problem three is often accompanied: the automatically constructed database often lacks data detection means, which easily leads to data leakage, storage, data adjustment and other failures, or causes the data structure to be more complicated, resulting in more computing resources being occupied during data operations. At the same time, there are more loopholes in the automatically constructed database, and it is difficult to be detected in time. In response to the above technical problem three, the inventor decided to adopt the following solution:
[0065] In some optional implementations of some embodiments, the execution subject optimizes the data structure of the constructed database to generate an optimized database, including:
[0066] The first step is to input the pre-acquired user test data into the above-mentioned constructed database, and generate a query test instruction set based on the above-mentioned user test data.
[0067] The above user test data is generated through the following steps:
[0068] Step 1: Obtain user entity data. User entity data may be actual stored data of the user. For example, it may include but is not limited to at least one of the following: user name, user ID, user item number, user item inventory, user item sales, and other attributes and corresponding attribute values.
[0069] Step 2: Match the data fields of the above user entity data to generate a matched data set. The entity data fields can be extracted from the preset position in the user entity data. Then, the corresponding fields in the data table of the constructed database are matched. If no match is found, fields can be added to the data table. Finally, the user entity data is divided into different matched data according to the fields to obtain a matched data set.
[0070] Step 3: Perform data fuzzification on the above matched data set to generate user test data. The data fuzzification can be a random transformation of the data. Here, the random transformation can be a random transformation of each parameter in the data. For example, if the user ID is "123", then the random transformation can be a random transformation of all three numbers. For example, the transformation results in "456". In addition, if it is coded data, the data position can be swapped.
[0071] In practice, in order to avoid the difficulty in measuring the actual data storage effect in the subsequent data detection process due to insufficient data, during the data fuzzification process, it is necessary to limit the data storage amount after data processing to be greater than or equal to the data storage amount before processing.
[0072] Optionally, the query test instruction set can be generated in the following manner: First, each field corresponding to the user test data can be filled into the preset data query instruction to obtain the query test instruction. Here, the preset data query instruction is generated based on the commonly used data query instruction. For example, it can include instructions such as data query, data modification, data deletion, multi-table joint query, multi-field joint query, etc. Thus, the query test instruction set can be obtained.
[0073] The second step is to perform multiple data queries through the query test instruction set and record the query information to obtain a query information set. Each query information in the query information set includes query duration, query results and query cache occupancy, and each data query corresponds to a data query information in the query information set.
[0074] The third step is to adjust the query cache parameters of the constructed database according to the query cache occupancy of each query information in the query information set. If the average of each query cache occupancy is greater than a preset threshold, the query cache parameters can be adjusted upward to expand the query cache occupancy. If the average of each query cache occupancy is less than the preset threshold, the query cache parameters can be adjusted downward based on the maximum query cache occupancy.
[0075] The fourth step is to optimize the query commands corresponding to the above-mentioned constructed database according to the query duration included in each query information in the above-mentioned query information set, and synchronize each query command to the above-mentioned database operation interface. Among them, query commands with query durations greater than the preset duration threshold can be used as high-consumption type commands. And each high-consumption type command can be stored and displayed on the interface to remind the user. Secondly, query commands with query durations less than the preset duration threshold can be used as command prompts and synchronized to the above-mentioned database operation interface for user use.
[0076] In step 5, in response to determining that the query information in the query information set includes a query result indicating a query failure, the mapping relationship between the data table and the field corresponding to the query test instruction corresponding to the query information in the constructed database is adjusted to obtain an optimized database. Different adjustment methods may correspond to different query failure situations.
[0077] As an example, the adjustment method may include but is not limited to at least one of the following: field type optimization, vertical table partitioning, horizontal table partitioning, table partitioning, database partitioning, adjusting field indexes (adjusting primary keys, foreign keys, etc. of fields in data tables), resetting query commands (for example, re-querying, querying after splitting query commands, reducing wildcard queries, reducing the use of select query functions), updating query permissions, adjusting data query types, etc.
[0078] In some other optional implementations of some embodiments, the execution subject establishes a data detection module corresponding to the optimized database according to a preset data detection script, including:
[0079] The first step is to select the data fields to be detected from each data table of the above optimized database to obtain a set of data fields to be detected. Among them, the data fields to be detected are sensitive data fields. Here, the data fields to be detected can be selected from each data table of the above optimized database through a sensitive word recognition algorithm to obtain a set of data fields to be detected.
[0080] As an example, the sensitive word recognition algorithm may include but is not limited to at least one of the following: a DFA (Deterministic Finite Automaton) algorithm, a Trie dictionary tree algorithm, and the like.
[0081] The second step is to add each data field to be detected in the above-mentioned data field set to the corresponding position in the above-mentioned data detection script to obtain the added detection script. Among them, the data detection script can be a script file for data detection, and the position corresponding to the data field to be detected in the script file can be empty or a placeholder. Thus, the data field to be detected that needs to be detected can be added to the corresponding position in the above-mentioned data detection script to obtain the added detection script.
[0082] The third step is to establish a user-side detection operating environment, and add the above-mentioned added script to the above-mentioned detection operating environment to obtain a data detection module. The above-mentioned data detection module is deployed on the user terminal. When the user uploads the data to be stored through the user terminal, according to the transmission instruction input by the user, the data information corresponding to each data field to be detected is extracted to perform data detection. Data detection may include but is not limited to at least one of the following detection steps: data encryption detection, data anomaly detection. Here, data encryption detection can be used to detect whether the data is encrypted. Data anomaly detection can be used to detect whether the data has abnormal conditions.
[0083] Specifically, a user-side detection operating environment can be established through a preset data security detection tool. Secondly, the added script can be deployed in the user-side detection operating environment. Finally, the image file of the user-side detection operating environment can be determined as a data detection module. For sending to the user terminal for security detection deployment.
[0084] As an example, the data security detection tool may include but is not limited to at least one of the following: Checkmarx static application security testing tool, Burp Suite dynamic application security detection tool.
[0085] The fourth step is to package the data files corresponding to the above data detection module, the database connection information and the data files of the database operation interface into a deployment file corresponding to the above database operation interface.
[0086] The above step 104 and its related contents are an inventive point of an embodiment of the present disclosure, which solves the above technical problem three "the automatically constructed database often lacks the means of data detection, which easily leads to data leakage, storage, data adjustment and other failures, or causes the data structure to be more complicated, resulting in more computing resources being occupied during data operation. At the same time, the automatically constructed database is prone to more loopholes and is difficult to be detected in time". The factors that cause the database to be stored with more loopholes and occupy more computing resources during the storage process are often as follows: the automatically constructed database often lacks the means of data detection, which easily leads to data leakage, storage, data adjustment and other failures, or causes the data structure to be more complicated, resulting in more computing resources being occupied during data operation. At the same time, the automatically constructed database is prone to more loopholes and is difficult to be detected in time. If the above factors are solved, the database loopholes can be reduced, the data processing efficiency can be improved, and the consumption of computing resources can be reduced. In order to achieve this effect, first, the database storage performance is tested by introducing the user's entity data. Here, in order to avoid user information leakage, data processing is also performed through fuzzy processing. In particular, in order to make the test process more in line with the actual user's use process, the reduction of data volume is avoided during the fuzzy processing process. Then, the data is stored in the database through the pre-matched data field to record the stored data. In order to perform data testing, query statements in different formats are also pre-set as data query instructions to facilitate testing the computing resource consumption of the database under different circumstances. Therefore, by comparing the query cache occupancy corresponding to different data query instructions, the query cache parameters of the database can be adjusted to meet the user's usage needs. In this way, the consumption of computing resources is reduced. Then, by comparing the query duration corresponding to different data query instructions, it can also be used to provide users with feedback on the efficiency of data query instructions in querying data under the current database environment. In this way, a more convenient and fast database query method can be provided to users. In this way, the database operation performance can be further improved and the consumption can be reduced. Finally, by locating the query failure, the mapping relationship of the data table or field in the database is modified in a targeted manner to reduce the consumption of computing resources again and avoid the query failure. In addition, by detecting sensitive fields in the database, a data detection module is established in a targeted manner. In order to facilitate data supervision and prevention of data operation vulnerabilities.
[0087] Step 105: Send the deployment file corresponding to the database operation interface to the user terminal to complete the automatic construction of the database.
[0088] In some embodiments, the execution subject may send the deployment file corresponding to the database operation interface to the user terminal to complete the automatic construction of the database. The user terminal may open the data operation interface and deploy the data monitoring module according to the deployment file. At the same time, the data operation interface and the data monitoring module are run according to the database connection information to complete the automatic construction of the database.
[0089] Optionally, the above database can be used to store data by following the steps below:
[0090] The first step is to, in response to receiving the data to be stored sent by the database operation interface, perform data detection on the data to be stored by the data detection module.
[0091] In the second step, in response to the data detection being passed, the data to be stored is stored in a data table specified by the user.
[0092] The above-mentioned various embodiments of the present disclosure have the following beneficial effects: through the database automatic construction method of some embodiments of the present disclosure, the consumption of database resources can be reduced and the situation of data resource leakage can be greatly reduced. Specifically, the reason for the need to consume more database resources and the leakage of data resources is that after the database is automatically constructed, it is necessary to re-adjust the fields and data tables according to the needs of different users. Therefore, it not only takes a longer construction cycle, but also consumes more database resources. At the same time, it is difficult to connect to the database operation interface, and data storage errors are prone to occur, thereby causing data resource leakage. Based on this, the database automatic construction method of some embodiments of the present disclosure, first, by receiving a database construction request sent by a user terminal, can be used to start the automatic construction of the database. Here, through data semantic extraction, the demand information of the database to be constructed by the user can be extracted from the database construction request, and a database construction configuration file and a database interface configuration information can be established. As a result, the constructed database can greatly meet the user's needs and reduce the situation of re-adjusting the database after construction. Then, based on the above-mentioned database construction configuration file, the database is automatically constructed to obtain the constructed database. Based on the above-mentioned database interface configuration information, a database operation interface corresponding to the above-mentioned optimized database is established. Thus, not only can the automatic construction of the database be completed, but also the automatic construction of the database operation interface can be completed according to the generated database interface configuration information. In this way, the construction of a complete database system is formed. Also, because the database and the database operation interface can be constructed simultaneously according to the user information, the data parameters can be synchronized. Thus, the docking errors existing in the separate construction of the database and the database interface can be greatly avoided. Then, by optimizing the data structure of the constructed database, the operating efficiency of the database can be further improved, and the jamming and large memory usage can be reduced. The purpose of reducing database resource consumption is achieved. At the same time, the leakage of database resources is greatly avoided. Finally, the deployment file corresponding to the above-mentioned database operation interface can be sent to the user terminal for downloading and installation by the user terminal to complete the automatic construction of the database.
[0093] Further references Figure 2 As an implementation of the methods shown in the above figures, the present disclosure provides some embodiments of a database automatic construction device. These device embodiments are similar to Figure 1 Corresponding to the method embodiments shown, the device can be specifically applied to various electronic devices.
[0094] like Figure 2As shown, the automatic database construction device 200 of some embodiments includes: a data semantic extraction unit 201, a database construction unit 202, an interface construction unit 203, a data structure optimization unit 204 and a sending unit 205. The data semantic extraction unit 201 is configured to perform data semantic extraction on the database construction request in response to receiving a database construction request sent by a user through a user terminal, so as to generate a database construction configuration file and a database interface configuration information, wherein the database construction configuration file includes a database type identifier, a data table type identifier and a field name list required for constructing the database; the database construction unit 202 is configured to automatically construct the database based on the database construction configuration file to obtain a constructed database, wherein the automatic database construction process includes constructing a corresponding database according to the database type identifier, building a data table in the database according to the data table type identifier, and establishing corresponding field names in the data table; the interface construction unit 203 is configured to establish a database operation interface corresponding to the optimized database based on the database interface configuration information, wherein the database operation interface includes a data operation; the data structure optimization unit 204 is configured to optimize the data structure of the constructed database to generate an optimized database, and establish a data detection module corresponding to the optimized database according to a preset data detection script; the sending unit 205 is configured to send the deployment file corresponding to the database operation interface to the user terminal to complete the automatic construction of the database.
[0095] It is understood that the units described in the device 200 are similar to those described in the reference Figure 1 Therefore, the operations, features and beneficial effects described above for the method are also applicable to the device 200 and the units included therein, and will not be described in detail here.
[0096] Reference below Figure 3 , which shows a structural schematic diagram of an electronic device (eg, a computing device) 300 suitable for implementing some embodiments of the present disclosure. Figure 3 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0097] like Figure 3As shown, the electronic device 300 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 301, which can perform various appropriate actions and processes according to a program stored in a read-only memory 302 or a program loaded from a storage device 308 into a random access memory 303. Various programs and data required for the operation of the electronic device 300 are also stored in the random access memory 303. The processing device 301, the read-only memory 302, and the random access memory 303 are connected to each other via a bus 304. An input / output interface 305 is also connected to the bus 304.
[0098] Typically, the following devices may be connected to the I / O interface 305: input devices 306 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 307 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 308 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 309. The communication devices 309 may allow the electronic device 300 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 3 The electronic device 300 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead. Figure 3 Each block shown in the figure may represent one device, or may represent multiple devices as required.
[0099] In particular, according to some embodiments of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, some embodiments of the present disclosure include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In some such embodiments, the computer program can be downloaded and installed from the network through the communication device 309, or installed from the storage device 308, or installed from the read-only memory 302. When the computer program is executed by the processing device 301, the above-mentioned functions defined in the method of some embodiments of the present disclosure are executed.
[0100] It should be noted that the computer-readable medium recorded in some embodiments of the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In some embodiments of the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In some embodiments of the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0101] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (Hyper Text Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.
[0102] The computer-readable medium may be included in the electronic device; or it may exist independently without being assembled into the electronic device. The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device: in response to receiving a database construction request sent by a user through a user terminal, extract data semantics from the database construction request to generate a database construction configuration file and database interface configuration information, wherein the database construction configuration file includes a database type identifier, a data table type identifier and a field name list required for building a database; based on the database construction configuration file, automatically build a database to obtain a constructed database, wherein the database automatic construction process includes building a corresponding database according to the database type identifier, building a data table in the database according to the data table type identifier, and establishing corresponding field names in the data table; based on the database interface configuration information, establish a database operation interface corresponding to the optimized database, wherein the database operation interface includes a method for performing data operations; optimize the data structure of the constructed database to generate an optimized database, and establish a data detection module corresponding to the optimized database according to a preset data detection script; send the deployment file corresponding to the database operation interface to the user terminal to complete the automatic construction of the database.
[0103] Computer program code for performing the operations of some embodiments of the present disclosure may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0104] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0105] The units described in some embodiments of the present disclosure may be implemented by software or by hardware. The described units may also be provided in a processor, for example, may be described as: a processor including a data semantic extraction unit, a database construction unit, an interface construction unit, a data structure optimization unit and a sending unit. Among them, the names of these units do not constitute a limitation on the units themselves in certain cases, for example, the data structure optimization unit may also be described as "a unit for optimizing the data structure of a constructed database to generate an optimized database".
[0106] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0107] The above descriptions are only some preferred embodiments of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the embodiments of the present disclosure is not limited to the technical solutions formed by a specific combination of the above-mentioned technical features, but should also cover other technical solutions formed by any combination of the above-mentioned technical features or their equivalent features without departing from the above-mentioned inventive concept. For example, the above-mentioned features are replaced with the technical features with similar functions disclosed in the embodiments of the present disclosure (but not limited to) and the technical solutions formed.
Claims
1. A method for automatically building a database, comprising: In response to receiving a database construction request sent by a user through a user terminal, performing data semantic extraction on the database construction request to generate a database construction configuration file and database interface configuration information, wherein the database construction configuration file includes a database type identifier, a data table type identifier, and a field name list required for building a database; Based on the database construction configuration file, the database is automatically constructed to obtain a constructed database, wherein the database automatic construction process includes constructing a corresponding database according to the database type identifier, building a data table in the database according to the data table type identifier, and establishing corresponding field names in the data table; Based on the database interface configuration information, establishing a database operation interface corresponding to the optimized database, wherein the database operation interface includes a function for performing data operations; Optimizing the data structure of the constructed database to generate an optimized database, and establishing a data detection module corresponding to the optimized database according to a preset data detection script; The deployment file corresponding to the database operation interface is sent to the user terminal to complete the automatic construction of the database.
2. The method according to claim 1, wherein: The database stores data through the following steps: In response to receiving the data to be stored sent by the database operation interface, performing data detection on the data to be stored by the data detection module; In response to the data detection being passed, the data to be stored is stored in a data table specified by the user.
3. The method according to claim 1, wherein: The database construction configuration file includes a database creation script file and a data table creation script file set; as well as The step of automatically constructing a database based on the database construction configuration file to obtain a constructed database includes: Run the database creation script file in the database construction configuration file to create an initial database; The data table creation script files in the data table creation script file set are run in the initial database environment to create data tables and obtain a constructed database.
4. The method according to claim 3, wherein: The step of establishing a database operation interface corresponding to the optimized database based on the database interface configuration information includes: According to the preset interface construction conditions, interface positions are allocated to each interface configuration file included in the database interface configuration information to generate an interface allocation data group; Determine the database access address corresponding to each interface configuration file included in the database interface configuration information; According to the interface allocation data group, each interface configuration file and the corresponding database access address included in the database interface configuration information are integrated to generate an overall interface configuration file; Run the overall interface configuration file to generate a database operation interface.
5. The method according to claim 1, wherein: The step of establishing a data detection module corresponding to the optimized database according to a preset data detection script includes: Selecting a data field to be detected from each data table of the optimized database to obtain a data field set to be detected, wherein the data field to be detected is a sensitive data field; Adding each data field to be detected in the data field set to be detected to a corresponding position in the data detection script to obtain a detection script after addition; Establishing a user-side detection operating environment, and adding the added script to the detection operating environment to obtain a data detection module, wherein the data detection module is deployed in the user terminal, and when the user uploads the data to be stored through the user terminal, according to the transmission instruction input by the user, extracts the data information corresponding to each data field to be detected to perform data detection, and the data detection includes at least one of the following: data encryption detection, data anomaly detection; The data files corresponding to the data detection module, the database connection information and the data files of the database operation interface are packaged into a deployment file corresponding to the database operation interface.
6. A database automatic construction device, comprising: A data semantic extraction unit is configured to, in response to receiving a database construction request sent by a user through a user terminal, perform data semantic extraction on the database construction request to generate a database construction configuration file and database interface configuration information, wherein the database construction configuration file includes a database type identifier, a data table type identifier and a field name list required for building a database; A database construction unit is configured to automatically construct a database based on the database construction configuration file to obtain a constructed database, wherein the automatic database construction process includes constructing a corresponding database according to the database type identifier, building a data table in the database according to the data table type identifier, and establishing corresponding field names in the data table; An interface building unit is configured to establish a database operation interface corresponding to the optimized database based on the database interface configuration information, wherein the database operation interface includes a data operation interface; A data structure optimization unit is configured to optimize the data structure of the constructed database to generate an optimized database, and to establish a data detection module corresponding to the optimized database according to a preset data detection script; The sending unit is configured to send the deployment file corresponding to the database operation interface to the user terminal to complete the automatic construction of the database.
7. An electronic device comprising: one or more processors; a storage device having one or more programs stored thereon, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 5.
8. A computer readable medium having a computer program stored thereon, wherein: When the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Database deployment method and device, computer readable storage medium and electronic equipment
CN116340294A
Database operation and maintenance method and device, equipment, storage medium and program product
CN116450619A
Method and system for computer-based processing of a database containing information about consumer products
EP1903490A1
Methods and systems for collecting, managing, and sharing data
WO2014092697A1