CN111352741B - Interface calling method and device, intelligent terminal and storage device - Google Patents

Interface calling method and device, intelligent terminal and storage device Download PDF

Info

Publication number
CN111352741B
CN111352741B CN201811573888.2A CN201811573888A CN111352741B CN 111352741 B CN111352741 B CN 111352741B CN 201811573888 A CN201811573888 A CN 201811573888A CN 111352741 B CN111352741 B CN 111352741B
Authority
CN
China
Prior art keywords
input parameters
interface
called
parameter
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
CN201811573888.2A
Other languages
Chinese (zh)
Other versions
CN111352741A (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.)
Mashang Xiaofei Finance Co Ltd
Original Assignee
Mashang Xiaofei Finance 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 Mashang Xiaofei Finance Co Ltd filed Critical Mashang Xiaofei Finance Co Ltd
Priority to CN201811573888.2A priority Critical patent/CN111352741B/en
Publication of CN111352741A publication Critical patent/CN111352741A/en
Application granted granted Critical
Publication of CN111352741B publication Critical patent/CN111352741B/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

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application discloses a method and a device for calling an interface, an intelligent terminal and a storage device. The method comprises the steps of receiving a request for setting global variables for at least part of input parameters of a first interface, obtaining at least part of the input parameters based on the request, and storing the at least part of the input parameters into a system cache database to complete the setting of the global variables for at least part of the input parameters in the first interface. When the second interface needs to call the input parameters of the first interface, whether the parameters to be called exist in a system cache database is judged by receiving a call instruction of the second interface; and if so, acquiring the input parameters corresponding to the parameters to be called from the system cache database and returning. And the calling of the second interface to the data in the first interface is realized. By the method, when data is called between the interfaces, the processes of reading, analyzing, matching and returning of the parameters are automatically completed, and the efficiency of data transmission is improved.

Description

