CN112181804B - Parameter verification method, device and storage medium - Google Patents

Parameter verification method, device and storage medium Download PDF

Info

Publication number
CN112181804B
CN112181804B CN202010898397.6A CN202010898397A CN112181804B CN 112181804 B CN112181804 B CN 112181804B CN 202010898397 A CN202010898397 A CN 202010898397A CN 112181804 B CN112181804 B CN 112181804B
Authority
CN
China
Prior art keywords
verified
parameter
verification
checked
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.)
Active
Application number
CN202010898397.6A
Other languages
Chinese (zh)
Other versions
CN112181804A (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.)
May 8 Home Co ltd
Original Assignee
May 8 Home 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 May 8 Home Co ltd filed Critical May 8 Home Co ltd
Priority to CN202010898397.6A priority Critical patent/CN112181804B/en
Publication of CN112181804A publication Critical patent/CN112181804A/en
Application granted granted Critical
Publication of CN112181804B publication Critical patent/CN112181804B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3604Software analysis for verifying properties of programs
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Abstract

The application discloses a parameter verification method, parameter verification equipment and a storage medium. The method comprises the following steps: creating a spring section based on a section technology, and intercepting a method to be checked; acquiring at least one annotation identifier corresponding to the method to be verified; analyzing parameters to be checked corresponding to the annotation identifiers based on a preset data structure rule; and verifying the parameter to be verified according to the corresponding relation between the parameter to be verified and at least one annotation identifier. Through the technical scheme, when the parameters to be checked are checked, at least one annotation identifier corresponding to each parameter to be checked can be obtained through analysis by utilizing the preset data structure rule, and further, various parameters to be checked can be checked, and the parameters meeting the data structure rule can be added into the parameters to be checked, so that the requirements of diversified and various parameter check can be met.

Description

