A data checking method and device

By receiving and loading data samples and determining the verification method based on feature data, the accuracy problem of data verification in the middleware system is solved, stable data verification without a user interface or storage files is achieved, and multi-dimensional expansion is supported.

CN114327994BActive Publication Date: 2026-04-07AISINO CORPORATION
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-09-29
Publication Date
2026-04-07

AI Technical Summary

Technical Problem

Existing data verification methods rely on interfaces or stored files, which cannot meet the high requirements for data accuracy in interface-less and file-less middleware systems, leading to system instability.

Method used

By receiving business data, determining its type, and loading data samples, determining the verification method based on feature data, and performing data verification based on the verification rules in the data samples, the system supports data preloading and predefinition, enabling sequential or full verification.

Benefits of technology

It achieves accurate data verification without a user interface or storage files, supports horizontal and vertical scaling, and ensures system stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114327994B_ABST
    Figure CN114327994B_ABST
Patent Text Reader

Abstract

The application discloses a data checking method and device. The method comprises the following steps: receiving service data carrying first characteristic data, second characteristic data and to-be-checked data; wherein the to-be-checked data comprises at least one data item; determining the service type of the to-be-checked data according to the first characteristic data, and loading the data specimen corresponding to the to-be-checked data; determining the preset checking mode of the to-be-checked data according to the second characteristic data; and checking the to-be-checked data based on the preset checking mode and the checking rule encapsulated in the data specimen. The method solves the data checking problem under the condition of no storage file and no interface, and has high requirement for data accuracy. Meanwhile, the data checking is easy to expand in different dimensions, such as horizontal, vertical and service category.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of data processing, and in particular to a data verification method and device. BACKGROUND

[0002] Generally, a data verification system relies on interface interaction to input verification-related parameters or rules through interface interaction, or relies on storage files (such as “.ini”, “.xls / xlsx”, databases, etc.) to input verification-related parameters or rules. With the development of technology and the needs of business, software technology has developed from the traditional “C-S, B-S” mode to “cloud-mobile terminal”, and in recent years, “middle platform business / system” has appeared: integrating enterprise data, and based on user needs to create business capabilities of the enterprise. If you want to provide business capability output for users, you need to access enterprise data. Many middle platform systems are “unaware” to users: requiring no interface, no storage file input / output, but silently running on the user's computer.

[0003] For “middle platform systems” or similar systems that are “unaware” to users, there are very high requirements for the stability and fault tolerance of the system. Generally, data errors are one of the common causes of system instability, and in order to ensure system stability, it is required that the input data of a middle platform system with a large daily access volume, such as millions or tens of millions, be 100% correct.

[0004] However, the inventors have found that the data verification method relying on “interface / file” cannot meet the “unaware” middle platform system of the user. SUMMARY

[0005] The embodiments of the present application provide a data verification method and device, which solve the above-mentioned problems existing in the prior art and provide accurate data verification for the “unaware” middle platform system of the user under the restriction conditions of no storage file and no interface.

[0006] In a first aspect, a data verification method is provided, which can include:

[0007] receiving business data, the business data including first feature data, second feature data, and to-be-verified data; wherein the to-be-verified data can include at least one data item;

[0008] determining a business type of the to-be-verified data according to the first feature data, and loading a data specimen corresponding to each data item; the data specimen including a verification rule corresponding to the at least one data item;

[0009] determining a preset verification mode of the to-be-verified data according to the second feature data;

[0010] According to the preset check mode and the check rule encapsulated in the data sample, the to-be-checked data is checked.

[0011] In an optional implementation, before receiving the service data, the method further includes:

[0012] According to the standardized data information of each service, a data sample of the corresponding service is determined.

[0013] According to the standardized data information of each service, a data sample of the corresponding service is determined.

[0014] In an optional implementation, according to the standardized data information of each service, a data sample of the corresponding service is determined, including:

[0015] According to the standardized data information of each service, a data structure of the corresponding service and at least one data item information corresponding to the data structure are determined; the data structure includes general attributes of data items and check rules; the number of categories of the general attributes is determined according to preset change requirements.

[0016] For each service, if the at least one data item information corresponding to the data structure is not data predefined, then according to the data structure of the service, each data item information is data predefined to obtain a data sample corresponding to the at least one data item information in the service.

