CN110188038B - Parameter verification method and device and verification framework - Google Patents

Parameter verification method and device and verification framework Download PDF

Info

Publication number
CN110188038B
CN110188038B CN201910395345.4A CN201910395345A CN110188038B CN 110188038 B CN110188038 B CN 110188038B CN 201910395345 A CN201910395345 A CN 201910395345A CN 110188038 B CN110188038 B CN 110188038B
Authority
CN
China
Prior art keywords
parameter
verification
parameters
interface
information
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
CN201910395345.4A
Other languages
Chinese (zh)
Other versions
CN110188038A (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.)
Qingdao Haier Technology Co Ltd
Original Assignee
Qingdao Haier 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 Qingdao Haier Technology Co Ltd filed Critical Qingdao Haier Technology Co Ltd
Priority to CN201910395345.4A priority Critical patent/CN110188038B/en
Publication of CN110188038A publication Critical patent/CN110188038A/en
Application granted granted Critical
Publication of CN110188038B publication Critical patent/CN110188038B/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/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3692Test management for test results analysis

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The application relates to a parameter verification method, a parameter verification device and a parameter verification architecture, and belongs to the technical field of parameter verification. The parameter verification method comprises the following steps: checking one or more inlet parameters according to the interface parameter rules to obtain corresponding checking results; and accessing to the corresponding interface under the condition that the verification result is that the verification is passed. According to the scheme of the invention, before the parameter verification of the interface is carried out, the inlet parameters are screened, and the validity of the parameters can be verified only by the inlet parameters which accord with the parameter rule of the current interface, so that the parameter verification process of the current interface is simplified, and the parameter verification efficiency of the current interface is greatly improved.

Description

Parameter verification method and device and verification framework
Technical Field
The present application relates to the field of parameter verification technologies, for example, to a parameter verification method and apparatus, and a verification architecture.
Background
Currently, in the process of developing a web application, when an interface of the web application is a rest interface, parameter verification needs to be performed on each entry parameter. The existing checking process of the interface parameters not only relates to each item of the inlet parameters to be checked which are matched with the current rest interface, but also relates to a large number of codes in the interface for developing corresponding services according to the service demands of users and service logic.
Based on a plurality of codes in the interface, the verification mode for carrying out parameter verification on each entry parameter is repeated and single; thus, since a large number of codes for realizing the service, which are irrelevant to parameter verification, are mixed in the entry parameters of the validity of the parameters to be verified, the process of verifying the parameters of the interface is a time-consuming and labor-consuming process.
In addition, in the parameter verification process, when the verification result is a verification error, the completed verification process needs to be re-verified, so that the efficiency of verifying the interface parameters is reduced.
In the process of implementing the embodiments of the present disclosure, it is found that at least the following problems exist in the related art:
the existing interface parameter checking process is time-consuming and labor-consuming, and the interface parameter checking efficiency is low.
Disclosure of Invention
The following presents a simplified summary in order to provide a basic understanding of some aspects of the disclosed embodiments. This summary is not an extensive overview, and is intended to neither identify key/critical elements nor delineate the scope of such embodiments, but is intended as a prelude to the more detailed description that follows.
The embodiment of the disclosure provides a parameter verification method.
In some embodiments, the method comprises:
checking one or more inlet parameters according to the interface parameter rules to obtain corresponding checking results; and
and accessing to a corresponding interface under the condition that the verification result is that the verification is passed.
The embodiment of the disclosure provides a parameter verification device.
In some embodiments, the apparatus comprises:
the verification module is configured to verify one or more than one inlet parameter according to the interface parameter rule to obtain a corresponding verification result; and
the access module is configured to:
and accessing to a corresponding interface under the condition that the verification result verified by the verification module is verification passing.
The embodiment of the disclosure provides a parameter verification architecture.
In some embodiments, the parameter verification architecture includes a parameter verification apparatus as described above.
The embodiment of the disclosure provides an electronic device.
In some embodiments, the electronic device comprises:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,,
the memory stores instructions executable by the at least one processor, which when executed by the at least one processor, cause the at least one processor to perform the parameter verification method described above.
Embodiments of the present disclosure provide a computer-readable storage medium.
In some embodiments, the computer readable storage medium stores computer executable instructions configured to perform the parameter verification method described above.
Embodiments of the present disclosure provide a computer program product.
In some embodiments, the computer program product comprises a computer program stored on a computer readable storage medium, the computer program comprising program instructions which, when executed by a computer, cause the computer to perform the parameter verification method described above.
Some technical schemes provided by the embodiments of the present disclosure may achieve the following technical effects:
before the parameter verification of the interface is carried out, the entry parameters are screened, and the validity of the parameters can be verified only by the entry parameters which accord with the parameter rule of the current interface, so that the parameter verification process of the current interface is simplified, and the parameter verification efficiency of the current interface is greatly improved.
The foregoing general description and the following description are exemplary and explanatory only and are not restrictive of the application.
Drawings
One or more embodiments are illustrated by way of example and not limitation in the figures of the accompanying drawings, in which like references indicate similar elements, and in which like reference numerals refer to similar elements, and in which:
FIG. 1 is a schematic flow chart of a parameter verification method according to an embodiment of the disclosure;
FIG. 2 is another flow chart of a parameter verification method according to an embodiment of the disclosure;
fig. 3 is a schematic structural diagram of a parameter verification apparatus according to an embodiment of the present disclosure;
FIG. 4 is a schematic diagram of a parameter verification architecture according to an embodiment of the present disclosure; and
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure.
Reference numerals:
30: a verification module; 31: an access module; 50: a processor; 51: a memory; 52: a communication interface; 53: a bus.
Detailed Description
So that the manner in which the features and techniques of the disclosed embodiments can be understood in more detail, a more particular description of the embodiments of the disclosure, briefly summarized below, may be had by reference to the appended drawings, which are not intended to be limiting of the embodiments of the disclosure. In the following description of the technology, for purposes of explanation, numerous details are set forth in order to provide a thorough understanding of the disclosed embodiments. However, one or more embodiments may still be practiced without these details. In other instances, well-known structures and devices may be shown simplified in order to simplify the drawing.
An embodiment of the present disclosure provides a parameter verification method, as shown in fig. 1, which is a flow chart of the parameter verification method provided in the embodiment of the present disclosure. In some embodiments, the method comprises the steps of:
s101, checking one or more inlet parameters according to interface parameter rules to obtain corresponding checking results; and
s102, accessing to a corresponding interface under the condition that the verification result is that verification is passed; in this way, compared with the parameter verification process of the existing interface, the process of verifying the parameters of the interface is a time-saving and labor-saving process because a large number of codes which are irrelevant to parameter verification and are used for realizing the service are reduced in the entry parameters of the validity of the parameters to be verified.
According to the parameter verification method provided by the embodiment of the disclosure, before the parameter verification of the interface is performed, the entry parameters are screened, and the validity of the parameters can be verified only by the entry parameters which accord with the parameter rule of the current interface, so that the parameter verification process of the current interface is simplified, and the parameter verification efficiency of the current interface is greatly improved.
In some embodiments, the parameter verification method provided by the embodiment of the disclosure adopts a mode of separating the parameter verification and the interface service logic, and accesses to the corresponding interface under the condition that the verification result is that the verification is passed, so that the verification efficiency of the parameter verification is improved, and the developer can concentrate on service implementation, thereby improving the development efficiency.
In some embodiments, the interface parameter rules are obtained according to the uniform resource locator and the request mode; in this way, based on the type information of the current interface, for example, the current interface is a rest (representational state transfer ) interface, according to the uniform resource locator of the current interface and the received request mode of the client, the interface parameter rule matched with the current interface type can be accurately acquired; in this way, each entry parameter is screened according to the interface parameter rule matched with the current interface type, and each entry parameter is screened out according to the interface parameter rule matched with the current interface type.
In some embodiments, rest is a design and development mode for network application, which can reduce development complexity and improve system scalability. In three mainstream Web service implementation schemes at present, because the Web service in the rest mode is more concise, more and more Web services adopt rest style design and implementation. For example, amazon provides a Web service that approaches rest style for book lookup.
In a specific application scene, on the premise of uniform parameter verification, parameter rules are customized for different interface types.
Specifically, on the premise of using the same verification mode, each parameter in each interface can customize a rule range, such as length, enumeration value, regular expression, general verification code and the like, and parameter verification is performed according to the customized rule.
Optionally, besides the uniform resource locator, positioning of the interface position may be implemented in other manners, and other positioning manners for implementing the interface position are all within the scope of the embodiments of the present disclosure, which are not described in detail herein.
Because the validity of the parameters can be checked only by the entry parameters conforming to the current interface parameter rule, the parameter checking process of the existing interface is simplified, and the parameter checking efficiency of the current interface is greatly improved.
In addition, the parameter verification method provided by the embodiment of the disclosure separates the parameter verification process from the service logic process, so that a large number of codes which are irrelevant to parameter verification and are used for realizing the service are prevented from being introduced in the parameter verification process, further, the time for parameter verification is shortened, and the verification efficiency and the accuracy of parameter verification of the parameter verification are improved.
On the premise of using the same checking mode, each parameter in each interface can customize rule range, such as length, enumerated value, regular expression, and universal checking code checks according to the rule
In some embodiments, in addition to the above-mentioned determination of the interface parameter rule by the url and the request manner, the interface parameter rule may be determined by other manners, which are not described herein in detail.
In some embodiments, the parameter verification method provided by the embodiments of the present disclosure further includes: returning a check error message under the condition that the check result is that the check fails; therefore, the terminal equipment can receive the returned checking error information conveniently, further accurately inquire related error parameters according to the checking error information, and purposefully modify the error parameters, so that the correction rate of parameter checking is improved.
In some embodiments, the parameter verification method provided by the embodiments of the present disclosure further includes: establishing a parameter configuration file matched with the request mode according to the request mode, and defining corresponding parameter configuration information; wherein the parameter configuration information includes one or more of the following: uniform resource locator information, request mode information, parameter data structure information, parameter format information, parameter type information and parameter verification rule information; thus, according to different request modes, different request modes correspond to different interface types, and according to different interface types, a parameter configuration file matched with the current interface type can be created, and parameter configuration information matched with the current interface type is defined; thus, it is possible to: and customizing configuration parameters matched with the current interface type.
In some embodiments, before verifying one or more entry parameters according to the interface parameter rules, further comprising: one or more entry parameters are tiled into one layer, and the parameter names of all layers are connected through preset connection characters, so that the parameter format identical to the parameter format in the parameter configuration file is obtained.
In some embodiments, even if the entry parameter is a nested data structure, the parameter verification method provided by the embodiments of the present disclosure expands the application range of parameter verification by tiling the nested entry parameter into a layer and performing parameter verification according to the interface parameter rule.
In some embodiments, the interface parameter rules are determined from a tiling of the ingress parameters; acquiring corresponding verification parameters according to interface parameter rules; wherein the verification parameters include one or more of the following: null check parameters, null value check parameters, null string check parameters, string length check parameters, enumerated value check parameters, regular match check parameters, numerical range check parameters, greater than value check parameters, less than value check parameters.
For different interface types, the parameter checking process uses unified checking parameters, such as the above listed checking parameters, and because the above checking parameters use the same set of codes, the process of repeatedly checking parameters for different interface types is avoided, and the method can be implemented: the parameter verification results aiming at different interface types can be compatible, so that the parameter verification process is further simplified, and the time for parameter verification during switching between different interfaces is shortened.
In some embodiments, the parameter verification method provided by the embodiments of the present disclosure further includes: intercepting a target interface matched with the request mode through a filter; therefore, a target interface matched with the request mode is intercepted by the filter, and the parameter verification process is simplified.
Optionally, besides the filter, the target interface matched with the request mode can be intercepted by other interception tools, which are not described in detail herein.
In some embodiments, the target interface is a rest interface.
Optionally, the target interface may be applicable to other interfaces besides the rest interface, which is not described in detail herein.
Fig. 2 is another flow chart of a parameter verification method according to an embodiment of the disclosure. From the flow schematic shown in fig. 2, it can be known that: before the parameter verification of the interface is carried out, the entry parameters are screened, and the validity of the parameters can be verified only by the entry parameters which accord with the parameter rule of the current interface, so that the parameter verification process of the current interface is simplified, and the parameter verification efficiency of the current interface is greatly improved.
The parameter verification process shown in fig. 2, the description of the same parts as those of fig. 1 is please refer to the related description of fig. 1, and will not be repeated here.
In order to better illustrate a parameter verification method provided by an embodiment of the present disclosure, logic for implementing the parameter verification method is as follows:
step 1: firstly, determining a verification rule of each parameter according to a tiling structure of an entry parameter (including parameters in a complex data structure) in each interface, wherein the verification rule comprises size, length, equality, inequality, regularization, invalid value and null value judgment, and configuring the rule in an xml (eXtensible Markup Language ) file to form a configuration file containing all interface url (uniform resource locator ) parameter rules; wherein url is composed of two main parts: protocol (Protoco 1) and Destination (Destination). The "protocol" section describes: what kind of Internet resources are faced. The most common protocol in the Web is http, which means that HTML documents are retrieved from the Web. Other protocols include gober, ftp, telnet, etc. The destination may be a file name, a directory name, or a name of a computer.
Step 2: adding a filter, reading the xml configuration file by using dom4j when initializing the filter, converting the file into Map and storing the Map into a cache;
step 3: the filter uses the established rule to filter the url configured in the xml file, and once the url is matched with the verification rule of the corresponding url, the url is delivered to the parameter verifier for further processing;
step 4: firstly, a parameter checker tiles the input parameters into a layer, connects the parameter names of all layers by using a 'term', and enables the parameter names to be the same as the parameter format in the configuration file so as to acquire the parameter rule of the url corresponding field in the configuration file, and finally, a tiled parameter list is obtained;
step 5: acquiring a verification rule of the field under the url in a cache Map according to the field names in the tiled parameter list, and verifying one by one;
step 6: and in the verification process, once the parameter is found to be inconsistent with the given rule, customized error information is returned.
The parameter verification method provided by the embodiment of the disclosure has the following beneficial effects: before the parameter verification of the interface is carried out, the entry parameters are screened, and the validity of the parameters can be verified only by the entry parameters which accord with the parameter rule of the current interface, so that the parameter verification process of the current interface is simplified, and the parameter verification efficiency of the current interface is greatly improved.
The embodiment of the disclosure provides a parameter verification device, as shown in fig. 3, which is a schematic structural diagram of the parameter verification device provided by the embodiment of the disclosure. The parameter verification device provided by the embodiment of the present disclosure includes a verification module 30 and an access module 31. In some embodiments, the verification module 30 is configured to verify one or more entry parameters according to the interface parameter rule, to obtain a corresponding verification result; and the access module 31 configured to: if the verification result verified by the verification module 30 is that verification is passed, accessing to a corresponding interface; in this way, compared with the parameter verification process of the existing interface, the process of verifying the parameters of the interface is a time-saving and labor-saving process because a large number of codes which are irrelevant to parameter verification and are used for realizing the service are reduced in the entry parameters of the validity of the parameters to be verified.
According to the parameter verification device provided by the embodiment of the disclosure, before the parameter verification of the interface is performed, the inlet parameters are screened, and the validity of the parameters can be verified only by the inlet parameters which accord with the parameter rule of the current interface, so that the parameter verification process of the current interface is simplified, and the parameter verification efficiency of the current interface is greatly improved.
In some embodiments, the parameter verification device provided by the embodiment of the disclosure adopts a mode of separating the parameter verification and the interface service logic, and is connected to the corresponding interface under the condition that the verification result is that the verification is passed, so that the verification efficiency of the parameter verification is improved, and the developer can concentrate on service implementation, thereby improving the development efficiency.
In some embodiments, the parameter verification apparatus provided by the embodiments of the present disclosure further includes a rule acquisition module (not shown in fig. 3); a rule obtaining module configured to obtain the interface parameter rule used for parameter verification by the verification module 30 according to the uniform resource locator and the request mode; therefore, the interface parameter rules applied to different interface types can be accurately acquired through the rule determining module, so that the parameter checking process is simplified, and the parameter checking time is shortened.
In some embodiments, the verification module 30 is further configured to: returning a check error message under the condition that the check result is that the check fails; in this way, the check error information returned by the check module 30 can be accurately known: which entry parameters are currently subject to verification errors in order to purposefully re-verify certain parameters.
In some embodiments, the apparatus further comprises a parameter profile creation and definition module comprising a parameter profile creation unit and a parameter configuration information definition unit; a parameter configuration file creating unit configured to create a parameter configuration file matching the request mode according to the request mode; the parameter configuration information definition unit is configured to define corresponding parameter configuration information according to the parameter configuration file created by the parameter configuration file creation unit; thus, through the parameter configuration file creation and definition module, the following can be achieved: and creating parameter configuration files matched with the request modes according to different request modes, and customizing corresponding parameter configuration information.
Optionally, the parameter configuration information defined by the parameter configuration information defining unit includes one or more of the following: uniform resource locator information, request mode information, parameter data structure information, parameter format information, parameter type information and parameter verification rule information.
In some embodiments, besides the above listed common parameter configuration information, other parameter configuration information may be included, which is not described in detail herein.
The parameter verification device provided by the embodiment of the disclosure has the following beneficial effects: before the parameter verification of the interface is carried out, the entry parameters are screened, and the validity of the parameters can be verified only by the entry parameters which accord with the parameter rule of the current interface, so that the parameter verification process of the current interface is simplified, and the parameter verification efficiency of the current interface is greatly improved.
The embodiment of the disclosure provides a parameter verification architecture, which comprises the parameter verification device.
Fig. 4 is a schematic structural diagram of a parameter verification architecture according to an embodiment of the disclosure. As can be seen from the parameter verification architecture shown in fig. 4, before the parameter verification of the interface is performed, the entry parameters are screened, and only each entry parameter conforming to the parameter rule of the current interface can perform the parameter validity verification, so that the parameter verification process of the current interface is simplified, and the parameter verification efficiency of the current interface is greatly improved.
The process of verifying the parameters of the interface by the parameter verification architecture shown in fig. 4 is described in the same parts as the parameter verification method with reference to the related description of the parameter verification method, and will not be repeated here.
The parameter verification architecture provided by the embodiment of the disclosure has the following beneficial effects: before the parameter verification of the interface is carried out, the entry parameters are screened, and the validity of the parameters can be verified only by the entry parameters which accord with the parameter rule of the current interface, so that the parameter verification process of the current interface is simplified, and the parameter verification efficiency of the current interface is greatly improved.
Embodiments of the present disclosure provide a computer-readable storage medium storing computer-executable instructions configured to perform the above-described parameter verification method.
The computer readable storage medium provided by the embodiment of the disclosure has the following beneficial effects: before the parameter verification of the interface is carried out, the entry parameters are screened, and the validity of the parameters can be verified only by the entry parameters which accord with the parameter rule of the current interface, so that the parameter verification process of the current interface is simplified, and the parameter verification efficiency of the current interface is greatly improved.
The disclosed embodiments provide a computer program product comprising a computer program stored on a computer readable storage medium, the computer program comprising program instructions which, when executed by a computer, cause the computer to perform the above-described parameter verification method.
The computer readable storage medium may be a transitory computer readable storage medium or a non-transitory computer readable storage medium.
The embodiment of the disclosure provides a computer program product with the following beneficial effects: before the parameter verification of the interface is carried out, the entry parameters are screened, and the validity of the parameters can be verified only by the entry parameters which accord with the parameter rule of the current interface, so that the parameter verification process of the current interface is simplified, and the parameter verification efficiency of the current interface is greatly improved.
An embodiment of the present disclosure provides an electronic device, whose structure is shown in fig. 5, including:
at least one processor (processor) 50, one processor 50 being exemplified in FIG. 5; and a memory (memory) 51, which may also include a communication interface (Communication Interface) 52 and a bus 53. The processor 50, the communication interface 52, and the memory 51 may communicate with each other via a bus 53. Communication interface 52 may be used for information transfer. The processor 50 may call logic instructions in the memory 51 to perform the parameter verification method of the above-described embodiment.
Further, the logic instructions in the memory 51 described above may be implemented in the form of software functional units and may be stored in a computer readable storage medium when sold or used as a stand alone product.
The memory 51 is a computer readable storage medium that can be used to store a software program, a computer executable program, such as program instructions/modules corresponding to the methods in the embodiments of the present disclosure. The processor 50 executes the function application and the data processing by running the software programs, instructions and modules stored in the memory 51, i.e. implements the parameter verification method in the above-described method embodiment.
The memory 51 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, at least one application program required for a function; the storage data area may store data created according to the use of the terminal device, etc. In addition, the memory 51 may include a high-speed random access memory, and may also include a nonvolatile memory.
Embodiments of the present disclosure may be embodied in a software product stored on a storage medium, including one or more instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of a method according to embodiments of the present disclosure. And the aforementioned storage medium may be a non-transitory storage medium including: a plurality of media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or a transitory storage medium.
The above description and the drawings illustrate embodiments of the disclosure sufficiently to enable those skilled in the art to practice them. Other embodiments may involve structural, logical, electrical, process, and other changes. The embodiments represent only possible variations. Individual components and functions are optional unless explicitly required, and the sequence of operations may vary. Portions and features of some embodiments may be included in, or substituted for, those of others. The scope of the embodiments of the present disclosure encompasses the full ambit of the claims, as well as all available equivalents of the claims. When used in this application, although the terms "first," "second," etc. may be used herein to describe various elements, these elements should not be limited by these terms. These terms are only used to distinguish one element from another element. For example, a first element could be termed a second element, and, similarly, a second element could be termed a first element, without changing the meaning of the description, so long as all occurrences of the "first element" are renamed consistently and all occurrences of the "second element" are renamed consistently. The first element and the second element are both elements, but may not be the same element. Moreover, the terminology used in the present application is for the purpose of describing embodiments only and is not intended to limit the claims. As used in the description of the embodiments and the claims, the singular forms "a," "an," and "the" (the) are intended to include the plural forms as well, unless the context clearly indicates otherwise. Similarly, the term "and/or" as used in this application is meant to encompass any and all possible combinations of one or more of the associated listed. Furthermore, when used in this application, the terms "comprises," "comprising," and/or "includes," and variations thereof, mean that the stated features, integers, steps, operations, elements, and/or components are present, but that the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof is not precluded. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method or apparatus comprising such elements. In this context, each embodiment may be described with emphasis on the differences from the other embodiments, and the same similar parts between the various embodiments may be referred to each other. For the methods, products, etc. disclosed in the embodiments, if they correspond to the method sections disclosed in the embodiments, the description of the method sections may be referred to for relevance.
Those of skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. The skilled artisan may use different methods for each particular application to achieve the described functionality, but such implementation should not be considered to be beyond the scope of the embodiments of the present disclosure. It will be clearly understood by those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described systems, apparatuses and units may refer to corresponding procedures in the foregoing method embodiments, which are not repeated herein.
In the embodiments disclosed herein, the disclosed methods, articles of manufacture (including but not limited to devices, apparatuses, etc.) may be practiced in other ways. For example, the apparatus embodiments described above are merely illustrative, and for example, the division of the units may be merely a logical function division, and there may be additional divisions when actually implemented, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not performed. In addition, the coupling or direct coupling or communication connection shown or discussed with each other may be through some interface, device or unit indirect coupling or communication connection, which may be in electrical, mechanical or other form. The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to implement the present embodiment. In addition, each functional unit in the embodiments of the present disclosure may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to embodiments of the present disclosure. 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). 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. In the description corresponding to the flowcharts and block diagrams in the figures, operations or steps corresponding to different blocks may also occur in different orders than that disclosed in the description, and sometimes no specific order exists between different operations or steps. For example, two consecutive operations or steps may actually be performed substantially in parallel, they may sometimes be performed in reverse order, which may be dependent on the functions involved. Each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/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.

Claims (7)

1. A method for parameter verification, comprising:
checking one or more inlet parameters according to the interface parameter rules to obtain corresponding checking results; and
accessing to a corresponding interface under the condition that the verification result is that verification is passed;
wherein the method further comprises:
acquiring the interface parameter rule according to the uniform resource locator and the request mode;
establishing a parameter configuration file matched with the request mode according to the request mode, and defining corresponding parameter configuration information; wherein the parameter configuration information includes one or more of the following: uniform resource locator information, request mode information, parameter data structure information, parameter format information, parameter type information and parameter verification rule information;
before the checking of the one or more entry parameters according to the interface parameter rules, the method further comprises: tiling one or more entry parameters into one layer, and connecting the parameter names of all levels through preset connection characters to obtain a parameter format identical to the parameter format in the parameter configuration file;
determining the interface parameter rule according to the tiling structure of the inlet parameter; and
acquiring corresponding verification parameters according to the interface parameter rules;
wherein the verification parameters include one or more of the following:
null check parameters, null value check parameters, null string check parameters, string length check parameters, enumerated value check parameters, regular match check parameters, numerical range check parameters, greater than value check parameters, less than value check parameters.
2. The method as recited in claim 1, further comprising:
and returning check error information under the condition that the check result is that the check fails.
3. The method as recited in claim 1, further comprising:
and intercepting a target interface matched with the request mode through a filter.
4. A method according to claim 3, wherein the target interface is a rest interface.
5. A parameter verification apparatus, comprising:
the verification module is configured to verify one or more than one inlet parameter according to the interface parameter rule to obtain a corresponding verification result; and
an access module configured to:
accessing to a corresponding interface under the condition that the verification result verified by the verification module is verification passing;
wherein the apparatus further comprises: the rule acquisition module is configured to acquire the interface parameter rule used for parameter verification by the verification module according to a uniform resource locator and a request mode;
the system comprises a parameter configuration file creating and defining module, a parameter configuration file creating and defining module and a parameter configuration information defining module, wherein the parameter configuration file creating and defining module comprises a parameter configuration file creating unit and a parameter configuration information defining unit;
the parameter configuration file creating unit is configured to create a parameter configuration file matched with the request mode according to the request mode;
the parameter configuration information definition unit is configured to define corresponding parameter configuration information according to the parameter configuration file created by the parameter configuration file creation unit; wherein the parameter configuration information defined by the parameter configuration information defining unit includes one or more of the following: uniform resource locator information, request mode information, parameter data structure information, parameter format information, parameter type information and parameter verification rule information;
the format setting module is configured to tile one or more entry parameters into one layer, and connect the parameter names of all levels through preset connection characters to obtain a parameter format identical to the parameter format in the parameter configuration file;
an interface parameter rule determining module configured to determine the interface parameter rule according to a tiling of the ingress parameters; and
the verification parameter obtaining module is configured to obtain corresponding verification parameters according to the interface parameter rules;
wherein the verification parameters include one or more of the following:
null check parameters, null value check parameters, null string check parameters, string length check parameters, enumerated value check parameters, regular match check parameters, numerical range check parameters, greater than value check parameters, less than value check parameters.
6. The apparatus of claim 5, wherein the verification module is further configured to:
and returning check error information under the condition that the check result is that the check fails.
7. A parameter verification architecture comprising the apparatus of claim 5 or 6.
CN201910395345.4A 2019-05-13 2019-05-13 Parameter verification method and device and verification framework Active CN110188038B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910395345.4A CN110188038B (en) 2019-05-13 2019-05-13 Parameter verification method and device and verification framework

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910395345.4A CN110188038B (en) 2019-05-13 2019-05-13 Parameter verification method and device and verification framework

Publications (2)

Publication Number Publication Date
CN110188038A CN110188038A (en) 2019-08-30
CN110188038B true CN110188038B (en) 2023-07-21

Family

ID=67716128

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910395345.4A Active CN110188038B (en) 2019-05-13 2019-05-13 Parameter verification method and device and verification framework

Country Status (1)

Country Link
CN (1) CN110188038B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111339137A (en) * 2020-02-19 2020-06-26 北京奇艺世纪科技有限公司 Data verification method and device
CN112540923B (en) * 2020-12-15 2022-03-25 平安科技(深圳)有限公司 Interface parameter checking and converting method, device, equipment and storage medium
CN113641585B (en) * 2021-08-20 2023-04-07 成方金融科技有限公司 Test data generation method, device, equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102231187A (en) * 2011-07-12 2011-11-02 四川大学 Computer vision detection technology-based method for detecting and identifying QR (Quick Response) code
CN107579836A (en) * 2016-07-04 2018-01-12 中兴通讯股份有限公司 A kind of parameter verification method and apparatus and NM server
CN108134962A (en) * 2016-12-01 2018-06-08 青岛海尔多媒体有限公司 Method for setting screen parameter, method and device, TV motherboard for obtaining screen parameter
CN108881101A (en) * 2017-05-08 2018-11-23 腾讯科技(深圳)有限公司 A kind of cross site scripting loophole defence method, device and client based on DOM Document Object Model
CN109101812A (en) * 2018-08-28 2018-12-28 北京神州绿盟信息安全科技股份有限公司 A kind of parameter verification method, apparatus, computing device and storage medium

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE59914907D1 (en) * 1998-11-27 2009-01-02 Alcatel Lucent Method and device for validation of configuration data for telecommunication systems
US9954860B2 (en) * 2013-03-15 2018-04-24 Entrust, Inc. Online secure transaction verification system proxy server and method
CN104360937A (en) * 2014-10-21 2015-02-18 福建富士通信息软件有限公司 Intelligent parameter checking device
CN105490816A (en) * 2015-12-29 2016-04-13 青岛海尔智能家电科技有限公司 Method and device of multiple authentications on the basis of AllJoyn
CN109324958B (en) * 2018-06-27 2021-10-29 郑州云海信息技术有限公司 REST unified verification method, device, equipment and readable storage medium
CN109739573B (en) * 2018-12-27 2023-07-18 深圳市多度科技有限公司 Processing method and device for realizing API (application program interface) call and system for realizing API

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102231187A (en) * 2011-07-12 2011-11-02 四川大学 Computer vision detection technology-based method for detecting and identifying QR (Quick Response) code
CN107579836A (en) * 2016-07-04 2018-01-12 中兴通讯股份有限公司 A kind of parameter verification method and apparatus and NM server
CN108134962A (en) * 2016-12-01 2018-06-08 青岛海尔多媒体有限公司 Method for setting screen parameter, method and device, TV motherboard for obtaining screen parameter
CN108881101A (en) * 2017-05-08 2018-11-23 腾讯科技(深圳)有限公司 A kind of cross site scripting loophole defence method, device and client based on DOM Document Object Model
CN109101812A (en) * 2018-08-28 2018-12-28 北京神州绿盟信息安全科技股份有限公司 A kind of parameter verification method, apparatus, computing device and storage medium

