CN111339137A - Data verification method and device - Google Patents

Data verification method and device Download PDF

Info

Publication number
CN111339137A
CN111339137A CN202010102555.2A CN202010102555A CN111339137A CN 111339137 A CN111339137 A CN 111339137A CN 202010102555 A CN202010102555 A CN 202010102555A CN 111339137 A CN111339137 A CN 111339137A
Authority
CN
China
Prior art keywords
parameter
data
transmitted
verification rule
annotation
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010102555.2A
Other languages
Chinese (zh)
Inventor
徐婷
周正
王平
段光磊
王杨
张大虎
柯登科
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing QIYI Century Science and Technology Co Ltd
Original Assignee
Beijing QIYI Century Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing QIYI Century Science and Technology Co Ltd filed Critical Beijing QIYI Century Science and Technology Co Ltd
Priority to CN202010102555.2A priority Critical patent/CN111339137A/en
Publication of CN111339137A publication Critical patent/CN111339137A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24564Applying rules; Deductive queries
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2457Query processing with adaptation to user needs

Abstract

A data verification method and device, the method includes: acquiring data to be transmitted; judging whether the data to be transmitted conforms to a parameter verification rule in an annotation parameter array, wherein the parameter verification rule comprises a corresponding relation between a parameter type and a parameter definition domain, and the parameter verification rule is used for judging whether the data to be transmitted belongs to the parameter definition domain corresponding to the parameter type of the data to be transmitted; if the data to be transmitted conform to the parameter verification rule in the annotation parameter array, transmitting the data to be transmitted into a processing system; and if the data to be transmitted does not conform to the parameter verification rule in the annotation parameter array, not transmitting the data to be transmitted into a processing system. According to the method provided by the embodiment of the application, the transmitted data is verified by establishing the parameter verification rule, if the parameters of the transmitted data are changed, only the corresponding parameters in the parameter verification rule need to be changed, and the data verification efficiency is improved.

Description