[0017] If there are some data item information that has been data predefined and some data item information that has not been data predefined in the at least one data item information corresponding to the data structure, then according to the data structure of the service, the data item information that has not been data predefined is data predefined to obtain a data sample corresponding to the data item information that has not been data predefined in the service.

[0018] In an optional implementation, according to the preset check mode and the check rule encapsulated in the data sample, the to-be-checked data is checked, including:

[0019] According to the data item identifier of each data item in the data sample, a check rule of each data item in the to-be-checked data is determined.

[0020] According to the check mode and the check rule of each data item, a corresponding data item in the to-be-checked data is checked.

[0021] In an optional implementation, the check mode includes sequential check and full check of each data item.

[0022] According to the check mode and the check rule of each data item, the corresponding data item in the data to be checked is checked, including:

[0023] If the preset check mode is sequential check, each data item is sequentially checked according to the check rule of each data item; and when the target data item fails to pass the check, the check of the un-checked data item is terminated, and the check result is displayed.

[0024] If the preset check mode is full check, each data item is checked according to the check rule of each data item; and after the check of each data item is completed, the check result is displayed.

[0025] The target data item is any data item in the data to be checked.

[0026] In an optional implementation, the check rule includes a data item general attribute check rule, and at least one of a data item description check rule and a data item association check rule.

[0027] In an optional implementation, if the business data is invoice business data, the data item general attribute check rule includes, but is not limited to, a data type check rule, a data maximum length check rule, and whether the data item must have a value; the data item description check rule includes, but is not limited to, a tax number rule check rule, a time and date format check rule, an alphanumeric check rule, a number range check rule, a tax payment period check rule, a decimal digit check rule, and a tax rate range check rule; and the association check rule includes, but is not limited to, a date mark and date format identification rule, a commodity tax classification code association check rule, a preferential policy association check rule, and an invoice query mode association check rule.

[0028] In a second aspect, a data check device is provided, which can include a receiving unit, a determining unit, a loading unit, and a checking unit.

[0029] The receiving unit is configured to receive business data, the business data including first feature data, second feature data, and data to be checked; wherein the data to be checked can include at least one data item.

[0030] The determining unit is configured to determine a business type of the data to be checked according to the first feature data.

[0031] The loading unit is configured to load a data specimen corresponding to each data item.

[0032] The determining unit is further configured to determine a preset check mode of the data to be checked according to the second feature data; and the data specimen includes a check rule corresponding to the at least one data item.

[0033] The checking unit is configured to check the to-be-checked data based on the preset checking mode and the checking rule encapsulated in the data specimen.

[0034] In an optional implementation, the apparatus further includes a preloading unit;

[0035] The determining unit is further configured to determine the data specimen of each service according to the formulated data standardization information of each service.

[0036] The preloading unit is configured to pre-load data of the data specimen of each service by using a preset preloading mode.

[0037] In an optional implementation, the apparatus further includes a predefining unit;

[0038] The determining unit is specifically configured to determine the data structure of each service and at least one data item information corresponding to the data structure according to the formulated data standardization information of each service; the data structure includes general attributes of data items and a checking rule; and the number of categories of the general attributes is determined according to a preset change requirement.

[0039] The predefining unit is configured to, for each service, if the at least one data item information corresponding to the data structure of the service has not been pre-defined, pre-define data of each data item information according to the data structure of the service, to obtain a data specimen corresponding to the at least one data item information in the service.

[0040] If there are some data item information that has been pre-defined and some data item information that has not been pre-defined in the at least one data item information corresponding to the data structure, the predefining unit is configured to pre-define data of the data item information that has not been pre-defined according to the data structure of the service, to obtain a data specimen corresponding to the data item information that has not been pre-defined in the service.

[0041] In an optional implementation, the determining unit is further configured to determine the checking rule of each data item in the to-be-checked data according to a data item identifier of each data item in the data specimen.

[0042] The checking unit is specifically configured to check the corresponding data item in the to-be-checked data based on the checking mode and the checking rule of each data item.

[0043] In an optional implementation, the checking mode includes sequential checking and full checking of each data item.

[0044] The check unit is further configured to, if the preset check mode is sequential check, sequentially check each data item according to the check rule of each data item; and if the target data item fails to pass the check, terminate the check of the unchecked data item and display the check result.

[0045] If the preset check mode is full check, check each data item according to the check rule of each data item; and after the check of each data item is completed, display the check result.

