CN116662317A - Data verification method and device, processor and electronic equipment - Google Patents

Data verification method and device, processor and electronic equipment Download PDF

Info

Publication number
CN116662317A
CN116662317A CN202310640207.4A CN202310640207A CN116662317A CN 116662317 A CN116662317 A CN 116662317A CN 202310640207 A CN202310640207 A CN 202310640207A CN 116662317 A CN116662317 A CN 116662317A
Authority
CN
China
Prior art keywords
field
verification
checked
target
check
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310640207.4A
Other languages
Chinese (zh)
Inventor
吴梓灵
韩靖
何敏
连煜伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202310640207.4A priority Critical patent/CN116662317A/en
Publication of CN116662317A publication Critical patent/CN116662317A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases
    • G06F16/215Improving data quality; Data cleansing, e.g. de-duplication, removing invalid entries or correcting typographical errors
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems
    • G06F16/252Integrating or interfacing systems involving database management systems between a Database Management System and a front-end application

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Quality & Reliability (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The application discloses a data verification method, a data verification device, a processor and electronic equipment. The method relates to the field of data verification, and comprises the following steps: receiving a verification request sent by a client through the client, and identifying the verification request to obtain database information, wherein the verification request is used for verifying whether fields written into a table to be verified are normal or not when a storage operation is executed on the database; determining a database indicated by the database information, and determining a table to be checked in the database; obtaining a preset field and a target check statement according to configuration of a table to be checked, wherein the target check statement is used for inquiring the field to be checked; determining a target field to be checked from the table to be checked through a target check statement, and comparing a preset field with the target field to be checked to obtain a check result. The application solves the problem that the data written in the database is difficult to accurately verify when the database is subjected to the storage operation in the related technology.

Description

Data verification method and device, processor and electronic equipment
Technical Field
The present application relates to the field of data verification, and in particular, to a data verification method, device, processor and electronic equipment.
Background
When a customer performs a financial business operation, the financial institution uses the application system to store data generated during the operation and data related to the financial business into an associated database. When testing an application system, a large amount of service data is required to be used for testing, and the data used during testing is required to be complete and real service data, so that a large amount of data in different databases is required to be checked. However, because the service scenes corresponding to different databases are different, each service scene can involve adding, deleting and modifying data, and meanwhile, in order to ensure the effectiveness of the service transaction site, a large amount of site information needs to be reserved, the data in the databases are complex, and in addition, the types of the databases are different, so that the problem of high verification difficulty exists when the data in the databases are verified.
In the prior art, a tester usually initiates an execution program of data verification manually, and then manually checks whether the data is stored correctly or not according to a verification result obtained by the execution program. However, the method has the problems of complicated steps, high research and development cost, difficulty in displaying the verification result, incomplete management and the like.
Aiming at the problem that the data written in the database is difficult to accurately verify when the storage operation is executed in the related technology, no effective solution is proposed at present.
Disclosure of Invention
The application mainly aims to provide a data verification method, a device, a processor and electronic equipment, so as to solve the problem that in the related art, accurate verification of data written in a database when a storage operation is performed is difficult.
In order to achieve the above object, according to one aspect of the present application, there is provided a data verification method. The method comprises the following steps: receiving a verification request sent by a client through the client, and identifying the verification request to obtain database information, wherein the verification request is used for verifying whether fields written into a table to be verified are normal or not when a storage operation is executed on the database; determining a database indicated by the database information, and determining a table to be checked in the database; obtaining a preset field and a target check statement according to configuration of a table to be checked, wherein the target check statement is used for inquiring the field to be checked; determining a target field to be checked from the table to be checked through a target check statement, and comparing a preset field with the target field to be checked to obtain a check result.
Optionally, obtaining the preset field and the target check statement according to the configuration of the table to be checked includes: obtaining a verification requirement of a client, identifying the verification requirement, and obtaining a preset field and a verification condition, wherein the verification condition is used for determining the range of the field to be verified; acquiring a field type of a field to be checked from a table to be checked; and configuring an initial check statement through check conditions, preset fields and field types to obtain a target check statement.
Optionally, determining the target field to be verified from the table to be verified by the target verification statement includes: obtaining a data processing program configured by a client, wherein the data processing program is used for performing data processing operation on a field to be checked, and the data processing operation at least comprises one of the following steps: a field intercept operation, a space removal operation, and a field offset operation; determining a field to be checked from the table to be checked according to the target check statement; and executing data processing operation on the field to be checked through a data processing program to obtain an updated field to be checked, and determining the updated field to be checked as a target field to be checked.
Optionally, determining the target field to be verified from the table to be verified by the target verification statement includes: identifying a target check statement to obtain a check type, wherein the check type comprises value-added check and equivalent check; under the condition that the verification type is value-added verification, before a client executes a storage operation, determining a first target field to be verified in a table to be verified through a target verification statement, after the client executes the storage operation, determining a second target field to be verified in the table to be verified through the target verification statement, and forming a target field to be verified by the first target field to be verified and the second target field to be verified; and under the condition that the verification type is equivalent verification, after the client executes the storage operation, determining a target field to be verified in the table to be verified through a target verification statement.
Optionally, comparing the preset field with the target field to be checked, and obtaining the check result includes: under the condition that the verification type is value-added verification, a first target field to be verified and a second target field to be verified are obtained, a change field is determined according to the first target field to be verified and the second target field to be verified, and the change field is compared with a preset field to obtain a verification result; under the condition that the verification type is equivalent verification, a target field to be verified is obtained, and a preset field is compared with the target field to be verified to obtain a verification result.
Optionally, determining a change field according to the first target field to be checked and the second target field to be checked, comparing the change field with a preset field, and obtaining a checking result includes: under the condition that the increment check indicates to execute check data increment, performing difference between the second target field to be checked and the first target field to be checked to obtain a first difference value field; judging whether the first difference value field is equal to a preset field; under the condition that the first difference value field is equal to the preset field, determining the verification result as successful verification; and determining the verification result as verification failure under the condition that the first difference value field is not equal to the preset field.
Optionally, determining a change field according to the first target field to be checked and the second target field to be checked, comparing the change field with a preset field, and obtaining a checking result includes: under the condition that the value added verification indicates to execute verification data reduction, performing difference between the first target field to be verified and the second target field to be verified to obtain a second difference value field; judging whether the second difference value field is equal to a preset field; under the condition that the second difference value field is equal to the preset field, determining the verification result as successful verification; and determining the verification result as verification failure under the condition that the second difference value field is not equal to the preset field.
Optionally, after obtaining the verification result, the method further comprises: obtaining the number of the verification results indicating the verification success, obtaining a first number, and obtaining a field of the verification results indicating the verification success, obtaining a verification success field; obtaining the number of verification failures indicated by the verification result, obtaining a second number, and obtaining a field of the verification failure indicated by the verification result, thus obtaining a verification failure field; calculating the ratio of the first quantity to the total number of checks to obtain a success rate of the checks, and calculating the ratio of the second quantity to the total number of the checks to obtain a failure rate of the checks; generating a check chart according to the check success field and the check failure field; and sending the verification success rate, the verification failure rate and the verification chart to the client.
In order to achieve the above object, according to another aspect of the present application, there is provided a data verification apparatus. The device comprises: the receiving unit is used for receiving a verification request sent by a client, identifying the verification request and obtaining database information, wherein the verification request is used for verifying whether fields written into a table to be verified are normal when a storage operation is executed on the database; the determining unit is used for determining a database indicated by the database information and determining a table to be checked in the database; the configuration unit is used for obtaining a preset field and a target check statement according to configuration of the table to be checked, wherein the target check statement is used for inquiring the field to be checked; the first execution unit is used for determining a target field to be checked from the table to be checked through a target check statement, and comparing a preset field with the target field to be checked to obtain a check result.
According to another aspect of the embodiment of the present application, there is further provided a processor, configured to execute a program, where the program controls a device in which a nonvolatile storage medium is located to execute a data verification method when running the program.
According to another aspect of embodiments of the present application, there is also provided an electronic device including one or more processors and a memory; the memory has stored therein computer readable instructions, and the processor is configured to execute the computer readable instructions, wherein the computer readable instructions execute a method of verifying data.
According to the application, the following steps are adopted: receiving a verification request sent by a client through the client, and identifying the verification request to obtain database information, wherein the verification request is used for verifying whether fields written into a table to be verified are normal or not when a storage operation is executed on the database; determining a database indicated by the database information, and determining a table to be checked in the database; obtaining a preset field and a target check statement according to configuration of a table to be checked, wherein the target check statement is used for inquiring the field to be checked; the target to-be-checked field is determined from the to-be-checked table through the target check statement, the preset field is compared with the target to-be-checked field to obtain a check result, the problem that in the related art, accurate check is difficult to be performed on data written in when a storage operation is performed on a database is solved, the target check statement can be configured and obtained through obtaining a check requirement, the target to-be-checked field is further obtained through the target check statement, the check result can be obtained after the target to-be-checked field is checked, and the effect of accurately checking different fields of different types of databases is achieved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this specification, illustrate embodiments of the application and together with the description serve to explain the application. In the drawings:
FIG. 1 is a flow chart of a method of verifying data provided in accordance with an embodiment of the present application;
FIG. 2 is a schematic diagram of an alternative data verification method provided in accordance with an embodiment of the present application;
FIG. 3 is a schematic diagram of a data verification device according to an embodiment of the present application;
fig. 4 is a schematic diagram of an electronic device according to an embodiment of the present application.
Detailed Description
It should be noted that, without conflict, the embodiments of the present application and features of the embodiments may be combined with each other. The application will be described in detail below with reference to the drawings in connection with embodiments.
In order that those skilled in the art will better understand the present application, a technical solution in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present application without making any inventive effort, shall fall within the scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present application and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate in order to describe the embodiments of the application herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It should be noted that, related information (including, but not limited to, user equipment information, user personal information, etc.) and data (including, but not limited to, data for presentation, analyzed data, etc.) related to the present disclosure are information and data authorized by a user or sufficiently authorized by each party.
The present application will be described with reference to preferred implementation steps, and fig. 1 is a flowchart of a method for verifying data according to an embodiment of the present application, and as shown in fig. 1, the method includes the following steps:
step S101, receiving a verification request sent by a client through a client, and identifying the verification request to obtain database information, wherein the verification request is used for verifying whether fields written into a table to be verified are normal when a storage operation is executed on a database.
Specifically, when a customer performs a financial service operation, the financial institution uses the application system to store fields generated in the operation process and relevant fields of the financial service into an associated database, so as to determine whether the data stored in the database is real and effective data and ensure that the stored service data is complete service data, and the database used by the financial institution needs to be subjected to data verification. When a client needs to check a field in the database, a check request is sent to a field checking device, wherein the field checking device refers to a device for checking the field in the database, and the check request can include a user name, a password of the client, a client address used by the client, database information and the like. The database information refers to information of a database to which a field to be verified belongs, and may include information such as a database address, a database name, and the like. By identifying the verification request, the client address used by the client is obtained while the database information is acquired, and further after the verification operation of the field of the table to be verified in the database is completed, the verification result can be sent to the client corresponding to the client address.
Step S102, determining a database indicated by the database information, and determining a table to be checked in the database.
Specifically, the tables to be checked refer to a list of fields to be checked, each database includes a plurality of tables to be checked, and each table to be checked includes a plurality of fields. After the database to be checked is determined by the database information, the field checking device is connected with the database to be checked, and after the connection, a field table to be checked is determined according to the table to be checked in the checking request, so that the field to be checked can be determined.
Step S103, obtaining a preset field and a target check statement according to configuration of the table to be checked, wherein the target check statement is used for inquiring the field to be checked.
Specifically, the target check statement is a check statement of a plurality of fields of a field of the table to be checked, which is obtained by adjusting configuration parameters in the initial check statement, the target check statement may be a compiled structured query statement, and the preset field refers to a field included in an expected field under the condition that a service field is normally stored when a storage operation is performed.
It should be noted that, the preset field and the target check statement are determined according to the check requirement sent by the client, and after the preset field is obtained through the check requirement, the target check statement is obtained according to the check requirement and the preset field, wherein the requirement information sent by the client contains the information of the field to be checked by the client.
Step S104, determining a target field to be checked from the table to be checked through a target check statement, and comparing a preset field with the target field to be checked to obtain a check result.
Specifically, after determining the target check statement, executing the target check statement in a table to be checked of the database, and screening by using the target check statement to obtain a field to be checked. Further, the field to be checked is processed by a data processing program, and a target field to be checked is obtained.
Further, comparing the preset field determined by the information of the table to be checked and the requirement information of the client with the target field to be checked obtained through screening, judging whether the preset field is equal to the target field to be checked, obtaining a check result of successful check when the preset field is equal to the target field to be checked, and obtaining a check result of failed check when the preset field is different from the target field to be checked. After the verification result is sent to the client, the client can analyze the function of the operation service according to the verification result, for example, if a certain user is performing the financial service of transaction transfer, a target field to be verified is generated after the service is performed, and the target field to be verified is verified, and the obtained result indicates that the number of verification failures is far greater than the number of verification successes, so that the transfer function may be abnormal, the function does not reach the expected effect, and further the transfer function needs to be adjusted to reduce economic loss as much as possible.
According to the data verification method provided by the embodiment of the application, the database information is obtained by receiving the verification request sent by the client through the client and identifying the verification request, wherein the verification request is used for verifying whether the field written into the table to be verified is normal or not when the storage operation is executed on the database; determining a database indicated by the database information, and determining a table to be checked in the database; obtaining a preset field and a target check statement according to configuration of a table to be checked, wherein the target check statement is used for inquiring the field to be checked; the target to-be-checked field is determined from the to-be-checked table through the target check statement, the preset field is compared with the target to-be-checked field to obtain a check result, the problem that the written field is difficult to accurately check when the database is subjected to storage operation in the related technology is solved, the target check statement can be configured and obtained through obtaining the check requirement, the target to-be-checked field is further obtained through the target check statement, the check result can be obtained after the target to-be-checked field is checked, and the effect of accurately checking different fields of different types of databases is achieved.
Optionally, in the method for verifying data provided in the embodiment of the present application, obtaining the preset field and the target verification statement according to the configuration of the table to be verified includes: obtaining a verification requirement of a client, identifying the verification requirement, and obtaining a preset field and a verification condition, wherein the verification condition is used for determining the range of the field to be verified; acquiring a field type of a field to be checked from a table to be checked; and configuring an initial check statement through check conditions, preset fields and field types to obtain a target check statement.
Specifically, the verification requirement may include information of fields in the database that the client needs to verify, for example, may include information of verification conditions, preset fields, and the like, where the verification conditions may be represented as a time range or a service range of the fields that need to be verified in the verification requirement, for example, a field stored when the client needs to verify that the user a performs a service, and then the verification requirement may include information of a name of the user, a name of a service employee who performs docking, service fields when performing different phases, and specific time for performing a service operation, and the like.
According to the verification requirement, a preset field associated with the target field to be verified can be obtained, namely, the field information of the client expected to store under the normal condition, for example, when the user A carries out a certain business transaction, the actual transaction amount is 1000, and the preset field can be indicated that the transaction amount related to the business information stored in the database by the application system after the user is expected to execute the business transaction is 1000.
It should be noted that the field type refers to a type of a field stored in the table to be checked, and may be a character type or a discrete type, for example, the character type field may be a field such as an amount of money, and the discrete type field may be a field such as a name and a time. The initial check statement is a preset check statement, configuration parameters in the initial check statement are adjusted by using check conditions and field types, so that the check statement can screen fields in a required database, for example, a transaction record with a financial transaction operation of more than 1000 of a user needs to be checked, the check conditions can be records with the financial operation of more than 1000, the field types are money, a target check statement can be obtained according to specific check conditions and the field types, and further screening of the fields is performed according to the target check statement. Therefore, the embodiment identifies the verification requirement to obtain the preset field and the verification condition, and the target verification statement can be accurately determined through the preset field, the verification condition and the field type of the field to be verified, so that the more accurate field to be verified is obtained through the target verification statement.
In order to acquire a field to be checked, information in a table to be checked needs to be processed, optionally, in the data checking method provided by the embodiment of the present application, determining, by a target check statement, the target field to be checked from the table to be checked includes: obtaining a data processing program configured by a client, wherein the data processing program is used for performing data processing operation on a field to be checked, and the data processing operation at least comprises one of the following steps: a field intercept operation, a space removal operation, and a field offset operation; determining a field to be checked from the table to be checked according to the target check statement; and executing data processing operation on the field to be checked through a data processing program to obtain an updated field to be checked, and determining the updated field to be checked as a target field to be checked.
Specifically, the data processing program is a program for processing the fields in the table to be checked, and may include a field interception operation, a space deletion operation, a field offset operation, and the like.
For example, if the acquired field in the table to be checked includes a plurality of spaces, the data processing program may be used to delete the spaces in the field, and the deleted field is used as the target field to be checked; if the table to be checked comprises a plurality of fields, when a part of the fields is needed, the fields to be checked can be intercepted by using a field interception operation in the data processing program; the field offset operation refers to a shift operation of a field with position deviation in a table to be checked, and if a certain row of field in the table to be checked needs to be obtained by using a target check statement, a data processing program can be used for shifting and then intercepting the required field.
After the field to be checked in the table to be checked is determined by using the target check statement, the data processing of the field to be checked is performed by using the compiled data processing program, so that a more accurate target field to be checked is obtained.
Optionally, in the method for verifying data provided by the embodiment of the present application, determining, by the target verification statement, the target field to be verified from the table to be verified includes: identifying a target check statement to obtain a check type, wherein the check type comprises value-added check and equivalent check; under the condition that the verification type is value-added verification, before a client executes a storage operation, determining a first target field to be verified in a table to be verified through a target verification statement, after the client executes the storage operation, determining a second target field to be verified in the table to be verified through the target verification statement, and forming a target field to be verified by the first target field to be verified and the second target field to be verified; and under the condition that the verification type is equivalent verification, after the client executes the storage operation, determining a target field to be verified in the table to be verified through a target verification statement.
Specifically, the verification of the fields can be divided into equivalence verification and value-added verification, wherein equivalence verification refers to judging whether a target to-be-verified field obtained from a to-be-verified table is equal to a preset field or not, and value-added verification refers to judging whether a difference field between two stored groups of service fields is equal to a preset field or not before and after a service transaction is performed by a client, so that in the case that the verification type is the value-added verification, the associated to-be-verified field before and after the service operation is performed by the client needs to be obtained, and when the verification type is the equivalence verification, the target to-be-verified field obtained after the service operation is performed by the client can be obtained.
The value-added verification result is obtained by comparing the obtained difference value between the two groups of fields with a preset field, optionally, in the verification method of data provided by the embodiment of the application, the preset field is compared with a target field to be verified, and the obtaining of the verification result includes: under the condition that the verification type is value-added verification, a first target field to be verified and a second target field to be verified are obtained, a change field is determined according to the first target field to be verified and the second target field to be verified, and the change field is compared with a preset field to obtain a verification result; under the condition that the verification type is equivalent verification, a target field to be verified is obtained, and a preset field is compared with the target field to be verified to obtain a verification result.
When the verification type is equivalent verification, after the client executes corresponding service operation, relevant service data generated by the operation are stored in a to-be-verified table of the database, then target to-be-verified fields in the service data in the to-be-verified table to be verified are obtained through target verification sentences, and the fields are compared with preset fields, so that a verification result is obtained.
When the check type is value added check, the target check statement needs to be executed twice. For example, in order to determine whether the data associated with a certain service is completely stored and correct, before a user needs to perform a financial service operation, a target check statement is executed once in a to-be-checked table of a database associated with the service to obtain a first target to-be-checked field; further, after the user A performs the service operation, the user A executes the target check statement again to obtain a second target field to be checked, which changes after the operation. And processing the two target fields to be checked, comparing the processed fields with the preset fields, and obtaining a check result when the check type is value-added check.
Optionally, in the method for verifying data provided by the embodiment of the present application, a change field is determined according to a first target field to be verified and a second target field to be verified, and the change field is compared with a preset field, so as to obtain a verification result, where the method includes: under the condition that the increment check indicates to execute check data increment, performing difference between the second target field to be checked and the first target field to be checked to obtain a first difference value field; judging whether the first difference value field is equal to a preset field; under the condition that the first difference value field is equal to the preset field, determining the verification result as successful verification; and determining the verification result as verification failure under the condition that the first difference value field is not equal to the preset field.
Specifically, when the verification type is value-added verification, the verification requirement of the client configuration needs to be identified, and further, the field change situation expected by the client is determined, where the field change situation may include that when the verification type is value-added verification, the change of the field representing the data value is data increase, that is, field increase, and the change of the field representing the data value is data decrease, that is, field decrease.
Specifically, when the change condition of the field expected by the customer is that the data is increased, that is, when the increment check indicates that the check field is increased, subtracting the second target to be checked field obtained after the customer performs the service operation from the first target to be checked field obtained before the customer performs the service operation, so as to obtain a first difference field, for example, when the user a receives 1000 yuan of transfer of other people, the field stored in the preset field of the database and representing the "account amount" is obtained through analysis of the transaction process, that is, the account amount is increased after the service operation is performed, that is, the increased value is 1000, the field with the field type of the account amount in the second target to be checked field is different from the field with the field type of the account amount in the first target to be checked field, so as to obtain a difference field, and judge whether the difference field is equal to the preset field, that is +1000, and under the condition that the difference between the difference field and the difference field is equal, that is 1000 is the field stored in the database to be checked compared with the field stored before the service operation, the field stored in the database is increased by the 1000, indicating that the check is successful, and under the condition that the difference is not equal, the fact that the difference field is not equal to the difference is indicated, the result is more accurate after the check is calculated by the fact that the difference is calculated, otherwise, the result is judged.
Optionally, in the method for verifying data provided by the embodiment of the present application, a change field is determined according to a first target field to be verified and a second target field to be verified, and the change field is compared with a preset field, so as to obtain a verification result, where the method includes: under the condition that the value added verification indicates to execute verification data reduction, performing difference between the first target field to be verified and the second target field to be verified to obtain a second difference value field; judging whether the second difference value field is equal to a preset field; under the condition that the second difference value field is equal to the preset field, determining the verification result as successful verification; and determining the verification result as verification failure under the condition that the second difference value field is not equal to the preset field.
Specifically, when the change condition of the field expected by the client is that the data is reduced, that is, when the value-added verification indicates that the verification field is reduced, subtracting the first target field to be verified obtained before the client executes the service operation from the second target field to be verified obtained after the client executes the service operation, so as to obtain a second difference field, and comparing the difference field with the preset field to obtain a verification result.
For example, when the user a transfers 1000 yuan to other people, the expected field representing the "account amount" stored in the preset field of the database is reduced by 1000 for the transaction process of the product, that is, the account amount is reduced after the business operation is performed than before the operation, and the value of the reduced amount is 1000. Therefore, the difference between the field with the field type of account amount in the first target to-be-checked field and the field with the field type of account amount in the second target to-be-checked field is needed to obtain a difference field, and whether the difference field is equal to the value of the field representing the 'account amount' in the preset field or not is judged, that is, whether the difference value of the difference field and the value of the difference field are-1000 is judged, if the difference value of the difference field and the value of the difference field are equal, that is, the field stored in the database to-be-checked table is reduced by 1000 compared with the field stored before the business operation, the verification is successful, otherwise, if the difference field and the field stored in the database to-be-checked table are not equal, for example, the field stored in the database to-be-checked table is reduced by 800 compared with the field stored before the business operation, the verification is failed, that is indicated, that is, the transfer function is abnormal, and the function is needed to be adjusted. Therefore, by judging whether the data is successfully checked in a quantization mode, a more accurate check result can be obtained.
After the verification result is obtained, the result needs to be analyzed and displayed, and optionally, in the data verification method provided by the embodiment of the application, after the verification result is obtained, the method further comprises the following steps: obtaining the number of the verification results indicating the verification success, obtaining a first number, and obtaining a field of the verification results indicating the verification success, obtaining a verification success field; obtaining the number of verification failures indicated by the verification result, obtaining a second number, and obtaining a field of the verification failure indicated by the verification result, thus obtaining a verification failure field; calculating the ratio of the first quantity to the total number of checks to obtain a success rate of the checks, and calculating the ratio of the second quantity to the total number of the checks to obtain a failure rate of the checks; generating a check chart according to the check success field and the check failure field; and sending the verification success rate, the verification failure rate and the verification chart to the client.
Specifically, the display mode can be calculated percentage or checking result list. Obtaining the verification results obtained after the field verification is carried out on all the target verification sentences, counting the number of verification success represented by all the verification results, namely the first number, and the number of verification failure represented by the verification results, namely the second number, determining the total number of the fields verified by all the target verification sentences, carrying out division calculation on the first number and the total number of the fields to obtain the verification success rate, and further carrying out division calculation on the second number and the total number of the fields to obtain the verification failure rate.
Further, since each target check statement can screen and obtain a plurality of fields to be checked, after comparing each field with a preset field, a check success or check failure result can be obtained, therefore, the total number of fields, the number of check successes and the number of check failures obtained by checking each target check statement can be counted, the ratio of the number of check successes to the total number of fields and the ratio of the number of check failures to the total number of fields can be calculated, and then the check result of the fields screened by each target check statement can be obtained.
Furthermore, the obtained fields obtained by screening all target check sentences can be checked, and the obtained fields representing successful check and the fields representing failed check are displayed in a listed manner, so that a customer can conveniently grasp the check conditions of specific fields of different types. Or the fields which are associated with each target check statement and indicate that the check is successful and the fields which indicate that the check is failed are displayed in a listed manner, and the check condition of a single statement can be conveniently mastered by a client through different display modes.
According to the embodiment, the fields in different aspects are displayed, so that a customer can conveniently complete modification of the database after obtaining the fields in different angles.
The embodiment of the application also provides a data verification method, and fig. 2 is a schematic diagram of an alternative data verification method provided according to the embodiment of the application, and as shown in fig. 2, the method is applied to a verification system, and in order to judge whether a field stored in a database is a real and effective field and ensure that a stored service field is a complete service field, field verification needs to be performed on the database used by a financial institution. The system comprises a database management module, a statement configuration module, a statement execution module, a data verification module and a statistics management module, wherein the database management module is used for being connected with a database, the statement configuration module is used for configuring a target verification statement, the statement execution module is used for executing the target verification statement to obtain a field to be verified, the data verification module is used for comparing the field to be verified with a preset field to obtain a comparison result, and the statistics management module is used for carrying out result statistics and display.
Specifically, the method comprises the following steps: after the client sends the verification request, the client is connected with the database to be verified according to the database information of the verification request, so that the fields in the database are verified.
Further, after the client provides the verification requirement, a table structure configuration method or an SQL configuration method is provided for configuring the required target verification statement. The table structure configuration method is that after a user selects a required database and a table to be checked, a system identifies a check requirement, an initial check statement is configured according to the check requirement, and a target check statement is obtained by configuring check conditions and field types in the initial check statement; the SQL configuration method is that after a user selects a required database and a table to be checked, an initial check statement is input, the system performs secondary configuration on the initial check statement to obtain a target check statement, and after screening the field to be checked in the target check statement according to a data processing program sent by the user, field processing is performed on the field to be checked.
Further, after determining the database and the table to be checked, executing the target check statement, formatting the execution result, returning the execution result, if the check type is value-added check, initiating SQL execution once before initiating the action of initiating the value-added operation, initiating SQL execution once after completing the action, obtaining the field to be checked, comparing the field to be checked with the field to be checked by utilizing the preset field to obtain the check result, and clearly displaying the check process after the check result is divided into check success and check failure.
According to the embodiment, the verification statement is configured, the obtained fields are compared with the preset fields by utilizing the verification statement, so that the field storage condition of the database can be obtained, the verification requirement for a large number of complex fields of different databases is met, and the verification efficiency is improved.
It should be noted that the steps illustrated in the flowcharts of the figures may be performed in a computer system such as a set of computer executable instructions, and that although a logical order is illustrated in the flowcharts, in some cases the steps illustrated or described may be performed in an order other than that illustrated herein.
The embodiment of the application also provides a data verification device, and the data verification device of the embodiment of the application can be used for executing the data verification method provided by the embodiment of the application. The following describes a data verification device provided by the embodiment of the present application.
FIG. 3 is a schematic diagram of a data verification device according to an embodiment of the present application, as shown in FIG. 3, the device includes: a receiving unit 30, a determining unit 31, a configuring unit 32, a first executing unit 33.
A receiving unit 30, configured to receive a verification request sent by a client through the client, and identify the verification request, to obtain database information, where the verification request is used to verify whether a field written into a table to be verified is normal when a storage operation is performed on the database;
a determining unit 31, configured to determine a database indicated by the database information, and determine a table to be checked in the database;
a configuration unit 32, configured to obtain a preset field and a target check statement according to the configuration of the table to be checked, where the target check statement is used to query the field to be checked;
the first execution unit 33 is configured to determine a target field to be checked from the table to be checked through a target check statement, and compare a preset field with the target field to be checked to obtain a check result.
Optionally, in the data verification device provided in the embodiment of the present application, the configuration unit 32 includes: the first acquisition module is used for acquiring the verification requirement of a client, identifying the verification requirement, and obtaining a preset field and verification conditions, wherein the verification conditions are used for determining the range of the field to be verified; the second acquisition module is used for acquiring the field type of the field to be checked from the table to be checked; the configuration module is used for configuring the initial check statement through the check condition, the preset field and the field type to obtain the target check statement.
Optionally, in the data verification device provided in the embodiment of the present application, the first execution unit 33 includes: a third obtaining module, configured to obtain a data processing program configured by a client, where the data processing program is configured to perform a data processing operation on a field to be verified, where the data processing operation includes at least one of: a field intercept operation, a space removal operation, and a field offset operation; the first determining module is used for determining a field to be checked from the table to be checked according to the target check statement; the first execution module is used for executing data processing operation on the field to be checked through the data processing program to obtain an updated field to be checked, and determining the updated field to be checked as a target field to be checked.
Optionally, in the data verification device provided in the embodiment of the present application, the first execution unit 33 includes: the identification module is used for identifying a target check statement to obtain a check type, wherein the check type comprises value-added check and equivalent check; the second execution module is used for determining a first target field to be checked in the table to be checked through a target check statement before the client executes the storage operation under the condition that the check type is value-added check, determining a second target field to be checked in the table to be checked through the target check statement after the client executes the storage operation, and forming a target field to be checked by the first target field to be checked and the second target field to be checked; and the third execution module is used for determining a target field to be verified in the table to be verified through a target verification statement after the client executes the storage operation under the condition that the verification type is equivalent verification.
Optionally, in the data verification device provided in the embodiment of the present application, the first execution unit 33 includes: the third acquisition module is used for acquiring a first target field to be checked and a second target field to be checked under the condition that the check type is value-added check, determining a change field according to the first target field to be checked and the second target field to be checked, and comparing the change field with a preset field to obtain a check result; the fourth acquisition module is used for acquiring the target field to be checked under the condition that the check type is equivalent check, and comparing the preset field with the target field to be checked to obtain a check result.
Optionally, in the data verification device provided in the embodiment of the present application, the first execution unit 33 includes: the first difference making module is used for making a difference between the second target field to be checked and the first target field to be checked under the condition that the increment check indicates that the check data is increased, so as to obtain a first difference value field; the first judging module is used for judging whether the first difference value field is equal to the preset field; the second determining module is used for determining the verification result as successful verification under the condition that the first difference value field is equal to the preset field; and the third determining module is used for determining the verification result as verification failure under the condition that the first difference value field is not equal to the preset field.
Optionally, in the data verification device provided in the embodiment of the present application, the first execution unit 33 includes: the second difference making module is used for making a difference between the first target field to be checked and the second target field to be checked under the condition that the value added check indicates that the execution check data is reduced, so as to obtain a second difference value field; the second judging module is used for judging whether the second difference value field is equal to the preset field; the fourth determining module is used for determining the verification result as successful verification under the condition that the second difference value field is equal to the preset field; and a fifth determining module, configured to determine the verification result as verification failure when the second difference field is not equal to the preset field.
Optionally, in the data verification device provided by the embodiment of the present application, the device further includes: the second acquisition unit is used for acquiring the number of the check results indicating the check success after the check results are obtained, acquiring the first number, and acquiring the field of the check results indicating the check success to obtain the check success field; the third acquisition unit is used for acquiring the number of the verification results indicating the verification failure, obtaining a second number, and acquiring a field of the verification results indicating the verification failure, and obtaining a verification failure field; the calculating unit is used for calculating the ratio of the first quantity to the total number of the checks to obtain the success rate of the checks, and calculating the ratio of the second quantity to the total number of the checks to obtain the failure rate of the checks; the generating unit is used for generating a check chart according to the check success field and the check failure field; and the sending unit is used for sending the verification success rate, the verification failure rate and the verification chart to the client.
The data verification device provided by the embodiment of the application is used for receiving a verification request sent by a client through a receiving unit 30, identifying the verification request and obtaining database information, wherein the verification request is used for verifying whether fields written into a table to be verified are normal when a storage operation is performed on a database; a determining unit 31, configured to determine a database indicated by the database information, and determine a table to be checked in the database; a configuration unit 32, configured to obtain a preset field and a target check statement according to the configuration of the table to be checked, where the target check statement is used to query the field to be checked; the first execution unit 33 is configured to determine a target field to be verified from the table to be verified through a target verification statement, compare a preset field with the target field to be verified to obtain a verification result, solve the problem that in the related art, it is difficult to accurately verify the data written in when the database performs the storage operation, obtain the target verification statement through obtaining the verification requirement, further obtain the target field to be verified through the target verification statement, and obtain the verification result after verifying the target field to be verified, thereby achieving the effect of accurately verifying different fields of the database of different types.
The data verification device includes a processor and a memory, where the receiving unit 30, the determining unit 31, the configuring unit 32, the first executing unit 33, and the like are stored as program units, and the processor executes the program units stored in the memory to implement corresponding functions.
The processor includes a kernel, and the kernel fetches the corresponding program unit from the memory. The kernel can be provided with one or more than one kernel, and the problem that the data written in the database is difficult to accurately verify when the database is subjected to storage operation in the related technology is solved by adjusting the kernel parameters.
The memory may include volatile memory, random Access Memory (RAM), and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM), among other forms in computer readable media, the memory including at least one memory chip.
The embodiment of the application provides a computer readable storage medium, on which a program is stored, which when executed by a processor, implements a method of verifying data.
The embodiment of the application provides a processor, which is used for running a program, wherein the program runs a verification method for execution data.
Fig. 4 is a schematic diagram of an electronic device according to an embodiment of the present application, and as shown in fig. 4, an electronic device 40 includes a processor, a memory, and a program stored on the memory and executable on the processor, where the processor is configured to execute computer readable instructions, and the computer readable instructions execute a method for verifying data when executed. The device herein may be a server, PC, PAD, cell phone, etc.
The application also provides a computer program product adapted to perform a method of verifying data when executed on a data processing apparatus.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In one typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include volatile memory in a computer-readable medium, random Access Memory (RAM) and/or nonvolatile memory, etc., such as Read Only Memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.
Computer readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. Computer-readable media, as defined herein, does not include transitory computer-readable media (transmission media), such as modulated data signals and carrier waves.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article or apparatus that comprises an element.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The foregoing is merely exemplary of the present application and is not intended to limit the present application. Various modifications and variations of the present application will be apparent to those skilled in the art. Any modification, equivalent replacement, improvement, etc. which come within the spirit and principles of the application are to be included in the scope of the claims of the present application.