Parameter verification method, device and storage medium
Technical Field
The embodiment of the application relates to the technical field of Internet, in particular to a parameter verification method, parameter verification equipment and a storage medium.
Background
With the development of internet technology, services are more and more complex, and correspondingly, when related service application development is performed, the content to be checked is more complex.
In the prior art, in the validity verification process of some parameters, verification needs to be performed for each field, a verification result is returned, and verification codes are repeated and the workload is high. When a large number of codes are faced, problematic parameters cannot be found at one time, and the progress of joint debugging, testing and troubleshooting is seriously affected.
Therefore, a scheme capable of performing parameter verification safely and efficiently is needed.
Disclosure of Invention
The embodiment of the application provides a parameter verification method, parameter verification equipment and a storage medium, which are used for realizing a scheme capable of carrying out parameter verification safely and efficiently.
In a first aspect, an embodiment of the present application provides a parameter verification method, where the method includes:
creating a spring section based on a section technology, and intercepting a method to be checked;
acquiring at least one annotation identifier corresponding to the method to be verified;
analyzing parameters to be checked corresponding to the annotation identifiers based on a preset data structure rule;
and verifying the parameter to be verified according to the corresponding relation between the parameter to be verified and at least one annotation identifier.
Optionally, the analyzing the parameter to be checked corresponding to the annotation identifier based on the preset data structure rule includes:
acquiring the content to be verified corresponding to the annotation identifier;
and analyzing the parameters to be verified in the content to be verified according to the separator contained in the content to be verified, and obtaining the objects and the attributes contained in the parameters to be verified.
Optionally, before obtaining the content to be verified corresponding to the annotation identifier, the method further includes:
determining at least one annotation identifier corresponding to the object and the attribute contained in the parameter to be verified;
and according to a preset data structure rule, the separator is utilized to correlate the parameter to be checked, the object and the attribute, and the content to be checked corresponding to the annotation identifier is generated.
Optionally, the verifying the parameter to be verified according to at least one annotation identifier corresponding to the parameter to be verified includes:
acquiring attribute values corresponding to the attributes in the parameters to be verified;
determining at least one annotation identifier corresponding to the attribute value according to the corresponding relation between the parameter to be checked and at least one annotation identifier;
and verifying the attribute value according to the verification logic corresponding to the annotation identifier.
Optionally, the verifying the attribute value according to the verification logic corresponding to the annotation identifier includes:
and if the attribute value corresponds to a plurality of annotation identifiers, checking the attribute value according to the priority order of the checking logic.
Optionally, after checking the attribute value, the method further includes:
and if the attribute value verification fails, returning field information of the attribute value verification failure according to a preset return format.
Optionally, the method further comprises: if the verification of the attribute value fails, judging the execution level of the attribute;
and if the execution level of the attribute is higher than a threshold value, continuing to execute the verification of the subsequent verification logic.
Optionally, after checking the parameter to be checked, the method further includes: and outputting a verification log after the verification of the method to be verified.
In a second aspect, an embodiment of the present application provides an electronic device, including a processor, and a memory, where the memory is configured to store one or more computer instructions, and the one or more computer instructions implement the parameter verification method according to the first aspect when executed by the processor.
In a third aspect, embodiments of the present application provide a computer-readable storage medium storing a computer program that, when executed by one or more processors, causes the one or more processors to perform actions comprising:
creating a spring section based on a section technology, and intercepting a method to be checked;
acquiring at least one annotation identifier corresponding to the method to be verified;
analyzing parameters to be checked corresponding to the annotation identifiers based on a preset data structure rule;
and verifying the parameter to be verified according to the corresponding relation between the parameter to be verified and at least one annotation identifier.
In the embodiment of the application, when parameters are required to be checked, a spring section is created based on a section cutting technology, and a method to be checked is intercepted; acquiring at least one annotation identifier corresponding to the method to be verified; analyzing parameters to be checked corresponding to the annotation identifiers based on a preset data structure rule; and verifying the parameter to be verified according to the corresponding relation between the parameter to be verified and at least one annotation identifier. Through the technical scheme, when the parameters to be checked are checked, at least one annotation identifier corresponding to each parameter to be checked can be obtained through analysis by utilizing the preset data structure rule, and further, various parameters to be checked can be checked, and the parameters meeting the data structure rule can be added into the parameters to be checked, so that the requirements of diversified and various parameter check can be met.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, a brief description will be given below of the drawings required for the embodiments or the prior art descriptions, and it is obvious that the drawings in the following description are some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic flow chart of a parameter verification method according to an embodiment of the present application;
FIG. 2 is a flowchart of a method for setting parameters to be checked according to an embodiment of the present application;
FIG. 3 is a schematic flow chart of a verification process according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of a parameter verification apparatus according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of an electronic device corresponding to the parameter verification apparatus provided in the embodiment shown in fig. 4.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present application more apparent, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments of the present application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
The terminology used in the embodiments of the application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this application and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise, the "plurality" generally includes at least two.
It should be understood that the term "and/or" as used herein is merely one relationship describing the association of the associated objects, meaning that there may be three relationships, e.g., a and/or B, may represent: a exists alone, A and B exist together, and B exists alone. In addition, the character "/" herein generally indicates that the front and rear associated objects are an "or" relationship.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a product or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such product or system. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a commodity or system comprising such elements.
In the existing parameter entering validity checking process, one mode is an if … else … mode, if the parameters to be checked are relatively large, a large number of repeated codes are needed, and the workload of personnel is increased. Moreover, the problems of all checked parameters cannot be found at one time, which is unfavorable for joint debugging, testing, checking problems and the like. And a third-party annotation is used on the bean attribute, a verification logic method corresponding to each annotation is independently written, and a corresponding verification process is introduced and executed at the place needing verification. In the above scheme, the verification process is complicated, and especially when the attribute needs to be verified, the annotation is usually added to the attribute in the parameter independently, which can affect the normal program execution and the normal verification of the related parameter. Meanwhile, some packets belonging to the class to be verified can be encountered, and cannot be modified. Therefore, the application provides a method for verifying parameters more simply and comprehensively.
Fig. 1 is a flow chart of a parameter verification method according to an embodiment of the present application, as shown in fig. 1, the method includes the following steps:
101: a spring section is created based on a section technology, and a method to be checked is intercepted.
102: and obtaining at least one annotation identifier corresponding to the method to be verified.
103: and analyzing parameters to be checked corresponding to the annotation identifiers based on a preset data structure rule.
104: and verifying the parameter to be verified according to the corresponding relation between the parameter to be verified and at least one annotation identifier.
In practical application, before parameter verification, annotation customization is required according to time requirements. For example, the parameters to be checked, the attributes, the prompt information, the service scene description, the log level, whether the check fails to automatically return or not, and the like are customized.
The method for intercepting to-be-checked is selected by a user according to the checking requirement. In particular, the method to be verified may be a parameter, class, object, attribute, etc. that a certain method contains. The verification methods to be adopted for different types of parameters to be verified are not identical. In practical application, a spring tangent plane is created by utilizing a tangent plane (AOP) technology, and spring annotation definition is carried out for each object to be checked. For example, when a call request for a certain target program code is received, the interception object is intercepted based on spring cutting. The parameter types referred to herein may include different types of data such as method parameters, attributes, and the like.
In one or more embodiments of the present application, the parsing the parameter to be checked corresponding to the annotation identifier based on the preset data structure rule includes: acquiring the content to be verified corresponding to the annotation identifier; and analyzing the parameters to be verified in the content to be verified according to the separator contained in the content to be verified, and obtaining the objects and the attributes contained in the parameters to be verified.
For ease of understanding, the following is exemplified, for example, by a section of annotation identifier and its corresponding content to be verified.
NotNull (fields= "user: name, age, phone", businessDesc= "save user information")
@Pattern(fields=“user:phone”,Pattern=“1\\d{10}”)
@Max(fields=“user:age”,Value=“60”)
It can be seen from the above embodiment that each annotation identifier corresponds to a set of content to be verified, and the content to be verified includes multiple different types of content to be verified, such as parameters, classes, objects, attributes, and the like. In order to be able to distinguish between different types of parameters in the content to be checked, a separator for the distinction is set. All the contents to be checked corresponding to the same annotation identifier are checked according to the check logic represented by the annotation identifier. In practical applications, a certain attribute may simultaneously correspond to multiple annotation identifiers, which means that the attribute needs to perform verification work of multiple different verification logics. For example, in the above example, the phone attribute corresponds to two annotation identifiers at the same time: notNull and @ Pattern. Thus, each parameter to be checked and the class, object, attribute and the like in the parameter can be obtained more efficiently and safely.
In one or more embodiments of the present application, before obtaining the content to be verified corresponding to the annotation identifier, the method further includes: determining at least one annotation identifier corresponding to the object and the attribute contained in the parameter to be verified; and according to a preset data structure rule, the separator is utilized to correlate the parameter to be checked, the object and the attribute, and the content to be checked corresponding to the annotation identifier is generated.
When setting the corresponding content to be checked for different annotation marks, a separator for distinguishing different types of parameters to be checked needs to be selected, wherein the separator can comprise: method parameter separators, object attribute separators, inter-attribute separators. For example, the parameters 'separation, the object and attribute' separation, the attributes 'separation, and the' separation. NotNull (fields= "configDto: classidentifier name, dataTypeId, dataTypeName," + "acquireDataPattern, getDataMode, getDataTime, ruleConfigStatus, operator|test", businessDesc= "New configuration").
It should be noted that, before the staff member performs the verification, the parameters of the separator to be added are determined according to the actual application requirements. The separator is illustrated herein, but not limited to the technical solution of the present application, and a user may select a suitable symbol as the separator according to actual needs.
By setting the corresponding separator for different types of parameters, the parameter type of the parameter can be quickly determined according to the separator when the parameter verification is performed. Moreover, through the scheme, when the parameter verification is carried out on the attribute, the definition of annotating the attribute is not needed, and the influence on the related parameter verification or program execution is avoided. Some classes are external packages that cannot be modified. In addition, various parameters can be checked, and the parameter checks are mutually independent, and the check rule of a certain attribute is modified without influencing other check interfaces.
In addition, all the contents to be verified corresponding to the same annotation identifier are grouped according to the verification logic represented by the annotation identifier. Rather than by parameter type (e.g., grouped by attribute, grouped by class), the definition of annotations for the attribute itself is no longer required. When the verification of a certain attribute or class needs to be increased or decreased later, the content to be verified corresponding to a certain annotation identifier can be directly modified without affecting other verification entries. In other words, the technical scheme of the application provides a data structure rule which is used for grouping according to annotation identifiers and distinguishing and associating parameters, classes, objects and attributes through separators. And the verification rule modification of the class, the object, the attribute and the like is convenient to follow. The modification and setting of the verification parameters are simpler and more efficient while the safety effect is improved.
For ease of understanding, the procedure of setting the parameter to be checked is exemplified below.
Fig. 2 is a flowchart of a method for setting parameters to be checked according to an embodiment of the present application. As can be seen from the view of figure 2,
201: the check type is determined, such as, for example, a non-null check type, a regular check type, a boundary value check type, and the like.
202: and respectively defining corresponding annotation identifiers for each check type, such as an annotation identifier @ NotNull corresponding to a non-null check type, an annotation identifier @ Pattern corresponding to a regular check type and an annotation identifier @ Max corresponding to a boundary value check type.
203: and dividing parameters in the method to be checked into corresponding annotation identification groups according to the check type. The parameters referred to herein may be individual parameters, objects, classes, intra-object properties, and the like.
204: according to a preset data structure rule, setting content to be checked, such as 'separation between parameters, separation between objects and attributes', separation between attributes and separation between attributes, which are respectively corresponding to each annotation identifier.
In one or more embodiments of the present application, the verifying the parameter to be verified according to at least one annotation identifier corresponding to the parameter to be verified includes: acquiring attribute values corresponding to the attributes in the parameters to be verified; determining at least one annotation identifier corresponding to the attribute value according to the corresponding relation between the parameter to be checked and at least one annotation identifier; and verifying the attribute value according to the verification logic corresponding to the annotation identifier.
In practical application, after the parameters to be checked are obtained, the attribute values corresponding to the attributes contained in the parameters to be checked are found. It is easy to understand that different attributes, contents to be verified are different, and corresponding verification logic is not identical. Some attributes need to be checked by using one check logic for the corresponding attribute values, and some attributes need to be checked by using multiple check logic for the corresponding attribute values.
The verification logic is set for the attribute, for example, when the mobile phone number (namely phone in the above example) is verified, non-null verification and regular verification are required; when checking the age (that is, age in the above example), it is necessary to perform non-empty check and boundary value check. The check logic may be set according to actual requirements, and the check logic is merely illustrative and not limiting to the technical solution of the present application.
In one or more embodiments of the present application, the verifying the attribute value according to the verification logic corresponding to the annotation identifier includes: and if the attribute value corresponds to a plurality of annotation identifiers, checking the attribute value according to the priority order of the checking logic.
In practical application, when the attribute value of a certain attribute needs to be checked in a plurality of different ways, a plurality of annotation identifiers corresponding to the attribute value are determined, and the annotation identifiers determine check logic corresponding to the attribute value. And determining the ordering order of the plurality of verification logics corresponding to the attribute values (the ordering order can be preset by a user), and sequentially performing verification according to the ordering order, for example, normally ordering non-empty verification in the first bit. In the verification process, if the verification fails, returning the field information of the attribute value failing to verify according to a preset return format. Further, if the verification of the attribute value fails, judging the execution level of the attribute; and if the execution level of the attribute is higher than a threshold value, continuing to execute the verification of the subsequent verification logic. If the execution level of the attribute is not above the threshold, verification of other verification logic for the attribute value may be terminated.
In one or more embodiments of the present application, after verifying the parameter to be verified, the method further includes: and outputting a verification log after the verification of the method to be verified. So that a user can intuitively see the overall verification result of the method to be verified
For ease of understanding, the overall verification process is illustrated below in conjunction with a flowchart. Fig. 3 is a schematic flow chart of a verification process according to an embodiment of the present application.
And running the program, when the program is executed to a method to be verified (such as a saveiser method), intercepting different types of notes carried by the method, and determining corresponding note identifiers. The annotations on the method to be verified are obtained, for example, three annotations can be obtained here, which are @ NotNull, @ Pattern, @ Max respectively. Furthermore, the content to be checked corresponding to the annotation identification is obtained, and the content is generated according to a certain data structure rule. The content to be checked contains parameters of different types and check logic corresponding to each parameter. For example, the verification parameters include an attribute of name, age, phone, a non-null verification logic, a regular verification logic corresponding to phone (for example, 1\\d {10}, a 10-bit number after a 1 start), and a boundary value verification logic corresponding to age (for example, max60, 60 years max). The attribute values corresponding to the respective attributes are obtained, for example, name=null, age=65, phone=123456. Then the loop traverses all the attributes, for example, the attribute is name, and it is first determined whether non-null check is needed for name, that is, whether name is in the packet corresponding to @ NotNull. If yes, non-empty verification is carried out on the test result, if the verification fails, the verification is terminated, and the verification result is added into a failure result set so as to output a verification failure related result subsequently. Checking the age, judging whether the age needs to be checked non-empty or not, namely, whether the age is in a group corresponding to @ NotNull or not, if yes, checking the age non-empty, if successful, continuing to judge whether the boundary value checking is needed or not, and if yes, checking the boundary value; since age=65, the verification fails. Checking the phone, judging whether the phone needs to be subjected to non-empty check or not, namely whether the phone is in a group corresponding to @ NotNull or not, if yes, performing the non-empty check on the phone, if the check is successful, continuously judging whether regular check is needed or not, and if yes, performing the regular check; since phone=123456, although the first bit is 1 is satisfied, the subsequent number of bits is less than 10, and the verification fails.
And further, summarizing the verification results of the method to be verified, and outputting prompt information of verification failure according to a preset format, wherein the prompt information comprises attributes, attribute values, failure reasons and the like.
In the prior art, notes are added to the attributes, when the program is executed, whether the notes are added to the attributes need to be traversed one by one, a plurality of unnecessary actions can be executed, a plurality of unnecessary verification results can be generated, and especially when only a few attributes need to be verified, the verification efficiency is low. In the technical scheme of the application, the set of parameters, objects, attributes and the like which need to execute the corresponding check logic is established in the content corresponding to the annotation, and any attribute which needs to be checked is in the set, so that before the check is performed, it is known which attribute needs to be checked, and which does not need to be checked (in other words, the parameters and the attributes which do not need to be checked in the content which does not correspond to the to-be-checked in the annotation), so that the attribute which needs to be checked can be accurately and quickly found according to the annotation identification when the method is performed, and the content which does not need to be checked is not traversed, thereby obviously improving the efficiency and the accuracy of the check.
Based on the embodiment, when the parameter needs to be checked, a spring section is created based on a section cutting technology, and a method to be checked is intercepted; acquiring at least one annotation identifier corresponding to the method to be verified; analyzing parameters to be checked corresponding to the annotation identifiers based on a preset data structure rule; and verifying the parameter to be verified according to the corresponding relation between the parameter to be verified and at least one annotation identifier. Through the technical scheme, when the parameters to be checked are checked, at least one annotation identifier corresponding to each parameter to be checked can be obtained through analysis by utilizing the preset data structure rule, and further, various parameters to be checked can be checked, and the parameters meeting the data structure rule can be added into the parameters to be checked, so that the requirements of diversified and various parameter check can be met.
Based on the same thought, the embodiment of the application also provides a parameter verification device. Fig. 4 is a schematic structural diagram of a parameter verification apparatus according to an embodiment of the present application. As can be seen from fig. 4, the device comprises:
the interception module 41 is configured to create a spring section based on a section technique, and intercept a method to be checked.
And the obtaining module 42 is configured to obtain at least one annotation identifier corresponding to the method to be verified.
And the analyzing module 43 is configured to analyze the parameter to be inspected corresponding to the annotation identifier based on a preset data structure rule.
And the verification module 44 is configured to verify the parameter to be verified according to a corresponding relationship between the parameter to be verified and at least one annotation identifier.
Optionally, the parsing module 43 is further configured to obtain content to be verified corresponding to the annotation identifier; and analyzing the parameters to be verified in the content to be verified according to the separator contained in the content to be verified, and obtaining the objects and the attributes contained in the parameters to be verified.
Optionally, the method further comprises a content generation module 45, configured to determine at least one annotation identifier corresponding to the object and the attribute included in the parameter to be verified; and according to a preset data structure rule, the separator is utilized to correlate the parameter to be checked, the object and the attribute, and the content to be checked corresponding to the annotation identifier is generated.
Optionally, the verification module 44 is further configured to obtain an attribute value corresponding to each attribute in the parameter to be verified; determining at least one annotation identifier corresponding to the attribute value according to the corresponding relation between the parameter to be checked and at least one annotation identifier; and verifying the attribute value according to the verification logic corresponding to the annotation identifier.
Optionally, the verification module 44 is further configured to verify the attribute value according to the priority order of the verification logic if the attribute value corresponds to a plurality of annotation identifiers.
Optionally, the method further comprises: and if the attribute value verification fails, returning field information of the attribute value verification failure according to a preset return format.
Optionally, the method further comprises: if the verification of the attribute value fails, judging the execution level of the attribute;
and if the execution level of the attribute is higher than a threshold value, continuing to execute the verification of the subsequent verification logic.
Optionally, the method further comprises: and outputting a verification log after the verification of the method to be verified.
The apparatus shown in fig. 4 may perform the steps related to the server in fig. 1, and the detailed implementation process and technical effects are referred to the description in the foregoing embodiments, which are not repeated herein.
In one possible design, the structure of the parameter verification apparatus shown in fig. 4 may be implemented as an electronic device, and as shown in fig. 5, a schematic structural diagram of the electronic device corresponding to the parameter verification apparatus provided in the embodiment shown in fig. 4 may include: the system comprises a processor 51 and a memory 52, wherein the memory 52 is used for storing one or more computer instructions, and the one or more computer instructions realize the steps executed by the service end in the previous embodiments when being executed by the processor 51.
Optionally, the electronic device may further include a communication interface 53 for communicating with other devices.
In addition, an embodiment of the present application provides a computer storage medium storing a computer program, where the computer program makes a server execute the parameter verification method in each embodiment.
The apparatus embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present application without undue burden.
From the above description of the embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by adding necessary general purpose hardware platforms, or may be implemented by a combination of hardware and software. Based on such understanding, the foregoing aspects, in essence and portions contributing to the art, may be embodied in the form of a computer program product, which may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable resource updating apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable resource updating apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable resource updating device to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable resource updating apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In one typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include volatile memory in a computer-readable medium, random Access Memory (RAM) and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.
Computer readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. Computer-readable media, as defined herein, does not include transitory computer-readable media (transmission media), such as modulated data signals and carrier waves.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present application, and are not limiting; although the application has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims (10)