Interface calling method and device, intelligent terminal and storage device
Technical Field
The present application relates to the field of computer software, and in particular, to a method and an apparatus for interface invocation, an intelligent terminal, and a storage apparatus.
Technical Field
Currently, many terminal devices need to call data between interfaces to each other when implementing a certain function, that is, a response of one interface is called out, and a request of another interface is called in. For example, the data of a reconciliation depends on the data of a single payment interface, and the entry of the payment interface is guaranteed and the entry of the payment interface is put into the exit of the reconciliation interface.
However, in some cases, the interfaces are single-line operations, independent of each other, and have no logical dependency relationship. Data transmission between interfaces mainly depends on a manual query configuration mode, which brings great inconvenience to users.
Disclosure of Invention
In order to solve the technical problems, the application provides an interface calling method, an interface calling device, an intelligent terminal and a storage device, so that the processes of reading, analyzing, matching and returning parameters are automatically completed when data calling is performed between interfaces, and the efficiency of data transmission is improved.
In order to solve the above technical problem, the first technical solution adopted by the present application is: a method of interface invocation is provided, the method comprising: receiving a request for setting global variables for at least part of input parameters of a first interface; acquiring at least part of input parameters based on the request, and storing the at least part of input parameters in a system cache database; receiving a calling instruction of a second interface, wherein the calling instruction comprises a parameter to be called; judging whether an input parameter corresponding to a parameter to be called exists in a system cache database; and if so, acquiring the input parameters corresponding to the parameters to be called from the system cache database, and returning the input parameters corresponding to the parameters to be called.
Wherein the step of receiving a request to set global variables for at least part of the input parameters of the first interface comprises: adding a global label to at least part of the input parameters; the steps of acquiring at least part of input parameters based on the request and storing the at least part of input parameters in a system cache database specifically include: analyzing at least part of input parameters from the corresponding data packet based on the global label; at least part of the input parameters are stored in a system cache database.
The step of obtaining at least part of input parameters from the corresponding data packet by analyzing based on the global tag specifically includes: and analyzing at least part of input parameters from the corresponding data packet by a get mode or a post mode.
The step of obtaining at least part of input parameters from the corresponding data packet by analyzing in a get mode or a post mode specifically includes: analyzing the uniform resource identifier field of the corresponding row of the data packet to obtain at least part of input parameters; or at least part of the input parameters are analyzed from the message body of the data packet.
The calling instruction also comprises a placeholder of an input parameter corresponding to the parameter to be called; the steps of acquiring the input parameters corresponding to the parameters to be called from the system cache database and returning the input parameters corresponding to the parameters to be called specifically comprise: and acquiring the input parameters corresponding to the parameters to be called from the system cache database, replacing the placeholders with the input parameters, and returning the parameters to be called and the input parameters.
The method specifically comprises the following steps of acquiring input parameters corresponding to parameters to be called from a system cache database, and returning the input parameters corresponding to the parameters to be called: and acquiring a plurality of input parameters corresponding to the parameters to be called from a system cache database, splicing the input parameters according to a set sequence, and returning.
The system cache database is a redis storage system.
In order to solve the above technical problem, the second technical solution adopted by the present application is: the device for calling the interface comprises a receiving module, a storage module, a judging module and a returning module, wherein the receiving module is used for receiving a request for setting global variables for at least part of input parameters of a first interface; the storage module is used for acquiring at least part of input parameters based on the request and storing the at least part of input parameters into a system cache database; the receiving module is further used for receiving a calling instruction of the second interface, wherein the calling instruction comprises a parameter to be called; the judging module is used for judging whether an input parameter corresponding to the parameter to be called exists in a system cache database; the return module is used for acquiring the input parameters corresponding to the parameters to be called from the system cache database when the input parameters exist in the system cache database, and returning the input parameters corresponding to the parameters to be called.
In order to solve the above technical problem, the third technical solution adopted by the present application is: there is provided an intelligent terminal comprising at least one processor, a memory connected to the processor, wherein the memory stores instructions executable by the processor, and the instructions are executed by the processor to implement the method of interface calling of any of the above embodiments.
In order to solve the above technical problem, a fourth technical solution adopted by the present application is: there is provided a storage device having stored program data capable of being executed to implement the method of interface calling of any of the above embodiments.
The beneficial effect of this application is: at least part of input parameters of the first interface are set as global variables, and after the at least part of input parameters are obtained, the at least part of input parameters are stored in a system cache database, so that the at least part of input parameters can become shared data of other interfaces. When the second interface calls the data of the first interface, the input parameters corresponding to the parameters to be called are searched from the system cache database, and the input parameters corresponding to the parameters to be called are returned, so that the effects of one-place storage and everywhere availability are realized. When the data between the interfaces is called, the processes of reading, analyzing, matching and returning parameters are automatically finished without manual query and configuration, and the efficiency of data transmission is improved.
Drawings
FIG. 1 is a flow chart illustrating an embodiment of a method for interface invocation according to the present application;
FIG. 2 is a schematic flow chart of one embodiment of S12 of FIG. 1;
FIG. 3 is a block diagram of an embodiment of an apparatus for interface invocation in the present application;
FIG. 4 is a schematic structural diagram of an embodiment of an intelligent terminal according to the present application;
FIG. 5 is a schematic structural diagram of an embodiment of a memory device according to the present application.
Detailed Description
The present application provides a method, an apparatus, an intelligent terminal and a storage apparatus for interface invocation, and in order to make the purpose, technical solution and technical effect of the present application more clear and clearer, the following further detailed description of the present application should be understood that the specific embodiments described herein are only used for explaining the present application, and are not used for limiting the present application.
Because the flows of some data services in real life are complex, the services of each service node are interdependent. For example, before the business system is completely or partially developed, the business system needs to be tested for performance to ensure that the system can operate correctly in a predetermined manner. The applied performance test is to test various applied performance indexes by simulating various normal and abnormal conditions through an automatic test tool. An application may logically rely on data from one interface on data from another interface during operation.
In order to enable the original mutually independent interfaces to be associated, namely the data between the interfaces can be mutually called, the application provides an interface calling method to automatically complete the transmission of parameters between the interfaces. Alternatively, the interface may be a mock interface. For example, during testing, some objects that are not easily constructed or easily obtained are created with a virtual object for testing. Using conventional mock behavior, a request is sent once, and a response value is returned.
In order to realize parameter calling between single-threaded mock interfaces, when an input parameter of a certain interface needs to be called by other interfaces, data of the interface is set as a global variable. I.e. setting the input parameters of this interface to data that is shareable by the other interfaces. Such as interface a: the https:// test.com/api/name ═ zhang & age ═ 12, where the input parameter in the interface a is name ═ zhang & age ═ 12, which may be called by the interface B, at this time, the input parameter name ═ zhang & age ═ 12 in the interface a is set as the global variable, so that the interface B can call the input parameter.
Referring to fig. 1, fig. 1 is a schematic flow chart of an embodiment of an interface invoking method according to the present application, where the method for invoking an interface according to the present embodiment specifically includes:
s11: a request to set a global variable for at least a portion of input parameters of a first interface is received.
In an actual system, a plurality of interfaces may exist, each interface has corresponding input parameters, and data among the plurality of interfaces has logical dependency relationship.
Specifically, each interface has corresponding configuration information, which includes: interface address, calling mode, return value, and/or responder.
In a specific embodiment, a user sends a request for setting a global variable for at least part of input parameters of an interface, and a corresponding terminal receives the request. The request may be issued when the interface is defined, or may be issued when the definition of the input parameter of the interface is completed, which is not limited herein.
In this embodiment, a request for setting a global variable for an input parameter of an interface may be transmitted by setting a global tag. Specifically, global labels, such as global flags, are added to the interface input parameters that require setting of global variables. The server is convenient to subsequently determine the parameters of the global variables needing to be set. In a preferred embodiment, the configuration of the global tag is done based on the node language and using the vue component. The node is a javascript running environment developed based on the chrome v8 engine, and the asynchronous event processing mechanism greatly improves the running capability of the javascript. vue is called vue.js, a set of progressive frames that build user interfaces. Unlike other heavyweight frameworks, vue employs a bottom-up incremental development design, whose core library only focuses on the viewing layer, and is easy to learn and integrate with other libraries; on the other hand, vue can drive single file components and vue supported libraries robustly to develop complex single page applications.
In other embodiments, the request may be sent by program instructions.
In any of the above embodiments, in order to simplify the flow and maximize the data sharing between the interfaces, all input parameters in the interface to be called may be set as global variables. In other alternative embodiments, in order to further save the memory space, only some of the input parameters may be set as global variables, for example, commonly used parameters are set as global variables to facilitate other interface calls, and a user may select the input parameters that specifically need to set the global variables according to actual situations, which is not specifically limited herein. For example, when the input parameters in interface a include related data of name, age, hobby, etc., and only name information in interface a is called by interface B, only the input parameters about the name in interface a need to be added with a global tag. No changes are made to other input parameters in interface a. In other alternative embodiments, in order to make the operation simpler, a global tag may be added to all input parameters in the interface a, including related data such as name, age, hobby, and the like, so as to avoid missing the related data and affecting the subsequent invocation of the input parameters.
S12: and acquiring at least part of input parameters based on the request, and storing the at least part of input parameters in a system cache database.
And after the request for setting the global variable is acquired, the server intercepts the request. When the number of the input parameters needing to set the global variable is more than two, a plurality of input parameters needing to set the global variable are obtained to form a list. Then at least part of input parameters in the interface are analyzed according to the list, so that at least part of input parameters which can be called by other interfaces are obtained, and then the at least part of input parameters are stored in a system cache database.
In a specific embodiment, a flowchart of a specific embodiment of this step is shown in fig. 2, and specifically includes:
s21: and analyzing at least part of input parameters from the corresponding data packet based on the global label.
The input parameters with the global tags are analyzed, and specifically, the calling mode of the interface may be divided into a get mode or a post mode, so that in this embodiment, at least part of the input parameters may be obtained by analyzing from the corresponding data packet through the get mode or the post mode.
When the get method is adopted, the at least part of parameters can be obtained by analyzing from the uniform resource identifier field of the corresponding row of the data packet. In a specific embodiment, the input parameter may be set in a uniform resource locator address, using "? The symbol separates the input parameter from the uniform resource locator address. Such as https:// test. com/api/name ═ zhang & age ═ 12. "? "before the symbol is the uniform resource locator address of the interface,"? The symbol is followed by the input parameters needed to set the global variables. name, age are names of a plurality of input parameters, and are divided from each other using "&" symbols. The "═ symbol is followed by the value of the input parameter. Therefore, the uniform resource identifier field name ═ zhang ═ 12 of the input parameter can be obtained from https:// test. And when the interface calling mode is the get mode, the interface acquires the input parameters by using the get mode. The interface can also transmit the input parameters to other programs by using a get mode according to the corresponding actual program.
When the post mode is adopted, the input parameters are set in the message body of the corresponding data packet, and the interface acquires the input parameters from the message body. Similarly, the interface may also set the input parameters in the message body according to the actual program corresponding to the interface and transmit the input parameters to other programs.
S22: at least part of the input parameters are stored in a system cache database.
The input parameters obtained by analysis are stored in a database, so that other interfaces can directly read the input parameters from the database when the input parameters are used. Optionally, at least part of the parsed input parameters may be stored in a system cache database.
In a preferred embodiment, the system cache database is a redis storage system. redis is a better-performing in-memory database. It supports relatively more types of stored values, including string, list, set, zset, and hashes. These data types all support push/pop, add/remove, and intersect union and difference, and richer operations, and these operations are all atomic. On this basis, redis supports various different ways of ordering.
In other alternative embodiments, the system cache database may also be other shared databases, such as a memcached data cache system. memcached is a free-source, high-performance, distributed memory object caching system that is used to store arbitrary data (strings, objects) of small blocks. These data may be database calls, interface calls, or the result of page rendering.
In order to maintain the long-term stable operation of the system, after the input parameters obtained by analysis are stored in a system cache database, a certain validity period is set so as to automatically clean the database. Alternatively, the validity period of the input parameter storage can be 1 month, half year, one year and the like, and the user can set the validity period according to the actual use condition of the data.
S13: and receiving a calling instruction of the second interface, wherein the calling instruction comprises a parameter to be called.
When the second interface is to be called, an instruction to call the second interface is issued. The calling instruction includes parameters to be called, that is, which data in the second interface needs to be called. Such as interface B: when the name parameter in the interface B is to be called, the calling instruction comprises the name of the parameter to be called, and the value of the name parameter depends on the value of the input parameter in the interface A. For example, https:// test.com/api/name ═ zhang & age 12 is configured in the interface a, and the input parameter name ═ zhang & age 12 has been set with a global variable and stored in the system cache database. It may be recalled from the system cache database.
In a preferred embodiment, the call instruction further includes a placeholder for an input parameter corresponding to the parameter to be called, and the placeholder is used to pre-occupy a fixed position to define a specific variable. The placeholder can be various symbols such as #,% d,% i, and the like, and the user can carry out definition setting by himself. For example, when the name parameter in interface B is to be called, a symbol may be used as a placeholder in the call instruction to define a specific variable, for example, when # is used as a placeholder, the call instruction may include name ═ and the # is used to replace the specific variable.
S14: and judging whether the system cache database has input parameters corresponding to the parameters to be called.
After the to-be-called parameter of the interface B is obtained, the to-be-called parameter of the interface B depends on the input parameter set as the global variable in the interface A. At the moment, whether the input parameter value corresponding to the parameter to be called exists in the system cache database or not is judged based on the fact that the parameter to be called is searched and matched in the system cache database.
For example, in a specific embodiment, if the parameter to be called by the interface B is a name, searching for an input parameter starting with the name in the system cache database, for example, searching for a name zhang stored in the system cache database, and at this time, determining that an input parameter corresponding to the parameter to be called exists in the cache database; and when the input parameter at the beginning of the name cannot be inquired in the cache database, judging that the parameter to be called does not exist in the system cache database. When the input parameter corresponding to the parameter to be called is not inquired, a prompt can be sent to the user, and the user can search in a manual configuration mode and return a corresponding value.
S15: and if so, acquiring the input parameters corresponding to the parameters to be called from the system cache database, and returning the input parameters corresponding to the parameters to be called.
And if the input parameters corresponding to the parameters to be called exist in the system cache database, acquiring the input parameters corresponding to the parameters to be called from the system cache database. For example, in a specific embodiment, the name of the parameter to be called in the interface B is found, and the corresponding input parameters are: and if the name is zhang, returning the value of the acquired corresponding input parameter name zhang to the user.
In a preferred embodiment, when the call instruction includes a placeholder, the call instruction may include a name #, acquire an input parameter name # -zhang corresponding to the parameter to be called from a system cache database, replace the # placeholder with a value zhang of the input parameter, that is, obtain returned data name # -zhang, and then return the data to the user.
In other embodiments, when there are a plurality of input parameter values corresponding to the parameters to be called, the corresponding input parameters need to be spliced and then returned. Optionally, the plurality of input parameters may be spliced according to a set sequence and then returned, or may be sequentially spliced according to a storage sequence of the input parameters in the system cache database and then returned. And the corresponding input parameters are spliced according to a set sequence and then returned, so that the data returned to the user are more ordered and can be consulted by the user in the aspect.
Different from the prior art, the interface calling method of the application sets at least part of input parameters of the first interface as global variables, and stores at least part of the input parameters into the system cache database after the at least part of the input parameters are obtained, so that at least part of the input parameters can become shared data of other interfaces. When the second interface calls the data of the first interface, the input parameters corresponding to the parameters to be called are searched from the system cache database, and the input parameters corresponding to the parameters to be called are returned, so that the effects of one-place storage and everywhere availability are realized. When the data between the interfaces is called, the processes of reading, analyzing, matching and returning parameters are automatically finished without manual query and configuration, and the efficiency of data transmission is improved.
Referring to fig. 3, fig. 3 is a schematic structural diagram of an embodiment of an apparatus for interface invocation according to the present application, and in the present embodiment, the apparatus includes a receiving module 301, a storing module 302, a determining module 303, and a returning module 304.
The receiving module 301 is configured to receive a request for setting a global variable for at least part of parameters of the first interface. In this embodiment, a request for setting a global variable for an input parameter of an interface may be transmitted by setting a global tag. Specifically, global labels, such as global flags, are added to the interface input parameters that require setting of global variables. The server is convenient to subsequently determine the parameters of the global variables needing to be set. In a preferred embodiment, the configuration of the global tag is done based on the node language and using the vue component.
In order to simplify the flow and maximize the data sharing among the interfaces, all input parameters in the interfaces to be called can be set as global variables. In other alternative embodiments, only some of the input parameters may be set as global variables to further save memory space.
The storage module 302 is configured to obtain at least part of the parameters based on the request, and store at least part of the input parameters in a system cache database. Specifically, the storage module 302 is configured to obtain at least part of the input parameters from the corresponding data packet by parsing based on the global tag; and storing at least part of the input parameters in a system cache database.
In a specific embodiment, when the number of input parameters requiring setting of the global variable is more than two, the storage module 302 acquires a plurality of input parameters requiring setting of the global variable to form a list. Then at least part of input parameters in the interface are analyzed according to the list, so that at least part of input parameters which can be called by other interfaces are obtained, and then the at least part of input parameters are stored in a system cache database.
Further, the storage module 302 parses at least a portion of the input parameters from the corresponding data packet in a get manner or a post manner. When a get mode is adopted, analyzing from uniform resource identifier fields of corresponding lines of the data packet to obtain at least part of input parameters; when the post mode is adopted, at least part of input parameters are obtained by analyzing the message body of the data packet.
In a preferred embodiment, the system cache database is a redis storage system. In other alternative embodiments, the system cache database may also be a memcached data cache system.
The receiving module 301 is further configured to receive a call instruction of the second interface, where the call instruction includes a parameter to be called. For clearer definition of variables, the call instruction further comprises a placeholder of an input parameter corresponding to the parameter to be called. A fixed location is preempted by placeholders to define specific variables. The placeholder can be various symbols such as #,% d,% i, and the like, and the user can carry out definition setting by himself.
The judging module 303 is configured to judge whether an input parameter corresponding to a parameter to be called exists in the system cache database. The determining module 303 finds and matches the parameter to be called in the system cache database, and determines whether an input parameter value corresponding to the parameter to be called exists in the system cache database. When the input parameter corresponding to the parameter to be called is not inquired, a prompt can be sent to the user, and the user can search in a manual configuration mode and return a corresponding value.
The returning module 304 is configured to, when a parameter to be called exists in the system cache database, obtain an input parameter corresponding to the parameter to be called from the system cache database, and return the input parameter corresponding to the parameter to be called. When the calling instruction includes the placeholder corresponding to the parameter to be called, the returning module 304 is configured to obtain the input parameter corresponding to the parameter to be called from the system cache database, replace the placeholder with the input parameter, and return the parameter to be called and the input parameter.
When the parameter to be called corresponds to a plurality of input parameters, the return module 304 is configured to obtain the plurality of input parameters corresponding to the parameter to be called from the system cache database, splice the plurality of input parameters according to a set sequence, and return the spliced input parameters.
Different from the prior art, the device for calling the interface sets at least part of input parameters of the first interface as global variables, and stores at least part of the input parameters into the system cache database after the at least part of the input parameters are obtained, so that at least part of the input parameters can become shared data of other interfaces. When the second interface calls the data of the first interface, the input parameters corresponding to the parameters to be called are searched from the system cache database, and the input parameters corresponding to the parameters to be called are returned, so that the effects of one-place storage and everywhere availability are realized. When the data between the interfaces is called, the processes of reading, analyzing, matching and returning parameters are automatically finished without manual query and configuration, and the efficiency of data transmission is improved.
Referring to fig. 4, fig. 4 is a schematic structural diagram of an embodiment of an intelligent terminal according to the present application, where the intelligent terminal 4 includes at least one processor 401 and a memory 402 connected to the processor 401, where the memory 402 stores instructions executable by the processor 401, and the instructions are executed by the processor 401 to implement the interface calling method according to any of the embodiments.
Specifically, the processor 401 is configured to receive a request for setting a global variable for at least part of parameters of the first interface; and acquiring at least part of input parameters based on the request, and storing the at least part of input parameters in a system cache database. In a specific embodiment, the processor 401 is configured to add a global tag to at least a portion of the input parameters; analyzing at least part of input parameters from the corresponding data packet based on the global label; and storing at least part of the input parameters in a system cache database.
Optionally, the processor 401 is configured to parse at least a part of the input parameters from the corresponding data packet through a get method or a post method. When a get mode is adopted, analyzing from uniform resource identifier fields of corresponding lines of the data packet to obtain at least part of input parameters; when the post mode is adopted, at least part of input parameters are obtained by analyzing the message body of the data packet.
The processor 401 is further configured to receive a call instruction of the second interface, where the call instruction includes a parameter to be called. For clearer definition of variables, the call instruction further comprises a placeholder of an input parameter corresponding to the parameter to be called. A fixed location is preempted by placeholders to define specific variables. The placeholder can be various symbols such as #,% d,% i, and the like, and the user can carry out definition setting by himself.
Further, the processor 401 is configured to determine whether a parameter to be called exists in the system cache database; and when the parameters to be called exist in the system cache database, acquiring the input parameters corresponding to the parameters to be called from the system cache database, and returning the input parameters corresponding to the parameters to be called.
Specifically, the processor 401 searches and matches the parameter to be called in the system cache database, and determines whether an input parameter value corresponding to the parameter to be called exists in the system cache database. When the input parameter corresponding to the parameter to be called is not inquired, a prompt can be sent to the user, and the user can search in a manual configuration mode and return a corresponding value.
When the calling instruction includes a placeholder corresponding to the parameter to be called, the processor 401 is configured to obtain an input parameter corresponding to the parameter to be called from the system cache database, replace the placeholder with the input parameter, and return the parameter to be called and the input parameter.
When the parameter to be called corresponds to multiple input parameters, the processor 401 is configured to obtain the multiple input parameters corresponding to the parameter to be called from the system cache database, splice the multiple input parameters according to a set sequence, and then return the spliced multiple input parameters.
Different from the prior art, the intelligent terminal of the application sets at least part of input parameters of the first interface as global variables, and stores at least part of the input parameters into the system cache database after the at least part of the input parameters are acquired, so that at least part of the input parameters can become shared data of other interfaces. When the second interface calls the data of the first interface, the input parameters corresponding to the parameters to be called are searched from the system cache database, and the input parameters corresponding to the parameters to be called are returned, so that the effects of one-place storage and everywhere availability are realized. When the data between the interfaces is called, the processes of reading, analyzing, matching and returning parameters are automatically finished without manual query and configuration, and the efficiency of data transmission is improved.
Referring to fig. 5, fig. 5 is a schematic structural diagram of a memory device according to an embodiment of the present disclosure. In this embodiment, the storage device 5 stores program data 501 executable by a processor, and the program data 501 is used for executing the method called by the interface in any of the above embodiments.
The storage device 5 may be a medium that can store program data, such as a usb disk, a portable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk, or may be a server or a terminal that stores the program data 501, and the server or the terminal may transmit the stored program data 501 to another device for operation, or may operate the stored program data 501 by itself.
The above embodiments are merely examples and are not intended to limit the scope of the present disclosure, and all modifications, equivalents, and flow charts using the contents of the specification and drawings of the present disclosure or those directly or indirectly applied to other related technical fields are intended to be included in the scope of the present disclosure.

Claims (8)

1. A method for interface invocation, the method comprising:
receiving a request for setting global variables for at least part of input parameters of a first interface, wherein the first interface and other interfaces are operated in a single line mode and are mutually independent, and the first interface is a single-stroke payment-substituting interface or a guarantee payment-substituting interface;
acquiring at least part of input parameters based on the request, and storing the at least part of input parameters into a system cache database, wherein the input parameters have valid periods;
receiving a calling instruction of a second interface, wherein the calling instruction comprises a parameter to be called;
judging whether an input parameter corresponding to the parameter to be called exists in the system cache database;
if the input parameter exists, the input parameter corresponding to the parameter to be called is obtained from the system cache database, and the input parameter corresponding to the parameter to be called is returned;
if not, sending a prompt to the user so that the user can search in a manual configuration mode and return a corresponding value;
wherein the step of receiving a request for setting a global variable for at least part of input parameters of the first interface comprises: adding a global label to the at least part of the input parameters;
the step of acquiring the at least part of input parameters based on the request and storing the at least part of input parameters in a system cache database specifically comprises: analyzing the corresponding data packet based on the global label to obtain at least part of input parameters; storing the at least part of the input parameters in the system cache database;
wherein the step of obtaining the at least part of input parameters from the corresponding data packet by parsing based on the global tag specifically includes: and analyzing the corresponding data packet by a get mode or a post mode to obtain the at least part of input parameters.
2. The method according to claim 1, wherein the step of parsing the at least part of the input parameters from the corresponding data packet in a get manner or a post manner specifically comprises:
analyzing the at least part of input parameters from uniform resource identifier fields of corresponding rows of the data packet; or
And analyzing the at least part of input parameters from the message body of the data packet.
3. The method according to claim 1, wherein the call instruction further comprises a placeholder for an input parameter corresponding to the parameter to be called;
the steps of acquiring the input parameters corresponding to the parameters to be called from the system cache database and returning the input parameters corresponding to the parameters to be called specifically include:
and acquiring the input parameter corresponding to the parameter to be called from the system cache database, replacing the placeholder with the input parameter, and returning the parameter to be called and the input parameter.
4. The method according to claim 1 or 3, wherein the step of acquiring the input parameter corresponding to the parameter to be called from the system cache database and returning the input parameter corresponding to the parameter to be called specifically comprises:
and acquiring a plurality of input parameters corresponding to the parameters to be called from the system cache database, splicing the input parameters according to a set sequence, and returning.
5. The method of claim 1, wherein the system cache database is a redis storage system.
6. The device for calling the interface is characterized by comprising a receiving module, a storage module, a judging module and a returning module,
the receiving module is used for receiving a request for setting global variables for at least part of input parameters of a first interface, the first interface and other interfaces are operated in a single-wire mode and are mutually independent, and the first interface is a single payment substitute interface or a guarantee payment substitute interface;
the storage module is used for acquiring the at least part of input parameters based on the request and storing the at least part of input parameters into a system cache database, wherein the input parameters have valid periods;
the receiving module is further used for receiving a calling instruction of a second interface, wherein the calling instruction comprises a parameter to be called;
the judging module is used for judging whether the input parameters corresponding to the parameters to be called exist in the system cache database or not;
the return module is used for acquiring the input parameters corresponding to the parameters to be called from the system cache database when the input parameters exist in the system cache database, and returning the input parameters corresponding to the parameters to be called; if the input parameters do not exist in the system cache database, sending a prompt to a user so that the user can search in a manual configuration mode and return a corresponding value;
in terms of receiving a request for setting a global variable by at least part of input parameters of a first interface, the receiving module is specifically configured to: adding a global label to the at least part of the input parameters;
in terms of acquiring the at least part of the input parameters based on the request and storing the at least part of the input parameters in a system cache database, the storage module is specifically configured to: analyzing the corresponding data packet based on the global label to obtain at least part of input parameters; storing the at least part of the input parameters in the system cache database;
in terms of parsing the at least part of the input parameters from the corresponding data packet based on the global tag, the storage module is specifically configured to: and analyzing the corresponding data packet by a get mode or a post mode to obtain the at least part of input parameters.
7. An intelligent terminal, characterized in that the intelligent terminal comprises at least one processor, a memory connected with the processor,
wherein the memory has stored thereon instructions executable by the processor to implement the method called by the interface of any of claims 1-5.
8. A storage device, characterized in that the storage device stores program data which can be executed to implement the method of interface invocation according to any one of claims 1-5.
CN201811573888.2A 2018-12-21 2018-12-21 Interface calling method and device, intelligent terminal and storage device Active CN111352741B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811573888.2A CN111352741B (en) 2018-12-21 2018-12-21 Interface calling method and device, intelligent terminal and storage device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811573888.2A CN111352741B (en) 2018-12-21 2018-12-21 Interface calling method and device, intelligent terminal and storage device