Claims (11)

1. A method for verifying data, comprising:
receiving a verification request sent by a client through the client, and identifying the verification request to obtain database information, wherein the verification request is used for verifying whether fields written into a table to be verified are normal or not when a storage operation is executed on the database;
Determining a database indicated by the database information, and determining the table to be checked in the database;
obtaining a preset field and a target check statement according to the configuration of the table to be checked, wherein the target check statement is used for inquiring the field to be checked;
and determining a target field to be checked from the table to be checked through the target check statement, and comparing the preset field with the target field to be checked to obtain a check result.
2. The method of claim 1, wherein obtaining a preset field and a target check statement according to the table configuration to be checked comprises:
acquiring the verification requirement of the client, identifying the verification requirement, and obtaining the preset field and the verification condition, wherein the verification condition is used for determining the range of the field to be verified;
acquiring the field type of the field to be checked from the table to be checked;
and configuring an initial check statement through the check condition, the preset field and the field type to obtain the target check statement.
3. The method of claim 1, wherein determining, by the target check statement, a target to-be-checked field from the to-be-checked table comprises:
Acquiring a data processing program configured by the client, wherein the data processing program is used for performing data processing operation on the field to be checked, and the data processing operation at least comprises one of the following steps: a field intercept operation, a space removal operation, and a field offset operation;
determining the field to be checked from the table to be checked according to the target check statement;
and executing the data processing operation on the field to be checked through the data processing program to obtain an updated field to be checked, and determining the updated field to be checked as the target field to be checked.
4. The method of claim 1, wherein determining, by the target check statement, a target to-be-checked field from the to-be-checked table comprises:
identifying the target check statement to obtain a check type, wherein the check type comprises value-added check and equivalent check;
determining a first target field to be checked in the table to be checked through the target check statement before the client executes the storage operation under the condition that the check type is the value-added check, determining a second target field to be checked in the table to be checked through the target check statement after the client executes the storage operation, and forming the target field to be checked through the first target field to be checked and the second target field to be checked;
And under the condition that the verification type is the equivalence verification, after the client executes the storage operation, determining the target field to be verified in the table to be verified through the target verification statement.
5. The method of claim 4, wherein comparing the predetermined field with the target field to be verified to obtain a verification result comprises:
under the condition that the verification type is the value-added verification, acquiring the first target field to be verified and the second target field to be verified, determining a change field according to the first target field to be verified and the second target field to be verified, and comparing the change field with the preset field to obtain the verification result;
and under the condition that the verification type is the equivalent verification, acquiring the target field to be verified, and comparing the preset field with the target field to be verified to obtain the verification result.
6. The method of claim 5, wherein determining a change field according to the first target field to be checked and the second target field to be checked, and comparing the change field with the preset field, and obtaining the check result comprises:
Under the condition that the increment check indicates to execute check data increment, the second target field to be checked and the first target field to be checked are subjected to difference making to obtain a first difference value field;
judging whether the first difference value field is equal to the preset field or not;
under the condition that the first difference value field is equal to the preset field, determining the verification result as verification success;
and under the condition that the first difference value field is not equal to the preset field, determining the verification result as verification failure.
7. The method of claim 5, wherein determining a change field according to the first target field to be checked and the second target field to be checked, and comparing the change field with the preset field, and obtaining the check result comprises:
under the condition that the value added verification indicates to execute verification data reduction, the first target field to be verified and the second target field to be verified are subjected to difference making to obtain a second difference value field;
judging whether the second difference value field is equal to the preset field or not;
under the condition that the second difference value field is equal to the preset field, determining the verification result as verification success;
And under the condition that the second difference value field is not equal to the preset field, determining the verification result as verification failure.
8. The method of claim 1, wherein after obtaining the verification result, the method further comprises:
obtaining the number of the verification results indicating successful verification, obtaining a first number, and obtaining a field of the verification results indicating successful verification, obtaining a successful verification field;
obtaining the number of the verification results indicating verification failures, obtaining a second number, and obtaining a field of the verification results indicating verification failures, obtaining a verification failure field;
calculating the ratio of the first quantity to the total number of checks to obtain a success rate of the checks, and calculating the ratio of the second quantity to the total number of the checks to obtain a failure rate of the checks;
generating a check chart according to the check success field and the check failure field;
and sending the check success rate, the check failure rate and the check chart to the client.
9. A data verification apparatus, comprising:
the receiving unit is used for receiving a verification request sent by a client through the client, identifying the verification request and obtaining database information, wherein the verification request is used for verifying whether fields written into a table to be verified are normal or not when a storage operation is executed on the database;
The determining unit is used for determining a database indicated by the database information and determining the table to be checked in the database;
the configuration unit is used for obtaining a preset field and a target check statement according to the configuration of the table to be checked, wherein the target check statement is used for inquiring the field to be checked;
the first execution unit is used for determining a target field to be checked from the table to be checked through the target check statement, and comparing the preset field with the target field to be checked to obtain a check result.
10. A processor, characterized in that the processor is configured to run a program, wherein the program, when run, performs a method of verifying data according to any one of claims 1 to 8.
11. An electronic device comprising one or more processors and a memory for storing one or more programs, wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method of verifying data of any of claims 1-8.
CN202310640207.4A 2023-05-31 2023-05-31 Data verification method and device, processor and electronic equipment Pending CN116662317A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310640207.4A CN116662317A (en) 2023-05-31 2023-05-31 Data verification method and device, processor and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310640207.4A CN116662317A (en) 2023-05-31 2023-05-31 Data verification method and device, processor and electronic equipment

