CN116610354A - Parameter verification method, device, computer equipment and storage medium - Google Patents

Parameter verification method, device, computer equipment and storage medium Download PDF

Info

Publication number
CN116610354A
CN116610354A CN202310523550.0A CN202310523550A CN116610354A CN 116610354 A CN116610354 A CN 116610354A CN 202310523550 A CN202310523550 A CN 202310523550A CN 116610354 A CN116610354 A CN 116610354A
Authority
CN
China
Prior art keywords
parameter
verification
class
annotation
logic code
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310523550.0A
Other languages
Chinese (zh)
Inventor
李国庆
廖振伟
左勇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Athena Eyes Co Ltd
Original Assignee
Athena Eyes 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 Athena Eyes Co Ltd filed Critical Athena Eyes Co Ltd
Priority to CN202310523550.0A priority Critical patent/CN116610354A/en
Publication of CN116610354A publication Critical patent/CN116610354A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The application relates to the field of parameter verification, and discloses a parameter verification method, a device, computer equipment and a storage medium, wherein the method comprises the following steps: generating an annotation class and a section class, wherein the annotation class is used for marking parameters in a logic code block of the package, and the section class is used for intercepting the logic code block containing the annotation class and checking the parameters in the logic code block; when the section class intercepts a logic code block containing the annotation class, acquiring parameter entering information of the logic code block through a surrounding enhancement method; acquiring parameter information of the annotation class; based on a preset parameter verification method, parameter verification is carried out on the parameter information of the annotation class and the parameter entering information to obtain a verification result, and the efficiency of parameter verification on the packaged logic code blocks is improved by adopting the method and the device.

Description

Parameter verification method, device, computer equipment and storage medium
Technical Field
The present application relates to the field of parameter verification, and in particular, to a parameter verification method, apparatus, computer device, and storage medium.
Background
With the development of internet technology, various basic technology iterations are continuously updated, and the service functions of the system are frequently changed and enter the agile development process.
In the running process of the service function of the system, the service function is always executed by adopting one or more encapsulated logic code blocks, but when some parameters are absent or abnormal, the whole flow cannot be executed, and the parameters are not necessarily necessary parameters.
The prior method for solving the problems is to verify parameters in each packaged logic code block by writing complicated codes, and the inventor realizes that the prior method at least has the following problems in the process of realizing the application: because the parameters related to each packaged logic code block are different, the parameters in each packaged logic code block are checked by independently writing judgment codes, and the development time is increased due to the fact that repeated and complicated codes are written, so that the technical problem of low parameter checking efficiency is caused.
Disclosure of Invention
The embodiment of the application provides a parameter verification method, a parameter verification device, computer equipment and a storage medium, which are used for improving the efficiency of parameter verification on packaged logic code blocks.
In order to solve the above technical problems, an embodiment of the present application provides a parameter verification method, including:
generating an annotation class and a section class, wherein the annotation class is used for marking parameters in a logic code block of the package, and the section class is used for intercepting the logic code block containing the annotation class and checking the parameters in the logic code block;
when the section class intercepts a logic code block containing the annotation class, acquiring parameter entering information of the logic code block through a surrounding enhancement method;
acquiring parameter information of the annotation class;
and carrying out parameter verification on the parameter information of the annotation class and the parameter entering information based on a preset parameter verification method to obtain a verification result.
In order to solve the above technical problem, an embodiment of the present application further provides a parameter verification apparatus, including:
the system comprises an annotation class and a section class generating module, wherein the annotation class is used for marking parameters in a logic code block of a package, and the section class is used for intercepting the logic code block containing the annotation class and checking the parameters in the logic code block;
the parameter entering information acquisition module is used for acquiring parameter entering information of the logic code blocks through a surrounding enhancement method when the section class intercepts the logic code blocks containing the annotation class;
the parameter information acquisition module is used for acquiring parameter information of the annotation class;
and the verification module is used for carrying out parameter verification on the parameter information of the annotation class and the parameter entering information based on a preset parameter verification method to obtain a verification result.
In order to solve the above technical problem, an embodiment of the present application further provides a computer device, including a memory, a processor, and a computer program stored in the memory and capable of running on the processor, where the processor implements the steps of the parameter verification method when executing the computer program.
To solve the above technical problem, embodiments of the present application further provide a computer readable storage medium storing a computer program, which when executed by a processor, implements the steps of the parameter verification method described above.
According to the parameter verification method, the device, the computer equipment and the storage medium, the logical code blocks containing the annotation class are intercepted through the section class, and the verification mode corresponding to the annotation class is executed on the parameters in the logical code blocks, so that the condition that judgment codes are independently written for verifying the parameters in each packaged logical code block due to the fact that the parameters related to each packaged logical code block are different is avoided, and therefore the efficiency of verifying the parameters of the packaged logical code blocks is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments of the present application will be briefly described below, it being obvious that the drawings in the following description are only 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 an exemplary system architecture diagram in which the present application may be applied;
FIG. 2 is a flow chart of one embodiment of a parameter verification method of the present application;
FIG. 3 is a schematic diagram of an embodiment of a parameter verification apparatus in accordance with the present application;
FIG. 4 is a schematic structural diagram of one embodiment of a computer device in accordance with the present application.
Detailed Description
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs; the terminology used in the description of the applications herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application; the terms "comprising" and "having" and any variations thereof in the description of the application and the claims and the description of the drawings above are intended to cover a non-exclusive inclusion. The terms first, second and the like in the description and in the claims or in the above-described figures, are used for distinguishing between different objects and not necessarily for describing a sequential or chronological order.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the application. The appearances of such phrases in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. Those of skill in the art will explicitly and implicitly appreciate that the embodiments described herein may be combined with other embodiments.
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all embodiments of the 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.
Referring to fig. 1, as shown in fig. 1, a system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 is used as a medium to provide communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
The user may interact with the server 105 via the network 104 using the terminal devices 101, 102, 103 to receive or send messages or the like.
The terminal devices 101, 102, 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smartphones, tablet computers, electronic book readers, MP3 players (Moving Picture Eperts Group Audio Layer III, dynamic video expert compression standard audio plane 3), MP4 (Moving Picture Eperts Group Audio Layer IV, dynamic video expert compression standard audio plane 4) players, laptop and desktop computers, and the like.
The server 105 may be a server providing various services, such as a background server providing support for pages displayed on the terminal devices 101, 102, 103.
It should be noted that, the parameter verification method provided by the embodiment of the present application is executed by a server, and accordingly, the parameter verification device is set in the server.
It should be understood that the number of terminal devices, networks and servers in fig. 1 is merely illustrative. Any number of terminal devices, networks and servers may be provided according to implementation requirements, and the terminal devices 101, 102, 103 in the embodiment of the present application may specifically correspond to application systems in actual production.
Referring to fig. 2, fig. 2 shows a parameter verification method according to an embodiment of the present application, and the method is applied to the server in fig. 1 for illustration, and is described in detail as follows:
s201, generating an annotation class and a section class, wherein the annotation class is used for marking parameters in the packaged logic code blocks, the section class is used for intercepting the logic code blocks containing the annotation class, and verifying the parameters in the logic code blocks.
In this embodiment the annotation is a special way of tool encapsulation, which can only be invoked, whose constructors are encapsulated. In this embodiment, parameters in the encapsulated logic code blocks are marked by custom annotations (custom construction method) so as to implement quick verification of the parameters in the following steps.
In this embodiment, parameters in the encapsulated logic code block marked by the annotated class may be selected according to actual needs, for example, all parameters are marked, or some parameters to be checked are marked, which is not limited herein.
The annotation class of the present application is used to illustrate that parameters in the encapsulated logical code blocks need to be checked. That is, when a packaged logical code block can be identified as an annotation class, it is stated that the packaged logical code block requires parameter verification.
An encapsulated logical code block refers to a logical code block of an encapsulated package, class, method, etc., that may be used to implement a particular function, including, but not limited to, a function, method, or functional module, etc.
Preferably, the encapsulated logic code block is a java method.
The tangent plane class refers to dynamically adding a specified code at a specified position of a method, that is, when a packaged logic code block can be identified as an annotation class, it is indicated that the packaged logic code block needs to be subjected to parameter verification, and the parameter in the packaged logic code block is verified through the tangent plane class.
Further, step S201 specifically includes:
and generating annotation class based on a preset verification task.
Generating a tangent plane class, defining a tangent point method in the tangent plane class, wherein the tangent plane of the tangent point method is an annotation class, the tangent plane class identifies the annotation class through the tangent plane, intercepts a logic code block containing the annotation class, and verifies parameters in the logic code block.
The preset verification task refers to the type of marking the packaged logic code block by the annotation type for verification.
The preset checking tasks include, but are not limited to, parameter presence checking, parameter non-null checking and dynamic rule checking.
It is easy to understand that the preset parameter verification method is determined by a verification task preset by the annotation class.
The above-mentioned facet class is a facet class (Aspect Oriented Programming, facet-oriented programming) built based on AOP, which includes @ Aspect notes for declaring the class as a facet class.
The AOP cut surface class uses @ Pointcut to define a cut point method, the cut surface of the cut point method is an annotation class, the cut surface class identifies the annotation class through the cut surface, intercepts a logic code block containing the annotation class, and verifies parameters in the logic code block.
The logical code blocks containing annotation classes are intercepted through the section classes, and parameters in the logical code blocks are checked, so that the condition that judgment codes are independently written for checking the parameters in each packaged logical code block due to different parameters related to each packaged logical code block is avoided, and the efficiency of checking the parameters of the packaged logical code blocks is improved.
S202, when the section class intercepts a logic code block containing the annotation class, acquiring the parameter entering information of the logic code block through a surrounding enhancement method.
The above-described surround enhancement method refers to a method of enhancing syntax in which a response can be performed both before and after a service method is called.
Specifically, the surround enhancement method obtains the Parameter entering information of the encapsulated logic code block through the proceedingjoint object, wherein the Parameter entering information is a Parameter object array.
Parameter entering information of the logic code blocks is obtained through a surrounding enhancement method so as to facilitate the subsequent combination of parameter information of annotation classes, parameter entering information of the logic code blocks is verified, parameter verification of the packaged logic code blocks is achieved, judgment codes are not required to be independently written for parameters of each packaged logic code block, and efficiency of parameter verification of the packaged logic code blocks is improved.
S203, acquiring parameter information of the annotation class.
Specifically, according to a preset verification task for generating the annotation class, parameter information of the annotation class is obtained.
For example, when the preset verification task of generating the annotation class is the parameter existence verification or the parameter non-null verification, the parameter information of the annotation class is the field value corresponding to the parameter index attribute.
And when the preset verification task for generating the annotation class is dynamic rule verification, the parameter information of the annotation class is a field value corresponding to the verification rule parameter.
The parameter information of the annotation class is obtained by generating the preset verification task of the annotation class, so that the expandability of parameter verification of the packaged logic code block is improved.
S204, parameter verification is carried out on the parameter information of the annotation class and the parameter entering information based on a preset parameter verification method, and a verification result is obtained.
Specifically, the preset parameter verification mode corresponds to a preset verification task for generating the annotation class.
For example, when the preset verification task for generating the annotation class is a parameter existence verification or a parameter non-null verification, the preset parameter verification mode is to verify whether the corresponding parameters in the parameter information and the parameter entering information of the annotation class exist.
When the preset verification task for generating the annotation class is parameter non-null verification, the preset parameter verification mode is to verify whether the corresponding parameters in the parameter information and the parameter entering information of the annotation class are non-null.
In this embodiment, the section class intercepts the logic code block containing the annotation class, and executes the verification mode corresponding to the annotation class on the parameters in the logic code block, so that the condition that the parameters in each packaged logic code block need to be independently written with judgment codes for verification due to different parameters related to each packaged logic code block is avoided, and the efficiency of parameter verification on the packaged logic code block is improved.
In some optional implementations of the present embodiment, when the preset parameter verification method is parameter presence verification, step S204 includes:
the total number of parameters of the Parameter object array is taken as the Parameter entering information.
And carrying out parameter existence verification on the quantity information and the parameter entering information of the annotation type parameters to obtain a verification result, wherein when the verification result comprises that the parameters do not exist, the calling request is refused, and otherwise, the calling request is executed.
Specifically, the total number of parameters of the Parameter object array refers to the total number of parameters.
The number information of the annotation parameters refers to the specific number of the annotation parameters. For example, when the annotation class has 10 parameters, the number information of the annotation class parameters is 10.
Comparing the quantity information of the annotation class parameters with the total number of the parameters of the Parameter object array, if the quantity information of the annotation class parameters is equal to the total number of the parameters of the Parameter object array, indicating that the parameters exist in the packaged logic code block, namely, the verification result is that the parameters exist, and executing a call request for the packaged logic code block. If the quantity information of the annotation class parameters is not equal to the total number of the parameters of the Parameter object array, the fact that the parameters in the packaged logic code block do not exist is indicated, namely the verification result is that the parameters do not exist, at the moment, the call request to the packaged logic code block is refused, a log is printed, and a null result value is returned.
The Parameter existence verification is carried out on the Parameter total number of the Parameter object array and the quantity information of the annotation type parameters to obtain a verification result, so that the problem that the number of parameters in each packaged logic code block is required to be independently written with judgment codes due to the fact that the number of parameters involved in each packaged logic code block is different is avoided, and therefore the efficiency of carrying out Parameter verification on the packaged logic code blocks is improved.
In some optional implementations of the present embodiment, when the preset parameter verification method is a parameter non-null verification, step S204 includes:
and taking the Parameter value of the Parameter object array as the Parameter entering information.
And carrying out parameter non-null verification on the value of the field corresponding to the annotation type parameter subscript and the parameter entering information to obtain a verification result, wherein when the verification result has a null result, the calling request is refused, and otherwise, the calling request is executed.
Specifically, the Parameter value of the Parameter object array refers to a specific value of the Parameter acquired by the Parameter object array.
For example, when the Parameter acquired by the Parameter object array is a (school, number, name) field, and there is a specific Parameter value of (university of Shanghai traffic, 0001, zhang Sano), the Parameter value of the Parameter object array is (university of Shanghai traffic, 0001, zhang Sano).
The value of the corresponding field of the annotation parameter subscript refers to the specific value of the corresponding field of the annotation parameter. For example, when the field corresponding to the parameter subscript of the annotation class is (school, number, name) and there is a specific parameter whose parameter value is (Shanghai university, 0001, zhang san), the value of the field corresponding to the school parameter of the annotation class is Shanghai university, the value of the field corresponding to the number parameter of the annotation class is 0001, and the value of the field corresponding to the name parameter of the annotation class is Zhang san.
Comparing the value of the corresponding field of the annotation Parameter index with the specific value of the Parameter acquired by the Parameter object array, if each specific value of the corresponding field of the annotation Parameter index is equal to the content of the specific Parameter value corresponding to the same Parameter field acquired by the Parameter object array and is not null, indicating that the Parameter exists and the result is not null in the packaged logic code block, namely, checking that the result is the Parameter exists and the result is not null, and executing the call request for the packaged logic code block at the moment. If a null exists in each specific value of the corresponding field of the annotation type Parameter subscript or the content of the specific Parameter value corresponding to the same Parameter field obtained by the Parameter object array, the Parameter in the packaged logic code block is indicated to be null, namely the verification result is that the Parameter is null, at the moment, the call request to the packaged logic code block is refused, the log is printed, and the null result value is returned.
And the verification result is obtained by the values of the corresponding fields of the annotation type Parameter subscripts and the specific values of the parameters acquired by the Parameter object array, so that the problem that the flow cannot be executed due to the lack of data in the service function in the system is solved, and the efficiency of Parameter verification on the packaged logic code blocks is improved.
In some optional implementations of the present embodiment, when the preset parameter verification method is dynamic rule verification, step S204 includes:
and acquiring a check rule from the query database according to the field value corresponding to the annotation class parameter subscript, and determining check rule data.
And verifying the parameter entering information based on the verification rule data to obtain a verification result, wherein when the verification result is that the result is not matched, the calling request is refused, and otherwise, the calling request is executed.
Specifically, the query database refers to a database storing verification rules.
And determining corresponding checking rule data from the query database according to field values corresponding to the annotation class parameter subscripts, matching classes by using a strategy mode to check rules, and calling a checking rule method function of a specific class to verify the parameter entering information.
And if the verification is passed, executing a call request to the packaged logic code block, returning a result value, and if the verification is not passed, rejecting the call request to the packaged logic code block, printing a log, and returning a null result value. In this embodiment, the verification rule is obtained from the query database, the verification rule data is determined, and the parameter entering information is verified based on the verification rule data, so that the problem that the verification adjustment is performed by the verification rule that cannot dynamically change the parameters is solved, the maintainability and the adjustability of the system are improved, and the efficiency of performing parameter verification on the packaged logic code blocks is improved.
It should be understood that the sequence number of each step in the foregoing embodiment does not mean that the execution sequence of each process should be determined by the function and the internal logic, and should not limit the implementation process of the embodiment of the present application.
Fig. 3 shows a schematic block diagram of a parameter verification apparatus in one-to-one correspondence with the parameter verification method of the above embodiment. As shown in fig. 3, the parameter verification device includes an annotation class and section class generating module 31, a parameter information acquiring module 32, a parameter information acquiring module 33 and a verification module 34. The functional modules are described in detail as follows:
the annotation class and section class generating module 31 is configured to generate an annotation class and a section class, where the annotation class is used to mark parameters in a logic code block of the package, and the section class is used to intercept the logic code block containing the annotation class and verify the parameters in the logic code block.
The parameter entering information obtaining module 32 is configured to obtain parameter entering information of a logic code block through a surrounding enhancement method when the section class intercepts the logic code block including the annotation class.
The parameter information obtaining module 33 is configured to obtain parameter information of the annotation class.
The verification module 34 is configured to perform parameter verification on the parameter information of the annotation class and the parameter entering information based on a preset parameter verification method, so as to obtain a verification result.
Optionally, the annotation class and section class generation module 31 includes:
and the annotation class generating unit is used for generating the annotation class based on a preset verification task.
The section class generating unit is used for generating a section class, defining a tangent point method in the section class, wherein the section of the tangent point method is an annotation class, the section class identifies the annotation class through the section, intercepts a logic code block containing the annotation class, and verifies parameters in the logic code block.
Optionally, the parameter information obtaining module 32 includes:
the surrounding enhancement unit is used for acquiring the Parameter entering information of the encapsulated logic code blocks through the proceedingjoint object by the surrounding enhancement method, wherein the Parameter entering information is a Parameter object array.
Optionally, when the preset parameter verification method is parameter presence verification, the verification module 34 includes:
the Parameter information first determining unit is used for taking the total number of parameters of the Parameter object array as Parameter information.
And the first verification unit is used for verifying the existence of the parameters of the quantity information and the parameter entering information of the annotation type parameters to obtain a verification result, wherein when the verification result comprises the parameters which do not exist, the calling request is refused, and otherwise, the calling request is executed.
Optionally, when the preset parameter verification method is parameter non-null verification, the verification module 34 includes:
and the Parameter information second determining unit is used for taking the Parameter value of the Parameter object array as the Parameter information.
And the second verification unit is used for carrying out parameter non-null verification on the value of the field corresponding to the annotation type parameter subscript and the parameter entering information to obtain a verification result, wherein when the verification result has a null result, the calling request is refused, and otherwise, the calling request is executed.
Optionally, when the preset parameter verification method is dynamic rule verification, the verification module 34 includes:
and the check rule data determining unit is used for acquiring check rules from the query database according to the field values corresponding to the annotation class parameter subscripts and determining check rule data.
And the third verification unit is used for verifying the parameter entering information based on the verification rule data to obtain a verification result, wherein when the verification result is that the results are not matched, the calling request is refused, and otherwise, the calling request is executed.
Optionally, the verification rule data determining unit includes:
and the dynamic configuration unit is used for verifying that the rule data is a verification rule dynamically configured by the system.
For specific limitations of the parameter verification apparatus, reference may be made to the above limitation of the parameter verification method, and the description thereof will not be repeated here. The above-mentioned respective modules in the parameter verification apparatus may be implemented in whole or in part by software, hardware, and combinations thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In order to solve the technical problems, the embodiment of the application also provides computer equipment. Referring specifically to fig. 4, fig. 4 is a basic structural block diagram of a computer device according to the present embodiment.
The computer device 4 comprises a memory 41, a processor 42, a network interface 43 communicatively connected to each other via a system bus. It is noted that only a computer device 4 having a component connection memory 41, a processor 42, a network interface 43 is shown in the figures, but it is understood that not all of the illustrated components are required to be implemented and that more or fewer components may be implemented instead. It will be appreciated by those skilled in the art that the computer device herein is a device capable of automatically performing numerical calculations and/or information processing in accordance with predetermined or stored instructions, the hardware of which includes, but is not limited to, microprocessors, application specific integrated circuits (Application Specific Integrated Circuit, ASICs), programmable gate arrays (fields-Programmable Gate Array, FPGAs), digital processors (Digital Signal Processor, DSPs), embedded devices, etc.
The computer equipment can be a desktop computer, a notebook computer, a palm computer, a cloud server and other computing equipment. The computer equipment can perform man-machine interaction with a user through a keyboard, a mouse, a remote controller, a touch pad or voice control equipment and the like.
The memory 41 includes at least one type of readable storage medium including flash memory, a hard disk, a multimedia card, a card type memory (e.g., SD or D interface display memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, etc. In some embodiments, the storage 41 may be an internal storage unit of the computer device 4, such as a hard disk or a memory of the computer device 4. In other embodiments, the memory 41 may also be an external storage device of the computer device 4, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash Card (Flash Card) or the like, which are provided on the computer device 4. Of course, the memory 41 may also comprise both an internal memory unit of the computer device 4 and an external memory device. In this embodiment, the memory 41 is typically used for storing an operating system and various application software installed on the computer device 4, such as program codes for controlling electronic files, etc. Further, the memory 41 may be used to temporarily store various types of data that have been output or are to be output.
The processor 42 may be a central processing unit (Central Processing Unit, CPU), controller, microcontroller, microprocessor, or other data processing chip in some embodiments. The processor 42 is typically used to control the overall operation of the computer device 4. In this embodiment, the processor 42 is configured to execute a program code stored in the memory 41 or process data, such as a program code for executing control of an electronic file.
The network interface 43 may comprise a wireless network interface or a wired network interface, which network interface 43 is typically used for establishing a communication connection between the computer device 4 and other electronic devices.
The present application also provides another embodiment, namely, a computer readable storage medium storing an interface display program, where the interface display program is executable by at least one processor, so that the at least one processor performs the steps of the parameter verification method as described above.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) comprising instructions for causing a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the method according to the embodiments of the present application.
It is apparent that the above-described embodiments are only some embodiments of the present application, but not all embodiments, and the preferred embodiments of the present application are shown in the drawings, which do not limit the scope of the patent claims. This application may be embodied in many different forms, but rather, embodiments are provided in order to provide a thorough and complete understanding of the present disclosure. Although the application has been described in detail with reference to the foregoing embodiments, it will be apparent to those skilled in the art that modifications may be made to the embodiments described in the foregoing description, or equivalents may be substituted for elements thereof. All equivalent structures made by the content of the specification and the drawings of the application are directly or indirectly applied to other related technical fields, and are also within the scope of the application.

Claims (10)

1. A parameter verification method, characterized in that the parameter verification method comprises:
generating an annotation class and a section class, wherein the annotation class is used for marking parameters in a logic code block of the package, and the section class is used for intercepting the logic code block containing the annotation class and checking the parameters in the logic code block;
when the section class intercepts a logic code block containing the annotation class, acquiring parameter entering information of the logic code block through a surrounding enhancement method;
acquiring parameter information of the annotation class;
and carrying out parameter verification on the parameter information of the annotation class and the parameter entering information based on a preset parameter verification method to obtain a verification result.
2. The method of parameter verification according to claim 1, wherein the generating of annotation classes and section classes comprises:
generating annotation class based on a preset verification task;
generating a tangent plane class, defining a tangent point method in the tangent plane class, wherein the tangent plane of the tangent point method is the annotation class, the tangent plane class identifies the annotation class through the tangent plane, intercepts a logic code block containing the annotation class, and verifies parameters in the logic code block.
3. The Parameter verification method of claim 1, wherein the surround enhancement method obtains Parameter entry information of the encapsulated logical code block through a procedingjoin object, wherein the Parameter entry information is a Parameter object array.
4. The parameter verification method as claimed in claim 3, wherein when the preset parameter verification method is a parameter presence verification, the step of performing parameter verification on the parameter information of the annotation class and the parameter entering information based on the preset parameter verification method to obtain a verification result comprises:
taking the total number of parameters of the Parameter object array as Parameter entering information;
and carrying out parameter existence verification on the quantity information of the annotation parameters and the parameter entering information to obtain a verification result, wherein when the verification result comprises parameters which are not existed, rejecting the calling request, otherwise, executing the calling request.
5. The method for verifying parameters as defined in claim 3, wherein when the preset parameter verification method is a parameter non-null verification, the step of performing parameter verification on the parameter information of the annotation class and the parameter entering information based on the preset parameter verification method to obtain a verification result comprises:
taking the Parameter value of the Parameter object array as Parameter entering information;
and carrying out parameter non-null verification on the value of the field corresponding to the annotation parameter subscript and the parameter entering information to obtain a verification result, wherein when the verification result has a null result, rejecting the call request, otherwise, executing the call request.
6. The method for verifying parameters according to claim 1, wherein when the preset parameter verification method is a dynamic rule verification, the step of performing parameter verification on the parameter information of the annotation class and the parameter entering information based on the preset parameter verification method to obtain a verification result includes:
acquiring a check rule from a query database according to a field value corresponding to the annotation parameter subscript, and determining check rule data;
and verifying the parameter entering information based on the verification rule data to obtain a verification result, wherein when the verification result is that the result is not matched, the calling request is refused, and otherwise, the calling request is executed.
7. The parameter verification method of claim 6, wherein the verification rule data is a verification rule dynamically configured by a system.
8. A parameter verification apparatus, characterized in that the parameter verification apparatus comprises:
the system comprises an annotation class and a section class generating module, wherein the annotation class is used for marking parameters in a logic code block of a package, and the section class is used for intercepting the logic code block containing the annotation class and checking the parameters in the logic code block;
the parameter entering information acquisition module is used for acquiring parameter entering information of the logic code blocks through a surrounding enhancement method when the section class intercepts the logic code blocks containing the annotation class;
the parameter information acquisition module is used for acquiring parameter information of the annotation class;
and the verification module is used for carrying out parameter verification on the parameter information of the annotation class and the parameter entering information based on a preset parameter verification method to obtain a verification result.
9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the parameter verification method according to any one of claims 1 to 7 when executing the computer program.
10. A computer readable storage medium storing a computer program, characterized in that the computer program when executed by a processor implements the parameter verification method according to any one of claims 1 to 7.
CN202310523550.0A 2023-05-10 2023-05-10 Parameter verification method, device, computer equipment and storage medium Pending CN116610354A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310523550.0A CN116610354A (en) 2023-05-10 2023-05-10 Parameter verification method, device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310523550.0A CN116610354A (en) 2023-05-10 2023-05-10 Parameter verification method, device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116610354A true CN116610354A (en) 2023-08-18