[0046] The target data item is any data item in the data to be checked.

[0047] In an optional implementation, the check rule includes a data item general attribute check rule, and at least one of a data item description check rule and a data item association check rule.

[0048] In an optional implementation, if the business data is invoice business data, the data item general attribute check rule includes, but is not limited to, a data type check rule, a data maximum length check rule and whether the data item must have a value; the data item description check rule includes, but is not limited to, a tax number rule check rule, a time and date format check rule, an alphanumeric check rule, a number range check rule, a tax payment period check rule, a decimal place check rule and a tax rate range check rule; and the association check rule includes, but is not limited to, a date mark and date format identification rule, a commodity tax classification code association check rule, a preferential policy association check rule and an invoice query mode association check rule.

[0049] In a third aspect, an electronic device is provided, which includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete communication with each other through the communication bus.

[0050] The memory is configured to store a computer program.

[0051] The processor is configured to execute the program stored on the memory to implement the method steps of any one of the first aspect.

[0052] In a fourth aspect, a computer readable storage medium is provided, which stores a computer program, and the computer program is executed by a processor to implement the method steps of any one of the first aspect.

[0053] The data verification method provided in this invention, after receiving business data including first feature data, second feature data, and data to be verified, determines the business type of the data to be verified based on the first feature data and loads a data sample corresponding to each data item; determines a preset verification method for the data to be verified based on the second feature data; and verifies the data to be verified based on the preset verification method and the verification rules encapsulated in the data sample. This method solves the data verification problem that has high requirements for data accuracy under conditions such as no storage files or no interface. It also enables easy expansion of data verification in different dimensions such as horizontal, vertical, and business categories. Attached Figure Description

[0054] Figure 1 This is a schematic diagram of the structure of a data verification system provided in an embodiment of the present invention;

[0055] Figure 2 A flowchart illustrating a data verification method provided in an embodiment of the present invention;

[0056] Figure 3 This is a schematic diagram of the structure of a data verification device provided in an embodiment of the present invention;

[0057] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0058] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0059] The term "data middle platform" refers to a public service platform. In this application, the data middle platform refers to data that has been processed and packaged into a public data product or service. The core concept of the data middle platform is "data is derived from business and used for business."

[0060] The data verification method provided in this application is applied to the data verification system in the data platform.

[0061] like Figure 1 As shown, the data verification system includes a data layer, a rule layer, and a verification layer.

[0062] The data layer is used to define different data structures and predefined data based on the standardized format information of different data items, and to preload data to obtain a complete set of data samples and data samples from different business operations.

[0063] The rule layer is configured to encapsulate a check rule for the data item according to a formulated data standard and a standardized format of different data items, which can include at least one of a data item general attribute check rule, a data item description check rule and a data item association check rule.

[0064] The check layer is configured to receive the service data, which can include the first feature data, the second feature data and the data to be checked. The data to be checked can be a single data item or a batch data composed of multiple data items.

[0065] The service type of the data to be checked is determined according to the first feature data, and a data specimen corresponding to the service type is loaded. The preset check mode of the data to be checked is determined according to the second feature data. The data to be checked is checked based on the preset check mode and the check rule encapsulated in the data specimen, and the check result and the service data are output.

[0066] It should be noted that before checking the data to be checked, the first feature data and the second feature data in the service data need to be checked. If the service data does not include the first feature data and the second feature data, the check result of check failure is directly output, that is, the data to be checked does not need to be checked.

[0067] The preferred embodiments of the present application are described below in conjunction with the accompanying drawings of the specification. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present application, and are not used to limit the present application, and the embodiments in the present application and the features in the embodiments can be combined with each other without conflict.

[0068] Figure 2 A flowchart of a data check method provided by an embodiment of the present application is shown in FIG. 1. As shown in FIG. 1, the method can include the following steps. Figure 2

[0069] Step 210, receiving service data.

[0070] The service data includes the first feature data, the second feature data and the data to be checked. The data to be checked is a data message, which includes at least one data item (or field).

[0071] The first feature data is used to distinguish different service types, and the second feature data is used to distinguish different check modes. The check mode can include sequential check and full check of each data item in the data to be checked.

[0072] Since the data message input into the data check system can include at least one data item, each data item exists in the form of a key-value pair, therefore, before performing the step, the data check system can formulate data standardization information for the data message of different services, which includes the standardized format of the data item and the data item information.​