Data verification method and device
Technical Field
The present application relates to the field of data verification, and in particular, to a data verification method and apparatus.
Background
With the advent of the big data era, data processing is increasing day by day, and it is very important to ensure the correctness of data, and a general system can perform corresponding data processing after receiving data, but the premise is to ensure the correctness of data transmitted into the system, currently, the transmitted data is verified manually, and under the condition of large amount of transmitted data, the time and the energy of technical personnel are greatly consumed.
Disclosure of Invention
In order to solve the above technical problem or at least partially solve the above technical problem, the present application provides a method.
In a first aspect, the present application provides a data verification method, including:
acquiring data to be transmitted;
judging whether the data to be transmitted conforms to a parameter verification rule in an annotation parameter array, wherein the parameter verification rule comprises a corresponding relation between a parameter type and a parameter definition domain, and the parameter verification rule is used for judging whether the data to be transmitted belongs to the parameter definition domain corresponding to the parameter type of the data to be transmitted;
if the data to be transmitted conform to the parameter verification rule in the annotation parameter array, transmitting the data to be transmitted into a processing system;
and if the data to be transmitted does not conform to the parameter verification rule in the annotation parameter array, not transmitting the data to be transmitted into a processing system.
Optionally, before the obtaining of the data to be transmitted, the method further includes:
determining a candidate annotation parameter array, wherein the candidate annotation parameter array comprises candidate parameter verification rules;
judging whether the sample data accords with the candidate parameter check rule;
if the sample data accords with the candidate parameter verification rule, judging that the candidate parameter verification rule is a parameter verification rule to be used, wherein the parameter verification rule to be used forms an annotation parameter array;
if the sample data does not accord with the candidate parameter verification rule, judging that the candidate parameter verification rule is an unavailable parameter verification rule.
Optionally, the determining whether the data to be transmitted conforms to the parameter verification rule in the annotation parameter array includes:
determining the target parameter type of the data to be transmitted;
determining a target parameter definition domain corresponding to the target parameter type according to the corresponding relation between the parameter type and the parameter definition domain;
judging whether the data to be transmitted belongs to the target parameter definition domain;
if the data to be transmitted belongs to the target parameter definition domain, judging that the data to be transmitted conforms to a parameter verification rule in the annotation parameter array;
and if the data to be transmitted does not belong to the target parameter definition domain, judging that the data to be transmitted does not conform to the parameter verification rule in the annotation parameter array.
Optionally, the determining whether the data to be transmitted belongs to the target parameter definition domain includes:
and under the condition that the data to be transmitted is a numerical value, judging whether the data to be transmitted belongs to the target parameter definition domain through a regular expression, wherein the target parameter definition domain is a threshold range.
Optionally, the determining whether the data to be transmitted belongs to the target parameter definition domain includes:
and under the condition that the data to be transmitted is the data name, judging whether the data to be transmitted belongs to the target parameter definition domain or not through non-null check.
Optionally, the acquiring data to be transmitted includes:
and acquiring the data to be transmitted by a reflection method.
In a second aspect, the present application provides a data verification apparatus, comprising:
the acquisition module is used for acquiring data to be transmitted;
the first judgment module is used for judging whether the data to be transmitted conforms to a parameter verification rule in an annotation parameter array, wherein the parameter verification rule comprises a corresponding relation between a parameter type and a parameter definition domain, and the parameter verification rule is used for judging whether the data to be transmitted belongs to the parameter definition domain corresponding to the parameter type of the data to be transmitted;
the first processing module is used for transmitting the data to be transmitted into a processing system if the data to be transmitted conforms to the parameter verification rule in the annotation parameter array;
and the second processing module is used for not transmitting the data to be transmitted into the processing system if the data to be transmitted does not conform to the parameter verification rule in the annotation parameter array.
Optionally, the apparatus further comprises:
the determining module is used for determining a candidate annotation parameter array, wherein the candidate annotation parameter array comprises candidate parameter checking rules;
the second judgment module is used for judging whether the sample data accords with the candidate parameter verification rule;
the first judging module is used for judging that the candidate parameter check rule is a parameter check rule to be used if the sample data accords with the candidate parameter check rule, and the parameter check rule to be used forms the annotation parameter array;
and the second judging module is used for judging that the candidate parameter verification rule is an unavailable parameter verification rule if the sample data does not accord with the candidate parameter verification rule.
Optionally, the determining module includes:
the first determining unit is used for determining the target parameter type of the data to be transmitted;
a second determining unit, configured to determine, according to a correspondence between the parameter type and the parameter definition domain, a target parameter definition domain corresponding to the target parameter type;
the judging unit is used for judging whether the data to be transmitted belongs to the target parameter definition domain;
the first judging unit is used for judging that the data to be transmitted conform to a parameter verification rule in the annotation parameter array if the data to be transmitted belongs to the target parameter definition domain;
and the second judging unit is used for judging that the data to be transmitted does not conform to the parameter verification rule in the annotation parameter array if the data to be transmitted does not belong to the target parameter definition domain.
Optionally, the obtaining module includes:
and the acquisition unit is used for acquiring the data to be transmitted by a reflection method.
Compared with the prior art, the technical scheme provided by the embodiment of the application has the following advantages:
the method provided by the embodiment of the application provides a data verification method, the transmitted data is verified by establishing a parameter verification rule, if the parameter of the transmitted data is changed, only the corresponding parameter in the parameter verification rule needs to be changed, and the transmitted data is automatically verified by the data verification method, so that the data verification efficiency is improved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention.
Fig. 1 is a schematic diagram of a data verification method according to an embodiment of the present application;
fig. 2 is a schematic diagram illustrating a method for determining a parameter verification rule according to an embodiment of the present disclosure;
fig. 3 is a schematic flow chart of a data verification method according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of a data verification apparatus according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application.
Fig. 1 is a data verification method provided in an embodiment of the present application, where the method is used in a server, and is used to verify data to be transmitted and transmit the data that passes the verification to a processing system.
A data verification method provided in an embodiment of the present application will be described in detail below with reference to specific embodiments, as shown in fig. 1, the specific steps are as follows:
step 101: and acquiring data to be transmitted.
In the embodiment of the application, before the data to be transmitted is transmitted into the processing system, the server needs to check the data to be transmitted, and then the server needs to acquire the data to be transmitted. Specifically, the server obtains data to be transmitted by a reflection method. For example, the data to be transmitted is personnel information, including: xiaoming, Heilongjiang, 20.
Step 102: and judging whether the data to be transmitted conforms to the parameter checking rule in the annotation parameter array.
The parameter verification rule comprises a corresponding relation between a parameter type and a parameter definition domain, and the parameter verification rule is used for judging whether the data to be transmitted belongs to the parameter definition domain corresponding to the parameter type of the data to be transmitted.
In the embodiment of the application, the annotation parameter array comprises a parameter verification rule, the parameter verification rule comprises a corresponding relation between a parameter type and a parameter definition domain, the annotation parameter array is well defined by technicians when writing codes, the server receives the corresponding relation between the parameter type and the parameter definition domain, determines the parameter type of data to be transmitted, and judges whether the parameter to be transmitted conforms to the parameter definition domain corresponding to the parameter type.
The parameter type refers to the category to which the data to be transmitted belongs. For example, if the data to be transmitted is twilight, the parameter type of the twilight is name (name); the data to be transmitted is Heilongjiang, and the parameter type of the Heilongjiang is region; the data to be transmitted is 20, then the parameter type of 20 is age.
According to different contents of data to be transmitted, the process of judging whether the data to be transmitted belongs to the target parameter definition domain is different, and the method specifically comprises the following two processes:
the first method is as follows: judging whether the data to be transmitted belongs to the target parameter definition domain comprises the following steps: and under the condition that the data to be transmitted is a numerical value, judging whether the data to be transmitted belongs to the target parameter definition domain through a regular expression, wherein the target parameter definition domain is a threshold range.
In the embodiment of the application, whether the data to be transmitted is a numerical value is judged, and if the data to be transmitted is not the numerical value, whether the data to be transmitted belongs to the target parameter definition domain is judged by adopting the method in the mode two; if the data to be transmitted is a numerical value, judging whether the data to be transmitted belongs to the target parameter definition domain through a regular expression, specifically, comparing the data to be transmitted with the target parameter definition domain, and judging whether the data to be transmitted is larger than the minimum value of the target parameter definition domain and smaller than the maximum value of the target parameter definition domain.
If the server judges that the data to be transmitted is larger than the minimum value of the target parameter definition domain and smaller than the maximum value of the target parameter definition domain, the data to be transmitted belongs to the threshold range in the annotation parameter array, and the data to be transmitted belongs to the target parameter definition domain; if the server judges that the data to be transmitted is not larger than the minimum value of the target parameter definition domain and is smaller than the maximum value of the target parameter definition domain, the data to be transmitted does not belong to the threshold range in the annotation parameter array, and the data to be transmitted does not belong to the target parameter definition domain.
For example, if the data to be transmitted is the numerical value 20, the threshold range of 20 in the annotation parameter array is 0-100, the server judges whether 20 is in the range of 0-100 through the regular expression, and if the server judges that 20 is in the range of 0-100, the data to be transmitted 20 belongs to the target parameter definition domain; if the server determines 20 is not in the range of 0-100, then the data to be incoming 20 does not belong to the target parameter definition field.
The second method comprises the following steps: judging whether the data to be transmitted belongs to the target parameter definition domain comprises the following steps: and under the condition that the data to be transmitted is the data name, judging whether the data to be transmitted belongs to the target parameter definition domain or not through non-null check.
In the embodiment of the application, whether the data to be transmitted is a data name is judged, and if the data to be transmitted is not the data name, whether the data to be transmitted belongs to a target parameter definition domain is judged by adopting a method of a mode one; and if the data to be transmitted is the data name, the server judges whether the data to be transmitted belongs to the target parameter definition domain through non-empty check.
Specifically, under the condition that the data to be transmitted is the data name, the server judges whether the data to be transmitted belongs to the target parameter definition domain through a non-null check, namely judges whether the data to be transmitted is non-null. If the server judges that the data to be transmitted are not null, the data to be transmitted belong to a target parameter definition domain in the annotation parameter array; if the server determines that the data to be transmitted is not null, the data to be transmitted does not belong to the target parameter definition field in the annotation parameter array.
For example, if the data to be transmitted is small and the small and clear target parameter definition field is isonotnull, the server determines whether the small and clear data to be transmitted is non-null, and if the server determines that the small and clear data is non-null, the small and clear data to be transmitted belongs to the target parameter definition field in the annotation parameter array; and if the server judges that the ambiguity is not null, the ambiguity of the data to be transmitted does not belong to the target parameter definition field in the annotation parameter array.
According to the above description, the parameter verification rule includes a corresponding relationship between the parameter type and the parameter definition field, for example, the parameter verification rule is { id is name, unknown; id ═ region, isonotnull; id ═ age, 0-100}, where name, region, age are parameter types, and innotnull and 0-100 are parameter definition fields; name and issotnull have a correspondence, region and issotnull have a correspondence, and age and 0-100 have a correspondence.
Optionally, the determining whether the data to be transmitted conforms to the parameter verification rule in the annotation parameter array includes: determining a target parameter type of data to be transmitted; determining a target parameter definition domain corresponding to the target parameter type according to the corresponding relation between the parameter type and the parameter definition domain; judging whether the data to be transmitted belongs to a target parameter definition domain; if the data to be transmitted belongs to the target parameter definition domain, judging that the data to be transmitted accords with the parameter verification rule in the annotation parameter array; and if the data to be transmitted does not belong to the target parameter definition domain, judging that the data to be transmitted does not conform to the parameter verification rule in the annotation parameter array.
In the embodiment of the application, the server determines the target parameter type of the data to be transmitted, the parameter verification rule comprises the corresponding relation between the parameter type and the parameter definition domain, and the target parameter type of the data to be transmitted is the same as the parameter type in the annotation parameter array, so that after the target parameter type of the data to be transmitted is determined, the server can determine the target parameter definition domain of the parameter to be transmitted in the annotation parameter array according to the corresponding relation between the parameter type and the parameter definition domain.
The server judges whether the data to be transmitted belongs to the target parameter definition domain, and if the server judges that the data to be transmitted belongs to the target parameter definition domain, the data to be transmitted accords with the parameter verification rule in the annotation parameter array; and if the server judges that the data to be transmitted does not belong to the target parameter definition domain, the data to be transmitted does not conform to the parameter verification rule in the annotation parameter array. According to the method and the device, the target parameter type of the data to be transmitted is determined, so that whether the data to be transmitted belongs to the target parameter definition domain is judged, the correctness of the data to be transmitted is determined, and the parameters to be transmitted, which belong to the target parameter definition domain, are transmitted into the processing system to be processed.
For example, the data to be transmitted is 20, the server determines that the target parameter type of the 20 is age, then the server searches for a parameter check rule with the parameter type of age in the annotation parameter array, the searched parameter check rule is { id ═ age, 0-100}, the server judges whether the parameter 20 is in the range of 0-100 according to the corresponding relationship between the parameter type and the parameter definition domain, and if the server judges that the parameter 20 is in the range of 0-100, then the data to be transmitted 20 conforms to the parameter check rule in the annotation parameter array; if the server determines 20 is not in the range of 0-100, then the data 20 to be transmitted does not comply with the parameter checking rules in the annotation parameter array.
If the data to be transmitted conforms to the parameter check rule in the annotation parameter array, executing step 103; otherwise, step 104 is performed.
Step 103: and transmitting the data to be transmitted into a processing system.
In the embodiment of the application, if the server judges that the data to be transmitted accords with the parameter verification rule in the annotation parameter array and indicates that the data to be transmitted passes the verification, the data to be transmitted is transmitted into the processing system to be processed.
Step 104: the data to be transmitted is not transmitted into the processing system.
The embodiment of the application verifies the incoming data by establishing the parameter verification rule, and if the parameters of the incoming data are changed, only the corresponding parameters in the parameter verification rule need to be changed.
Optionally, as shown in fig. 2, before acquiring the data to be transmitted, the method further includes:
step 201: determining a candidate annotation parameter array, wherein the candidate annotation parameter array comprises candidate parameter verification rules.
In an embodiment of the present application, the server determines a candidate annotation parameter array, where the candidate annotation parameter array includes a candidate parameter verification rule.
Step 202: and judging whether the sample data accords with the candidate parameter verification rule.
In the embodiment of the application, the server determines the target parameter type of the sample data, the candidate parameter verification rule comprises the corresponding relation between the parameter type and the parameter definition domain, and the target parameter type of the sample data and the parameter type in the candidate annotation parameter array are the same, so that the server can determine the target parameter definition domain of the sample data in the candidate annotation parameter array according to the corresponding relation between the parameter type in the candidate parameter verification rule and the parameter definition domain after determining the target parameter type of the sample data.
The server judges whether the sample data belongs to the target parameter definition domain, if the server judges that the sample data belongs to the target parameter definition domain, the sample data accords with the candidate parameter check rule in the annotation parameter array, and the step 203 is continuously executed; if the server determines that the sample data does not belong to the target parameter definition domain, the sample data does not conform to the candidate parameter check rule in the annotation parameter array, and the step 204 is continued.
Step 203: the candidate parameter verification rule is a parameter verification rule to be used, and the parameter verification rule to be used forms an annotation parameter array.
In the embodiment of the application, if the server judges that the sample data conforms to the candidate parameter verification rule, the candidate parameter verification rule is judged to be the parameter verification rule to be used, and the parameter verification rule to be used forms the annotation parameter array.
Step 204: the candidate parameter verification rule is an unavailable parameter verification rule.
In the embodiment of the application, if the server judges that the sample data does not accord with the sample parameter check rule, the server judges that the candidate parameter check rule is an unavailable parameter check rule.
The parameter verification rule to be used is selected, the transmitted data are verified through the parameter verification rule, and data verification efficiency is improved.
Optionally, an embodiment of the present application further provides a processing flow of the data verification method, as shown in fig. 3, and the specific steps are as follows.
Step 301: an array of candidate annotation parameters is determined.
In an embodiment of the present application, the server determines a candidate annotation parameter array, where the candidate annotation parameter array includes a candidate parameter verification rule.
Step 302: and judging whether the sample data accords with the candidate parameter verification rule.
In the embodiment of the application, the server determines the target parameter type of the sample data, and the server determines the target parameter definition domain of the sample data in the candidate annotation parameter array according to the corresponding relation between the parameter type and the parameter definition domain in the candidate parameter verification rule. And the server judges whether the sample data belongs to the target parameter definition domain or not so as to judge whether the sample data accords with the candidate parameter verification rule or not.
If the server judges that the sample data accords with the candidate parameter verification rule, the step 303 is carried out; if the server determines that the sample data does not conform to the candidate parameter verification rule, the server proceeds to step 304.
Step 303: and judging the candidate parameter verification rule as a parameter verification rule to be used, wherein the parameter verification rule to be used forms an annotation parameter array.
In the embodiment of the application, if the server judges that the sample data conforms to the candidate parameter verification rule, the candidate parameter verification rule is correct, the server judges that the candidate parameter verification rule is the parameter verification rule to be used, and the parameter verification rule to be used forms an annotation parameter array.
Step 304: it is determined that the candidate parameter verification rule is erroneous.
Step 305: and acquiring data to be transmitted.
In the embodiment of the application, the server needs to acquire the data to be transmitted, and specifically, the server acquires the data to be transmitted by a reflection method.
Step 306: and judging whether the data to be transmitted conforms to the parameter checking rule in the annotation parameter array. The parameter checking rule comprises a corresponding relation between a parameter type and a parameter definition domain.
In the embodiment of the application, after the server determines the target parameter type of the data to be transmitted, the server determines a target parameter definition domain of the parameter to be transmitted in the annotation parameter array according to the corresponding relation between the parameter type and the parameter definition domain; the server judges whether the data to be transmitted belongs to a target parameter definition domain; if the data to be transmitted belongs to the target parameter definition domain, judging that the data to be transmitted accords with the parameter verification rule in the annotation parameter array, and performing step 307; if the data to be transmitted does not belong to the target parameter definition domain, it is determined that the data to be transmitted does not conform to the parameter verification rule in the annotation parameter array, and step 308 is performed.
Step 307: and transmitting the data to be transmitted into a processing system.
In the embodiment of the application, if the server judges that the data to be transmitted accords with the parameter verification rule in the annotation parameter array and indicates that the data to be transmitted passes the verification, the data to be transmitted is transmitted into the processing system to be processed.
Step 308: the data to be transmitted is not transmitted into the processing system.
The embodiment of the application verifies the incoming data by establishing the parameter verification rule, and if the parameters of the incoming data are changed, only the corresponding parameters in the parameter verification rule need to be changed.
Based on the same technical concept, an embodiment of the present application further provides a data verification apparatus, as shown in fig. 4, the apparatus includes:
an obtaining module 401, configured to obtain data to be transmitted;
the first judging module 402 is configured to judge whether the data to be transmitted conforms to a parameter verification rule in the annotation parameter array, where the parameter verification rule includes a correspondence between a parameter type and a target parameter definition domain, and the parameter verification rule is used to judge whether the data to be transmitted belongs to the parameter definition domain corresponding to the parameter type of the data to be transmitted;
the first processing module 403 is configured to, if the data to be transmitted conforms to the parameter verification rule in the annotation parameter array, transmit the data to be transmitted to the processing system;
and the second processing module 404 is configured to not transmit the data to be transmitted into the processing system if the data to be transmitted does not conform to the parameter verification rule in the annotation parameter array.
Optionally, before acquiring the data to be transmitted, the apparatus further includes:
the determining module is used for determining a candidate annotation parameter array, wherein the candidate annotation parameter array comprises candidate parameter checking rules;
the second judgment module is used for judging whether the sample data accords with the candidate parameter check rule;
the first judgment module is used for judging the candidate parameter check rule as a parameter check rule to be used if the sample data accords with the candidate parameter check rule, and the parameter check rule to be used forms an annotation parameter array;
and the second judging module is used for judging that the candidate parameter verification rule is an unavailable parameter verification rule if the sample data does not accord with the candidate parameter verification rule.
Optionally, the first determining module 402 includes:
the first determining unit is used for determining the target parameter type of the data to be transmitted;
the second determining unit is used for determining a target parameter definition domain corresponding to the target parameter type according to the corresponding relation between the parameter type and the parameter definition domain;
the judging unit is used for judging whether the data to be transmitted belongs to a target parameter definition domain;
the first judgment unit is used for judging that the data to be transmitted conforms to the parameter verification rule in the annotation parameter array if the data to be transmitted belongs to the target parameter definition domain;
and the second judging unit is used for judging that the data to be transmitted does not conform to the parameter verification rule in the annotation parameter array if the data to be transmitted does not belong to the target parameter definition domain.
Optionally, the determining unit includes:
the first judgment subunit is configured to judge, through the regular expression, whether the data to be transmitted belongs to a target parameter definition domain under the condition that the data to be transmitted is a numerical value, where the target parameter definition domain is a threshold range.
Optionally, the determining unit includes:
and the second judgment subunit is used for judging whether the data to be transmitted belongs to the target parameter definition domain or not through a non-null check under the condition that the data to be transmitted is the data name.
Optionally, the obtaining module 401 includes:
and the acquisition unit is used for acquiring the data to be transmitted by a reflection method.
The method provided by the embodiment of the application provides a data verification method, the transmitted data is verified by establishing a parameter verification rule, if the parameter of the transmitted data is changed, only the corresponding parameter in the parameter verification rule needs to be changed, and the transmitted data is automatically verified by the data verification method, so that the data verification efficiency is improved.
Based on the same technical concept, the embodiment of the present invention further provides an electronic device, as shown in fig. 5, including a processor 501, a communication interface 502, a memory 503 and a communication bus 504, where the processor 501, the communication interface 502 and the memory 503 complete mutual communication through the communication bus 504,
a memory 503 for storing a computer program;
the processor 501 is configured to implement the above method steps when executing the program stored in the memory 503.
The communication bus mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the electronic equipment and other equipment.
The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component.
In yet another embodiment of the present invention, a computer-readable storage medium is further provided, in which a computer program is stored, and the computer program, when executed by a processor, implements the steps of any of the above-mentioned data verification methods.
In yet another embodiment, a computer program product containing instructions is provided, which when run on a computer, causes the computer to perform any of the above-described data verification methods.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It is noted that, in this document, relational terms such as "first" and "second," and the like, may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The foregoing are merely exemplary embodiments of the present invention, which enable those skilled in the art to understand or practice the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A method for data verification, the method comprising:
acquiring data to be transmitted;
judging whether the data to be transmitted conforms to a parameter verification rule in an annotation parameter array, wherein the parameter verification rule comprises a corresponding relation between a parameter type and a parameter definition domain, and the parameter verification rule is used for judging whether the data to be transmitted belongs to the parameter definition domain corresponding to the parameter type of the data to be transmitted;
if the data to be transmitted conform to the parameter verification rule in the annotation parameter array, transmitting the data to be transmitted into a processing system;
and if the data to be transmitted does not conform to the parameter verification rule in the annotation parameter array, not transmitting the data to be transmitted into a processing system.
2. The method of claim 1, wherein prior to obtaining the data to be transmitted, the method further comprises:
determining a candidate annotation parameter array, wherein the candidate annotation parameter array comprises candidate parameter verification rules;
judging whether the sample data accords with the candidate parameter check rule;
if the sample data accords with the candidate parameter verification rule, judging that the candidate parameter verification rule is a parameter verification rule to be used, and the parameter verification rule to be used forms the annotation parameter array;
if the sample data does not accord with the candidate parameter verification rule, judging that the candidate parameter verification rule is an unavailable parameter verification rule.
3. The method of claim 1, wherein the determining whether the data to be transmitted conforms to a parameter checking rule in an annotation parameter array comprises:
determining the target parameter type of the data to be transmitted;
determining a target parameter definition domain corresponding to the target parameter type according to the corresponding relation between the parameter type and the parameter definition domain;
judging whether the data to be transmitted belongs to the target parameter definition domain;
if the data to be transmitted belongs to the target parameter definition domain, judging that the data to be transmitted conforms to a parameter verification rule in the annotation parameter array;
and if the data to be transmitted does not belong to the target parameter definition domain, judging that the data to be transmitted does not conform to the parameter verification rule in the annotation parameter array.
4. The method of claim 3, wherein the determining whether the data to be transmitted belongs to the target parameter definition domain comprises:
and under the condition that the data to be transmitted is a numerical value, judging whether the data to be transmitted belongs to the target parameter definition domain through a regular expression, wherein the target parameter definition domain is a threshold range.
5. The method of claim 3, wherein the determining whether the data to be transmitted belongs to the target parameter definition domain comprises:
and under the condition that the data to be transmitted is the data name, judging whether the data to be transmitted belongs to the target parameter definition domain or not through non-null check.
6. The method of claim 1, wherein the obtaining data to be transmitted comprises:
and acquiring the data to be transmitted by a reflection method.
7. A data verification apparatus, the apparatus comprising:
the acquisition module is used for acquiring data to be transmitted;
the first judgment module is used for judging whether the data to be transmitted conforms to a parameter verification rule in an annotation parameter array, wherein the parameter verification rule comprises a corresponding relation between a parameter type and a parameter definition domain, and the parameter verification rule is used for judging whether the data to be transmitted belongs to the parameter definition domain corresponding to the parameter type of the data to be transmitted;
the first processing module is used for transmitting the data to be transmitted into a processing system if the data to be transmitted conforms to the parameter verification rule in the annotation parameter array;
and the second processing module is used for not transmitting the data to be transmitted into the processing system if the data to be transmitted does not conform to the parameter verification rule in the annotation parameter array.
8. The apparatus of claim 7, further comprising:
the determining module is used for determining a candidate annotation parameter array, wherein the candidate annotation parameter array comprises candidate parameter checking rules;
the second judgment module is used for judging whether the sample data accords with the candidate parameter verification rule;
the first judging module is used for judging that the candidate parameter check rule is a parameter check rule to be used if the sample data accords with the candidate parameter check rule, and the parameter check rule to be used forms the annotation parameter array;
and the second judging module is used for judging that the candidate parameter verification rule is an unavailable parameter verification rule if the sample data does not accord with the candidate parameter verification rule.
9. The apparatus of claim 7, wherein the determining module comprises:
the first determining unit is used for determining the target parameter type of the data to be transmitted;
a second determining unit, configured to determine, according to a correspondence between the parameter type and the parameter definition domain, a target parameter definition domain corresponding to the target parameter type;
the judging unit is used for judging whether the data to be transmitted belongs to the target parameter definition domain;
the first judging unit is used for judging that the data to be transmitted conform to a parameter verification rule in the annotation parameter array if the data to be transmitted belongs to the target parameter definition domain;
and the second judging unit is used for judging that the data to be transmitted does not conform to the parameter verification rule in the annotation parameter array if the data to be transmitted does not belong to the target parameter definition domain.
10. The apparatus of claim 7, wherein the obtaining module comprises:
and the acquisition unit is used for acquiring the data to be transmitted by a reflection method.
CN202010102555.2A 2020-02-19 2020-02-19 Data verification method and device Pending CN111339137A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010102555.2A CN111339137A (en) 2020-02-19 2020-02-19 Data verification method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010102555.2A CN111339137A (en) 2020-02-19 2020-02-19 Data verification method and device

Publications (1)

Publication Number Publication Date
CN111339137A true CN111339137A (en) 2020-06-26

Family

ID=71184214

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010102555.2A Pending CN111339137A (en) 2020-02-19 2020-02-19 Data verification method and device

Country Status (1)

Country Link
CN (1) CN111339137A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112102058A (en) * 2020-09-27 2020-12-18 中国建设银行股份有限公司 Management system parameter configuration method and device
CN112181804A (en) * 2020-08-31 2021-01-05 五八到家有限公司 Parameter checking method, equipment and storage medium
CN112182037A (en) * 2020-09-28 2021-01-05 百度在线网络技术(北京)有限公司 Data verification method, device, equipment and storage medium
CN114356438A (en) * 2021-12-14 2022-04-15 海尔优家智能科技(北京)有限公司 Intelligent scene enabling method and device, electronic equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080229262A1 (en) * 2007-03-16 2008-09-18 Ichiro Harashima Design rule management method, design rule management program, rule management apparatus and rule verification apparatus
CN110147402A (en) * 2019-05-22 2019-08-20 北大方正集团有限公司 Excel file introduction method and equipment, deriving method and equipment
CN110188038A (en) * 2019-05-13 2019-08-30 青岛海尔科技有限公司 A kind of parameter verification method and device, verification framework
CN110347999A (en) * 2019-07-17 2019-10-18 政采云有限公司 A kind of method and apparatus of list data verification
CN110390069A (en) * 2019-07-31 2019-10-29 中国工商银行股份有限公司 The method, apparatus of data check calculates equipment and medium
CN110766160A (en) * 2019-10-21 2020-02-07 北京明略软件系统有限公司 Data verification method and device, storage medium and electronic equipment

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080229262A1 (en) * 2007-03-16 2008-09-18 Ichiro Harashima Design rule management method, design rule management program, rule management apparatus and rule verification apparatus
CN110188038A (en) * 2019-05-13 2019-08-30 青岛海尔科技有限公司 A kind of parameter verification method and device, verification framework
CN110147402A (en) * 2019-05-22 2019-08-20 北大方正集团有限公司 Excel file introduction method and equipment, deriving method and equipment
CN110347999A (en) * 2019-07-17 2019-10-18 政采云有限公司 A kind of method and apparatus of list data verification
CN110390069A (en) * 2019-07-31 2019-10-29 中国工商银行股份有限公司 The method, apparatus of data check calculates equipment and medium
CN110766160A (en) * 2019-10-21 2020-02-07 北京明略软件系统有限公司 Data verification method and device, storage medium and electronic equipment

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112181804A (en) * 2020-08-31 2021-01-05 五八到家有限公司 Parameter checking method, equipment and storage medium
CN112181804B (en) * 2020-08-31 2023-09-08 五八到家有限公司 Parameter verification method, device and storage medium
CN112102058A (en) * 2020-09-27 2020-12-18 中国建设银行股份有限公司 Management system parameter configuration method and device
CN112182037A (en) * 2020-09-28 2021-01-05 百度在线网络技术(北京)有限公司 Data verification method, device, equipment and storage medium
CN112182037B (en) * 2020-09-28 2024-03-29 百度在线网络技术(北京)有限公司 Data verification method, device, equipment and storage medium
CN114356438A (en) * 2021-12-14 2022-04-15 海尔优家智能科技(北京)有限公司 Intelligent scene enabling method and device, electronic equipment and storage medium
CN114356438B (en) * 2021-12-14 2023-08-18 海尔优家智能科技(北京)有限公司 Intelligent scene starting method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN111339137A (en) Data verification method and device
CN111062013B (en) Account filtering method and device, electronic equipment and machine-readable storage medium
US10452725B2 (en) Web page recognizing method and apparatus
CN107992738B (en) Account login abnormity detection method and device and electronic equipment
CN108008936B (en) Data processing method and device and electronic equipment
CN107360261A (en) A kind of HTTP request processing method, device and electronic equipment
CN109450969B (en) Method and device for acquiring data from third-party data source server and server
CN113542442B (en) Malicious domain name detection method, device, equipment and storage medium
WO2019056496A1 (en) Method for generating picture review probability interval and method for picture review determination
CN109600254B (en) Method for generating full-link log and related system
CN108805332B (en) Feature evaluation method and device
CN113961768A (en) Sensitive word detection method and device, computer equipment and storage medium
CN109976828B (en) Method and device for configuring file
CN110427538B (en) Data query method, data storage method, data query device, data storage device and electronic equipment
CN110727895B (en) Sensitive word sending method and device, electronic equipment and storage medium
CN110334019B (en) Test method, test device and readable storage medium
CN106407165A (en) Numerical value transfer record checking method and apparatus
CN115757994A (en) Business name determining method, device, equipment, medium and product
CN113220949B (en) Construction method and device of private data identification system
CN115458100A (en) Knowledge graph-based follow-up method and device, electronic equipment and storage medium
CN113763305B (en) Method and device for calibrating defect of article and electronic equipment
CN113609363A (en) User searching method and device
CN112711574A (en) Database security detection method and device, electronic equipment and medium
CN114297735A (en) Data processing method and related device
CN109165127B (en) Problem interface positioning method and device and electronic equipment

Legal Events

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