Family

ID=87675780

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310523550.0A Pending CN116610354A (en) 2023-05-10 2023-05-10 Parameter verification method, device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116610354A (en)

Similar Documents

Publication Publication Date Title
CN108462760B (en) Electronic device, automatic cluster access domain name generation method and storage medium
CN111414407A (en) Data query method and device of database, computer equipment and storage medium
CN112416458A (en) Preloading method and device based on ReactNative, computer equipment and storage medium
CN114238948A (en) Application program detection method and device, electronic equipment and storage medium
CN113259342A (en) Login verification method, device, computer equipment and medium
CN112328486A (en) Interface automation test method and device, computer equipment and storage medium
CN113204386A (en) Nginx + Lua-based data processing method and equipment
CN112818270A (en) Data cross-domain transfer method and device and computer equipment
CN112416784A (en) Interface checking method, system and device based on configuration center and storage medium
CN117033249A (en) Test case generation method and device, computer equipment and storage medium
CN116431200A (en) Configuration method, device, equipment and storage medium for application data configuration information
CN116383787A (en) Page creation method, page creation device, computer equipment and storage medium
WO2023066258A1 (en) Data processing method and apparatus for private data, computer device and medium
CN114637672A (en) Automatic data testing method and device, computer equipment and storage medium
CN116610354A (en) Parameter verification method, device, computer equipment and storage medium
CN114003603A (en) Data export method, system and storage medium based on big data platform
CN115203672A (en) Information access control method and device, computer equipment and medium
CN112261072B (en) Service calling method, device, equipment and storage medium
CN113590352A (en) Data calling method, device, equipment and readable storage medium
CN111352357B (en) Robot control method and device and terminal equipment
CN112948817A (en) Permission control method and device of application program, computer equipment and medium
CN116302847B (en) Dynamic acquisition method and device of abnormal information, computer equipment and medium
CN116595590A (en) Data desensitization method, device, computer equipment and storage medium
CN113641966B (en) Application integration method, system, equipment and medium
CN117851014A (en) Application program calling method and device, computer equipment and storage 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