CN112540923A - Interface parameter checking and converting method, device, equipment and storage medium - Google Patents

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

Info

Publication number
CN112540923A
CN112540923A CN202011472836.3A CN202011472836A CN112540923A CN 112540923 A CN112540923 A CN 112540923A CN 202011472836 A CN202011472836 A CN 202011472836A CN 112540923 A CN112540923 A CN 112540923A
Authority
CN
China
Prior art keywords
parameter
preset
output
interface
verification
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
CN202011472836.3A
Other languages
Chinese (zh)
Other versions
CN112540923B (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 Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen 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 Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN202011472836.3A priority Critical patent/CN112540923B/en
Publication of CN112540923A publication Critical patent/CN112540923A/en
Priority to PCT/CN2021/090208 priority patent/WO2022126966A1/en
Application granted granted Critical
Publication of CN112540923B publication Critical patent/CN112540923B/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/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Document Processing Apparatus (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention relates to the technical field of big data, and discloses a method, a device, equipment and a storage medium for interface parameter verification and conversion, which are used for improving interface docking efficiency. The interface parameter checking and converting method comprises the following steps: acquiring a plurality of service parameters, interface identifiers, service codes and product types from a target interface access request; acquiring an input parameter tag identifier to be matched and an output parameter tag identifier to be matched, and inquiring input parameter extensible markup language configuration information according to the input parameter tag identifier to be matched; determining the parameter name, the parameter type and the verification rule of each preset incoming parameter according to the configuration information of the extensible markup language of the input parameter; carrying out rule verification on each service parameter according to the parameter name, the parameter type and the verification rule; and generating target parameter-out data based on the identifier of the output parameter label to be matched. In addition, the invention also relates to a block chain technology, and the target parameter data can be stored in the block chain node.

Description

Interface parameter checking and converting method, device, equipment and storage medium
Technical Field
The invention relates to the field of traversal query of big data technology, in particular to a method, a device, equipment and a storage medium for interface parameter verification and conversion.
Background
In the existing various interface docking schemes, the work of processing input-parameter verification, output-parameter type conversion, code value conversion and the like through a coding mode is generally developed. While this allows maximum freedom in development, in special scenarios this approach is inefficient and not easy to maintain.
For example, there is a whole set of standards for service providers and peripheral systems need to be accessed according to the standards, but some differentiation is allowed. In such a scenario, if interface docking is processed in the manner of the existing interface development every time, a large amount of condition judgment and repeated codes exist, which results in the problems of high code redundancy and low interface docking checking efficiency.
Disclosure of Invention
The invention provides an interface parameter checking and converting method, device, equipment and storage medium, which are used for reducing the redundancy of logic judgment codes and improving the interface docking efficiency.
In order to achieve the above object, a first aspect of the present invention provides an interface parameter checking and converting method, including: receiving a target interface access request, and acquiring a plurality of service parameters, interface identifiers, service codes and product types from the target interface access request; generating an input parameter label identifier to be matched and an output parameter label identifier to be matched according to a preset input parameter identifier, a preset output parameter identifier, the interface identifier, the service code and the product type, and searching an in-memory database according to the input parameter label identifier to be matched to obtain a query result; judging whether the query result is a null value or not, and determining that the query result is input parameter extensible markup language configuration information when the query result is not the null value; analyzing the configuration information of the extensible markup language of the input parameters to obtain the parameter name of each preset incoming parameter, the parameter type of each preset incoming parameter and the check rule of each preset incoming parameter, wherein the check rule of each preset parameter comprises a must-pass parameter check rule, a minimum length check rule, a maximum length check rule, a numerical precision check rule, a regular expression check rule and a preset function check rule; carrying out rule verification on each service parameter according to the parameter name of each preset incoming parameter, the parameter type of each preset incoming parameter and the verification rule of each preset incoming parameter to obtain a verification result corresponding to each service parameter; and when the verification results respectively corresponding to the plurality of service parameters pass all verification, retrieving the memory database based on the tag identifier of the output parameter to be matched to obtain configuration information of the extensible markup language of the output parameter, generating target parameter-output data based on the configuration information of the extensible markup language of the output parameter, and sending the target parameter-output data to a target terminal.
Optionally, in a first implementation manner of the first aspect of the present invention, the receiving a target interface access request, and acquiring a plurality of service parameters, interface identifiers, service codes, and product types from the target interface access request includes: receiving a target interface access request, and performing parameter analysis on the target interface access request to obtain a parameter to be verified, an interface identifier, a service code and a product type; and acquiring a target decryption interface from a preset configuration file according to the interface identifier, calling the target decryption interface to decrypt the parameter to be verified to obtain a decryption result, and reading a plurality of service parameters from the decryption result when the decryption result is not a null value.
Optionally, in a second implementation manner of the first aspect of the present invention, the generating an input parameter tag identifier to be matched and an output parameter tag identifier to be matched according to a preset input parameter identifier, a preset output parameter identifier, the interface identifier, the service code, and the product type, and retrieving an in-memory database according to the input parameter tag identifier to be matched to obtain a query result includes: performing character string splicing on a preset input parameter identifier and a preset output parameter identifier respectively with the interface identifier, the service code and the product type according to a preset parameter sequence based on a preset symbol to obtain an input parameter label identifier to be matched and an output parameter label identifier to be matched; and setting the input parameter label identifier to be matched as a target key, inquiring from the memory database according to the target key to obtain a target value, and setting the target value as an inquiry result.
Optionally, in a third implementation manner of the first aspect of the present invention, the analyzing the extensible markup language configuration information of the input parameter to obtain a parameter name of each preset incoming parameter, a parameter type of each preset incoming parameter, and a check rule of each preset incoming parameter, where the check rule of each preset parameter includes a must-pass parameter check rule, a minimum length check rule, a maximum length check rule, a numerical precision check rule, a regular expression check rule, and a preset function check rule, includes: determining an architecture schema type corresponding to the input parameter extensible markup language configuration information, and analyzing the input parameter extensible markup language configuration information according to a data structure of the schema type to obtain document object model tree node data; and traversing and reading the document object model tree node data to obtain a parameter name of each preset incoming parameter, a parameter type of each preset incoming parameter and a check rule of each preset incoming parameter, wherein the check rule of each preset incoming parameter comprises a must-pass parameter check rule, a minimum length check rule, a maximum length check rule, a numerical precision check rule, a regular expression check rule and a preset function check rule.
Optionally, in a fourth implementation manner of the first aspect of the present invention, the performing rule verification on each service parameter according to the parameter name of each preset incoming parameter, the parameter type of each preset incoming parameter, and the verification rule of each preset incoming parameter to obtain the verification result corresponding to each service parameter includes: performing rule sorting on a necessary transmission parameter check rule, a minimum length check rule, a maximum length check rule, a numerical precision check rule, a regular expression check rule and a preset function check rule corresponding to each preset transmission parameter according to a preset check priority from high to low to obtain a sorted check rule of each preset transmission parameter; sequentially carrying out rule verification on each service parameter based on the parameter name of each preset incoming parameter, the parameter type of each preset incoming parameter and the sequenced verification rule of each preset incoming parameter to obtain a verification result corresponding to each service parameter; if the verification result corresponding to at least one service parameter is not a preset value, determining that the parameter verification fails, generating warning information according to a preset template, and sending the warning information to a target terminal; and if the verification result corresponding to each service parameter is a preset value, determining that all the verification results corresponding to the plurality of service parameters respectively pass verification.
Optionally, in a fifth implementation manner of the first aspect of the present invention, when all verification results corresponding to the service parameters respectively pass, retrieving the memory database based on the tag identifier of the output parameter to be matched to obtain configuration information of the extensible markup language of the output parameter, generating target parameter-output data based on the configuration information of the extensible markup language of the output parameter, and sending the target parameter-output data to a target terminal, the method includes: when the verification results respectively corresponding to the plurality of service parameters pass all verification, retrieving the memory database based on the tag identifier of the output parameter to be matched to obtain extensible markup language configuration information of the output parameter, and performing data analysis on the extensible markup language configuration information of the output parameter to obtain a plurality of preset output parameters, wherein each preset output parameter comprises an original name of the output parameter, a target name of the output parameter, a default value of the output parameter, a conversion function of the output parameter and a type of the output parameter; when the output parameter conversion function of each preset output parameter is a null value, setting the output parameter target name of each preset output parameter and the output parameter default value of each preset output parameter as the interface parameter output data of each preset output parameter; when the parameter-output conversion function of each preset output parameter is not null, setting the output parameter original name of each preset output parameter, the output parameter target name of each preset output parameter and the output parameter type of each preset output parameter as input parameters corresponding to the output parameter conversion function of each preset output parameter, acquiring an interface parameter-output value output by the output parameter conversion function of each preset output parameter, and setting the parameter-output name of each preset output parameter and the output interface parameter-output value as interface parameter-output data of each preset output parameter; and carrying out data encapsulation on interface parameter data respectively corresponding to a plurality of preset output parameters to obtain target parameter data, and sending the target parameter data to a target terminal so that the target terminal analyzes and displays the target parameter data.
Optionally, in a sixth implementation manner of the first aspect of the present invention, when all verification results corresponding to the service parameters respectively pass, the memory database is retrieved based on the tag identifier of the output parameter to be matched to obtain extensible markup language configuration information of the output parameter, target parameter-output data is generated based on the extensible markup language configuration information of the output parameter, and the target parameter-output data is sent to a target terminal, where the interface parameter verification and conversion method further includes: recording the target interface access request, the plurality of service parameters and the check result corresponding to each service parameter into a preset operation log; and carrying out data analysis on the preset operation log at regular time to obtain an interface verification report, and sending the interface verification report to the target terminal.
The second aspect of the present invention provides an interface parameter verifying and converting apparatus, including: the acquisition module is used for receiving a target interface access request and acquiring a plurality of service parameters, interface identifiers, service codes and product types from the target interface access request; the retrieval module is used for generating an input parameter label identifier to be matched and an output parameter label identifier to be matched according to a preset input parameter identifier, a preset output parameter identifier, the interface identifier, the service code and the product type, and retrieving the memory database according to the input parameter label identifier to be matched to obtain a query result; the judging module is used for judging whether the query result is a null value or not, and when the query result is not the null value, determining that the query result is input parameter extensible markup language configuration information; the analysis module is used for analyzing the configuration information of the extensible markup language of the input parameters to obtain the parameter name of each preset incoming parameter, the parameter type of each preset incoming parameter and the check rule of each preset incoming parameter, wherein the check rule of each preset parameter comprises a mandatory parameter check rule, a minimum length check rule, a maximum length check rule, a numerical precision check rule, a regular expression check rule and a preset function check rule; the verification module is used for carrying out rule verification on each service parameter according to the parameter name of each preset incoming parameter, the parameter type of each preset incoming parameter and the verification rule of each preset incoming parameter to obtain a verification result corresponding to each service parameter; and the generating module is used for retrieving the memory database based on the tag identifier of the output parameter to be matched when all the verification results corresponding to the plurality of service parameters pass through, obtaining the configuration information of the extensible markup language of the output parameter, generating target parameter-output data based on the configuration information of the extensible markup language of the output parameter, and sending the target parameter-output data to a target terminal.
Optionally, in a first implementation manner of the second aspect of the present invention, the obtaining module is specifically configured to: receiving a target interface access request, and performing parameter analysis on the target interface access request to obtain a parameter to be verified, an interface identifier, a service code and a product type; and acquiring a target decryption interface from a preset configuration file according to the interface identifier, calling the target decryption interface to decrypt the parameter to be verified to obtain a decryption result, and reading a plurality of service parameters from the decryption result when the decryption result is not a null value.
Optionally, in a second implementation manner of the second aspect of the present invention, the retrieving module is specifically configured to: performing character string splicing on a preset input parameter identifier and a preset output parameter identifier respectively with the interface identifier, the service code and the product type according to a preset parameter sequence based on a preset symbol to obtain an input parameter label identifier to be matched and an output parameter label identifier to be matched; and setting the input parameter label identifier to be matched as a target key, inquiring from the memory database according to the target key to obtain a target value, and setting the target value as an inquiry result.
Optionally, in a third implementation manner of the second aspect of the present invention, the parsing module is specifically configured to: determining an architecture schema type corresponding to the input parameter extensible markup language configuration information, and analyzing the input parameter extensible markup language configuration information according to a data structure of the schema type to obtain document object model tree node data; and traversing and reading the document object model tree node data to obtain a parameter name of each preset incoming parameter, a parameter type of each preset incoming parameter and a check rule of each preset incoming parameter, wherein the check rule of each preset incoming parameter comprises a must-pass parameter check rule, a minimum length check rule, a maximum length check rule, a numerical precision check rule, a regular expression check rule and a preset function check rule.
Optionally, in a fourth implementation manner of the second aspect of the present invention, the verification module is specifically configured to: performing rule sorting on a necessary transmission parameter check rule, a minimum length check rule, a maximum length check rule, a numerical precision check rule, a regular expression check rule and a preset function check rule corresponding to each preset transmission parameter according to a preset check priority from high to low to obtain a sorted check rule of each preset transmission parameter; sequentially carrying out rule verification on each service parameter based on the parameter name of each preset incoming parameter, the parameter type of each preset incoming parameter and the sequenced verification rule of each preset incoming parameter to obtain a verification result corresponding to each service parameter; if the verification result corresponding to at least one service parameter is not a preset value, determining that the parameter verification fails, generating warning information according to a preset template, and sending the warning information to a target terminal; and if the verification result corresponding to each service parameter is a preset value, determining that all the verification results corresponding to the plurality of service parameters respectively pass verification.
Optionally, in a fifth implementation manner of the second aspect of the present invention, the generating module is specifically configured to: when the verification results respectively corresponding to the plurality of service parameters pass all verification, retrieving the memory database based on the tag identifier of the output parameter to be matched to obtain extensible markup language configuration information of the output parameter, and performing data analysis on the extensible markup language configuration information of the output parameter to obtain a plurality of preset output parameters, wherein each preset output parameter comprises an original name of the output parameter, a target name of the output parameter, a default value of the output parameter, a conversion function of the output parameter and a type of the output parameter; when the output parameter conversion function of each preset output parameter is a null value, setting the output parameter target name of each preset output parameter and the output parameter default value of each preset output parameter as the interface parameter output data of each preset output parameter; when the parameter-output conversion function of each preset output parameter is not null, setting the output parameter original name of each preset output parameter, the output parameter target name of each preset output parameter and the output parameter type of each preset output parameter as input parameters corresponding to the output parameter conversion function of each preset output parameter, acquiring an interface parameter-output value output by the output parameter conversion function of each preset output parameter, and setting the parameter-output name of each preset output parameter and the output interface parameter-output value as interface parameter-output data of each preset output parameter; and carrying out data encapsulation on interface parameter data respectively corresponding to a plurality of preset output parameters to obtain target parameter data, and sending the target parameter data to a target terminal so that the target terminal analyzes and displays the target parameter data.
Optionally, in a sixth implementation manner of the second aspect of the present invention, the interface parameter verifying and converting apparatus further includes: the recording module is used for recording the target interface access request, the plurality of service parameters and the check result corresponding to each service parameter into a preset operation log; and the analysis module is used for carrying out data analysis on the preset operation log at regular time to obtain an interface verification report and sending the interface verification report to the target terminal.
A third aspect of the present invention provides an interface parameter verifying and converting apparatus, including: a memory and at least one processor, the memory having instructions stored therein; the at least one processor calls the instruction in the memory to enable the interface parameter verification and conversion equipment to execute the interface parameter verification and conversion method.
A fourth aspect of the present invention provides a computer-readable storage medium having stored therein instructions, which, when run on a computer, cause the computer to execute the above-mentioned interface parameter checking and converting method.
In the technical scheme provided by the invention, an input parameter label identifier to be matched and an output parameter label identifier to be matched are generated through a preset input parameter identifier, a preset output parameter identifier, an interface identifier, a service code and a product type, and input parameter extensible markup language configuration information and output parameter extensible markup language configuration information are respectively determined according to the input parameter label identifier to be matched and the output parameter label identifier to be matched; and parameter rules are carried out according to the input parameter extensible markup language configuration information and the output parameter extensible markup language configuration information respectively, and target parameter output data are generated, so that the redundancy of logic judgment codes is reduced, and the interface docking efficiency is improved.
Drawings
FIG. 1 is a diagram of an embodiment of a method for checking and converting interface parameters according to an embodiment of the present invention;
FIG. 2 is a diagram of another embodiment of a method for checking and converting interface parameters according to an embodiment of the present invention;
FIG. 3 is a diagram of an embodiment of an interface parameter verifying and converting apparatus according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of another embodiment of an interface parameter verification and conversion apparatus according to an embodiment of the present invention;
fig. 5 is a schematic diagram of an embodiment of an interface parameter checking and converting device in an embodiment of the present invention.
Detailed Description
The embodiment of the invention provides an interface parameter checking and converting method, device, equipment and storage medium, which are used for performing parameter rules and generating target parameter output data according to input parameter extensible markup language configuration information and output parameter extensible markup language configuration information, reducing redundancy of logic judgment codes and improving interface docking efficiency.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims, as well as in the drawings, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It will be appreciated that the data so used may be interchanged under appropriate circumstances such that the embodiments described herein may be practiced otherwise than as specifically illustrated or described herein. Furthermore, the terms "comprises," "comprising," or "having," and any variations thereof, are intended to cover non-exclusive inclusions, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
For convenience of understanding, a detailed flow of the embodiment of the present invention is described below, and referring to fig. 1, an embodiment of the method for checking and converting interface parameters in the embodiment of the present invention includes:
101. and receiving a target interface access request, and acquiring a plurality of service parameters, interface identifiers, service codes and product types from the target interface access request.
The plurality of service parameters are parameters to be checked in the target interface access request, and include parameter names and parameter values, and the parameter values can be preset according to actual requirements. The server checks a plurality of service parameters one by one, further, the server determines a check rule of each service parameter according to an interface identifier, a service code and a product type, the check rules corresponding to the plurality of service parameters of the same interface are packaged in advance according to a preset data format and are stored in a memory database, wherein the preset data format is an extensible markup language (XML) data format, the memory database can adopt a remote service dictionary redis or a memory mapping map, and can also adopt other data structures, and the specific details are not limited herein.
Further, the target parameter data is stored in the blockchain database, which is not limited herein.
It is to be understood that the execution subject of the present invention may be an interface parameter verifying and converting apparatus, and may also be a terminal or a server, which is not limited herein. The embodiment of the present invention is described by taking a server as an execution subject.
102. And generating an input parameter label identifier to be matched and an output parameter label identifier to be matched according to the preset input parameter identifier, the preset output parameter identifier, the interface identifier, the service code and the product type, and searching the memory database according to the input parameter label identifier to be matched to obtain a query result.
The interface identifier is used for describing different interface information, the service code is used for describing a service module called by the interface, and the product type is used for indicating different product iteration types. Specifically, the server performs character string combination and splicing on a preset input parameter identifier, a preset output parameter identifier, an interface identifier, a service code and a product type to obtain an input parameter unique identifier and an output parameter unique identifier, and sets the input parameter unique identifier and the output parameter unique identifier as an input parameter tag identifier to be matched and an output parameter tag identifier to be matched respectively, wherein the input parameter tag identifier to be matched is used for indicating a text segment tag value in the content of the extensible markup language XML file. The server splices the input parameter label identifiers to be matched through the interface identifiers, the service codes and the product types, and the uniqueness and the orderliness of the input parameter label identifiers to be matched are ensured.
103. And judging whether the query result is a null value, and determining the query result as the configuration information of the extensible markup language of the input parameter when the query result is not the null value.
The null value may be a null character string, may also be 0, and may also be other types of numerical values, which is not limited herein. If the query result is a null value, the server generates prompt information and sends the prompt information to the target terminal; and if the query result is not a null value, the server determines that the query result is input parameter extensible markup language configuration information, wherein the input parameter extensible markup language configuration information is XML structure data which is preset and stored in the memory database. Therefore, the server does not need to judge the correctness of the data format of the configuration information of the extensible markup language of the input parameter.
104. Analyzing the configuration information of the extensible markup language of the input parameters to obtain the parameter name of each preset incoming parameter, the parameter type of each preset incoming parameter and the check rule of each preset incoming parameter, wherein the check rule of each preset parameter comprises a mandatory parameter check rule, a minimum length check rule, a maximum length check rule, a numerical precision check rule, a regular expression check rule and a preset function check rule.
The configuration information of the input parameter extensible markup language comprises a plurality of field elements for indicating the self-defining data part, and the field number of the field elements is the same as the number of the plurality of service parameters. The mandatory parameter check rule is used for indicating that a parameter value corresponding to each service parameter cannot be a null value, the minimum length check rule and the maximum length check rule are respectively used for indicating a character string length range of the parameter value corresponding to each service parameter, the regular expression check rule is used for checking the parameter value of each service parameter in a regular expression mode, and the preset function check rule is used for indicating that the parameter value of each service parameter is checked according to a preset function. Further, the server reads the parameter name of each preset incoming parameter, the parameter type of each preset incoming parameter and the check rule of each preset incoming parameter from the input parameter extensible markup language configuration information.
105. And carrying out rule verification on each service parameter according to the parameter name of each preset incoming parameter, the parameter type of each preset incoming parameter and the verification rule of each preset incoming parameter to obtain a verification result corresponding to each service parameter.
Specifically, the server performs parameter mandatory transmission verification on each service parameter according to the mandatory transmission parameter verification rule. For example, when the required value in the interface structure of the input parameter extensible markup language configuration information is "true", the server searches for a plurality of service parameters according to the parameter name of each preset incoming parameter, and when the parameter name of the preset incoming parameter does not exist in the plurality of service parameters, the server generates prompt information, where the prompt information is used to indicate that the necessary transmission field of the corresponding interface is an empty error. Further, the server can also perform parameter type verification, a minimum length verification rule, a maximum length verification rule, a regular expression verification rule and a preset function verification rule on each service parameter respectively to obtain a verification result corresponding to each service parameter.
106. And when all the verification results respectively corresponding to the plurality of service parameters pass the verification, searching the memory database based on the tag identifier of the output parameter to be matched to obtain the configuration information of the extensible markup language of the output parameter, generating target parameter-output data based on the configuration information of the extensible markup language of the output parameter, and sending the target parameter-output data to the target terminal.
That is, the server performs logical processing on the parameter function parameter entering mode, and finally takes the function return value as the target parameter exit data. When the verification results respectively corresponding to the plurality of service parameters are all verified, the server acquires the extensible markup language configuration information of the output parameters corresponding to the tag identifiers of the output parameters to be matched from the memory database; the server generates data and encapsulates the data based on the configuration information of the extensible markup language of the output parameter to obtain target parameter output data, for example, the server performs data type conversion on the interface parameter output value, or the server generates random data according to the parameter output type, and the server performs desensitization processing on sensitive data.
It should be noted that the output parameter extensibility markup language configuration information is used to indicate the original name of the output parameter, the target name of the output parameter, the value of the output parameter, the conversion function of the output parameter, and the data type of the output parameter that are returned by the server for the target interface access request.
In the embodiment of the invention, an input parameter label identifier to be matched and an output parameter label identifier to be matched are generated through a preset input parameter identifier, a preset output parameter identifier, an interface identifier, a service code and a product type, and input parameter extensible markup language configuration information and output parameter extensible markup language configuration information are respectively determined according to the input parameter label identifier to be matched and the output parameter label identifier to be matched; and parameter rules are carried out according to the input parameter extensible markup language configuration information and the output parameter extensible markup language configuration information respectively, and target parameter output data are generated, so that the redundancy of logic judgment codes is reduced, and the interface docking efficiency is improved.
Referring to fig. 2, another embodiment of the interface parameter checking and converting method according to the embodiment of the present invention includes:
201. and receiving a target interface access request, and acquiring a plurality of service parameters, interface identifiers, service codes and product types from the target interface access request.
Wherein the target interface access request includes a plurality of service parameters, an interface identifier, a service code, and a product type. Optionally, the server receives the target interface access request, and performs parameter analysis on the target interface access request to obtain a parameter to be verified, an interface identifier, a service code, and a product type. Further, when the parameter names of the parameter to be verified, the interface identifier, the service code and the product type are respectively consistent with preset parameter names, the server respectively judges whether the parameter values of the parameter to be verified, the interface identifier, the service code and the product type are null values, and when the parameter values of the parameter to be verified, the interface identifier, the service code and the product type are not null values, the server determines that the parameter verification is successful. The preset parameter name may be pre-stored in a preset file or a preset data table, and is mapped and stored with an interface identifier (e.g., an interface address) of the target interface access request.
And then, the server acquires a target decryption interface from a preset configuration file according to the interface identifier, calls the target decryption interface to decrypt the parameters to be verified to obtain a decryption result, and reads a plurality of service parameters from the decryption result when the decryption result is not a null value. Further, the server may obtain a preset decryption key from the cache, and decrypt the to-be-verified parameter (which is an encrypted character string) according to a preset decryption algorithm and the preset decryption key to obtain a decryption result.
202. And performing character string splicing on the preset input parameter identifier and the preset output parameter identifier, the interface identifier, the service code and the product type according to a preset parameter sequence based on a preset symbol to obtain an input parameter label identifier to be matched and an output parameter label identifier to be matched.
The preset parameter sequence may be an interface identifier, a service code, a product type, and a sequence of a preset input parameter identifier/a preset output parameter identifier, or may be other sequences, and is not limited herein. That is, the server sets the preset input parameter identifier and the preset output parameter identifier as a prefix or a suffix. For example, the preset input parameter identifier is inner, the preset output parameter identifier is outer, the interface identifier interfaceId is "lonappl", the service code bankCode is "avitcc", and the product type productType is "1". The preset symbol may be "_", or may be other symbols, and is not limited herein. When the preset input parameter identifier and the preset output parameter identifier are prefixes, the server performs character string splicing according to the preset parameter sequence by using a preset function to obtain that the input parameter tag identifier to be matched is 'inner _ Loanappl _ AVICTC _ 1', and the output parameter tag identifier to be matched is 'outer _ Loanappl _ AVICTC _ 1'. When the preset input parameter identifier and the preset output parameter identifier are suffixes, the to-be-matched input parameter tag identifier generated by the server is "Loanappl _ AVICTC _1_ inner", and the to-be-matched output parameter tag identifier is "Loanappl _ AVICTC _1_ outer", so that the safety of the to-be-matched input parameter tag identifier and the to-be-matched output parameter tag identifier is improved. The preset function may be a string splicing function join (), or may be another function, which is not limited herein.
203. And setting the input parameter label identifier to be matched as a target key, inquiring from the memory database according to the target key to obtain a target value, and setting the target value as an inquiry result.
The input parameter tag identifiers to be matched correspond to the query results one by one, and the query results can be null values or data in an XML format. It can be understood that the server stores data through the memory database, and the data reading efficiency is improved.
204. And judging whether the query result is a null value, and determining the query result as the configuration information of the extensible markup language of the input parameter when the query result is not the null value.
The step 204 is similar to the step 103, and detailed description thereof is omitted here.
205. Analyzing the configuration information of the extensible markup language of the input parameters to obtain the parameter name of each preset incoming parameter, the parameter type of each preset incoming parameter and the check rule of each preset incoming parameter, wherein the check rule of each preset parameter comprises a mandatory parameter check rule, a minimum length check rule, a maximum length check rule, a numerical precision check rule, a regular expression check rule and a preset function check rule.
For example, the server represents the must-pass parameter check rule by using required ═ true ", the server represents the minimum length check rule by using minLength ═ 1, the server represents the maximum length check rule by using maxLength ═ 20, and the server represents the regular expression check rule by using regular exp ═ d {8} $", where "^ d {8} $" is used to indicate that the date can only be 8-bit numbers; the server adopts custom valid ═ xxxx "to represent the preset function check rule. It can be understood that the check rule corresponding to each preset incoming parameter is any one or a combination of any several of a mandatory parameter check rule, a minimum length check rule, a maximum length check rule, a regular expression check rule, and a preset function check rule, and is not limited herein.
Optionally, the server determines an architecture schema type corresponding to the input parameter extensible markup language configuration information, and analyzes the input parameter extensible markup language configuration information according to a data structure of the schema type to obtain document object model tree node data; the server reads node data of the document object model tree in a traversing mode to obtain a parameter name of each preset incoming parameter, a parameter type of each preset incoming parameter and a check rule of each preset incoming parameter, wherein the check rule of each preset incoming parameter comprises a must-pass parameter check rule, a minimum length check rule, a maximum length check rule, a numerical precision check rule, a regular expression check rule and a preset function check rule.
206. And carrying out rule verification on each service parameter according to the parameter name of each preset incoming parameter, the parameter type of each preset incoming parameter and the verification rule of each preset incoming parameter to obtain a verification result corresponding to each service parameter.
It should be noted that, the server performs parameter verification on each service parameter in sequence according to the mandatory parameter verification rule, the minimum length verification rule, the maximum length verification rule, the numerical precision verification rule, the regular expression verification rule and the preset function verification rule. For example, the server sets the preset function check rule to have a high priority, the server executes the check logic corresponding to the preset function check rule first, and if the check does not pass, the server reports an error. And the server sets that the priority of the regular expression check rule is low, executes the regular expression check rule after the preset function check rule passes the check, and reports an error if the check fails.
Optionally, the server performs rule sorting on the mandatory parameter check rule, the minimum length check rule, the maximum length check rule, the numerical precision check rule, the regular expression check rule and the preset function check rule corresponding to each preset incoming parameter according to the preset check priority from high to low, so as to obtain a sorted check rule of each preset incoming parameter; the server sequentially carries out rule verification on each service parameter based on the parameter name of each preset incoming parameter, the parameter type of each preset incoming parameter and the sequenced verification rule of each preset incoming parameter to obtain a verification result corresponding to each service parameter; if the verification result corresponding to at least one service parameter is not a preset value, the server determines that the parameter verification fails, generates warning information according to a preset template, and sends the warning information to the target terminal; and if the verification result corresponding to each service parameter is a preset value, the server determines that the verification results corresponding to the plurality of service parameters respectively are all verified.
207. And when all the verification results respectively corresponding to the plurality of service parameters pass the verification, searching the memory database based on the tag identifier of the output parameter to be matched to obtain the configuration information of the extensible markup language of the output parameter, generating target parameter-output data based on the configuration information of the extensible markup language of the output parameter, and sending the target parameter-output data to the target terminal.
It should be noted that the server may also generate an output parameter template in advance, and when the server is connected to multiple third-party interfaces, the server forms differentiated parameter-output data by configuring an XML. For example, the server converts the parameter name to SYSTEM _ SERIAL to the parameter name applNo. The server can not only verify the access parameters, but also convert and configure the output parameters. That is, when the core code logic is fixed, for a plurality of third-party interfaces with differences, the server needs to configure a plurality of XML configurations, and the parameters are sent to each third-party interface, so that the third-party interfaces are assembled and converted according to the corresponding XML, and the structure and variable names of the final outgoing parameters can be controlled.
Optionally, when all the verification results respectively corresponding to the plurality of service parameters pass the verification, the server searches the memory database based on the tag identifier of the output parameter to be matched to obtain extensible markup language configuration information of the output parameter, and performs data analysis on the extensible markup language configuration information of the output parameter to obtain a plurality of preset output parameters, wherein each preset output parameter comprises an original name of the output parameter, a target name of the output parameter, a default value of the output parameter, a conversion function of the output parameter and a type of the output parameter; when the output parameter conversion function of each preset output parameter is a null value, the server sets the output parameter target name of each preset output parameter and the output parameter default value of each preset output parameter as the interface parameter output data of each preset output parameter; when the parameter-output conversion function of each preset output parameter is not null, the server sets the output parameter original name of each preset output parameter, the output parameter target name of each preset output parameter and the output parameter type of each preset output parameter as input parameters corresponding to the output parameter conversion function of each preset output parameter, acquires an interface parameter-output value output by the output parameter conversion function of each preset output parameter, and sets the parameter-output name of each preset output parameter and the output interface parameter-output value as interface parameter-output data of each preset output parameter; and the server performs data encapsulation on the interface parameter data respectively corresponding to the plurality of preset output parameters to obtain target parameter data, and sends the target parameter data to the target terminal so that the target terminal analyzes and displays the target parameter data.
Further, the server records the target interface access request, the plurality of service parameters and the check result corresponding to each service parameter into a preset operation log; and the server performs data analysis on the preset operation log at regular time to obtain an interface verification report, and sends the interface verification report to the target terminal.
In the embodiment of the invention, an input parameter label identifier to be matched and an output parameter label identifier to be matched are generated through a preset input parameter identifier, a preset output parameter identifier, an interface identifier, a service code and a product type, and input parameter extensible markup language configuration information and output parameter extensible markup language configuration information are respectively determined according to the input parameter label identifier to be matched and the output parameter label identifier to be matched; and parameter rules are carried out according to the input parameter extensible markup language configuration information and the output parameter extensible markup language configuration information respectively, and target parameter output data are generated, so that the redundancy of logic judgment codes is reduced, and the interface docking efficiency is improved.
The above description of the interface parameter verification and conversion method in the embodiment of the present invention, and the following description of the interface parameter verification and conversion apparatus in the embodiment of the present invention refer to fig. 3, where an embodiment of the interface parameter verification and conversion apparatus in the embodiment of the present invention includes:
an obtaining module 301, configured to receive a target interface access request, and obtain a plurality of service parameters, interface identifiers, service codes, and product types from the target interface access request;
a retrieval module 302, configured to generate an input parameter tag identifier to be matched and an output parameter tag identifier to be matched according to a preset input parameter identifier, a preset output parameter identifier, an interface identifier, a service code, and a product type, and retrieve the in-memory database according to the input parameter tag identifier to be matched to obtain a query result;
the judging module 303 is configured to judge whether the query result is a null value, and when the query result is not the null value, determine that the query result is input parameter extensible markup language configuration information;
the parsing module 304 is configured to parse the input parameter extensible markup language configuration information to obtain a parameter name of each preset incoming parameter, a parameter type of each preset incoming parameter, and a check rule of each preset incoming parameter, where the check rule of each preset parameter includes a must-pass parameter check rule, a minimum length check rule, a maximum length check rule, a numerical precision check rule, a regular expression check rule, and a preset function check rule;
the checking module 305 is configured to perform rule checking on each service parameter according to the parameter name of each preset incoming parameter, the parameter type of each preset incoming parameter, and the checking rule of each preset incoming parameter, so as to obtain a checking result corresponding to each service parameter;
and the generating module 306 is configured to, when all the verification results corresponding to the plurality of service parameters respectively pass the verification, retrieve the in-memory database based on the tag identifier of the output parameter to be matched to obtain the configuration information of the extensible markup language of the output parameter, generate target parameter-output data based on the configuration information of the extensible markup language of the output parameter, and send the target parameter-output data to the target terminal.
Further, the target parameter data is stored in the blockchain database, which is not limited herein.
In the embodiment of the invention, an input parameter label identifier to be matched and an output parameter label identifier to be matched are generated through a preset input parameter identifier, a preset output parameter identifier, an interface identifier, a service code and a product type, and input parameter extensible markup language configuration information and output parameter extensible markup language configuration information are respectively determined according to the input parameter label identifier to be matched and the output parameter label identifier to be matched; and parameter rules are carried out according to the input parameter extensible markup language configuration information and the output parameter extensible markup language configuration information respectively, and target parameter output data are generated, so that the redundancy of logic judgment codes is reduced, and the interface docking efficiency is improved.
Referring to fig. 4, another embodiment of the interface parameter verifying and converting apparatus according to the embodiment of the present invention includes:
an obtaining module 301, configured to receive a target interface access request, and obtain a plurality of service parameters, interface identifiers, service codes, and product types from the target interface access request;
a retrieval module 302, configured to generate an input parameter tag identifier to be matched and an output parameter tag identifier to be matched according to a preset input parameter identifier, a preset output parameter identifier, an interface identifier, a service code, and a product type, and retrieve the in-memory database according to the input parameter tag identifier to be matched to obtain a query result;
the judging module 303 is configured to judge whether the query result is a null value, and when the query result is not the null value, determine that the query result is input parameter extensible markup language configuration information;
the parsing module 304 is configured to parse the input parameter extensible markup language configuration information to obtain a parameter name of each preset incoming parameter, a parameter type of each preset incoming parameter, and a check rule of each preset incoming parameter, where the check rule of each preset parameter includes a must-pass parameter check rule, a minimum length check rule, a maximum length check rule, a numerical precision check rule, a regular expression check rule, and a preset function check rule;
the checking module 305 is configured to perform rule checking on each service parameter according to the parameter name of each preset incoming parameter, the parameter type of each preset incoming parameter, and the checking rule of each preset incoming parameter, so as to obtain a checking result corresponding to each service parameter;
and the generating module 306 is configured to, when all the verification results corresponding to the plurality of service parameters respectively pass the verification, retrieve the in-memory database based on the tag identifier of the output parameter to be matched to obtain the configuration information of the extensible markup language of the output parameter, generate target parameter-output data based on the configuration information of the extensible markup language of the output parameter, and send the target parameter-output data to the target terminal.
Optionally, the obtaining module 301 may be further specifically configured to:
receiving a target interface access request, and performing parameter analysis on the target interface access request to obtain a parameter to be verified, an interface identifier, a service code and a product type; and acquiring a target decryption interface from a preset configuration file according to the interface identifier, calling the target decryption interface to decrypt the parameters to be verified to obtain a decryption result, and reading a plurality of service parameters from the decryption result when the decryption result is not a null value.
Optionally, the retrieving module 302 may be further specifically configured to:
performing character string splicing on the preset input parameter identifier and the preset output parameter identifier, the interface identifier, the service code and the product type according to a preset parameter sequence based on a preset symbol to obtain an input parameter label identifier to be matched and an output parameter label identifier to be matched; and setting the input parameter label identifier to be matched as a target key, inquiring from the memory database according to the target key to obtain a target value, and setting the target value as an inquiry result.
Optionally, the parsing module 304 may be further specifically configured to:
determining an architecture schema type corresponding to the input parameter extensible markup language configuration information, and analyzing the input parameter extensible markup language configuration information according to a data structure of the schema type to obtain document object model tree node data; traversing and reading the document object model tree node data to obtain the parameter name of each preset incoming parameter, the parameter type of each preset incoming parameter and the check rule of each preset incoming parameter, wherein the check rule of each preset incoming parameter comprises a must-pass parameter check rule, a minimum length check rule, a maximum length check rule, a numerical precision check rule, a regular expression check rule and a preset function check rule.
Optionally, the checking module 305 may further be specifically configured to:
performing rule sorting on a necessary transmission parameter check rule, a minimum length check rule, a maximum length check rule, a numerical precision check rule, a regular expression check rule and a preset function check rule corresponding to each preset transmission parameter according to a preset check priority from high to low to obtain a sorted check rule of each preset transmission parameter; sequentially carrying out rule verification on each service parameter based on the parameter name of each preset incoming parameter, the parameter type of each preset incoming parameter and the sequenced verification rule of each preset incoming parameter to obtain a verification result corresponding to each service parameter; if the verification result corresponding to at least one service parameter is not a preset value, determining that the parameter verification fails, generating warning information according to a preset template, and sending the warning information to a target terminal; and if the verification result corresponding to each service parameter is a preset value, determining that all the verification results corresponding to the plurality of service parameters respectively pass verification.
Optionally, the generating module 306 may be further specifically configured to:
when all the verification results respectively corresponding to the plurality of service parameters pass the verification, retrieving the memory database based on the tag identifier of the output parameter to be matched to obtain the configuration information of the extensible markup language of the output parameter, and performing data analysis on the configuration information of the extensible markup language of the output parameter to obtain a plurality of preset output parameters, wherein each preset output parameter comprises an original name of the output parameter, a target name of the output parameter, a default value of the output parameter, a conversion function of the output parameter and a type of the output parameter; when the output parameter conversion function of each preset output parameter is a null value, setting the output parameter target name of each preset output parameter and the output parameter default value of each preset output parameter as the interface parameter output data of each preset output parameter; when the parameter-output conversion function of each preset output parameter is not null, setting the output parameter original name of each preset output parameter, the output parameter target name of each preset output parameter and the output parameter type of each preset output parameter as input parameters corresponding to the output parameter conversion function of each preset output parameter, acquiring an interface parameter-output value output by the output parameter conversion function of each preset output parameter, and setting the parameter-output name of each preset output parameter and the output interface parameter-output value as interface parameter-output data of each preset output parameter; and carrying out data encapsulation on interface parameter data respectively corresponding to the plurality of preset output parameters to obtain target parameter data, and sending the target parameter data to a target terminal so that the target terminal analyzes and displays the target parameter data.
Optionally, the interface parameter verifying and converting apparatus further includes:
a recording module 307, configured to record the target interface access request, the multiple service parameters, and the check result corresponding to each service parameter in a preset operation log; the analysis module 308 is configured to perform data analysis on the preset operation log at regular time, obtain an interface verification report, and send the interface verification report to the target terminal.
In the embodiment of the invention, an input parameter label identifier to be matched and an output parameter label identifier to be matched are generated through a preset input parameter identifier, a preset output parameter identifier, an interface identifier, a service code and a product type, and input parameter extensible markup language configuration information and output parameter extensible markup language configuration information are respectively determined according to the input parameter label identifier to be matched and the output parameter label identifier to be matched; and parameter rules are carried out according to the input parameter extensible markup language configuration information and the output parameter extensible markup language configuration information respectively, and target parameter output data are generated, so that the redundancy of logic judgment codes is reduced, and the interface docking efficiency is improved.
The interface parameter checking and converting apparatus in the embodiment of the present invention is described in detail in the above fig. 3 and fig. 4 from the perspective of modularization, and the interface parameter checking and converting apparatus in the embodiment of the present invention is described in detail in the following from the perspective of hardware processing.
Fig. 5 is a schematic structural diagram of an interface parameter checking and converting apparatus 500 according to an embodiment of the present invention, which may include one or more processors (CPUs) 510 (e.g., one or more processors) and a memory 520, and one or more storage media 530 (e.g., one or more mass storage devices) storing applications 533 or data 532, where the interface parameter checking and converting apparatus 500 may generate a relatively large difference due to different configurations or performances. Memory 520 and storage media 530 may be, among other things, transient or persistent storage. The program stored on the storage medium 530 may include one or more modules (not shown), each of which may include a series of instruction operations for the interface parameter verification and conversion apparatus 500. Still further, the processor 510 may be configured to communicate with the storage medium 530 and execute a series of instruction operations in the storage medium 530 on the interface parameter verification and translation device 500.
The interface parameter verification and translation device 500 may also include one or more power supplies 540, one or more wired or wireless network interfaces 550, one or more input-output interfaces 560, and/or one or more operating systems 531, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, etc. It will be appreciated by those skilled in the art that the interface parameter verification and translation device configuration shown in FIG. 5 does not constitute a limitation of the interface parameter verification and translation device, and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
The present invention also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium, or a volatile computer-readable storage medium, having stored therein instructions, which, when executed on a computer, cause the computer to perform the steps of the interface parameter checking and converting method.
The present invention further provides an interface parameter verifying and converting device, where the interface parameter verifying and converting device includes a memory and a processor, where the memory stores instructions, and the instructions, when executed by the processor, enable the processor to execute the steps of the interface parameter verifying and converting method in the foregoing embodiments.
Further, the computer-readable storage medium may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function, and the like; the storage data area may store data created according to the use of the blockchain node, and the like.
The block chain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
The integrated unit, if implemented in the form of a software functional unit 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 invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a read-only memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (10)

1. An interface parameter verification and conversion method, characterized in that the interface parameter verification and conversion method comprises:
receiving a target interface access request, and acquiring a plurality of service parameters, interface identifiers, service codes and product types from the target interface access request;
generating an input parameter label identifier to be matched and an output parameter label identifier to be matched according to a preset input parameter identifier, a preset output parameter identifier, the interface identifier, the service code and the product type, and searching an in-memory database according to the input parameter label identifier to be matched to obtain a query result;
judging whether the query result is a null value or not, and determining that the query result is input parameter extensible markup language configuration information when the query result is not the null value;
analyzing the configuration information of the extensible markup language of the input parameters to obtain the parameter name of each preset incoming parameter, the parameter type of each preset incoming parameter and the check rule of each preset incoming parameter, wherein the check rule of each preset parameter comprises a must-pass parameter check rule, a minimum length check rule, a maximum length check rule, a numerical precision check rule, a regular expression check rule and a preset function check rule;
carrying out rule verification on each service parameter according to the parameter name of each preset incoming parameter, the parameter type of each preset incoming parameter and the verification rule of each preset incoming parameter to obtain a verification result corresponding to each service parameter;
and when the verification results respectively corresponding to the plurality of service parameters pass all verification, retrieving the memory database based on the tag identifier of the output parameter to be matched to obtain configuration information of the extensible markup language of the output parameter, generating target parameter-output data based on the configuration information of the extensible markup language of the output parameter, and sending the target parameter-output data to a target terminal.
2. The interface parameter verification and conversion method of claim 1, wherein the receiving a target interface access request, and obtaining a plurality of service parameters, interface identifiers, service codes and product types from the target interface access request comprises:
receiving a target interface access request, and performing parameter analysis on the target interface access request to obtain a parameter to be verified, an interface identifier, a service code and a product type;
and acquiring a target decryption interface from a preset configuration file according to the interface identifier, calling the target decryption interface to decrypt the parameter to be verified to obtain a decryption result, and reading a plurality of service parameters from the decryption result when the decryption result is not a null value.
3. The interface parameter verification and conversion method according to claim 1, wherein the generating an input parameter tag identifier to be matched and an output parameter tag identifier to be matched according to a preset input parameter identifier, a preset output parameter identifier, the interface identifier, the service code and the product type, and retrieving an in-memory database according to the input parameter tag identifier to be matched to obtain a query result includes:
performing character string splicing on a preset input parameter identifier and a preset output parameter identifier respectively with the interface identifier, the service code and the product type according to a preset parameter sequence based on a preset symbol to obtain an input parameter label identifier to be matched and an output parameter label identifier to be matched;
and setting the input parameter label identifier to be matched as a target key, inquiring from the memory database according to the target key to obtain a target value, and setting the target value as an inquiry result.
4. The method as claimed in claim 1, wherein the parsing the configuration information of the extensible markup language of the input parameter to obtain a parameter name of each preset incoming parameter, a parameter type of each preset incoming parameter, and a check rule of each preset incoming parameter, wherein the check rule of each preset parameter includes a must-pass parameter check rule, a minimum length check rule, a maximum length check rule, a numerical precision check rule, a regular expression check rule, and a preset function check rule, includes:
determining an architecture schema type corresponding to the input parameter extensible markup language configuration information, and analyzing the input parameter extensible markup language configuration information according to a data structure of the schema type to obtain document object model tree node data;
and traversing and reading the document object model tree node data to obtain a parameter name of each preset incoming parameter, a parameter type of each preset incoming parameter and a check rule of each preset incoming parameter, wherein the check rule of each preset incoming parameter comprises a must-pass parameter check rule, a minimum length check rule, a maximum length check rule, a numerical precision check rule, a regular expression check rule and a preset function check rule.
5. The method for interface parameter verification and conversion according to claim 1, wherein the performing rule verification on each service parameter according to the parameter name of each preset incoming parameter, the parameter type of each preset incoming parameter, and the verification rule of each preset incoming parameter to obtain the verification result corresponding to each service parameter includes:
performing rule sorting on a necessary transmission parameter check rule, a minimum length check rule, a maximum length check rule, a numerical precision check rule, a regular expression check rule and a preset function check rule corresponding to each preset transmission parameter according to a preset check priority from high to low to obtain a sorted check rule of each preset transmission parameter;
sequentially carrying out rule verification on each service parameter based on the parameter name of each preset incoming parameter, the parameter type of each preset incoming parameter and the sequenced verification rule of each preset incoming parameter to obtain a verification result corresponding to each service parameter;
if the verification result corresponding to at least one service parameter is not a preset value, determining that the parameter verification fails, generating warning information according to a preset template, and sending the warning information to a target terminal;
and if the verification result corresponding to each service parameter is a preset value, determining that all the verification results corresponding to the plurality of service parameters respectively pass verification.
6. The interface parameter checking and converting method according to claim 1, wherein when all the check results corresponding to the plurality of service parameters respectively pass, retrieving the in-memory database based on the tag identifier of the output parameter to be matched to obtain configuration information of the extensible markup language of the output parameter, generating target parameter-output data based on the configuration information of the extensible markup language of the output parameter, and sending the target parameter-output data to a target terminal, the method includes:
when the verification results respectively corresponding to the plurality of service parameters pass all verification, retrieving the memory database based on the tag identifier of the output parameter to be matched to obtain extensible markup language configuration information of the output parameter, and performing data analysis on the extensible markup language configuration information of the output parameter to obtain a plurality of preset output parameters, wherein each preset output parameter comprises an original name of the output parameter, a target name of the output parameter, a default value of the output parameter, a conversion function of the output parameter and a type of the output parameter;
when the output parameter conversion function of each preset output parameter is a null value, setting the output parameter target name of each preset output parameter and the output parameter default value of each preset output parameter as the interface parameter output data of each preset output parameter;
when the parameter-output conversion function of each preset output parameter is not null, setting the output parameter original name of each preset output parameter, the output parameter target name of each preset output parameter and the output parameter type of each preset output parameter as input parameters corresponding to the output parameter conversion function of each preset output parameter, acquiring an interface parameter-output value output by the output parameter conversion function of each preset output parameter, and setting the parameter-output name of each preset output parameter and the output interface parameter-output value as interface parameter-output data of each preset output parameter;
and carrying out data encapsulation on interface parameter data respectively corresponding to a plurality of preset output parameters to obtain target parameter data, and sending the target parameter data to a target terminal so that the target terminal analyzes and displays the target parameter data.
7. The interface parameter checking and converting method according to any one of claims 1 to 6, wherein when all the check results respectively corresponding to the plurality of service parameters pass, the memory database is retrieved based on the tag identifier of the output parameter to be matched, so as to obtain extensible markup language configuration information of the output parameter, target parameter-output data is generated based on the extensible markup language configuration information of the output parameter, and the target parameter-output data is sent to a target terminal, and then the interface parameter checking and converting method further includes:
recording the target interface access request, the plurality of service parameters and the check result corresponding to each service parameter into a preset operation log;
and carrying out data analysis on the preset operation log at regular time to obtain an interface verification report, and sending the interface verification report to the target terminal.
8. An interface parameter verifying and converting apparatus, comprising:
the acquisition module is used for receiving a target interface access request and acquiring a plurality of service parameters, interface identifiers, service codes and product types from the target interface access request;
the retrieval module is used for generating an input parameter label identifier to be matched and an output parameter label identifier to be matched according to a preset input parameter identifier, a preset output parameter identifier, the interface identifier, the service code and the product type, and retrieving the memory database according to the input parameter label identifier to be matched to obtain a query result;
the judging module is used for judging whether the query result is a null value or not, and when the query result is not the null value, determining that the query result is input parameter extensible markup language configuration information;
the analysis module is used for analyzing the configuration information of the extensible markup language of the input parameters to obtain the parameter name of each preset incoming parameter, the parameter type of each preset incoming parameter and the check rule of each preset incoming parameter, wherein the check rule of each preset parameter comprises a mandatory parameter check rule, a minimum length check rule, a maximum length check rule, a numerical precision check rule, a regular expression check rule and a preset function check rule;
the verification module is used for carrying out rule verification on each service parameter according to the parameter name of each preset incoming parameter, the parameter type of each preset incoming parameter and the verification rule of each preset incoming parameter to obtain a verification result corresponding to each service parameter;
and the generating module is used for retrieving the memory database based on the tag identifier of the output parameter to be matched when all the verification results corresponding to the plurality of service parameters pass through, obtaining the configuration information of the extensible markup language of the output parameter, generating target parameter-output data based on the configuration information of the extensible markup language of the output parameter, and sending the target parameter-output data to a target terminal.
9. An interface parameter verification and conversion apparatus, characterized in that the interface parameter verification and conversion apparatus comprises: a memory and at least one processor, the memory having instructions stored therein;
the at least one processor invoking the instructions in the memory to cause the interface parameter checking and translation device to perform the interface parameter checking and translation method of any of claims 1-7.
10. A computer-readable storage medium having stored thereon instructions, which when executed by a processor, implement the interface parameter checking and converting method according to any one of claims 1 to 7.
CN202011472836.3A 2020-12-15 2020-12-15 Interface parameter checking and converting method, device, equipment and storage medium Active CN112540923B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202011472836.3A CN112540923B (en) 2020-12-15 2020-12-15 Interface parameter checking and converting method, device, equipment and storage medium
PCT/CN2021/090208 WO2022126966A1 (en) 2020-12-15 2021-04-27 Interface parameter verification and conversion method and apparatus, and device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011472836.3A CN112540923B (en) 2020-12-15 2020-12-15 Interface parameter checking and converting method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112540923A true CN112540923A (en) 2021-03-23
CN112540923B CN112540923B (en) 2022-03-25

Family

ID=75018678

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011472836.3A Active CN112540923B (en) 2020-12-15 2020-12-15 Interface parameter checking and converting method, device, equipment and storage medium

Country Status (2)

Country Link
CN (1) CN112540923B (en)
WO (1) WO2022126966A1 (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113609014A (en) * 2021-08-04 2021-11-05 深圳鼎盛电脑科技有限公司 Interface field checking method and device, storage medium and electronic equipment
CN113791762A (en) * 2021-11-17 2021-12-14 浙江太美医疗科技股份有限公司 Clinical test data conversion method and device, computer equipment and storage medium
WO2022126966A1 (en) * 2020-12-15 2022-06-23 平安科技(深圳)有限公司 Interface parameter verification and conversion method and apparatus, and device and storage medium
CN115001628A (en) * 2022-06-07 2022-09-02 北京百度网讯科技有限公司 Data encoding method and device, data decoding method and device and data structure
CN114997111A (en) * 2022-08-08 2022-09-02 太平金融科技服务(上海)有限公司深圳分公司 Service processing method, device, computer equipment and storage medium
CN115145587A (en) * 2022-07-22 2022-10-04 中国农业银行股份有限公司 Product parameter checking method and device, electronic equipment and storage medium
WO2022237506A1 (en) * 2021-05-12 2022-11-17 康键信息技术(深圳)有限公司 Method, apparatus, and device for monitoring online diagnosis service, and storage medium

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114996040B (en) * 2022-08-04 2022-10-04 飞天诚信科技股份有限公司 Service interface calling method and device
CN115334145B (en) * 2022-08-09 2024-04-12 中国建设银行股份有限公司 Service processing method and device, electronic equipment and storage medium
CN115794927B (en) * 2023-01-29 2023-05-09 北京仁科互动网络技术有限公司 Service function expansion method and system
CN116860859B (en) * 2023-09-01 2023-12-22 江西省信息中心(江西省电子政务网络管理中心 江西省信用中心 江西省大数据中心) Multi-source heterogeneous data interface creation method and device and electronic equipment
CN117893244A (en) * 2024-03-15 2024-04-16 中国海洋大学 Comprehensive management and control system for seaweed hydrothermal carbonization application based on machine learning

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018006789A1 (en) * 2016-07-04 2018-01-11 中兴通讯股份有限公司 Parameter checking method and apparatus, and network management server and computer storage medium
CN109766264A (en) * 2018-12-15 2019-05-17 深圳壹账通智能科技有限公司 Method of calibration, device, computer equipment and the storage medium of interface parameters
CN110389765A (en) * 2019-07-24 2019-10-29 深圳市盟天科技有限公司 A kind of parameter verification method and parameter verification system
CN110674376A (en) * 2019-09-09 2020-01-10 中国平安财产保险股份有限公司 Interface parameter checking method, device, equipment and computer readable storage medium
CN111158792A (en) * 2020-01-02 2020-05-15 普元信息技术股份有限公司 System and method for realizing dynamic configurable service parameter verification processing under distributed architecture

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7100153B1 (en) * 2000-07-06 2006-08-29 Microsoft Corporation Compiler generation of a late binding interface implementation
US8494832B2 (en) * 2007-06-20 2013-07-23 Sanjeev Krishnan Method and apparatus for software simulation
CN110188038B (en) * 2019-05-13 2023-07-21 青岛海尔科技有限公司 Parameter verification method and device and verification framework
CN112540923B (en) * 2020-12-15 2022-03-25 平安科技(深圳)有限公司 Interface parameter checking and converting method, device, equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018006789A1 (en) * 2016-07-04 2018-01-11 中兴通讯股份有限公司 Parameter checking method and apparatus, and network management server and computer storage medium
CN109766264A (en) * 2018-12-15 2019-05-17 深圳壹账通智能科技有限公司 Method of calibration, device, computer equipment and the storage medium of interface parameters
CN110389765A (en) * 2019-07-24 2019-10-29 深圳市盟天科技有限公司 A kind of parameter verification method and parameter verification system
CN110674376A (en) * 2019-09-09 2020-01-10 中国平安财产保险股份有限公司 Interface parameter checking method, device, equipment and computer readable storage medium
CN111158792A (en) * 2020-01-02 2020-05-15 普元信息技术股份有限公司 System and method for realizing dynamic configurable service parameter verification processing under distributed architecture

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
于美丽: "云存储数据完整性校验中数据抽样算法的研究", 《中国优秀硕士学位论文全文数据库 (信息科技辑)》 *

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022126966A1 (en) * 2020-12-15 2022-06-23 平安科技(深圳)有限公司 Interface parameter verification and conversion method and apparatus, and device and storage medium
WO2022237506A1 (en) * 2021-05-12 2022-11-17 康键信息技术(深圳)有限公司 Method, apparatus, and device for monitoring online diagnosis service, and storage medium
CN113609014A (en) * 2021-08-04 2021-11-05 深圳鼎盛电脑科技有限公司 Interface field checking method and device, storage medium and electronic equipment
CN113791762A (en) * 2021-11-17 2021-12-14 浙江太美医疗科技股份有限公司 Clinical test data conversion method and device, computer equipment and storage medium
CN115001628A (en) * 2022-06-07 2022-09-02 北京百度网讯科技有限公司 Data encoding method and device, data decoding method and device and data structure
CN115001628B (en) * 2022-06-07 2024-02-27 北京百度网讯科技有限公司 Data encoding method and device, data decoding method and device and data structure
CN115145587A (en) * 2022-07-22 2022-10-04 中国农业银行股份有限公司 Product parameter checking method and device, electronic equipment and storage medium
CN114997111A (en) * 2022-08-08 2022-09-02 太平金融科技服务(上海)有限公司深圳分公司 Service processing method, device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN112540923B (en) 2022-03-25
WO2022126966A1 (en) 2022-06-23

Similar Documents

Publication Publication Date Title
CN112540923B (en) Interface parameter checking and converting method, device, equipment and storage medium
CN112506946B (en) Service data query method, device, equipment and storage medium
CN110287109B (en) Protocol interface testing method and device, computer equipment and storage medium thereof
CN111209004B (en) Code conversion method and device
CN107341399B (en) Method and device for evaluating security of code file
CN111683066B (en) Heterogeneous system integration method, heterogeneous system integration device, computer equipment and storage medium
CN112527421A (en) Service calling method, device, equipment and storage medium
US5226148A (en) Method and apparatus for validating character strings
CN113420537B (en) Method, device, equipment and storage medium for processing electronic form data
CN112306879A (en) Interface parameter checking method, device, equipment and storage medium
CN113946546B (en) Abnormality detection method, computer storage medium, and program product
CN113495902A (en) Data processing method and data standard management system
CN111858601A (en) Tree structure data query method, device, equipment and storage medium
CN111443901A (en) Business expansion method and device based on Java reflection
CN112329043A (en) Information encryption processing method, device, computer equipment and medium
CN111708807A (en) Data flattening processing method, device, equipment and storage medium
CN113642025A (en) Interface data processing method, device, equipment and storage medium
WO2002027486A1 (en) Methods and apparatus for generating unique identifiers for software components
CN116702181A (en) Data desensitization method, system, equipment and medium based on Apache Calcite
CN115130043B (en) Database-based data processing method, device, equipment and storage medium
CN113448764A (en) Check code generation method and device, electronic equipment and computer storage medium
CN115543479A (en) Interface calling analysis method and device suitable for dynamic parameters
CN111708542B (en) Test case generation method, system, equipment and storage medium
CN111858658A (en) Data acquisition method, device, equipment and storage medium
CN113535461A (en) Configuration file based visual data verification method for interlocking lower computer

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