CN111258832B - Interface parameter verification method, device, equipment and medium - Google Patents

Interface parameter verification method, device, equipment and medium Download PDF

Info

Publication number
CN111258832B
CN111258832B CN202010074223.8A CN202010074223A CN111258832B CN 111258832 B CN111258832 B CN 111258832B CN 202010074223 A CN202010074223 A CN 202010074223A CN 111258832 B CN111258832 B CN 111258832B
Authority
CN
China
Prior art keywords
interface
parameter
input
verification
standard file
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
CN202010074223.8A
Other languages
Chinese (zh)
Other versions
CN111258832A (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.)
Taikang Insurance Group Co Ltd
Original Assignee
Taikang Insurance Group 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 Taikang Insurance Group Co Ltd filed Critical Taikang Insurance Group Co Ltd
Priority to CN202010074223.8A priority Critical patent/CN111258832B/en
Publication of CN111258832A publication Critical patent/CN111258832A/en
Application granted granted Critical
Publication of CN111258832B publication Critical patent/CN111258832B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2205Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing using arrangements specific to the hardware being tested
    • G06F11/221Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing using arrangements specific to the hardware being tested to test buses, lines or interfaces, e.g. stuck-at or open line faults
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/16Error detection or correction of the data by redundancy in hardware
    • G06F11/1608Error detection by comparing the output signals of redundant hardware
    • G06F11/1625Error detection by comparing the output signals of redundant hardware in communications, e.g. transmission, interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2273Test methods
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

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

Abstract

The application discloses an interface parameter checking method, device, equipment and medium, which are applied to the technical field of computers and are used for solving the problems of lengthy interface parameter checking process and low checking efficiency in the prior art. The method comprises the following steps: by adding the filling-necessary identification into the interface standard file of the interface, when receiving the data submitting request sent by the application through the interface, the method can obtain the input parameters added with the filling-necessary identification from the interface standard file of the interface, thereby carrying out non-empty verification on the field value of the corresponding field name in the data submitting request according to the obtained parameter name of the input parameter, and having simple operation and higher verification efficiency. When the necessary-filling input parameters are required to be adjusted according to actual demands, the necessary-filling identification of the necessary-filling input parameters recorded in the interface standard file is directly deleted, and the configurability and the practicability are high.

Description

Interface parameter verification method, device, equipment and medium
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a medium for verifying an interface parameter.
Background
At present, data transmission is generally performed between systems and between subsystems in the systems by using interfaces, and in order to ensure smooth data transmission, the interfaces may be tested before the data transmission is performed by using the interfaces, where test contents of the interface test mainly include: filling checking of interface parameters, normalization checking, validity checking and the like.
In practical application, the necessary filling check of the interface parameters is an important link of the interface test, the necessary filling check of the interface parameters is needed first, and after the necessary filling check of the interface parameters is passed, the other checks such as the normalization check, the validity check and the like are performed on the interface parameters, however, in the prior art, the process of the necessary filling check of the interface parameters is relatively lengthy, the efficiency is relatively low, and the problem that needs to be considered currently is how to simplify the checking process of the necessary filling check of the interface parameters and improve the checking efficiency.
Disclosure of Invention
The embodiment of the application provides an interface parameter checking method, device, equipment and medium, which are used for solving the problems of lengthy interface parameter checking process and low checking efficiency in the prior art.
The technical scheme provided by the embodiment of the application is as follows:
In one aspect, an embodiment of the present application provides an interface parameter verification method, including:
receiving a data submitting request sent by an application through an interface, wherein the data submitting request at least comprises field names and field values of the field names, and the field names are used for representing input parameters of the interface;
obtaining each input parameter added with the necessary filling mark from an interface standard file of the interface to be used as an input parameter to be checked respectively;
screening out the field names matched with the parameter names of the input parameters to be checked from the field names contained in the data submitting request;
and respectively carrying out non-null check on the field values of the screened field names.
In one possible implementation, before receiving a data submission request sent by an application through an interface, the method further includes:
receiving an interface configuration instruction, wherein the interface configuration instruction at least comprises an interface identifier and an interface standard file, and the interface standard file is at least recorded with a parameter name of each input parameter and a filling-necessary identifier added for the input parameter which is necessary to be filled in each input parameter;
and carrying out associated storage on the interface identification and the interface configuration file contained in the interface configuration instruction.
In one possible implementation manner, each input parameter added with the necessary filling identifier is obtained from an interface standard file of the interface and used as an input parameter to be verified, and the method comprises the following steps:
acquiring a corresponding interface standard file according to the interface identification of the interface;
and screening out all the input parameters added with the necessary filling identification from all the input parameters recorded in the interface standard file, wherein the input parameters are used as input parameters to be checked respectively.
In one possible implementation manner, performing non-null verification on the field value of each screened field name respectively includes:
for each screened field name, detecting whether the field value of the field name is null, if the field value of the field name is detected to be null, determining that the non-null check of the input parameter represented by the field name is not passed, and if the field value of the field name is detected to be not null, determining that the non-null check of the input parameter represented by the field name is passed.
In a possible implementation manner, the method for checking the interface parameters provided in the embodiment of the present application further includes:
if the non-empty verification of any input parameter of the interface is determined to be not passed, returning error prompt information to the application based on any input parameter;
and if the non-empty verification of each input parameter of the interface is determined to pass, performing content verification on each input parameter of the interface.
In a possible implementation manner, the method for checking the interface parameters provided in the embodiment of the present application further includes:
receiving an interface parameter updating instruction, wherein the interface parameter updating instruction at least comprises an interface identifier, a parameter updating type and a parameter name of each input parameter to be updated;
based on the interface identifier contained in the interface parameter updating instruction, acquiring a corresponding interface standard file;
and updating the interface standard file based on the parameter updating type and the parameter names of the input parameters to be updated contained in the interface parameter updating instruction.
In one possible implementation, updating the interface standard file based on the parameter update type and the parameter name of each input parameter to be updated included in the interface parameter update instruction includes:
if the parameter updating type is newly added and necessary filled input parameters, adding the parameter name of each input parameter to be updated into each input parameter recorded in the interface standard file, and adding necessary filling identification for each input parameter to be updated respectively;
if the parameter update type is to delete the necessary input parameters, deleting the parameter names and the necessary marks of the input parameters to be updated from the input parameters recorded in the interface standard file.
In another aspect, an embodiment of the present application provides an interface parameter checking apparatus, including:
the request receiving unit is used for receiving a data submitting request sent by an application through an interface, wherein the data submitting request at least comprises field names and field values of the field names, and the field names are used for representing input parameters of the interface;
the parameter acquisition unit is used for acquiring each input parameter added with the necessary filling mark from the interface standard file of the interface as the input parameter to be checked;
and the non-empty verification unit is used for screening out the field names matched with the parameter names of the input parameters to be verified from the field names contained in the data submitting request, and respectively carrying out non-empty verification on the field values of the screened field names.
In a possible implementation manner, the interface parameter verification apparatus provided in the embodiment of the present application further includes:
the associated storage unit is used for receiving the interface configuration instruction and carrying out associated storage on the interface identifier and the interface configuration file contained in the interface configuration instruction, wherein the interface configuration instruction at least contains the interface identifier and the interface standard file, and the interface standard file at least records the parameter name of each input parameter and the filling-necessary identifier added for the filling-necessary input parameter in each input parameter.
In one possible implementation manner, when each input parameter added with the necessary identifier is obtained from the interface standard file of the interface and taken as the input parameter to be verified, the parameter obtaining unit is specifically configured to:
acquiring a corresponding interface standard file according to the interface identification of the interface;
and screening out all the input parameters added with the necessary filling identification from all the input parameters recorded in the interface standard file, wherein the input parameters are used as input parameters to be checked respectively.
In one possible implementation manner, when the field values of the screened field names are respectively subjected to non-null verification, the non-null verification unit is specifically configured to:
for each screened field name, detecting whether the field value of the field name is null, if the field value of the field name is detected to be null, determining that the non-null check of the input parameter represented by the field name is not passed, and if the field value of the field name is detected to be not null, determining that the non-null check of the input parameter represented by the field name is passed.
In a possible implementation manner, the interface parameter verification apparatus provided in the embodiment of the present application further includes:
the error prompting unit is used for returning error prompting information to the application based on any input parameter if the non-empty checking unit determines that the non-empty checking of any input parameter of the interface is not passed;
And the content verification unit is used for carrying out content verification on each input parameter of the interface if the non-empty verification unit determines that the non-empty verification of each input parameter of the interface is passed.
In a possible implementation manner, the interface parameter verification apparatus provided in the embodiment of the present application further includes:
the parameter updating unit is used for receiving an interface parameter updating instruction, wherein the interface parameter updating instruction at least comprises an interface identifier, a parameter updating type and a parameter name of each input parameter to be updated; based on the interface identifier contained in the interface parameter updating instruction, acquiring a corresponding interface standard file; and updating the interface standard file based on the parameter updating type and the parameter names of the input parameters to be updated contained in the interface parameter updating instruction.
In one possible implementation manner, when updating the interface standard file based on the parameter update type and the parameter name of each input parameter to be updated, which are included in the interface parameter update instruction, the parameter update unit is specifically configured to:
if the parameter updating type is newly added and necessary filled input parameters, adding the parameter name of each input parameter to be updated into each input parameter recorded in the interface standard file, and adding necessary filling identification for each input parameter to be updated respectively;
If the parameter update type is to delete the necessary input parameters, deleting the parameter names and the necessary marks of the input parameters to be updated from the input parameters recorded in the interface standard file.
In another aspect, an embodiment of the present application provides an interface parameter verification apparatus, including: the system comprises a memory, a processor and a computer program stored in the memory and capable of running on the processor, wherein the processor executes the computer program to realize the interface parameter checking method provided by the embodiment of the application.
On the other hand, the embodiment of the application also provides a computer readable storage medium, and the computer readable storage medium stores computer instructions which are executed by the processor to realize the interface parameter verification method provided by the embodiment of the application.
The beneficial effects of the embodiment of the application are as follows:
in the embodiment of the application, the necessary-filling identification is added to each input parameter of the interface in the interface standard file of the interface, so that when the data submitting request sent by the application through the interface is received, each input parameter added with the necessary-filling identification can be obtained from the interface standard file of the interface, and according to the obtained parameter name of each input parameter, the field value of the corresponding field name in the data submitting request is subjected to non-empty verification, so that the operation is simple, and the verification efficiency is higher.
Additional features and advantages of the application will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the application. The objectives and other advantages of the application will be realized and attained by the structure particularly pointed out in the written description and claims thereof as well as the appended drawings.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiments of the application and together with the description serve to explain the application and do not constitute an undue limitation to the application. In the drawings:
FIG. 1 is a schematic diagram of a system frame of an interface parameter verification system according to an embodiment of the present application;
FIG. 2 is a schematic flow chart of an interface parameter checking method according to an embodiment of the present application;
FIG. 3 is a schematic flowchart of a method for checking interface parameters according to an embodiment of the present application;
FIG. 4 is a schematic functional structure diagram of an interface parameter checking device according to an embodiment of the present application;
fig. 5 is a schematic hardware structure of an interface parameter checking device in an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantageous effects of the present application more clear, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only some embodiments, but not all embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
In order to facilitate a better understanding of the present application, technical terms related to the present application will be briefly described below.
1. An application, which is an application program that can be installed on a terminal device such as a mobile phone, a computer, a personal digital assistant (Personal Digital Assistant, PDA), etc., in this application, refers to an application program that provides a group insurance application service for a user and supports user interaction, including but not limited to: a group insurance application light application, a group insurance application APP, a group insurance application online mall and the like.
2. And the application server is background operation equipment for managing the application and providing various services such as computing service, database service and the like for the application.
3. A underwriting system, a system for auditing application data transmitted by an application, including but not limited to: and the core protection server and the core protection platform are arranged on terminal equipment such as mobile phones, computers, PDAs and the like.
4. The data checking device is used for checking various items such as filling checking, normalization checking, validity checking and the like for the application data sent by the application.
5. An interface, which is a medium for transmitting data between systems and between subsystems in the system, in this application refers to a medium for transmitting application data and a core protection system, including but not limited to: a customs clearance interface, a insured person interface, and an applicant interface, etc.
6. The interface standard file is a file recorded with relevant interface information such as an address of an interface, a parameter name and a parameter type of each input parameter, and in the application, a filling-necessary identifier which is respectively added for each input parameter to be filled is also recorded in the interface standard file.
After technical terms related to the application are introduced, application scenes and design ideas of the embodiment of the application are briefly introduced.
At present, in order to realize the necessary filling verification of the interface parameters, a method is generally adopted, namely necessary filling verification logic is respectively configured for each input parameter of an interface, when a data submitting request sent by an application through the interface is received, the necessary filling verification logic is respectively configured for each input parameter of the interface, and each input parameter of the interface is sequentially subjected to necessary filling verification.
Therefore, with reference to the foregoing problem, referring to fig. 1, in this embodiment of the present application, an application 120 installed on a terminal device 110 is communicatively connected with an application server 130, a data checking device 140 and a kernel protection system 150 through a communication network, where in the kernel protection system 150, a kernel protection platform 151 installed on the terminal device 110 is communicatively connected with the kernel protection server 152 through the communication network, in an actual application, an application user may fill in application 120 installed on the terminal device 110 with the application data, according to a user operation, when the application 120 installed on the terminal device 110 determines that the application user has completed filling in of the application data, according to a type of the application data, a corresponding interface is called, the application data is carried in a field name-field value form in a data submission request and sent to the data checking device 140, when the data checking device 140 receives a data submission request sent by the application 120, each input parameter added with a necessary filling identifier is obtained from an interface standard file of the interface as an input parameter to be checked, in each field name contained in the data submission request, a parameter to be checked by each input parameter to be checked, when the verification parameter of each field name to be checked is checked, each field name is checked, and when the validity of each input parameter is checked by each field is checked, and each field name is checked, and the input is not matched by each interface is determined, and when the validity of each field name is checked, and the input parameter is determined. Therefore, by adding the filling-necessary identification into the interface standard file of the interface, when receiving the data submitting request sent by the application through the interface, each input parameter added with the filling-necessary identification can be obtained from the interface standard file of the interface, so that the field value of the corresponding field name in the data submitting request is subjected to non-empty verification according to the obtained parameter name of each input parameter, the operation is simple, and the verification efficiency is higher.
It should be understood that, in fig. 1, the number of the applications 120, the application server 130, the data verification device 140, and the kernel security platform 150 and the kernel security server 152 installed on the terminal device 110 in the kernel security system 150 are only illustrative, and may be arbitrarily configured according to actual requirements, which is not limited in this application.
After the application scenario and the design idea of the embodiment of the present application are introduced, the technical solution provided by the embodiment of the present application is described below.
The embodiment of the application provides an interface parameter verification method, in the interface parameter verification method, a configurator is required to configure an interface standard file containing relevant interface information such as an address of the interface, a parameter name of each input parameter, a parameter type and the like for the interface in advance through an interface file management tool such as Swagger and the like, and add a necessary filling mark for each necessary filling input parameter in each input parameter recorded in the interface standard file according to actual requirements, and when the configuration of the interface standard file of the interface is completed, the interface mark and the interface standard file of the interface can be carried in an interface configuration instruction through the interface file management tool such as Swagger and the like and sent to a data verification device 140; when the data checking device 140 receives the interface configuration instruction, the interface identifier and the interface configuration file contained in the interface configuration instruction may be stored in association, so as to complete the initialization configuration of the interface standard file.
Further, after the initialization configuration of the interface standard file is completed, the interface parameter verification method provided by the embodiment of the present application may be used to verify the interface parameter, where the interface parameter verification method provided by the embodiment of the present application may be applied to the data verification device 140 in the interface parameter verification system shown in fig. 1, and specifically, referring to fig. 2, the flow of the interface parameter verification method provided by the embodiment of the present application is as follows:
step 201: the receiving application 120 sends a data submission request through the interface, where the data submission request includes at least field names and field values of the field names, and the field names are used to characterize the input parameters of the interface.
In practical application, the application user may fill in the application 120 installed on the terminal device 110 with the application data, and when the application 120 installed on the terminal device 110 determines that the application user has completed filling in the application data according to the user operation, according to the type of the application data, a corresponding interface is called, and the application data is carried in a field name-field value form in a data submitting request and sent to the data checking device 140, so that the data checking device 140 receives the data submitting request sent by the application 120 through the interface.
For example: the application user may fill in the application 120 installed on the terminal device 110 with the applicant data, and when the application 120 installed on the terminal device 110 determines that the application user has completed filling in the applicant data according to the user operation, the application interface is called, and the applicant data is carried in the form of field name-field value in the data submitting request and is sent to the data checking device 140, so that the data checking device 140 receives the data submitting request sent by the application 120 through the application interface.
Another example is: the user may fill in the insured data in the application 120 installed on the terminal device 110, and when the application 120 installed on the terminal device 110 determines that the user has completed filling in the insured data according to the user operation, the insured interface is called, and the insured data is carried in the form of field name-field value in the data submitting request and is sent to the data checking device 140, so that the data checking device 140 receives the data submitting request sent by the application 120 through the insured interface.
And the following steps: the application user may fill in the form data in the application 120 installed on the terminal device 110, and when the application 120 installed on the terminal device 110 determines that the application user has completed filling in the form data according to the user operation, the application 120 invokes the form interface, carries the form data in the form of field name-field value in the data submitting request, and sends the form data to the data checking device 140, so that the data checking device 140 receives the data submitting request sent by the application 120 through the form interface.
Step 202: and obtaining each input parameter added with the necessary filling identification from the interface standard file of the interface as the input parameter to be checked.
In practical application, when the data verification device 140 obtains each input parameter added with the necessary identifier from the interface standard file of the interface as the input parameter to be verified, the following manner may be adopted, but is not limited to:
the data verification device 140 obtains a corresponding interface standard file according to the interface identifier of the interface, and screens out each input parameter added with the necessary identifier from each input parameter recorded in the interface standard file to be used as the input parameter to be verified.
For example: assuming that the data submitting request is transmitted through the applicant interface, the data verification device 140 may obtain an interface standard file of the applicant interface according to the interface identifier of the applicant interface, and filter out each input parameter added with the necessary identifier from each input parameter recorded in the interface standard file of the applicant interface, where each input parameter is used as an input parameter to be verified.
Another example is: assuming that the data submitting request is transmitted through the protected interface, the data verification device 140 may obtain the interface standard file of the protected interface according to the interface identifier of the protected interface, and filter out each input parameter added with the necessary identifier from each input parameter recorded in the interface standard file of the protected interface, where each input parameter is used as an input parameter to be verified.
And the following steps: assuming that the data submitting request is transmitted through the gateway interface, the data checking device 140 may obtain the interface standard file of the gateway interface according to the interface identifier of the gateway interface, and screen out each input parameter added with the identifier to be checked from each input parameter recorded in the interface standard file of the gateway interface.
Step 203: and screening out the field names matched with the parameter names of the input parameters to be checked from the field names contained in the data submitting request.
In practical application, the data verification device 140 may screen out, for each parameter name of the input parameter to be verified, a field name matching with the parameter name of the input parameter to be verified from the field names included in the data submission request, so as to obtain the field names respectively matching with the parameter names of the input parameters to be verified.
Step 204: and respectively carrying out non-null check on the field values of the screened field names.
In practical applications, when the data checking device 140 performs non-null checking on the field values of the screened field names, the following methods may be used, but are not limited to:
For each selected field name, the data checking device 140 detects whether the field value of the field name is null, if the field value of the field name is detected to be null, determines that the non-null check of the input parameter represented by the field name fails, and if the field value of the field name is detected to be non-null, determines that the non-null check of the input parameter represented by the field name fails.
Further, in the process of performing non-empty verification on the field values of the screened field names, the data verification device 140 may return, based on any input parameter of the interface, error prompt information to the application 120 if it is determined that the non-empty verification of any input parameter is not passed, for example: an error indication that some of the mandatory fields are empty may be returned to the application 120. Of course, if it is determined that the non-empty verification of each input parameter of the interface passes, the data verification device 140 may perform content verification such as normalization verification and validity verification on each input parameter of the interface, and when it is determined that the content verification of each input parameter of the interface passes, may send each input parameter of the interface to the kernel protection system 150 for performing operations such as manual verification. So far, the interface parameter checking flow is ended.
It is worth mentioning that, in the process of verifying the interface parameters by the data verification device 140, the configurator can also adjust the necessary-filled input parameters recorded by the interface standard file through the interface file management tool such as Swagger according to the actual needs, specifically, the configurator can carry the information such as the interface identifier, the parameter update type and the parameter name of each input parameter to be updated in the interface parameter update instruction through the interface file management tool such as Swagger, and send the information to the data verification device 140; when the data checking device 140 receives the interface parameter updating instruction, it may acquire a corresponding interface standard file based on the interface identifier included in the interface parameter updating instruction, and update the interface standard file based on the parameter updating type included in the interface parameter updating instruction and the parameter name of each input parameter to be updated.
Specifically, when updating the interface standard file based on the parameter update type and the parameter name of each input parameter to be updated, which are included in the interface parameter update instruction, the data verification device 140 may use, but is not limited to, the following ways:
if the data checking device 140 determines that the parameter update type is the newly added and necessary-filled input parameter, the parameter name of each input parameter to be updated can be added to each input parameter recorded in the interface standard file, and necessary-filled identifiers are respectively added to each input parameter to be updated;
If the data checking device 140 determines that the parameter update type is to delete the necessary input parameters, the parameter name and the necessary identifier of each input parameter to be updated may be deleted from each input parameter recorded in the interface standard file.
In this way, when the necessary-to-be-filled input parameters of a certain interface need to be adjusted according to actual requirements, the interface identifier, the parameter update type, the parameter names of the input parameters to be updated and other information of the interface are carried in the interface parameter update instruction and sent to the data checking device 140 through the interface file management tool such as Swagger, so that the necessary-to-be-filled input parameters of the interface can be deleted, and the configurability and the practicability are high.
Taking the example of checking the interface parameters of the applicant interface in the application scenario of group insurance application, the method for checking the interface parameters provided in the embodiment of the present application is described in further detail, and referring to fig. 3, the specific flow of the method for checking the interface parameters provided in the embodiment of the present application is as follows:
step 301: the group insurance application 120 invokes the applicant interface when determining that the user has completed filling the applicant data according to the user operation, and sends the applicant data in the form of field name-field value carried in the data submission request to the data verification device 140.
Step 302: when the data verification device 140 receives a data submitting request sent by the group insurance application 120 through the insurance applicant interface, an interface standard file of the insurance applicant interface is obtained according to the interface identifier of the insurance applicant interface.
Step 303: the data verification device 140 screens out each input parameter added with the necessary filling identification from each input parameter recorded in the interface standard file of the applicant interface, and takes each input parameter added with the necessary filling identification as the input parameter to be verified.
Step 304: the data verification device 140 filters out the field names matched with the parameter names of the input parameters to be verified from the field names contained in the data submitting request.
Step 305: the data checking device 140 detects whether the field value of the field name is null for each selected field name, and determines whether the non-null check of the input parameter represented by the field name passes according to the detection result.
Specifically, the data verification device 140 may determine that the non-empty verification of the input parameter represented by the field name fails if the field value of the field name is detected to be empty, and may determine that the non-empty verification of the input parameter represented by the field name fails if the field value of the field name is detected to be not empty.
Step 306: the data checking device 140 determines whether the non-empty checks of the input parameters of the interface pass, if yes, step 307 is executed; if not, go to step 308.
Step 307: the data verification device 140 performs content verification such as normalization verification and validity verification on each input parameter of the interface.
Further, when determining that the content verification of each input parameter of the interface is passed, the data verification device 140 may send each input parameter of the interface to the kernel protection system 150 for performing operations such as manual verification.
Step 308: the data verification device 140 returns error prompt information to the group insurance application 120 based on the input parameters that are not passed by the non-empty verification.
Based on the foregoing embodiments, the embodiment of the present application provides an interface parameter verification apparatus, and the interface parameter verification method may be applied to the data verification apparatus 140 in the interface parameter verification system shown in fig. 1, and referring to fig. 4, the interface parameter verification apparatus 400 provided in the embodiment of the present application at least includes:
a request receiving unit 401, configured to receive a data submission request sent by an application through an interface, where the data submission request at least includes field names and field values of the field names, and the field names are used to characterize input parameters of the interface;
A parameter obtaining unit 402, configured to obtain, from an interface standard file of an interface, each input parameter added with a mark to be filled as an input parameter to be verified;
and the non-null verification unit 403 is configured to screen out field names that are respectively matched with the parameter names of the input parameters to be verified from the field names included in the data submission request, and perform non-null verification on the field values of the screened field names.
In a possible implementation manner, the interface parameter verification apparatus provided in the embodiment of the present application further includes:
the association storage unit 404 is configured to receive an interface configuration instruction, and store an interface identifier and an interface configuration file included in the interface configuration instruction in an associated manner, where the interface configuration instruction at least includes an interface identifier and an interface standard file, and the interface standard file at least records a parameter name of each input parameter and a filling-necessary identifier added for a filling-necessary input parameter in each input parameter.
In one possible implementation manner, when each input parameter added with the necessary identifier is obtained from the interface standard file of the interface as the input parameter to be verified, the parameter obtaining unit 402 is specifically configured to:
Acquiring a corresponding interface standard file according to the interface identification of the interface;
and screening out all the input parameters added with the necessary filling identification from all the input parameters recorded in the interface standard file, wherein the input parameters are used as input parameters to be checked respectively.
In one possible implementation manner, when performing non-null verification on the field values of the screened field names, the non-null verification unit 403 is specifically configured to:
for each screened field name, detecting whether the field value of the field name is null, if the field value of the field name is detected to be null, determining that the non-null check of the input parameter represented by the field name is not passed, and if the field value of the field name is detected to be not null, determining that the non-null check of the input parameter represented by the field name is passed.
In a possible implementation manner, the interface parameter verification apparatus provided in the embodiment of the present application further includes:
an error prompting unit 405, configured to return error prompting information to the application based on any input parameter if the non-empty verification unit 403 determines that the non-empty verification of any input parameter of the interface is not passed;
and the content verification unit 406 is configured to perform content verification on each input parameter of the interface if the non-empty verification unit 403 determines that the non-empty verification of each input parameter of the interface passes.
In a possible implementation manner, the interface parameter verification apparatus provided in the embodiment of the present application further includes:
a parameter updating unit 407, configured to receive an interface parameter updating instruction, where the interface parameter updating instruction at least includes an interface identifier, a parameter updating type, and a parameter name of each input parameter to be updated; based on the interface identifier contained in the interface parameter updating instruction, acquiring a corresponding interface standard file; and updating the interface standard file based on the parameter updating type and the parameter names of the input parameters to be updated contained in the interface parameter updating instruction.
In one possible implementation, when updating the interface standard file based on the parameter update type and the parameter name of each input parameter to be updated, which are included in the interface parameter update instruction, the parameter update unit 407 is specifically configured to:
if the parameter updating type is newly added and necessary filled input parameters, adding the parameter name of each input parameter to be updated into each input parameter recorded in the interface standard file, and adding necessary filling identification for each input parameter to be updated respectively;
if the parameter update type is to delete the necessary input parameters, deleting the parameter names and the necessary marks of the input parameters to be updated from the input parameters recorded in the interface standard file.
It should be noted that, the principle of the interface parameter checking device 400 provided in the embodiment of the present application to solve the technical problem is similar to that of the interface parameter checking method provided in the embodiment of the present application, so that the implementation of the interface parameter checking device 400 provided in the embodiment of the present application may refer to the implementation of the interface parameter checking method provided in the embodiment of the present application, and the repetition is omitted.
After the method and the device for checking the interface parameters provided by the embodiment of the application are introduced, the device for checking the interface parameters provided by the embodiment of the application is briefly introduced.
An embodiment of the present application provides an interface parameter verification device, referring to fig. 5, where the interface parameter verification device 500 at least includes: the processor 501, the memory 502 and the computer program stored in the memory 502 and capable of running on the processor 501 implement the interface parameter checking method provided in the embodiment of the present application when the processor 501 executes the computer program.
It should be noted that, the interface parameter verification apparatus 500 shown in fig. 5 is only an example, and should not impose any limitation on the functions and application scope of the embodiments of the present application.
The interface parameter verification apparatus 500 provided in the embodiment of the present application may further include a bus 503 connecting different components (including a processor 501 and a memory 502). Where bus 503 represents one or more of several types of bus structures, including a memory bus, a peripheral bus, a local bus, and so forth.
The Memory 502 may include readable media in the form of volatile Memory, such as random access Memory (Random Access Memory, RAM) 5021 and/or cache Memory 5022, and may further include Read Only Memory (ROM) 5023.
The memory 502 may also include a program tool 5025 having a set (at least one) of program modules 5024, the program modules 5024 including, but not limited to: an operating subsystem, one or more application programs, other program modules, and program data, each or some combination of which may include an implementation of a network environment.
The interface parameter verification device 500 may also be in communication with one or more external devices 504 (e.g., keyboard, remote control, etc.), one or more devices that enable a user to interact with the interface parameter verification device 500 (e.g., cell phone, computer, etc.), and/or any device that enables the interface parameter verification device 500 to communicate with one or more other interface parameter verification devices 500 (e.g., router, modem, etc.). Such communication may be through an Input/Output (I/O) interface 505. Also, the interface parameter verification apparatus 500 may communicate with one or more networks (e.g., a local area network (Local Area Network, LAN), a wide area network (Wide Area Network, WAN) and/or a public network, such as the internet) via the network adapter 506. As shown in fig. 5, the network adapter 506 communicates with other modules of the interface parameter verification apparatus 500 via the bus 503. It should be appreciated that although not shown in fig. 5, other hardware and/or software modules may be used in connection with interface parameter verification device 500, including, but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, disk array (Redundant Arrays of Independent Disks, RAID) subsystems, tape drives, data backup storage subsystems, and the like.
Having described the method, apparatus and device for verifying interface parameters provided in the embodiments of the present application, a description is given next to a computer readable storage medium provided in the embodiments of the present application.
The embodiment of the application provides a computer readable storage medium, and the computer readable storage medium stores computer instructions which when executed by a processor implement the interface parameter verification method provided by the embodiment of the application. Specifically, the executable program may be built into or installed in the interface parameter verification apparatus 500, so that the interface parameter verification apparatus 500 may implement the interface parameter verification method provided in the embodiment of the present application by executing the built-in or installed executable program.
In addition, the method for checking an interface parameter provided in the embodiment of the present application may also be implemented as a program product, where the program product includes program code, and when the program product may be executed on the interface parameter checking device 500, the program code is used to cause the interface parameter checking device 500 to execute the method for checking an interface parameter provided in the embodiment of the present application.
The program product provided by the embodiments of the present application may employ any combination of one or more readable media, where the readable media may be a readable signal medium or a readable storage medium, and the readable storage medium may be, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof, and more specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a RAM, a ROM, an erasable programmable read-Only Memory (Erasable Programmable Read Only Memory, EPROM), an optical fiber, a portable compact disk read-Only Memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The program product provided by the embodiments of the present application may be implemented as a CD-ROM and include program code that may also be run on a computing device. However, the program product provided by the embodiments of the present application is not limited thereto, and in the embodiments of the present application, the readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
It should be noted that although several units or sub-units of the apparatus are mentioned in the above detailed description, such a division is merely exemplary and not mandatory. Indeed, the features and functions of two or more of the elements described above may be embodied in one element in accordance with embodiments of the present application. Conversely, the features and functions of one unit described above may be further divided into a plurality of units to be embodied.
Furthermore, although the operations of the methods of the present application are depicted in the drawings in a particular order, this is not required to or suggested that these operations must be performed in this particular order or that all of the illustrated operations must be performed in order to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step to perform, and/or one step decomposed into multiple steps to perform.
While preferred embodiments of the present application have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. It is therefore intended that the following claims be interpreted as including the preferred embodiments and all such alterations and modifications as fall within the scope of the application.
It will be apparent to those skilled in the art that various modifications and variations can be made to the embodiments of the present application without departing from the spirit and scope of the embodiments of the present application. Thus, if such modifications and variations of the embodiments of the present application fall within the scope of the claims and the equivalents thereof, the present application is intended to encompass such modifications and variations.

Claims (9)

1. An interface parameter checking method, comprising:
receiving a data submitting request sent by an application through an interface, wherein the data submitting request at least comprises each field name and a field value of each field name, and each field name is used for representing each input parameter of the interface;
obtaining each input parameter added with the necessary filling mark from an interface standard file of the interface to be used as an input parameter to be checked respectively;
screening out the field names matched with the parameter names of the input parameters to be checked from the field names contained in the data submitting request;
Respectively carrying out non-null check on the field values of the screened field names;
before receiving the data submitting request sent by the application through the interface, the method further comprises the following steps:
receiving an interface configuration instruction, wherein the interface configuration instruction at least comprises an interface identifier and an interface standard file, and the interface standard file is at least recorded with parameter names of all input parameters and filling-necessary identifiers added for filling-necessary input parameters in all the input parameters;
and carrying out association storage on the interface identifier and the interface configuration file contained in the interface configuration instruction.
2. The method for checking interface parameters according to claim 1, wherein obtaining each input parameter added with the necessary-to-be-checked identifier from an interface standard file of the interface as an input parameter to be checked, respectively, comprises:
acquiring a corresponding interface standard file according to the interface identification of the interface;
and screening out all the input parameters added with the necessary filling identification from all the input parameters recorded in the interface standard file, and taking the input parameters as the input parameters to be checked.
3. The method for checking interface parameters according to claim 1 or 2, wherein the step of checking field values of the respective field names screened out by the screening method for non-null checking includes:
And detecting whether the field value of each field name is empty or not according to each screened field name, if so, determining that the non-empty verification of the input parameter represented by the field name fails, and if not, determining that the non-empty verification of the input parameter represented by the field name fails.
4. The interface parameter verification method of claim 3, further comprising:
if the non-empty verification of any input parameter of the interface is determined to be not passed, returning error prompt information to the application based on any input parameter;
and if the non-empty verification of each input parameter of the interface is determined to pass, performing content verification on each input parameter of the interface.
5. A method of checking interface parameters as claimed in claim 1 or 3, further comprising:
receiving an interface parameter updating instruction, wherein the interface parameter updating instruction at least comprises an interface identifier, a parameter updating type and a parameter name of each input parameter to be updated;
acquiring a corresponding interface standard file based on the interface identifier contained in the interface parameter updating instruction;
And updating the interface standard file based on the parameter updating type and the parameter names of the input parameters to be updated, which are contained in the interface parameter updating instruction.
6. The interface parameter verification method according to claim 5, wherein updating the interface standard file based on the parameter update type and the parameter name of each input parameter to be updated included in the interface parameter update instruction, comprises:
if the parameter updating type is newly added necessary filling input parameters, adding the parameter names of the input parameters to be updated into the input parameters recorded in the interface standard file, and adding necessary filling marks for the input parameters to be updated respectively;
and if the parameter updating type is to delete the necessary filling input parameters, deleting the parameter names and the necessary filling identifications of the input parameters to be updated from the input parameters recorded in the interface standard file.
7. An interface parameter checking device, comprising:
the receiving unit is used for receiving a data submitting request sent by an application through an interface, wherein the data submitting request at least comprises each field name and a field value of each field name, and each field name is used for representing each input parameter of the interface;
The acquisition unit is used for acquiring each input parameter added with the necessary filling mark from the interface standard file of the interface to be used as the input parameter to be checked respectively;
the verification unit is used for screening out the field names matched with the parameter names of the input parameters to be verified from the field names contained in the data submitting request, and carrying out non-empty verification on the field values of the screened field names;
the interface parameter checking device further comprises:
the associated storage unit is used for receiving the interface configuration instruction and carrying out associated storage on the interface identifier and the interface configuration file contained in the interface configuration instruction, wherein the interface configuration instruction at least contains the interface identifier and the interface standard file, and the interface standard file at least records the parameter name of each input parameter and the filling-necessary identifier added for the filling-necessary input parameter in each input parameter.
8. An interface parameter verification apparatus, comprising: memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the interface parameter verification method according to any one of claims 1-6 when executing the computer program.
9. A computer readable storage medium storing computer instructions which, when executed by a processor, implement the interface parameter verification method of any one of claims 1-6.
CN202010074223.8A 2020-01-22 2020-01-22 Interface parameter verification method, device, equipment and medium Active CN111258832B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010074223.8A CN111258832B (en) 2020-01-22 2020-01-22 Interface parameter verification method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010074223.8A CN111258832B (en) 2020-01-22 2020-01-22 Interface parameter verification method, device, equipment and medium

Publications (2)

Publication Number Publication Date
CN111258832A CN111258832A (en) 2020-06-09
CN111258832B true CN111258832B (en) 2023-06-20

Family

ID=70954406

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010074223.8A Active CN111258832B (en) 2020-01-22 2020-01-22 Interface parameter verification method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN111258832B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112148540B (en) * 2020-08-27 2023-03-24 云账户技术(天津)有限公司 Interface parameter checking method and device, electronic equipment and readable storage medium
CN114116039A (en) * 2020-08-31 2022-03-01 北京比特大陆科技有限公司 Data processing apparatus configuration method, data processing apparatus, and computer-readable storage medium
CN112306879A (en) * 2020-11-02 2021-02-02 平安普惠企业管理有限公司 Interface parameter checking method, device, equipment and storage medium
CN112395194B (en) * 2020-11-17 2024-03-22 中国建设银行股份有限公司 Method and device for accessing test platform

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2001059585A1 (en) * 2000-02-08 2001-08-16 Clearwater Networks, Inc. Queueing system for processors in packet routing operations
CN104866743A (en) * 2015-05-07 2015-08-26 北京金山安全软件有限公司 Method and device for calling interface in browser
CN105099692A (en) * 2014-05-22 2015-11-25 阿里巴巴集团控股有限公司 Safety verification method, device, server and terminal
CN107798128A (en) * 2017-11-14 2018-03-13 泰康保险集团股份有限公司 Data lead-in method, device, medium and electronic equipment
CN109101812A (en) * 2018-08-28 2018-12-28 北京神州绿盟信息安全科技股份有限公司 A kind of parameter verification method, apparatus, computing device and storage medium
CN109446072A (en) * 2018-09-27 2019-03-08 深圳壹账通智能科技有限公司 The generation method and device of test script
CN109815013A (en) * 2019-01-02 2019-05-28 深圳壹账通智能科技有限公司 Business data processing method, device, computer equipment and storage medium
CN110427735A (en) * 2019-07-31 2019-11-08 上海联影医疗科技有限公司 A kind of method of calibration, device, server and storage medium
CN110633160A (en) * 2019-08-22 2019-12-31 浙江大搜车软件技术有限公司 Interface calling method and device, computer equipment and storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030023555A1 (en) * 2001-07-26 2003-01-30 Cashworks, Inc. Method and system for providing financial services
US8297498B2 (en) * 2007-09-28 2012-10-30 Visa U.S.A. Inc. Automated submission of prepaid programs
CN101616136B (en) * 2008-06-26 2013-05-01 阿里巴巴集团控股有限公司 Method for supplying internet service and service integrated platform system
JP5671056B2 (en) * 2009-12-16 2015-02-18 コーニンクレッカ フィリップス エヌ ヴェ Universal medical device driver adapter

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2001059585A1 (en) * 2000-02-08 2001-08-16 Clearwater Networks, Inc. Queueing system for processors in packet routing operations
CN105099692A (en) * 2014-05-22 2015-11-25 阿里巴巴集团控股有限公司 Safety verification method, device, server and terminal
CN104866743A (en) * 2015-05-07 2015-08-26 北京金山安全软件有限公司 Method and device for calling interface in browser
CN107798128A (en) * 2017-11-14 2018-03-13 泰康保险集团股份有限公司 Data lead-in method, device, medium and electronic equipment
CN109101812A (en) * 2018-08-28 2018-12-28 北京神州绿盟信息安全科技股份有限公司 A kind of parameter verification method, apparatus, computing device and storage medium
CN109446072A (en) * 2018-09-27 2019-03-08 深圳壹账通智能科技有限公司 The generation method and device of test script
CN109815013A (en) * 2019-01-02 2019-05-28 深圳壹账通智能科技有限公司 Business data processing method, device, computer equipment and storage medium
CN110427735A (en) * 2019-07-31 2019-11-08 上海联影医疗科技有限公司 A kind of method of calibration, device, server and storage medium
CN110633160A (en) * 2019-08-22 2019-12-31 浙江大搜车软件技术有限公司 Interface calling method and device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN111258832A (en) 2020-06-09

