CN107908485B - Interface parameter transmission method, device, equipment and computer readable storage medium - Google Patents

Interface parameter transmission method, device, equipment and computer readable storage medium Download PDF

Info

Publication number
CN107908485B
CN107908485B CN201711029424.0A CN201711029424A CN107908485B CN 107908485 B CN107908485 B CN 107908485B CN 201711029424 A CN201711029424 A CN 201711029424A CN 107908485 B CN107908485 B CN 107908485B
Authority
CN
China
Prior art keywords
parameter
interface
key
configuration information
parameters
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201711029424.0A
Other languages
Chinese (zh)
Other versions
CN107908485A (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 Life Insurance Company of China Ltd
Original Assignee
Ping An Life Insurance Company of China 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 Life Insurance Company of China Ltd filed Critical Ping An Life Insurance Company of China Ltd
Priority to CN201711029424.0A priority Critical patent/CN107908485B/en
Publication of CN107908485A publication Critical patent/CN107908485A/en
Application granted granted Critical
Publication of CN107908485B publication Critical patent/CN107908485B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/541Client-server

Abstract

The invention discloses an interface parameter transmission method, a device, equipment and a computer readable storage medium, wherein the method comprises the steps of reading a configuration information group in an XM L configuration file, extracting parameters according to the current configuration information group, verifying the extracted parameters, storing the extracted parameters in a preset storage area in a key value pair mode after the verification is successful, judging whether the format of an interface request parameter is the preset format or not when the interface request parameter is received, and acquiring a return parameter corresponding to the interface request parameter from the preset storage area when the format of the interface request parameter is the preset format.

Description

Interface parameter transmission method, device, equipment and computer readable storage medium
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a method, an apparatus, a device, and a computer-readable storage medium for transferring interface parameters.
Background
The communication between the computer, the mobile phone and other equipment and the server can realize multiple functions, the various functions are realized by calling multiple interfaces through program codes, and parameter extraction and transmission processes exist among the multiple interfaces. At present, corresponding program codes are written aiming at different interface calls, namely different program codes exist in different interfaces, in order to realize the extraction and transmission of parameters among the interfaces, the program codes of the different interfaces need to be analyzed, the program codes still need to be written in the analyzing process, and the program codes and the parameter extraction and transmission operation have high coupling and are not beneficial to the maintenance of the program codes.
Disclosure of Invention
The invention mainly aims to provide an interface parameter transmission method, an interface parameter transmission device, interface parameter transmission equipment and a computer readable storage medium, and aims to solve the problems that in the prior art, program codes and parameter extraction and transmission operations are high in coupling and are not beneficial to maintaining the program codes.
In order to achieve the above object, the present invention provides an interface parameter transferring method, which includes the following steps:
reading a configuration information group in the XM L configuration file, and extracting parameters according to the current configuration information group;
checking the extracted parameters, and storing the extracted parameters in a preset storage area in a key value pair mode after the checking is successful;
when the interface request parameter is received, judging whether the format of the interface request parameter is a preset format, and when the format of the interface request parameter is the preset format, acquiring a return parameter corresponding to the interface request parameter from a preset storage area to finish the transmission of the return parameter between interfaces.
Preferably, the configuration information group includes an extraction path, an extraction value, and a variable name, and the step of reading the configuration information group in the XM L configuration file includes:
and receiving the extracted paths, the extracted values and the variable names, storing the extracted paths, the extracted values and the variable names in a grouping mode, and generating an XM L configuration file.
Preferably, the step of extracting parameters according to the configuration information group includes:
and judging whether an extraction path of the configuration information group exists or not, and extracting parameters according to the extraction path when the extraction path exists.
Preferably, the step of checking the extracted parameters and storing the extracted parameters in the preset storage area in the form of key value pairs after the checking is successful comprises:
comparing the parameters with the extracted values, and judging whether the parameters are valid or not so as to verify the parameters;
and when the parameter is valid, judging that the parameter is successfully verified, and storing the parameter and the variable name into a key value pair in a preset storage area.
Preferably, the preset format is a key-value pair format, and the step of acquiring the return parameter corresponding to the interface request parameter from the preset storage area when the format of the interface request parameter is the preset format includes:
when the format of the interface request parameter is a key-value pair format, judging whether a target key corresponding to the interface request parameter exists in a preset storage area, wherein the target key is a key in the interface request parameter corresponding to the key-value pair format in the extraction parameters stored in the key-value pair format;
when a target key corresponding to the interface request parameter exists in the preset storage area, acquiring a corresponding target value from the preset storage area according to the target key, and associating the target value with the target key to form a return parameter.
Preferably, the step of obtaining the return parameter corresponding to the interface request parameter from the preset storage area and completing the transmission of the return parameter between the interfaces includes:
when the current configuration information group is detected to finish the transmission of the return parameters between the interfaces, reading a new configuration information group in the XM L configuration file, and taking the new configuration information group as the current configuration information group;
and executing the step of extracting the parameters according to the current configuration information group until all the configuration information groups in the XM L configuration file are read.
In addition, to achieve the above object, the present invention further provides an interface parameter transferring apparatus, including:
the reading module is used for reading the configuration information group in the XM L configuration file and extracting parameters according to the current configuration information group;
the checking module is used for checking the extracted parameters and storing the extracted parameters in a preset storage area in a key value pair mode after the checking is successful;
and the acquisition module is used for judging whether the format of the interface request parameter is a preset format or not when the interface request parameter is received, acquiring a return parameter corresponding to the interface request parameter from a preset storage area when the format of the interface request parameter is the preset format, and finishing the transmission of the return parameter between the interfaces.
Preferably, the configuration information group includes an extraction path, an extraction value, and a variable name, and the interface parameter transfer device further includes:
and the configuration module is used for receiving the extracted paths, the extracted values and the variable names, grouping the extracted paths, the extracted values and the variable names into a storage, and generating an XM L configuration file.
In addition, to achieve the above object, the present invention further provides an interface parameter transferring apparatus, including: a memory, a processor, a communication bus, and an interface parameter passing program stored on the memory;
the communication bus is used for realizing connection communication between the processor and the memory;
the processor is used for executing the interface parameter transmission program to realize the following steps:
reading a configuration information group in the XM L configuration file, and extracting parameters according to the current configuration information group;
checking the extracted parameters, and storing the extracted parameters in a preset storage area in a key value pair mode after the checking is successful;
when the interface request parameter is received, judging whether the format of the interface request parameter is a preset format, and when the format of the interface request parameter is the preset format, acquiring a return parameter corresponding to the interface request parameter from a preset storage area to finish the transmission of the return parameter between interfaces.
Further, to achieve the above object, the present invention also provides a computer-readable storage medium storing one or more programs, the one or more programs being executable by one or more processors for:
reading a configuration information group in the XM L configuration file, and extracting parameters according to the current configuration information group;
checking the extracted parameters, and storing the extracted parameters in a preset storage area in a key value pair mode after the checking is successful;
when the interface request parameter is received, judging whether the format of the interface request parameter is a preset format, and when the format of the interface request parameter is the preset format, acquiring a return parameter corresponding to the interface request parameter from a preset storage area to finish the transmission of the return parameter between interfaces.
According to the interface parameter transmission method, the configuration information group in the XM L configuration file is read, the parameters are extracted according to the current configuration information group, after the extracted parameters are verified successfully, the parameters are stored in the preset storage area in a key value pair mode, so that when the interface request parameters in the preset format are received, the return parameters corresponding to the interface request parameters are obtained from the preset storage area, and the transmission of the return parameters among the interfaces is completed.
Drawings
FIG. 1 is a flowchart illustrating a first embodiment of an interface parameter passing method according to the present invention;
FIG. 2 is a flowchart illustrating a second embodiment of an interface parameter passing method according to the present invention;
FIG. 3 is a functional block diagram of a first embodiment of an interface parameter passing apparatus according to the present invention;
fig. 4 is a schematic device structure diagram of a hardware operating environment related to the method according to the embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The invention provides an interface parameter transmission method.
Referring to fig. 1, fig. 1 is a flowchart illustrating an interface parameter passing method according to a first embodiment of the present invention. In this embodiment, the interface parameter transferring method includes:
and step S10, reading the configuration information group in the XM L configuration file, and extracting parameters according to the current configuration information group.
With the development of communication technology, various application software has more and more application functions, such as financial management software installed on a mobile phone or a computer, for example, a safe bank, a safe and easy loan, or self-service equipment for realizing self-service, such as an ATM machine, a self-service book borrowing and returning machine, and the like, and the functions supported by the software are more and more powerful. Each function is realized by a program code, and in order to facilitate maintenance of the program, an API (Application Programming Interface) is provided in the code, and the substance of the API is some predefined functions for an Application program or a program developer to access the program provided with the API, so that the Application program or the program developer can realize or know the function of the code without accessing a source code of the program or understanding an internal working mechanism thereof. When a certain function is realized, a plurality of API interfaces are required to be called, and return values which are mutually related exist among the API interfaces. If the user logs in the panning account or logs in the card of the ATM, the background returns a return value after the login is successful, and the return value is used by calling other interfaces in other operations subsequently to indicate the correctness of the current login account. If the login is successful, returning a return value A, and subsequently checking logistics information corresponding to the Taobao account, or checking balance on an ATM (automatic teller machine) machine, and calling an interface corresponding to the function, the return value A is required to be acquired to determine the validity of the current login identity. If the acquisition of the return value fails, the login state is jumped out, and the check operation cannot be carried out.
The interface parameter transmission of the embodiment is used for realizing the transmission of a return value between an interface and an interface when a tester tests after a developer finishes developing, specifically, a configuration information group in an XM L configuration file is read first, and parameter extraction is performed according to the configuration information group, an XM L configuration file is a file generated by configuring information related to extracted parameters in an XM L format, an XM L (eXtensible Markup language) is a Markup language for marking an electronic file to have a structure, the information related to the extracted parameters is configured as a configuration information group in an XM L configuration file, when the information related to the extracted parameters is changed, a code does not need to be changed and rewritten, only the configuration information group in the XM L file needs to be changed, wherein the configuration information group includes an extraction path, an extraction value and a variable name, the extraction path is a path for acquiring an interface return value, the extraction value is a preset test for judging whether the configuration information acquired according to the extraction path return value and the extraction value are consistent with the extraction path of the configuration information group, and the configuration information is stored as an expected value, when the configuration information is extracted from the extraction path, the configuration information group, the extraction path, the configuration information group is stored as a value, and the configuration information is stored in the extraction path, when the extraction parameter extraction process of the extraction parameter extraction step of the extraction parameter group, the extraction step of obtaining a parameter is performed, the extraction step of obtaining a parameter group, the extraction step of obtaining a parameter is performed, the parameter is performed when the parameter is performed, the parameter group is performed, when the parameter extraction step of obtaining a:
and judging whether an extraction path of the configuration information group exists or not, and extracting parameters according to the extraction path when the extraction path exists.
The method comprises the steps of configuring an extraction path in an XM L file, searching a pointed position according to the extraction path, indicating that the extraction path exists and the extraction path is effective when the pointed position exists, indicating that the extraction path is invalid when the pointed position does not exist, finding the pointed position according to the extraction path if the extraction path is 'user/abc/def', indicating that the extraction path is invalid when the pointed position cannot be found, indicating that the extraction path is invalid when the pointed position can be found, and indicating that the extraction path is valid when the pointed position can be found.
Step S20, checking the extracted parameters, and storing the extracted parameters in a preset storage area in a key value pair form after the checking is successful;
furthermore, after the parameters are extracted according to the extraction paths in the configuration information group, the extracted parameters are checked to determine whether the extracted parameters meet the test requirements. And when the verification is successful and the extracted parameters meet the test requirements, storing the extracted parameters in a preset storage area in a key value pair mode, wherein the preset storage area is a storage area preset in a storage unit and used for storing data, and storing the extracted parameters in the area for subsequent parameter transmission. Specifically, the checking and storing step of the extracted parameter includes:
step S21, comparing the parameters with the extracted values, judging whether the parameters are valid or not, and checking the parameters;
and step S22, when the parameter is valid, judging that the parameter is successfully checked, and storing the parameter and the variable name into a key value pair in a preset storage area.
The configuration information group of the XM L configuration file is configured with an extracted value as a test expected value, the extracted parameter is compared with the extracted value to judge whether the extracted parameter is valid, the extracted parameter is actually a return value of the interface, when the interface is tested, the expected value of the interface is set, namely, the interface realizes a value which should be returned theoretically, the value which should be returned by the interface is configured to the configuration information group as the extracted value, the extracted parameter is compared with the extracted value, when the extracted value is consistent with the extracted value, the extracted interface return value is consistent with the value which should be returned theoretically by the interface, the extracted parameter is valid, the valid parameter and the variable name of the configuration information group form a key value pair, the data of the key value pair exists in a form corresponding to a key (value) and a value (value), the extracted parameter is used as the value, the variable name is used as the key, the key value pair is formed, and the formed key value pair is stored in a preset storage area without paying attention to the storage sequence of the key value pair, all the variables are ensured to be different, and only the key name is determined according to the unique key value.
Step S30, when the interface request parameter is received, determining whether the format of the interface request parameter is a preset format, and when the format of the interface request parameter is the preset format, obtaining a return parameter corresponding to the interface request parameter from a preset storage area, and completing the transfer of the return parameter between interfaces.
Furthermore, after the parameter extraction test of the interface is performed, a parameter transfer function between the interface and the interface needs to be tested. The interface request parameters are sent to request for obtaining the extraction parameters of the interface, and the extracted parameters are stored in a preset storage area in a key value pair mode, so that when the stored parameters are obtained, the corresponding request parameters also correspond to the stored key value pair format, and the corresponding values are obtained according to the keys. In order to ensure that the request parameter is consistent with the stored key-value pair format, the present embodiment is provided with a preset format, which is substantially the key-value pair format, and when receiving the interface request parameter, determines whether the format of the interface request parameter is the preset format, that is, whether the format of the interface request parameter is the key-value pair format. When the format of the interface request parameter is a preset format, namely a key value pair format, acquiring an extraction parameter corresponding to the interface request parameter from a preset storage area for storing the extraction parameter and a variable name, and transmitting the extraction parameter as a return parameter to realize the transmission of the extracted parameter between interfaces.
According to the interface parameter transmission method, the configuration information group in the XM L configuration file is read, the parameters are extracted according to the current configuration information group, after the extracted parameters are verified successfully, the parameters are stored in the preset storage area in a key value pair mode, so that when the interface request parameters in the preset format are received, the return parameters corresponding to the interface request parameters are obtained from the preset storage area, and the transmission of the return parameters among the interfaces is completed.
Further, in another embodiment of the interface parameter passing method of the present invention, the preset format is a key-value pair format, and when the format of the interface request parameter is the preset format, the step of obtaining the return parameter corresponding to the interface request parameter from the preset storage area includes:
step S31, when the format of the interface request parameter is the key-value pair format, judging whether the preset storage area has the target key corresponding to the interface request parameter, wherein the target key is the key in the interface request parameter corresponding to the key-value pair format in the extraction parameter stored in the key-value pair format;
and step S32, when a target key corresponding to the interface request parameter exists in the preset storage area, acquiring a corresponding target value from the preset storage area according to the target key, and associating the target value with the target key to form a return parameter.
Further, in this embodiment, the preset format is set as a key-value pair format, and when the format of the received interface request parameter corresponds to the key-value pair format, it indicates that the interface request parameter satisfies the condition for transmitting the request parameter. The preset storage area is used for storing the extracted parameters in a key-value pair form, so that whether a key corresponding to the key of the interface request parameter in the key-value pair format exists in the extracted parameters in the key-value pair format stored in the preset storage area is further judged, the corresponding key is a target key, namely the target key exists in the extracted parameters stored in the key-value pair format in the preset storage area and corresponds to the key in the interface request parameter in the key-value pair format. If the target key is stored in the preset storage area, the fact that the corresponding key _ value pair is stored in the preset storage area is indicated, so that the corresponding target value is obtained according to the existing target key, the value is associated with the key in the interface request parameter, and the key _ value serving as the return parameter is formed. If the key value pair formed by the extracted parameter and the variable name is: "use 1": "jerry", i.e., the variable name key-use 1, and the parameter value-jerry; when the interface request parameter is received, whether the request parameter conforms to the "use 1" is judged: if the preset key value pair format of "$ { use1 }" meets the format, the parameter transfer request can be made, a parameter with a variable name key of use1 is searched in a preset storage area, a value, i.e., jerry, corresponding to the key in the preset storage area is taken out and assigned to use1, and a return parameter use1_ jerry is formed.
Further, referring to fig. 2, on the basis of the first embodiment of the interface parameter transferring method of the present invention, a second embodiment of the interface parameter transferring method of the present invention is provided, in the second embodiment, the step of obtaining the return parameter corresponding to the interface request parameter from the preset storage area, and after completing the transfer of the return parameter between the interfaces includes:
step S40, when detecting that the current configuration information group completes the transmission of the return parameters between the interfaces, reading the new configuration information group in the XM L configuration file, and taking the new configuration information group as the current configuration information group;
step S50, the step of extracting parameters according to the current configuration information set is performed until all configuration information sets in the XM L configuration file are read.
After the transfer test between interfaces is completed by detecting the corresponding extracted return parameters of the current configuration information group, the parameters in the new configuration information group are read for testing, the new configuration information group is used as the current configuration information group, and the step of extracting the parameters according to the current configuration information group is executed to carry out the parameter transfer test on each configuration information group until all the configuration information groups in the XM L configuration file are read and the test is completed.
In addition, referring to fig. 3, the present invention provides an interface parameter transferring apparatus, in a first embodiment of the interface parameter transferring apparatus of the present invention, the interface parameter transferring apparatus includes:
the reading module 10 is configured to read a configuration information group in the XM L configuration file, and perform parameter extraction according to the current configuration information group;
the checking module 20 is configured to check the extracted parameters, and store the extracted parameters in a preset storage area in a key value pair form after the extracted parameters are successfully checked;
the obtaining module 30 is configured to, when the interface request parameter is received, determine whether a format of the interface request parameter is a preset format, and when the format of the interface request parameter is the preset format, obtain a return parameter corresponding to the interface request parameter from a preset storage area to complete transfer of the return parameter between interfaces.
With the development of communication technology, various application software has more and more application functions, such as instant messaging software installed on a mobile phone or a computer, such as WeChat and QQ, payment software of a Paibao and a Baidu wallet, financing software of a safe bank, a safe and easy loan, or self-service equipment for realizing self-service, such as an ATM (automatic teller machine), a self-service book borrowing machine and the like, and the supported functions of the application software are more and more powerful. Each function is realized by a program code, and in order to facilitate maintenance of the program, an API (application programming Interface) is provided in the code, and the substance of the API is some predefined functions for an application program or a program developer to access the program provided with the API, so that the application program or the program developer can realize or know the function of the code without accessing a source code of the program or understanding an internal working mechanism thereof. When a certain function is realized, a plurality of API interfaces are required to be called, and return values which are mutually related exist among the API interfaces. If the user logs in the panning account or logs in the card of the ATM, the background returns a return value after the login is successful, and the return value is used by calling other interfaces in other operations subsequently to indicate the correctness of the current login account. If the login is successful, returning a return value A, and subsequently checking logistics information corresponding to the Taobao account, or checking balance on an ATM (automatic teller machine) machine, and calling an interface corresponding to the function, the return value A is required to be acquired to determine the validity of the current login identity. If the acquisition of the return value fails, the login state is jumped out, and the check operation cannot be carried out.
The interface parameter transmission device of the embodiment is used for transmitting a return value between an interface and an interface when a tester tests after a developer finishes developing, specifically, a configuration information group in an XM L configuration file is read through a reading module 10, and parameter extraction is performed according to the configuration information group, an XM L configuration file is a Markup language for configuring information related to extracted parameters in an XM L format to generate a file, an XM L (eXtensible Markup language) is a Markup language for marking an electronic file to make the electronic file have a structure, the interface parameter transmission device of the embodiment further includes a configuration module for configuring information related to extracted parameters as a configuration information group in an XM L configuration file, when the information related to extracted parameters changes, no change and recomputation of codes are needed, only the configuration information group in the XM L file needs to be changed, wherein the configuration information group includes an extraction path, an extraction value and a variable name, the extraction path is a preset path for extracting a return value of the configuration information, and the configuration information is used for obtaining a preset path, and storing the extracted value as an expected value, and obtaining a test parameter when the configuration information is received, the configuration information, and obtaining a value, and obtaining a test parameter.
Further, after the parameters are extracted according to the extraction path in the configuration information group, the extracted parameters are verified by the verification module 20 to determine whether the extracted parameters meet the test requirements. And when the verification is successful and the extracted parameters meet the test requirements, storing the extracted parameters in a preset storage area in a key value pair mode, wherein the preset storage area is a storage area preset in a storage unit and used for storing data, and storing the extracted parameters in the area for subsequent parameter transmission.
Furthermore, after the parameter extraction test of the interface is performed, a parameter transfer function between the interface and the interface needs to be tested. The interface request parameters are sent to request for obtaining the extraction parameters of the interface, and the extracted parameters are stored in a preset storage area in a key value pair mode, so that when the stored parameters are obtained, the corresponding request parameters also correspond to the stored key value pair format, and the corresponding values are obtained according to the keys. In order to ensure that the request parameter is consistent with the stored key-value pair format, the present embodiment is provided with a preset format, which is substantially the key-value pair format, and when receiving the interface request parameter, determines whether the format of the interface request parameter is the preset format, that is, whether the format of the interface request parameter is the key-value pair format. When the format of the interface request parameter is a preset format, that is, a key-value pair format, the obtaining module 30 obtains an extracted parameter corresponding to the interface request parameter from a preset storage area storing the extracted parameter and a variable name, and transmits the extracted parameter as a return parameter, thereby realizing transmission of the extracted parameter between interfaces.
The interface parameter transferring device of this embodiment reads the configuration information group in the XM L configuration file through the reading module 10, performs parameter extraction according to the current configuration information group, and stores the parameter in the preset storage area in the form of a key value pair after the verification module 20 successfully verifies the extracted parameter, so that when the interface request parameter in the preset format is received, the obtaining module 30 obtains the return parameter corresponding to the interface request parameter from the preset storage area, and completes the transfer of the return parameter between interfaces.
Referring to fig. 4, fig. 4 is a schematic device structure diagram of a hardware operating environment related to the method according to the embodiment of the present invention.
The interface parameter transmission equipment of the embodiment of the invention can be a PC, and can also be terminal equipment such as a smart phone, a tablet computer, an electronic book reader, a portable computer and the like.
As shown in fig. 4, the interface parameter transferring apparatus may include: a processor 1001, such as a CPU, a memory 1005, and a communication bus 1002. The communication bus 1002 is used for realizing connection communication between the processor 1001 and the memory 1005. The memory 1005 may be a high-speed RAM memory or a non-volatile memory (e.g., a magnetic disk memory). The memory 1005 may alternatively be a storage device separate from the processor 1001.
Optionally, the interface parameter transferring device may further include a user interface, a network interface, a camera, an RF (radio frequency) circuit, a sensor, an audio circuit, a WiFi module, and the like. The user interface may comprise a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface may also comprise a standard wired interface, a wireless interface. The network interface may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface).
Those skilled in the art will appreciate that the interface parameter passing device configuration shown in fig. 4 does not constitute a limitation of the interface parameter passing device and may include more or fewer components than shown, or some components in combination, or a different arrangement of components.
As shown in fig. 4, a memory 1005, which is a kind of computer storage medium, may include therein an operating system, a network communication module, and an interface parameter transfer program. The operating system is a program that manages and controls the interface parameter passing device hardware and software resources, supporting the operation of the interface parameter passing program, as well as other software and/or programs. The network communication module is used to implement communication between the components inside the memory 1005 and with other hardware and software in the interface parameter passing device.
In the interface parameter transfer apparatus shown in fig. 4, the processor 1001 is configured to execute an interface parameter transfer program stored in the memory 1005, and implement the following steps:
reading a configuration information group in the XM L configuration file, and extracting parameters according to the current configuration information group;
checking the extracted parameters, and storing the extracted parameters in a preset storage area in a key value pair mode after the checking is successful;
when the interface request parameter is received, judging whether the format of the interface request parameter is a preset format, and when the format of the interface request parameter is the preset format, acquiring a return parameter corresponding to the interface request parameter from a preset storage area to finish the transmission of the return parameter between interfaces.
Further, the configuration information set includes an extracted path, an extracted value, and a variable name, and before the step of reading the configuration information set in the XM L configuration file, the processor 1001 is configured to execute an interface parameter passing program stored in the memory 1005, and implement the following steps:
and receiving the extracted paths, the extracted values and the variable names, storing the extracted paths, the extracted values and the variable names in a grouping mode, and generating an XM L configuration file.
Further, the step of extracting parameters according to the configuration information group includes:
and judging whether an extraction path of the configuration information group exists or not, and extracting parameters according to the extraction path when the extraction path exists.
Further, the step of checking the extracted parameters and storing the extracted parameters in the preset storage area in the form of key value pairs after the checking is successful comprises:
comparing the parameters with the extracted values, and judging whether the parameters are valid or not so as to verify the parameters;
and when the parameter is valid, judging that the parameter is successfully verified, and storing the parameter and the variable name into a key value pair in a preset storage area.
Further, the preset format is a key-value pair format, and the step of acquiring the return parameter corresponding to the interface request parameter from the preset storage area when the format of the interface request parameter is the preset format includes:
when the format of the interface request parameter is a key-value pair format, judging whether a target key corresponding to the interface request parameter exists in a preset storage area, wherein the target key is a key in the interface request parameter corresponding to the key-value pair format in the extraction parameters stored in the key-value pair format;
when a target key corresponding to the interface request parameter exists in the preset storage area, acquiring a corresponding target value from the preset storage area according to the target key, and associating the target value with the target key to form a return parameter.
Further, after the step of acquiring the return parameter corresponding to the interface request parameter from the preset storage area and completing the transfer of the return parameter between the interfaces, the processor 1001 is configured to execute the interface parameter transfer program stored in the memory 1005, and implement the following steps:
when the current configuration information group is detected to finish the transmission of the return parameters between the interfaces, reading the configuration information group in the XM L configuration file, and taking the new configuration information group as the current configuration information group;
and executing the step of extracting the parameters according to the current configuration information group until all the configuration information groups in the XM L configuration file are read.
The specific implementation of the interface parameter transferring device of the present invention is substantially the same as the embodiments of the interface parameter transferring method, and is not described herein again.
The present invention provides a computer readable storage medium storing one or more programs, the one or more programs further executable by one or more processors for:
reading a configuration information group in the XM L configuration file, and extracting parameters according to the current configuration information group;
checking the extracted parameters, and storing the extracted parameters in a preset storage area in a key value pair mode after the checking is successful;
when the interface request parameter is received, judging whether the format of the interface request parameter is a preset format, and when the format of the interface request parameter is the preset format, acquiring a return parameter corresponding to the interface request parameter from a preset storage area to finish the transmission of the return parameter between interfaces.
Further, the configuration information set comprises an extracted path, an extracted value, and a variable name, and before the step of reading the configuration information set in the XM L configuration file, the one or more programs are further executable by one or more processors for:
and receiving the extracted paths, the extracted values and the variable names, storing the extracted paths, the extracted values and the variable names in a grouping mode, and generating an XM L configuration file.
Further, the step of extracting parameters according to the configuration information group includes:
and judging whether an extraction path of the configuration information group exists or not, and extracting parameters according to the extraction path when the extraction path exists.
Further, the step of checking the extracted parameters and storing the extracted parameters in the preset storage area in the form of key value pairs after the checking is successful comprises:
comparing the parameters with the extracted values, and judging whether the parameters are valid or not so as to verify the parameters;
and when the parameter is valid, judging that the parameter is successfully verified, and storing the parameter and the variable name into a key value pair in a preset storage area.
Further, the preset format is a key-value pair format, and the step of acquiring the return parameter corresponding to the interface request parameter from the preset storage area when the format of the interface request parameter is the preset format includes:
when the format of the interface request parameter is a key-value pair format, judging whether a target key corresponding to the interface request parameter exists in a preset storage area, wherein the target key is a key in the interface request parameter corresponding to the key-value pair format in the extraction parameters stored in the key-value pair format;
when a target key corresponding to the interface request parameter exists in the preset storage area, acquiring a corresponding target value from the preset storage area according to the target key, and associating the target value with the target key to form a return parameter.
Further, after the step of obtaining the return parameter corresponding to the interface request parameter from the preset storage area and completing the transfer of the return parameter between the interfaces, the one or more programs may be further executable by the one or more processors to:
when the current configuration information group is detected to finish the transmission of the return parameters between the interfaces, reading a new configuration information group in the XM L configuration file, and taking the new configuration information group as the current configuration information group;
and executing the step of extracting the parameters according to the current configuration information group until all the configuration information groups in the XM L configuration file are read.
The specific implementation of the computer-readable storage medium of the present invention is substantially the same as the embodiments of the interface parameter transferring method described above, and is not described herein again.
It should also be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. 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 (e.g., ROM/RAM, magnetic disk, optical disk) as described above and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and is not intended to limit the scope of the present invention, and all modifications and equivalents of the present invention, which are made by the contents of the present specification and the accompanying drawings, or directly/indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (8)

