A data verification method, device, equipment and medium
By determining the request type in the data verification method and selecting target verification rules, the problem of inflexible data verification in the prior art is solved, and the accuracy and adaptability of data verification are improved.
Patent Information
- Application Number
- CN202011585208.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-28
- Publication Date
- 2024-12-24
- Estimated Expiration
- 2040-12-28
AI Technical Summary
Existing data verification methods cannot flexibly adapt to multiple types of data verification requests, resulting in poor data verification accuracy.
By obtaining the data verification request from the client, determining the request type based on the interface information, and determining the target verification rule from the candidate verification rule to verify the verification data.
Improve the accuracy and flexibility of data verification, adapt to different types of data verification requests, and reduce development workload.
Smart Images

Figure CN112579632B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of computer technology, and in particular, to a data verification method, device, equipment and medium. Background Art
[0002] In the financial field, in order to supervise the operating and management data of various financial institutions, financial regulatory authorities require financial institutions to submit operating and management data regularly. In the current environment of strong supervision, errors in data submission may result in fines or inquiries from regulatory authorities. Therefore, data needs to be verified before submitting it to financial regulatory authorities.
[0003] Most existing data verification methods verify the data to be verified through fixed verification rules, which cannot flexibly adapt to various types of data verification requests, resulting in poor accuracy of data verification. Summary of the invention
[0004] The embodiments of the present application disclose a data verification method, apparatus, device and medium to solve the problem that the existing data verification method cannot flexibly adapt to various types of data verification requests, thereby resulting in poor data verification accuracy.
[0005] In a first aspect, an embodiment of the present invention provides a data verification method, including:
[0006] Obtaining a data verification request from a client, and determining a request type of the data verification request according to interface information of the interface to which the data verification request belongs; wherein the request type is a single verification request or a batch verification request;
[0007] According to the association relationship between the preset verification rule and the request type, determine the target verification rule corresponding to the request type from the candidate verification rules;
[0008] The target verification rule is used to verify the data to be verified in the client.
[0009] In a second aspect, an embodiment of the present invention provides a data verification device, including:
[0010] A request type determination module, used to obtain a data verification request from a client, and determine the request type of the data verification request according to the interface information of the interface to which the data verification request belongs; wherein the request type is a single verification request or a batch verification request;
[0011] A target verification rule determination module, used to determine the target verification rule corresponding to the request type from the candidate verification rules according to the association relationship between the preset verification rule and the request type;
[0012] The data verification module is used to verify the data to be verified in the client using the target verification rule.
[0013] In a third aspect, an embodiment of the present invention provides an electronic device, the electronic device comprising:
[0014] one or more processors;
[0015] a storage device for storing one or more programs,
[0016] When the one or more programs are executed by the one or more processors, the one or more processors implement the data verification method as described in any one of the embodiments of the present invention.
[0017] In a fourth aspect, an embodiment of the present invention provides a computer-readable medium having a computer program stored thereon, which, when executed by a processor, implements a data verification method as described in any one of the embodiments of the present invention.
[0018] The embodiment of the present invention improves the accuracy of data verification by selecting corresponding target verification rules from candidate verification rules for different types of data verification requests to perform data verification. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary users in this field, other related drawings can be obtained based on these drawings without creative work.
[0020] Figure 1 is a flow chart of a data verification method provided by Embodiment 1 of the present invention;
[0021] Figure 2 A flowchart of a data verification method provided in Embodiment 2 of the present invention;
[0022] Figure 3 A flowchart of a data verification method provided in Embodiment 3 of the present invention;
[0023] Figure 4 A schematic diagram of the structure of a data verification device provided in Embodiment 4 of the present invention;
[0024] Figure 5 This is a schematic diagram of the structure of an electronic device provided in Embodiment 5 of the present invention. DETAILED DESCRIPTION
[0025] The embodiments of the present invention are further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the embodiments of the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only structures related to the embodiments of the present invention are shown in the accompanying drawings, rather than all structures.
[0026] Since regulatory agencies require data to come from multiple business systems, and the results of data collection often need to be processed, the data reporting system is generally a back-end system based on the data warehouse after processing and integration of data. Reporting generally requires a high degree of timeliness. If a large amount of data is found to be inconsistent with the reporting requirements after being processed by the data warehouse, and then the business system client is required to make adjustments, it will greatly extend the data reporting cycle. In order to ensure the timeliness of data reporting, it is necessary to perform real-time data verification on the business system client.
[0027] Embodiment 1
[0028] Figure 1 1 is a flow chart of a data verification method provided by the first embodiment of the present invention. This embodiment is applicable to the case of verifying the business management data submitted to the financial regulatory agency. The method can be executed by the data verification device provided by the embodiment of the present invention, and the device can be implemented by software and / or hardware. Figure 1 As shown, the method may include:
[0029] Step 101: Obtain a data verification request from a client, and determine the request type of the data verification request based on the interface information of the interface to which the data verification request belongs; wherein the request type is a single verification request or a batch verification request.
[0030] Among them, a single verification request indicates that the data to be verified is a single data, such as a single database table data or a single file data, etc., and a batch verification request indicates that the data to be verified is batch data, such as batch database table data or batch file data, etc.
[0031] In one embodiment, the client generates a data verification request based on the data to be verified, and according to the type of the data verification request, determines the target interface in the interface exposed by the server, and calls the target interface to send the data verification request to the server. For example, if the type of the data verification request is a single verification request, the single verification interface exposed by the server is called to send the data verification request to the server; for another example, if the type of the data verification request is a batch verification request, the batch verification interface exposed by the server is called to send the data verification request to the server. After the server obtains the data verification request from the client, it determines the request type of the data verification request based on the interface information of the interface to which the data verification request belongs, that is, the interface information of the interface called by the client.
[0032] Optionally, if the interface information of the interface to which the data verification request belongs is a single verification interface, then the request type of the data verification request is determined to be a single verification request; if the interface information of the interface to which the data verification request belongs is a batch verification interface, then the request type of the data verification request is determined to be a batch verification request.
[0033] Optionally, before the client generates a data verification request based on the data to be verified, the following steps may also be performed:
[0034] According to the database attribute information specified by the user, a connection is established with the target database, and database table data is obtained from the target database, or, according to the file attribute information specified by the user, a target file is accessed, and file data is obtained from the target file.
[0035] The database attribute information and file attribute information can be arbitrarily specified by the user according to the verification requirements. Database attribute information includes but is not limited to database name, database type, database connection URL (Uniform Resource Locator) string, user name and password; file attribute information includes but is not limited to file name, file type and file structure.
[0036] By obtaining a data verification request from a client and determining the request type of the data verification request according to the interface information of the interface to which the data verification request belongs, a foundation is laid for subsequently determining a target verification rule corresponding to the request type.
[0037] Step 102: According to the association relationship between the preset verification rule and the request type, determine the target verification rule corresponding to the request type from the candidate verification rules.
[0038] Among them, the user pre-configures at least one candidate verification rule according to actual business needs, such as the format requirements of financial regulatory agencies for reported data. Optionally, the candidate verification rule includes at least one of non-empty verification, field length verification, illegal character verification, and date format verification. In addition, the candidate verification rule may also include field interception verification, regular expression verification, count verification, and field first and last character verification. In addition, the user also establishes an association relationship between the verification rule and the data verification request type based on the candidate verification rule. One data verification request type can be associated with one verification rule or multiple verification rules.
[0039] In one implementation, the server uses the candidate verification rule corresponding to the request type of the data verification request obtained from the client as the target verification rule based on the pre-established association relationship between the verification rule and the request type. For example, if a single verification request is associated with verification rule A, verification rule B, and verification rule C, then verification rule A, verification rule B, and verification rule C in the candidate verification rules are used as the target verification rules.
[0040] By determining the target verification rule corresponding to the request type from the candidate verification rules based on the association between the preset verification rules and the request type, the effect of determining the adapted target verification rule according to the request type is achieved, laying the foundation for subsequent verification of the verification data according to the target verification rule.
[0041] Step 103: Use the target verification rule to verify the data to be verified in the client.
[0042] In one embodiment, the data to be verified is obtained from the client, and each field in the data to be verified is verified according to the target verification rules. The fields that do not meet the target verification rules are regarded as abnormal fields, and an alarm message is generated to notify relevant users to modify the abnormal fields in the data to be verified.
[0043] The technical solution provided by the embodiment of the present invention obtains a data verification request from the client, and determines the request type of the data verification request based on the interface information of the interface to which the data verification request belongs, and then determines the target verification rule corresponding to the request type from the candidate verification rules based on the association between the preset verification rule and the request type, and finally uses the target verification rule to verify the data to be verified in the client, thereby achieving the effect of selecting matching target verification rules to verify the data to be verified according to different types of data verification requests, thereby improving the accuracy of data verification.
[0044] Based on the above embodiment, the method further includes:
[0045] In response to a user's configuration operation on the association relationship between the verification rule and the request type, the association relationship between the verification rule and the request type is updated.
[0046] In one implementation, the user can configure the association between the verification rules and the request type according to the change of actual business needs. The configuration operations include but are not limited to adding a new association, deleting an association, and modifying an association, where adding an association means adding a new associated verification rule for any request type; deleting an association means deleting any currently associated verification rule for any request type; modifying an association means changing the request type currently associated with any verification rule to another request type. For example, if the request type currently associated with verification rule A is a single verification request, its association is modified to change the request type associated with verification rule A to a batch verification request. The server responds to the user's configuration operation on the association between the verification rules and the request types and updates the association between the verification rules and the request types.
[0047] By responding to the user's configuration operation on the association between the verification rules and the request type, the association between the verification rules and the request type is updated, which reduces the development workload and improves the flexibility of data verification.
[0048] Embodiment 2
[0049] Figure 2 Flow chart of a data verification method provided in Embodiment 2 of the present invention. This embodiment is applicable to the case where the request type of the data verification request is a single verification request, such as Figure 2 As shown, the method may include:
[0050] Step 201: Obtain a data verification request from a client, and determine the request type of the data verification request based on the interface information of the interface to which the data verification request belongs.
[0051] Step 202: If the request type is a single verification request, the target verification rule corresponding to the single verification request is determined from the candidate verification rules according to the association between the preset verification rule and the request type, and the target verification rule corresponding to the single verification request is used as the first type of verification rule.
[0052] Step 203: Use the first type of verification rules to verify the single database table data or the single file data.
[0053] In one embodiment, the server sends a data acquisition instruction to the client to acquire a single database table data or a single file data from the client. The server uses the first type of verification rule to verify the single database table data or the single file data to determine whether the single database table data or the single file data has an abnormal field.
[0054] Optionally, step 203 includes three steps A, B and C:
[0055] A. Acquire the single database table data or the single file data from the client.
[0056] In one implementation, the server sends a data acquisition instruction to the client, and the client then calls the single verification interface of the server to transmit a single database table data or a single file data to the server in a Map manner.
[0057] B. Match each field in the single database table data or single file data with the first type of verification rules respectively.
[0058] In one implementation, the server parses and calculates the first type of verification rules through a preset syntax analyzer generation tool, such as antlr4, so as to convert the first type of verification rules into implementable function judgment logic, such as non-empty verification can be converted into non-empty function, and field length verification can be converted into length function, etc. Then, through the converted logic judgment function, each field in a single database table data or a single file data is matched and verified.
[0059] C. Treat the fields in the single database table data that do not conform to the first type of verification rules as the first type of abnormal fields, or treat the fields in the single file data that do not conform to the first type of verification rules as the second type of abnormal fields.
[0060] In one implementation, a field in a single database table data that does not conform to the logic judgment function is regarded as a first type of abnormal field; or a field in a single file data that does not conform to the logic judgment function is regarded as a second type of abnormal field. For example, an empty field is regarded as an abnormal field, and another example is regarded as a field whose field length is greater than a threshold value.
[0061] The technical solution provided by the embodiment of the present invention, if the request type is a single verification request, determines the target verification rule corresponding to the single verification request from the candidate verification rules according to the association relationship between the preset verification rule and the request type, and uses the target verification rule corresponding to the single verification request as the first-class verification rule, and uses the first-class verification rule to verify the single database table data or the single file data, thereby achieving the effect of using an adapted target verification rule to verify the single database table data or the single file data, and improving the accuracy of the verification of the single database table data or the single file data.
[0062] Embodiment 3
[0063] Figure 3 Flow chart of a data verification method provided in Embodiment 3 of the present invention. This embodiment is applicable to the case where the request type of the data verification request is a batch verification request, such as Figure 2 As shown, the method may include:
[0064] Step 301: Obtain a data verification request from a client, and determine the request type of the data verification request according to the interface information of the interface to which the data verification request belongs.
[0065] Step 302: If the request type is a batch verification request, the target verification rule corresponding to the batch verification request is determined from the candidate verification rules according to the association between the preset verification rule and the request type, and the target verification rule corresponding to the batch verification request is used as the second type of verification rule.
[0066] Step 303: Use the second type of verification rules to verify the batch database table data or the batch file data.
[0067] In one embodiment, the server sends a data acquisition instruction to the client to acquire batch database table data or batch file data from the client. The server uses the second type of verification rule to verify the batch database table data or batch file data to determine whether the batch database table data or batch file data has abnormal fields.
[0068] Optionally, in step 303, “using the second type of verification rule to verify the batch file data” includes the following three steps:
[0069] 1) Acquire the batch file data from the client in batches according to preset batches.
[0070] Exemplarily, assuming that the batch file data includes 100 file data in total and the preset batches are 20 times, the batch file data is obtained from the client in 20 batches, and 5 file data are obtained in each batch.
[0071] 2) Match each field in the batch file data obtained in each batch with the second type of verification rules respectively.
[0072] In one implementation, the server parses and calculates the second type of verification rules through a preset syntax analyzer generation tool, such as antlr4, so as to convert the second type of verification rules into an implementable function judgment logic. Then, through the converted logic judgment function, each field in the batch file data obtained in each batch is matched and verified.
[0073] 3) The fields in the batch file data obtained in each batch that do not comply with the second type of verification rules are regarded as the third type of abnormal fields.
[0074] In one implementation, the fields in the batch file data acquired in each batch that do not conform to the logic judgment function are regarded as the third type of abnormal fields.
[0075] Batch file data is obtained from the client in batches according to preset batches, and each field in the batch file data obtained in each batch is matched with the second type of verification rules respectively, and then the fields in the batch file data obtained in each batch that do not meet the second type of verification rules are treated as the third type of abnormal fields. Since the batch file data is obtained in batches, the problem of data loss that may result from obtaining all batch file data at once is avoided, thereby ensuring that data verification can proceed smoothly.
[0076] Optionally, in step 303, “using the second type of verification rule to verify the batch database table data” includes the following three steps:
[0077] 1) Obtaining a structured query statement corresponding to the second type of verification rule from a preset structured query statement.
[0078] Among them, the user has pre-written corresponding structured query statements for all candidate verification rules by custom writing, such as SQL, which supports parameter passing, multi-table association query and database native syntax. In addition, the association relationship between each candidate verification rule and the structured query statement is established.
[0079] In one implementation, the server obtains the structured query statement corresponding to the second type of verification rule from the pre-written structured query statements based on the association relationship between the candidate verification rules and the structured query statements.
[0080] 2) Sending the structured query statement to the client, so that the client executes the structured query statement to query and obtain the fields in the batch database table data that do not comply with the second type of verification rules.
[0081] In one embodiment, the server provides a REST service to the outside world, and the client obtains a structured query statement corresponding to the second type of verification rule from the server by calling the REST service, and executes the structured query statement in the database to which the batch database table data belongs, thereby querying the database to obtain the fields in the batch database table data that do not comply with the second type of verification rule, and directly marking the abnormal fields in the database.
[0082] 3) receiving the fields in the batch database table data sent by the client that do not comply with the second type of verification rules as the fourth type of abnormal fields.
[0083] In one implementation, the client sends the fields in the batch database table data obtained by query that do not comply with the second type of verification rules to the server, and the server receives and regards these fields as the fourth type of abnormal fields.
[0084] By obtaining the structured query statement corresponding to the second type of verification rule from the preset structured query statement, and sending the structured query statement to the client, so that the client executes the structured query statement to query the fields in the batch database table data that do not comply with the second type of verification rule, and then receiving the fields in the batch database table data sent by the client that do not comply with the second type of verification rule as the fourth type of abnormal field, since the data verification process is sent to the client for execution, the client does not need to send a large amount of database table data to the server, which reduces the occupancy of network bandwidth, saves the time spent on data transmission, and improves the efficiency of data verification.
[0085] The technical solution provided by the embodiment of the present invention obtains a data verification request from a client, and determines the request type of the data verification request according to the interface information of the interface to which the data verification request belongs. If the request type is a batch verification request, the target verification rule corresponding to the batch verification request is determined from the candidate verification rules according to the association between the preset verification rule and the request type, and the target verification rule corresponding to the batch verification request is used as the second-type verification rule. Finally, the second-type verification rule is used to verify the batch database table data or batch file data, thereby achieving the effect of verifying the batch database table data or batch file data using an adapted target verification rule, and improving the accuracy of the verification of the batch database table data or batch file data.
[0086] Based on the above embodiment, the method further includes:
[0087] The first type of abnormal field, the second type of abnormal field and the third type of abnormal field are sent to the client, so that the client stores the first type of abnormal field, the second type of abnormal field and the third type of abnormal field.
[0088] In one implementation, the server packages the first type of abnormal field, the second type of abnormal field, and the third type of abnormal field and sends them to the client, so that the client stores the first type of abnormal field, the second type of abnormal field, and the third type of abnormal field locally for subsequent analysis.
[0089] Based on the above embodiment, the method further includes:
[0090] The first type of abnormal fields and the fourth type of abnormal fields are stored as database table abnormal fields; the second type of abnormal fields and the third type of abnormal fields are stored as file abnormal fields.
[0091] In one embodiment, the server stores the first type of abnormal fields and the fourth type of abnormal fields as database table abnormal fields in a first preset file in the server for subsequent analysis; and stores the second type of abnormal fields and the third type of abnormal fields as file abnormal fields in a second preset file in the server for subsequent analysis.
[0092] Based on the above embodiment, the method further includes:
[0093] Determine a first ratio between the number of abnormal fields in the database table and the total number of fields in the verified database table data; if the first ratio is greater than or equal to a first preset threshold, generate database table warning information.
[0094] For example, assuming that the number of abnormal fields in the database table is 200, the total number of fields of the verified database table data is 10,000, the first preset threshold is 0.015, and the first ratio is 200 / 10,000=0.02. Since the first ratio of 0.02 is greater than the first preset threshold of 0.015, it indicates that a large number of data quality problems occur in the database table data, and database table warning information is generated accordingly to remind relevant personnel to pay attention and conduct risk problem investigation on the database to which the data table data belongs.
[0095] Based on the above embodiment, the method further includes:
[0096] Determine a second ratio between the number of abnormal fields in the file and the total number of fields in the verified file data; if the second ratio is greater than or equal to a second preset threshold, generate file warning information.
[0097] For example, assuming that the number of abnormal fields in the file is 100, the total number of fields in the verified file data is 10000, the second preset threshold is 0.01, and the second ratio is 100 / 10000=0.01. Since the second ratio 0.01 is equal to the second preset threshold 0.01, it means that a large number of data quality problems occur in the file data, and file warning information is generated accordingly to remind relevant personnel to pay attention and conduct risk inspection on the files to which the file data belongs.
[0098] Embodiment 4
[0099] Figure 4 This is a schematic diagram of the structure of a data verification device provided in the fourth embodiment of the present invention. The data verification device can execute a data verification method provided in any embodiment of the present invention and has the corresponding functional modules and beneficial effects of the execution method. Figure 4 As shown, the device may include:
[0100] The request type determination module 41 is used to obtain a data verification request from a client, and determine the request type of the data verification request according to the interface information of the interface to which the data verification request belongs; wherein the request type is a single verification request or a batch verification request;
[0101] A target verification rule determination module 42 is used to determine a target verification rule corresponding to the request type from candidate verification rules according to the association relationship between the preset verification rule and the request type;
[0102] The data verification module 43 is used to verify the data to be verified in the client using the target verification rule.
[0103] Based on the above embodiment, the request type determination module 41 is specifically used for:
[0104] If the interface information of the interface to which the data verification request belongs is a single verification interface, determining that the request type of the data verification request is a single verification request;
[0105] If the interface information of the interface to which the data verification request belongs is a batch verification interface, it is determined that the request type of the data verification request is a batch verification request.
[0106] Based on the above embodiment, the data to be verified is one of single database table data, batch database table data, single file data and batch file data;
[0107] The target verification rule determination module 42 is specifically used to:
[0108] The target verification rule corresponding to the single verification request is used as the first type of verification rule, and the target verification rule corresponding to the batch verification request is used as the second type of verification rule;
[0109] Accordingly, the data verification module 43 is specifically used for:
[0110] Using the first type of verification rule to verify the single database table data or the single file data;
[0111] The batch database table data or the batch file data is verified using the second type of verification rules.
[0112] Based on the above embodiment, the data verification module 43 is further used for:
[0113] Acquire the single database table data or the single file data from the client;
[0114] Matching the single database table data or each field in the single file data with the first type of verification rules respectively;
[0115] The fields in the single database table data that do not conform to the first type of verification rules are regarded as first type abnormal fields, or the fields in the single file data that do not conform to the first type of verification rules are regarded as second type abnormal fields.
[0116] Based on the above embodiment, the data verification module 43 is further used for:
[0117] Acquiring the batch file data from the client in batches according to preset batches;
[0118] Matching each field in the batch file data obtained in each batch with the second type of verification rules respectively;
[0119] The fields in the batch file data obtained in each batch that do not comply with the second type of verification rules are regarded as the third type of abnormal fields.
[0120] Based on the above embodiment, the data verification module 43 is further used for:
[0121] Obtaining a structured query statement corresponding to the second type of verification rule from a preset structured query statement;
[0122] Sending the structured query statement to the client so that the client executes the structured query statement to query and obtain the fields in the batch database table data that do not comply with the second type of verification rules;
[0123] The fields in the batch database table data sent by the client that do not comply with the second type of verification rules are received as fourth type abnormal fields.
[0124] On the basis of the above embodiment, the device further includes an abnormal field sending module, which is specifically used to:
[0125] The first type of abnormal field, the second type of abnormal field and the third type of abnormal field are sent to the client, so that the client stores the first type of abnormal field, the second type of abnormal field and the third type of abnormal field.
[0126] On the basis of the above embodiment, the device further includes an abnormal field storage module, which is specifically used to:
[0127] The first type of abnormal field and the fourth type of abnormal field are stored as abnormal fields in the database table;
[0128] The second type of abnormal field and the third type of abnormal field are stored as file abnormal fields.
[0129] On the basis of the above embodiment, the device further includes a first early warning module, which is specifically used for:
[0130] Determine a first ratio between the number of abnormal fields in the database table and the total number of fields in the verified database table data;
[0131] If the first ratio is greater than or equal to a first preset threshold, database table warning information is generated.
[0132] On the basis of the above embodiment, the device further includes a second early warning module, which is specifically used for:
[0133] Determining a second ratio between the number of abnormal fields in the file and the total number of fields in the verified file data;
[0134] If the second ratio is greater than or equal to a second preset threshold, file warning information is generated.
[0135] Based on the above embodiment, the candidate verification rules include at least one of non-empty verification, field length verification, illegal character verification and date format verification.
[0136] Based on the above embodiment, the device further includes an association relationship updating module, which is specifically used to:
[0137] In response to a user's configuration operation on the association relationship between the verification rule and the request type, the association relationship between the verification rule and the request type is updated.
[0138] A data verification device provided in an embodiment of the present invention can execute a data verification method provided in any embodiment of the present invention, and has functional modules and beneficial effects corresponding to the execution method. For technical details not fully described in this embodiment, please refer to a data verification method provided in any embodiment of the present invention.
[0139] Embodiment 5
[0140] Figure 5 This is a schematic diagram of the structure of an electronic device provided in Embodiment 5 of the present invention. Figure 5 A block diagram of an exemplary electronic device 500 suitable for implementing embodiments of the present invention is shown. Figure 5 The electronic device 500 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0141] like Figure 5As shown, the electronic device 500 is in the form of a general computing electronic device. The components of the electronic device 500 may include but are not limited to: one or more processors or processing units 501, a system memory 502, and a bus 503 connecting different system components (including the system memory 502 and the processing unit 501).
[0142] Bus 503 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus structures. For example, these architectures include but are not limited to Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, Enhanced ISA bus, Video Electronics Standards Association (VESA) local bus and Peripheral Component Interconnect (PCI) bus.
[0143] The electronic device 500 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the electronic device 500, including volatile and non-volatile media, removable and non-removable media.
[0144] System memory 502 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 504 and / or cache memory 505. Electronic device 500 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 506 may be used to read and write non-removable, non-volatile magnetic media ( Figure 5 not shown, usually called a "hard drive"). Although Figure 5 Not shown in the figure, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, a DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to the bus 503 via one or more data medium interfaces. The memory 502 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the embodiments of the present invention.
[0145] A program / utility 508 having a set (at least one) of program modules 507 may be stored, for example, in the memory 502, such program modules 507 including but not limited to an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. The program modules 507 generally perform the functions and / or methods of the embodiments described herein.
[0146] The electronic device 500 may also communicate with one or more external electronic devices 509 (e.g., keyboards, pointing electronic devices, displays 510, etc.), may also communicate with one or more electronic devices that enable a user to interact with the electronic device 500, and / or communicate with any electronic device that enables the electronic device 500 to communicate with one or more other computing electronic devices (e.g., network cards, modems, etc.). Such communication may be performed via an input / output (I / O) interface 611. Furthermore, the electronic device 500 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 512. As shown, the network adapter 512 communicates with other modules of the electronic device 500 via a bus 503. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 500, including but not limited to: microcode, electronic device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.
[0147] The processing unit 501 executes various functional applications and data processing by running the program stored in the system memory 502, for example, implementing the data verification method provided in the embodiment of the present invention, including:
[0148] Obtaining a data verification request from a client, and determining a request type of the data verification request according to interface information of the interface to which the data verification request belongs; wherein the request type is a single verification request or a batch verification request;
[0149] According to the association relationship between the preset verification rule and the request type, determine the target verification rule corresponding to the request type from the candidate verification rules;
[0150] The target verification rule is used to verify the data to be verified in the client.
[0151] Embodiment 6
[0152] Embodiment 6 of the present invention further provides a computer-readable storage medium, wherein the computer-executable instructions are used to execute a data verification method when executed by a computer processor, the method comprising:
[0153] Obtaining a data verification request from a client, and determining a request type of the data verification request according to interface information of the interface to which the data verification request belongs; wherein the request type is a single verification request or a batch verification request;
[0154] According to the association relationship between the preset verification rule and the request type, determine the target verification rule corresponding to the request type from the candidate verification rules;
[0155] The target verification rule is used to verify the data to be verified in the client.
[0156] Of course, a storage medium containing computer executable instructions provided in an embodiment of the present invention, whose computer executable instructions are not limited to the method operations described above, can also perform related operations in a data verification method provided in any embodiment of the present invention. The computer-readable storage medium of an embodiment of the present invention can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, - but not limited to - an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it.
[0157] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0158] Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0159] Computer program code for performing the operations of the present invention may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0160] Note that the above are only preferred embodiments of the present invention and the technical principles used. Users in the field will understand that the present invention is not limited to the specific embodiments described here, and users in the field can make various obvious changes, readjustments and substitutions without departing from the scope of protection of the present invention. Therefore, although the present invention is described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may also include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the attached claims.
Claims
1. A data verification method, characterized in that: include: Obtaining a data verification request from a client, and determining a request type of the data verification request according to interface information of the interface to which the data verification request belongs; wherein the request type is a single verification request or a batch verification request; According to the association relationship between the preset verification rule and the request type, the target verification rule corresponding to the request type is determined from the candidate verification rules; wherein the target verification rule is the candidate verification rule corresponding to the request type of the data verification request obtained from the client; the target verification rule corresponding to the single verification request is the first type of verification rule, and the target verification rule corresponding to the batch verification request is the second type of verification rule; The target verification rule is used to verify the data to be verified in the client; wherein the data to be verified is one of single database table data, batch database table data, single file data and batch file data; The method further comprises: In response to the user's configuration operation on the association between the verification rule and the request type, the association between the verification rule and the request type is updated; wherein the configuration operation includes adding an association, deleting an association, and modifying an association; the adding an association is marked as adding an associated verification rule to any request type; the deleting an association is marked as deleting any verification rule of the current association for any request type; the modifying an association is marked as changing the request type currently associated with any verification rule to another request type; Wherein, the adopting the target verification rule to verify the data to be verified in the client includes: Using the first type of verification rule to verify the single database table data or the single file data; Using the second type of verification rules to verify the batch database table data or the batch file data; The adopting of the first type of verification rule to verify the single database table data or the single file data includes: Acquire the single database table data or the single file data from the client; Matching the single database table data or each field in the single file data with the first type of verification rules respectively; The fields in the single database table data that do not conform to the first type of verification rules are regarded as first type abnormal fields, or the fields in the single file data that do not conform to the first type of verification rules are regarded as second type abnormal fields; Wherein, the adopting the second type of verification rule to verify the batch file data includes: Acquiring the batch file data from the client in batches according to preset batches; Matching each field in the batch file data obtained in each batch with the second type of verification rules respectively; The fields in the batch file data obtained in each batch that do not comply with the second type of verification rules are regarded as the third type of abnormal fields; Wherein, the adopting the second type of verification rule to verify the batch database table data includes: Obtaining a structured query statement corresponding to the second type of verification rule from a preset structured query statement; Sending the structured query statement to the client so that the client executes the structured query statement to query and obtain the fields in the batch database table data that do not comply with the second type of verification rules; The fields in the batch database table data sent by the client that do not comply with the second type of verification rules are received as fourth type abnormal fields.
2. The method according to claim 1, characterized in that Determining the request type of the data verification request according to the interface information of the interface to which the data verification request belongs includes: If the interface information of the interface to which the data verification request belongs is a single verification interface, determining that the request type of the data verification request is a single verification request; If the interface information of the interface to which the data verification request belongs is a batch verification interface, it is determined that the request type of the data verification request is a batch verification request.
3. The method according to claim 1, characterized in that The method further comprises: The first type of abnormal field, the second type of abnormal field and the third type of abnormal field are sent to the client, so that the client stores the first type of abnormal field, the second type of abnormal field and the third type of abnormal field.
4. The method according to claim 1, characterized in that: The method further comprises: The first type of abnormal field and the fourth type of abnormal field are stored as abnormal fields in the database table; The second type of abnormal field and the third type of abnormal field are stored as file abnormal fields.
5. The method according to claim 4, characterized in that The method further comprises: Determine a first ratio between the number of abnormal fields in the database table and the total number of fields in the verified database table data; If the first ratio is greater than or equal to a first preset threshold, database table warning information is generated.
6. The method according to claim 4, characterized in that The method further comprises: Determining a second ratio between the number of abnormal fields in the file and the total number of fields in the verified file data; If the second ratio is greater than or equal to a second preset threshold, file warning information is generated.
7. The method according to claim 1, characterized in that The candidate verification rules include at least one of non-empty verification, field length verification, illegal character verification, and date format verification.
8. A data verification device, characterized in that: include: A request type determination module, used to obtain a data verification request from a client, and determine the request type of the data verification request according to the interface information of the interface to which the data verification request belongs; wherein the request type is a single verification request or a batch verification request; A target verification rule determination module, used to determine the target verification rule corresponding to the request type from the candidate verification rules according to the association relationship between the preset verification rule and the request type; wherein the target verification rule is the candidate verification rule corresponding to the request type of the data verification request obtained from the client; the target verification rule corresponding to the single verification request is the first type of verification rule, and the target verification rule corresponding to the batch verification request is the second type of verification rule; A data verification module, used to verify the data to be verified in the client by using the target verification rule, wherein the data to be verified is one of single database table data, batch database table data, single file data and batch file data; An association relationship update module is used to respond to a user's configuration operation on the association relationship between the verification rule and the request type, and update the association relationship between the verification rule and the request type; wherein the configuration operation includes adding an association relationship, deleting an association relationship, and modifying an association relationship; the added association relationship identifier is a verification rule newly associated with any request type; the deleted association relationship identifier is a verification rule of a current association relationship deleted from any request type; the modified association relationship identifier is a request type currently associated with any verification rule modified to another request type; Wherein, the data verification module is specifically used for: Using the first type of verification rule to verify the single database table data or the single file data; Using the second type of verification rules to verify the batch database table data or the batch file data; The adopting of the first type of verification rule to verify the single database table data or the single file data includes: Acquire the single database table data or the single file data from the client; Matching the single database table data or each field in the single file data with the first type of verification rules respectively; The fields in the single database table data that do not conform to the first type of verification rules are regarded as first type abnormal fields, or the fields in the single file data that do not conform to the first type of verification rules are regarded as second type abnormal fields; Wherein, the adopting the second type of verification rule to verify the batch file data includes: Acquiring the batch file data from the client in batches according to preset batches; Matching each field in the batch file data obtained in each batch with the second type of verification rules respectively; The fields in the batch file data obtained in each batch that do not comply with the second type of verification rules are regarded as the third type of abnormal fields; Wherein, the adopting the second type of verification rule to verify the batch database table data includes: Obtaining a structured query statement corresponding to the second type of verification rule from a preset structured query statement; Sending the structured query statement to the client so that the client executes the structured query statement to query and obtain the fields in the batch database table data that do not comply with the second type of verification rules; The fields in the batch database table data sent by the client that do not comply with the second type of verification rules are received as fourth type abnormal fields.
9. An electronic device, characterized in that: The electronic device further comprises: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the data verification method as described in any one of claims 1-7.
10. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the data verification method as described in any one of claims 1 to 7 is implemented.