[0073] Based on the standardized data information for each business, the corresponding data specimens are determined; the data specimens are the standard data used to verify the data to be verified; the union of the data specimen sets of each business is called the complete data specimen set; and a preset preloading method is used to preload the data specimens of each business.

[0074] In the specific implementation method, the standardized data information for each business is shown in Table 1.

[0075] Table 1

[0076]

[0077] The standardized format for data items in Table 1 may include:

[0078] Data item: refers to the name of the "key" in the "key-value pair" of the input message.

[0079] Data item name: A description of the data item, not used for validation, but for system output prompts.

[0080] Attribute 1, Attribute 2... Attribute N: General attributes of data items, which are also the requirements that data items should meet; general attributes include, but are not limited to: data type (string, integer, floating point, boolean, date and time format, etc.), maximum data length, whether the field must have a value, etc.

[0081] Field description: The special conditions that a data item needs to meet.

[0082] Association description: The association conditions that must be met between data items.

[0083] The number of categories of the above-mentioned general attributes can be increased or decreased according to preset change requirements, that is, the general attributes of horizontal data items in the standardized format are extensible.

[0084] Furthermore, based on the standardized format and information of the data items in Table 1, the data structure for the corresponding business and the corresponding data item information can be determined, i.e., information is populated into Table 1, as shown in Table 2. The data structure corresponds to the header (first row) in Table 1, and the data item information is the information used to populate Table 1.

[0085] Suppose an invoice transaction contains data items such as "extension number, invoice date, date stamp, code, ... tax number". Each data item has its own attributes. Extract the common data attributes as general attributes, such as: (data item) type, length (limitation), ... whether it is required. The special requirements of a single data item are called "field description", and the association requirements between fields are called "association description".

[0086] Table 2

[0087]

[0088]

[0089] It should be noted that different business data will have different defined data structures if the data standardization information is different. The data structure can include the general attributes of data items, as well as the validation rules of data items encapsulated by the rule layer of the data validation system.

[0090] The validation rules may include at least one of the following: general attribute validation rules for data items, data item description validation rules, and data item association validation rules.

[0091] Among them, the general attribute validation rules of data items are encapsulated for general attributes. That is, the general attribute validation rules of data items are used to verify whether the data items have the corresponding general attributes or whether the general attributes are correct.

[0092] If the business data is invoice business data, the general attribute validation rules for data items include, but are not limited to: data type (including string, integer, floating-point, boolean, date and time format, etc.) validation rules, maximum data length validation rules, and whether data items must have values, etc.

[0093] The field description encapsulates the data item description validation rules, which are used to validate the special instructions of the data item, namely the content in the "field description".

[0094] If the business data is invoice business data, the data item description verification includes, but is not limited to: tax number rule verification, time and date format verification, alphanumeric verification, number range verification, enumeration value verification, node verification, decimal place verification, tax rate range verification, etc.

[0095] The association description encapsulates the data item association verification rules, which are used to verify the association relationship between data items.

[0096] If the business data is invoice business data, the data item association verification includes, but is not limited to: date flag and date format recognition rules, node association field mandatory field verification rules, "whether it is a Sino-foreign cooperative oil and gas field flag, tax rate, tax-inclusive price flag" association verification, commodity tax classification code association verification, preferential policy association verification, invoice query method association verification, etc.

[0097] Furthermore, taking the standardized data information of the target business as an example, based on this standardized data information, the data structure of the business and at least one data item information corresponding to the corresponding data structure can be determined. The determined at least one data item information may include: all data item information that has not been predefined, or all data item information that has been predefined, or a combination of some data item information that has not been predefined and some data item information that has been predefined.

[0098] If at least one data item information corresponding to the data structure has been predefined, then the data sample corresponding to at least one data item information is directly obtained, that is, the data predefinition process is not performed.

[0099] If at least one data item information corresponding to the data structure has not been predefined, then according to the business data structure, the at least one data item information is predefined to obtain the data sample corresponding to the at least one data item information.

[0100] If at least one data item in the data structure contains some predefined data items and some undefined data items, then according to the business data structure, the undefined data items are predefined to obtain the data sample corresponding to the undefined data items.