Publications (2)

Publication Number Publication Date
CN111352741A CN111352741A (en) 2020-06-30
CN111352741B true CN111352741B (en) 2021-04-06

Family

ID=71198019

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811573888.2A Active CN111352741B (en) 2018-12-21 2018-12-21 Interface calling method and device, intelligent terminal and storage device

Country Status (1)

Country Link
CN (1) CN111352741B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113590699B (en) * 2021-07-14 2023-12-01 车智互联(北京)科技有限公司 Interface request processing method, system and computing device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105573733A (en) * 2014-10-16 2016-05-11 腾讯科技(深圳)有限公司 Communication method for browser and web front end and web front end and system
CN107861713A (en) * 2017-07-25 2018-03-30 平安普惠企业管理有限公司 Data calling method, device and computer-readable recording medium
CN107908485A (en) * 2017-10-26 2018-04-13 中国平安人寿保险股份有限公司 Interface parameters transmission method, device, equipment and computer-readable recording medium
CN108062223A (en) * 2017-11-29 2018-05-22 北京新能源汽车股份有限公司 A kind of method and device to establish a connection between Simulink models

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9886368B2 (en) * 2016-05-23 2018-02-06 International Business Machines Corporation Runtime detection of uninitialized variable across functions
CN108093070B (en) * 2017-12-27 2020-12-18 复旦大学 Internet of things data service middleware system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105573733A (en) * 2014-10-16 2016-05-11 腾讯科技(深圳)有限公司 Communication method for browser and web front end and web front end and system
CN107861713A (en) * 2017-07-25 2018-03-30 平安普惠企业管理有限公司 Data calling method, device and computer-readable recording medium
CN107908485A (en) * 2017-10-26 2018-04-13 中国平安人寿保险股份有限公司 Interface parameters transmission method, device, equipment and computer-readable recording medium
CN108062223A (en) * 2017-11-29 2018-05-22 北京新能源汽车股份有限公司 A kind of method and device to establish a connection between Simulink models

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
《Fortran与C/C++共享公用外部数据》;任慧 等;《郑州大学学报(工学版)》;20071231;第28卷(第4期);第63-65页 *
《TURBO C语言对汇编语言调用时数据传递的方法》;陈菊红;《现代电子技术》;19961231;第12,17页 *