Publications (1)

Publication Number Publication Date
CN116662317A true CN116662317A (en) 2023-08-29

Family

ID=87716720

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310640207.4A Pending CN116662317A (en) 2023-05-31 2023-05-31 Data verification method and device, processor and electronic equipment

Country Status (1)

Country Link
CN (1) CN116662317A (en)

Similar Documents

Publication Publication Date Title
CN107885656B (en) Automatic product algorithm testing method and application server
CN110222042B (en) Method, device, equipment and system architecture for determining checked business data
CN111209206B (en) Automatic test method and system for software products
CN108897686B (en) Full-entry automatic testing method and device
CN104778123A (en) Method and device for detecting system performance
CN114490375A (en) Method, device and equipment for testing performance of application program and storage medium
CN112882957B (en) Test task validity checking method and device
CN113220597B (en) Test method, test device, electronic equipment and storage medium
US20200294057A1 (en) Business processing method, apparatus, and equipment
CN111984519B (en) Test method and device for service system
CN116662317A (en) Data verification method and device, processor and electronic equipment
CN116185706A (en) Data backup method and device, computing and storage medium and electronic equipment
CN113590440A (en) Pressure testing method, device, equipment and medium for bank core system
CN111951017A (en) Counter transaction authorization method, system, computer equipment and readable storage medium
CN116468529A (en) Financial business processing method and device, processor and electronic equipment
CN114048145A (en) Transaction checking test method and device, electronic equipment and storage medium
CN118093948A (en) Attendance checking data query method and device, storage medium and electronic equipment
CN113743948A (en) Method and device for generating transaction information file, electronic equipment and storage medium
CN116627830A (en) Financial business testing method and device, storage medium and electronic equipment
CN116501587A (en) Data processing method, device, electronic equipment and storage medium
CN116228414A (en) Transaction processing method and device, processor and electronic equipment
CN116594873A (en) Service judging method, device, processor and electronic equipment
CN118245369A (en) Product model testing method and device, electronic equipment and readable storage medium
CN117492817A (en) Processing method and device of environment configuration information, storage medium and electronic equipment
CN117350839A (en) Account checking method and device, storage medium and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination