CN111258832A - Interface parameter checking method, device, equipment and medium - Google Patents

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

Info

Publication number
CN111258832A
CN111258832A CN202010074223.8A CN202010074223A CN111258832A CN 111258832 A CN111258832 A CN 111258832A CN 202010074223 A CN202010074223 A CN 202010074223A CN 111258832 A CN111258832 A CN 111258832A
Authority
CN
China
Prior art keywords
interface
parameter
input parameter
input
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.)
Granted
Application number
CN202010074223.8A
Other languages
Chinese (zh)
Other versions
CN111258832B (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 used for solving the problems of long interface parameter checking process and low checking efficiency in the prior art. The method specifically comprises the following steps: the method comprises the steps of adding a necessary filling mark to each input parameter to be filled in an interface standard file of an interface, obtaining each input parameter added with the necessary filling mark from the interface standard file of the interface when a data submission request sent by the application through the interface is received, and performing non-empty verification on a field value of a corresponding field name in the data submission request according to the obtained parameter name of each input parameter. Moreover, when each necessary input parameter needs to be adjusted according to actual requirements, the necessary filling mark of each necessary filling input parameter recorded in the interface standard file is directly deleted, and the configurability and the practicability are strong.

Description

Interface parameter checking method, device, equipment and medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a medium for checking an interface parameter.
Background
At present, data transmission is generally performed between systems and between subsystems inside the systems by using interfaces, and in order to ensure smooth data transmission, before data transmission is performed by using the interfaces, the interfaces may be tested, where the test content of the interface test mainly includes: mandatory verification, normative verification, legality verification and the like of the interface parameters.
In practical application, the mandatory check of the interface parameters is an important link of the interface test, the mandatory check of the interface parameters needs to be performed first, and after the mandatory check of the interface parameters passes, other checks such as normative check and legality check are performed on the interface parameters.
Disclosure of Invention
The embodiment of the application provides an interface parameter checking method, an interface parameter checking device, interface parameter checking equipment and an interface parameter checking medium, and aims to solve the problems that in the prior art, an interface parameter checking process is long and checking efficiency is low.
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 checking method, including:
receiving a data submission request sent by an application through an interface, wherein the data submission 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 a necessary filling identifier from an interface standard file of an interface as an input parameter to be verified;
screening field names matched with the parameter names of the input parameters to be verified from the field names contained in the data submission request;
and respectively carrying out non-empty check on the field value of each screened field name.
In a possible implementation manner, 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 at least records the parameter name of each input parameter and a necessary filling identifier added to the necessary input parameter in each input parameter;
and storing the interface identification and the interface configuration file contained in the interface configuration instruction in an associated manner.
In a possible implementation manner, obtaining, from an interface standard file of an interface, each input parameter added with a must-fill identifier as an input parameter to be verified respectively includes:
acquiring a corresponding interface standard file according to the interface identifier of the interface;
and screening the input parameters added with the necessary filling marks from the input parameters recorded in the interface standard file to be used as input parameters to be verified respectively.
In a possible implementation, the non-null check is performed on the field values of the screened field names respectively, and the non-null check comprises the following steps:
and detecting whether the field value of the field name is null or not for each screened field name, if so, determining that the non-null check of the input parameter represented by the field name does not pass, and if not, determining that the non-null check of the input parameter represented by the field name passes.
In a possible implementation manner, the interface parameter verification method provided in the embodiment of the present application further includes:
if the non-empty check of any input parameter of the interface is determined not to pass, 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 interface parameter verification method 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;
acquiring a corresponding interface standard file based on an interface identifier contained in the interface parameter updating instruction;
and updating the interface standard file based on the parameter updating type contained in the interface parameter updating instruction and the parameter name of each input parameter to be updated.
In a possible embodiment, updating the interface standard file based on the parameter update type included in the interface parameter update instruction and the parameter name of each input parameter to be updated includes:
if the parameter updating type is the newly added and filled input parameter, adding the parameter name of each input parameter to be updated into each input parameter recorded in the interface standard file, and respectively adding a filling identifier for each input parameter to be updated;
and if the parameter updating type is to delete the input parameters which must be filled, deleting the parameter names and the filling marks of the input parameters to be updated from the input parameters recorded in the interface standard file.
On the other hand, an embodiment of the present application provides an interface parameter checking apparatus, including:
the device comprises a request receiving unit, a data submitting unit and a data processing unit, wherein the request receiving unit is used for receiving a data submitting request sent by an application through an interface, 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 identifier from an interface standard file of the interface as an input parameter to be verified;
and the non-null check unit is used for screening field names matched with the parameter names of the input parameters to be checked from the field names contained in the data submission request, and respectively carrying out non-null check on the field values of the screened field names.
In a possible implementation manner, the interface parameter checking apparatus provided in an embodiment of the present application further includes:
and the association storage unit is used for receiving the interface configuration instruction and performing association storage on the interface identifier and the interface configuration file contained in the interface configuration instruction, wherein the interface configuration instruction at least comprises the interface identifier and an interface standard file, and the interface standard file at least records the parameter name of each input parameter and a necessary filling identifier added to the input parameter which must be filled in each input parameter.
In a possible implementation manner, when obtaining, from an interface standard file of an interface, each input parameter added with a must-fill identifier as an input parameter to be verified, the parameter obtaining unit is specifically configured to:
acquiring a corresponding interface standard file according to the interface identifier of the interface;
and screening the input parameters added with the necessary filling marks from the input parameters recorded in the interface standard file to be used as input parameters to be verified respectively.
In a possible embodiment, when performing non-null check on the field values of the respective screened field names, the non-null check unit is specifically configured to:
and detecting whether the field value of the field name is null or not for each screened field name, if so, determining that the non-null check of the input parameter represented by the field name does not pass, and if not, determining that the non-null check of the input parameter represented by the field name passes.
In a possible implementation manner, the interface parameter checking apparatus provided in an embodiment of the present application further includes:
the error prompt unit is used for returning error prompt information to the application based on any input parameter if the non-null check unit determines that the non-null check of any input parameter of the interface fails;
and the content verification unit is used for verifying the content of 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 passes.
In a possible implementation manner, the interface parameter checking apparatus provided in an embodiment of the present application further includes:
the device comprises a parameter updating unit, a parameter updating unit and a parameter updating unit, wherein the parameter updating unit is used for receiving an interface parameter updating instruction, and 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 an interface identifier contained in the interface parameter updating instruction; and updating the interface standard file based on the parameter updating type contained in the interface parameter updating instruction and the parameter name of each input parameter to be updated.
In a possible embodiment, when the interface standard file is updated based on the parameter update type included in the interface parameter update instruction and the parameter name of each input parameter to be updated, the parameter update unit is specifically configured to:
if the parameter updating type is the newly added and filled input parameter, adding the parameter name of each input parameter to be updated into each input parameter recorded in the interface standard file, and respectively adding a filling identifier for each input parameter to be updated;
and if the parameter updating type is to delete the input parameters which must be filled, deleting the parameter names and the filling marks of the input parameters to be updated from the input parameters recorded in the interface standard file.
On the other hand, an embodiment of the present application provides an interface parameter checking device, including: the interface parameter verification method comprises a memory, a processor and a computer program which is stored on the memory and can run on the processor, wherein the interface parameter verification method provided by the embodiment of the application is realized when the processor executes the computer program.
On the other hand, an embodiment of the present application further provides a computer-readable storage medium, where computer instructions are stored, and when the computer instructions are executed by a processor, the interface parameter verification method provided in the embodiment of the present application is implemented.
The beneficial effects of the embodiment of the application are as follows:
in the embodiment of the application, the bound filling identifier is respectively added to each input parameter bound to be filled in the interface standard file of the interface, so that when a data submission request sent by the application through the interface is received, each input parameter bound to be filled in the interface standard file of the interface can be obtained, and the field value of the corresponding field name in the data submission request can be subjected to non-empty verification according to the parameter name of each obtained input parameter, so that the operation is simple, and the verification efficiency is high.
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 the practice of the application. The objectives and other advantages of the application may be realized and attained by the structure particularly pointed out in the written description and claims hereof 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 embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
FIG. 1 is a system framework diagram of an interface parameter verification system according to an embodiment of the present application;
FIG. 2 is a schematic flow chart illustrating an overview of an interface parameter checking method according to an embodiment of the present application;
fig. 3 is a schematic flowchart illustrating an exemplary interface parameter checking method according to an embodiment of the present disclosure;
fig. 4 is a schematic functional structure diagram of an interface parameter checking apparatus in an embodiment of the present application;
fig. 5 is a schematic diagram of a hardware structure of an interface parameter verification device in the embodiment of the present application.
Detailed Description
In order to make the purpose, technical solution and advantages of the present application more clearly and clearly understood, the technical solution in the embodiments of the present application will be described below in detail and completely with reference to the accompanying drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
To facilitate a better understanding of the present application by those skilled in the art, a brief description of the technical terms involved in the present application will be given below.
1. An application, which is an application that can be installed on a terminal device such as a mobile phone, a computer, a Personal Digital Assistant (PDA), and the like, in this application, the application refers to an application that provides a group insurance service for a user and supports user interaction, and includes but is not limited to: the application of group insurance application, the APP of group insurance application, the online shopping mall of group insurance application and the like.
2. And the application server is background running equipment for managing the application and providing various services such as computing service, database service and the like for the application.
3. An underwriting system is a system for auditing application data sent by an application, and includes but is not limited to: an underwriting server, an underwriting platform installed on terminal equipment such as a mobile phone, a computer and a PDA, and the like.
4. The data checking device is a device for checking the insurable data transmitted by the application such as mandatory check, normative check, legality check and the like.
5. The interface is a medium for data transmission between systems and between subsystems in the systems, and in the present application, the interface refers to a medium for transferring insurance application data between an application and an underwriting system, and includes but is not limited to: a policy interface, an insured 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 of each input parameter, a parameter type and the like.
After introducing the technical terms related to the present application, the following briefly introduces the application scenarios and design ideas of the embodiments of the present application.
At present, in order to implement mandatory check on interface parameters, a commonly adopted method is to configure mandatory check logic for each input parameter of an interface respectively, and when a data submission request sent by an application through the interface is received, the mandatory check is sequentially performed on each input parameter of the interface according to the mandatory check logic configured for each input parameter of the interface respectively.
Therefore, in view of the above problem, referring to fig. 1, in the embodiment of the present application, an application 120 installed on a terminal device 110 is communicatively connected to an application server 130, a data verification apparatus 140 and an underwriting system 150 through a communication network, wherein in the underwriting system 150, an underwriting platform 151 installed on the terminal device 110 is communicatively connected to an underwriting server 152 through the communication network, in an actual application, an insurance user can fill insurance application data in the application 120 installed on the terminal device 110, when the application 120 installed on the terminal device 110 determines that the insurance user has completed filling the insurance data according to a user operation, a corresponding interface is called according to a type of the insurance data, the insurance data is carried in a data submission request in a form of a field name-field value and sent to the data verification apparatus 140, when the data verification apparatus 140 receives the data submission request sent by the application 120, the method includes the steps of obtaining input parameters added with necessary filling marks from an interface standard file of the interface to be used as input parameters to be verified respectively, screening field names matched with the parameter names of the input parameters to be verified respectively from the field names contained in a data submission request, performing non-null verification on the field values of the screened field names respectively, performing content verification such as normative verification and legality verification on the input parameters of the interface when the non-null verification of the input parameters of the interface is determined to pass, and sending the input parameters of the interface to an underwriting system 150 to perform operations such as manual verification when the content verification of the input parameters of the interface is determined to pass. In this way, by adding the padding mark to each input parameter to be padded in the interface standard file of the interface, when a data submission request sent by the application through the interface is received, each input parameter added with the padding mark can be obtained from the interface standard file of the interface, and the field value of the corresponding field name in the data submission request can be checked in a non-empty mode according to the parameter name of each obtained input parameter.
It should be understood that, in fig. 1, the number of the application 120 installed on the terminal device 110, the application server 130, the data verification device 140, the underwriting platform 150 installed on the terminal device 110 in the underwriting system 150, and the underwriting server 152 is only illustrative, and any configuration may be performed according to actual needs, which is not limited in this application.
After introducing the application scenario and the design concept of the embodiment of the present application, the following describes a technical solution provided by the embodiment of the present application.
The embodiment of the application provides an interface parameter checking method, in the interface parameter checking method, a configuration person needs to configure an interface standard file containing address of an interface, parameter name of each input parameter, parameter type and other related interface information for the interface in advance through an interface file management tool such as Swagger and the like, and adds a necessary filling identifier for each input parameter to be filled in each input parameter recorded in the interface standard file according to actual requirements, and when the interface standard file configuration of the interface is completed, the interface identifier and the interface standard file of the interface are carried in an interface configuration instruction through the interface file management tool such as Swagger and the like and are sent to a data checking device 140; when the data verification device 140 receives the interface configuration instruction, the interface identifier and the interface configuration file included in the interface configuration instruction may be stored in an associated manner, 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 may be verified by using the interface parameter verification method provided in the embodiment of the present application, where the interface parameter verification method provided in 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 in the embodiment of the present application is as follows:
step 201: receiving a data submission request sent by the application 120 through the interface, wherein the data submission request at least includes 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.
In practical application, an application 120 installed on the terminal device 110 may fill in 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 user operation, a corresponding interface is called according to the type of the application data, and the application data is carried in a data submission request in a field name-field value form and sent to the data verification device 140, so that the data verification device 140 receives the data submission request sent by the application 120 through the interface.
For example: the application 120 installed on the terminal device 110 calls the applicant interface when determining that the application user has completed filling the applicant data according to the user operation, carries the applicant data in a data submission request in a field name-field value form and sends the data submission request to the data verification device 140, so that the data verification device 140 receives the data submission request sent by the application 120 through the applicant interface.
For another example: an insurance user can fill and write data of an insured person in an application 120 installed on a terminal device 110, when the application 120 installed on the terminal device 110 determines that the insurance user finishes filling the data of the insured person according to user operation, an insured person interface is called, the insured person data is carried in a data submission request in a field name-field value mode and is sent to a data verification device 140, and therefore the data verification device 140 receives the data submission request sent by the application 120 through the insured person interface.
The following steps are repeated: the application 120 installed on the terminal device 110 calls the policy interface when determining that the application 120 installed on the terminal device 110 has completed filling the policy data according to the user operation, and carries the policy data in the form of field name-field value in the data submission request to be sent to the data verification device 140, so that the data verification device 140 receives the data submission request sent by the application 120 through the policy interface.
Step 202: and obtaining each input parameter added with the necessary filling mark from the interface standard file of the interface as an input parameter to be verified respectively.
In practical application, when the data verification apparatus 140 obtains each input parameter added with the necessary padding identifier from the interface standard file of the interface as an input parameter to be verified, the following method 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 filling identifier from each input parameter recorded in the interface standard file as an input parameter to be verified.
For example: assuming that the data submission request is transmitted through the applicant interface, the data verification device 140 may obtain the interface standard file of the applicant interface according to the interface identifier of the applicant interface, and screen out each input parameter added with the necessary filling identifier from each input parameter recorded in the interface standard file of the applicant interface as the input parameter to be verified.
For another example: assuming that the data submission request is transmitted through the insured interface, the data verification apparatus 140 may obtain the interface standard file of the insured interface according to the interface identifier of the insured interface, and screen out each input parameter added with the necessary filling identifier from each input parameter recorded in the interface standard file of the insured interface as the input parameter to be verified.
The following steps are repeated: assuming that the data submission request is transmitted through the customs clearance interface, the data verification apparatus 140 may obtain the interface standard file of the customs clearance interface according to the interface identifier of the customs clearance interface, and screen out each input parameter added with the necessary filling identifier from each input parameter recorded in the interface standard file of the customs clearance interface as the input parameter to be verified.
Step 203: and screening field names matched with the parameter names of the input parameters to be verified from the field names contained in the data submission request.
In practical applications, the data verification apparatus 140 may screen out, from the field names included in the data submission request, field names that match the parameter names of the input parameters to be verified, so as to obtain field names that match the parameter names of the input parameters to be verified.
Step 204: and respectively carrying out non-empty check on the field value of each screened field name.
In practical applications, the data verification device 140 may perform non-null verification on the field values of the screened field names, respectively, in the following manners:
the data verification device 140 detects whether or not the field value of each of the field names is null, and if it detects that the field value of the field name is null, it determines that the non-null verification of the input parameter represented by the field name does not pass, and if it detects that the field value of the field name is not null, it determines that the non-null verification of the input parameter represented by the field name passes.
Further, in the process of performing non-null check on the field values of the respective screened field names, if it is determined that the non-null check of any input parameter of the interface does not pass, the data checking device 140 may return error notification information to the application 120 based on the any input parameter, for example: an error prompt may be returned to the application 120 with certain mandatory fields empty. Of course, if the data verification device 140 determines that the non-empty verification of each input parameter of the interface passes, it may perform content verification, such as normative verification and validity verification, on each input parameter of the interface, and when it determines that the content verification of each input parameter of the interface passes, it may send each input parameter of the interface to the underwriting system 150 for manual verification and other operations. And ending the interface parameter checking process.
It is worth mentioning that, in the process of verifying the interface parameters by the data verification device 140, the configurator can adjust each input parameter to be filled in the interface standard file record according to the actual requirement by using the interface file management tool such as Swagger, and specifically, the configurator can carry the information such as the interface identifier, the parameter update type, the parameter name of each input parameter to be updated and the like in the interface parameter update instruction by using the interface file management tool such as Swagger and send the interface identifier, the parameter update type, the parameter name of each input parameter to be updated and the like to the data verification device 140; when the data verification device 140 receives the interface parameter update instruction, it may obtain a corresponding interface standard file based on the interface identifier included in the interface parameter update instruction, and update the interface standard file based on the parameter update type included in the interface parameter update instruction and the parameter name of each input parameter to be updated.
Specifically, when the data verification apparatus 140 updates the interface standard file based on the parameter update type included in the interface parameter update instruction and the parameter name of each input parameter to be updated, the following method may be adopted, but is not limited to:
if the data checking device 140 determines that the parameter update type is an input parameter that needs to be added, the data checking device may add the parameter name of each input parameter to be updated to each input parameter recorded in the interface standard file, and add a filling identifier for each input parameter to be updated;
if the data verification device 140 determines that the parameter update type is the input parameter that must be updated, the parameter name and the must-be-updated identifier of each input parameter to be updated may be deleted from each input parameter recorded in the interface standard file.
Therefore, when necessary input parameters of a certain interface need to be adjusted according to actual requirements, information such as the interface identifier, the parameter updating type of the interface, the parameter name of each input parameter to be updated and the like is carried in the interface parameter updating instruction and sent to the data checking device 140 through interface file management tools such as Swagger and the like, deletion of the necessary input parameters of the interface can be achieved, and configurability and practicability are high.
Taking "checking the interface parameter of the applicant interface in the application scenario of the group insurance application" as an example, the interface parameter checking method provided in the embodiment of the present application is further described in detail, and referring to fig. 3, a specific flow of the interface parameter checking method provided in the embodiment of the present application is as follows:
step 301: when the group insurance application 120 determines that the insurance user completes the filling of the insurance applicant data according to the user operation, the group insurance application calls an insurance applicant interface, carries the insurance applicant data in a data submission request in a field name-field value form, and sends the insurance data to the data verification device 140.
Step 302: when the data verification device 140 receives a data submission request sent by the group insurance application 120 through the applicant interface, the interface standard file of the applicant interface is obtained according to the interface identifier of the applicant interface.
Step 303: the data verification device 140 screens out the input parameters added with the necessary filling identifier from the input parameters recorded in the interface standard file of the applicant interface to be used as the input parameters to be verified.
Step 304: the data verification device 140 screens out field names matching parameter names of the input parameters to be verified from the field names included in the data submission request.
Step 305: the data checking device 140 detects whether the field value of each field name is null, 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 when detecting that the field value of the field name is empty, and may determine that the non-empty verification of the input parameter represented by the field name passes when detecting that the field value of the field name is 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, execute step 307; 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 it is determined that the content verification of each input parameter of the interface passes, the data verification apparatus 140 may send each input parameter of the interface to the underwriting system 150 for manual review and the like.
Step 308: the data verification means 140 returns an error prompt to the risk application 120 based on the input parameter that the non-empty verification failed.
Based on the foregoing embodiments, an interface parameter verification apparatus is provided in an embodiment of the present application, 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 each field name is used to represent each input parameter of the interface;
a parameter obtaining unit 402, configured to obtain, from an interface standard file of an interface, each input parameter to which a must-fill identifier is added as an input parameter to be verified, respectively;
the non-null check unit 403 is configured to screen out, from the field names included in the data submission request, field names that match the parameter names of the input parameters to be checked, and perform non-null check on field values of the screened field names.
In a possible implementation manner, the interface parameter checking apparatus provided in an embodiment of the present application further includes:
the association storage unit 404 is configured to receive an interface configuration instruction, and perform association storage on an interface identifier and an interface configuration file included in the interface configuration instruction, where the interface configuration instruction at least includes the interface identifier and an interface standard file, and the interface standard file at least records a parameter name of each input parameter and a padding identifier added to an input parameter that must be padded in each input parameter.
In a possible embodiment, when obtaining, from an interface standard file of an interface, each input parameter added with a must-fill identifier as an input parameter to be verified, the parameter obtaining unit 402 is specifically configured to:
acquiring a corresponding interface standard file according to the interface identifier of the interface;
and screening the input parameters added with the necessary filling marks from the input parameters recorded in the interface standard file to be used as input parameters to be verified respectively.
In one possible embodiment, when performing non-null check on the field values of the respective screened field names, the non-null check unit 403 is specifically configured to:
and detecting whether the field value of the field name is null or not for each screened field name, if so, determining that the non-null check of the input parameter represented by the field name does not pass, and if not, determining that the non-null check of the input parameter represented by the field name passes.
In a possible implementation manner, the interface parameter checking apparatus provided in an embodiment of the present application further includes:
an error prompt unit 405, configured to, if the non-empty check unit 403 determines that the non-empty check of any input parameter of the interface fails, return an error prompt message to the application based on any input parameter;
a content checking unit 406, configured to perform content checking on each input parameter of the interface if the non-empty checking unit 403 determines that the non-empty checking of each input parameter of the interface passes.
In a possible implementation manner, the interface parameter checking apparatus provided in an 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; acquiring a corresponding interface standard file based on an interface identifier contained in the interface parameter updating instruction; and updating the interface standard file based on the parameter updating type contained in the interface parameter updating instruction and the parameter name of each input parameter to be updated.
In a possible embodiment, when the interface standard file is updated based on the parameter update type included in the interface parameter update instruction and the parameter name of each input parameter to be updated, the parameter update unit 407 is specifically configured to:
if the parameter updating type is the newly added and filled input parameter, adding the parameter name of each input parameter to be updated into each input parameter recorded in the interface standard file, and respectively adding a filling identifier for each input parameter to be updated;
and if the parameter updating type is to delete the input parameters which must be filled, deleting the parameter names and the filling 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 verification apparatus 400 provided in the embodiment of the present application for solving the technical problem is similar to that of the interface parameter verification method provided in the embodiment of the present application, and therefore, the implementation of the interface parameter verification apparatus 400 provided in the embodiment of the present application can refer to the implementation of the interface parameter verification method provided in the embodiment of the present application, and repeated details are not described again.
After the interface parameter verification method and the interface parameter verification device provided by the embodiment of the present application are introduced, a brief introduction is performed on the interface parameter verification device provided by the embodiment of the present application.
An embodiment of the present application provides an interface parameter checking device, and as shown in fig. 5, the interface parameter checking device 500 at least includes: the interface parameter verification method comprises a processor 501, a memory 502 and a computer program stored on the memory 502 and capable of running on the processor 501, wherein the interface parameter verification method provided by the embodiment of the application is realized when the processor 501 executes the computer program.
It should be noted that the interface parameter verification device 500 shown in fig. 5 is only an example, and should not bring any limitation to the functions and the application scope of the embodiment of the present application.
The interface parameter verification apparatus 500 provided in this embodiment of the present application may further include a bus 503 for connecting different components (including the processor 501 and the memory 502). Bus 503 represents one or more of any of several types of bus structures, including a memory bus, a peripheral bus, a local bus, and the like.
The Memory 502 may include readable media in the form of volatile Memory, such as 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 of which, or some combination thereof, may comprise an implementation of a network environment.
The interface parameter verification device 500 may also communicate with one or more external devices 504 (e.g., keyboard, remote control, etc.), with one or more devices (e.g., cell phone, computer, etc.) that enable a user to interact with the interface parameter verification device 500, and/or with any device (e.g., router, modem, etc.) that enables the interface parameter verification device 500 to communicate with one or more other interface parameter verification devices 500. Such communication may be through an Input/Output (I/O) interface 505. Furthermore, the interface parameter verification device 500 may also communicate with one or more networks (e.g., a Local Area Network (LAN), a 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 the other modules of the interface parameter verification device 500 via a bus 503. It should be understood that although not shown in FIG. 5, other hardware and/or software modules may be used in conjunction with interface parameter verification device 500, including but not limited to: microcode, device drivers, Redundant processors, external disk drive Arrays, disk array (RAID) subsystems, tape drives, and data backup storage subsystems, to name a few.
After the method, the apparatus, and the device for checking interface parameters provided in the embodiments of the present application are introduced, a computer-readable storage medium provided in the embodiments of the present application is introduced next.
The embodiment of the application provides a computer-readable storage medium, which stores computer instructions, and the computer instructions, 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 in 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 interface parameter verification method provided in the embodiment of the present application may also be implemented as a program product, where the program product includes a program code, and when the program product can run on the interface parameter verification apparatus 500, the program code is configured to enable the interface parameter verification apparatus 500 to execute the interface parameter verification method provided in the embodiment of the present application.
The program product provided by the embodiments of the present application may be 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 in particular, 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 (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 embodiment of the application can adopt a CD-ROM and comprises program codes, and can 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, which can be used 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 division is merely exemplary and not mandatory. Indeed, the features and functions of two or more units described above may be embodied in one unit, according to embodiments of the application. Conversely, the features and functions of one unit described above may be further divided into embodiments by a plurality of units.
Further, while the operations of the methods of the present application are depicted in the drawings in a particular order, this does not require or imply that these operations must be performed in this particular order, or that all of the illustrated operations must be performed, to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step execution, and/or one step broken down into multiple step executions.
While the 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. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all alterations and modifications as fall within the scope of the application.
It will be apparent to those skilled in the art that various changes and modifications may be made in 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 of the present application and their equivalents, the present application is also intended to encompass such modifications and variations.

Claims (10)

1. An interface parameter verification method is characterized by comprising the following steps:
receiving a data submission request sent by an application through an interface, wherein the data submission 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 as an input parameter to be verified;
screening field names matched with the parameter names of the input parameters to be verified from the field names contained in the data submission request;
and respectively carrying out non-empty check on the field value of each screened field name.
2. The interface parameter verification method of claim 1, wherein before receiving a data submission request sent by an application through an interface, the method further comprises:
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 at least records a parameter name of each input parameter and a necessary filling identifier added to the necessary input parameter in each input parameter;
and storing the interface identification and the interface configuration file contained in the interface configuration instruction in an associated manner.
3. The method for verifying interface parameters according to claim 1, wherein obtaining, from the interface standard file of the interface, each input parameter added with the must-fill identifier as an input parameter to be verified, respectively, comprises:
acquiring a corresponding interface standard file according to the interface identifier of the interface;
and screening out the input parameters added with the necessary filling marks from the input parameters recorded in the interface standard file to be respectively used as the input parameters to be verified.
4. The interface parameter checking method according to claim 1, 2 or 3, wherein the non-null checking is performed on the field values of the respective screened field names, respectively, including:
and detecting whether the field value of the field name is null or not for each screened field name, if so, determining that the non-null check of the input parameter represented by the field name fails, and if not, determining that the non-null check of the input parameter represented by the field name passes.
5. The interface parameter verification method of claim 4, further comprising:
if the non-empty check of any input parameter of the interface is determined not to pass, 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.
6. The interface parameter verification method of claim 1, 2 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 contained in the interface parameter updating instruction and the parameter name of each input parameter to be updated.
7. The method for verifying interface parameters according to claim 6, wherein updating the interface standard file based on the parameter update type included in the interface parameter update instruction and the parameter name of each input parameter to be updated comprises:
if the parameter updating type is the newly added and filled input parameter, adding the parameter name of each input parameter to be updated into each input parameter recorded in the interface standard file, and respectively adding a filling identifier for each input parameter to be updated;
and if the parameter updating type is the input parameter which is necessary to be updated, deleting the parameter name and the necessary filling identifier of each input parameter to be updated from each input parameter recorded in the interface standard file.
8. An interface parameter verification apparatus, comprising:
the device comprises a receiving unit, a processing unit and a processing unit, wherein the receiving unit is used for receiving a data submission request sent by an application through an interface, the data submission request at least comprises each field name and the 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 identifier from the interface standard file of the interface as an input parameter to be verified;
and the verification unit is used for screening the field names matched with the parameter names of the input parameters to be verified from the field names contained in the data submission request, and respectively performing non-empty verification on the field values of the screened field names.
9. An interface parameter verification device, comprising: a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the interface parameter checking method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium storing computer instructions which, when executed by a processor, implement the interface parameter checking method according to any one of claims 1 to 7.
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 true CN111258832A (en) 2020-06-09
CN111258832B 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)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112148540A (en) * 2020-08-27 2020-12-29 云账户技术(天津)有限公司 Interface parameter checking method and device, electronic equipment and readable storage medium
CN112306879A (en) * 2020-11-02 2021-02-02 平安普惠企业管理有限公司 Interface parameter checking method, device, equipment and storage medium
CN112395194A (en) * 2020-11-17 2021-02-23 中国建设银行股份有限公司 Method and device for accessing test platform

Citations (13)

* 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
US20030023555A1 (en) * 2001-07-26 2003-01-30 Cashworks, Inc. Method and system for providing financial services
US20090084842A1 (en) * 2007-09-28 2009-04-02 Carrie Vriheas Automated submission of prepaid programs
US20090328174A1 (en) * 2008-06-26 2009-12-31 Alibaba Group Holding Limited Method and system for providing internet services
US20120284734A1 (en) * 2009-12-16 2012-11-08 Koninklijke Philips Electronics N.V. Universal medical device driver adapter
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

Patent Citations (13)

* 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
US20030023555A1 (en) * 2001-07-26 2003-01-30 Cashworks, Inc. Method and system for providing financial services
US20090084842A1 (en) * 2007-09-28 2009-04-02 Carrie Vriheas Automated submission of prepaid programs
US20090328174A1 (en) * 2008-06-26 2009-12-31 Alibaba Group Holding Limited Method and system for providing internet services
US20120284734A1 (en) * 2009-12-16 2012-11-08 Koninklijke Philips Electronics N.V. Universal medical device driver adapter
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

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112148540A (en) * 2020-08-27 2020-12-29 云账户技术(天津)有限公司 Interface parameter checking method and device, electronic equipment and readable storage medium
CN112306879A (en) * 2020-11-02 2021-02-02 平安普惠企业管理有限公司 Interface parameter checking method, device, equipment and storage medium
CN112395194A (en) * 2020-11-17 2021-02-23 中国建设银行股份有限公司 Method and device for accessing test platform
CN112395194B (en) * 2020-11-17 2024-03-22 中国建设银行股份有限公司 Method and device for accessing test platform

Also Published As

Publication number Publication date
CN111258832B (en) 2023-06-20

Similar Documents

Publication Publication Date Title
CN111258832B (en) Interface parameter verification method, device, equipment and medium
CN111340402B (en) Group insurance service management method, system, device and storage medium
WO2022068316A1 (en) Data reconciliation method and apparatus, device, and storage medium
US8484724B2 (en) User permissions in computing systems
WO2022245294A2 (en) Method and apparatus for managing accounts, and server and storage medium thereof
US20140180949A1 (en) System and method for automated coding and testing of benefits
US7698176B2 (en) Method, system, and computer-readable medium for updating inventory data in an inventory management system
CN111353763B (en) Method, device, server and storage medium for processing data
CN113238739A (en) Plug-in development and data acquisition method, device, electronic equipment and medium
CN112579632A (en) Data verification method, device, equipment and medium
CN112732372A (en) Service calling method and device and server
CN112965986B (en) Service consistency processing method, device, equipment and storage medium
CN114037523A (en) Letter service test method, device, equipment, medium and program product
CN116467156A (en) Joint debugging test method and device, storage medium and electronic equipment
CN106301983A (en) A kind of website based on fictitious host computer detection method and device
CN111209548A (en) Enterprise information verification and checking system and method based on cloud platform
KR101737575B1 (en) Method and device for verifying data based on sql sentences generated automatically
CN113568682B (en) Rule data verification method, device, computer equipment and storage medium
CN112801772B (en) Trusted method, trusted processing system, electronic equipment and storage medium
CN115396277B (en) Login state management method, device, equipment and storage medium
CN110427600B (en) Batch text management method and device
CN117272278B (en) Decentralization management method and device for digital asset platform
CN111857664B (en) Application development method, device, equipment and storage medium
CN114490409A (en) Product testing method and device, storage medium and electronic equipment
CN117688550A (en) Account password substitution filling 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
GR01 Patent grant
GR01 Patent grant