1. An interface parameter transmission method, characterized in that the interface parameter transmission method comprises the following steps:
reading a configuration information group in an XM L configuration file, and extracting parameters according to the current configuration information group, wherein the configuration information group comprises an extraction value and a variable name, and the extracted parameters are return values of an interface;
comparing the parameters with the extracted values, and judging whether the parameters are valid or not so as to verify the parameters;
when the parameter is valid, judging that the parameter is successfully verified, and storing the parameter and the variable name into a key value pair in a preset storage area;
when receiving an interface request parameter, judging whether the format of the interface request parameter is a key-value pair format, and when the format of the interface request parameter is the key-value pair format, judging whether a target key corresponding to the interface request parameter exists in a preset storage area, wherein the target key is a key in the interface request parameter corresponding to the key-value pair format in an extraction parameter stored in the key-value pair format;
when a target key corresponding to the interface request parameter exists in the preset storage area, acquiring a corresponding target value from the preset storage area according to the target key, and associating the target value with the target key to form a return parameter.
2. The interface parameter passing method of claim 1, wherein the configuration information set further comprises an extraction path, and the step of reading the configuration information set in the XM L configuration file is preceded by the steps of:
and receiving the extracted paths, the extracted values and the variable names, storing the extracted paths, the extracted values and the variable names in a grouping mode, and generating an XM L configuration file.
3. The interface parameter delivery method of claim 2, wherein the step of extracting parameters according to the current configuration information group comprises:
and judging whether an extraction path of the configuration information group exists or not, and extracting parameters according to the extraction path when the extraction path exists.
4. The interface parameter delivery method according to any one of claims 1 to 3, wherein the step of obtaining a corresponding target value from a preset storage area according to the target key and associating the target value with the target key to form a return parameter is followed by:
when the current configuration information group is detected to finish the transmission of the return parameters between the interfaces, reading a new configuration information group in the XM L configuration file, and taking the new configuration information group as the current configuration information group;
and executing the step of extracting the parameters according to the current configuration information group until all the configuration information groups in the XM L configuration file are read.
5. An interface parameter passing apparatus, comprising:
the reading module is used for reading a configuration information group in the XM L configuration file and extracting parameters according to the current configuration information group, wherein the configuration information group comprises an extraction value and a variable name, and the extracted parameters are return values of an interface;
the checking module is used for comparing the parameters with the extracted values and judging whether the parameters are effective or not so as to check the parameters; when the parameter is valid, judging that the parameter is successfully verified, and storing the parameter and the variable name into a key value pair in a preset storage area;
the acquisition module is used for judging whether the format of the interface request parameter is a key-value pair format or not when the interface request parameter is received, and judging whether a target key corresponding to the interface request parameter exists in a preset storage area or not when the format of the interface request parameter is the key-value pair format, wherein the target key is a key in the interface request parameter corresponding to the key-value pair format in the extraction parameters stored in the key-value pair format; when a target key corresponding to the interface request parameter exists in the preset storage area, acquiring a corresponding target value from the preset storage area according to the target key, and associating the target value with the target key to form a return parameter.
6. The interface parameter passing apparatus of claim 5, wherein the configuration information group further includes an extraction path, the interface parameter passing apparatus further comprising:
and the configuration module is used for receiving the extracted paths, the extracted values and the variable names, grouping the extracted paths, the extracted values and the variable names into a storage, and generating an XM L configuration file.
7. An interface parameter transfer apparatus, characterized in that the interface parameter transfer apparatus comprises: a memory, a processor, a communication bus, and an interface parameter passing program stored on the memory;
the communication bus is used for realizing connection communication between the processor and the memory;
the processor is configured to execute the interface parameter passing program to implement the steps of the interface parameter passing method according to any one of claims 1 to 4.
8. A computer-readable storage medium, wherein the computer-readable storage medium has stored thereon an interface parameter delivery program, which when executed by a processor, implements the steps of the interface parameter delivery method according to any one of claims 1-4.
CN201711029424.0A 2017-10-26 2017-10-26 Interface parameter transmission method, device, equipment and computer readable storage medium Active CN107908485B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711029424.0A CN107908485B (en) 2017-10-26 2017-10-26 Interface parameter transmission method, device, equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711029424.0A CN107908485B (en) 2017-10-26 2017-10-26 Interface parameter transmission method, device, equipment and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN107908485A CN107908485A (en) 2018-04-13
CN107908485B true CN107908485B (en) 2020-08-04

