CN113821829A - Data verification method, device and storage medium - Google Patents

Data verification method, device and storage medium Download PDF

Info

Publication number
CN113821829A
CN113821829A CN202110021015.6A CN202110021015A CN113821829A CN 113821829 A CN113821829 A CN 113821829A CN 202110021015 A CN202110021015 A CN 202110021015A CN 113821829 A CN113821829 A CN 113821829A
Authority
CN
China
Prior art keywords
verified
plug
verification
class
strategy
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.)
Granted
Application number
CN202110021015.6A
Other languages
Chinese (zh)
Other versions
CN113821829B (en
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 Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information 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 Jingdong Century Trading Co Ltd, Beijing Wodong Tianjun Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN202110021015.6A priority Critical patent/CN113821829B/en
Publication of CN113821829A publication Critical patent/CN113821829A/en
Application granted granted Critical
Publication of CN113821829B publication Critical patent/CN113821829B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures
    • 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/2453Query optimisation
    • G06F16/24534Query rewriting; Transformation
    • G06F16/24539Query rewriting; Transformation using cached or materialised query results
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading

Abstract

The application discloses a method, a device and a storage medium for data verification, and particularly relates to a method, a device and a storage medium for data verification, wherein the method comprises the steps of firstly obtaining a plug-in to be verified, wherein the plug-in to be verified comprises business logic information to be verified, a parameter to be verified in the business logic information to be verified is marked with a custom annotation containing a verification strategy corresponding to the business logic information to be verified, secondly, registering the verification strategy in the custom annotation, establishing a mapping relation between the plug-in to be verified and the corresponding verification strategy, further, configuring a verification package path containing the corresponding verification strategy for the plug-in to be verified based on the mapping relation, and finally, executing the business logic information to be verified in the plug-in to be verified based on the verification strategy in the verification package path and verifying the parameter to be verified. According to the embodiment of the application, the business logic information to be verified is written into the plug-in to be verified, and the user-defined verification strategy is set for the plug-in to be verified for verification, so that the complex business logic verification can be realized without code intrusion.

Description

Data verification method, device and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for data verification, and a storage medium.
Background
The checking link is indispensable in various business systems in the Internet industry. The method comprises the steps of checking parameters input by a front end of a user, checking services containing logic at a rear end, checking codes at a basic technical level and the like.
In the industry, there are many schemes for checking, and the checking is mainly focused on checking the data parameters themselves, and among them, annotation type checking of bean validity is widely applied, which can perform data checking based on the judgment of parameters, size, length, and the like. But the framework can not check the specific service logic contained in the data, and can not support the attribute in one parameter to check the similar scene of the data by relying on the check result of another attribute. If parameter verification of related business logic is needed, only codes can be developed in the business method, so that the invasion degree of the business method is high.
Disclosure of Invention
The embodiment of the application provides a data verification method, and the problem that verification of relevant service logic cannot be achieved in a non-invasive manner is solved.
The method comprises the following steps:
acquiring a plug-in to be verified, wherein the plug-in to be verified comprises business logic information to be verified, and a parameter to be verified in the business logic information to be verified is marked with a custom annotation containing a verification strategy corresponding to the business logic information to be verified;
registering the verification strategy in the user-defined annotation, and establishing a mapping relation between the plug-in to be verified and the corresponding verification strategy;
configuring a checking packet path containing the corresponding checking strategy for the plug-in to be checked based on the mapping relation;
and executing the service logic information to be verified in the plug-in unit to be verified in the verification packet path based on the verification strategy, and verifying the parameter to be verified.
Optionally, identifying the plug-in to be verified;
and reflecting the plug-in to be verified into the plug-in class to be verified based on a JAVA class reflection mechanism, and caching the plug-in class to be verified.
Optionally, reading a cache, querying the class of the plug-in to be verified corresponding to the identified plug-in to be verified in the cache, and directly calling the class of the plug-in to be verified when the class of the plug-in to be verified is queried.
Optionally, based on the mapping relationship, selecting the corresponding verification policy for the plug-in class to be verified, and determining the verification packet path related to the plug-in class to be verified.
In another embodiment of the present invention, there is provided an apparatus for data verification, including:
the system comprises an acquisition module, a verification module and a verification module, wherein the acquisition module is used for acquiring a plug-in to be verified, the plug-in to be verified comprises business logic information to be verified, and a parameter to be verified in the business logic information to be verified is marked with a custom annotation containing a verification strategy corresponding to the business logic information to be verified;
the registration module is used for registering the verification strategy in the user-defined annotation and establishing a mapping relation between the plug-in to be verified and the corresponding verification strategy;
a configuration module, configured to configure, for the to-be-verified plug-in, a verification packet path including the corresponding verification policy based on the mapping relationship;
and the checking module is used for executing the service logic information to be checked in the plug-in unit to be checked based on the checking strategy in the checking packet path and checking the parameter to be checked.
Optionally, the apparatus further comprises:
the identification module is used for identifying the plug-in to be verified;
and the reflection module is used for reflecting the plug-in to be verified into the plug-in class to be verified based on a JAVA class reflection mechanism and caching the plug-in class to be verified.
Optionally, the apparatus further comprises:
and the query module is used for reading the cache, querying the plug-in class to be verified corresponding to the identified plug-in to be verified in the cache, and directly calling the plug-in class to be verified when the plug-in class to be verified is queried.
Optionally, the configuration module is further configured to:
and selecting the corresponding verification strategy for the plug-in class to be verified based on the mapping relation, and determining the verification packet path related to the plug-in class to be verified.
In another embodiment of the present invention, a non-transitory computer readable storage medium is provided, which stores instructions that, when executed by a processor, cause the processor to perform the steps of one of the above-described methods of data verification.
In another embodiment of the present invention, a terminal device is provided, which includes a processor configured to execute the steps of a data verification method as described above.
Based on the embodiment, firstly, a to-be-verified plug-in is obtained, wherein the to-be-verified plug-in includes to-be-verified business logic information, a to-be-verified parameter in the to-be-verified business logic information is marked with a custom annotation containing a verification strategy corresponding to the to-be-verified business logic information, secondly, the verification strategy in the custom annotation is registered, a mapping relation between the to-be-verified plug-in and the corresponding verification strategy is established, further, a verification package path containing the corresponding verification strategy is configured for the to-be-verified plug-in based on the mapping relation, and finally, the to-be-verified business logic information in the to-be-verified plug-in is executed in the verification package path based on the verification strategy, and the to-be-verified parameter is verified. According to the embodiment of the application, the business logic information to be verified is written into the plug-in to be verified, and the user-defined verification strategy is set for the plug-in to be verified for verification, so that the complex business logic verification can be realized without code intrusion.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained from the drawings without inventive effort.
Fig. 1 is a schematic diagram illustrating a method for data verification provided in embodiment 100 of the present application;
fig. 2 is a schematic diagram illustrating data interaction in a method for data verification according to an embodiment 200 of the present application;
fig. 3 is a schematic diagram illustrating a specific flow of a method for data verification according to an embodiment 300 of the present application;
fig. 4 is a schematic diagram illustrating an apparatus for verifying data according to an embodiment 400 of the present application;
fig. 5 shows a schematic diagram of a terminal device provided in embodiment 500 of the present application.
Detailed Description
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, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims, as well as in the drawings, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are, for example, capable of operation in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprising" and "having," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements explicitly listed, but may include other steps or elements not explicitly listed or inherent to such process, method, article, or apparatus.
Based on the problems in the prior art, the embodiment of the application provides a data verification method, which is mainly applicable to the technical field of computers. By means of self-defining annotation, annotation is marked on parameters needing to be verified, meanwhile, business logic plug-ins needing to be verified are customized, verification can be conducted according to the self-defining business logic in the system execution process, complex parameter business judgment is achieved without manually writing codes in a business method, a parameter verification link is arranged in front of the business logic execution link for verification, meanwhile, dynamic business logic verification is supported to be added at any time, and the method is extensible. Further, as shown in fig. 1, a flow chart of a data verification method provided in embodiment 100 of the present application is schematically illustrated. The detailed steps are as follows:
and step S11, acquiring the plug-in to be verified.
In this step, the user defines the service logic information to be verified, and develops a plug-in to be verified containing the service logic information to be verified. The plug-in unit to be verified comprises business logic information to be verified, wherein the business logic information to be verified is encapsulation of a business entity, a flow thereof and an implementation process of a constraint rule. Further, the parameter to be verified in the service logic information to be verified is marked with a custom annotation containing a verification strategy corresponding to the service logic information to be verified. The verification strategy is a specific verification rule for the service logic information to be verified and the parameters to be verified. And marking the verification strategy required by the user on the parameter to be verified in the business logic information to be verified in a self-defined annotation manner, and packaging the parameter to be verified into the plug-in to be verified.
And step S12, registering the verification strategy in the user-defined annotation, and establishing a mapping relation between the plug-in to be verified and the corresponding verification strategy.
In this step, after the verification system obtains the custom annotation in the plug-in to be verified, the verification system automatically maps and registers the verification strategy for the verifier to identify the verification strategy carried in the custom annotation. Further, when the user-defined annotation is obtained, a mapping relation between a verification strategy in the user-defined annotation and the plug-in to be verified is established. The plug-in to be verified can correspond to a plurality of verification strategies.
And step S13, configuring a verification package path containing the corresponding verification strategy for the plug-in to be verified based on the mapping relation.
In this step, the verification system configures a verification packet path to be verified. Specifically, based on the mapping relationship, a verification packet path including a corresponding verification policy is configured for each plug-in to be verified.
And step S14, executing the service logic information to be verified in the plug-in unit to be verified in the verification packet path based on the verification strategy, and verifying the parameters to be verified.
In this step, the verification system executes the service logic information to be verified in the plug-in to be verified in the verification packet path to be verified according to the verification strategy selected by the user, so as to verify the service logic information to be verified and the parameter to be verified.
As described above, based on the above embodiment, firstly, a to-be-verified plugin is obtained, where the to-be-verified plugin includes to-be-verified business logic information, a to-be-verified parameter in the to-be-verified business logic information is marked with a custom annotation including a verification policy corresponding to the to-be-verified business logic information, secondly, a verification policy in the custom annotation is registered, and a mapping relationship between the to-be-verified plugin and the corresponding verification policy is established, further, based on the mapping relationship, a verification package path including a corresponding verification policy is configured for the to-be-verified plugin, and finally, based on the verification policy, the to-be-verified business logic information in the to-be-verified plugin is executed in the verification package path, and the to-be-verified parameter is verified. According to the embodiment of the application, the business logic information to be verified is written into the plug-in to be verified, and the user-defined verification strategy is set for the plug-in to be verified for verification, so that the complex business logic verification can be realized without code intrusion.
Fig. 2 is a schematic diagram illustrating data interaction in a data verification method according to an embodiment 200 of the present application. The method comprises the steps of marking annotation on a parameter to be verified of business logic information to be verified in a user-defined annotation mode, and setting a verification strategy selected by a user. The user develops the service plug-in unit to be verified containing the service logic information to be verified, the verification system automatically inserts the service plug-in unit to be verified developed by the user into the verification chain, and meanwhile, the verification strategy is automatically mapped and registered in the strategy pool. Different service plug-ins to be verified can be registered to generate different verification strategies (strategy 1, strategy 2, strategy 3,. and.. times.n). The basic checker identifies the acquired service plug-in to be checked and transmits the service plug-in to be checked to the reflector, and the reflector executes reflection by using an asm byte stream technology and reflects the service plug-in to be checked into a service plug-in class to be checked. And in the reflection process, the cache is used for the service plug-in to be verified, so that the same service plug-in to be verified can not be reflected repeatedly, and the cache is directly read for obtaining. Further, the verification system identifies a verification packet path of the configuration center and transmits the verification packet path to the actuator, and the actuator executes a verification chain in the verification packet path needing to be verified according to a verification strategy selected by a user.
Fig. 3 is a schematic diagram illustrating a specific flow of a data verification method according to an embodiment 300 of the present application. The specific process is as follows:
s301, obtaining the user-defined plug-in to be verified.
Here, the user marks the verification strategy corresponding to the business logic information to be verified in the plug-in to be verified in a self-defined annotation mode. The logic information to be verified and the verification strategy are set by the user. For example in a business scenario: the requirement is that on the premise that the attribute 1 in the parameter is equal to the service value A, the service values of the attribute 2 and the attribute 3 are compared, and if the values are not equal, the verification is not passed. The service logic information to be verified is the whole service scene, and the verification strategy is whether the service values of the attribute 2 and the attribute 3 are equal or not.
S302, registering the verification strategy in the custom annotation.
Here, to facilitate verification system identification, the verification policies in the custom annotation are automatically mapped to a policy pool and registered, as shown in FIG. 2. Different plug-ins to be verified are correspondingly registered with different verification strategies (verification strategy 1, verification strategy 2, verification strategy 3. And simultaneously, inserting the plug-in to be verified developed by the user into a verification chain to wait for verification.
S303, establishing a mapping relation for the registered verification strategy and the corresponding plug-in to be verified.
S304, identifying the plug-in to be verified.
Here, as shown in FIG. 2, the base verifier in the verification system identifies the plug-in to be verified.
S305, inquiring whether the plug-in class to be verified corresponding to the plug-in to be verified exists in the cache.
Reading the cache, inquiring the plug-in class to be verified corresponding to the identified plug-in to be verified in the cache, and directly calling the plug-in class to be verified when the plug-in class to be verified is inquired. If the plug-ins are the same, the corresponding plug-ins to be verified are not generated in a reflecting mode, and processing efficiency is improved.
S306, generating a plug-in class to be verified corresponding to the plug-in to be verified and caching the plug-in class.
Here, the plug-in to be verified is reflected into the plug-in class to be verified based on the JAVA class reflection mechanism, and the plug-in class to be verified is cached. Specifically, the core of the Java reflection mechanism is to dynamically load a class and obtain detailed information of the class when a program runs, thereby operating the attributes and methods of the class or object. The essence is that after the class object is obtained, decompiling is carried out through the class object, and therefore various information of the object is obtained. After the Java source file is compiled by the Java compiler, a corresponding binary file is generated. Each legal Java class file has an accurate definition, and it is the accurate definition that makes the Java virtual machine correctly read and interpret all Java class files. Further, the reflector uses an ASM byte stream technology to perform reflection, and the plug-in to be verified is reflected into a plug-in class to be verified. Wherein, asm (association) is a Java bytecode manipulation framework. It can be used to dynamically generate classes or to enhance the functionality of existing classes. The ASM can either directly generate the binary class file or dynamically change the class behavior before the class is loaded into the Java virtual machine. Java class is stored in a strictly format defined class file, which has enough metadata to parse all the elements in the class: class name, method, attribute, and Java bytecode (instruction). After the ASM reads information from the class file, the ASM can change class behaviors, analyze class information and even generate a new class according to user requirements.
S307, calling the plug-in class to be checked.
S308, configuring a verification packet path for the plug-in to be verified.
Here, based on the mapping relationship, as shown in fig. 2, the configuration center of the verification system configures a verification packet path including a corresponding verification policy for the plug-in to be verified.
S309, executing the service logic information to be checked in the plug-in unit to be checked based on the checking strategy in the checking packet path.
And executing the service logic information to be verified in the plug-in to be verified based on the verification strategy in the verification packet path, and verifying the parameter to be verified. Specifically, an executor in the verification system executes a verification chain according to a verification strategy selected by a user in a verification packet path needing verification.
The data verification method is realized based on the steps. By means of a user-defined annotation mode, annotation is marked on the to-be-verified parameters to be verified, meanwhile, the to-be-verified plug-in to be verified is customized, the verification system can verify according to user-defined business logic information to be verified in the verification process, complex parameter business judgment is not needed to be manually realized in a business method, a parameter verification link is preposed to be verified before business execution, meanwhile, dynamic business verification is supported to be added at any time, and the method is extensible.
The existing parameter checking framework performs basic data integrity and data correctness checking on certain attributes, and in a real service system, besides the basic checking, complex service logic checking is certainly included, and the checking also includes checking on each scene of the parameter. Aiming at the problems, the service logic information to be verified in the data verification method in the embodiment of the application is executed according to the verification strategy (multiple options) selected by the user, the service logic information verification which can be defined by the user is provided, the verification strategy can also be defined by the user, the parameter verification is executed before the service method, and the data integrity is ensured at the first time. And may be used with any other verification framework.
Based on the same inventive concept, the embodiment 400 of the present application further provides an apparatus for data verification, where as shown in fig. 4, the apparatus includes:
the obtaining module 41 is configured to obtain a plug-in to be verified, where the plug-in to be verified includes business logic information to be verified, and a parameter to be verified in the business logic information to be verified is marked with a custom annotation containing a verification policy corresponding to the business logic information to be verified;
the registration module 42 is configured to register a verification policy in the custom annotation, and establish a mapping relationship between the plug-in to be verified and the corresponding verification policy;
a configuration module 43, configured to configure a verification packet path including a corresponding verification policy for the to-be-verified plug-in based on the mapping relationship;
and the checking module 44 is configured to execute the service logic information to be checked in the plug-in to be checked based on the checking policy in the checking packet path, and check the parameter to be checked.
In this embodiment, the specific functions and interaction manners of the obtaining module 41, the registering module 42, the configuring module 43, and the verifying module 44 may refer to the record of the embodiment corresponding to fig. 1, and are not described herein again.
Optionally, the apparatus further comprises:
the identification module 45 is used for identifying the plug-in to be verified;
and the reflection module 46 is configured to reflect the plug-in to be verified into the plug-in class to be verified based on a JAVA class reflection mechanism, and cache the plug-in class to be verified.
Optionally, the apparatus further comprises:
and the query module 47 is configured to read the cache, query the class of the plug-in to be verified corresponding to the identified plug-in to be verified in the cache, and directly invoke the class of the plug-in to be verified when the class of the plug-in to be verified is queried.
Optionally, the configuration module 43 is further configured to:
and selecting a corresponding verification strategy for the plug-in class to be verified based on the mapping relation, and determining a verification packet path related to the plug-in class to be verified.
As shown in fig. 5, another embodiment 500 of the present application further provides a terminal device, which includes a processor 501, where the processor 501 is configured to execute the steps of the above-mentioned data verification method. As can also be seen from fig. 5, the terminal device provided by the above embodiment further includes a non-transitory computer readable storage medium 502, the non-transitory computer readable storage medium 502 stores thereon a computer program, and the computer program is executed by the processor 501 to perform the steps of the above-mentioned data verification method. In practice, the terminal device may be one or more computers, as long as the computer-readable medium and the processor are included.
In particular, the storage medium can be a general-purpose storage medium, such as a removable disk, a hard disk, a FLASH, and the like, and when the computer program on the storage medium is executed, the steps in the above-mentioned data verification method can be executed. In practical applications, the computer readable medium may be included in the apparatus/device/system described in the above embodiments, or may exist alone without being assembled into the apparatus/device/system. The computer readable storage medium carries one or more programs which, when executed, enable performance of the steps of a method of data verification as described above.
According to embodiments disclosed herein, the computer-readable storage medium may be a non-volatile computer-readable storage medium, which may include, for example and without limitation: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing, without limiting the scope of the present disclosure. In the embodiments disclosed herein, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The flowchart and block diagrams in the figures of the present application illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments disclosed herein. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
Those skilled in the art will appreciate that various combinations and/or combinations of features recited in the various embodiments and/or claims of the present disclosure can be made, even if such combinations or combinations are not explicitly recited in the present application. In particular, the features recited in the various embodiments and/or claims of the present application may be combined and/or coupled in various ways, all of which fall within the scope of the present disclosure, without departing from the spirit and teachings of the present application.
Finally, it should be noted that: the above-mentioned embodiments are only specific embodiments of the present application, and are used for illustrating the technical solutions of the present application, but not limiting the same, and the scope of the present application is not limited thereto, and although the present application is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: any person skilled in the art can still change or easily conceive of the technical solutions described in the foregoing embodiments or equivalent replacement of some technical features thereof within the technical scope disclosed in the present application; such changes, variations and substitutions do not depart from the spirit and scope of the exemplary embodiments of the present application and are intended to be covered by the appended claims. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (10)

1. A method of data verification, comprising:
acquiring a plug-in to be verified, wherein the plug-in to be verified comprises business logic information to be verified, and a parameter to be verified in the business logic information to be verified is marked with a custom annotation containing a verification strategy corresponding to the business logic information to be verified;
registering the verification strategy in the user-defined annotation, and establishing a mapping relation between the plug-in to be verified and the corresponding verification strategy;
configuring a checking packet path containing the corresponding checking strategy for the plug-in to be checked based on the mapping relation;
and executing the service logic information to be verified in the plug-in unit to be verified in the verification packet path based on the verification strategy, and verifying the parameter to be verified.
2. The method according to claim 1, wherein between the step of establishing the mapping relationship between the to-be-verified plugin and the corresponding verification policy and the step of configuring the verification packet path including the corresponding verification policy for the to-be-verified plugin, the method further comprises:
identifying the plug-in to be verified;
and reflecting the plug-in to be verified into the plug-in class to be verified based on a JAVA class reflection mechanism, and caching the plug-in class to be verified.
3. The method of claim 2, wherein after the step of identifying the plug-in to be verified, the method further comprises:
reading the cache, inquiring the plug-in class to be verified corresponding to the identified plug-in to be verified in the cache, and directly calling the plug-in class to be verified when the plug-in class to be verified is inquired.
4. The method according to claim 3, wherein the step of configuring the verification packet path containing the corresponding verification policy for the plug-in to be verified comprises:
and selecting the corresponding verification strategy for the plug-in class to be verified based on the mapping relation, and determining the verification packet path related to the plug-in class to be verified.
5. An apparatus for data verification, comprising:
the system comprises an acquisition module, a verification module and a verification module, wherein the acquisition module is used for acquiring a plug-in to be verified, the plug-in to be verified comprises business logic information to be verified, and a parameter to be verified in the business logic information to be verified is marked with a custom annotation containing a verification strategy corresponding to the business logic information to be verified;
the registration module is used for registering the verification strategy in the user-defined annotation and establishing a mapping relation between the plug-in to be verified and the corresponding verification strategy;
a configuration module, configured to configure, for the to-be-verified plug-in, a verification packet path including the corresponding verification policy based on the mapping relationship;
and the checking module is used for executing the service logic information to be checked in the plug-in unit to be checked based on the checking strategy in the checking packet path and checking the parameter to be checked.
6. The apparatus of claim 5, further comprising:
the identification module is used for identifying the plug-in to be verified;
and the reflection module is used for reflecting the plug-in to be verified into the plug-in class to be verified based on a JAVA class reflection mechanism and caching the plug-in class to be verified.
7. The apparatus of claim 6, further comprising:
and the query module is used for reading the cache, querying the plug-in class to be verified corresponding to the identified plug-in to be verified in the cache, and directly calling the plug-in class to be verified when the plug-in class to be verified is queried.
8. The apparatus of claim 7, wherein the configuration module is further configured to:
and selecting the corresponding verification strategy for the plug-in class to be verified based on the mapping relation, and determining the verification packet path related to the plug-in class to be verified.
9. A non-transitory computer readable storage medium storing instructions that, when executed by a processor, cause the processor to perform the steps of a method of data verification as claimed in any one of claims 1 to 4.
10. A terminal device comprising a processor for performing the steps of a method of data verification as claimed in any one of claims 1 to 4.
CN202110021015.6A 2021-01-07 2021-01-07 Data verification method, device and storage medium Active CN113821829B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110021015.6A CN113821829B (en) 2021-01-07 2021-01-07 Data verification method, device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110021015.6A CN113821829B (en) 2021-01-07 2021-01-07 Data verification method, device and storage medium

Publications (2)

Publication Number Publication Date
CN113821829A true CN113821829A (en) 2021-12-21
CN113821829B CN113821829B (en) 2024-04-16

Family

ID=78912339

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110021015.6A Active CN113821829B (en) 2021-01-07 2021-01-07 Data verification method, device and storage medium

Country Status (1)

Country Link
CN (1) CN113821829B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003099283A (en) * 2001-09-25 2003-04-04 Toshiba Corp Test priority derivation support method for software system, test case designing support method, and its support program
CN108345511A (en) * 2017-01-24 2018-07-31 阿里巴巴集团控股有限公司 A kind of application data verification method, device and electronic equipment
WO2019153544A1 (en) * 2018-02-12 2019-08-15 平安科技(深圳)有限公司 Annotation backend check method and apparatus, computer device and storage medium.
CN110750740A (en) * 2019-09-16 2020-02-04 苏宁云计算有限公司 Method and device for verifying collected data in webpage request
CN112182037A (en) * 2020-09-28 2021-01-05 百度在线网络技术(北京)有限公司 Data verification method, device, equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003099283A (en) * 2001-09-25 2003-04-04 Toshiba Corp Test priority derivation support method for software system, test case designing support method, and its support program
CN108345511A (en) * 2017-01-24 2018-07-31 阿里巴巴集团控股有限公司 A kind of application data verification method, device and electronic equipment
WO2019153544A1 (en) * 2018-02-12 2019-08-15 平安科技(深圳)有限公司 Annotation backend check method and apparatus, computer device and storage medium.
CN110750740A (en) * 2019-09-16 2020-02-04 苏宁云计算有限公司 Method and device for verifying collected data in webpage request
CN112182037A (en) * 2020-09-28 2021-01-05 百度在线网络技术(北京)有限公司 Data verification method, device, equipment and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
唐玥玚: "基于Spring与iBatis的游戏活动商城平台设计与实现", 中国优秀硕士学位论文全文数据库, no. 2, 15 February 2017 (2017-02-15) *
林霞;申端明;时迎;乔德新;: "可配置组合式数据校验方法", 计算机系统应用, no. 05, 15 May 2015 (2015-05-15) *

Also Published As

Publication number Publication date
CN113821829B (en) 2024-04-16

Similar Documents

Publication Publication Date Title
CN109359468B (en) Vulnerability detection method, device and equipment
CN111428462B (en) Communication protocol template construction method and terminal equipment
CN110414261B (en) Data desensitization method, device, equipment and readable storage medium
CN111967017B (en) Method, device, terminal equipment and storage medium for generating dependency relationship
CN108614702B (en) Byte code optimization method and device
CN109240665A (en) Log recording method, device and electronic equipment
CN109271789B (en) Malicious process detection method and device, electronic equipment and storage medium
CN107203535B (en) Information query method and device
CN113961919B (en) Malicious software detection method and device
CN111615688A (en) Assertion verification code binding method and device
CN105760761A (en) Software behavior analyzing method and device
CN108829575B (en) Test case recommendation method, electronic device and readable storage medium
CN108345458B (en) Calling method and system for static compiling language and scripting language
CN111930363B (en) Block interface code generation method and device
CN112230963A (en) Method and device for repairing security vulnerability, computer equipment and storage medium
CN113821829B (en) Data verification method, device and storage medium
CN116775087A (en) Thermal repair method, device, electronic equipment and storage medium
EP3692456B1 (en) Binary image stack cookie protection
CN114338850B (en) Message checking method, device, terminal equipment and computer readable storage medium
CN113419734A (en) Application program reinforcing method and device and electronic equipment
CN110780881A (en) Software package manufacturing method and device and electronic equipment
US10726109B2 (en) Method and system for identifying whether an application is genuine by means of digital watermarks
CN116700840B (en) File execution method, device, electronic equipment and readable storage medium
CN111625784B (en) Anti-debugging method of application, related device and storage medium
WO2022068559A1 (en) Code processing method and apparatus, and device

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
GR01 Patent grant