Also Published As

Publication number Publication date
CN111352741A (en) 2020-06-30

Similar Documents

Publication Publication Date Title
US8145726B1 (en) Method and apparatus for web resource validation
US9514240B2 (en) System to modify a website for search optimization
JP2009059353A (en) Device and method for retrieving information selectively and enabling display of information after that
US10382313B2 (en) Test building for testing server operation
CN112148580A (en) Test method and device and electronic equipment
US11681696B2 (en) Finding services in a service registry system of a service-oriented architecture
CN111309466B (en) Multithreading scheduling method, system, equipment and medium based on cloud platform
US10489024B2 (en) UI rendering based on adaptive label text infrastructure
CN113419729A (en) Front-end page building method, device, equipment and storage medium based on modularization
US20050108388A1 (en) Method, system, and apparatus for scheduling pattern based web services
Currier Protocol buffers
CN111352741B (en) Interface calling method and device, intelligent terminal and storage device
CN110851136A (en) Data acquisition method and device, electronic equipment and storage medium
CN111177098B (en) Method and system for checking system log context
CN110781375B (en) User state identification determining method and device
CN110502690B (en) Classified search method and device
US20120047228A1 (en) Method for delivering tag based services
CN113609166A (en) Search method, search device, computer equipment and computer-readable storage medium
US20150324333A1 (en) Systems and methods for automatically generating hyperlinks
CN112966029A (en) Information display and sending method, device, equipment and readable medium
CN115470127B (en) Page compatibility processing method, device, computer equipment and storage medium
CN116467519A (en) Search ordering method, device, server and storage medium
CN117725080A (en) SQL grammar compatibility evaluation method and device
CN117806741A (en) Page display method and device, computer equipment, storage medium and product
CN117093478A (en) Method, device, equipment and readable storage medium for managing and using test data

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