[0101] Among them, after a data item in the data standardization information of the target business is predefined and preloaded, a data sample corresponding to the business type of the target business can be obtained. This data sample can be used to verify a data field in the data to be verified for the corresponding business.

[0102] Based on the defined data structure, macro definitions can be used to predefine the information of each data item, or other data predefining methods can be used, such as constants, global variables, or more complex custom methods, to predefine the information of each data item. This embodiment of the invention does not limit the specific methods used. The data items are initialized based on the data item information of each data item in the data standardization information, that is, the content of the row corresponding to the data item.

[0103] Understandably, if different business data have the same data items and the data standardization information of these data items is the same, then there is no need to predefine the same data items multiple times; they only need to be defined once for use by different businesses.

[0104] A pre-loading method, such as a container (vector), is used to preload data samples from each business within the data sample set. Other data preloading methods, such as sets or maps, can also be used; this embodiment of the invention is not limited to any particular method. Data preloading does not consume memory resources. Memory resources are only actually loaded when business data is input. For different businesses, the loaded data can be understood as the data sample corresponding to the business data.

[0105] Referring to Table 1, the above-mentioned method of predefining and preloading each data item allows the embodiments of the present invention to be extended vertically.

[0106] It is evident that standardized data information can simplify complex business data in two dimensions, without losing information and ensuring that data verification is systematic and traceable. For each standardized data format, a corresponding data structure is defined, ensuring horizontal scalability: the data structure can change as data attributes change.

[0107] Step 220: Determine the business type of the data to be verified based on the first feature data, load the data sample corresponding to each data item, and determine the preset verification method of the data to be verified based on the second feature data.

[0108] The verification layer of the data verification system loads the data sample corresponding to the business type of the data to be verified based on the first feature data, and determines the preset verification method of the data to be verified based on the second feature data.

[0109] Step 230: Verify the data to be verified based on the preset verification method and the verification rules encapsulated in the data sample.

[0110] The verification layer of the data verification system can determine the verification rules for each data item in the data to be verified based on the data item identifier of each data item in the data sample.

[0111] Based on the verification method and the verification rules for each data item, the corresponding data items in the data to be verified are verified.

[0112] If the preset verification method is sequential verification, then each data item is verified sequentially according to the verification rules for each data item; and when the target data item fails verification, the verification of the unverified data items is terminated and the verification result is displayed; wherein, the target data item is any data item in the data to be verified.

[0113] For example, the return result format of sequential verification can be represented as:

[0114] {"code":"0000","msg":"Success"}

[0115] {"code":"XXXX","msg":"Data validation failed:XXXXXX"}.

[0116] If the preset verification method is full verification, then each data item will be verified according to the verification rules for each data item; and the verification results will be displayed after each data item has been verified.

[0117] For example, the return result format of a full validation can be represented as:

[0118] {"code":"0000","msg":"Success"}

[0119] {"code":"XXXX",

[0120] "msg": "Data validation failed"

[0121] “err”: [

[0123] {

[0124] “Nm”: “0”

[0125] "Data Item 1": "Verification Failure Message XXX"

[0126] ...

[0127] "Data Item N": "Validation Failure Message XXX"

[0128] },

[0129] {

[0130] “Nm”: “1”

[0131] "Data Item 1": "Verification Failure Message XXX"

[0132] ...

[0133] "Data Item N": "Validation Failure Message XXX"

[0134] },

[0135] ... ]

[0137] }

[0138] The data verification method provided in this invention, after receiving business data including first feature data, second feature data, and data to be verified, determines the business type of the data to be verified based on the first feature data and loads a data sample corresponding to each data item; determines a preset verification method for the data to be verified based on the second feature data; and verifies the data to be verified based on the preset verification method and the verification rules encapsulated in the data sample. This method solves the data verification problem that has high requirements for data accuracy under conditions such as no storage files or no interface. It also enables easy expansion of data verification in different dimensions such as horizontal, vertical, and business categories.

[0139] Corresponding to the above method, embodiments of the present invention also provide a data verification device, such as... Figure 3 As shown, the data verification device includes: a receiving unit 310, a determining unit 320, a loading unit 330, and a verification unit 340;

[0140] The receiving unit 310 is used to receive service data, which includes first feature data, second feature data, and data to be verified; wherein, the data to be verified may include at least one data item.

[0141] The determining unit 320 is used to determine the service type of the data to be verified based on the first feature data;