1. A method for parameter verification, the method comprising:
creating a spring section based on a section technology, and intercepting a method to be checked;
acquiring at least one annotation identifier corresponding to the method to be verified;
analyzing parameters to be checked corresponding to the annotation identifiers based on a preset data structure rule; the data structure rule is that grouping is carried out according to annotation identifiers, and parameters, classes, objects and attributes are distinguished and associated through separators;
and verifying the parameter to be verified according to the corresponding relation between the parameter to be verified and at least one annotation identifier.
2. The method according to claim 1, wherein the parsing the parameter to be verified corresponding to the annotation identifier based on the preset data structure rule includes:
acquiring the content to be verified corresponding to the annotation identifier;
and analyzing the parameters to be verified in the content to be verified according to the separator contained in the content to be verified, and obtaining the objects and the attributes contained in the parameters to be verified.
3. The method according to claim 2, further comprising, before obtaining the content to be verified corresponding to the annotation identifier:
determining at least one annotation identifier corresponding to the object and the attribute contained in the parameter to be verified;
and according to a preset data structure rule, the separator is utilized to correlate the parameter to be checked, the object and the attribute, and the content to be checked corresponding to the annotation identifier is generated.
4. The method according to claim 2, wherein the verifying the parameter to be verified according to at least one of the annotation identifiers corresponding to the parameter to be verified includes:
acquiring attribute values corresponding to the attributes in the parameters to be verified;
determining at least one annotation identifier corresponding to the attribute value according to the corresponding relation between the parameter to be checked and at least one annotation identifier;
and verifying the attribute value according to the verification logic corresponding to the annotation identifier.
5. The method of claim 4, wherein verifying the attribute value according to the verification logic corresponding to the annotation identifier comprises:
and if the attribute value corresponds to a plurality of annotation identifiers, checking the attribute value according to the priority order of the checking logic.
6. The method of claim 4, further comprising, after verifying the attribute value:
and if the attribute value verification fails, returning field information of the attribute value verification failure according to a preset return format.
7. The method as recited in claim 6, further comprising: if the verification of the attribute value fails, judging the execution level of the attribute;
and if the execution level of the attribute is higher than a threshold value, continuing to execute the verification of the subsequent verification logic.
8. The method of claim 1, further comprising, after verifying the parameter to be verified: and outputting a verification log after the verification of the method to be verified.
9. An electronic device, comprising: a processor, a memory for storing one or more computer instructions, wherein the one or more computer instructions when executed by the processor implement the parameter verification method of any one of claims 1 to 8.
10. A computer-readable storage medium storing a computer program, which when executed by one or more processors causes the one or more processors to perform acts comprising:
creating a spring section based on a section technology, and intercepting a method to be checked;
acquiring at least one annotation identifier corresponding to the method to be verified;
analyzing parameters to be checked corresponding to the annotation identifiers based on a preset data structure rule; the data structure rule is that grouping is carried out according to annotation identifiers, and parameters, classes, objects and attributes are distinguished and associated through separators;
and verifying the parameter to be verified according to the corresponding relation between the parameter to be verified and at least one annotation identifier.
CN202010898397.6A 2020-08-31 2020-08-31 Parameter verification method, device and storage medium Active CN112181804B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010898397.6A CN112181804B (en) 2020-08-31 2020-08-31 Parameter verification method, device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010898397.6A CN112181804B (en) 2020-08-31 2020-08-31 Parameter verification method, device and storage medium

Publications (2)

Publication Number Publication Date
CN112181804A CN112181804A (en) 2021-01-05
CN112181804B true CN112181804B (en) 2023-09-08

Family

ID=73924032

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010898397.6A Active CN112181804B (en) 2020-08-31 2020-08-31 Parameter verification method, device and storage medium

Country Status (1)

Country Link
CN (1) CN112181804B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113254951B (en) * 2021-04-23 2022-07-19 天津车之家数据信息技术有限公司 Data processing method and computing device
CN113535553B (en) * 2021-06-30 2023-02-28 上海联影医疗科技股份有限公司 Parameter checking method, computer device and storage medium
CN113608913A (en) * 2021-08-05 2021-11-05 上海微盟企业发展有限公司 Parameter checking method, system, device and storage medium
CN114356427A (en) * 2022-01-06 2022-04-15 成都新希望金融信息有限公司 Scanning filtering method and device, electronic equipment and storage medium
CN114647233B (en) * 2022-05-18 2022-09-30 浙江国利网安科技有限公司 PLC operation configuration monitoring method and device, storage medium and electronic equipment
CN114860549B (en) * 2022-05-30 2024-02-20 北京新唐思创教育科技有限公司 Buried data verification method, buried data verification device, buried data verification equipment and storage medium
CN116795426B (en) * 2023-08-21 2023-11-10 智慧眼科技股份有限公司 Data processing method and system

Citations (21)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA2505370A1 (en) * 2004-04-26 2005-10-26 Watchfire Corporation Method and system for website analysis
US7840939B1 (en) * 2006-03-09 2010-11-23 Oracle America, Inc. Method for managing annotation inheritance
US9652359B1 (en) * 2016-10-27 2017-05-16 Semmle Limited Annotation natural keys for source code analysis
WO2017101606A1 (en) * 2015-12-15 2017-06-22 北京奇虎科技有限公司 System and method for collecting and analyzing data
CN106991023A (en) * 2017-03-22 2017-07-28 深圳市彬讯科技有限公司 A kind of interface parameters method of calibration and component
CN107908541A (en) * 2017-07-26 2018-04-13 平安壹钱包电子商务有限公司 Interface test method, device, computer equipment and storage medium
CN107908442A (en) * 2017-12-07 2018-04-13 武汉斗鱼网络科技有限公司 Resource loading method, device, terminal device and computer-readable recording medium based on spring
CN108415834A (en) * 2018-02-12 2018-08-17 平安科技(深圳)有限公司 Explain rear end method of calibration, device, computer equipment and storage medium
CN108595680A (en) * 2018-05-02 2018-09-28 四川长虹电器股份有限公司 The implementation method of the caching of XBRL
CN108694194A (en) * 2017-04-10 2018-10-23 北京京东尚科信息技术有限公司 A kind of method and apparatus of construction data object
CN109766102A (en) * 2018-12-30 2019-05-17 卓集送信息科技(武汉)有限公司 A kind of matching process automatically parsing required parameter
KR20190091042A (en) * 2018-01-26 2019-08-05 성신여자대학교 연구 산학협력단 Pparatus for software analysis, method thereof and computer recordable medium storing the method
CN110147261A (en) * 2019-04-15 2019-08-20 平安普惠企业管理有限公司 Parameter verification method and relevant device based on calling interface
CN110413269A (en) * 2019-06-18 2019-11-05 深圳壹账通智能科技有限公司 Interface coding method, server and computer readable storage medium
CN110673838A (en) * 2019-09-10 2020-01-10 四川新网银行股份有限公司 Input checking method
CN110765422A (en) * 2018-07-25 2020-02-07 北京京东尚科信息技术有限公司 Parameter checking method and device
CN110765021A (en) * 2019-10-25 2020-02-07 腾讯科技(深圳)有限公司 Test method, test device, computer readable storage medium and computer equipment
CN111339137A (en) * 2020-02-19 2020-06-26 北京奇艺世纪科技有限公司 Data verification method and device
CN111475516A (en) * 2020-03-05 2020-07-31 深圳壹账通智能科技有限公司 Method and device for calling distributed lock, computer equipment and storage medium
CN111475331A (en) * 2020-03-24 2020-07-31 平安银行股份有限公司 Data verification method and device, computer equipment and storage medium
CN111596922A (en) * 2020-05-15 2020-08-28 山东汇贸电子口岸有限公司 Method for realizing custom cache annotation based on redis

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080222611A1 (en) * 2007-03-09 2008-09-11 Microsoft Corporation Generic validation layer for object properties
US8424107B2 (en) * 2010-06-14 2013-04-16 Microsoft Corporation Selectively exposing base class libraries based on application execution context
US8719770B2 (en) * 2010-09-09 2014-05-06 International Business Machines Corporation Verifying programming artifacts generated from ontology artifacts or models
US8555250B2 (en) * 2011-05-31 2013-10-08 Microsoft Corporation Static semantic analysis of dynamic languages
US9678856B2 (en) * 2015-04-30 2017-06-13 Emc Corporation Annotated test interfaces
US10754644B2 (en) * 2015-08-04 2020-08-25 International Business Machines Corporation Annotations in software development
KR101695277B1 (en) * 2016-04-26 2017-01-11 (주)시큐레이어 Method for supporting regularization of unconstructed data and computing device using the same

Patent Citations (21)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA2505370A1 (en) * 2004-04-26 2005-10-26 Watchfire Corporation Method and system for website analysis
US7840939B1 (en) * 2006-03-09 2010-11-23 Oracle America, Inc. Method for managing annotation inheritance
WO2017101606A1 (en) * 2015-12-15 2017-06-22 北京奇虎科技有限公司 System and method for collecting and analyzing data
US9652359B1 (en) * 2016-10-27 2017-05-16 Semmle Limited Annotation natural keys for source code analysis
CN106991023A (en) * 2017-03-22 2017-07-28 深圳市彬讯科技有限公司 A kind of interface parameters method of calibration and component
CN108694194A (en) * 2017-04-10 2018-10-23 北京京东尚科信息技术有限公司 A kind of method and apparatus of construction data object
CN107908541A (en) * 2017-07-26 2018-04-13 平安壹钱包电子商务有限公司 Interface test method, device, computer equipment and storage medium
CN107908442A (en) * 2017-12-07 2018-04-13 武汉斗鱼网络科技有限公司 Resource loading method, device, terminal device and computer-readable recording medium based on spring
KR20190091042A (en) * 2018-01-26 2019-08-05 성신여자대학교 연구 산학협력단 Pparatus for software analysis, method thereof and computer recordable medium storing the method
CN108415834A (en) * 2018-02-12 2018-08-17 平安科技(深圳)有限公司 Explain rear end method of calibration, device, computer equipment and storage medium
CN108595680A (en) * 2018-05-02 2018-09-28 四川长虹电器股份有限公司 The implementation method of the caching of XBRL
CN110765422A (en) * 2018-07-25 2020-02-07 北京京东尚科信息技术有限公司 Parameter checking method and device
CN109766102A (en) * 2018-12-30 2019-05-17 卓集送信息科技(武汉)有限公司 A kind of matching process automatically parsing required parameter
CN110147261A (en) * 2019-04-15 2019-08-20 平安普惠企业管理有限公司 Parameter verification method and relevant device based on calling interface
CN110413269A (en) * 2019-06-18 2019-11-05 深圳壹账通智能科技有限公司 Interface coding method, server and computer readable storage medium
CN110673838A (en) * 2019-09-10 2020-01-10 四川新网银行股份有限公司 Input checking method
CN110765021A (en) * 2019-10-25 2020-02-07 腾讯科技(深圳)有限公司 Test method, test device, computer readable storage medium and computer equipment
CN111339137A (en) * 2020-02-19 2020-06-26 北京奇艺世纪科技有限公司 Data verification method and device
CN111475516A (en) * 2020-03-05 2020-07-31 深圳壹账通智能科技有限公司 Method and device for calling distributed lock, computer equipment and storage medium
CN111475331A (en) * 2020-03-24 2020-07-31 平安银行股份有限公司 Data verification method and device, computer equipment and storage medium
CN111596922A (en) * 2020-05-15 2020-08-28 山东汇贸电子口岸有限公司 Method for realizing custom cache annotation based on redis

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
自定义注解+注解功能实现的一个例子;隔壁w王叔叔;《https://www.cnblogs.com/UncleWang001/p/11044902.html》;全文 *