Also Published As

Publication number Publication date
CN110188038A (en) 2019-08-30

Similar Documents

Publication Publication Date Title
CN110188038B (en) Parameter verification method and device and verification framework
CN105635324A (en) Big file uploading and continuous uploading method and device for browser or server
CN106681921B (en) Method and device for realizing data parameterization
EP3518109A1 (en) Method and apparatus for realizing communication between web page and native application, and electronic device
US20180077157A1 (en) Method and system for identifying user information in social network
US7540416B2 (en) Smart card authentication system with multiple card and server support
CN110661829B (en) File downloading method and device, client and computer readable storage medium
EP3306904A1 (en) Automatic recharging system, method and server
CN105635218B (en) Software center system
CN111177776A (en) Multi-tenant data isolation method and system
CN112039900A (en) Network security risk detection method, system, computer device and storage medium
CN110895603A (en) Multi-system account information integration method and device
CN111654542A (en) Proxy server, execution server, reception device, and task execution method
CN111158716B (en) Version upgrade calling method and device, computer system and readable storage medium
CN102769625A (en) Client-side Cookie information acquisition method and device
CN111738853A (en) Transaction optimization method and device based on block chain distributed system
CN114428661A (en) Mirror image management method and device
CN113240499B (en) Order processing method and device based on system switching
CN111049877B (en) Big data external output method and device and data open platform
CN113626509A (en) Data access method and device, electronic equipment and readable storage medium
CN112527780A (en) Redis cluster creating and managing method, system, computer device and storage medium
US20200322336A1 (en) Authentication broker apparatus and non-transitory computer readable medium storing authentication broker program
CN112383633B (en) Session management method and system
JP2015072531A (en) Test support method, test support device, and program
CN109933573B (en) Database service updating method, device and system

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