[0142] Loading unit 330 is used to load the data sample corresponding to each data item;

[0143] The determining unit 320 is further configured to determine a preset verification method for the data to be verified based on the second feature data; the data sample includes verification rules corresponding to the at least one data item;

[0144] The verification unit 340 is used to verify the data to be verified based on the preset verification method and the verification rules encapsulated in the data sample.

[0145] In an alternative implementation, the apparatus further includes a preloading unit 350;

[0146] The determination unit 320 is also used to determine the data specimens of the corresponding business based on the established data standardization information of each business.

[0147] The preloading unit 350 is used to preload the data samples of each service using a preset preloading method.

[0148] In an alternative implementation, the device further includes a predefined unit 360;

[0149] The determining unit 320 is specifically used to determine the data structure of the corresponding business and at least one data item information corresponding to the corresponding data structure based on the established data standardization information for each business; the data structure includes the general attributes and verification rules of the data items; the number of categories of the general attributes is determined according to the preset change requirements;

[0150] The predefined unit 360 is used to predefine the data of each data item information according to the data structure of the service if at least one data item information corresponding to the data structure has not been predefined for each service, so as to obtain the data sample corresponding to the at least one data item information in the service.

[0151] If at least one data item in the data structure contains some predefined data items and some undefined data items, then according to the data structure of the business, the undefined data items are predefined to obtain the data sample corresponding to the undefined data items in the business.

[0152] In an optional implementation, the determining unit 320 is further configured to determine the verification rule for each data item in the data to be verified based on the data item identifier of each data item in the data sample;

[0153] The verification unit 340 is specifically used to verify the corresponding data item in the data to be verified based on the verification method and the verification rules for each data item.

[0154] In one optional implementation, the verification method includes sequential verification and full verification of each data item;

[0155] The verification unit 340 is also specifically used to verify each data item sequentially according to the verification rules of each data item if the preset verification method is sequential verification; and to terminate the verification of unverified data items and display the verification result when the target data item fails verification.

[0156] If the preset verification method is full verification, then each data item is verified according to the verification rules for each data item; and after each data item has been verified, the verification result is displayed.

[0157] The target data item is any one of the data items in the data to be verified.

[0158] In one optional implementation, the validation rules include at least one of the following: general attribute validation rules for data items, data item description validation rules, and data item association validation rules.

[0159] In one optional implementation, if the business data is invoice business data, the general attribute validation rules for the data items include, but are not limited to, data type validation rules, maximum data length validation rules, and whether the data item must have a value; the data item description validation rules include, but are not limited to, tax number rule validation rules, date and time format validation rules, alphanumeric validation rules, number range validation rules, tax period validation rules, decimal place validation rules, and tax rate range validation rules; the association validation rules include, but are not limited to, date flag and date format recognition rules, commodity tax classification code association validation rules, preferential policy association validation rules, and invoice query method association validation rules.

[0160] The functions of each functional unit of the data verification device provided in the above embodiments of the present invention can be implemented through the above method steps. Therefore, the specific working process and beneficial effects of each unit in the data verification device provided in the embodiments of the present invention will not be repeated here.

[0161] This invention also provides an electronic device, such as... Figure 4 As shown, it includes a processor 410, a communication interface 420, a memory 430, and a communication bus 440, wherein the processor 410, the communication interface 420, and the memory 430 communicate with each other through the communication bus 440.

[0162] Memory 430 is used to store computer programs;

[0163] When the processor 410 executes the program stored in the memory 430, it performs the following steps:

[0164] Receive service data, the service data including first feature data, second feature data, and data to be verified; wherein, the data to be verified may include at least one data item;

[0165] The service type of the data to be verified is determined based on the first feature data, and a data sample corresponding to each data item is loaded; the data sample includes the verification rules corresponding to at least one data item.

[0166] Based on the second feature data, a preset verification method for the data to be verified is determined;

[0167] The data to be verified is verified based on the preset verification method and the verification rules encapsulated in the data sample.

[0168] In an alternative implementation, before receiving business data, the method further includes:

[0169] Based on the standardized data information for each business, determine the data samples for the corresponding business;

[0170] A preset preloading method is used to preload data samples in the data samples of each service.

[0171] In one optional implementation, based on the established data standardization information for each business, data samples for the corresponding business are determined, including:

[0172] Based on the standardized data information for each business, determine the data structure for the corresponding business and at least one data item information corresponding to the data structure; the data structure includes the general attributes and validation rules of the data items; the number of categories of the general attributes is determined according to the preset change requirements;

[0173] For each business, if at least one data item information corresponding to the data structure has not been predefined, then according to the data structure of the business, each data item information is predefined to obtain a data sample corresponding to the at least one data item information in the business.

[0174] If at least one data item in the data structure contains some predefined data items and some undefined data items, then according to the data structure of the business, the undefined data items are predefined to obtain the data sample corresponding to the undefined data items in the business.

[0175] In one optional implementation, the data to be verified is verified based on the preset verification method and the verification rules encapsulated in the data sample, including:

[0176] Based on the data item identifier of each data item in the data sample, determine the verification rules for each data item in the data to be verified;

[0177] Based on the verification method and the verification rules for each data item, the corresponding data items in the data to be verified are verified.

[0178] In one optional implementation, the verification method includes sequential verification and full verification of each data item;

[0179] Based on the verification method and the verification rules for each data item, the corresponding data items in the data to be verified are verified, including:

[0180] If the preset verification method is sequential verification, then each data item is verified sequentially according to the verification rules of each data item; and when the target data item fails verification, the verification of the unverified data items is terminated and the verification result is displayed.

[0181] If the preset verification method is full verification, then each data item is verified according to the verification rules for each data item; and after each data item has been verified, the verification result is displayed.

[0182] The target data item is any one of the data items in the data to be verified.

[0183] In one optional implementation, the validation rules include at least one of the following: general attribute validation rules for data items, data item description validation rules, and data item association validation rules.

[0184] In one optional implementation, if the business data is invoice business data, the general attribute validation rules for the data items include, but are not limited to, data type validation rules, maximum data length validation rules, and whether the data item must have a value; the data item description validation rules include, but are not limited to, tax number rule validation rules, date and time format validation rules, alphanumeric validation rules, number range validation rules, tax period validation rules, decimal place validation rules, and tax rate range validation rules; the association validation rules include, but are not limited to, date flag and date format recognition rules, commodity tax classification code association validation rules, preferential policy association validation rules, and invoice query method association validation rules.

[0185] The communication bus mentioned above can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not mean that there is only one bus or one type of bus.

[0186] The communication interface is used for communication between the aforementioned electronic devices and other devices.

[0187] The memory may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.

[0188] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0189] The implementation methods and beneficial effects of the various components of the electronic device in the above embodiments for solving the problem can be found in [reference needed]. Figure 2 The steps in the illustrated embodiments are used to implement the electronic device. Therefore, the specific working process and beneficial effects of the electronic device provided by the embodiments of the present invention will not be repeated here.

[0190] In another embodiment of the present invention, a computer-readable storage medium is also provided, which stores instructions that, when executed on a computer, cause the computer to perform any of the data verification methods described in the above embodiments.

[0191] In another embodiment of the present invention, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to execute any of the data verification methods described in the above embodiments.

[0192] Those skilled in the art will understand that the embodiments in this application can be provided as methods, systems, or computer program products. Therefore, the embodiments in this application can take the form of entirely hardware embodiments, entirely software embodiments, or embodiments combining software and hardware aspects. Furthermore, the embodiments in this application can take the form of computer program products implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0193] This application describes embodiments of methods, apparatus (systems), and computer program products according to embodiments of this application with reference to flowchart illustrations and / or block diagrams. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can 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, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0194] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0195] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0196] Although preferred embodiments have been described in this application, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments of this application.

[0197] Obviously, those skilled in the art can make various modifications and variations to the embodiments of this application without departing from the spirit and scope of the embodiments of this application. Therefore, if these modifications and variations to the embodiments of this application fall within the scope of the claims in this application and their equivalents, then this application also intends to include these modifications and variations.

Claims