Also Published As

Publication number Publication date
CN112181804A (en) 2021-01-05

Similar Documents

Publication Publication Date Title
CN112181804B (en) Parameter verification method, device and storage medium
US10872034B2 (en) Method, device and computer program product for executing test cases
CN109800258B (en) Data file deployment method, device, computer equipment and storage medium
CN108628748B (en) Automatic test management method and automatic test management system
CN111897724B (en) Automatic testing method and device suitable for cloud platform
US20150106663A1 (en) Hash labeling of logging messages
CN107092535B (en) Method and apparatus for data storage of test interface
CN110727581B (en) Crash positioning method and electronic equipment
CN110059068B (en) Data verification method and data verification system in distributed storage system
KR102478464B1 (en) System, apparatuses, and methods of processing and managing web traffic data
CN106487603A (en) A kind of response test method and device
CN113271237A (en) Industrial control protocol analysis method and device, storage medium and processor
CN111767226A (en) Method, system and equipment for testing cloud computing platform resources
CN111158741A (en) Method and device for monitoring change of dependency relationship of business module on third-party class library
CN111679979A (en) Destructive testing method and device
CN113114680A (en) Detection method and detection device for file uploading vulnerability
CN104298589B (en) A kind of performance test methods and equipment
CN112445706A (en) Program abnormal code acquisition method and device, electronic equipment and storage medium
CN111737351A (en) Transaction management method and device for distributed management system
CN110928941A (en) Data fragment extraction method and device
US8819645B2 (en) Application analysis device
CN115987821A (en) Gateway routing test method and device
CN114281549A (en) Data processing method and device
CN114490413A (en) Test data preparation method and device, storage medium and electronic equipment
CN112181816A (en) Interface testing method and device based on scene, computer equipment and medium

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