Family

ID=61842877

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711029424.0A Active CN107908485B (en) 2017-10-26 2017-10-26 Interface parameter transmission method, device, equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN107908485B (en)

Families Citing this family (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109324958B (en) * 2018-06-27 2021-10-29 郑州云海信息技术有限公司 REST unified verification method, device, equipment and readable storage medium
CN109522211B (en) * 2018-09-29 2023-07-18 中国平安人寿保险股份有限公司 Interface parameter transmission method and device, electronic equipment and storage medium
CN109542357B (en) * 2018-12-03 2022-03-08 郑州云海信息技术有限公司 Command parameter assembling method, system, equipment and computer storage medium
CN111352741B (en) * 2018-12-21 2021-04-06 马上消费金融股份有限公司 Interface calling method and device, intelligent terminal and storage device
CN109739553B (en) * 2019-02-01 2022-07-19 深圳创维-Rgb电子有限公司 Parameter configuration method, device, terminal and storage medium
CN110278123B (en) * 2019-05-10 2021-04-06 新华三技术有限公司 Checking method, checking device, electronic equipment and readable storage medium
CN112017330B (en) * 2019-05-13 2023-05-05 浙江宇视科技有限公司 Intelligent lock parameter configuration method and device, intelligent lock and storage medium
CN110275703B (en) * 2019-06-27 2023-06-06 浙江大搜车软件技术有限公司 Method and device for assigning key value to data, computer equipment and storage medium
CN110851136A (en) * 2019-09-18 2020-02-28 平安科技(深圳)有限公司 Data acquisition method and device, electronic equipment and storage medium
CN111352610A (en) * 2020-03-03 2020-06-30 五八有限公司 Interface return value modification method and device, electronic equipment and storage medium
CN114499829B (en) * 2020-11-11 2023-07-07 蓝婷 Key management method and device, electronic equipment and storage medium
CN112486811A (en) * 2020-11-26 2021-03-12 杭州安恒信息技术股份有限公司 Interface test method, device, equipment and medium
CN112612700A (en) * 2020-12-21 2021-04-06 北京达佳互联信息技术有限公司 Interface test method and device and electronic equipment
CN113407252B (en) * 2021-05-28 2023-06-02 威胜集团有限公司 Method, device, equipment and storage medium for configuring parameters of electric energy meter
CN113360300B (en) * 2021-06-29 2023-10-24 北京思普艾斯科技有限公司 Interface call link generation method, device, equipment and readable storage medium
CN113918499B (en) * 2021-12-16 2022-04-08 深圳市明源云科技有限公司 Open interface generation method, network device and computer readable storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2002015029A1 (en) * 2000-08-14 2002-02-21 I2 Technologies, Inc. Network application program interface facilitating communication in a distributed network environment
CN1519703A (en) * 2003-01-23 2004-08-11 英业达股份有限公司 Computer multithreading test system capable of being combined and linked as well as its method
CN101488085A (en) * 2008-01-17 2009-07-22 中兴通讯股份有限公司 Software interface test method and apparatus
CN106469048A (en) * 2015-08-18 2017-03-01 北京神州泰岳软件股份有限公司 A kind of method and apparatus calling content in attribute configuration file
CN107133163A (en) * 2016-02-29 2017-09-05 阿里巴巴集团控股有限公司 A kind of method and apparatus for verifying description class API
CN107197024A (en) * 2017-06-09 2017-09-22 努比亚技术有限公司 Single table access and control method, user terminal, server and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2002015029A1 (en) * 2000-08-14 2002-02-21 I2 Technologies, Inc. Network application program interface facilitating communication in a distributed network environment
CN1519703A (en) * 2003-01-23 2004-08-11 英业达股份有限公司 Computer multithreading test system capable of being combined and linked as well as its method
CN101488085A (en) * 2008-01-17 2009-07-22 中兴通讯股份有限公司 Software interface test method and apparatus
CN106469048A (en) * 2015-08-18 2017-03-01 北京神州泰岳软件股份有限公司 A kind of method and apparatus calling content in attribute configuration file
CN107133163A (en) * 2016-02-29 2017-09-05 阿里巴巴集团控股有限公司 A kind of method and apparatus for verifying description class API
CN107197024A (en) * 2017-06-09 2017-09-22 努比亚技术有限公司 Single table access and control method, user terminal, server and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于接口参数的黑箱测试用例自动生成算法;聂长海 等;《计算机学报》;20040326;第27卷(第3期);第382-388页 *

Also Published As

Publication number Publication date
CN107908485A (en) 2018-04-13

Similar Documents

Publication Publication Date Title
CN107908485B (en) Interface parameter transmission method, device, equipment and computer readable storage medium
CN108335237B (en) Scheme setting method, terminal and computer readable storage medium
CN110737881B (en) Fingerprint verification method and device for intelligent equipment
CN107911340B (en) Login verification method, device and equipment of application program and storage medium
US20230269238A1 (en) Headless browser system with virtual api
US20200380494A1 (en) Resource transfer method and apparatus, computer device, and storage medium
EP3553731A1 (en) Systems and methods for automatically identifying a checkout webpage and injecting a virtual token
US20160246958A1 (en) Method, device, and system for updating authentication information
CN107807841B (en) Server simulation method, device, equipment and readable storage medium
CN111274131A (en) Interface testing method and device, electronic equipment and storage medium
US20140172532A1 (en) Optimal utilization of coupons
CN103973506A (en) Domain name verifying method, device and system
CN112835808A (en) Interface testing method and device, computer equipment and storage medium
US9978056B2 (en) Smart card having multiple payment instruments
CN108346095B (en) Management and control method, device and equipment of combined system and computer readable storage medium
US11455991B2 (en) Voice-assistant activated virtual card replacement
CN112433935A (en) Test method, test device, electronic equipment and storage medium
CN108600242B (en) Account registration method, device and equipment of application software and readable storage medium
CN109145591B (en) Plug-in loading method of application program
CN110752933A (en) Verification code input method and device, electronic equipment and storage medium
CN113706138B (en) Payment method, device, equipment and storage medium based on digital currency hard wallet
CN110830556B (en) Service processing method and device
CN111767544B (en) Multi-frequency replay attack vulnerability determination method, device, equipment and readable storage medium
EP3105732A1 (en) Universal payment method and system
CN111901299A (en) Application authentication method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant