Storage process substitution system and method based on artificial intelligence
Through the artificial intelligence-based stored process replacement system, the stored process is decomposed and parsed, and soft verification and hard verification are performed, which solves the consistency and debugging problems of database storage process under distributed deployment, reduces enterprise development costs, and improves efficiency. System portability and ease of debugging.
Patent Information
- Application Number
- CN202410623541.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-20
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2044-05-20
AI Technical Summary
Stored procedures in existing databases face consistency, query and transaction problems under distributed deployment, high debugging costs, poor portability, difficult debugging, and high coupling, which increase enterprise development costs.
Adopt a stored process replacement system based on artificial intelligence. By decomposing the stored process into multiple subtasks, use the subtask parsing module, parameter replacement module, subtask execution verification module and verification result return module to perform soft verification or hard verification. It simplifies the business process, directly calls the built-in functions of the database to perform complex judgments and operations, and converts the results into JSON format feedback.
It achieves fine parsing and replacement of stored procedures, reduces operation and development costs, improves portability and ease of debugging, reduces coupling, and supports flexible combination and rapid configuration of complex business logic.
Smart Images

Figure CN118535604A
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of data access technology, and in particular, relates to a storage process replacement system and method based on artificial intelligence. Background Art
[0002] Stored procedure replacement refers to the process of replacing traditional stored procedures with other technologies or methods; a traditional stored procedure is a collection of SQL statements stored in a database that can be called and executed when needed; the purpose of stored procedure replacement is to improve the maintainability, scalability and performance of the system. Traditional stored procedures may have some disadvantages, such as difficult code maintenance, debugging and version management; stored procedure replacement refers to replacing traditional stored procedures with other technologies or methods to improve the maintainability, scalability and performance of the system; different alternatives can be selected based on specific needs and technology selection.
[0003] Chinese patent CN103842973A discloses a method for monitoring stored procedures executed in a database management system, the method may include - providing the following event data and an identification of the stored procedure for one of the stored procedures: a first time indicating the start of execution of the stored procedure; a second time indicating the end of execution of the stored procedure; at least one SQL statement identifier assigned to a SQL statement executed as part of the stored procedure; and for each SQL statement identifier, a counter indicating the number of executions of the associated SQL statement as part of the stored procedure between the first time and the second time. In addition, the method may include providing periodic database monitoring information through the database management system, including parameter values of executed SQL statements that can be identified by the SQL statement identifier. In addition, the value may be associated with the number of executions.
[0004] Currently in the Internet industry, the use of stored procedure components in databases is relatively common. However, if the database cluster adopts a distributed deployment, it will face many problems, including consistency problems, query problems and transaction problems when the database is adding, deleting, modifying and checking data. The entire architecture capability requirements suddenly rise to a very professional level, resulting in increased debugging costs. In addition, the stored procedures in the existing databases face problems such as poor portability, difficult debugging, closed system and high coupling during product upgrades and iterations, which increases the company's development costs. Summary of the invention
[0005] In view of the problems in the related technology, the present invention proposes a storage process replacement system and method based on artificial intelligence to overcome the above-mentioned technical problems existing in the existing related technology.
[0006] In order to solve the above technical problems, the present invention is achieved through the following technical solutions:
[0007] The present invention is a storage process replacement method based on artificial intelligence, comprising the following steps:
[0008] S1. An initial subtask set is set according to multiple subtasks in the storage process, and each subtask in the initial subtask set is analyzed. After the analysis is completed, a subtask operator matrix is obtained;
[0009] S2. Obtaining an operator input parameter set matrix and an operator output parameter set matrix according to the subtask operator matrix, wherein the input parameter includes the data date of verification, the status of verification data and the code of the verification mechanism; the output parameter includes the rule data and the data code of the verification error;
[0010] S3, replace each input parameter in the operator input parameter set matrix and replace each output parameter in the operator output parameter set matrix. After the replacement is completed, generate a replaced subtask set and save each input parameter in the operator input parameter set matrix in the replaced subtask set;
[0011] S4, construct a scheduled task, verify the replaced subtask set, and obtain a final verification result;
[0012] The specific steps include:
[0013] According to the difference of the extended attributes of each subtask in the replaced subtask set, it is divided into soft verification and hard verification; when hard verification is performed, the query process is terminated immediately when an exception occurs, and the exception information is returned to the business system; when soft verification is performed, the query process will not be terminated when an exception occurs in the query, and after the query is completed, the final verification result and the exception information are obtained; the final verification result and the exception information are returned to the business system together;
[0014] In the query process, conditional judgments and cursor statements can be applied, which are very flexible and can directly call some built-in functions of the database, such as count, sum, avg, etc., so as to complete complex judgments and more complex calculations. Secondly, when the query returns, the query results and the final verification results are converted into a consistent JSON format and fed back to the business system to facilitate business personnel to process and analyze data. Before performing stored procedure replacement, the stored procedure replacement system of the present invention needs to be maintained first. The maintenance includes six sub-businesses, namely, job sequence maintenance, job maintenance, task maintenance, sub-task maintenance, parameter maintenance and sub-task parameter binding; after the maintenance process is completed, the stored procedure replacement system of the present invention needs to be initialized. The initialization includes four sub-businesses, namely, job sequence initialization, job initialization, task initialization and sub-task initialization; the stored procedure replacement system of the present invention can combine multiple complex functions through a simple rule logic, thereby simplifying complex business processes;
[0015] Take the e-commerce order scenario as an example: according to the functional requirements of the system, the business logic is split, and each process requires a separate engine. In different scenarios, the engine meets the actual needs of different users. For example, in the system, after the user places an order, successful payment means that the product price and payment amount meet the minimum standard, or the order settlement needs to be completed. Different business actions are often required in different scenarios;
[0016] Taking the financial scenario as an example, when a user submits an application for a certificate, he or she needs to pre-filter the blacklist, pass an anti-fraud assessment, and pass some basic risk control rules. If all business logic and rule verification are written in stored procedures, once the risk control personnel need to adjust the requirements, the database administrator and developer will need to synchronize the changes to the stored procedures that may be affected. If the engine provided by the system is used, the developer only needs to adjust the relevant rule configuration to meet the requirements of the risk control personnel, which is efficient and fast.
[0017] Preferably, the S1 comprises the following steps:
[0018] S11, according to the multiple subtasks in the stored process, set the initial subtask set a = {a1, a2, ..., a i ,...,a a′}, a i is the i-th subtask in the storage process, and a′ is the total number of subtasks in the storage process;
[0019] S12, analyzing each subtask in the initial subtask set, and after the analysis is completed, obtaining the subtask operator matrix a″, as follows:
[0020]
[0021] Among them: a i ' j ′ represents the jth operator of the i-th subtask in the storage process, a i ″′ represents the total number of operators in the i-th subtask during the storage process;
[0022] Dividing the stored procedure into multiple subtasks facilitates the subsequent parsing of the entire stored procedure, making the parsing more refined and thus making the replacement process more accurate.
[0023] Preferably, the S12 comprises the following steps:
[0024] S121, constructing a stored procedure subtask parsing model, and setting a first subtask support document matrix b according to the support document set corresponding to each subtask in the initial subtask set, as follows:
[0025]
[0026] Where: b ij represents the jth supporting document of the i-th subtask in the storage process, b i ′ is the total number of supporting documents of the i-th subtask in the storage process;
[0027] S122, according to the initial subtask set a={a1, a2, ..., a i ,...,a a′} and the first subtask support document matrix b use the BM25 algorithm to calculate the cosine similarity between each subtask and its corresponding supporting documents, and obtain the cosine similarity matrix b″, as follows:
[0028]
[0029] Where: b i ' j ′ represents the cosine similarity value between the jth supporting document of the i-th subtask and the i-th subtask in the storage process;
[0030] Sort the data in each row of the cosine similarity matrix b″ from large to small, and select the supporting documents corresponding to the first b″′ cosine similarity values to obtain the second subtask supporting document matrix c, as follows:
[0031]
[0032] Where: c ij Indicates the jth supporting document of the i-th subtask in the storage process after selection;
[0033] S123, using the dynamic word vector BERT model to analyze the initial subtask set a={a1, a2, ..., a i ,...,a a′} and the second subtask support document matrix c for word segmentation operation to obtain the initial subtask word vector matrix c′, as follows:
[0034]
[0035] Where: c i ' j is the jth word vector of the i-th subtask after word segmentation in the storage process, c i ″ is the total number of word vectors of the ith subtask in the storage process;
[0036] And the initial support document word vector set matrix c″′ is as follows:
[0037]
[0038] c i ' j ″ is the word vector set of the jth supporting document in the i-th subtask in the storage process, c i ' j ″ k is the kth word vector in the word vector set of the jth supporting document of the i-th subtask in the storage process, d ij is the total number of word vectors in the word vector set of the jth supporting document of the i-th subtask in the storage process;
[0039] S124, using the bidirectional long short-term memory neural network in the stored procedure subtask parsing model to perform context encoding processing on the initial subtask word vector matrix c′ and the initial support document word vector set matrix c″′, to obtain the support document word vector encoding matrix And the subtask word vector encoding matrix d″ is the number of hidden units in the bidirectional long short-term memory neural network;
[0040] S125, after context encoding processing is performed on the initial subtask word vector matrix c′ and the initial support document word vector set matrix c″′, sentence encoding is performed on the second subtask support document matrix c, and after the sentence encoding is completed, a support document context matrix is obtained; and then a self-attention mechanism is used to model the sentence meaning features between the sentences in the support document context matrix to obtain a support document sentence matrix;
[0041] S126, using a hierarchical memory neural network to construct a supporting document sentence reasoning chain set between each sentence in the supporting document sentence matrix, and then obtaining a subtask operator matrix a″ according to the supporting document sentence reasoning chain set;
[0042] By constructing a stored procedure subtask parsing model and cooperating with the supporting documents corresponding to each subtask in the stored procedure, each subtask in the initial subtask set is parsed, and each operator in the subtask is determined, so as to facilitate replacement. Among them, the dynamic word vector BERT model is used to segment each subtask and the corresponding supporting documents, and then the self-attention mechanism is used to model the sentence features between sentences in the context matrix of the supporting documents. This can provide a more accurate analysis and grasp of the task requirements of the supporting documents and subtasks and the methods of solving the tasks, which is conducive to subsequent replacement.
[0043] Preferably, the S125 comprises the following steps:
[0044] S1251, sentence encoding is performed on the second subtask support document matrix c, and after the sentence encoding is completed, a support document context matrix e is obtained, which specifically includes the following steps:
[0045] S12511, divide each supporting document in the second subtask supporting document matrix c into single sentences to obtain a supporting document single sentence matrix e i ' j ′ represents the total number of single sentences after the jth supporting document of the i-th subtask in the storage process is divided into single sentences;
[0046] S12512: Combine two adjacent single sentences in the same supporting document in the supporting document single sentence matrix to obtain a supporting document combined sentence matrix f ij is the total number of joint sentences of the jth supporting document in the i-th subtask in the storage process, f ij =e i ' j ′;
[0047] S12513: Supporting document single sentence matrix The data support document joint sentence matrix in The corresponding data in are merged to obtain the supporting document context matrix
[0048]
[0049] S1252: Sentence meaning feature modeling is performed between sentences in the supporting document context matrix e to obtain a supporting document sentence meaning matrix
[0050] Encoding each sentence in the supporting document makes it easier to grasp the semantics in the document and provides a data basis for modeling the semantic features between each sentence in the supporting document.
[0051] Preferably, the S126 comprises the following steps:
[0052] S1261, using a hierarchical memory neural network to support the document sentence matrix Construct a support document sentence reasoning chain matrix f″ between each sentence in a′×b″×f″′ , f″′ is the total number of sentence reasoning chains in the supporting document sentence reasoning chain set; the supporting document sentence reasoning chain matrix f″ a′×b″×f″′ Each sentence inference chain is f ij ″ k ,as follows:
[0053]
[0054] in: is the j1th sentence in the kth reasoning chain of the jth supporting document of the i-th subtask in the supporting document sentence reasoning chain set, g is the total number of sentences constituting the kth reasoning chain of the jth supporting document of the i-th subtask in the supporting document sentence reasoning chain set;
[0055] S1262: Reasoning chain matrix f″ based on the supporting document sentences a′×b″×f″′ Calculate the subtask operator score matrix g′ a′×b″×f″′ ; Construct the corresponding matrix between the sentence reasoning chain and the operator, recorded as the candidate operator matrix g″ a′×b″×f″′ ; Then select the subtask operator score matrix g′ a′×b″×f″′ The sentence reasoning chain corresponding to the maximum operator score in the sentence is matched with the candidate operator matrix g″ a′×b″×f″′ , get the subtask operator matrix a″;
[0056] By using a hierarchical memory neural network to construct a document sentence reasoning chain for the supporting documents corresponding to each subtask, the logical connection relationship between each sentence in the supporting document can be analyzed, making the analysis result more accurate.
[0057] Preferably, S2 is specifically as follows:
[0058] According to the subtask operator matrix, the operator input parameter set matrix g″′ and the operator output parameter set matrix h are obtained, which are as follows:
[0059]
[0060] Where: g i' j ″ is the input parameter set of the jth operator in the i-th subtask in the storage process, g i ' j ″ k is the kth input parameter of the jth operator of the i-th subtask in the storage process, h i ' j is the total number of input parameters of the jth operator in the i-th subtask in the storage process;
[0061] h ij is the output parameter set of the jth operator in the i-th subtask in the storage process,
[0062] h ijk is the kth output parameter of the jth operator of the i-th subtask in the storage process, h i ' j ′ is the total number of output parameters of the jth operator in the i-th subtask in the storage process;
[0063] By constructing the operator input parameter set matrix and the operator output parameter set matrix corresponding to the task operator matrix, the replacement object can be determined.
[0064] Preferably, S3 comprises the following steps:
[0065] S31, replace each input parameter in the operator input parameter set matrix and replace each output parameter in the operator output parameter set matrix to obtain a replaced operator input parameter set matrix h″′ and a replaced operator output parameter set matrix l;
[0066] S32, according to the replaced operator input parameter set matrix h″′ and the replaced operator output parameter set matrix l, obtain the replaced subtask set l′={l1′,l2′,...,l i ′,...,l a ″},l i ′ is the i-th subtask in the replaced subtask set, and the replaced operator input parameter set matrix h″′ is saved;
[0067] When the query is returned, the query results and final verification results are converted into a consistent JSON format and fed back to the business system to facilitate data processing and analysis by business personnel.
[0068] Preferably, S4 comprises the following steps:
[0069] S41, according to the replaced subtask set l′={l1′,l2′,...,l i ′,...,l a The differences in the extended attributes of each subtask in ″} are divided into soft verification mode and hard verification mode;
[0070] When hard checking is performed, the replaced subtask set l′={l1′,l2′,...,l i ′,...,l a The operators in each subtask in ″} perform database queries. When an exception occurs during the query process, the query process is immediately terminated and the exception information is returned to the business system;
[0071] When performing soft verification, the replaced subtask set l′={l1′,l2′,...,l i ′,...,l a The operators in each subtask in "} perform database query. When an exception occurs during the query process, the query process will not be terminated. After the query is completed, the final verification result and exception information are obtained;
[0072] S42, returning the final verification result and abnormal information to the business system;
[0073] If the final verification result is related to the master data information and requires separate business processing, the system will call the business system configured in the verification task table to process the data after all verification rules are executed; if no special processing is required, the verification task ends.
[0074] An artificial intelligence-based stored procedure replacement system includes a subtask parsing module, a parameter replacement module, a subtask execution verification module and a verification result return module;
[0075] The subtask parsing module is used to parse each subtask in the initial subtask set;
[0076] The parameter replacement module is used to replace each input parameter in the operator input parameter set matrix and to replace each output parameter in the operator output parameter set matrix;
[0077] The subtask execution verification module is used to perform soft verification or hard verification on the subtask according to the difference of the extended attributes of each subtask in the replaced subtask set;
[0078] The verification result returning module is used to return the final verification result and abnormal information to the business system.
[0079] The present invention has the following beneficial effects:
[0080] 1. In the present invention, by setting a task parsing module, a parameter replacement module, a subtask execution verification module and a verification result return module, statements such as conditional judgment and cursors can be applied in the query process, which has strong flexibility and can directly call some built-in functions of the database to complete complex judgments and more complex operations. Secondly, when the query is returned, the query results and the final verification results are converted into a consistent JSON format and fed back to the business system to facilitate business personnel to process and analyze data. Before performing stored procedure replacement, the stored procedure replacement system in the present invention needs to be maintained first. The maintenance includes six sub-businesses, namely, job sequence maintenance, job maintenance, task maintenance, subtask maintenance, and Maintenance, parameter maintenance and subtask parameter binding; after the maintenance process is completed, the stored procedure replacement system in the present invention needs to be initialized, and the initialization includes four sub-businesses, namely job sequence initialization, job initialization, task initialization and subtask initialization; the stored procedure replacement system of the present invention can combine multiple complex functions through a simple rule logic, thereby simplifying complex business processes. When using this system, developers should be able to directly manage the pre-configured rules in the product and configure them online; and in view of the fact that business rules of the financial system often change, the configuration is convenient and flexible, and takes effect in real time, effectively reducing the purpose of operating costs and development costs, and has good portability, simple debugging, and low coupling.
[0081] 2. In the present invention, by dividing the stored procedure into a plurality of subtasks, it is convenient to analyze the entire stored procedure later, making the analysis more refined, and thus making the replacement process more accurate.
[0082] 3. In the present invention, a hierarchical memory neural network is used to construct a document sentence reasoning chain for the supporting documents corresponding to each subtask, so that the logical connection relationship between each sentence in the supporting document can be analyzed, making the analysis result more accurate. At the same time, each sentence in the supporting document is encoded, so as to facilitate the grasp of the semantics in the document and provide a data basis for sentence feature modeling between each sentence in the supporting document.
[0083] Of course, any product implementing the present invention does not necessarily need to achieve all of the advantages described above at the same time. BRIEF DESCRIPTION OF THE DRAWINGS
[0084] In order to more clearly illustrate the technical solutions of the embodiments of the invention, the drawings required for describing the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the invention. For ordinary technicians in this field, they can also obtain drawings based on these drawings without paying creative work.
[0085] Figure 1The present invention is a flowchart of replacing a stored procedure by an artificial intelligence-based stored procedure replacement system. DETAILED DESCRIPTION
[0086] The following will be combined with the drawings in the embodiments of the invention to clearly and completely describe the technical solutions in the embodiments of the invention. Obviously, the described embodiments are only part of the embodiments of the invention, not all of the embodiments. Based on the embodiments in the invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the invention.
[0087] In the description of the present invention, it is necessary to understand that the terms "opening", "upper", "lower", "top", "middle", "inside" and the like indicating orientation or positional relationship are only for the convenience of describing the invention and simplifying the description, and do not indicate or imply that the components or elements referred to must have a specific orientation, be constructed and operate in a specific orientation, and therefore cannot be understood as limiting the invention.
[0088] The present invention is a storage process replacement method based on artificial intelligence, comprising the following steps:
[0089] S1. An initial subtask set is set according to multiple subtasks in the storage process, and each subtask in the initial subtask set is analyzed. After the analysis is completed, a subtask operator matrix is obtained;
[0090] The S1 comprises the following steps:
[0091] S11, according to the multiple subtasks in the stored process, set the initial subtask set a = {a1, a2, ..., a i ,...,a a′}, a i is the i-th subtask in the storage process, and a′ is the total number of subtasks in the storage process;
[0092] S12, analyzing each subtask in the initial subtask set, and after the analysis is completed, obtaining the subtask operator matrix a″, as follows:
[0093]
[0094] Among them: a i ' j ′ represents the jth operator of the i-th subtask in the storage process, a i ″′ represents the total number of operators in the i-th subtask during the storage process;
[0095] The S12 comprises the following steps:
[0096] S121, constructing a stored procedure subtask parsing model, and setting a first subtask support document matrix b according to the support document set corresponding to each subtask in the initial subtask set, as follows:
[0097]
[0098] Where: b ij represents the jth supporting document of the i-th subtask in the storage process, b i ′ is the total number of supporting documents of the i-th subtask in the storage process;
[0099] S122, according to the initial subtask set a={a1, a2, ..., a i ,...,a a′} and the first subtask support document matrix b calculate the cosine similarity between each subtask and its corresponding supporting documents to obtain the cosine similarity matrix b″, as follows:
[0100]
[0101] Where: b i ' j ′ represents the cosine similarity value between the jth supporting document of the i-th subtask and the i-th subtask in the storage process;
[0102] Sort the data in each row of the cosine similarity matrix b″ from large to small, and select the supporting documents corresponding to the first b″′ cosine similarity values to obtain the second subtask supporting document matrix c, as follows:
[0103]
[0104] Where: c ij Indicates the jth supporting document of the i-th subtask in the storage process after selection;
[0105] S123, using the dynamic word vector BERT model to analyze the initial subtask set a={a1, a2, ..., a i ,...,a a′} and the second subtask support document matrix c for word segmentation operation to obtain the initial subtask word vector matrix c′, as follows:
[0106]
[0107] Where: c i ' j is the jth word vector of the i-th subtask after word segmentation in the storage process, c i ″ is the total number of word vectors of the ith subtask in the storage process;
[0108] And the initial support document word vector set matrix c″′ is as follows:
[0109]
[0110] c i ' j ″ is the word vector set of the jth supporting document in the i-th subtask in the storage process, c i ' j ″ k is the kth word vector in the word vector set of the jth supporting document of the i-th subtask in the storage process, d ij is the total number of word vectors in the word vector set of the jth supporting document of the i-th subtask in the storage process;
[0111] S124, using the bidirectional long short-term memory neural network in the stored procedure subtask parsing model to perform context encoding processing on the initial subtask word vector matrix c′ and the initial support document word vector set matrix c″′, to obtain the support document word vector encoding matrix And the subtask word vector encoding matrix d″ is the number of hidden units in the bidirectional long short-term memory neural network;
[0112] S125, after context encoding processing is performed on the initial subtask word vector matrix c′ and the initial support document word vector set matrix c″′, sentence encoding is performed on the second subtask support document matrix c, and after the sentence encoding is completed, a support document context matrix is obtained; sentence meaning feature modeling is then performed between the sentences in the support document context matrix to obtain a support document sentence matrix;
[0113] The S125 comprises the following steps:
[0114] S1251, sentence encoding is performed on the second subtask support document matrix c, and after the sentence encoding is completed, a support document context matrix e is obtained, which specifically includes the following steps:
[0115] S12511, divide each supporting document in the second subtask supporting document matrix c into single sentences to obtain a supporting document single sentence matrix e i ' j ′ represents the total number of single sentences after the jth supporting document of the i-th subtask in the storage process is divided into single sentences;
[0116] S12512: Combine two adjacent single sentences in the same supporting document in the supporting document single sentence matrix to obtain a supporting document combined sentence matrix f ijis the total number of joint sentences of the jth supporting document in the i-th subtask in the storage process, f ij =e i ' j ′;
[0117] S12513: Supporting document single sentence matrix The data support document joint sentence matrix in The corresponding data in are merged to obtain the supporting document context matrix
[0118]
[0119] S1252: Sentence meaning feature modeling is performed between sentences in the supporting document context matrix e to obtain a supporting document sentence meaning matrix
[0120] S126, using a hierarchical memory neural network to construct a supporting document sentence reasoning chain set between each sentence in the supporting document sentence matrix, and then obtaining a subtask operator matrix a″ according to the supporting document sentence reasoning chain set;
[0121] The S126 comprises the following steps:
[0122] S1261, using a hierarchical memory neural network to support the document sentence matrix Construct a support document sentence reasoning chain matrix f″ between each sentence in a′×b″×f″′ , f″′ is the total number of sentence reasoning chains in the supporting document sentence reasoning chain set; the supporting document sentence reasoning chain matrix f″ a′×b″×f″′ Each sentence inference chain is f ij ″ k ,as follows:
[0123]
[0124] in: is the j1th sentence in the kth reasoning chain of the jth supporting document of the i-th subtask in the supporting document sentence reasoning chain set, g is the total number of sentences constituting the kth reasoning chain of the jth supporting document of the i-th subtask in the supporting document sentence reasoning chain set;
[0125] S1262: Reasoning chain matrix f″ based on the supporting document sentences a′×b″×f″′ Calculate the subtask operator score matrix g′ a′×b″×f″′ ; Construct the corresponding matrix between the sentence reasoning chain and the operator, recorded as the candidate operator matrix g″ a′×b″×f″′ ; Then select the subtask operator score matrix g′ a′×b″×f″′The sentence reasoning chain corresponding to the maximum operator score in the sentence is matched with the candidate operator matrix g″ a′×b″×f″′ , get the subtask operator matrix a″;
[0126] S2. Obtaining an operator input parameter set matrix and an operator output parameter set matrix according to the subtask operator matrix, wherein the input parameter includes the data date of verification, the status of verification data and the code of the verification mechanism; the output parameter includes the rule data and the data code of the verification error;
[0127] The S2 is specifically as follows:
[0128] According to the subtask operator matrix, the operator input parameter set matrix g″′ and the operator output parameter set matrix h are obtained, which are as follows:
[0129]
[0130] Where: g i ' j ″ is the input parameter set of the jth operator in the i-th subtask in the storage process, g i ' j ″ k is the kth input parameter of the jth operator of the i-th subtask in the storage process, h i ' j is the total number of input parameters of the jth operator in the i-th subtask in the storage process;
[0131] h ij is the output parameter set of the jth operator in the i-th subtask in the storage process,
[0132] h ijk is the kth output parameter of the jth operator of the i-th subtask in the storage process, h i ' j ′ is the total number of output parameters of the jth operator in the i-th subtask in the storage process;
[0133] S3, replace each input parameter in the operator input parameter set matrix and replace each output parameter in the operator output parameter set matrix. After the replacement is completed, generate a replaced subtask set and save each input parameter in the operator input parameter set matrix in the replaced subtask set;
[0134] The S3 comprises the following steps:
[0135] S31, replace each input parameter in the operator input parameter set matrix and replace each output parameter in the operator output parameter set matrix to obtain a replaced operator input parameter set matrix h″′ and a replaced operator output parameter set matrix l;
[0136] S32, according to the replaced operator input parameter set matrix h″′ and the replaced operator output parameter set matrix l, obtain the replaced subtask set l′={l1′,l2′,...,l i ′,...,l a ″},l i ′ is the i-th subtask in the replaced subtask set, and the replaced operator input parameter set matrix h″′ is saved;
[0137] S4, construct a scheduled task, verify the replaced subtask set, and obtain a final verification result;
[0138] The specific steps include:
[0139] According to the difference of the extended attributes of each subtask in the replaced subtask set, it is divided into soft verification and hard verification; when hard verification is performed, the query process is terminated immediately when an exception occurs, and the exception information is returned to the business system; when soft verification is performed, the query process will not be terminated when an exception occurs in the query, and after the query is completed, the final verification result and the exception information are obtained; the final verification result and the exception information are returned to the business system together;
[0140] The S4 comprises the following steps:
[0141] S41, according to the replaced subtask set l′={l1′,l2′,...,l i ′,...,l a The differences in the extended attributes of each subtask in ″} are divided into soft verification mode and hard verification mode;
[0142] When hard checking is performed, the replaced subtask set l′={l1′,l2′,...,l i ′,...,l a The operators in each subtask in ″} perform database queries. When an exception occurs during the query process, the query process is immediately terminated and the exception information is returned to the business system;
[0143] When performing soft verification, the replaced subtask set l′={l1′,l2′,...,l i ′,...,l a The operators in each subtask in "} perform database query. When an exception occurs during the query process, the query process will not be terminated. After the query is completed, the final verification result and exception information are obtained;
[0144] S42: Return the final verification result and abnormal information to the business system.
[0145] An artificial intelligence-based stored procedure replacement system includes a subtask parsing module, a parameter replacement module, a subtask execution verification module and a verification result return module;
[0146] The subtask parsing module is used to parse each subtask in the initial subtask set;
[0147] The parameter replacement module is used to replace each input parameter in the operator input parameter set matrix and to replace each output parameter in the operator output parameter set matrix;
[0148] The subtask execution verification module is used to perform soft verification or hard verification on the subtask according to the difference of the extended attributes of each subtask in the replaced subtask set;
[0149] The verification result returning module is used to return the final verification result and abnormal information to the business system.
[0150] In the description of this specification, the description with reference to the terms "one embodiment", "example", "specific example", etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.
[0151] The preferred embodiments of the invention disclosed above are only used to help explain the invention. The preferred embodiments do not describe all the details in detail, nor do they limit the invention to the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the invention, so that those skilled in the art can understand and use the invention well.
Claims
1. A stored procedure replacement method based on artificial intelligence, characterized in that: The following steps are involved: S1. An initial subtask set is set according to multiple subtasks in the storage process, and each subtask in the initial subtask set is analyzed. After the analysis is completed, a subtask operator matrix is obtained; S2. Obtaining an operator input parameter set matrix and an operator output parameter set matrix according to the subtask operator matrix, wherein the input parameter includes the data date of verification, the status of verification data and the code of the verification mechanism; the output parameter includes the rule data and the data code of the verification error; S3, replace each input parameter in the operator input parameter set matrix and replace each output parameter in the operator output parameter set matrix. After the replacement is completed, generate a replaced subtask set and save each input parameter in the operator input parameter set matrix in the replaced subtask set; S4, construct a scheduled task, verify the replaced subtask set, and obtain a final verification result; The specific steps include: According to the difference in the extended attributes of each subtask in the replaced subtask set, it is divided into soft verification and hard verification; when performing hard verification, the query process is terminated immediately when an exception occurs, and the exception information is returned to the business system; when performing soft verification, the query process will not be terminated when an exception occurs in the query, and after the query is completed, the final verification result and exception information are obtained; the final verification result and exception information are returned together to the business system.
2. The storage process replacement method based on artificial intelligence according to claim 1, characterized in that: The S1 comprises the following steps: S11, according to the multiple subtasks in the storage process, set the initial subtask set a = {a1, a2, ..., a i ,...,a a′ }, a i is the i-th subtask in the storage process, and a′ is the total number of subtasks in the storage process; S12, analyzing each subtask in the initial subtask set, and after the analysis is completed, obtaining the subtask operator matrix a″, as follows: Among them: a i ' j ′ represents the jth operator of the i-th subtask in the storage process, a i ″′ represents the total number of operators in the i-th subtask during the storage process.
3. The storage process replacement method based on artificial intelligence according to claim 2, characterized in that: The S12 comprises the following steps: S121, constructing a stored procedure subtask parsing model, and setting a first subtask support document matrix b according to the support document set corresponding to each subtask in the initial subtask set, as follows: Where: b ij represents the jth supporting document of the i-th subtask in the storage process, b i ′ is the total number of supporting documents of the i-th subtask in the storage process; S122, according to the initial subtask set a={a1, a2, ..., a i ,...,a a′ } and the first subtask support document matrix b calculate the cosine similarity between each subtask and its corresponding supporting documents to obtain the cosine similarity matrix b″, as follows: Where: b i ' j ′ represents the cosine similarity value between the jth supporting document of the i-th subtask and the i-th subtask in the storage process; Sort the data in each row of the cosine similarity matrix b″ from large to small, and select the supporting documents corresponding to the first b″′ cosine similarity values to obtain the second subtask supporting document matrix c, as follows: Where: c ij Indicates the jth supporting document of the i-th subtask in the storage process after selection; S123, using the dynamic word vector BERT model to analyze the initial subtask set a={a1, a2, ..., a i ,...,a a′ } and the second subtask support document matrix c for word segmentation operation to obtain the initial subtask word vector matrix c′, as follows: Where: c i ' j is the jth word vector of the i-th subtask after word segmentation in the storage process, c i ″ is the total number of word vectors of the ith subtask in the storage process; And the initial support document word vector set matrix c″′ is as follows: c i ' j ″ is the word vector set of the jth supporting document in the i-th subtask in the storage process, c i ' j ″={c i ' j ″1,c i ' j ″2,...,c i ' j ″ k ,...,c i ' j ″ dij },c i ' j ″ k is the kth word vector in the word vector set of the jth supporting document of the i-th subtask in the storage process, d ij is the total number of word vectors in the word vector set of the jth supporting document of the i-th subtask in the storage process; S124, using the bidirectional long short-term memory neural network in the stored procedure subtask parsing model to perform context encoding processing on the initial subtask word vector matrix c′ and the initial support document word vector set matrix c″′, to obtain the support document word vector encoding matrix And the subtask word vector encoding matrix d″ is the number of hidden units in the bidirectional long short-term memory neural network; S125, after context encoding processing is performed on the initial subtask word vector matrix c′ and the initial support document word vector set matrix c″′, sentence encoding is performed on the second subtask support document matrix c, and after the sentence encoding is completed, a support document context matrix is obtained; sentence meaning feature modeling is then performed between the sentences in the support document context matrix to obtain a support document sentence matrix; S126. Use a hierarchical memory neural network to construct a supporting document sentence reasoning chain set between each sentence in the supporting document sentence matrix, and then obtain a subtask operator matrix a″ based on the supporting document sentence reasoning chain set.
4. The storage process replacement method based on artificial intelligence according to claim 3 is characterized in that: The S125 comprises the following steps: S1251, sentence encoding is performed on the second subtask support document matrix c, and after the sentence encoding is completed, a support document context matrix e is obtained, which specifically includes the following steps: S12511, divide each supporting document in the second subtask supporting document matrix c into single sentences to obtain a supporting document single sentence matrix e i ' j ′ represents the total number of single sentences after the jth supporting document of the i-th subtask in the storage process is divided into single sentences; S12512: Combine two adjacent single sentences in the same supporting document in the supporting document single sentence matrix to obtain a supporting document combined sentence matrix f ij is the total number of joint sentences of the jth supporting document in the i-th subtask in the storage process, f ij =e i ' j ′; S12513: Supporting document single sentence matrix The data support document joint sentence matrix in The corresponding data in are merged to obtain the supporting document context matrix S1252: Sentence meaning feature modeling is performed between sentences in the supporting document context matrix e to obtain a supporting document sentence meaning matrix 5. The storage process replacement method based on artificial intelligence according to claim 4 is characterized in that: The S126 comprises the following steps: S1261, using a hierarchical memory neural network to support the document sentence matrix Construct a support document sentence reasoning chain matrix f″ between each sentence in a′×b″×f″′ , f″′ is the total number of sentence reasoning chains in the supporting document sentence reasoning chain set; the supporting document sentence reasoning chain matrix f″ a′×b″×f″′ Each sentence inference chain is f ij ″ k ,as follows: f ij ″ k =f″ a′×b″×f″′ [i][j][k]={f ij ″ k1 ,f ij ″ k2 ,...,f ij ″ kj1 ,...,f ij ″ kg } in: is the j1th sentence in the kth reasoning chain of the jth supporting document of the i-th subtask in the supporting document sentence reasoning chain set, g is the total number of sentences constituting the kth reasoning chain of the jth supporting document of the i-th subtask in the supporting document sentence reasoning chain set; S1262: Reasoning chain matrix f″ based on the supporting document sentences a′×b″×f″′ Calculate the subtask operator score matrix g′ a′×b″×f″′ ; Construct the corresponding matrix between the sentence reasoning chain and the operator, recorded as the candidate operator matrix g″ a′×b″×f″′ ; Then select the subtask operator score matrix g′ a′×b″×f″′ The sentence reasoning chain corresponding to the maximum operator score in the sentence is matched with the candidate operator matrix g″ a′×b″×f″′ , and obtain the subtask operator matrix a″.
6. The storage process replacement method based on artificial intelligence according to claim 1, characterized in that: The S2 is specifically as follows: According to the subtask operator matrix, the operator input parameter set matrix g″′ and the operator output parameter set matrix h are obtained, which are as follows: Where: g i ' j ″ is the input parameter set of the jth operator in the i-th subtask in the storage process, g i ' j ″ k is the kth input parameter of the jth operator of the i-th subtask in the storage process, h i ' j The total number of input parameters of the jth operator in the i-th subtask in the storage process; h ij is the output parameter set of the jth operator in the i-th subtask in the storage process, h ijk is the kth output parameter of the jth operator of the i-th subtask in the storage process, h i ' j ′ is the total number of output parameters of the jth operator of the i-th subtask in the storage process.
7. The storage process replacement method based on artificial intelligence according to claim 1, characterized in that: The S3 comprises the following steps: S31, replace each input parameter in the operator input parameter set matrix and replace each output parameter in the operator output parameter set matrix to obtain a replaced operator input parameter set matrix h″′ and a replaced operator output parameter set matrix l; S32, according to the replaced operator input parameter set matrix h″′ and the replaced operator output parameter set matrix l, obtain the replaced subtask set l′={l1′,l2′,...,l i ′,...,l a ″},l i ′ is the i-th subtask in the replaced subtask set, and the replaced operator input parameter set matrix h″′ is saved.
8. The storage process replacement method based on artificial intelligence according to claim 1, characterized in that: The S4 comprises the following steps: S41, according to the replaced subtask set l′={l1′,l2′,...,l i ′,...,l a The differences in the extended attributes of each subtask in ″} are divided into soft verification mode and hard verification mode; When hard checking is performed, the replaced subtask set l′={l1′,l2′,...,l i ′,...,l a The operators in each subtask in ″} perform database queries. When an exception occurs during the query process, the query process is immediately terminated and the exception information is returned to the business system; When performing soft verification, the replaced subtask set l′={l1′,l2′,...,l i ′,...,l a The operators in each subtask in "} perform database query. When an exception occurs during the query process, the query process will not be terminated. After the query is completed, the final verification result and exception information are obtained; S42: Return the final verification result and abnormal information to the business system.
9. A system for implementing the artificial intelligence-based stored procedure substitution method according to any one of claims 1 to 8, characterized in that: It includes a subtask parsing module, a parameter replacement module, a subtask execution verification module and a verification result return module; The subtask parsing module is used to parse each subtask in the initial subtask set; The parameter replacement module is used to replace each input parameter in the operator input parameter set matrix and to replace each output parameter in the operator output parameter set matrix; The subtask execution verification module is used to perform soft verification or hard verification on the subtask according to the difference of the extended attributes of each subtask in the replaced subtask set; The verification result returning module is used to return the final verification result and abnormal information to the business system.
Citation Information
Patent Citations
Method for generating statement from natural language to SQL in business scene based on large model
CN117708162A
Storage process conversion method and device, equipment and medium
CN117827879A
Predictive prefetching to improve parallelization of document generation subtasks
US7331038B1