1. A data verification method, characterized in that, The method includes: Receive service data, the service data including first feature data, second feature data, and data to be verified; wherein, the data to be verified includes at least one data item; The service type of the data to be verified is determined based on the first feature data, and a data sample corresponding to the service type of the data to be verified is loaded; the data sample corresponding to the service type includes the verification rules for at least one data item in the data to be verified of the service type. Based on the second feature data, a preset verification method for the data to be verified is determined; The data to be verified is verified based on the preset verification method and the verification rules encapsulated in the data sample. Before receiving business data, the method further includes: Based on the standardized data information for each business, determine the data samples for the corresponding business; A preset preloading method is used to preload data samples of each service. Based on the established data standardization information for each business, determine the corresponding data samples for that business, including: Based on the standardized data information for each business, determine the data structure for the corresponding business and at least one data item information corresponding to the data structure; the data structure includes the general attributes and validation rules of the data items; the number of categories of the general attributes is determined according to the preset change requirements; For each business, if at least one data item information corresponding to the data structure has not been predefined, then according to the data structure of the business, each data item information is predefined to obtain a data sample corresponding to the at least one data item information in the business. If at least one data item in the data structure contains some predefined data items and some undefined data items, then according to the data structure of the business, the undefined data items are predefined to obtain the data sample corresponding to the undefined data items in the business.

2. The method as described in claim 1, characterized in that, Based on the preset verification method and the verification rules encapsulated in the data sample, the data to be verified is verified, including: Based on the data item identifier of each data item in the data sample, determine the verification rules for each data item in the data to be verified; Based on the verification method and the verification rules for each data item, the corresponding data items in the data to be verified are verified.

3. The method as described in claim 2, characterized in that, The verification method includes sequential verification and full verification of each data item; Based on the verification method and the verification rules for each data item, the corresponding data items in the data to be verified are verified, including: If the preset verification method is sequential verification, then each data item is verified sequentially according to the verification rules of each data item; and when the target data item fails verification, the verification of the unverified data items is terminated and the verification result is displayed. If the preset verification method is full verification, then each data item is verified according to the verification rules for each data item; and after each data item has been verified, the verification result is displayed. The target data item is any one of the data items in the data to be verified.

4. The method as described in claim 3, characterized in that, The verification rules include at least one of the following: general attribute verification rules for data items, data item description verification rules, and data item association verification rules.

5. The method as described in claim 4, characterized in that, If the business data is invoice business data, then the general attribute verification rules for the data items include at least one of the following: data type verification rules, maximum data length verification rules, and whether the data item must have a value; the data item description verification rules include at least one of the following: tax number rule verification rules, date and time format verification rules, alphanumeric verification rules, number range verification rules, tax period verification rules, decimal place verification rules, and tax rate range verification rules; the association verification rules include at least one of the following: date flag and date format recognition rules, commodity tax classification code association verification rules, preferential policy association verification rules, and invoice query method association verification rules.

6. A data verification device, characterized in that, The device includes: a receiving unit, a determining unit, a loading unit, and a verification unit; The receiving unit is used to receive service data, which includes first feature data, second feature data, and data to be verified; wherein the data to be verified includes at least one data item. The determining unit is used to determine the service type of the data to be verified based on the first feature data. The loading unit is used to load a data sample corresponding to the service type of the data to be verified; the data sample corresponding to the service type includes the verification rules for at least one data item in the data to be verified of the service type. The determining unit is further configured to determine a preset verification method for the data to be verified based on the second feature data; The verification unit is used to verify the data to be verified based on the preset verification method and the verification rules encapsulated in the data sample. The device also includes a preloading unit; The determining unit is further configured to determine the data sample of the corresponding business based on the established data standardization information for each business. The preloading unit is used to preload the data samples of each service using a preset preloading method; The device also includes predefined units; The determining unit is specifically used to determine the data structure of the corresponding business and at least one data item information corresponding to the corresponding data structure based on the established data standardization information for each business; the data structure includes the general attributes and verification rules of the data items; the number of categories of the general attributes is determined according to preset change requirements; The predefined unit is used to predefine the data of each data item for each service if at least one data item information corresponding to the data structure has not been predefined, in order to obtain a data sample corresponding to the at least one data item information in the service. If at least one data item in the data structure contains some predefined data items and some undefined data items, then according to the data structure of the business, the undefined data items are predefined to obtain the data sample corresponding to the undefined data items in the business.

7. An electronic device, characterized in that, The electronic device includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, when executing a program stored in memory, implements the steps of the method according to any one of claims 1-5.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the method described in any one of claims 1-5.

Citation Information

Patent Citations

  • Service verification method and device and computer readable storage medium

    CN109614262A

  • Data processing method and device, storage medium and electronic equipment

    CN111127178A