Data verification method and device, computer device, readable storage medium and program product
By dynamically generating verification logic using a large language model during the data reconciliation process, the lack of flexibility caused by hard coding in existing technologies is solved, and flexible and efficient data consistency verification is achieved.
Patent Information
- Application Number
- CN202610398459.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-03-27
- Publication Date
- 2026-11-20
AI Technical Summary
The existing data reconciliation method is based on hard coding, which requires code modification when business rules change, resulting in a lack of flexibility.
By acquiring feature data from business data and resource change data, retrieving target verification rules using a pre-built knowledge base, dynamically generating verification logic by calling a large language model, constructing verification scripts or performing semantic consistency verification based on verification prompt words, and generating data consistency verification results.
It improves the flexibility and efficiency of data verification, reduces maintenance costs, enhances system stability and security, and adapts to the verification needs of unstructured data.
Smart Images

Figure CN123138256A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to a data verification method, apparatus, computer equipment, computer-readable storage medium, and computer program product. Background Technology
[0002] In modern distributed systems, financial payment and settlement systems, and e-commerce transaction systems, data reconciliation is a core step in ensuring consistency between financial data and business information. The main purpose of data reconciliation is to verify and correct data discrepancies between upstream business systems (such as order systems) and downstream settlement systems (such as banks and third-party payment systems).
[0003] Traditional data reconciliation methods mainly include two types: T+1 reconciliation based on database stored procedures / Structured Query Language Script (SQL), and real-time / near real-time reconciliation based on rule engines. However, both of these methods are based on hard-coded implementations. If the business rules of upstream or downstream systems change, the code needs to be modified again.
[0004] Therefore, a more flexible data verification method is urgently needed. Summary of the Invention
[0005] Therefore, it is necessary to provide a data verification method, apparatus, computer equipment, computer-readable storage medium, and computer program product that can improve the flexibility of verification in response to the above-mentioned technical problems.
[0006] Firstly, this application provides a data verification method, including:
[0007] Obtain the business data to be verified and its corresponding resource change data;
[0008] Extract at least one of the channel identifier, business type, or business description information from the business data and the resource change data as feature data, and retrieve the target verification rule from a pre-built knowledge base based on the feature data;
[0009] The verification prompt words are constructed using the business data, the resource change data, and the target verification rules.
[0010] The large language model is invoked to dynamically generate verification logic based on the verification prompt words, and the data consistency verification result between the business data and the resource change data is determined based on the verification logic.
[0011] In one embodiment, the invocation of the large language model dynamically generates verification logic based on the verification prompt words, and determines the data consistency verification result between the business data and the resource change data based on the verification logic, including:
[0012] When the verification logic is code generation logic, the large language model is called to generate the corresponding verification script;
[0013] The verification script is sent to the verification logic executor, which executes the verification script in the sandbox environment to obtain the data consistency verification result.
[0014] In one embodiment, the invocation of the large language model dynamically generates verification logic based on the verification prompt words, and determines the data consistency verification result between the business data and the resource change data based on the verification logic, including:
[0015] When the verification logic is semantic reasoning logic, the large language model is invoked to perform semantic consistency verification on the business data and the resource change data, and the data consistency verification result is obtained.
[0016] In one embodiment, retrieving the target verification rule from a pre-built knowledge base based on the feature data includes:
[0017] The feature data is matched with the rule data based on natural language description in the knowledge base to obtain the keyword matching degree.
[0018] Determine the semantic similarity between the feature vector corresponding to the feature data and the rule vector corresponding to the rule data;
[0019] The semantic similarity and the keyword matching degree are weighted and fused based on preset weight coefficients to obtain the target similarity between the feature data and the rule data;
[0020] Based on the target similarity, the target verification rules corresponding to the feature data are determined.
[0021] In one embodiment, after the large language model dynamically generates verification logic based on the verification prompt words, and determines the data consistency verification result between the business data and the resource change data based on the verification logic, the method further includes:
[0022] If the data consistency verification result is inconsistent, the cause of the target difference is retrieved from the knowledge base based on the feature data.
[0023] Construct attribution prompt words using the business data, the resource change data, the data consistency verification results, and the reasons for the target differences;
[0024] The large language model is invoked to generate an attribution analysis report on the inconsistency between the business data and the resource change data based on the attribution prompts.
[0025] In one embodiment, obtaining the business data to be verified and its corresponding resource change data includes:
[0026] Copy the request traffic from the upstream business system and extract the business data from the request traffic;
[0027] The resource change data is obtained by monitoring the database logs of the downstream business system.
[0028] Secondly, this application also provides a data verification device, comprising:
[0029] The data acquisition module is used to acquire the business data to be verified and its corresponding resource change data;
[0030] The rule retrieval module is used to extract at least one of the channel identifier, business type or business description information of the business data and the resource change data as feature data, and retrieve the target verification rule based on the feature data in a pre-built knowledge base.
[0031] The prompt word construction module is used to construct verification prompt words using the business data, the resource change data, and the target verification rules;
[0032] The consistency verification module is used to call the large language model to dynamically generate verification logic based on the verification prompt words, and determine the data consistency verification result between the business data and the resource change data based on the verification logic.
[0033] Thirdly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the data verification method described in any of the embodiments of the first aspect.
[0034] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, implements the data verification method described in any of the embodiments of the first aspect.
[0035] Fifthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the data verification method described in any of the embodiments of the first aspect.
[0036] The aforementioned data verification method, apparatus, computer equipment, computer-readable storage medium, and computer program product utilize feature data extracted from at least one of the channel identifier, business type, or business description information of business data and resource change data. They retrieve similar target verification rules from a pre-built knowledge base, construct verification prompts using the business data, resource change data, and target verification rules currently requiring data consistency verification, call a large language model to dynamically generate executable verification logic based on the verification prompts, and determine the data consistency verification result of the business data and resource change data based on the verification logic. This allows the verification logic dynamically generated by the large language model to replace the hard-coded logic in the original data verification method, improving the dynamic flexibility of the verification method. Attached Figure Description
[0037] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0038] Figure 1 This is a flowchart illustrating a data verification method in one embodiment;
[0039] Figure 2 This is a flowchart illustrating the target verification rule retrieval steps in one embodiment;
[0040] Figure 3 This is a flowchart illustrating the attribution analysis report generation steps in one embodiment;
[0041] Figure 4 This is a schematic diagram of the system architecture of a data verification method in one embodiment;
[0042] Figure 5 This is a flowchart illustrating the data verification method in another embodiment;
[0043] Figure 6 This is a sequence diagram of module interactions for a data verification method in one embodiment;
[0044] Figure 7 This is a structural block diagram of a data verification device 700 in one embodiment;
[0045] Figure 8 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0046] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0047] It should be noted that the terms "comprising" and "having," and any variations thereof, used in this application, are intended to cover non-exclusive inclusion. The term "multiple" as used in this application refers to two or more. The term "and / or" as used in this application refers to one of the solutions, or any combination of multiple solutions. The user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use, and processing of related data must comply with relevant regulations.
[0048] In one exemplary embodiment, such as Figure 1 As shown, a data verification method is provided. This embodiment illustrates the method applied to a server, but it is understood that the method can also be applied to a terminal, or to a system including both a terminal and a server, and implemented through interaction between the terminal and the server. In this embodiment, the method includes the following steps S102 to S108. Wherein:
[0049] Step S102: Obtain the business data to be verified and its corresponding resource change data.
[0050] For example, the server can read business data from upstream business systems and resource change data from downstream business systems. The correspondence between the business data and resource change data can be determined based on information such as timestamps, identifiers, business objects, and business channels. The business data and resource change data with corresponding relationships are then treated as a set of data for data consistency verification.
[0051] Step S104: Extract at least one of the channel identifier, business type, or business description information from the business data and resource change data as feature data, and retrieve the target verification rule from the pre-built knowledge base based on the feature data.
[0052] The knowledge base may, but is not limited to, storing information such as data consistency verification rules, historical data verification records, historical data consistency verification differences and their corresponding solutions.
[0053] For example, the server can identify field information in business data and resource change data, and extract corresponding field values as feature data from at least one corresponding field among channel identifier, business type, or business description information. Based on the currently extracted feature data, a verification rule carrying the same feature data is retrieved from a pre-built knowledge base as the target verification rule. Alternatively, the currently extracted feature data can be matched with historical data stored in the knowledge base for similarity, and the verification rule used by the similar historical data can be used as the target verification rule.
[0054] Step S106: Construct verification prompt words using business data, resource change data, and target verification rules.
[0055] For example, the server can concatenate business data, resource change data, and target verification rules according to a preset semantic order or a preset verification prompt word template to obtain verification prompt words. Optionally, in some implementations, verification records of historical data using target verification rules stored in the knowledge base can also be read and combined with the target verification rules as case data to form business rule context data. Referring to the above-described method of constructing verification prompt words, verification prompt words can be constructed using business data, resource change data, and business rule context data. Alternatively, in other implementations, preset instruction constraint data can also be stored, such as data requiring the final output of a Boolean value result or the reason for the difference. Verification prompt words can also be constructed by combining business data, resource change data, target verification rules, and instruction constraint data. Alternatively, business data, resource change data, business rule context data, and instruction constraint data can also be used.
[0056] Step S108: Call the large language model to dynamically generate verification logic based on verification prompt words, and determine the data consistency verification result between business data and resource change data based on the verification logic.
[0057] For example, the server can send validation prompts to a large language model, which then dynamically generates executable validation logic that matches the validation prompts. The business data and resource change data are processed according to the validation logic to obtain a data consistency validation result. The validation rules can include, but are not limited to, rules for generating a dynamic structured query language or programming language for validation, semantic matching rules, and field matching rules.
[0058] In the aforementioned data verification method, feature data extracted from at least one of the channel identifier, business type, or business description information of business data and resource change data is used to retrieve similar target verification rules from a pre-built knowledge base. Verification prompt words are constructed using the business data, resource change data, and target verification rules that need to be verified for data consistency. A large language model is then called to dynamically generate executable verification logic based on the verification prompt words. The data consistency verification result of business data and resource change data is determined based on the verification logic. This method can replace the hard-coded logic in the original data verification method with the verification logic dynamically generated by the large language model, thereby improving the dynamic flexibility of the verification method.
[0059] Optionally, in some implementations, when the data requiring consistency verification between business data and resource change data is structured data, code generation logic can be dynamically generated as the currently executable verification logic.
[0060] In an exemplary embodiment, step S108 may include: if the verification logic is code generation logic, calling the large language model to generate the corresponding verification script; sending the verification script to the verification logic executor, and executing the verification script in the sandbox environment through the verification logic executor to obtain the data consistency verification result.
[0061] For example, when the validation logic is code generation logic, a large language model can be invoked to generate a corresponding validation script based on validation prompts. The validation script is then sent to a separate validation logic executor. This executor executes the validation script within its configured sandbox environment to perform data consistency checks on business data and resource change data, obtaining a Boolean result. If the Boolean result is True, a data consistency check result is obtained indicating that the business data and resource change data are consistent. If the Boolean result is False, a data consistency check result is obtained indicating that the business data and resource change data are inconsistent.
[0062] In this embodiment, by using code generation logic for verification, a large language model is invoked to generate a corresponding verification script. This script is then sent to an independent verification logic executor. The verification script is executed within the secure sandbox environment of the executor to obtain the data consistency verification result. This approach not only rapidly adapts to the data consistency verification requirements of current business scenarios by dynamically generating corresponding verification scripts, significantly improving the iteration efficiency of the verification logic and thus enhancing the flexibility of data verification, but also achieves low-code implementation, reducing the maintenance and execution costs of the data verification method. Furthermore, since the verification script executes in the independent sandbox environment of the verification logic executor, it avoids the verification script affecting the main data verification program, thereby improving the security and stability of the data verification method.
[0063] Optionally, in some implementations, when the data requiring consistency verification between business data and resource change data is unstructured data, semantic reasoning logic can be dynamically generated as the currently executable verification logic.
[0064] In an exemplary embodiment, step S108 may include: when the verification logic is semantic reasoning logic, calling the large language model to perform semantic consistency verification on business data and resource change data, and obtaining data consistency verification results.
[0065] For example, when the verification logic is semantic reasoning logic, the server can directly call the large language model to perform semantic extraction on the business data and resource change data, and perform semantic consistency verification based on the semantic extraction results. Alternatively, it can call the large language model to retrieve verification records of historical data corresponding to the feature data in the knowledge base, and learn the semantic matching relationships between historical data as prior knowledge. Based on the prior knowledge, it can determine whether the business data and resource change data are semantically consistent.
[0066] For example, when the business description information of the business data is "Pay January's rent," and the corresponding resource change data's business description information includes "2023-01 RENT," the server can extract the business description information as feature data and utilize verification records of similar historical data retrieved from the knowledge base. It learns the semantic matching relationship between "rent" and "RENT" from the similar historical data as prior knowledge for the current data verification. Based on this prior knowledge, it determines that the business data and resource change data are semantically consistent. Simultaneously, it can also combine the amount and time in the business data and resource change data for consistency verification. Finally, it obtains the data consistency verification result between the business data and the resource change data.
[0067] In this embodiment, by calling a large language model to perform semantic consistency verification on business data and resource change data when the verification logic is semantic reasoning logic, the data consistency verification result is obtained. The semantic understanding capability of the large language model can be used to solve the verification problem of unstructured data such as fuzzy text and business description information that traditional data verification methods cannot handle, thereby improving the applicability of the data verification method and enriching the business scenarios in which the data verification method can be applied.
[0068] In one exemplary embodiment, such as Figure 2 As shown, step S104 includes steps S202 to S208. Wherein:
[0069] Step S202: Match the feature data with the rule data based on natural language description in the knowledge base using keywords to obtain the keyword matching degree.
[0070] For example, the server can use pre-stored specific field names to extract corresponding keywords from feature data and pre-stored rule data based on natural language descriptions in the knowledge base. The feature data is then matched with the keywords in the rule data to obtain the keyword matching degree between the feature data and the rule data.
[0071] Step S204: Determine the semantic similarity between the feature vector corresponding to the feature data and the rule vector corresponding to the rule data.
[0072] For example, the server can use a word embedding model to vectorize the feature data and rule data, obtaining high-dimensional feature vectors and rule vectors. The semantic similarity between the feature vectors and rule vectors is then determined using the distance between them.
[0073] Step S206: Based on preset weight coefficients, semantic similarity and keyword matching degree are weighted and fused to obtain the target similarity between feature data and rule data.
[0074] For example, the server can store the weight coefficients corresponding to semantic similarity and keyword matching respectively, or it can store only the weight coefficient alpha corresponding to semantic similarity, and use 1-alpha as the weight coefficient corresponding to keyword matching. The semantic similarity and keyword matching are weighted using the corresponding weight coefficients, and the weighted semantic similarity and the weighted keyword matching are added together to obtain the target similarity.
[0075] Step S208: Determine the target verification rules corresponding to the feature data based on the target similarity.
[0076] Optionally, in some implementations, the server can sort the rule data in descending order of target similarity value, and select a preset number of rule data as the target verification rules corresponding to the current feature data, starting from the first rule data after sorting. Alternatively, in other implementations, the target similarity can be compared with a preset similarity threshold. Rule data with a target similarity greater than the similarity threshold is selected as the target verification rules corresponding to the current feature data.
[0077] In this embodiment, a hybrid retrieval strategy is used to evaluate the keyword matching degree and semantic similarity of feature data and rule data respectively. The keyword matching degree and semantic similarity are weighted and fused based on preset weight coefficients to obtain the target similarity. Based on the target similarity, similar target verification rules are selected, which can take into account both the accuracy of keyword matching and the generalization of semantic matching, thereby improving the accuracy of target verification rules.
[0078] In one exemplary embodiment, such as Figure 3 As shown, the data verification method provided in this application may further include steps S302 to S306. Wherein:
[0079] Step S302: If the data consistency verification result is inconsistent, retrieve the reason for the target difference from the knowledge base based on the feature data.
[0080] For example, when the data consistency verification results of business data and resource change data are inconsistent, the server can refer to the retrieval method of the target verification rule provided in the above embodiments, and retrieve historical data with consistency verification differences similar to the current feature data from the consistency verification differences of historical data and their corresponding solutions pre-stored in the knowledge base based on the feature data, and read the reasons for the differences between the historical data as the target difference reasons.
[0081] Step S304: Construct attribution prompts using business data, resource change data, data consistency verification results, and reasons for target differences.
[0082] For example, the server can construct attribution prompts for business data, resource change data, data consistency verification results, and target discrepancy reasons by referring to the above-described method of constructing verification prompts. Optionally, in some implementations, attribution prompts can also be constructed by combining instruction constraint data for requesting the generation of discrepancy reasons.
[0083] Step S306: Call the large language model to generate an attribution analysis report on the inconsistency between business data and resource change data based on attribution prompts.
[0084] For example, the server can send attribution prompts to the large language model, which then generates the reasons for the discrepancies between business data and resource change data and their corresponding solutions based on the attribution prompts. The server can then combine the reasons for the discrepancies and their corresponding solutions to form an attribution analysis report.
[0085] Optionally, in some implementations, the attribution analysis report can also be pushed to the client. The client receives rule correction data based on the attribution analysis report. The rule correction data is stored in a knowledge base for subsequent data verification. Optionally, in some implementations, the rule correction data can be obtained by business personnel modifying the original rule document using natural language processing. Simply uploading the rule correction data to the knowledge base is sufficient; no developer intervention is required to modify the hard-coded rules, thus reducing the rule change cycle from days to minutes.
[0086] In this embodiment, when the data consistency verification result is inconsistent, a secondary search is actively triggered to identify historical data similar to the current feature data. The reasons for the differences in the historical data are used as the target reasons for the differences. Attribution prompts are constructed by combining the current consistency verification business data and resource change data. The large language model is called to generate corresponding attribution analysis reports based on the attribution prompts. This not only enables intelligent attribution and reduces subsequent operation and maintenance troubleshooting time, but also allows the verification rules stored in the current knowledge base to be learned and corrected based on the attribution analysis report, thereby helping to improve the accuracy of subsequent data verification.
[0087] In an exemplary embodiment, step S102 may further include: copying the request traffic of the upstream business system and extracting business data from the request traffic; and monitoring the database logs of the downstream business system to obtain resource change data.
[0088] For example, the server can also use traffic mirroring technology to replicate the Hypertext Transfer Protocol (HTTP) request traffic of the upstream business system at the gateway layer, and extract business data from the request traffic. Change Data Capture (CDC) technology or database change log parsing tools can be used to monitor the database logs of the downstream business system, capturing changes to the business database and financial database of the downstream business system as resource change data.
[0089] In this embodiment, business data and resource change data are obtained from upstream and downstream business systems through traffic mirroring or database log monitoring. This allows for non-intrusive data capture and reduces the interference of data verification on the stable operation of upstream and downstream business systems.
[0090] In one exemplary embodiment, such as Figure 4 The diagram illustrates a server system architecture, including a main business link 402, a bypass acquisition layer 404, and a core verification domain 406. The main business link 402, the bypass acquisition layer 404, and the core verification domain 406 employ a bypass asynchronous architecture.
[0091] Among them, the main business link 402 is used to realize the normal interaction between the upstream business system and the downstream business system, and is not affected by the data verification logic of the bypass acquisition layer 404 and the core verification domain 406.
[0092] The bypass acquisition layer 404 is used to asynchronously capture business data and resource change data from heterogeneous data sources (upstream and downstream business systems) corresponding to the main business link 402 without intrusion, through traffic mirroring or database log monitoring technology. Optionally, in some implementations, the bypass acquisition layer 404 can also perform data cleaning on the raw heterogeneous data captured from the heterogeneous data sources in formats such as JSON, XML, and Binlog. For example, the raw heterogeneous data can be uniformly converted into standard validation entity objects according to a preset format. The standard validation entity objects are then pushed into a message queue.
[0093] The core verification domain 406 may include an intelligent verification engine layer 4062, a knowledge base management layer 4064, and a difference analysis and feedback layer 4066.
[0094] The intelligent verification engine layer 4062 can include a large language model and a verification logic executor. The intelligent verification engine layer 4062 can consume business data and resource change data from the message queue using Retrieval-Augmented Generation (RAG, a technique combining the generation capabilities of a pre-trained large model and the retrieval capabilities of an external knowledge base). It obtains target verification rules through interaction with the knowledge base in the knowledge base management layer 4064, constructs verification prompts using business data, resource change data, target verification rules, and instruction constraint data, and sends these prompts to the large language model. Through interaction with the large language model, it dynamically generates currently executable verification logic. If the verification logic is code generation logic, it calls the large language model to generate a verification script and sends it to the verification logic executor. The verification logic executor executes the verification script in an independent sandbox environment to obtain the data consistency verification result between the business data and the resource change data. If the verification logic is semantic reasoning logic, it calls the large language model to perform semantic consistency verification on the business data and the resource change data to obtain the data consistency verification result between the business data and the resource change data.
[0095] The knowledge base management layer 4064 includes a knowledge base. The knowledge base may include two parts: a rule base and a case base. The rule base stores validation rules described in natural language. The case base can store validation records of historical data, consistency validation differences in historical data, and corresponding solutions. The server can use a word embedding model to convert the validation rules based on natural language descriptions in the rule base into high-dimensional vectors and store them in a vector database to improve the semantic matching efficiency between subsequent feature vectors and rule vectors. Optionally, in some implementations, when the data consistency validation result is consistent, business data, resource change data, target validation rules, validation prompt words, validation logic, and consistent data consistency results can be combined to form a validation record and stored in the knowledge base.
[0096] The difference analysis and feedback layer 4066 can be used to obtain the cause of the target difference through interaction with the knowledge base when the data consistency verification result is inconsistent. It can also be used to construct attribution prompts by using business data, resource change data, inconsistent data consistency verification results, and the cause of the target difference. The attribution prompts are sent to the large language model, and an attribution analysis report is obtained through interaction with the large language model. The attribution analysis report is pushed to the client, and the client receives rule correction data based on the attribution analysis report. The rule correction data is then used to update the knowledge base.
[0097] In this embodiment, by adopting a bypass asynchronous architecture, the bypass acquisition layer 404 and the core verification domain 406 can avoid blocking the business operation of the main business link 402 during the data verification operation, thus ensuring the business stability of the main business link 402. By utilizing the bypass acquisition layer 404 to collect data from the bypass, and utilizing the interaction between the core verification domain 406 and the large language model, verification logic executor, and knowledge base, a closed-loop process for data consistency verification is achieved. This reduces manual intervention, helps to lower data verification costs, and improves data verification efficiency.
[0098] In one exemplary embodiment, such as Figure 5 As shown, a data verification method is provided, including the following steps S502 to S520. Wherein:
[0099] Step S502: Obtain heterogeneous data from upstream and downstream business systems through bypass, and perform data cleaning on the heterogeneous data to obtain business data and its corresponding resource change data.
[0100] For example, a bypass asynchronous architecture can be adopted, mirroring the request traffic of the upstream business system and monitoring changes in the database logs of the downstream business system to obtain heterogeneous data captured from both systems. Data cleaning is performed as follows: the captured heterogeneous data is uniformly transformed into corresponding standard verification entity objects, which include entity identifiers, resource change values, timestamps, business objects, and business description information. Standard verification entity objects from the upstream business system are used as business data, and those from the downstream business system are used as resource change data. Based on the entity identifiers, resource change values, timestamps, business objects, and business description information of the standard verification entity objects, a corresponding set of business data and resource change data is determined.
[0101] Step S504: Extract at least one of the channel identifier, business type, or business description information from the business data and resource change data as feature data, and perform vectorization processing on the feature data to obtain feature vectors.
[0102] For example, feature data under the same field name for both business data and resource change data can be extracted using at least one field name from channel identifier, business type, or business description information. A word embedding model is then used to convert the feature data into a high-dimensional vector form, resulting in a feature vector.
[0103] Step S506: Retrieve rule vectors similar to feature vectors from the vector database, and obtain the business rule context data corresponding to the rule vectors as target verification rules.
[0104] For example, the semantic matching degree and keyword matching degree between feature vectors and rule vectors can be calculated. The semantic matching degree and keyword matching degree are then weighted and fused using preset weight coefficients to obtain the target similarity. Based on the target similarity from largest to smallest, the rule vectors are sorted, and a preset number of rule vectors and their corresponding historical data verification cases are selected from the beginning to form the target verification rules.
[0105] Step S508: Combine business data, resource change data, target verification rules, and instruction constraint data to construct verification prompt words.
[0106] Step S510: Call the large language model to dynamically generate the currently executable verification logic based on the verification prompt words.
[0107] For example, business data, resource change data, target verification rules, and instruction constraint data can be combined according to a preset semantic order to obtain verification prompts. These verification prompts are then sent to a large language model, which dynamically generates currently executable verification logic based on the prompts.
[0108] If the verification logic is code generation logic, execute step S512 to call the large language model to generate the corresponding verification script and send it to the verification logic executor. The verification logic executor executes the verification script in the sandbox environment to obtain the data consistency verification result.
[0109] If the verification logic is semantic reasoning logic, execute step S514 to call the large language model to perform semantic consistency verification on business data and resource change data, and obtain the data consistency verification result.
[0110] If the data consistency check result is inconsistent, proceed to step S516: retrieve the cause of the target discrepancy from the knowledge base based on the feature data, and construct attribution suggestion words using business data, resource change data, data consistency check result, and the cause of the target discrepancy. Step S518: call the large language model to generate an attribution analysis report on the inconsistency between business data and resource change data based on the attribution suggestion words.
[0111] If the data consistency verification result is consistent, execute step S520 to combine business data, resource change data, target verification rules, verification prompt words, verification logic, and data consistency verification result to generate a data verification record and update the vector knowledge base.
[0112] For example, such as Figure 6 The diagram illustrates a module interaction sequence diagram for a data verification method when the verification logic is code generation logic and the data consistency verification result is inconsistent. The method includes: a data source 610, a verification engine service 630, a vector database 650, a large language model 670, and a code execution sandbox 690. In step S502, heterogeneous data captured from upstream and downstream business systems by the data source 610 is cleaned and pushed to the verification engine service 630, along with a set of cleaned and standardized business data and resource change data. In step S504, the verification engine service 630 extracts feature data and performs vectorization to obtain feature vectors. In step S506, the verification engine service 630 interacts with the vector database 650 to retrieve the target verification rule. In step S508, the verification engine service 630 constructs verification prompt words. In step S510, the verification engine service 630 interacts with the large language model 670 to obtain the currently executable verification logic dynamically generated by the large language model 670. During step S512, the interaction between the large language model 670 and the code execution sandbox 690 is used to obtain the data consistency verification result returned by the code execution sandbox 690 after executing the verification script. The large language model 670 returns the data consistency verification result to the verification engine service 630. If the data consistency verification result is inconsistent, step S516 is executed: the interaction between the verification engine service 630 and the vector database 650 is used to retrieve the cause of the target difference and construct the corresponding attribution hint words. During step S518, the interaction between the verification engine service 630 and the large language model 670 is used to generate an attribution analysis report.
[0113] In this embodiment, by utilizing feature data extracted from business data and its corresponding resource change data, similar data verification cases are retrieved in the vector database. Target verification rules are obtained based on the data verification cases. Verification prompt words are obtained by combining business data, resource change data, target verification rules, and instruction constraint data. A large language model is called to dynamically generate verification logic based on the verification prompt words. Data consistency verification results are obtained based on the verification logic. This approach can reduce the amount of hard-coded code in the overall system architecture and improve the flexibility and efficiency of data verification.
[0114] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps. It is understood that the steps in different embodiments can be freely combined as needed, and all non-contradictory solutions formed by such combinations are within the scope of protection of this application.
[0115] Based on the same inventive concept, this application also provides a data verification device for implementing the data verification method described above. The solution provided by this device is similar to the implementation described in the above method; therefore, the specific limitations in one or more data verification device embodiments provided below can be found in the limitations of the data verification method described above, and will not be repeated here.
[0116] In one exemplary embodiment, such as Figure 7 As shown, a data verification device 700 is provided, including: a data acquisition module 702, a rule retrieval module 704, a prompt word construction module 706, and a consistency verification module 708, wherein:
[0117] The data acquisition module 702 is used to acquire the business data to be verified and its corresponding resource change data.
[0118] The rule retrieval module 704 is used to extract at least one of the channel identifier, business type or business description information from business data and resource change data as feature data, and retrieve the target verification rule from the pre-built knowledge base based on the feature data.
[0119] The prompt word construction module 706 is used to construct verification prompt words using business data, resource change data, and target verification rules.
[0120] The consistency verification module 708 is used to call the large language model to dynamically generate verification logic based on verification prompt words, and determine the data consistency verification result of business data and resource change data based on the verification logic.
[0121] In an exemplary embodiment, the consistency verification module 708 is further configured to, when the verification logic is code generation logic, call the large language model to generate the corresponding verification script; send the verification script to the verification logic executor, and execute the verification script in the sandbox environment through the verification logic executor to obtain the data consistency verification result.
[0122] In an exemplary embodiment, the consistency verification module 708 is further configured to call a large language model to perform semantic consistency verification on business data and resource change data when the verification logic is semantic reasoning logic, and obtain data consistency verification results.
[0123] In an exemplary embodiment, the rule retrieval module 704 is further configured to perform keyword matching between feature data and rule data described in natural language in the knowledge base to obtain keyword matching degree; determine the semantic similarity between the feature vector corresponding to the feature data and the rule vector corresponding to the rule data; perform weighted fusion of semantic similarity and keyword matching degree based on preset weight coefficients to obtain target similarity between feature data and rule data; and determine the target verification rule corresponding to the feature data based on the target similarity.
[0124] In an exemplary embodiment, the data verification device 700 further includes an attribution analysis module, which is used to retrieve the cause of the discrepancy in the knowledge base based on feature data when the data consistency verification result is inconsistent; construct attribution prompt words using business data, resource change data, data consistency verification result, and the cause of the discrepancy; and call a large language model to generate an attribution analysis report on the inconsistency between business data and resource change data based on the attribution prompt words.
[0125] In an exemplary embodiment, the data acquisition module 702 is further configured to copy the request traffic of the upstream business system, extract business data from the request traffic, and monitor the database logs of the downstream business system to obtain resource change data.
[0126] Each module in the aforementioned data verification device 700 can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.
[0127] In one exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 8As shown, this computer device includes a processor, memory, input / output interfaces (I / O), and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operating system and computer programs stored in the non-volatile storage media. The database stores business data, resource change data, feature data, target verification rules, verification prompts, verification logic, and data consistency verification results. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communication with external terminals via a network connection. When executed by the processor, the computer program implements a data verification method.
[0128] Those skilled in the art will understand that Figure 8 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0129] In one exemplary embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.
[0130] In one exemplary embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps in the above-described method embodiments.
[0131] In one exemplary embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.
[0132] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.
[0133] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0134] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A data verification method, characterized in that, The method includes: Obtain the business data to be verified and its corresponding resource change data; Extract at least one of the channel identifier, business type, or business description information from the business data and the resource change data as feature data, and retrieve the target verification rule from a pre-built knowledge base based on the feature data; The verification prompt words are constructed using the business data, the resource change data, and the target verification rules. The large language model is invoked to dynamically generate verification logic based on the verification prompt words, and the data consistency verification result between the business data and the resource change data is determined based on the verification logic.
2. The method according to claim 1, characterized in that, The method of calling the large language model dynamically generates verification logic based on the verification prompt words, and determines the data consistency verification result between the business data and the resource change data based on the verification logic, including: When the verification logic is code generation logic, the large language model is called to generate the corresponding verification script; The verification script is sent to the verification logic executor, which executes the verification script in a sandbox environment to obtain the data consistency verification result.
3. The method according to claim 1, characterized in that, The method of calling the large language model dynamically generates verification logic based on the verification prompt words, and determines the data consistency verification result between the business data and the resource change data based on the verification logic, including: When the verification logic is semantic reasoning logic, the large language model is invoked to perform semantic consistency verification on the business data and the resource change data, and the data consistency verification result is obtained.
4. The method according to claim 1, characterized in that, The process of retrieving target verification rules from a pre-built knowledge base based on the feature data includes: The feature data is matched with the rule data based on natural language description in the knowledge base to obtain the keyword matching degree. Determine the semantic similarity between the feature vector corresponding to the feature data and the rule vector corresponding to the rule data; The semantic similarity and the keyword matching degree are weighted and fused based on preset weight coefficients to obtain the target similarity between the feature data and the rule data; Based on the target similarity, the target verification rules corresponding to the feature data are determined.
5. The method according to claim 1, characterized in that, After the large language model is invoked to dynamically generate verification logic based on the verification prompt words, and the data consistency verification result between the business data and the resource change data is determined based on the verification logic, the method further includes: If the data consistency verification result is inconsistent, the cause of the target difference is retrieved from the knowledge base based on the feature data. Attribution suggestions are constructed using the business data, the resource change data, the data consistency verification results, and the reasons for the target differences. The large language model is invoked to generate an attribution analysis report on the inconsistency between the business data and the resource change data based on the attribution prompts.
6. The method according to claim 1, characterized in that, The acquisition of the business data to be verified and its corresponding resource change data includes: Copy the request traffic from the upstream business system and extract the business data from the request traffic; The resource change data is obtained by monitoring the database logs of the downstream business system.
7. A data verification device, characterized in that, The device includes: The data acquisition module is used to acquire the business data to be verified and its corresponding resource change data; The rule retrieval module is used to extract at least one of the channel identifier, business type or business description information of the business data and the resource change data as feature data, and retrieve the target verification rule based on the feature data in a pre-built knowledge base. The prompt word construction module is used to construct verification prompt words using the business data, the resource change data, and the target verification rules; The consistency verification module is used to call the large language model to dynamically generate verification logic based on the verification prompt words, and determine the data consistency verification result between the business data and the resource change data based on the verification logic.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.