Similar Documents

Publication Publication Date Title
CN111258832B (en) Interface parameter verification method, device, equipment and medium
US11449379B2 (en) Root cause and predictive analyses for technical issues of a computing environment
CN108628748B (en) Automatic test management method and automatic test management system
CN112183782B (en) Fault work order processing method and equipment
CN111242462B (en) Data processing method and device, computer storage medium and electronic equipment
CN111260465A (en) Business processing method, device, server and storage medium
CN113612766B (en) Data management device, method, computer equipment and storage medium
CN112559635B (en) Service processing method, device, equipment and medium for Ethernet alliance chain node
CN110851471A (en) Distributed log data processing method, device and system
WO2022068316A1 (en) Data reconciliation method and apparatus, device, and storage medium
CN112631924A (en) Automatic testing method and device, computer equipment and storage medium
US8484724B2 (en) User permissions in computing systems
CN113220633A (en) Unified file coding management method and system
CN115168341A (en) Service processing method, system, medium and equipment
CN112613288B (en) Method, device, computer equipment and storage medium for generating bill
CN112561690A (en) Method, system, equipment and storage medium for testing credit card staging service interface
CN112685077A (en) Data modification method, system, computer device and computer readable storage medium
CN114385722A (en) Interface attribute consistency checking method and device, electronic equipment and storage medium
CN114037523A (en) Letter service test method, device, equipment, medium and program product
US7516048B2 (en) Externalized metric calculation engine
CN116467156A (en) Joint debugging test method and device, storage medium and electronic equipment
CN112416713A (en) Operation auditing system and method, computer readable storage medium and electronic equipment
CN112711628A (en) Data interaction method, device and central station
CN111901299A (en) Application authentication method and device, electronic equipment and storage medium
CN112801772B (en) Trusted method, trusted processing system, electronic 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
GR01 Patent grant
GR01 Patent grant