CN115086436B - inter-API parameter verification method and device, computer equipment and storage medium - Google Patents

inter-API parameter verification method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN115086436B
CN115086436B CN202210686333.9A CN202210686333A CN115086436B CN 115086436 B CN115086436 B CN 115086436B CN 202210686333 A CN202210686333 A CN 202210686333A CN 115086436 B CN115086436 B CN 115086436B
Authority
CN
China
Prior art keywords
interface
api
message
parameter
field
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
CN202210686333.9A
Other languages
Chinese (zh)
Other versions
CN115086436A (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.)
Ping An Bank Co Ltd
Original Assignee
Ping An Bank 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 Ping An Bank Co Ltd filed Critical Ping An Bank Co Ltd
Priority to CN202210686333.9A priority Critical patent/CN115086436B/en
Publication of CN115086436A publication Critical patent/CN115086436A/en
Application granted granted Critical
Publication of CN115086436B publication Critical patent/CN115086436B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0813Configuration setting characterised by the conditions triggering a change of settings
    • H04L41/0816Configuration setting characterised by the conditions triggering a change of settings the condition being an adaptation, e.g. in response to network events
    • 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)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The application provides a method, a device, computer equipment and a storage medium for checking parameters among APIs, wherein the method for checking the parameters among the APIs comprises the following steps: receiving an interface calling request sent by a development terminal where a developer is located; judging whether the interface parameters meet preset conditions or not based on the interface configuration information, and if the interface parameters do not meet the preset conditions, generating an error prompting message; and sending response information aiming at the interface call request to the development terminal, so that when the response information carries the message of the error prompt, the development terminal modifies the interface parameter according to the message of the error prompt, and resends the interface call request based on the modified interface parameter. The parameter verification method and the parameter verification device can automatically verify the parameters of the AP I to ensure that the parameters of a plurality of the AP I are consistent, wherein the parameter verification method and the parameter verification device can automatically verify the parameters of the AP I without manually participating in the parameter verification of the AP I, so that the parameter verification method and the parameter verification device have the advantage of high parameter verification efficiency of the AP I.

Description

inter-API parameter verification method and device, computer equipment and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and apparatus for verifying parameters between APIs, a computer device, and a storage medium.
Background
The API joint call is an indispensable step for interfacing a developer and an open platform API, and at present, in a complex API call flow, parameters among a plurality of APIs have consistency dependence, for example, in a flow of a user opening a bank account, an identity card of the user needs to be uploaded by an uploading image API, then the image auditing API is called for image auditing, and a file ID returned by the uploading image API is used as an input to be uploaded when the image auditing API is called.
In the above process, if the parameters among multiple APIs do not depend on the values according to consistency, technical support personnel of the open platform need to search logs, find parameters of several APIs with parameter dependence, notify a developer of value transmission errors after finding parameter errors according to the dependence among APIs by naked eyes, and instruct the developer to transmit values according to correct rules, wherein one such type of errors takes about 20-30 minutes from occurrence to resolution, so two main problems exist in the way of solving the problems:
1. the developer waits for a long time and experiences very poor. (if two developers meet such problems while consulting a technical support personnel of the open platform, one developer waits for at least 40 minutes, and so on)
2. The open platform technology supports personnel with great manpower consumption.
Disclosure of Invention
The application aims to provide an inter-API parameter verification method, device, computer equipment and storage medium, which are used for automatically verifying parameters of an API so as to ensure that a plurality of API parameters are consistent.
For this purpose, a first aspect of the present application discloses a method for verifying parameters between APIs, where the method is applied to a joint debugging platform, and the method includes:
receiving an interface calling request sent by a development terminal where a developer is located, wherein the interface calling request carries interface parameters;
judging whether the interface parameter meets a preset condition or not based on interface configuration information, if the interface parameter meets the preset condition, generating a message carrying a correct service, and if the interface parameter does not meet the preset condition, generating a message of an error prompt, wherein the error prompt comprises a modification prompt message aiming at the interface parameter;
and sending response information aiming at the interface call request to the development terminal, so that the development terminal modifies the interface parameters according to the message of the error prompt when the response information carries the message of the error prompt, and resends the interface call request based on the modified interface parameters.
According to the method and the device, whether the interface parameters meet the preset conditions is automatically judged through the interface configuration information, if the interface parameters meet the preset conditions, a message carrying the correct service is generated, and if the interface parameters do not meet the preset conditions, a message of an error prompt is generated, wherein the error prompt comprises modification prompt information aiming at the interface parameters. On the other hand, the method and the system can enable the joint debugging platform to send response information aiming at the interface calling request to the development terminal, so that when the response information carries a message of an error prompt, the development terminal modifies the interface parameter according to the message of the error prompt, and resends the interface calling request based on the modified interface parameter.
Through the above process, the parameter verification method and the parameter verification device can automatically verify the parameter of the API without manually participating in parameter verification of the API, so that the parameter verification method and the parameter verification device have the advantage of high parameter verification efficiency of the API.
In a first aspect of the present application, as an optional implementation manner, before the determining, based on the interface configuration information, whether the interface parameter meets a preset condition, the method further includes:
receiving the interface configuration information, wherein the interface configuration information comprises a checked field, a reference step, a reference API, a reference field type and a reference field;
And saving the interface configuration information.
In this optional embodiment, by receiving the interface configuration information, it is further possible to maintain the interface configuration information for determining whether the interface parameter satisfies the preset condition.
In the first aspect of the present application, as an optional implementation manner, the interface parameter includes a target API name and an access field;
and judging whether the interface parameter meets a preset condition based on the interface configuration information, if the interface parameter meets the preset condition, generating a correct service message, and if the interface parameter does not meet the preset condition, generating a message with an error prompt, wherein the method comprises the following steps:
determining the checked field based on the target API name;
and judging whether the checked field is the same as the access field, if so, generating the correct service message, and if not, generating the message of the error prompt.
The optional implementation manner can determine the checked field through the target API name, further can judge whether the checked field is the same as the access field, if so, generates a correct service message, and if not, generates a message with an error prompt.
In a first aspect of the present application, as an optional implementation manner, after the determining whether the checked field is the same as the access field, before the generating the correct service packet, the method further includes:
Determining a field type of the checked field;
judging whether the field types of the access fields are consistent or not based on the field types of the checked fields, and if not, generating the message of the error prompt.
According to the alternative embodiment, the field type of the checked field is determined, so that whether the field type of the access field is consistent or not can be judged based on the field type of the checked field, and if not, an error prompt message is generated.
In a first aspect of the present application, as an optional implementation manner, the generating the message of the error prompt includes:
and generating the message of the false prompt based on the reference step, the reference API, the reference field type and the reference field.
This alternative embodiment is capable of generating a false-prompted message based on the reference step, the reference API, the reference field type, and the reference field.
In the first aspect of the present application, as an optional implementation manner, the determining the checked field based on the target API name includes:
determining the reference API based on the target API name;
the checked field is determined based on the reference API.
This alternative embodiment can determine the reference API based on the target API name, and can in turn determine the checked fields based on the reference API.
The second aspect of the application discloses a parameter verification method between APIs, where the method is applied to a development terminal, and the method includes:
an interface call request is sent to a joint debugging platform, wherein the interface call request carries interface parameters, so that the joint debugging platform judges whether the interface parameters meet preset conditions or not and returns response information for the interface call request;
when the response information carries the message of the error prompt, modifying the interface parameter according to the message of the error prompt, and resending the interface calling request based on the modified interface parameter.
The method of the second aspect of the present application can automatically verify parameters of the API without manually participating in parameter verification of the API, so the present application has the advantage of high parameter verification efficiency of the API
The third aspect of the application discloses an inter-API parameter verification device, the device is applied to a joint debugging platform, and the device comprises:
the receiving module is used for receiving an interface calling request sent by a development terminal where a developer is located, wherein the interface calling request carries interface parameters;
the first judging module is used for judging whether the interface parameter meets a preset condition or not based on the interface configuration information, generating a message carrying a correct service if the interface parameter meets the preset condition, and generating a message of an error prompt if the interface parameter does not meet the preset condition, wherein the error prompt comprises a modified prompt message aiming at the interface parameter;
And the first sending module is used for sending response information aiming at the interface call request to the development terminal, so that the development terminal modifies the interface parameters according to the message of the error prompt when the response information carries the message of the error prompt, and resends the interface call request based on the modified interface parameters.
The device of the third aspect of the application can automatically verify the parameters of the API by executing the parameter verification method between the APIs, and does not need to manually participate in parameter verification of the API, so that the device has the advantage of high parameter verification efficiency of the API.
A fourth aspect of the present application discloses a computer device comprising:
a processor; and
a memory configured to store machine-readable instructions that, when executed by the processor, perform the inter-API parameter checking method of the first aspect of the present application.
The computer equipment of the fourth aspect of the present application can automatically verify parameters of the API by executing the parameter verification method between APIs, without manually participating in parameter verification of the API, so that the present application has the advantage of high parameter verification efficiency of the API.
A fifth aspect of the present application discloses a storage medium storing a computer program that is executed by a processor to perform the inter-API parameter checking method of the first aspect of the present application.
The storage medium of the fifth aspect of the present application performs the inter-API parameter verification method, so that parameters of an API can be automatically verified without manually participating in parameter verification of the API, and therefore, the present application has the advantage of high parameter verification efficiency of the API.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the embodiments of the present application will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and should not be considered as limiting the scope, and other related drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of an inter-API parameter checking method according to an embodiment of the present application;
FIG. 2 is a flow chart of a method for checking parameters between APIs according to a second embodiment of the present disclosure;
FIG. 3 is a schematic structural diagram of an inter-API parameter checking device according to a third embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of an inter-API parameter checking apparatus according to a fourth embodiment of the present disclosure;
fig. 5 is a schematic structural diagram of a computer device in accordance with a fifth embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application.
Example 1
Referring to fig. 1, fig. 1 is a flowchart of an inter-API parameter verification method according to an embodiment of the present disclosure, where the method is applied to a joint debugging platform. As shown in fig. 1, the method of the embodiment of the present application includes the following steps:
101. receiving an interface calling request sent by a development terminal where a developer is located, wherein the interface calling request carries interface parameters;
102. judging whether the interface parameters meet preset conditions or not based on the interface configuration information, if the interface parameters meet the preset conditions, generating a message carrying the correct service, and if the interface parameters do not meet the preset conditions, generating a message of an error prompt, wherein the error prompt comprises modification prompt information aiming at the interface parameters;
103. and sending response information aiming at the interface call request to the development terminal, so that when the response information carries the message of the error prompt, the development terminal modifies the interface parameter according to the message of the error prompt, and resends the interface call request based on the modified interface parameter.
In this embodiment of the present application, for step 101, the development terminal where the developer is located may be a mobile terminal or a PC terminal.
In this embodiment of the present application, for step 101, the interface refers to an API interface, i.e. an API (Application Program Interface ), where the application program interface is a set of definitions, programs and protocols, and the mutual communication between computer software is implemented through the API interface.
In this embodiment of the present application, for step 102, the interface call request is initiated for the target API, where the target API is associated with other APIs, for example, assuming that there are a first API and a second API, then the first API and the second API are used to field a at the same time, and then there is an association between the first API and the second API, so both the first API and the second API may be the target API.
In the embodiment of the present application, for step 102, since the joint debugging platform and the development terminal communicate in the form of a message, the message needs to be generated.
In this embodiment of the present application, for step 102, the correct service packet refers to that the interface parameter carried in the interface parameter is correct, that is, the interface parameter is consistent with the parameter in the associated API, for example, it is assumed that there is a first API and a second API, where the first API has a file address field classaddr, and classaddr: the second API needs to call the content of the file address field in the first API, so when the joint debugging platform acquires the interface parameter aiming at the first API, judging whether the field carrying the file address in the interface parameter is 'classaddr', if yes, determining that the interface parameter meets the preset condition, and if not, determining that the interface parameter does not meet the preset condition.
In this embodiment of the present application, for step 102, the error hint is used to hint that the interface parameter uploaded by the development terminal needs to be modified, and hint that the development terminal modifies the specific content, for example, if the file address field in the interface parameter is not "classaddr" but "addr", the error hint is used to hint that the file address field is modified to "classaddr".
According to the method, whether the interface parameters meet the preset conditions is automatically judged through the interface configuration information, if the interface parameters meet the preset conditions, a message carrying the correct service is generated, and if the interface parameters do not meet the preset conditions, a message of an error prompt is generated, wherein the error prompt comprises modification prompt information aiming at the interface parameters. On the other hand, the method and the system can enable the joint debugging platform to send response information aiming at the interface calling request to the development terminal, so that when the response information carries a message of an error prompt, the development terminal modifies the interface parameter according to the message of the error prompt, and resends the interface calling request based on the modified interface parameter.
Through the above process, the embodiment of the application can automatically verify the parameters of the API without manually participating in parameter verification of the API, so that the application has the advantage of high parameter verification efficiency of the API. For example, in the process of developing terminal joint debugging, if parameters are not transferred according to consistency dependency, a response can be obtained in real time through the joint debugging platform, codes can be directly modified according to the prompts, the following joint debugging is continued, a long-time waiting for a butt joint person of the platform to check the problem is not needed, compared with the traditional mode for solving the problem, the experience of a developer is greatly improved, the manpower consumption of the butt joint person of an open platform is greatly reduced, and the problem is avoided from being processed in 20-30 minutes.
In the embodiment of the present application, as an alternative implementation manner, in step 102: before judging whether the interface parameters meet the preset conditions or not based on the interface configuration information, the method of the embodiment of the application further comprises the following steps:
receiving interface configuration information, wherein the interface configuration information comprises a checked field, a reference step, a reference API, a reference field type and a reference field;
and saving the interface configuration information.
In this optional embodiment, further optionally, the interface configuration information is stored in a database of the joint debugging platform in the form of a data table, for example, the interface configuration information is stored in an Oracle database of the joint debugging platform in the form of a data table.
In this optional embodiment, the referencing step is used to instruct the development terminal to transmit according to the parameters specified in the preset step, and in some scenarios, when the second API calls the first API, the second API may call the function a implemented by the API or call the function B implemented by the API, so that it is necessary to inform that the parameters uploaded by the development terminal also need to correspond to the specific step.
For example, when the second API would call the function a implemented by the API, the development terminal is informed that the parameter uploaded for the first API should be consistent with the parameter required by the function a, so that the second API can correctly call the first API in a predetermined field, and when the second API would call the function B implemented by the API, the development terminal is informed that the parameter uploaded for the first API should be consistent with the parameter required by the function B, so that the second API can correctly call the first API in a predetermined field.
In this alternative embodiment, the checked field indicates a field to be checked, for example, when the second API needs to call the first API, so as to obtain the file address calculated by the first API, a field related to the file address in the interface parameter for the first API is the checked field.
In this optional embodiment, the reference API indicates that the current API needs a corresponding object, for example, when the development terminal uploads an interface parameter for the first API, the interface parameter of the first API needs to be consistent with a parameter required by the second API, and in this process, the second API is the reference API.
It should be noted that, the last interface parameter of the development terminal for the first API occurs during the testing process of the development terminal, for example, in order to ensure that the first API and the second API can be normally co-tuned during the subsequent use process, the development terminal simulates the process of calling the first API.
In this alternative embodiment, the reference field type and the reference field sequentially represent the object and attribute of the field comparison in the interface parameter, for example, when the file address field in the interface parameter is to be checked, the reference field is compared with the file address field, and the field type of the file address field is compared with the reference field type.
In this alternative embodiment, as a specific example, the interface configuration information is shown in table 1, where the current API is apicode1 assuming that the current step is 3.
Checked field Reference step Reference API Reference field type Reference field
Field name 1 1 apicode2 Ginseng radix Field name 5
Field name 2 1 apicode2 Ginseng radix Field name 6
Field name 3 2 apicode3 Ginseng radix Field name 7
Field name 4 2 apicode3 Ginseng radix Field name 8
TABLE 1
As shown in table 1, field name 1 in apicode1 needs to correspond to field name 5 in apicode 2.
As can be seen from the above, the optional embodiment can further maintain the interface configuration information for determining whether the interface parameter meets the preset condition by receiving the interface configuration information.
In this embodiment of the present application, as an optional implementation manner, the interface parameter includes a target API name and an access field, and accordingly, step 102: judging whether the interface parameter meets the preset condition or not based on the interface configuration information, if the interface parameter meets the preset condition, generating a correct service message, and if the interface parameter does not meet the preset condition, generating an error prompting message, wherein the method comprises the following substeps:
determining a checked field based on the target API name;
judging whether the checked field is the same as the access field, if so, generating a correct service message, and if not, generating an error prompting message.
The optional implementation manner can determine the checked field through the target API name, further can judge whether the checked field is the same as the access field, if so, generates a correct service message, and if not, generates a message with an error prompt.
In the embodiment of the present application, as an optional implementation manner, in the step: after judging whether the checked field is the same as the access field, the steps are as follows: before generating the correct service message, the method of the embodiment of the application further comprises the following steps:
determining a field type of the checked field;
judging whether the field types of the access fields are consistent based on the field types of the checked fields, and if not, generating an error prompting message.
According to the alternative embodiment, the field type of the checked field is determined, so that whether the field type of the access field is consistent or not can be judged based on the field type of the checked field, and if not, an error prompt message is generated.
In the embodiment of the present application, as an optional implementation manner, the steps include: generating a message of an error prompt, comprising:
and generating a message of the false prompt based on the reference step, the reference API, the reference field type and the reference field.
This alternative embodiment is capable of generating a false-prompted message based on the reference step, the reference API, the reference field type, and the reference field.
In the embodiment of the present application, as an optional implementation manner, the steps include: determining a checked field based on the target API name, comprising the sub-steps of:
determining a reference API based on the target API name;
the checked fields are determined based on the reference API.
This alternative embodiment can determine the reference API based on the target API name, and can in turn determine the checked fields based on the reference API.
Example two
Referring to fig. 2, fig. 2 is a flowchart of an inter-API parameter checking method disclosed in an embodiment of the present application, where the method is applied to a development terminal. As shown in fig. 1, the method of the embodiment of the present application includes the following steps:
201. sending an interface call request to the joint debugging platform, wherein the interface call request carries interface parameters, so that the joint debugging platform judges whether the interface parameters meet preset conditions and returns response information for the interface call request;
202. when the response information carries the message of the error prompt, the interface parameter is modified according to the message of the error prompt, and the interface calling request is resent based on the modified interface parameter.
The method of the embodiment of the application can automatically verify the parameters of the API without manually participating in parameter verification of the API, so that the method of the embodiment of the application has the advantage of high parameter verification efficiency of the API. For example, in the process of developing terminal joint debugging, if parameters are not transferred according to consistency dependency, a response can be obtained in real time through the joint debugging platform, codes can be directly modified according to the prompts, the following joint debugging is continued, a long-time waiting for a butt joint person of the platform to check the problem is not needed, compared with the traditional mode for solving the problem, the experience of a developer is greatly improved, the manpower consumption of the butt joint person of an open platform is greatly reduced, and the problem is avoided from being processed in 20-30 minutes.
Example III
Referring to fig. 3, fig. 3 is a schematic structural diagram of an inter-API parameter checking device according to an embodiment of the present application, where the device is applied to a joint debugging platform. As shown in fig. 3, the apparatus of the embodiment of the present application includes the following functional modules:
the receiving module 301 is configured to receive an interface call request sent by a development terminal where a developer is located, where the interface call request carries an interface parameter;
the first judging module 302 is configured to judge whether the interface parameter meets a preset condition based on the interface configuration information, if the interface parameter meets the preset condition, generate a message carrying a correct service, and if the interface parameter does not meet the preset condition, generate a message of an error prompt, where the error prompt includes modification prompt information for the interface parameter;
The first sending module 303 is configured to send response information for the interface call request to the development terminal, so that when the response information carries a message of an error prompt, the development terminal modifies an interface parameter according to the message of the error prompt, and resends the interface call request based on the modified interface parameter.
In this embodiment of the present application, for step 101, the development terminal where the developer is located may be a mobile terminal or a PC terminal.
In this embodiment of the present application, the receiving module 301, the interface refers to an API interface, i.e. an API (Application Program Interface ), where the application program interface is a set of definitions, programs and protocols, and the mutual communication between computer software is implemented through the API interface.
In this embodiment of the present application, the first determining module 302 initiates the interface call request for the target API, where the target API is associated with other APIs, for example, if the first API and the second API exist, the first API and the second API use the field a at the same time, and the first API and the second API have an association, so both the first API and the second API may be the target API.
In this embodiment of the present application, the first judging module 302 needs to generate a message because the joint debugging platform and the development terminal communicate in the form of a message.
In this embodiment of the present application, the first determining module 302, the correct service packet refers to that the interface parameter carried in the interface parameter is correct, that is, the interface parameter is consistent with the parameter in the associated API, for example, it is assumed that there are a first API and a second API, where the first API has a file address field classaddr, and classaddr: the second API needs to call the content of the file address field in the first API, so when the joint debugging platform acquires the interface parameter aiming at the first API, judging whether the field carrying the file address in the interface parameter is 'classaddr', if yes, determining that the interface parameter meets the preset condition, and if not, determining that the interface parameter does not meet the preset condition.
In this embodiment of the present application, the first determining module 302 is configured to, in an error prompt, prompt that the interface parameter uploaded by the development terminal needs to be modified, and prompt that the development terminal modifies the specific content, for example, if the file address field in the interface parameter is not "classaddr" but "addr", the error prompt is configured to prompt that the file address field is modified to "classaddr".
According to the method, whether the interface parameters meet the preset conditions is automatically judged through the interface configuration information, if the interface parameters meet the preset conditions, a message carrying the correct service is generated, and if the interface parameters do not meet the preset conditions, a message of an error prompt is generated, wherein the error prompt comprises modification prompt information aiming at the interface parameters. On the other hand, the method and the system can enable the joint debugging platform to send response information aiming at the interface calling request to the development terminal, so that when the response information carries a message of an error prompt, the development terminal modifies the interface parameter according to the message of the error prompt, and resends the interface calling request based on the modified interface parameter.
Through the above process, the embodiment of the application can automatically verify the parameters of the API without manually participating in parameter verification of the API, so that the application has the advantage of high parameter verification efficiency of the API. For example, in the process of developing terminal joint debugging, if parameters are not transferred according to consistency dependency, a response can be obtained in real time through the joint debugging platform, codes can be directly modified according to the prompts, the following joint debugging is continued, a long-time waiting for a butt joint person of the platform to check the problem is not needed, compared with the traditional mode for solving the problem, the experience of a developer is greatly improved, the manpower consumption of the butt joint person of an open platform is greatly reduced, and the problem is avoided from being processed in 20-30 minutes.
In this embodiment of the present application, as an optional implementation manner, the apparatus of this embodiment of the present application further includes a storage module, where:
the receiving module 301 is further configured to receive interface configuration information, where the interface configuration information includes a checked field, a reference step, a reference API, a reference field type, and a reference field;
and the storage module is also used for storing the interface configuration information.
In this optional embodiment, further optionally, the interface configuration information is stored in a database of the joint debugging platform in the form of a data table, for example, the interface configuration information is stored in an Oracle database of the joint debugging platform in the form of a data table.
In this optional embodiment, the referencing step is used to instruct the development terminal to transmit according to the parameters specified in the preset step, and in some scenarios, when the second API calls the first API, the second API may call the function a implemented by the API or call the function B implemented by the API, so that it is necessary to inform that the parameters uploaded by the development terminal also need to correspond to the specific step.
For example, when the second API would call the function a implemented by the API, the development terminal is informed that the parameter uploaded for the first API should be consistent with the parameter required by the function a, so that the second API can correctly call the first API in a predetermined field, and when the second API would call the function B implemented by the API, the development terminal is informed that the parameter uploaded for the first API should be consistent with the parameter required by the function B, so that the second API can correctly call the first API in a predetermined field.
In this alternative embodiment, the checked field indicates a field to be checked, for example, when the second API needs to call the first API, so as to obtain the file address calculated by the first API, a field related to the file address in the interface parameter for the first API is the checked field.
In this optional embodiment, the reference API indicates that the current API needs a corresponding object, for example, when the development terminal uploads an interface parameter for the first API, the interface parameter of the first API needs to be consistent with a parameter required by the second API, and in this process, the second API is the reference API.
It should be noted that, the last interface parameter of the development terminal for the first API occurs during the testing process of the development terminal, for example, in order to ensure that the first API and the second API can be normally co-tuned during the subsequent use process, the development terminal simulates the process of calling the first API.
In this alternative embodiment, the reference field type and the reference field sequentially represent the object and attribute of the field comparison in the interface parameter, for example, when the file address field in the interface parameter is to be checked, the reference field is compared with the file address field, and the field type of the file address field is compared with the reference field type.
In this alternative embodiment, as a specific example, the interface configuration information is shown in table 1, where the current API is apicode1 assuming that the current step is 3.
Checked field Reference step Reference API Reference field type Reference field
Field name 1 1 apicode2 Ginseng radix Field name 5
Field name 2 1 apicode2 Ginseng radix Field name 6
Field name 3 2 apicode3 Ginseng radix Field name 7
Field name 4 2 apicode3 Ginseng radix Field name 8
TABLE 1
As shown in table 1, field name 1 in apicode1 needs to correspond to field name 5 in apicode 2.
As can be seen from the above, the optional embodiment can further maintain the interface configuration information for determining whether the interface parameter meets the preset condition by receiving the interface configuration information.
In this embodiment of the present application, as an optional implementation manner, the interface parameter includes a target API name and an access field, and accordingly, the first determining module 302 includes:
a first determination submodule for determining a checked field based on the target API name;
and the judging sub-module is used for judging whether the checked field is the same as the access field, if so, generating a correct service message, and if not, generating an error prompting message.
The optional implementation manner can determine the checked field through the target API name, further can judge whether the checked field is the same as the access field, if so, generates a correct service message, and if not, generates a message with an error prompt.
In this embodiment of the present application, as an optional implementation manner, the apparatus of this embodiment of the present application further includes the following functional modules:
a determining module, configured to determine a field type of the checked field;
and the second judging module is used for judging whether the field types of the access fields are consistent based on the field types of the checked fields, and if not, generating an error prompting message.
In this optional embodiment, by determining the field type of the checked field, it is further able to determine whether the field type of the access field is consistent based on the field type of the checked field, and if not, generate an error-prompting message.
In this embodiment of the present application, as an optional implementation manner, the second determining module includes:
and the generation sub-module is used for generating a message with false prompt based on the reference step, the reference API, the reference field type and the reference field.
This alternative embodiment is capable of generating a false-prompted message based on the reference step, the reference API, the reference field type, and the reference field.
In this embodiment, as an optional implementation manner, the generating submodule includes:
a second determination submodule for determining a reference API based on the target API name;
and a third determination sub-module for determining the checked field based on the reference API.
This alternative embodiment can determine the reference API based on the target API name, and can in turn determine the checked fields based on the reference API.
Example IV
Referring to fig. 4, fig. 4 is a schematic structural diagram of an inter-API parameter checking device according to an embodiment of the present application, where the device is applied to a development terminal. As shown in fig. 4, the apparatus of the embodiment of the present application includes the following functional modules:
the second sending module 401 is configured to send an interface call request to the joint debugging platform, where the interface call request carries an interface parameter, so that the joint debugging platform determines whether the interface parameter meets a preset condition and returns response information for the interface call request;
And a modifying module 402, configured to modify the interface parameter according to the error-prompted message when the response message carries the error-prompted message, and trigger the second sending module 401 to resend the interface call request based on the modified interface parameter.
The device of the embodiment of the application can automatically verify the parameters of the API by executing the parameter verification method among the APIs without manually participating in the parameter verification of the API, so that the device of the embodiment of the application has the advantage of high parameter verification efficiency of the API. For example, in the process of developing terminal joint debugging, if parameters are not transferred according to consistency dependency, a response can be obtained in real time through the joint debugging platform, codes can be directly modified according to the prompts, the following joint debugging is continued, a long-time waiting for a butt joint person of the platform to check the problem is not needed, compared with the traditional mode for solving the problem, the experience of a developer is greatly improved, the manpower consumption of the butt joint person of an open platform is greatly reduced, and the problem is avoided from being processed in 20-30 minutes.
Example five
Referring to fig. 5, fig. 5 is a schematic structural diagram of a computer device according to an embodiment of the present disclosure. As shown in fig. 5, the computer device of the embodiment of the present application includes:
A processor 502; and
the memory 501 is configured to store machine-readable instructions that, when executed by the processor 502, perform the inter-API parameter checking method of the first embodiment of the present application.
The computer equipment of the embodiment of the application can automatically verify the parameters of the API by executing the parameter verification method among the APIs without manually participating in the parameter verification of the API, so that the application has the advantage of high parameter verification efficiency of the API. For example, in the process of developing terminal joint debugging, if parameters are not transferred according to consistency dependency, a response can be obtained in real time through the joint debugging platform, codes can be directly modified according to the prompts, the following joint debugging is continued, a long-time waiting for a butt joint person of the platform to check the problem is not needed, compared with the traditional mode for solving the problem, the experience of a developer is greatly improved, the manpower consumption of the butt joint person of an open platform is greatly reduced, and the problem is avoided from being processed in 20-30 minutes.
Example six
The embodiment of the application discloses a storage medium, and the storage medium stores a computer program, and the computer program is executed by a processor to perform the inter-API parameter checking method in the first embodiment of the application.
The storage medium of the embodiment of the application can automatically verify the parameters of the API by executing the parameter verification method among the APIs without manually participating in the parameter verification of the API, so that the application has the advantage of high parameter verification efficiency of the API. For example, in the process of developing terminal joint debugging, if parameters are not transferred according to consistency dependency, a response can be obtained in real time through the joint debugging platform, codes can be directly modified according to the prompts, the following joint debugging is continued, a long-time waiting for a butt joint person of the platform to check the problem is not needed, compared with the traditional mode for solving the problem, the experience of a developer is greatly improved, the manpower consumption of the butt joint person of an open platform is greatly reduced, and the problem is avoided from being processed in 20-30 minutes.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other manners. The above-described apparatus embodiments are merely illustrative, for example, the division of units is merely a logical function division, and there may be other manners of division in actual implementation, and for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be through some communication interface, device or unit indirect coupling or communication connection, which may be in electrical, mechanical or other form.
Further, the units described as separate units may or may not be physically separate, and units displayed as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
Furthermore, functional modules in various embodiments of the present application may be integrated together to form a single portion, or each module may exist alone, or two or more modules may be integrated to form a single portion.
It should be noted that the functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM) random access Memory (Random Access Memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
In this document, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions.
The foregoing is merely exemplary embodiments of the present application and is not intended to limit the scope of the present application, and various modifications and variations may be suggested to one skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.

Claims (9)

1. An inter-API parameter verification method, wherein the method is applied to a joint debugging platform, and the method comprises:
receiving an interface calling request sent by a development terminal where a developer is located, wherein the interface calling request carries interface parameters;
judging whether the interface parameter meets a preset condition or not based on interface configuration information, if the interface parameter meets the preset condition, generating a message carrying a correct service, and if the interface parameter does not meet the preset condition, generating a message of an error prompt, wherein the error prompt comprises a modification prompt message aiming at the interface parameter;
Transmitting response information aiming at the interface call request to the development terminal, so that the development terminal modifies the interface parameters according to the message of the error prompt when the response information carries the message of the error prompt, and resends the interface call request based on the modified interface parameters;
and before the interface configuration information is based on the interface configuration information to judge whether the interface parameter meets the preset condition, the method further comprises:
receiving the interface configuration information, wherein the interface configuration information comprises a checked field, a reference step, a reference API, a reference field type and a reference field;
and saving the interface configuration information.
2. The method of claim 1, wherein the interface parameters include a target API name, an access field;
and judging whether the interface parameter meets a preset condition based on the interface configuration information, if the interface parameter meets the preset condition, generating a correct service message, and if the interface parameter does not meet the preset condition, generating a message with an error prompt, wherein the method comprises the following steps:
determining the checked field based on the target API name;
And judging whether the checked field is the same as the access field, if so, generating the correct service message, and if not, generating the message of the error prompt.
3. The method of claim 2, wherein after said determining if the checked field and the access field are the same, prior to said generating the correct service message, the method further comprises:
determining a field type of the checked field;
judging whether the field types of the access fields are consistent or not based on the field types of the checked fields, and if not, generating the message of the error prompt.
4. The method of claim 2, wherein the generating the error-prompted message comprises:
and generating the message of the false prompt based on the reference step, the reference API, the reference field type and the reference field.
5. The method of claim 2, wherein the determining the checked field based on the target API name comprises:
determining the reference API based on the target API name;
the checked field is determined based on the reference API.
6. An inter-API parameter checking method, wherein the method is applied to a development terminal, and the method comprises:
an interface call request is sent to a joint debugging platform, wherein the interface call request carries interface parameters, so that the joint debugging platform judges whether the interface parameters meet preset conditions or not and returns response information for the interface call request;
when the response information carries a message of an error prompt, modifying the interface parameter according to the message of the error prompt, and resending the interface calling request based on the modified interface parameter;
and, the method further comprises:
and sending interface configuration information to enable the joint debugging platform to receive the interface configuration information and store the interface configuration information before executing judging whether the interface parameters meet preset conditions based on the interface configuration information, wherein the interface configuration information comprises a checked field, a reference step, a reference API, a reference field type and a reference field.
7. An inter-API parameter checking apparatus, the apparatus being applied to a joint debugging platform, the apparatus comprising:
the receiving module is used for receiving an interface calling request sent by a development terminal where a developer is located, wherein the interface calling request carries interface parameters;
The first judging module is used for judging whether the interface parameter meets a preset condition or not based on the interface configuration information, generating a message carrying a correct service if the interface parameter meets the preset condition, and generating a message of an error prompt if the interface parameter does not meet the preset condition, wherein the error prompt comprises a modified prompt message aiming at the interface parameter;
the first sending module is used for sending response information aiming at the interface calling request to the development terminal, so that when the response information carries the message of the error prompt, the development terminal modifies the interface parameter according to the message of the error prompt and resends the interface calling request based on the modified interface parameter;
and the device is further used for executing receiving the interface configuration information and storing the interface configuration information before judging whether the interface parameters meet preset conditions based on the interface configuration information, wherein the interface configuration information comprises a checked field, a reference step, a reference API, a reference field type and a reference field.
8. A computer device, comprising:
A processor; and
a memory configured to store machine-readable instructions that, when executed by the processor, perform the inter-API parameter checking method according to any of claims 1-6.
9. A storage medium storing a computer program for executing the inter-API parameter checking method according to any one of claims 1-6 by a processor.
CN202210686333.9A 2022-06-16 2022-06-16 inter-API parameter verification method and device, computer equipment and storage medium Active CN115086436B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210686333.9A CN115086436B (en) 2022-06-16 2022-06-16 inter-API parameter verification method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210686333.9A CN115086436B (en) 2022-06-16 2022-06-16 inter-API parameter verification method and device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN115086436A CN115086436A (en) 2022-09-20
CN115086436B true CN115086436B (en) 2023-05-26

Family

ID=83254451

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210686333.9A Active CN115086436B (en) 2022-06-16 2022-06-16 inter-API parameter verification method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115086436B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108089985A (en) * 2017-12-14 2018-05-29 中国平安人寿保险股份有限公司 Method of calibration, device, equipment and the readable storage medium storing program for executing of interface return parameters
CN112650488A (en) * 2019-10-12 2021-04-13 上海际链网络科技有限公司 Parameter checking method and device, storage medium and service terminal

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110908890A (en) * 2018-09-18 2020-03-24 亿阳信通股份有限公司 Automatic test method and device for interface
CN111190596A (en) * 2019-12-24 2020-05-22 平安普惠企业管理有限公司 Joint debugging method and device, computer equipment and readable storage medium
CN112328486A (en) * 2020-11-06 2021-02-05 深圳壹账通智能科技有限公司 Interface automation test method and device, computer equipment and storage medium
CN112491649A (en) * 2020-11-17 2021-03-12 中国平安财产保险股份有限公司 Interface joint debugging test method and device, electronic equipment and storage medium
CN114003432A (en) * 2021-09-28 2022-02-01 济南浪潮数据技术有限公司 Parameter checking method and device, computer equipment and storage medium
CN114490336A (en) * 2021-12-28 2022-05-13 阿里云计算有限公司 Joint debugging test method, access system, front end and storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108089985A (en) * 2017-12-14 2018-05-29 中国平安人寿保险股份有限公司 Method of calibration, device, equipment and the readable storage medium storing program for executing of interface return parameters
CN112650488A (en) * 2019-10-12 2021-04-13 上海际链网络科技有限公司 Parameter checking method and device, storage medium and service terminal

Also Published As

Publication number Publication date
CN115086436A (en) 2022-09-20

Similar Documents

Publication Publication Date Title
CN112448956B (en) Authority processing method and device of short message verification code and computer equipment
CN112561690B (en) Method, system, equipment and storage medium for testing credit card staged service interface
CN115086436B (en) inter-API parameter verification method and device, computer equipment and storage medium
CN115730935A (en) Data processing method, device and equipment based on block chain and readable storage medium
CN108345508B (en) Interface call testing method and device
CN110198222A (en) A kind of distribution power automation terminal plug and play test method and test main website
CN109214189B (en) Method, device, storage medium and electronic equipment for identifying program bugs
CN112214475B (en) Method, system, storage medium and terminal for configuring multiple data sources
CN114650211A (en) Fault repairing method, device, electronic equipment and computer readable storage medium
CN113868116A (en) Test dependent data generation method and device, server and storage medium
CN108933681A (en) A kind of cloud computing system configuration update method, control centre and cloud computing node
CN113691618A (en) Message notification method, device, message center and storage medium
CN107276852B (en) Data security detection method and terminal
CN111324368B (en) Data sharing method and server
CN113660288B (en) User number binding method and system based on block chain system
CN112040430B (en) Short message sending method, device, server and storage medium
CN117331754B (en) Abnormality problem reduction method, abnormality problem reduction system, electronic device, and computer storage medium
CN114417359B (en) Rebound mode determining method, device, equipment and storage medium
CN114390457B (en) Short message verification method, device, equipment and storage medium
CN110740120B (en) Account information processing method and device
CN116841858A (en) Service testing method and device
CN116205681A (en) Resource exchange method, device, computer equipment and computer readable storage medium
CN115220822A (en) Method and device for realizing interface baffle
CN115511563A (en) Service order verification method and device, electronic equipment and storage medium
CN115269429A (en) Test method and device, electronic equipment and computer readable 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