WO2022227566A1 - 一种数据库变更脚本的评估方法及装置 - Google Patents

一种数据库变更脚本的评估方法及装置 Download PDF

Info

Publication number
WO2022227566A1
WO2022227566A1 PCT/CN2021/134646 CN2021134646W WO2022227566A1 WO 2022227566 A1 WO2022227566 A1 WO 2022227566A1 CN 2021134646 W CN2021134646 W CN 2021134646W WO 2022227566 A1 WO2022227566 A1 WO 2022227566A1
Authority
WO
WIPO (PCT)
Prior art keywords
sql
script
change script
sql change
change
Prior art date
Application number
PCT/CN2021/134646
Other languages
English (en)
French (fr)
Inventor
陈泽昊
Original Assignee
深圳前海微众银行股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳前海微众银行股份有限公司 filed Critical 深圳前海微众银行股份有限公司
Publication of WO2022227566A1 publication Critical patent/WO2022227566A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/242Query formulation
    • G06F16/2433Query languages
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Definitions

  • Embodiments of the present invention relate to the field of financial technology (Fintech), and in particular, to a method and apparatus for evaluating a database change script.
  • Fetech financial technology
  • the embodiments of the present invention provide a method and device for evaluating a database change script, which are used to solve the problem of low evaluation efficiency caused by relying on operation and maintenance personnel to evaluate the change impact of the SQL change script in the prior art.
  • an embodiment of the present invention provides a method for evaluating a database change script, including:
  • a first strategy for optimizing the sql change script is matched from a preset strategy library; the preset strategy library stores the analysis result information and a strategy corresponding to the analysis result information.
  • the solution can automatically obtain the status information of the database table associated with the target change object, and analyze the impact results of the status information of the database table, so as to automatically and accurately determine that the sql change script is changing.
  • the first analysis result information generated at the time. Based on the first analysis result information, the first strategy for optimizing the SQL change script can be matched from the preset strategy library in time.
  • this solution can avoid excessive manual intervention, and help reduce the time and manpower spent on manually evaluating the impact of changes in SQL change scripts, thereby improving the efficiency of evaluating the impact of changes in SQL change scripts. Further, the problem of low evaluation efficiency caused by relying on operation and maintenance personnel to evaluate the change impact of the SQL change script in the prior art can be solved, and the problem of different evaluation accuracy caused by different manual experience in the prior art can be solved. In addition, since this solution can automatically optimize the SQL change script based on the first strategy, compared with manual evaluation and optimization, the knowledge threshold required for evaluation and optimization can be greatly reduced, and it is more secure and reliable.
  • determining whether the sql change script is executable according to word analysis rules includes:
  • the sql change script is grammatically analyzed by using grammatical analysis rules to determine whether the sql change script complies with the grammatical rules, so as to determine whether the sql change script is executable.
  • the lexical analysis is performed on the sql change script based on the lexical analysis rule, and each keyword in the sql change script is determined, including:
  • the vocabulary is determined as a keyword.
  • the hash value matching by means of hash value matching, it can be quickly determined whether the vocabulary in the SQL change script is a keyword without manual judgment, thereby improving the evaluation efficiency of the change impact of the SQL change script.
  • the hash value of the vocabulary can be directly compared with the hash values of multiple keywords without recalculating the hash values of the keywords each time. , which can improve the efficiency of data processing.
  • the grammatical analysis is performed on the sql change script based on the keywords, using grammatical analysis rules to determine whether the sql change script complies with the grammatical rules, including:
  • each keyword in the sql change script as a parameter for building a syntax parse tree to determine whether a syntax parse tree can be constructed
  • the parsing tree can be constructed quickly, and it can be determined whether the constructed parsing tree conforms to the syntax rules, so that the sql change script can be accurately determined. Is the syntax correct, so as to further determine whether the sql change script is executable.
  • the status information of the database table includes at least one of the following: capacity, number of rows, primary key information, index information, access request status, and the influence scope of the target change object.
  • determining the first analysis result information generated by changing the sql change script according to the state information of the database table including:
  • the influence result information and the prediction result information are determined as the first analysis result information.
  • the sub-state information can be timely and accurately generated.
  • Corresponding impact result information can be determined timely and accurately based on the memory neural network model.
  • the state information of the database table is predicted based on the memory neural network model, and the prediction result information is determined, including:
  • the database table access hot spot information at the current moment in the state information of the database table into the memory neural network model for analysis and prediction, and determine the time period when the access volume of the database table is at a low point after the current moment;
  • the time period is used as the change period when the SQL change script makes changes in the database.
  • the time period when the access volume of the database table is at a low point after the current moment can be accurately determined, which can facilitate the sql change script.
  • timely and effective changes are made in the database, so that the database table cannot be accessed when the SQL change script is changed during the non-access trough period, so as to ensure that the database table can be accessed normally, and can ensure The business system can operate normally.
  • the method further includes:
  • a second strategy for optimizing the sql change script is matched from the preset strategy library.
  • a second strategy for optimizing the sql change script can be directly matched from the preset strategy library based on the second analysis result information, so that the sql change script can be optimized in time.
  • a first strategy for optimizing the sql change script is matched from a preset strategy library, including:
  • the sql change script is optimized.
  • the matching degree can be determined more quickly, and it is convenient to determine whether the strategy corresponding to the matching degree is the first strategy in a timely manner, thereby. It is convenient to optimize the sql change script based on the first strategy in a timely and accurate manner.
  • an embodiment of the present invention also provides an apparatus for evaluating a database change script, including:
  • the receiving unit is used to receive the structured query language sql change script for the database
  • a processing unit configured to determine whether the sql change script is executable according to the word analysis rule; if executable, obtain the state information of the database table associated with the target change object based on the target change object in the sql change script ; According to the status information of the database table, determine the first analysis result information generated by the sql change script when changing; The first strategy of the sql change script; the preset strategy library stores the analysis result information and the strategy corresponding to the analysis result information.
  • an embodiment of the present invention provides a computing device, including at least one processor and at least one memory, wherein the memory stores a computer program, and when the program is executed by the processor, the processing is performed.
  • the server executes the method for evaluating a database change script described in any of the above first aspects.
  • an embodiment of the present invention provides a computer-readable storage medium, which stores a computer program executable by a computing device, and when the program runs on the computing device, causes the computing device to execute the above-mentioned first A method of evaluating a database change script of any of the aspects.
  • FIG. 1 is a schematic diagram of an evaluation system architecture of a database change script provided by an embodiment of the present invention
  • FIG. 2 is a schematic flowchart of a method for evaluating a database change script according to an embodiment of the present invention
  • FIG. 3 is a schematic structural diagram of a Trie tree provided by an embodiment of the present invention.
  • FIG. 4 is a schematic diagram of a state machine of a sql lexical analysis provided by an embodiment of the present invention.
  • FIG. 5 is a schematic diagram of constructing a parse tree according to an embodiment of the present invention.
  • FIG. 6 is a schematic diagram of analyzing and predicting a database table access hotspot situation by using the Lstm algorithm according to an embodiment of the present invention
  • FIG. 7 is a schematic process diagram of a full-text indexing algorithm provided by an embodiment of the present invention.
  • FIG. 8 is a schematic diagram of a syntax tree formed based on A, B, and C according to an embodiment of the present invention.
  • FIG. 9 is a schematic diagram of storing a newly created index according to an embodiment of the present invention.
  • FIG. 10 is a schematic structural diagram of a device for evaluating a database change script provided by an embodiment of the present invention.
  • FIG. 11 is a schematic structural diagram of a computing device according to an embodiment of the present invention.
  • Database It is a collection of some associated tables.
  • a table is a matrix of data.
  • a table in a database looks like a simple spreadsheet.
  • a column (data element) contains the same type of data, such as zip code data.
  • a row (tuple or record) is a group of related data, such as a piece of data subscribed by a user.
  • Primary key The primary key is unique, and a data table can only contain one primary key, which can be used to query data.
  • Index Use the index to quickly access specific information in the database table.
  • An index is a structure that sorts the values of one or more columns in a database table. A catalogue similar to a book.
  • sql command Structured Query Language (sql), is a special-purpose programming language, a database query and programming language, used to access data and query, update and manage relational database systems .
  • MySQL is a relational database management system and an associative database management system, which stores data in different tables.
  • the system structure shown in FIG. 1 is used as an example to describe the evaluation system architecture of the database change script applicable to the embodiments of the present invention.
  • the evaluation system architecture of the database change script can be applied to evaluate and optimize the SQL change statement submitted by the operation and maintenance personnel.
  • the evaluation system architecture of the database change script may include an evaluation optimization platform 100 and a target database system 200 .
  • the evaluation and optimization platform 100 may include a receiving module 101 , a syntax analysis module 102 , an impact analysis module 103 , an instruction optimization module 104 and a database state collection module 105 .
  • the receiving module 101 is configured to receive the database sql change script submitted by the operation and maintenance personnel, and submit the database sql change script to the syntax analysis module 102 . At the same time, it also includes the function of returning information, which can return the SQL execution result or SQL optimization strategy to the operation and maintenance personnel.
  • the syntax analysis module 102 is used to receive the sql change script submitted by the module 101, and analyze the sql change script through a pre-defined artificial intelligence natural language syntax analysis model, judge the grammatical correctness of the sql change script, and then judge the sql change script Whether the change script can be successfully executed in a database (such as a MySQL database). If it is determined that it cannot be executed successfully, the sql change script and the influence result of the unsuccessful execution of the sql change script are submitted to the instruction optimization module 104, a correct syntax optimization strategy is given, and finally returned to the operation and maintenance personnel. If it is determined that it can be successfully executed, the SQL change script will be submitted to the impact analysis module 103, so as to analyze and predict the impact that the SQL change script may cause during the change.
  • a database such as a MySQL database
  • the impact analysis module 103 is configured to receive the sql change script submitted by the syntax analysis module 102, and perform analysis and prediction in combination with the database table state collected from the target database system 200 by the collection module. Therefore, the impact analysis module 103 is mainly divided into two major functions, analysis and prediction. Among them, the analysis function will judge the impact results that will inevitably be produced after the SQL change script is changed according to the real-time status information of the database table in the collection results, and the prediction function will be based on the collected database table access status, combined with the Lstm algorithm (Long Short-Term Memory, long-term and short-term memory network), and then predict the future access status of the database table, and finally predict the possible impact of changing the sql change script at a certain time in the future.
  • Lstm algorithm Long Short-Term Memory, long-term and short-term memory network
  • the impact analysis module will submit the impact results and the SQL change script to the instruction optimization module 104, and provide the SQL change script optimization strategy with the lowest impact risk, and finally return it to the operation and maintenance Personnel; for SQL change scripts with low risk of analysis and prediction, or SQL change scripts that have no impact on the database, they will be finally submitted to the target database system 200 for modification.
  • the instruction optimization module 104 is configured to receive the sql change script and the impact result submitted from the syntax analysis module 102 or the impact analysis module 103 . Then, according to the pre-set strategy library, a full-text indexing algorithm is used to perform matching retrieval, and finally an optimization strategy for the SQL change script is given, which is submitted to the receiving module 101 and returned to the operation and maintenance personnel. At the same time, the analysis/prediction/execution results of this SQL will be put into the knowledge base, so as to evaluate and optimize the platform 100 for self-growth and learning.
  • the database state collection module 105 is used to collect the running state information of the database table in real time. For example, collect database cpu usage, disk I/O utilization, number of tcp network connections, capacity of database table, primary key/index information of database table, number of database table rows involved in changed fields, and database table access of target database system 200 Status information such as frequency.
  • FIG. 1 the structure shown in FIG. 1 above is only an example, which is not limited in this embodiment of the present invention.
  • FIG. 2 exemplarily shows a flow of a method for evaluating a database change script provided by an embodiment of the present invention, and the flow may be executed by an apparatus for evaluating a database change script.
  • the process specifically includes:
  • Step 201 receiving a structured query language sql change script for the database.
  • Step 202 determine whether the sql change script is executable.
  • Step 203 if executable, acquire the status information of the database table associated with the target change object based on the target change object in the sql change script.
  • Step 204 Determine, according to the state information of the database table, first analysis result information generated by the SQL change script when the change is made.
  • Step 205 Based on the first analysis result information, match a first strategy for optimizing the sql change script from a preset strategy library; the preset strategy library stores the analysis result information and the corresponding strategy.
  • the sql change script may be the operation and maintenance personnel to change the sql script in the original database system according to the actual application scenario (such as adding or reducing index conditions, increasing or reducing time limit, and adding or reducing data display fields, etc.)
  • the resulting change script may also be that one or several sql scripts in the database system often report errors during the execution process or the execution waits for a long time, etc., then the operation and maintenance personnel will modify one or several sql scripts in the database system according to the actual situation.
  • a change script formed by making adjustments may also be a change script generated in other forms, which is not limited in this embodiment of the present invention.
  • the operation and maintenance personnel need to detect whether the SQL change script can be successfully executed in the database system, and determine the impact results of the SQL change script when it is changed in the database system (for example, during the change process It may lead to inaccessibility of database tables, increase in database disk I/O load pressure, etc.), and then optimize the SQL change script based on the impact results. Therefore, the generated SQL change script needs to be submitted to the data receiving module in the evaluation and optimization platform, so that the evaluation and optimization platform can evaluate and optimize the SQL change script.
  • the syntax analysis module in the evaluation and optimization platform analyzes the sql change script according to the word analysis rule, and determines whether the sql change script is executable. If it is determined that the sql change script is executable, submit the sql change script to the impact analysis module in the evaluation and optimization platform, and the impact analysis module obtains the target change from the database state acquisition module in the evaluation and optimization platform based on the target change object in the SQL change script Status information for the database table associated with the object.
  • the status information of the database table includes at least one of the following: capacity, number of rows, primary key information, index information, access request status, and the influence scope of the target change object.
  • lexical analysis is performed on the SQL modification script based on the lexical analysis rules, and each keyword in the SQL modification script is determined. Then, based on each keyword, the sql change script is grammatically analyzed by using the grammatical analysis rules to determine whether the sql change script conforms to the grammatical rules, so as to determine whether the sql change script is executable. If it is determined that the sql change script is executable, the sql change script is submitted to the impact analysis module in the evaluation and optimization platform.
  • each vocabulary in the sql change script may be determined through the constructed keyword search tree. Then, for each vocabulary, it is determined whether there is a keyword equal to the hash value of the vocabulary in the keyword database. If present, the vocabulary is determined as a keyword. If it does not exist, it is determined that the word is not a keyword.
  • the keyword library may include keywords such as select, from, and where, and hash values corresponding to each keyword. In this way, by means of hash value matching, it can be quickly determined whether the vocabulary in the SQL change script is a keyword without manual judgment, so that the evaluation efficiency of the change impact of the SQL change script can be improved.
  • the hash value of the vocabulary can be directly compared with the hash values of multiple keywords without recalculating the hash values of the keywords each time. , which can improve the efficiency of data processing.
  • the sql change script is "select*from tableA;" words such as select and from can be found through the constructed keyword search tree, and select, from and other words can be obtained through the get_hash_symbol() function in the lexical analyzer. The hash value of words such as from. Then, the hash values of the words such as select and from are respectively matched with the hash values of each keyword in the preset keyword database. If the matching is successful, the word can be determined as a keyword.
  • the syntax parse tree it may be determined whether the syntax parse tree can be constructed by using each keyword in the sql change script as a parameter for constructing the syntax parse tree according to the syntax analysis rule. If so, determine that the syntax of the SQL change script is correct; otherwise, determine that the syntax of the SQL change script is incorrect.
  • the parsing tree can be constructed quickly, and it can be determined whether the constructed parsing tree conforms to the syntax rules, so as to accurately determine whether the syntax of the sql change script is correct. Correct, in order to further determine whether the sql change script is executable, so as to avoid the fault of the database caused by the wrong sql change script during the change.
  • the impact analysis module in the evaluation and optimization platform can determine the first analysis result information generated when the SQL change script is changed according to the state information of the database table, and based on the first analysis result information, from the pre- The first strategy for optimizing the SQL change script is matched in the strategy library.
  • the preset strategy library stores analysis result information and corresponding strategies.
  • the influence result information corresponding to the sub-state information is generated, and the state information of the database table is predicted based on the memory neural network model, and the prediction result information is determined, that is, the database table at the current moment in the state information of the database table is determined.
  • the access hotspot information is input into the memory neural network model for analysis and prediction, and the time period when the access volume of the database table is at a low point after the current moment is determined, and the time period is used as the change period in which the SQL change script is changed in the database. Then, the influence result information and the prediction result information are determined as the first analysis result information.
  • the influence result information corresponding to the sub-state information can be timely and accurately generated.
  • the prediction result information can be determined timely and accurately based on the memory neural network model.
  • the strategy corresponding to the index word is determined as the first strategy, and the SQL change script is optimized based on the first strategy.
  • the matching degree can be determined more quickly, and it is convenient to determine whether the strategy corresponding to the matching degree is the first strategy in a timely manner, so as to facilitate the follow-up
  • the sql change script is optimized based on the first strategy in a timely and accurate manner.
  • the influence range of the target change object is 110,000 rows
  • determine whether there is a policy influence condition matching the sub-state information in each policy influence condition and assume that each influence There is a policy influence condition in the policy conditions: the number of affected database rows exceeds 100,000 rows, and needs to be split and executed.
  • the sub-state information is matched with each policy influence condition, that is, the influence range of the target change object exceeds 100,000 rows, it can be determined that there is a policy influence condition in each policy influence condition that matches the sub-state information, therefore, the influence can be generated.
  • the Lstm algorithm can also be used to analyze and predict the sub-state information "database table access hotspots". For example, the collection time of database table access hotspots is 20:00. By entering the database table access hotspots at the collection time into By making predictions in the Lstm algorithm, an access trough time period (such as 22:00-22:30) can be predicted, and the access trough period can be used as a change period for the SQL change script to make changes in the database.
  • the instruction optimization module can determine the word segmentation from the impact result information, such as "target”, “change”, “object”, “impact” range", “over 100,000 lines”, etc.
  • Match the word segments such as “target”, “change”, “object”, “scope of influence”, “more than 100,000 rows”, “database”, “disk”, “high load pressure” and index words in the preset strategy library one by one Match, determine multiple matching degrees, for example, determine 7 matching degrees, namely 0.85, 0.75, 0.7, 0.6, 0.5, 0.4, 0.3, assuming that the matching threshold is 0.8, then the 7 matching degrees are all matched with the matching threshold.
  • the strategy corresponding to the matching degree of 0.85 can be determined as the sql change script used to optimize the load pressure on the database, or the 7 matching degrees can be directly compared to determine the maximum matching degree.
  • the strategy corresponding to the degree is determined to be used to optimize the SQL change script that affects the load pressure on the database, so as to disassemble the original SQL change script into multiple sub-SQL change scripts, and then make changes in the database based on the multiple sub-SQL change scripts. , in order to alleviate the load pressure on the database when the original SQL change script is changed in the database.
  • the syntax analysis module determines that the sql change script is not executable, it generates second analysis result information of the sql change script, and directly submits the sql change script and the second analysis result information to the instruction optimization module.
  • the instruction optimization module first determines each word segment of the second analysis result information, and determines the matching degree based on the matching situation of each word segment and the index word in the preset strategy library. If the matching degree is greater than or equal to the matching threshold, the strategy corresponding to the index word is determined as the second strategy, so that the SQL change script can be optimized in time, and the SQL change script with correct syntax is determined.
  • the syntax analysis module determines that the SQL change script is not executable, it generates analysis result information that the SQL change script is not executable (for example, there is a syntax error in the SQL change script). Then, a connection relationship can be established with the instruction optimization module through a connection method based on TCP (Transmission Control Protocol), and the sql change script and the analysis result information can be transmitted to the instruction optimization module.
  • the instruction optimization module determines the word segmentation, such as "grammar”, "error” or "grammar error”, from the analysis result information "the SQL change script has a syntax error, which leads to an error in execution in the database".
  • the strategy corresponding to the matching degree 0.8 can be determined.
  • the strategy corresponding to the matching degree 0.8 can be determined. In order to optimize the sql change script with syntax errors, or directly compare the five matching degrees, determine the maximum matching degree, and determine the strategy corresponding to the maximum matching degree as the one used to optimize the sql with syntax errors Change the script to get the sql change script with correct syntax.
  • Step1 The receiving module receives the SQL change statement submitted by the operation and maintenance personnel.
  • the receiving module may be an independent physical server, or a server cluster or a distributed system composed of multiple physical servers.
  • the operation and maintenance personnel may send a SQL change request (or a SQL change instruction) to the receiving module, where the SQL change request includes a SQL change statement (or called a SQL change script).
  • the receiving module parses the SQL change request to obtain the SQL change statement, and sends it to the syntax analysis module.
  • the receiving module may provide the operation and maintenance personnel with a service interface in advance, and the operation and maintenance personnel may input a SQL change request on the service interface, so as to submit the SQL change request to the receiving module.
  • the receiving module parses the SQL change request to obtain the SQL change statement, and sends it to the syntax analysis module.
  • the operation and maintenance personnel can directly input the SQL change statement on the service interface, and the receiving module sends the SQL change statement to the syntax analysis module after receiving the SQL change statement.
  • the operation and maintenance personnel can generate multiple SQL change requests based on the multiple SQL change statements, and sequentially receive the services provided by the module. Enter the multiple SQL change requests on the interface.
  • the receiving module can immediately parse each SQL change request to obtain the corresponding SQL change statement, or can parse the multiple SQL change requests after receiving all the multiple SQL change requests to obtain the corresponding multiple SQL change requests. sql change statement.
  • the operation and maintenance personnel can also package the multiple SQL change statements to obtain a data package, generate a SQL change request based on the data package, and input the QL change request on the service interface provided by the receiving module. After receiving the SQL change request, the receiving module parses to obtain a plurality of corresponding SQL change statements.
  • the receiving module can also receive the SQL change statement optimization strategy and the execution result of the SQL change statement sent by the instruction optimization module.
  • Step 2 The syntax analysis module analyzes the SQL change statement to determine the grammatical correctness of the SQL change statement.
  • the grammar analysis module After receiving the SQL change statement sent by the receiving module, the grammar analysis module analyzes the SQL change statement through the pre-set SQL grammar rules, and judges the grammatical correctness of the SQL change statement. If it is determined that the syntax of the SQL change statement is correct, it means that the SQL change statement can be successfully executed in the database table. If it is determined that the syntax of the sql change statement is incorrect, it means that the sql change statement cannot be successfully executed in the database table, and the result of the inability to execute the sql change statement is determined. The influence result of the execution is submitted to the instruction optimization module, so that the instruction optimization module adjusts the syntax of the SQL change statement with syntax error, and determines the SQL change statement with correct syntax.
  • the syntax analysis module when it is determined that the syntax of the SQL change statement is correct, the syntax analysis module will also determine the target object to be changed by the SQL change statement (such as the table involved in the change, the fields in the table, the number of data rows in the table, and the index conditions). Wait). Then submit the SQL change statement and the corresponding analysis result to the impact analysis module.
  • the analysis result includes the target change object and the syntax of the SQL change statement is correct.
  • the syntax analysis module can identify the target object to be changed by the SQL change statement.
  • the SQL change statement and the corresponding analysis result (the target change object and the syntax of the SQL change statement are correct) are packaged to form a data package, and the data package is submitted to the impact analysis module.
  • the SQL change statement and the corresponding analysis result can also be directly submitted to the impact analysis module together.
  • the grammar analysis module can analyze the SQL change statement by using a pre-set artificial intelligence natural language (NLP, Natural Language Processing) grammar analysis model, that is, using the natural language grammar analysis model.
  • NLP Natural Language Processing
  • the lexical analysis and syntax analysis in the sql change statement is analyzed to judge the grammatical correctness of the sql change statement.
  • the Lex lexical analyzer is used for lexical analysis
  • the Bison syntax analyzer is used for syntax analysis.
  • the Lex lexical analyzer is used to perform lexical analysis on the SQL change statement, that is, each character in the SQL change statement is converted into a corresponding identifier (token), and the converted identifier is easily processed by the subsequent Bison parser .
  • the Lex lexer matches sql change statements with regular expressions, that is, reads in one input character (ie, one word) at a time until a pattern matching the input character is found, and after finding a matching pattern, determine Generate a corresponding token.
  • Each token corresponds to a terminal in the Bison parser (terminal is the smallest element that cannot be split).
  • Each token plus its corresponding terminator can form a string, and then these strings will be divided into two groups, namely sql keyword and sql function, the sql keyword and sql function respectively correspond to an array.
  • sql keywords such as select, from, where, etc.
  • the data structure dictionary tree Trie tree a variant of hash tree
  • FIG. 3 is a schematic structural diagram of a Trie tree according to an embodiment of the present invention.
  • An array of keywords is stored in the Trie tree, and the keywords in the SQL change statement can be searched according to the Trie tree.
  • the keywords in the SQL change statement can be determined based on the Trie tree and calling the get_hash_symbol() function in the Lex lexical analyzer. That is, use the get_hash_symbol() function in the Lex lexical analyzer to process each word in the SQL change statement, and determine the hash value of each word.
  • FIG. 4 it is a schematic diagram of a state machine of sql lexical analysis provided by an embodiment of the present invention.
  • character matching is performed according to the process shown in the figure, so as to determine the token corresponding to the corresponding character.
  • match the select and determine the token corresponding to the select, that is, SELECT_SYM748.
  • the space will be filtered, and then continue to match *, and determine the token corresponding to *, that is, *42.
  • table1 is the table name
  • the table name can be customized, and each customized table name may be different. Therefore, there is no need to determine the token corresponding to the table name here.
  • the special character is an end character. If so, determine the token corresponding to the end character, that is, END_OF_INPUT 411. Based on this, the token corresponding to the corresponding character in the SQL change statement "select*from table1;" can be determined.
  • the Bison parser processes the sql change statements processed by the Lex lexical analyzer according to predefined rules (rules refer to matching the corresponding characters and then executes the corresponding actions), and constructs a parsing tree. .
  • rules refer to matching the corresponding characters and then executes the corresponding actions
  • the parser When the parser reads a token, whenever it reads a token that cannot end a rule, it pushes the token onto an internal stack and switches to a new state that reflects The token just read. When all the grammar symbols pushed into the stack are already equivalent to the right part of a rule, all the symbols in the right part are popped from the stack, and then the grammar symbols in the left part of the rule are pushed into the stack.
  • FIG. 5 is a schematic diagram of constructing a syntax parse tree according to an embodiment of the present invention. Exemplarily, continue to take the sql change statement as "select*from table1;" as an example, and describe the process of constructing the parse tree of the sql change statement according to the flow shown in FIG. 5 .
  • the select_statement (ie select*from table1) can be constructed in the order from top to bottom, and the first level is constructed first, which includes select, selection and table expression. Then build a second level based on table expression, which includes from clause and option order by clause. Then, the third level is constructed based on the from clause, which includes the from, table refer list and option where clause, and the fourth level table refer and the fifth level table are constructed based on the table refer list. Since there is no corresponding order by clause and corresponding where clause in the sql change statement "select*from table1;", there is no need to build.
  • the instruction optimization module can grammatically adjust the SQL change statement based on the error information, and determine the SQL change statement with correct syntax. Then send the SQL change statement with correct syntax to the operation and maintenance personnel for confirmation.
  • Step 3 The impact analysis module analyzes the impact result of the SQL change statement, and determines the impact result information generated by the SQL change statement when it is changed.
  • the impact analysis module After receiving the data packet sent by the syntax analysis module, the impact analysis module parses the data packet to obtain the SQL change statement and the corresponding analysis result, or receives the SQL change statement and the corresponding analysis result directly sent by the syntax analysis module.
  • a data acquisition request is sent to the database state acquisition module, and the data acquisition request includes the identification of the impact analysis module and the target change object.
  • the database status acquisition module After receiving the data acquisition request, the database status acquisition module parses the data acquisition request to obtain the identification of the impact analysis module and the target change object, and obtains the status information of the corresponding database table from the production database system in real time based on the target change object, and then Send the status information of the database table to the impact analysis module corresponding to the identification of the impact analysis module.
  • the database state collection module can also collect the state information of the database table from the production database system in advance and store it in the memory. In this way, after receiving the data acquisition request, it analyzes the data acquisition request to obtain the identifier and the impact analysis module. The target change object, and based on the target change object, the state information of the corresponding database table is obtained from the memory, and then the state information of the database table is sent to the impact analysis module corresponding to the identification of the impact analysis module.
  • the status information of the database table may include at least one of the following: database table capacity (including index), database table row size, database table primary key information, database table index information, target change object influence range (row number), database table Table access hotspots (that is, the frequency of database table access requests).
  • the impact analysis module combines the status information of the database table and the conditions of each impact strategy to determine whether the change of the SQL change statement has an abnormal impact on the database.
  • the state information of the database table includes each sub-state information, and for each sub-state information, the impact analysis module determines whether there is an impact policy condition matching the sub-state information in the impact policy condition database, wherein the impact policy condition database stores There are various influencing policy conditions. If it exists, it is determined that the change of the SQL change statement has an abnormal impact on the database, and the impact result is determined from the analysis result database based on the impact policy condition matched by the sub-state information, and the impact result and the SQL change statement are submitted to the instruction optimization. module is optimized. If it does not exist, it is determined that the change of the SQL change statement has no abnormal impact on the database, and the change can be made directly in the database based on the SQL change statement.
  • the influencing policy conditions may include (1) the size of the database table is greater than 10 Gb, and it is necessary to combine the access hotspot situation to predict the future business trough time period; (2) the number of affected database rows exceeds 100,000 rows, which needs to be split and executed ; (3) Change the database SQL change statement missing index, and the number of affected rows exceeds 5000 rows, etc.
  • those skilled in the art may perform settings based on experience or actual scenario requirements, which are not limited in this embodiment of the present invention.
  • the impact analysis module may preset the impact results corresponding to each impact strategy condition, and store the impact results corresponding to each impact strategy condition in the analysis result library.
  • the influence result is determined from the analysis result database, for a certain sub-state information, if the sub-state information matches the corresponding influence policy condition from the influence policy condition database, it can be retrieved from the analysis result database based on the influence policy condition. Match the corresponding impact results.
  • the impact analysis module uses the memory neural network algorithm to analyze and predict the collected database table access hot spots, and determine the prediction result information for the database table access hot spots.
  • the impact analysis module uses the Lstm algorithm to analyze and predict the access hotspots of the database tables, and predicts a future access trough time period, and the trough time period is a relatively reliable change time range, so that the SQL change statement can be stored in the database. This access trough time period is changed. Then, the prediction result (ie, a future trough time period) is submitted to the instruction optimization module.
  • an access trough time period (such as 15:15:10) can be predicted. 00-15:30), and use the access trough period as the sql change script to make changes in the database, so that the sql change script can use the access trough period given by the impact analysis module (for example, 15:00-15:30 ) to make changes in the database, so that the database table cannot be accessed when the SQL change script makes changes during the non-access trough time period.
  • the schematic diagram of using the Lstm algorithm to analyze and predict the hotspot situation of database table access may be shown in FIG. 6 .
  • Step 4 The instruction optimization module determines the corresponding optimization strategy from the preset strategy library based on the received impact results.
  • the instruction optimization module can receive the influence result from the syntax analysis module, and can also receive the influence result from the influence analysis module. For each impact result, a full-text indexing algorithm can be used to match the corresponding optimization strategy from the preset strategy library.
  • FIG. 7 is a schematic process diagram of a full-text indexing algorithm provided by an embodiment of the present invention. Based on the figure, the full-text indexing algorithm used by the instruction optimization module is mainly divided into two processes, namely index creation (Indexing) and search index (Search Index).
  • the index creation is to pre-define the optimization strategy corresponding to each impact result, and store the pre-defined optimization strategy corresponding to each impact result in the strategy library.
  • the strategy library may include (1) when the syntax of the SQL change statement is incorrect, the syntax error is corrected and a correct SQL change statement is given; (2) when the capacity of the target database table to be changed exceeds 10Gb, it will be analyzed according to the impact analysis module. (3) When the number of rows affected by the change object exceeds 100,000 rows, the SQL change statement will be automatically disassembled to generate multiple change instructions to reduce the impact of each change on the database table, etc.
  • those skilled in the art may perform settings based on experience or actual scenario requirements, which are not limited in this embodiment of the present invention.
  • FIG. 8 is a schematic diagram of a syntax tree formed based on A, B, and C according to an embodiment of the present invention.
  • the document list containing A, B, and C will be searched, and then the document list of A and B will be used for intersection, and the resulting result set will be subtracted from C, and the final result will be A list of documents matching the search criteria.
  • A, B, and C are the processed words.
  • the correlation of the results can be obtained.
  • a relatively simple implementation is described as follows: When indexing, the Inverse document Frequency (reverse file frequency) and Term Frequency (word frequency) are obtained. The higher the Term Frequency, the higher the relevance of the document; the higher the Inverse document Frequency, the higher the weaker the correlation.
  • the final optimization strategy can be determined.
  • the impact result submitted by the impact analysis module to the instruction optimization module is "change the target database table capacity exceeding 10Gb, resulting in inaccessibility of the database table”
  • the word segmentation can be determined from the impact result, such as "change target”, “Database table capacity”, “more than 10Gb” and so on.
  • the strategy corresponding to the matching degree of 0.89 can be determined as the sql change script used to optimize the inaccessibility of the database table, or the 6 matching degrees can be directly compared to determine the maximum matching degree, and the maximum matching degree can be determined as the maximum matching degree.
  • the corresponding strategy is determined to be used to optimize the sql change script that makes the database table inaccessible, so that the sql change script can make changes in the database according to the access trough time period (such as 15:00-15:30) given by the impact analysis module, In this way, the database table can be prevented from being inaccessible when the SQL change script is changed during the non-access trough time period, thereby ensuring that the database table can be accessed normally and the business system can run normally.
  • the access trough time period such as 15:00-15:30
  • FIG. 9 is a schematic diagram of storing a newly created index according to an embodiment of the present invention.
  • the newly created index may be split into two or more sub-indexes to be stored in the policy database. For example, split a long index into sub-index 1 and sub-index 2 first. Sub-index 1 and sub-index 2 are then stored in the policy library.
  • FIG. 10 exemplarily shows an apparatus for evaluating a database change script provided by an embodiment of the present invention, and the apparatus can execute the flow of a method for evaluating a database change script.
  • the device includes:
  • a receiving unit 1001 configured to receive a structured query language sql change script for the database
  • the processing unit 1002 is configured to determine whether the sql change script is executable according to the word analysis rule; if executable, obtain the status of the database table associated with the target change object based on the target change object in the sql change script information; according to the state information of the database table, determine the first analysis result information generated by the sql change script when the change is made; The first strategy of the sql change script; the preset strategy library stores the analysis result information and the strategy corresponding to the analysis result information.
  • processing unit 1002 is specifically configured to:
  • the sql change script is grammatically analyzed by using grammatical analysis rules to determine whether the sql change script complies with the grammatical rules, so as to determine whether the sql change script is executable.
  • processing unit 1002 is specifically configured to:
  • the vocabulary is determined as a keyword.
  • processing unit 1002 is specifically configured to:
  • each keyword in the sql change script as a parameter for building a syntax parse tree to determine whether a syntax parse tree can be constructed
  • processing unit 1002 is specifically configured to:
  • the status information of the database table includes at least one of the following items: capacity, number of rows, primary key information, index information, access request status, and the influence scope of the target change object.
  • processing unit 1002 is specifically configured to:
  • the influence result information and the prediction result information are determined as the first analysis result information.
  • processing unit 1002 is specifically configured to:
  • the database table access hot spot information at the current moment in the state information of the database table into the memory neural network model for analysis and prediction, and determine the time period when the access volume of the database table is at a low point after the current moment;
  • the time period is used as the change period when the SQL change script makes changes in the database.
  • processing unit 1002 is further configured to:
  • a second strategy for optimizing the sql change script is matched from the preset strategy library.
  • processing unit 1002 is specifically configured to:
  • the sql change script is optimized.
  • an embodiment of the present invention further provides a computing device, as shown in FIG. 11 , including at least one processor 1101 and a memory 1102 connected to the at least one processor, and processing is not limited in the embodiment of the present invention
  • the specific connection medium between the processor 1101 and the memory 1102 is taken as an example of the connection between the processor 1101 and the memory 1102 through a bus in FIG. 11 .
  • the bus can be divided into address bus, data bus, control bus and so on.
  • the memory 1102 stores instructions that can be executed by at least one processor 1101. By executing the instructions stored in the memory 1102, the at least one processor 1101 can execute the steps included in the foregoing method for evaluating a database change script .
  • the processor 1101 is the control center of the computing device, which can use various interfaces and lines to connect various parts of the computing device, and realize the data by running or executing the instructions stored in the memory 1102 and calling the data stored in the memory 1102. deal with.
  • the processor 1101 may include one or more processing units, and the processor 1101 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, etc.
  • the calling processor mainly deals with issuing instructions. It can be understood that, the above-mentioned modulation and demodulation processor may not be integrated into the processor 1101.
  • the processor 1101 and the memory 1102 may be implemented on the same chip, and in some embodiments, they may be implemented separately on separate chips.
  • the processor 1101 may be a general-purpose processor, such as a central processing unit (CPU), a digital signal processor, an application specific integrated circuit (ASIC), a field programmable gate array or other programmable logic device, discrete gates or transistors Logic devices and discrete hardware components can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of the present invention.
  • a general purpose processor may be a microprocessor or any conventional processor or the like.
  • the steps of the method disclosed in the embodiments of the method for evaluating a database change script can be directly embodied as executed by a hardware processor, or executed by a combination of hardware and software modules in the processor.
  • the memory 1102 as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs and modules.
  • the memory 1102 may include at least one type of storage medium, for example, may include flash memory, hard disk, multimedia card, card-type memory, random access memory (Random Access Memory, RAM), Static Random Access Memory (Static Random Access Memory, SRAM), Programmable Read Only Memory (PROM), Read Only Memory (ROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Magnetic Memory, Disk , CD-ROM, etc.
  • Memory 1102 is, but is not limited to, any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer.
  • the memory 1102 in this embodiment of the present invention may also be a circuit or any other device capable of implementing a storage function, for storing program instructions and/or data.
  • an embodiment of the present invention also provides a computer-readable storage medium, which stores a computer program executable by a computing device.
  • the computing device causes the Execute the steps of the evaluation method of the above database change script.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Mathematical Physics (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本发明实施例提供了一种数据库变更脚本的评估方法及装置,该方法包括接收针对数据库的结构化查询语言sql变更脚本,按照词语分析规则,确定sql变更脚本是否可执行,若可执行,则基于sql变更脚本中的目标变更对象,获取目标变更对象关联的数据库表的状态信息,根据数据库表的状态信息,确定sql变更脚本在变更时所产生的第一分析结果信息,基于第一分析结果信息,从预设策略库中匹配出用于优化sql变更脚本的第一策略。该方案的自动化实现可以减少依靠人工评估sql变更脚本的变更影响所耗费的时间和人力,并提高评估sql变更脚本的效率,以便解决现有技术中依赖运维人员评估sql变更脚本的变更影响所导致的评估效率低的问题。

Description

一种数据库变更脚本的评估方法及装置
相关申请的交叉引用
本申请要求在2021年04月30日提交中国专利局、申请号为202110478503.X、申请名称为“一种数据库变更脚本的评估方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本发明实施例涉及金融科技(Fintech)领域,尤其涉及一种数据库变更脚本的评估方法及装置。
背景技术
随着计算机技术的发展,越来越多的技术应用在金融领域,传统金融业正在逐步向金融科技转变,但由于金融行业的安全性、实时性要求,也对技术提出的更高的要求。在金融领域中,随着金融业务的不断更新和/或增加,通常会涉及到对相关数据库表进行修改,而针对相关数据库表进行修改也即是通过对数据库表的结构化查询语言sql语句进行变更来实现。然而,若sql变更语句存在错误或者未对sql变更语句进行评估,在变更sql变更语句时会引起数据库发生故障,从而影响金融业务的正常执行,给金融领域带来严重的损失。因此,需要对sql变更语句的变更影响进行准确地评估,以确保金融领域的正常运行。
现有方案通常是基于运维人员的经验对sql变更语句的变更影响进行评估。具体地,运维人员在确定出sql变更语句后,根据自己的经验对sql变更语句的变更影响进行评估,确定出sql变更语句在变更时所产生的影响结果,然后再将sql变更语句提交给分析检测平台进行检测,以确定sql变更语句是否可执行。然而,这种处理方式由于不同运维人员的经验可能不同,导致评估结果的准确性也不同,并由于运维人员在评估过程中存在误判或漏判等问题,因此会导致sql变更语句在变更时使得金融业务系统出现异常。此外,由于需要依赖运维人员进行评估,需要耗费较长的时间和精力,使得评估的效率低。
综上,目前亟需一种数据库变更脚本的评估方法,用以解决现有技术中依赖运维人员评估sql变更脚本的变更影响所导致的评估效率低的问题。
发明内容
本发明实施例提供了一种数据库变更脚本的评估方法及装置,用以解决现有技术中依赖运维人员评估sql变更脚本的变更影响所导致的评估效率低的问题。
第一方面,本发明实施例提供了一种数据库变更脚本的评估方法,包括:
接收针对数据库的结构化查询语言sql变更脚本;
按照词语分析规则,确定所述sql变更脚本是否可执行;
若可执行,则基于所述sql变更脚本中的目标变更对象,获取所述目标变更对象关联的数据库表的状态信息;
根据所述数据库表的状态信息,确定所述sql变更脚本在变更时所产生的第一分析结 果信息;
基于所述第一分析结果信息,从预设策略库中匹配出用于优化所述sql变更脚本的第一策略;所述预设策略库中存储有分析结果信息以及分析结果信息对应的策略。
上述技术方案中,由于现有技术依靠人工分析来评估sql变更脚本的变更影响,需要耗费一定的时间,且由于依赖人工分析会导致评估出的影响结果准确性不高。而该方案在确定sql变更脚本可成功执行时,可以自动获取目标变更对象关联的数据库表的状态信息,并对数据库表的状态信息进行影响结果分析,可以自动准确地确定出sql变更脚本在变更时所产生的第一分析结果信息。再基于第一分析结果信息,可以及时地从预设策略库中匹配出用于优化sql变更脚本的第一策略。基于此可知,该方案的自动化实现可以避免人工过多的介入,有助于减少依靠人工评估sql变更脚本的变更影响所耗费的时间和人力,从而可以提高评估sql变更脚本的变更影响的效率,进而可以解决现有技术中依赖运维人员评估sql变更脚本的变更影响所导致的评估效率低的问题,并可以解决现有技术中因人工的经验不同所导致的评估准确性不同的问题。此外,由于该方案可以基于第一策略对sql变更脚本进行自动优化,因此相对人工评估和优化来说,可以大大降低评估和优化所需的知识门槛,并且更加的安全可靠。
可选地,所述按照词语分析规则,确定所述sql变更脚本是否可执行,包括:
基于词法分析规则对所述sql变更脚本进行词法分析,确定出所述sql变更脚本中的各关键字;
基于所述各关键字,利用语法分析规则对所述sql变更脚本进行语法分析,确定所述sql变更脚本是否符合语法规则,从而确定所述sql变更脚本是否可执行。
上述技术方案中,通过基于关键字,并利用语法分析规则对sql变更脚本进行语法分析,可以及时准确地确定sql变更脚本的语法是否正确,以便进一步确定sql变更脚本是否可执行,从而可以避免错误的sql变更脚本在变更时引起数据库的故障。
可选地,所述基于词法分析规则对所述sql变更脚本进行词法分析,确定出所述sql变更脚本中的各关键字,包括:
通过构建的关键字查找树,确定所述sql变更脚本中的各词汇;
针对每个词汇,确定关键字库中是否存在与所述词汇的哈希值相等的关键字;
若存在,则将所述词汇确定为关键字。
上述技术方案中,通过哈希值匹配的方式,可以快速地确定sql变更脚本中的词汇是否为关键字,而无需人工判断,从而可以提高sql变更脚本的变更影响的评估效率。此外,通过预先在关键字库中存储每个关键字的哈希值,可以直接比对词汇的哈希值与多个关键字的哈希值,而无需每次重新计算关键字的哈希值,从而可以提高数据处理的效率。
可选地,所述基于所述各关键字,利用语法分析规则对所述sql变更脚本进行语法分析,确定所述sql变更脚本是否符合语法规则,包括:
按照语法分析规则,以所述sql变更脚本中的各关键字作为构建语法分析树的参数,确定是否可构建出语法分析树;
若是,则确定所述sql变更脚本的语法正确,否则确定所述sql变更脚本的语法存在错误。
上述技术方案中,通过以各关键字作为构建语法分析树的参数,可以快速地去构建语法分析树,并可以确定所构建出的语法分析树是否符合语法规则,从而可以准确地确定sql 变更脚本的语法是否正确,以便进一步地确定sql变更脚本是否可执行。
可选地,所述数据库表的状态信息包括以下至少一项:容量、行数、主键信息、索引信息、访问请求状态以及目标变更对象的影响范围。
上述技术方案中,通过实时采集数据库表的状态信息,可以及时准确地基于该数据库表的状态信息确定出sql变更脚本在变更时所产生的影响结果,并且该影响结果是基于实时采集的数据库表的状态信息确定的,所以该影响结果更加符合实际场景,从而可以便于后续能够更精准地对sql变更脚本进行优化。
可选地,所述根据所述数据库表的状态信息,确定变更所述sql变更脚本所产生的第一分析结果信息,包括:
针对所述数据库表的状态信息中每个子状态信息,确定所述子状态信息是否符合设定的影响策略条件;
若符合,则生成与所述子状态信息对应的影响结果信息,以及基于记忆神经网络模型对所述数据库表的状态信息进行预测,确定出预测结果信息;
将所述影响结果信息和所述预测结果信息确定为所述第一分析结果信息。
上述技术方案中,针对数据库表的状态信息中每个子状态信息,通过确定设定的各影响策略条件中是否存在与该子状态信息匹配的影响策略条件,可以及时准确的生成与该子状态信息对应的影响结果信息。此外,基于记忆神经网络模型可以及时准确地确定出预测结果信息。
可选地,所述基于记忆神经网络模型对所述数据库表的状态信息进行预测,确定出预测结果信息,包括:
将所述数据库表的状态信息中当前时刻的数据库表访问热点信息输入到所述记忆神经网络模型进行分析预测,确定出在当前时刻之后所述数据库表的访问量处于低谷的时间段;
将所述时间段作为sql变更脚本在数据库中进行变更时的变更时段。
上述技术方案中,通过将当前时刻的数据库表访问热点信息输入到记忆神经网络模型进行分析预测,可以准确地确定出在当前时刻之后数据库表的访问量处于低谷的时间段,可以便于sql变更脚本基于该低谷的时间段在数据库中进行及时有效地变更,如此可以避免sql变更脚本在非访问低谷时间段进行变更时造成数据库表无法访问,从而可以确保数据库表能够被正常的访问,并可以确保业务系统能够正常运行。
可选地,所述方法还包括:
若确定所述sql变更脚本不可执行,则生成所述sql变更脚本的第二分析结果信息;
根据所述第二分析结果信息,从所述预设策略库中匹配出用于优化所述sql变更脚本的第二策略。
上述技术方案中,在确定sql变更脚本不可执行时,可以直接基于第二分析结果信息从预设策略库中匹配出用于优化sql变更脚本的第二策略,以便sql变更脚本能够及时的优化。
可选地,从预设策略库中匹配出用于优化所述sql变更脚本的第一策略,包括:
确定出所述第一分析结果信息中的各分词;
基于所述各分词与所述预设策略库中的索引词的匹配情况,确定出匹配度;
若所述匹配度大于等于匹配阈值,将所述索引词对应的策略确定为所述第一策略;
基于所述第一策略,优化所述sql变更脚本。
上述技术方案中,通过基于各分词与预设策略库中的索引词进行匹配,可以更快速的确定出匹配度,并以及时地便于确定该匹配度所对应的策略是否为第一策略,从而可以便于后续及时准确地基于第一策略对sql变更脚本进行优化。
第二方面,本发明实施例还提供了一种数据库变更脚本的评估装置,包括:
接收单元,用于接收针对数据库的结构化查询语言sql变更脚本;
处理单元,用于按照词语分析规则,确定所述sql变更脚本是否可执行;若可执行,则基于所述sql变更脚本中的目标变更对象,获取所述目标变更对象关联的数据库表的状态信息;根据所述数据库表的状态信息,确定所述sql变更脚本在变更时所产生的第一分析结果信息;基于所述第一分析结果信息,从预设策略库中匹配出用于优化所述sql变更脚本的第一策略;所述预设策略库中存储有分析结果信息以及分析结果信息对应的策略。
第三方面,本发明实施例提供一种计算设备,包括至少一个处理器以及至少一个存储器,其中,所述存储器存储有计算机程序,当所述程序被所述处理器执行时,使得所述处理器执行上述第一方面任意所述的数据库变更脚本的评估方法。
第四方面,本发明实施例提供一种计算机可读存储介质,其存储有可由计算设备执行的计算机程序,当所述程序在所述计算设备上运行时,使得所述计算设备执行上述第一方面任意所述的数据库变更脚本的评估方法。
附图说明
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简要介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域的普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为本发明实施例提供的一种数据库变更脚本的评估系统架构的示意图;
图2为本发明实施例提供的一种数据库变更脚本的评估方法的流程示意图;
图3为本发明实施例提供的一种Trie树的结构示意图;
图4为本发明实施例提供的一种sql词法分析的状态机示意图;
图5为本发明实施例提供的一种构建语法分析树的示意图;
图6为本发明实施例提供的一种使用Lstm算法对数据库表访问热点情况进行分析预测的示意图;
图7为本发明实施例提供的一种全文索引算法的过程示意图;
图8为本发明实施例提供的一种基于A、B、C形成的语法树示意图;
图9为本发明实施例提供的一种对新创建的索引进行存储的示意图;
图10为本发明实施例提供的一种数据库变更脚本的评估装置的结构示意图;
图11为本发明实施例提供的一种计算设备的结构示意图。
具体实施方式
为了使本发明的目的、技术方案和优点更加清楚,下面将结合附图对本发明作进一步 地详细描述,显然,所描述的实施例仅仅是本发明的一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其它实施例,都属于本发明保护的范围。
下面首先对本发明实施例中涉及的部分用语进行解释说明,以便于本领域技术人员进行理解。
(1)数据库:是一些关联表的集合。
(2)数据表:表是数据的矩阵。在一个数据库中的表看起来像一个简单的电子表格。
(3)列:一列(数据元素)包含了相同类型的数据,例如邮政编码的数据。
(4)行:一行(元组或记录)是一组相关的数据,例如一条用户订阅的数据。
(5)主键:主键是唯一的,一个数据表中只能包含一个主键,可以使用主键来查询数据。
(6)索引:使用索引可快速访问数据库表中的特定信息。索引是对数据库表中一列或多列的值进行排序的一种结构。类似于书籍的目录。
(7)sql指令:结构化查询语言(Structured Query Language,sql),是一种特殊目的编程语言,是一种数据库查询和程序设计语言,用于存取数据以及查询、更新和管理关系数据库系统。
(8)树:一种数据结构,它是由n(n>=1)个有限结点组成一个具有层次关系的集合。把它叫做“树”是因为它看起来像一棵倒挂的树,也就是说它是根朝上,而叶朝下的。
(9)MySQL:MySQL是一个关系型数据库管理系统,也是一种关联数据库管理系统,关联数据库将数据保存在不同的表中。
如上介绍了本发明实施例中涉及的部分用语,下面对本发明实施例涉及的技术特征进行介绍。
为了便于理解本发明实施例,首先以图1中示出的系统结构为例说明适用于本发明实施例的数据库变更脚本的评估系统架构。该数据库变更脚本的评估系统架构可以应用于评估优化运维人员提交的sql变更语句等。如图1所示,该数据库变更脚本的评估系统架构可以包括评估优化平台100和目标数据库系统200。
其中,评估优化平台100可以包括接收模块101、语法分析模块102、影响分析模块103、指令优化模块104和数据库状态采集模块105。
接收模块101用于接收运维人员提交的数据库sql变更脚本,并将该数据库sql变更脚本提交给语法分析模块102。同时也包含了返回信息的功能,可以将sql执行结果或者sql优化策略返回给运维人员。
语法分析模块102用于接收模块101提交过来的sql变更脚本,并通过事先定义好的人工智能自然语言语法分析模型对sql变更脚本进行分析,判断该sql变更脚本的语法正确性,进而判断该sql变更脚本是否能够在数据库(比如MySQL数据库)中成功执行。如果确定不能成功执行,则会将sql变更脚本以及sql变更脚本不能成功执行的影响结果提交到指令优化模块104,给出正确的语法优化策略,并最终返回给运维人员。如果确定可成功执行,则会将sql变更脚本提交到影响分析模块103,以便进行sql变更脚本在变更时可能造成的影响进行分析和预测。
影响分析模块103用于接收语法分析模块102提交的sql变更脚本,并将结合采集模块从目标数据库系统200中采集到的数据库表状态,进行分析和预测。因此该影响分析模 块103又主要分为两大功能,分析和预测。其中,分析功能会根据采集结果中数据库表的实时状态信息,判断该sql变更脚本变更后必然会产生的影响结果,预测功能会根据采集到的数据库表访问状态,结合Lstm算法(Long Short-Term Memory,长短期记忆网络),进而预测数据库表未来的访问状态,最终预测未来某个时间变更该sql变更脚本可能造成的影响。对于分析和预测后可能存在变更风险的sql变更脚本,影响分析模块会将影响结果和sql变更脚本提交到指令优化模块104,给出影响风险最低的sql变更脚本优化策略,并最终返回给运维人员;对于分析和预测都低风险的sql变更脚本或者对数据库无影响的sql变更脚本,将最终提交到目标数据库系统200进行变更。
指令优化模块104用于接收来自语法分析模块102或者影响分析模块103提交的sql变更脚本和影响结果。再根据事先设置好的策略库,通过全文索引算法进行匹配检索,最终给出sql变更脚本的优化策略,并提交给接收模块101返回给运维人员。同时会将本次sql的分析/预测/执行结果落入知识库,以便评估优化平台100自我成长学习。
数据库状态采集模块105用于实时采集数据库表的运行状态信息。比如,采集数据库cpu使用率、磁盘I/O利用率、tcp网络连接数量、数据库表的容量大小、数据库表的主键/索引信息、变更字段涉及数据库表行数以及目标数据库系统200的数据库表访问频率等状态信息。
需要说明的是,上述图1所示的结构仅是一种示例,本发明实施例对此不做限定。
基于上述描述,图2示例性的示出了本发明实施例提供的一种数据库变更脚本的评估方法的流程,该流程可以由数据库变更脚本的评估装置执行。
如图2所示,该流程具体包括:
步骤201,接收针对数据库的结构化查询语言sql变更脚本。
步骤202,按照词语分析规则,确定所述sql变更脚本是否可执行。
步骤203,若可执行,则基于所述sql变更脚本中的目标变更对象,获取所述目标变更对象关联的数据库表的状态信息。
步骤204,根据所述数据库表的状态信息,确定所述sql变更脚本在变更时所产生的第一分析结果信息。
步骤205,基于所述第一分析结果信息,从预设策略库中匹配出用于优化所述sql变更脚本的第一策略;所述预设策略库中存储有分析结果信息及对应的策略。
上述步骤201中,sql变更脚本可以是运维人员根据实际应用场景对原来的数据库系统中的sql脚本进行变更(比如增加或减少索引条件、增加或减少时间限制以及增加或减少数据展示字段等)所形成的变更脚本。或者,也可以是数据库系统中某一个或某几个sql脚本在执行过程中经常报错或执行等待的时间比较长等,则运维人员根据实际情况对数据库系统中某一个或某几个sql脚本进行调整所形成的变更脚本。当然,也可以是其它形式下所产生的变更脚本,本发明实施例对此并不作限定。
具体地,运维人员在生成sql变更脚本后,需要检测该sql变更脚本是否可在数据库系统中成功执行,并确定该sql变更脚本在数据库系统中变更时所产生的影响结果(比如变更过程中可能会导致数据库表无法访问、数据库磁盘I/O负载压力增加等),进而基于影响结果对sql变更脚本进行优化。因此,需要将生成的sql变更脚本提交给评估优化平台中的数据接收模块,以便评估优化平台对该sql变更脚本进行评估优化。
上述步骤202和步骤203中,评估优化平台中的语法分析模块按照词语分析规则对sql 变更脚本进行分析,确定sql变更脚本是否可执行。若确定sql变更脚本可执行,则将sql变更脚本提交给评估优化平台中的影响分析模块,影响分析模块基于sql变更脚本中的目标变更对象,从评估优化平台中的数据库状态采集模块获取目标变更对象关联的数据库表的状态信息。
其中,数据库表的状态信息包括以下至少一项:容量、行数、主键信息、索引信息、访问请求状态以及目标变更对象的影响范围。通过实时采集数据库表的状态信息,可以及时准确地基于该数据库表的状态信息确定出sql变更脚本在变更时所产生的影响结果,并且该影响结果是基于实时采集的数据库表的状态信息确定的,所以该影响结果更加符合实际场景,从而可以便于后续能够更精准地对sql变更脚本进行优化。
具体地,首先基于词法分析规则对sql变更脚本进行词法分析,确定出sql变更脚本中的各关键字。再基于各关键字,利用语法分析规则对sql变更脚本进行语法分析,确定sql变更脚本是否符合语法规则,从而确定sql变更脚本是否可执行。若确定sql变更脚本可执行,则将sql变更脚本提交给评估优化平台中的影响分析模块。
在一种可能的实现方式中,可以通过构建的关键字查找树,确定sql变更脚本中的各词汇。再针对每个词汇,确定关键字库中是否存在与词汇的哈希值相等的关键字。若存在,则将词汇确定为关键字。若不存在,则确定该词汇不为关键字。其中,关键字库可以包括select、from、where等关键字以及各关键字对应的哈希值。如此,通过哈希值匹配的方式,可以快速地确定sql变更脚本中的词汇是否为关键字,而无需人工判断,从而可以提高sql变更脚本的变更影响的评估效率。此外,通过预先在关键字库中存储每个关键字的哈希值,可以直接比对词汇的哈希值与多个关键字的哈希值,而无需每次重新计算关键字的哈希值,从而可以提高数据处理的效率。
示例性地,比如sql变更脚本为“select*from tableA;”,则通过构建的关键字查找树,可以查找出select、from等词汇,并通过词法分析器中的get_hash_symbol()函数可以获取select、from等词汇的哈希值。再将select、from等词汇的哈希值分别与预设关键字库中各关键字的哈希值进行匹配,若匹配成功,则可确定该词汇为关键字。
在一种可能的实现方式中,可以按照语法分析规则,以sql变更脚本中的各关键字作为构建语法分析树的参数,确定是否可构建出语法分析树。若是,则确定sql变更脚本的语法正确,否则确定sql变更脚本的语法存在错误。如此,通过以各关键字作为构建语法分析树的参数,可以快速地去构建语法分析树,并可以确定所构建出的语法分析树是否符合语法规则,从而可以准确地确定sql变更脚本的语法是否正确,以便进一步地确定sql变更脚本是否可执行,从而可以避免错误的sql变更脚本在变更时引起数据库的故障。
上述步骤204和步骤205中,评估优化平台中的影响分析模块可以根据数据库表的状态信息,确定sql变更脚本在变更时所产生的第一分析结果信息,并基于第一分析结果信息,从预设策略库中匹配出用于优化sql变更脚本的第一策略。其中,预设策略库中存储有分析结果信息及对应的策略。
具体地,针对数据库表的状态信息中每个子状态信息,确定子状态信息是否符合设定的影响策略条件。若符合,则生成与子状态信息对应的影响结果信息,以及基于记忆神经网络模型对数据库表的状态信息进行预测,确定出预测结果信息,即,将数据库表的状态信息中当前时刻的数据库表访问热点信息输入到记忆神经网络模型进行分析预测,确定出在当前时刻之后所述数据库表的访问量处于低谷的时间段,将时间段作为sql变更脚本在 数据库中进行变更的变更时段。再将影响结果信息和预测结果信息确定为第一分析结果信息。如此,通过确定设定的各影响策略条件中是否存在与该子状态信息匹配的影响策略条件,可以及时准确的生成与该子状态信息对应的影响结果信息。此外,基于记忆神经网络模型可以及时准确地确定出预测结果信息。然后,再将第一分析结果信息和sql变更脚本提交给评估优化平台中的指令优化模块,指令优化模块会基于全文索引算法从预设策略库中匹配出与第一分析结果信息对应的策略,并基于该策略对sql变更脚本进行优化。即,指令优化模块首先确定出第一分析结果信息的各分词,并基于各分词与预设策略库中的索引词的匹配情况,确定出匹配度。若匹配度大于等于匹配阈值,将索引词对应的策略确定为第一策略,并基于第一策略,优化sql变更脚本。如此,通过基于各分词与预设策略库中的索引词进行匹配,可以更快速的确定出匹配度,并以及时地便于确定该匹配度所对应的策略是否为第一策略,从而可以便于后续及时准确地基于第一策略对sql变更脚本进行优化。
示例性地,假设sql变更脚本的某一子状态信息是:目标变更对象的影响范围为110000行,则确定各策略影响条件中是否存在与该子状态信息匹配的策略影响条件,并假设各影响策略条件中存在一个策略影响条件为:影响数据库行数超过100000行,需要进行拆分执行。在将该子状态信息与各策略影响条件进行匹配时,即目标变更对象的影响范围超过100000行,可确定各策略影响条件中存在一个策略影响条件与该子状态信息匹配,因此,可以生成影响结果信息“目标变更对象的影响范围超过100000行,导致数据库磁盘负载压力大”。此外,还可以使用Lstm算法对子状态信息“数据库表访问热点情况”进行分析预测,比如说数据库表访问热点情况的采集时刻为20:00,通过将该采集时刻的数据库表访问热点情况输入到Lstm算法中进行预测,即可预测出一个访问低谷时间段(比如22:00-22:30),并将该访问低谷时段作为sql变更脚本在数据库中进行变更的变更时段。然后,将sql变更脚本、影响结果信息以及访问低谷时间段提交给指令优化模块,则指令优化模块可以从影响结果信息中确定出分词,比如“目标”、“变更”、“对象”、“影响范围”、“超过100000行”等分词。将“目标”、“变更”、“对象”、“影响范围”、“超过100000行”、“数据库”、“磁盘”、“负载压力大”等分词与预设策略库中的索引词进行逐一匹配,确定出多个匹配度,比如确定出7个匹配度,即0.85、0.75、0.7、0.6、0.5、0.4、0.3,假设匹配阈值为0.8,则将该7个匹配度都与匹配阈值进行比较,即可得出只有0.85大于0.8。因此,可以将匹配度0.85所对应的策略确定为用于优化给数据库造成负载压力影响的sql变更脚本,或者,直接将该7个匹配度进行比对,确定出最大匹配度,并将最大匹配度所对应的策略确定为用于优化给数据库造成负载压力影响的sql变更脚本,以便将原有sql变更脚本拆解成多个子sql变更脚本,然后基于该多个子sql变更脚本在数据库中进行变更,以便缓解原有sql变更脚本在数据库中变更时对数据库造成的负载压力影响。
需要说明的是,语法分析模块若确定sql变更脚本不可执行,则生成sql变更脚本的第二分析结果信息,并直接将sql变更脚本以及第二分析结果信息提交给指令优化模块。指令优化模块首先会确定出第二分析结果信息的各分词,并基于各分词与预设策略库中的索引词的匹配情况,确定出匹配度。若匹配度大于等于匹配阈值,将索引词对应的策略确定为第二策略,以便sql变更脚本能够及时的被优化,确定出语法正确的sql变更脚本。
示例性地,语法分析模块在确定sql变更脚本不可执行时,生成sql变更脚本不可执行的分析结果信息(比如sql变更脚本存在语法错误)。然后,可以通过基于TCP(Transmission  Control Protocol,传输控制协议)的连接方式与指令优化模块建立连接关系,将sql变更脚本以及分析结果信息传输给指令优化模块。指令优化模块从分析结果信息“sql变更脚本存在语法错误,导致在数据库中执行出错”中确定出分词,比如“语法”、“错误”或“语法错误”等分词。将“语法”、“错误”、“执行出错”或“语法错误”等分词与预设策略库中的索引词进行逐一匹配,确定出多个匹配度,比如确定出5个匹配度,即0.8、0.6、0.5、0.3、0.2,假设匹配阈值为0.7,则将该5个匹配度都与匹配阈值进行比较,即可得出只有0.8大于0.7,因此,可以将匹配度0.8所对应的策略确定为用于优化存在语法错误的sql变更脚本,或者,直接将该5个匹配度进行比对,确定出最大匹配度,并将最大匹配度所对应的策略确定为用于优化存在语法错误的sql变更脚本,从而得到语法正确的sql变更脚本。
基于此,下面对本发明实施例中数据库变更脚本的评估方法的实施过程进行具体描述。
Step1:接收模块接收运维人员提交的sql变更语句。
其中,接收模块可以是独立的物理服务器,也可以是多个物理服务器构成的服务器集群或者分布式系统。
具体实施过程中,运维人员可以向接收模块发送sql变更请求(或sql变更指令),该sql变更请求包括sql变更语句(或称为sql变更脚本)。接收模块在接收到sql变更请求后,解析该sql变更请求得到sql变更语句,并将该发送给语法分析模块。例如,接收模块可以预先给运维人员提供服务界面,运维人员可以在该服务界面输入sql变更请求,以将sql变更请求提交给接收模块。接收模块在接收到sql变更请求后,解析该sql变更请求得到sql变更语句,并将该发送给语法分析模块。或者,运维人员可以在该服务界面直接输入sql变更语句,接收模块在接收到sql变更语句后,将该发送给语法分析模块。
其中,以运维人员向接收模块发送sql变更请求为例,若存在多条sql变更语句,运维人员可以基于该多条sql变更语句生成多个sql变更请求,并依次在接收模块提供的服务界面上输入该多个sql变更请求。接收模块可以每接收到一个sql变更请求就立即进行解析得到对应的sql变更语句,或者可以在全部接收该多个sql变更请求后,再对该多个sql变更请求进行解析,得到对应的多个sql变更语句。此外,运维人员也可以将该多条sql变更语句进行打包处理,得到数据包,并基于该数据包生成sql变更请求,在接收模块提供的服务界面上输入该ql变更请求。接收模块在接收到该sql变更请求后进行解析得到对应的多个sql变更语句。
需要说明的是,该接收模块还可以接收指令优化模块发送的sql变更语句优化策略以及sql变更语句的执行结果。
Step2:语法分析模块对sql变更语句进行分析,确定sql变更语句的语法正确性。
语法分析模块在接收到接收模块发送的sql变更语句后,通过预先设定的sql语法规则对sql变更语句进行分析,判断sql变更语句的语法正确性。若确定sql变更语句的语法正确,则说明sql变更语句能够在数据库表成功执行。若确定sql变更语句的语法不正确,则说明sql变更语句不能在数据库表成功执行,并确定出sql变更语句不能执行的影响结果,此时会将存在语法错误的sql变更语句以及sql变更语句不能执行的影响结果提交给指令优化模块,以使指令优化模块对存在语法错误的sql变更语句进行语法调整,确定出语法正确的sql变更语句。
此外,在确定sql变更语句的语法正确时,语法分析模块也会确定出sql变更语句所需要变更的目标对象(比如变更所涉及的表、表中的字段以及表中的数据行数、索引条件等)。 然后将sql变更语句以及对应的分析结果提交给影响分析模块。该分析结果包括目标变更对象和sql变更语句的语法是正确的。具体地,语法分析模块在判断sql变更语句的语法是否正确的过程中,可以识别出sql变更语句所需要变更的目标对象。然后,将sql变更语句以及对应的分析结果(目标变更对象和sql变更语句的语法是正确的)进行打包处理,形成一个数据包,并将该数据包提交给影响分析模块。或者,也可以将sql变更语句以及对应的分析结果直接一起提交给影响分析模块。
示例性地,语法分析模块在接收到sql变更语句后,可以通过预先设定好的人工智能自然语言(NLP,Natural Language Processing)语法分析模型对sql变更语句进行分析,即利用自然语言语法分析模型中的词法分析和语法分析对sql变更语句进行分析,以判断sql变更语句的语法正确性。其中,词法分析所采用的是Lex词法分析器,语法分析所采用的是Bison语法分析器。
其中,利用Lex词法分析器对sql变更语句进行词法分析,即,将sql变更语句中每个字符转化成对应的标识符(token),转化后的标识符容易被后续的Bison语法分析器进行处理。具体地,Lex词法分析器将sql变更语句与常规表达式进行匹配,即,一次读入一个输入字符(即一个词汇),直至找到一个与输入字符匹配的模式,在找到匹配的模式后,确定出一个对应的token。每一个token都会对应一个Bison语法分析器中的终结符(终结符是不可拆分的最小元素)。每一个token加上其对应的终结符就可以构成一个字符串,然后这些字符串会被分为两组,即sql关键字和sql函数,该sql关键字和sql函数分别对应一个数组。此外,考虑到sql关键字(比如select、from、where等)是一个固定的集合,则可以使用数据结构字典树Trie树(一种哈希树的变种)来储存sql关键字数组。
如图3所示,图3为本发明实施例提供的一种Trie树的结构示意图。Trie树上存储有关键字数组,可以根据Trie树来查找sql变更语句中的关键字。具体地,在形成Trie树后,基于Trie树,并调用Lex词法分析器中的get_hash_symbol()函数就可以确定出sql变更语句中的关键字。即,利用Lex词法分析器中的get_hash_symbol()函数对sql变更语句中每个词汇进行处理,确定出各词汇的哈希值。针对每个词汇,将该词汇的哈希值与Trie树(即关键字库)中的关键字的哈希值进行比较,确定该词汇是否为关键字,若出现相等,则确定该词汇为关键字,否则确定该词汇不为关键字。
如图4所示,为本发明实施例提供的一种sql词法分析的状态机示意图。示例性地,以sql变更语句为“select*from table1;”为例,按照图所示的流程进行字符匹配,以便确定出相应字符对应的token。首先匹配出select,并确定出select对应的token,即SELECT_SYM748。紧接着继续开始下一个字符的匹配,此时遇到空格会过滤,然后继续匹配出*,并确定出*对应的token,即*42。再继续开始下一个字符的匹配。匹配出from,并确定出from对应的token,即FROM 452。然后,由于table1为表名,表名是可以自定义的,每个自定义的表名都可能不相同,因此,此处无需确定表名所对应的token。直接继续开始下一个字符的识别,在匹配出一个特殊字符后,确定该特殊字符是否为结束字符,若是,则确定出该结束字符对应的token,即END_OF_INPUT 411。基于此,即可确定出sql变更语句“select*from table1;”中相应字符所对应的token。
在对sql变更语句进行词法分析后,就开始对词法分析后的sql变更语句(即sql变更语句所对应的各token)进行语法分析。具体地,Bison语法分析器根据预先定义好的规则(规则是指匹配上对应字符之后,执行相应的动作),对基于Lex词法分析器处理过的sql 变更语句进行处理,构建一课语法分析树。当处理一个语法分析树时,会创建一组状态,每个状态都对应一个或者多个分析过的规则中的可能的位置。当语法分析器读取记号(token)时,每当它读到的记号无法结束一条规则时,它将把这个记号压入一个内部堆栈,然后切换到一个新状态,这个新状态就能够反映出刚刚读取的记号。当压入栈内的所有的语法符号已经等价于一个规则的右部时,就把右部的这些符号全部从堆栈中弹出,然后把规则中的左部语法符号压入堆栈。
参考图5,图5为本发明实施例提供的一种构建语法分析树的示意图。示例性地,继续以sql变更语句为“select*from table1;”为例,并按照图5所示的流程对构建sql变更语句的语法分析树的过程进行描述。首先,调用sql.tab.c中的解析函数,对词法分析后的sql变更语句进行解析,得到select_statement的状态,将select_statement作为参数,去匹配语法规则,并执行相应的动作,即可构建一课语法树。即,按照语法规则,对select_statement(即select*from table1)可按照从上到下的顺序进行构建,首先构建出第一层级,该层级包括select、selection和table expression。再基于table expression构建出第二层级,该层级包括from clause和option order by clause。然后,基于from clause构建出第三层级,该层级包括from、table refer list和option where clause,并基于table refer list继续构建出第四层级table refer和第五层级table。由于sql变更语句“select*from table1;”中没有相应的order by clause和相应的where clause,因此无需构建。此外,由于sql变更语句“select*from table1;”中只有一个table1,因此也无需构建第四层级和第五层级。在构建语法分析树的过程中,如果语法分析树能够构建成功,则确认sql变更语句的语法验证通过,并将分析结果提交给影响分析模块。如果语法分析树构建失败,比如sql变更语句“select*from table1;”中缺少from(或table1等),则在构建第二层级时构建不出from clause,则可以确认sql变更语句的语法存在错误,并将sql变更语句和错误信息(比如缺少from的错误信息等)提交给指令优化模块,以使指令优化模块基于错误信息对sql变更语句进行语法调整,确定出语法正确的sql变更语句。然后将语法正确的sql变更语句发送给运维人员进行确认。
Step3:影响分析模块对sql变更语句进行影响结果分析,确定出sql变更语句在变更时所产生的影响结果信息。
影响分析模块在接收到语法分析模块发送的数据包后,对数据包进行解析处理,得到sql变更语句以及对应的分析结果,或者接收语法分析模块直接一起发送的sql变更语句以及对应的分析结果。并向数据库状态采集模块发送数据获取请求,该数据获取请求中包括影响分析模块的标识和目标变更对象。数据库状态采集模块在接收到数据获取请求后,对数据获取请求进行解析得到影响分析模块的标识和目标变更对象,并基于目标变更对象实时从生产数据库系统中获取对应的数据库表的状态信息,然后将数据库表的状态信息发送给影响分析模块的标识对应的影响分析模块。或者,数据库状态采集模块也可以预先从生产数据库系统中采集数据库表的状态信息,并存储在内存中,如此,在接收到数据获取请求后,对数据获取请求进行解析得到影响分析模块的标识和目标变更对象,并基于目标变更对象从内存中获取对应的数据库表的状态信息,然后将数据库表的状态信息发送给影响分析模块的标识对应的影响分析模块。
其中,数据库表的状态信息可以包括以下至少一项:数据库表容量大小(含索引)、数据库表行数大小、数据库表主键信息、数据库表索引信息、目标变更对象影响范围(行 数)、数据库表访问热点情况(即数据库表访问请求频繁度)。
影响分析模块结合数据库表的状态信息和各影响策略条件,确定sql变更语句的变更是否对数据库存在异常影响。具体地,数据库表的状态信息包括各子状态信息,针对每个子状态信息,影响分析模块确定影响策略条件库中是否存在与该子状态信息匹配的影响策略条件,其中,影响策略条件库中存储有各影响策略条件。若存在,则确定sql变更语句的变更对数据库存在异常影响,并基于该子状态信息所匹配的影响策略条件从分析结果库中确定出影响结果,并将影响结果和sql变更语句提交到指令优化模块进行优化处理。若不存在,则确定sql变更语句的变更对数据库不存在异常影响,可直接在数据库中基于sql变更语句进行变更。
其中,示例性地,影响策略条件可以包括(1)数据库表容量大小>10Gb,需要结合访问热点情况,预测未来业务低谷时间段;(2)影响数据库行数超过100000行,需要进行拆分执行;(3)变更数据库sql变更语句缺失索引,且影响行数超过5000行等。在实际应用场景中,本领域技术人员可以根据经验或实际场景需要进行设置,本发明实施例对此并不作限定。
在一种可能的实现方式中,影响分析模块可以预先设置各影响策略条件所对应的影响结果,并将各影响策略条件所对应的影响结果存储在分析结果库中。在从分析结果库中确定出影响结果时,针对某一子状态信息,若该子状态信息从影响策略条件库中匹配出对应的影响策略条件,则可以基于该影响策略条件从分析结果库中匹配出对应的影响结果。
此外,影响分析模块使用记忆神经网络算法对采集到的数据库表访问热点情况进行分析预测,确定出针对数据库表访问热点情况的预测结果信息。示例性地,影响分析模块使用Lstm算法对数据库表访问热点情况进行分析预测,预测出一个未来的访问低谷时间段,该低谷时间段即为相对可靠的变更时间范围,以便sql变更语句在数据库的这个访问低谷时间段进行变更。然后,将该预测结果(即一个未来的低谷时间段)提交给指令优化模块。示例性地,假设数据库表访问热点情况的采集时刻为9:00,通过将该采集时刻的数据库表访问热点情况输入到Lstm算法中进行预测,即可预测出一个访问低谷时间段(比如15:00-15:30),并将该访问低谷时段作为sql变更脚本在数据库中进行变更的变更时段,以便sql变更脚本根据影响分析模块给出的访问低谷时间段(比如15:00-15:30)在数据库中进行变更,如此可以避免sql变更脚本在非访问低谷时间段进行变更时造成数据库表无法访问。其中,使用Lstm算法对数据库表访问热点情况进行分析预测的示意图可以如图6所示。
Step4:指令优化模块基于接收到的影响结果,从预设策略库中确定出对应的优化策略。
指令优化模块可以接收来自语法分析模块的影响结果,也可以接收来自影响分析模块的影响结果。针对每个影响结果,可以利用全文索引算法从预设策略库中匹配出对应的优化策略。其中,如图7所示,图7为本发明实施例提供的一种全文索引算法的过程示意图。基于图可知,指令优化模块所使用的全文索引算法主要分为两个过程,即索引创建(Indexing)和搜索索引(Search Index)。
其中,索引创建即为预先定义好各影响结果所对应的优化策略,并将预先定义好各影响结果所对应的优化策略存储在策略库中。示例性地,策略库中可以包括(1)sql变更语句语法错误时,则修正语法错误,给出正确的sql变更语句;(2)变更目标数据库表容量超过10Gb时,会根据影响分析模块中预测的建议变更时间段进行变更;(3)变更对象影 响记录行数超过100000行时,会自动将该sql变更语句拆解生成多个变更指令,以减少每一次变更对数据库表的影响等。在实际应用场景中,本领域技术人员可以根据经验或实际场景需要进行设置,本发明实施例对此并不作限定。
在搜索索引时(即检索策略库,去匹配对应的优化策略),同样会生成一课语法树进行检索,对输入的检索语句(即影响结果)进行拆分,关键字识别(AND,NOT)等。对拆分的词元进行语言处理,再由关键字与处理后的词生成语法树。根据生成的语法树进行搜索,即可获得符合设定条件的文档列表。示例性地,如图8所示,图8为本发明实施例提供的一种基于A、B、C形成的语法树示意图。基于图8所示的语法树,则会搜索包含A、B、C的文档列表,然后用A和B的文档列表做交集,所得的结果集再与C做差集,最后得到的结果,就是符合搜索条件的文档列表。其中,A、B、C即为处理后的词。此外,通过向量空间模型的算法,可以得到结果的相关性。比较简单的实现描述如下:在建立索引的时候,得到了Inverse document Frequency(逆向文件频率)和Term Frequency(词频),Term Frequency越高,说明文档的相关性越高;Inverse document Frequency越高,说明相关性越弱。根据上面的排序结果,就可以确定出最终的优化策略。示例性地,假设指令优化模块收到影响分析模块提交的影响结果为“变更目标数据库表容量超过10Gb,导致数据库表无法访问”,则可以从影响结果中确定出分词,比如“变更目标”、“数据库表容量”、“超过10Gb”等分词。再将“变更目标”、“数据库表容量”、“超过10Gb”等分词与预设策略库中的索引词进行逐一匹配,确定出多个匹配度,比如确定出6个匹配度,即0.89、0.8、0.75、0.65、0.6、0.5,假设匹配阈值为0.85,则将该6个匹配度都与匹配阈值进行比较,即可得出只有0.89大于0.85。因此,可以将匹配度0.89所对应的策略确定为用于优化造成数据库表无法访问的sql变更脚本,或者,直接将该6个匹配度进行比对,确定出最大匹配度,并将最大匹配度所对应的策略确定为用于优化造成数据库表无法访问的sql变更脚本,以便sql变更脚本根据影响分析模块给出的访问低谷时间段(比如15:00-15:30)在数据库中进行变更,如此可以避免sql变更脚本在非访问低谷时间段进行变更时造成数据库表无法访问,从而可以确保数据库表能够被正常的访问,并可以确保业务系统能够正常运行。
其中,对于新出现的优化策略(即新创建的索引),也会将该优化策略存储在策略库中。如图9所示,图9为本发明实施例提供的一种对新创建的索引进行存储的示意图。基于图,在确定新创建的索引较长时,可以将该新创建的索引拆分为两个或者两个以上的子索引进行存储在策略库中。比如,将某一较长的索引先拆分为子索引1和子索引2。再将子索引1和子索引2存储在策略库中。
基于相同的技术构思,图10示例性的示出了本发明实施例提供的一种数据库变更脚本的评估装置,该装置可以执行数据库变更脚本的评估方法的流程。
如图10所示,该装置包括:
接收单元1001,用于接收针对数据库的结构化查询语言sql变更脚本;
处理单元1002,用于按照词语分析规则,确定所述sql变更脚本是否可执行;若可执行,则基于所述sql变更脚本中的目标变更对象,获取所述目标变更对象关联的数据库表的状态信息;根据所述数据库表的状态信息,确定所述sql变更脚本在变更时所产生的第一分析结果信息;基于所述第一分析结果信息,从预设策略库中匹配出用于优化所述sql变更脚本的第一策略;所述预设策略库中存储有分析结果信息以及分析结果信息对应的策略。
可选地,所述处理单元1002具体用于:
基于词法分析规则对所述sql变更脚本进行词法分析,确定出所述sql变更脚本中的各关键字;
基于所述各关键字,利用语法分析规则对所述sql变更脚本进行语法分析,确定所述sql变更脚本是否符合语法规则,从而确定所述sql变更脚本是否可执行。
可选地,所述处理单元1002具体用于:
通过构建的关键字查找树,确定所述sql变更脚本中的各词汇;
针对每个词汇,确定关键字库中是否存在与所述词汇的哈希值相等的关键字;
若存在,则将所述词汇确定为关键字。
可选地,所述处理单元1002具体用于:
按照语法分析规则,以所述sql变更脚本中的各关键字作为构建语法分析树的参数,确定是否可构建出语法分析树;
若是,则确定所述sql变更脚本的语法正确,否则确定所述sql变更脚本的语法存在错误。
可选地,所述处理单元1002具体用于:
所述数据库表的状态信息包括以下至少一项:容量、行数、主键信息、索引信息、访问请求状态以及目标变更对象的影响范围。
可选地,所述处理单元1002具体用于:
针对所述数据库表的状态信息中每个子状态信息,确定所述子状态信息是否符合设定的影响策略条件;
若符合,则生成与所述子状态信息对应的影响结果信息,以及基于记忆神经网络模型对所述数据库表的状态信息进行预测,确定出预测结果信息;
将所述影响结果信息和所述预测结果信息确定为所述第一分析结果信息。
可选地,所述处理单元1002具体用于:
将所述数据库表的状态信息中当前时刻的数据库表访问热点信息输入到所述记忆神经网络模型进行分析预测,确定出在当前时刻之后所述数据库表的访问量处于低谷的时间段;
将所述时间段作为sql变更脚本在数据库中进行变更时的变更时段。
可选地,所述处理单元1002还用于:
若确定所述sql变更脚本不可执行,则生成所述sql变更脚本的第二分析结果信息;
根据所述第二分析结果信息,从所述预设策略库中匹配出用于优化所述sql变更脚本的第二策略。
可选地,所述处理单元1002具体用于:
确定出所述第一分析结果信息中的各分词;
基于所述各分词与所述预设策略库中的索引词的匹配情况,确定出匹配度;
若所述匹配度大于等于匹配阈值,将所述索引词对应的策略确定为所述第一策略;
基于所述第一策略,优化所述sql变更脚本。
基于相同的技术构思,本发明实施例还提供了一种计算设备,如图11所示,包括至少一个处理器1101,以及与至少一个处理器连接的存储器1102,本发明实施例中不限定处理器1101与存储器1102之间的具体连接介质,图11中处理器1101和存储器1102之间通过 总线连接为例。总线可以分为地址总线、数据总线、控制总线等。
在本发明实施例中,存储器1102存储有可被至少一个处理器1101执行的指令,至少一个处理器1101通过执行存储器1102存储的指令,可以执行前述的数据库变更脚本的评估方法中所包括的步骤。
其中,处理器1101是计算设备的控制中心,可以利用各种接口和线路连接计算设备的各个部分,通过运行或执行存储在存储器1102内的指令以及调用存储在存储器1102内的数据,从而实现数据处理。可选的,处理器1101可包括一个或多个处理单元,处理器1101可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户界面和应用程序等,调制解调处理器主要处理下发指令。可以理解的是,上述调制解调处理器也可以不集成到处理器1101中。在一些实施例中,处理器1101和存储器1102可以在同一芯片上实现,在一些实施例中,它们也可以在独立的芯片上分别实现。
处理器1101可以是通用处理器,例如中央处理器(CPU)、数字信号处理器、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件,可以实现或者执行本发明实施例中公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者任何常规的处理器等。结合数据库变更脚本的评估方法实施例所公开的方法的步骤可以直接体现为硬件处理器执行完成,或者用处理器中的硬件及软件模块组合执行完成。
存储器1102作为一种非易失性计算机可读存储介质,可用于存储非易失性软件程序、非易失性计算机可执行程序以及模块。存储器1102可以包括至少一种类型的存储介质,例如可以包括闪存、硬盘、多媒体卡、卡型存储器、随机访问存储器(Random Access Memory,RAM)、静态随机访问存储器(Static Random Access Memory,SRAM)、可编程只读存储器(Programmable Read Only Memory,PROM)、只读存储器(Read Only Memory,ROM)、带电可擦除可编程只读存储器(Electrically Erasable Programmable Read-Only Memory,EEPROM)、磁性存储器、磁盘、光盘等等。存储器1102是能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。本发明实施例中的存储器1102还可以是电路或者其它任意能够实现存储功能的装置,用于存储程序指令和/或数据。
基于相同的技术构思,本发明实施例还提供了一种计算机可读存储介质,其存储有可由计算设备执行的计算机程序,当所述程序在所述计算设备上运行时,使得所述计算设备执行上述数据库变更脚本的评估方法的步骤。
本发明是参照根据本发明的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。
显然,本领域的技术人员可以对本发明进行各种改动和变型而不脱离本发明的精神和范围。这样,倘若本发明的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本发明也意图包含这些改动和变型在内。

Claims (10)

  1. 一种数据库变更脚本的评估方法,其特征在于,包括:
    接收针对数据库的结构化查询语言sql变更脚本;
    按照词语分析规则,确定所述sql变更脚本是否可执行;
    若可执行,则基于所述sql变更脚本中的目标变更对象,获取所述目标变更对象关联的数据库表的状态信息;
    根据所述数据库表的状态信息,确定所述sql变更脚本在变更时所产生的第一分析结果信息;
    基于所述第一分析结果信息,从预设策略库中匹配出用于优化所述sql变更脚本的第一策略;所述预设策略库中存储有分析结果信息以及分析结果信息对应的策略。
  2. 如权利要求1所述的方法,其特征在于,所述按照词语分析规则,确定所述sql变更脚本是否可执行,包括:
    基于词法分析规则对所述sql变更脚本进行词法分析,确定出所述sql变更脚本中的各关键字;
    基于所述各关键字,利用语法分析规则对所述sql变更脚本进行语法分析,确定所述sql变更脚本是否符合语法规则,从而确定所述sql变更脚本是否可执行。
  3. 如权利要求2所述的方法,其特征在于,所述基于词法分析规则对所述sql变更脚本进行词法分析,确定出所述sql变更脚本中的各关键字,包括:
    通过构建的关键字查找树,确定所述sql变更脚本中的各词汇;
    针对每个词汇,确定关键字库中是否存在与所述词汇的哈希值相等的关键字;
    若存在,则将所述词汇确定为关键字。
  4. 如权利要求2所述的方法,其特征在于,所述基于所述各关键字,利用语法分析规则对所述sql变更脚本进行语法分析,确定所述sql变更脚本是否符合语法规则,包括:
    按照语法分析规则,以所述sql变更脚本中的各关键字作为构建语法分析树的参数,确定是否可构建出语法分析树;
    若是,则确定所述sql变更脚本的语法正确,否则确定所述sql变更脚本的语法存在错误。
  5. 如权利要求1至4任一项所述的方法,其特征在于,所述根据所述数据库表的状态信息,确定所述sql变更脚本在变更时所产生的第一分析结果信息,包括:
    针对所述数据库表的状态信息中每个子状态信息,确定所述子状态信息是否符合设定的影响策略条件;
    若符合,则生成与所述子状态信息对应的影响结果信息,以及基于记忆神经网络模型对所述数据库表的状态信息进行预测,确定出预测结果信息;
    将所述影响结果信息和所述预测结果信息确定为所述第一分析结果信息。
  6. 如权利要求5所述的方法,其特征在于,所述基于记忆神经网络模型对所述数据库表的状态信息进行预测,确定出预测结果信息,包括:
    将所述数据库表的状态信息中当前时刻的数据库表访问热点信息输入到所述记忆神经网络模型进行分析预测,确定出在当前时刻之后所述数据库表的访问量处于低谷的时间段;
    将所述时间段作为sql变更脚本在数据库中进行变更时的变更时段。
  7. 如权利要求1所述的方法,其特征在于,所述方法还包括:
    若确定所述sql变更脚本不可执行,则生成所述sql变更脚本的第二分析结果信息;
    根据所述第二分析结果信息,从所述预设策略库中匹配出用于优化所述sql变更脚本的第二策略。
  8. 如权利要求1至4任一项所述的方法,其特征在于,从预设策略库中匹配出用于优化所述sql变更脚本的第一策略,包括:
    确定出所述第一分析结果信息中的各分词;
    基于所述各分词与所述预设策略库中的索引词的匹配情况,确定出匹配度;
    若所述匹配度大于等于匹配阈值,将所述索引词对应的策略确定为所述第一策略;
    基于所述第一策略,优化所述sql变更脚本。
  9. 一种数据库变更脚本的评估装置,其特征在于,包括:
    接收单元,用于接收针对数据库的结构化查询语言sql变更脚本;
    处理单元,用于按照词语分析规则,确定所述sql变更脚本是否可执行;若可执行,则基于所述sql变更脚本中的目标变更对象,获取所述目标变更对象关联的数据库表的状态信息;根据所述数据库表的状态信息,确定所述sql变更脚本在变更时所产生的第一分析结果信息;基于所述第一分析结果信息,从预设策略库中匹配出用于优化所述sql变更脚本的第一策略;所述预设策略库中存储有分析结果信息以及分析结果信息对应的策略。
  10. 一种计算设备,其特征在于,包括至少一个处理器以及至少一个存储器,其中,所述存储器存储有计算机程序,当所述程序被所述处理器执行时,使得所述处理器执行权利要求1至8任一权利要求所述的方法。
PCT/CN2021/134646 2021-04-30 2021-11-30 一种数据库变更脚本的评估方法及装置 WO2022227566A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110478503.X 2021-04-30
CN202110478503.XA CN113110866B (zh) 2021-04-30 2021-04-30 一种数据库变更脚本的评估方法及装置

Publications (1)

Publication Number Publication Date
WO2022227566A1 true WO2022227566A1 (zh) 2022-11-03

Family

ID=76720633

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/134646 WO2022227566A1 (zh) 2021-04-30 2021-11-30 一种数据库变更脚本的评估方法及装置

Country Status (2)

Country Link
CN (1) CN113110866B (zh)
WO (1) WO2022227566A1 (zh)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116245406A (zh) * 2023-02-09 2023-06-09 江苏省工商行政管理局信息中心 基于运维质量管理数据库的软件运维质量评价方法及系统
CN116310440A (zh) * 2023-03-16 2023-06-23 中国华能集团有限公司北京招标分公司 一种规则引擎使用方法
CN116955504A (zh) * 2023-09-21 2023-10-27 太平金融科技服务(上海)有限公司 一种数据处理方法、装置、电子设备和存储介质
CN117331908A (zh) * 2023-08-23 2024-01-02 上海麦杰科技股份有限公司广州分公司 一种实时数据库在线扩容方法及系统装置

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113110866B (zh) * 2021-04-30 2023-07-21 深圳前海微众银行股份有限公司 一种数据库变更脚本的评估方法及装置
CN116108025B (zh) * 2023-04-14 2023-08-01 安元科技股份有限公司 一种数据虚拟化性能优化方法
CN116720628B (zh) * 2023-08-07 2023-11-03 建信金融科技有限责任公司 系统投产变更预测方法、装置、设备及存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040249830A1 (en) * 2003-06-06 2004-12-09 Dmitry Sonkin Database object script generation method and system
CN107368582A (zh) * 2017-07-21 2017-11-21 深信服科技股份有限公司 一种sql语句检测方法及系统
CN110209684A (zh) * 2019-06-03 2019-09-06 深圳前海微众银行股份有限公司 数据库ddl变更操作的跟踪方法、装置、系统及介质
CN110795455A (zh) * 2019-09-06 2020-02-14 中国平安财产保险股份有限公司 依赖关系解析方法、电子装置、计算机设备及可读存储介质
CN113110866A (zh) * 2021-04-30 2021-07-13 深圳前海微众银行股份有限公司 一种数据库变更脚本的评估方法及装置

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040249830A1 (en) * 2003-06-06 2004-12-09 Dmitry Sonkin Database object script generation method and system
CN107368582A (zh) * 2017-07-21 2017-11-21 深信服科技股份有限公司 一种sql语句检测方法及系统
CN110209684A (zh) * 2019-06-03 2019-09-06 深圳前海微众银行股份有限公司 数据库ddl变更操作的跟踪方法、装置、系统及介质
CN110795455A (zh) * 2019-09-06 2020-02-14 中国平安财产保险股份有限公司 依赖关系解析方法、电子装置、计算机设备及可读存储介质
CN113110866A (zh) * 2021-04-30 2021-07-13 深圳前海微众银行股份有限公司 一种数据库变更脚本的评估方法及装置

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116245406A (zh) * 2023-02-09 2023-06-09 江苏省工商行政管理局信息中心 基于运维质量管理数据库的软件运维质量评价方法及系统
CN116245406B (zh) * 2023-02-09 2023-09-19 江苏省工商行政管理局信息中心 基于运维质量管理数据库的软件运维质量评价方法及系统
CN116310440A (zh) * 2023-03-16 2023-06-23 中国华能集团有限公司北京招标分公司 一种规则引擎使用方法
CN117331908A (zh) * 2023-08-23 2024-01-02 上海麦杰科技股份有限公司广州分公司 一种实时数据库在线扩容方法及系统装置
CN117331908B (zh) * 2023-08-23 2024-05-14 上海麦杰科技股份有限公司广州分公司 一种实时数据库在线扩容方法及系统装置
CN116955504A (zh) * 2023-09-21 2023-10-27 太平金融科技服务(上海)有限公司 一种数据处理方法、装置、电子设备和存储介质
CN116955504B (zh) * 2023-09-21 2023-12-19 太平金融科技服务(上海)有限公司 一种数据处理方法、装置、电子设备和存储介质

Also Published As

Publication number Publication date
CN113110866A (zh) 2021-07-13
CN113110866B (zh) 2023-07-21

Similar Documents

Publication Publication Date Title
WO2022227566A1 (zh) 一种数据库变更脚本的评估方法及装置
US10489463B2 (en) Finding documents describing solutions to computing issues
US20180107933A1 (en) Web page training method and device, and search intention identifying method and device
WO2016188279A1 (zh) 一种故障谱的生成、基于故障谱的检测方法和装置
WO2020258487A1 (zh) 一种问答关系排序方法、装置、计算机设备及存储介质
US20220365957A1 (en) Log parsing method and device, server and storage medium
US20220083874A1 (en) Method and device for training search model, method for searching for target object, and storage medium
US20220342950A1 (en) System and method for searching based on text blocks and associated search operators
US11935315B2 (en) Document lineage management system
WO2015084757A1 (en) Systems and methods for processing data stored in a database
Hameed et al. SURAGH: Syntactic Pattern Matching to Identify Ill-Formed Records.
US11615080B1 (en) System, method, and computer program for converting a natural language query to a nested database query
CN112579755A (zh) 基于人工智能和云计算的信息应答方法及信息互动平台
CN109977397B (zh) 基于词性组合的新闻热点提取方法、系统及存储介质
CN116150376A (zh) 一种样本数据分布优化方法、装置和存储介质
CN116737758A (zh) 一种数据库查询语句的生成方法、装置、设备及存储介质
US9223833B2 (en) Method for in-loop human validation of disambiguated features
CN114647739B (zh) 实体链指方法、装置、电子设备及存储介质
CN115203758A (zh) 一种数据安全存储方法、系统及云平台
CN115098061A (zh) 软件开发文档优化方法、装置、计算机设备及存储介质
CN110309258A (zh) 一种输入检查方法、服务器和计算机可读存储介质
Hirschmeier et al. Improving recall and precision in unsupervised multi-label document classification tasks by combining word embeddings with TF-IDF
CN112988704A (zh) 一种基于ai咨询数据库集群搭建方法和系统
US20170147707A1 (en) Apparatus and method for managing graph data
KR102622433B1 (ko) 데이터의 타입을 자동으로 판별하여 메타데이터를 생성하는 방법 및 이를 위한 머신러닝/딥러닝 모델을 이용한 데이터 타입 판별 장치

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21939025

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 130224)