CN111158661A - System interface docking method, device, medium and electronic equipment - Google Patents

System interface docking method, device, medium and electronic equipment Download PDF

Info

Publication number
CN111158661A
CN111158661A CN201911265346.3A CN201911265346A CN111158661A CN 111158661 A CN111158661 A CN 111158661A CN 201911265346 A CN201911265346 A CN 201911265346A CN 111158661 A CN111158661 A CN 111158661A
Authority
CN
China
Prior art keywords
request
parameter
corresponding relation
execution code
protocol
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.)
Pending
Application number
CN201911265346.3A
Other languages
Chinese (zh)
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 Property and Casualty Insurance Company of China Ltd
Original Assignee
Ping An Property and Casualty 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 Property and Casualty Insurance Company of China Ltd filed Critical Ping An Property and Casualty Insurance Company of China Ltd
Priority to CN201911265346.3A priority Critical patent/CN111158661A/en
Publication of CN111158661A publication Critical patent/CN111158661A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code

Abstract

The disclosure relates to the field of software development and discloses a system interface docking method, a system interface docking device, a system interface docking medium and electronic equipment. The method comprises the following steps: acquiring a corresponding relation between a first parameter of a first system corresponding to a target interface and a second parameter of a second system; acquiring a request address and a request protocol of a target interface; generating an execution code according to the request address, the request protocol and the corresponding relation; sending the execution code to the first system; when receiving an execution code of a first system, acquiring a request address, a request protocol and a corresponding relation corresponding to the execution code, and sending the request address, the request protocol and the corresponding relation to a request execution engine, so that the request execution engine packages a first parameter into a second parameter according to the corresponding relation, and then sends the second parameter to a second system according to the request address and the request protocol to call a target interface, receive data returned by the second system, and return the data. Under the method, the interface docking cost is reduced, the interface docking efficiency is improved, and the system risk is reduced.

Description

System interface docking method, device, medium and electronic equipment
Technical Field
The present disclosure relates to the field of software development technologies, and in particular, to a system interface docking method, apparatus, medium, and electronic device.
Background
At present, software developers mainly adopt a mode when realizing interface docking between two different systems, and the software developers carry out a series of development work according to docking files provided by the other party. These tasks are mainly: determining which parameters are butted, and establishing a corresponding parameter class; determining a request address and a coding mode of the request address; determining a request protocol, learning a related protocol and carrying out corresponding development work; after the development is finished, testing work is carried out.
Therefore, the interface docking mode adopted in the prior art needs a great amount of repeated and tedious work of developers. Therefore, the existing interface docking mode has the problems of high labor cost, low interface docking efficiency, high system risk caused by more development steps and the like.
Disclosure of Invention
In the technical field of software development, to solve the above technical problems, an object of the present disclosure is to provide a system interface docking method, apparatus, medium, and electronic device.
According to an aspect of the present application, there is provided a system interface interfacing method, the method including:
acquiring a corresponding relation between a first parameter on a first system and a second parameter on a second system corresponding to a target interface, so as to be used for butting the target interfaces of the first system and the second system;
acquiring a request address and a request protocol of the target interface;
generating an execution code according to the request address, the request protocol and the corresponding relation;
sending the execution code to the first system so that the first system calls the target interface by using the execution code after receiving an access request needing to call the target interface;
when receiving an execution code analysis request from the first system, acquiring the request address, the request protocol and the corresponding relation corresponding to the execution code by using the execution code in the execution code analysis request, and sends the request address, request protocol and corresponding relation to a preset request execution engine, so that the request execution engine encapsulates the first parameter of the first system according to the corresponding relation, takes the encapsulated first parameter as the second parameter of the second system, and transmitting the encapsulated second parameter to the second system according to the request address and request protocol to call the target interface by the request execution engine, and receiving target data returned by the second system according to the call to the target interface, and returning the target data to a sender of the access request by the request execution engine.
According to another aspect of the present application, there is provided a system interface interfacing apparatus, the apparatus including:
the first acquisition module is configured to acquire a corresponding relation between a first parameter on the first system and a second parameter on the second system corresponding to the target interface, so as to interface the target interfaces of the first system and the second system;
a second obtaining module configured to obtain a request address and a request protocol of the target interface;
the execution code generation module is configured to generate an execution code according to the request address, the request protocol and the corresponding relation;
the execution code sending module is configured to send the execution code to the first system, so that the first system calls the target interface by using the execution code after receiving an access request needing to call the target interface;
an execution code analysis module, when receiving an execution code analysis request from the first system, using the execution code in the execution code analysis request to obtain the request address, the request protocol and the corresponding relation corresponding to the execution code, and sends the request address, request protocol and corresponding relation to a preset request execution engine, so that the request execution engine encapsulates the first parameter of the first system according to the corresponding relation, takes the encapsulated first parameter as the second parameter of the second system, and transmitting the encapsulated second parameter to the second system according to the request address and request protocol to call the target interface by the request execution engine, and receiving target data returned by the second system according to the call to the target interface, and returning the target data to a sender of the access request by the request execution engine.
According to another aspect of the present application, there is provided a computer readable program medium storing computer program instructions which, when executed by a computer, cause the computer to perform the method as previously described.
According to another aspect of the present application, there is provided an electronic device including:
a processor;
a memory having computer readable instructions stored thereon which, when executed by the processor, implement the method as previously described.
The technical scheme provided by the embodiment of the invention can have the following beneficial effects:
the system interface docking method provided by the invention comprises the following steps: acquiring a corresponding relation between a first parameter on a first system and a second parameter on a second system corresponding to a target interface, so as to be used for butting the target interfaces of the first system and the second system; acquiring a request address and a request protocol of the target interface; generating an execution code according to the request address, the request protocol and the corresponding relation; sending the execution code to the first system so that the first system calls the target interface by using the execution code after receiving an access request needing to call the target interface; when receiving an execution code analysis request from the first system, acquiring the request address, the request protocol and the corresponding relation corresponding to the execution code by using the execution code in the execution code analysis request, and sends the request address, request protocol and corresponding relation to a preset request execution engine, so that the request execution engine encapsulates the first parameter of the first system according to the corresponding relation, takes the encapsulated first parameter as the second parameter of the second system, and transmitting the encapsulated second parameter to the second system according to the request address and request protocol to call the target interface by the request execution engine, and receiving target data returned by the second system according to the call to the target interface, and returning the target data to a sender of the access request by the request execution engine.
Under the method, when the interfaces between the systems are butted, the interface can be butted only by providing a parameter corresponding relation, a request address and a request protocol by a user, and tasks such as specific parameter butting and packaging, request address configuration, parameter packaging into a message of the request protocol and the like are executed by a request execution engine which is developed in advance, so that task codes do not need to be repeatedly written when the interfaces are butted each time, a person who carries out the interface butting does not need to learn the request protocol required by the interface butting, the labor cost of the interface butting is reduced, the efficiency of the interface butting is improved, and meanwhile, the system risk can be reduced due to the reduction of development steps.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention, as claimed.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention.
FIG. 1 is a system architecture diagram illustrating a method of system interface interfacing, according to an exemplary embodiment;
FIG. 2 is a system architecture diagram illustrating a system interface interfacing method in accordance with another exemplary embodiment;
FIG. 3 is a flow diagram illustrating a system interface docking method in accordance with an exemplary embodiment;
FIG. 4 is an interface diagram illustrating a correspondence for obtaining parameters, according to an exemplary embodiment;
FIG. 5 is a flowchart detailing step 330 according to one embodiment shown in a corresponding embodiment in FIG. 3;
FIG. 6 is a block diagram illustrating a system interface docking arrangement in accordance with an exemplary embodiment;
FIG. 7 is a block diagram illustrating an example of an electronic device implementing the system interface docking method described above, according to an example embodiment;
fig. 8 is a diagram illustrating a computer-readable storage medium implementing the system interface interfacing method described above, according to an exemplary embodiment.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the invention, as detailed in the appended claims.
Furthermore, the drawings are merely schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and thus their repetitive description will be omitted. Some of the block diagrams shown in the figures are functional entities and do not necessarily correspond to physically or logically separate entities.
The present disclosure first provides a system interface interfacing method. The system herein refers to a software system, including but not limited to database management systems, file storage systems, human-computer interaction systems, and the like, which comprise one or more functional modules. An Interface, i.e. an API (Application Programming Interface), is a convention for the connection between different components of a software system or between different software systems, and may include a reference type, while other types may implement an Interface. The specific implementation of the interface may be based on various programming languages, such as Java, C #, etc. The system interface docking refers to docking an external interface provided by the first system and the second system, so that the first system can realize certain functions or complete certain tasks by calling the interface of the second system. The first system and the second system may be two separate systems, or may be two subsystems under the same system, and each subsystem may include at least one functional module.
The implementation terminal of the present disclosure may be any device having computing, processing, and communication functions, which may be connected to an external device for receiving or sending data, may be a portable mobile device, such as a smart phone, a tablet computer, a notebook computer, a pda (personal Digital assistant), or the like, may also be a fixed device, such as a computer device, a field terminal, a desktop computer, a server, a workstation, or the like, and may also be a set of multiple devices, such as a server cluster or a physical infrastructure of cloud computing, or the like.
Preferably, the implementation terminal of the present disclosure may be a server, a server cluster, or a physical infrastructure of cloud computing.
A system architecture of the system interface interfacing method provided by the embodiments of the present disclosure will be described below.
Fig. 1 is a system architecture diagram illustrating a system interface interfacing method according to an exemplary embodiment. As shown in fig. 1, the system architecture includes an access request sender 110, a first system 130, a second system 160, an execution terminal 140, and a user terminal 170 connected to the execution terminal 140 through a communication link, wherein the first system 130 includes a request execution engine 120, and the second system 160 includes an interface 150 provided to the outside. When the system interface interfacing method provided by the embodiment of the present disclosure is applied to the system architecture shown in the embodiment of fig. 1, a specific process may be as follows:
the request execution engine 120 is established in advance, and the request execution engine 120 at least has the functions of encapsulating parameters according to the parameter correspondence, further encapsulating the encapsulated parameters into messages of corresponding request protocols, sending a request for calling an interface according to a request address, receiving data, forwarding and the like.
The first system 130 may need to use the functions of other systems in order to process the access request sent by the access request sender 110, and when the first system 130 needs to use the functions provided by the second system 160, it may need to be implemented by calling the interface 150 provided by the second system 160. In order to enable the first system 130 to call the interface 150, after the interface docking developer of the first system 130 reads the docking file of the second system 160 and knows the parameter correspondence between the first system 130 and the second system 160, the request address of the interface 150, and the request protocol required to be used for calling the interface 150 by reading the docking file, the contents known by reading the docking file are sent to the execution terminal 140 of the present disclosure through the user terminal 170, the execution terminal 140 generates a corresponding execution code according to the acquired contents, and the execution code is returned to the first system 130.
After the request execution engine 120 of the first system 130 receives the access request from the access request sender 110, the first system 130 sends a corresponding execution code to the execution terminal 140, the execution terminal 140 may determine a corresponding parameter correspondence, a request address, and a request protocol according to the obtained execution code, and send the determined corresponding parameter correspondence, request address, and request protocol to the request execution engine 120, where the request execution engine 120 may convert data carried in the access request into a first parameter, and then encapsulate the first parameter into a second parameter that can be identified by the second system 160 according to the parameter correspondence; next, the request execution engine 120 further encapsulates the second parameter into a message of the request protocol that can be recognized by the second system 160 according to the request protocol, and then the request execution engine 120 sends the message to the second system 160 according to the request address to call the interface 150, the second system 160 may return a corresponding result to the request execution engine 120 according to the second parameter in the message that is sent by calling the interface, and the request execution engine 120 may send the result to the access request sender 110 after obtaining the result.
Fig. 2 is a system architecture diagram illustrating a system interface interfacing method according to another exemplary embodiment. As shown in fig. 2, the system architecture includes an access request sender 210, a first system 220, a request execution engine 230, a second system 260, an execution terminal 240, and a user terminal 270 connected to the execution terminal 240 through a communication link, wherein the second system 260 includes an externally provided interface 250. When the system interface interfacing method provided by the embodiment of the present disclosure is applied to the system architecture in the embodiment of fig. 2, a specific process for implementing interface interfacing may be the same as the process in the embodiment of fig. 1, and the difference between the embodiment of fig. 2 and the embodiment of fig. 1 is that the request execution engine is located outside the first system.
Thus, it is understood that the system architectures provided by fig. 1 and 2 are both embodiments of the present disclosure. The position of the request execution engine in the system interface docking method provided by the embodiment of the disclosure may be arbitrary, and may be a part of the first system, or may be located outside the first system; meanwhile, among the functions performed by all the request execution engines, the functions other than encapsulating the parameters according to the parameter correspondence, further encapsulating the encapsulated parameters into messages of the corresponding request protocol, and sending a request for invoking the interface according to the request address may be performed by the first system, for example, although in the embodiment of fig. 1, the request execution engine receives the access request sent by the access request sender, and converts the data carried in the access request into the first parameter by the request execution engine, in other embodiments, the task of receiving the access request and converting the data in the access request into the first parameter may be performed by other modules or components in the first system. Therefore, the system architecture adopted in the practical application of the system interface interfacing method provided by the embodiment of the present disclosure may be various, and is not limited to those shown in fig. 1 and fig. 2, and the interaction manner between the parts in the system architecture may also be selected according to needs.
FIG. 3 is a flow diagram illustrating a system interface interfacing method in accordance with an exemplary embodiment. The present embodiment may be performed by a server. As shown in fig. 3, the method comprises the following steps:
step 310, acquiring a corresponding relationship between a first parameter on the first system and a second parameter on the second system corresponding to the target interface, so as to interface the target interfaces of the first system and the second system.
As mentioned above, the first system and the second system may be two separate systems, or may be two subsystems of the same system.
The target interface is an interface provided externally by the second system, and provides a capability for realizing a specific function which is possessed only by the second system for a system other than the second system.
The parameter is a variable name used for interface calling, and may be a character string composed of letters, numbers, underlines and other elements. The parameters generally have corresponding parameter values, which are generally used for the processing of actual services.
The first parameter refers to a type of parameter corresponding to the target interface on the first system, and the second parameter refers to a type of parameter corresponding to the target interface on the second system, so that the first parameter and the second parameter respectively include a plurality of parameters.
If the first parameter value corresponding to the first parameter can be used as the second parameter value corresponding to the second parameter and transmitted into the target interface, the target interface on the first system and the second system can be butted. Before obtaining the corresponding relationship between the first parameter on the first system corresponding to the target interface and the second parameter on the second system, a developer of the first system first makes the first parameter on the first system corresponding to the target interface.
In one embodiment, the correspondence between the first parameter on the first system and the second parameter on the second system corresponding to the target interface is determined and submitted to the local end by the developer of the first system after reading the docking document of the second system.
In one embodiment, before obtaining a correspondence of a first parameter on a first system and a second parameter on a second system corresponding to a target interface, the method further comprises: and determining whether the first parameter on the first system corresponding to the target interface is formulated successfully, wherein the obtaining of the corresponding relation between the first parameter on the first system corresponding to the target interface and the second parameter on the second system is performed under the condition that the formulation of the first parameter on the first system corresponding to the target interface is successful.
In this embodiment, the first parameter of the first system needs to be manually formulated in advance, and the correspondence between the first parameter and the second parameter can be determined only when it is determined that the formulation of the first parameter is successful, so that the interface docking can be performed, thereby avoiding the possibility of interface docking failure caused by unsuccessful formulation of the first parameter, and improving the robustness of the system.
In one embodiment, the obtaining a correspondence between a first parameter on the first system corresponding to the target interface and a second parameter on the second system for interfacing the first system with the target interface includes:
and acquiring a corresponding relation between a first request parameter on the first system and a second request parameter on the second system corresponding to the target interface and a corresponding relation between a first return parameter on the first system and a second return parameter on the second system, so as to be used for butting the target interfaces of the first system and the second system.
In this embodiment, how to interface the parameters of the interface should be interfaced is further specifically explained by further defining the first parameter of the first system and the second parameter of the second system, and the request parameter and the return parameter of the two systems are respectively and correspondingly interfaced, so that the target interface of the first system and the target interface of the second system can be successfully interfaced.
The correspondence between the first parameter and the second parameter can be obtained in various ways as long as the first parameter and the second parameter can be associated with each other.
In one embodiment, the correspondence relationship between the first parameter and the second parameter is previously entered into the correspondence relationship table.
In one embodiment, the obtaining a correspondence between a first request parameter on the first system and a second request parameter on the second system, which correspond to the target interface, and a correspondence between a first return parameter on the first system and a second return parameter on the second system, so as to interface the target interfaces of the first system and the second system, includes:
and receiving the corresponding relation between a first request parameter on the first system and a second request parameter on the second system corresponding to the target interface and the corresponding relation between a first return parameter on the first system and a second return parameter on the second system through the form input boxes correspondingly arranged on the interface so as to be used for butting the target interfaces of the first system and the second system.
The interface can be various front-end display interfaces, such as Web pages, dialog boxes, popup windows and the like.
In this embodiment, the corresponding relationship between the first parameter and the second parameter is obtained by means of a form, where the corresponding relationship is determined based on the layout of the form entry box.
FIG. 4 is an interface diagram illustrating a correspondence for obtaining parameters, according to an example embodiment. As shown in fig. 4, it can be determined from the title of the interface, which can be used for configuration entry of parameter correspondence, wherein, a list of form input boxes corresponding to the first system is used for inputting a first parameter on the first system, a list of form entry boxes corresponding to the second system is used to enter a second parameter on the second system, in the layout of the interface, the parameters recorded in the two form input boxes respectively corresponding to the first system and the second system which are positioned on the same line represent that the two parameters are corresponding to each other in the first system and the second system, and simultaneously, the number of the form entry boxes for entering the corresponding relationship of the parameters on the interface can be any, the logarithm of the parameters entered into the interface by the user can also be any, after the user enters the parameter corresponding relationship through the interface, if the user clicks the save button, the parameter corresponding relationship entered by the user is submitted to the home terminal.
In one embodiment, the interface for obtaining the corresponding relationship of the parameters is displayed by the terminal outside the home terminal, and the corresponding relationship of the parameters is sent to the home terminal by the terminal after the user of the terminal submits the corresponding relationship of the parameters through the interface.
In one embodiment, the interface for acquiring the corresponding relationship of the parameters is displayed on the implementation terminal of the present disclosure, and the user enters and submits the corresponding relationship of the parameters through the interface and then stores the corresponding relationship of the parameters to the local.
In one embodiment, a developer first formulates a first request parameter and a first return parameter of a first system, and then obtains a corresponding relationship between the first request parameter and a second request parameter submitted by the developer and a corresponding relationship between the first return parameter and a second return parameter, thereby implementing: and acquiring the corresponding relation between a first request parameter on the first system and a second request parameter on the second system corresponding to the target interface and the corresponding relation between a first return parameter on the first system and a second return parameter on the second system.
For example, the first request parameter of the first system formulated by the developer may be: the paramReq1, paramReq2 … … paramReq n, and the first return parameter of the first system set by the developer may be paramResp1, paramResp2 … … paramRespN, etc.
Step 320, obtaining the request address and the request protocol of the target interface.
The request address of the target interface is the access entry of the target interface.
In one embodiment, the request address is a Uniform Resource Locator (URL).
The request Protocol may be various internet protocols supporting the request, such as a Web Service Protocol, an HTTP Protocol (HyperText Transfer Protocol), an RMI (Remote method invocation) Protocol, a Dubbo Protocol, a Hessian Protocol, a Burlap Protocol, and the like.
And step 330, generating an execution code according to the request address, the request protocol and the corresponding relation.
In one embodiment, the correspondence is recorded and represented in the form of a character string.
The execution code is an access mode uniquely corresponding to a set of request addresses, request protocols, and a correspondence between a first parameter on the first system and a second parameter on the second system, and may be a character string, for example.
In one embodiment, the generating an execution code according to the request address, the request protocol, and the correspondence includes:
sequentially connecting the request address, the request protocol and the corresponding relation end to obtain a character sequence;
and carrying out Hash operation on the character sequence to obtain an abstract of the character sequence, and taking the abstract as an execution code corresponding to the request address, the request protocol and the corresponding relation.
And carrying out Hash operation on the character sequence, namely processing the character sequence by using a Hash function.
In one embodiment, the generating an execution code according to the request address, the request protocol, and the correspondence includes:
an unexcited character string is randomly generated as an execution code corresponding to the request address, the request protocol and the correspondence relationship.
The method for configuring and generating the execution code according to the request address, the request protocol and the corresponding relationship includes but is not limited to: a file mode, a database storage mode, a Redis storage mode, a Zookeeper mode, an Etcd mode, a Consul mode, an Eureka mode, an Apollo mode, and the like.
A specific manner of configuring the generation execution code will be described below.
In one embodiment, before generating the execution code according to the request address, the request protocol, and the correspondence, the method further comprises:
inserting the request address, the request protocol and the corresponding relation into a database as records;
the generating of the execution code according to the request address, the request protocol and the corresponding relation includes:
and generating a query statement for the record based on the position of the record in the database, and taking the query statement as an execution code.
The generated query statement may vary according to the kind of the database to be used and the location of the record stored in the database. The generated query statement can uniquely query the record in the database, and the record comprises the request address, the request protocol and the corresponding relation, so that the request address, the request protocol and the corresponding relation can be uniquely determined by taking the query statement as an execution code.
The method has the advantages that the request address, the request protocol and the corresponding relation are inserted into the database and the corresponding query statement is used as the execution code, so that the request address, the request protocol and the corresponding relation can be more conveniently migrated to other environments or systems, and the interface docking efficiency is further improved.
In one embodiment, the query statement is an SQL statement.
In one embodiment, before generating the execution code according to the request address, the request protocol, and the correspondence, the method further comprises:
storing the request address, the request protocol and the corresponding relation into a target file;
the generating of the execution code according to the request address, the request protocol and the corresponding relation includes:
and generating a download link of the target file by using the uniform resource locator pointing to the target file and taking the download link as an execution code.
The embodiment has the advantages that the download link of the target file containing the request address, the request protocol and the corresponding relation is used as the execution code, and the request address, the request protocol and the corresponding relation corresponding to the execution code can be obtained as long as other environments or systems obtain the download link as the execution code, so that the request address, the request protocol and the corresponding relation can be more conveniently migrated to other environments or systems, and the interface docking efficiency is further improved.
In one embodiment, the generating an execution code according to the request address, the request protocol, and the correspondence includes:
sending the request address, the request protocol and the corresponding relation to a pre-established configuration center;
and receiving a configuration statement generated by the configuration center according to the request address, the request protocol and the corresponding relation as an execution code.
The configuration center is used for generating corresponding configuration statements according to the received request address, the request protocol and the corresponding relation. The configuration center is used as a software system, wherein the code logic can be various, so that various ways can be adopted to generate corresponding configuration statements according to the received request address, request protocol and corresponding relation, and in addition, the configuration center can also allow the configuration statements to be customized according to needs.
The embodiment has the advantages that the configuration statement generated by the configuration center is used as the execution code, when interface docking is needed, the request address, the request protocol and the corresponding relation can be obtained by using the configuration statement, and the interface docking efficiency is ensured.
Step 340, sending the execution code to the first system, so that the first system calls the target interface by using the execution code after receiving the access request needing to call the target interface.
The first system can receive access requests sent by other terminals or devices, and if the access requests of other terminals or devices to the first system relate to a function on the first system, which is related to the target interface, the target interface of the second system needs to be called to execute the function.
For example, if the service system of another terminal needs a certain processing result of the first system, and the first system needs to call the target interface first to obtain the processing result, the first system will call the target interface first by using the parameter, thereby completing the output of the corresponding processing result.
Since the first system obtains the execution code, if the first system needs to call the target interface, the first system can use the obtained execution code to implement the execution.
In one embodiment, the execution code is sent to the first system over a TCP/IP connection with the first system.
Step 350, when receiving the request for executing code resolution from the first system, using the executing code in the request for executing code resolution to obtain the request address, request protocol and corresponding relation corresponding to the executing code, and sends the request address, request protocol and corresponding relation to a preset request execution engine, so that the request execution engine encapsulates the first parameter of the first system according to the corresponding relation, takes the encapsulated first parameter as the second parameter of the second system, and transmitting the encapsulated second parameter to the second system according to the request address and request protocol to call the target interface by the request execution engine, and receiving target data returned by the second system according to the call to the target interface, and returning the target data to a sender of the access request by the request execution engine.
The request execution engine is a pre-established system, may be located outside of the first system, or may be part of the first system.
The request execution engine at least has three functions of encapsulating parameters according to the corresponding relation of the parameters, further encapsulating the encapsulated parameters into messages of corresponding request protocols, and sending out requests for calling the interface according to request addresses.
In one embodiment, the execution code and the corresponding request address, request protocol and corresponding relation are correspondingly stored in the local terminal, and the request address, request protocol and corresponding relation corresponding to the execution code are obtained by reading the content correspondingly stored with the execution code in the local terminal.
Since the target interface on the second system can only be normally called by using the second parameter, the first system can normally call the target interface on the second system by packaging the first parameter of the first system into the form of the second parameter.
In one embodiment, the first parameters include a first request parameter and a first return parameter, and the second parameters include a second request parameter and a second return parameter, and step 350 may include:
when receiving an execution code analysis request from the first system, acquiring the request address, the request protocol and the corresponding relation corresponding to the execution code by using the execution code in the execution code analysis request, and sending the request address, the request protocol and the corresponding relation to a preset request execution engine, so that the request execution engine encapsulates a first request parameter of the first system according to the corresponding relation, takes the encapsulated first request parameter as a second request parameter of a second system, sends the encapsulated second request parameter to the second system according to the request address and the request protocol to invoke the target interface by the request execution engine, receives a second return parameter returned by the second system according to the invocation of the target interface, and encapsulates the second return parameter into the corresponding first return parameter according to the corresponding relation by the request execution engine, and returning the first return parameter to the sender of the access request.
In summary, according to the system interface docking method provided in the embodiment of fig. 3, when the interfaces between the systems are docked, the interfaces can be docked only by providing the parameter correspondence, the request address, and the request protocol by the user, and the specific tasks such as parameter docking and encapsulation, configuration of the request address, and encapsulation of the parameters into the message of the request protocol are executed by the request execution engine that is developed in advance, so that the task codes do not need to be repeatedly written each time the interfaces are docked, and the person performing the interface docking does not need to learn the request protocol required by the interface docking, which reduces the labor cost of the interface docking, improves the efficiency of the interface docking, and reduces the system risk due to the reduction of development steps.
Fig. 5 is a detailed flowchart of step 330 according to one embodiment shown in a corresponding embodiment of fig. 3. As shown in fig. 5, the method comprises the following steps:
step 331, performing hash operation on the request address, the request protocol and the corresponding relation respectively to obtain digests of the request address, the request protocol and the corresponding relation respectively.
In this step, the hash operations are performed on the request address, the request protocol, and the correspondence, respectively. Namely, carrying out Hash operation on the request address to obtain the abstract of the request address; carrying out Hash operation on the request protocol to obtain an abstract of the request protocol; and carrying out Hash operation on the corresponding relation to obtain an abstract of the corresponding relation.
And 332, taking a character string formed by sequentially connecting the request address, the request protocol and the abstract of the corresponding relation end to end as an execution code corresponding to the request address, the request protocol and the corresponding relation.
In this embodiment, the request address, the request protocol, and the three elements of the correspondence relation are respectively subjected to the hash operation to generate the execution code, and since the portion of the execution code corresponding to each element is largely unique, when the portions of the execution codes corresponding to the three elements are combined together, the execution codes can be made unique, and the uniqueness and the usability of the generated execution code can be further improved.
The present disclosure also provides a system interface docking device, and the following are device embodiments of the present disclosure.
FIG. 6 is a block diagram illustrating a system interface docking device according to an exemplary embodiment. As shown in fig. 6, the apparatus 600 includes:
a first obtaining module 610 configured to obtain a corresponding relationship between a first parameter on the first system and a second parameter on the second system corresponding to the target interface, so as to interface the target interface of the first system and the target interface of the second system;
a second obtaining module 620, configured to obtain a request address and a request protocol of the target interface;
an execution code generation module 630 configured to generate an execution code according to the request address, the request protocol, and the correspondence;
an execution code sending module 640, configured to send the execution code to the first system, so that the first system calls the target interface by using the execution code after receiving an access request that needs to call the target interface;
the executable code parsing module 650, upon receiving an executable code parsing request from the first system, obtains the request address, the request protocol and the corresponding relationship corresponding to the executable code by using the executable code in the executable code parsing request, and sends the request address, request protocol and corresponding relation to a preset request execution engine, so that the request execution engine encapsulates the first parameter of the first system according to the corresponding relation, takes the encapsulated first parameter as the second parameter of the second system, and transmitting the encapsulated second parameter to the second system according to the request address and request protocol to call the target interface by the request execution engine, and receiving target data returned by the second system according to the call to the target interface, and returning the target data to a sender of the access request by the request execution engine.
According to a third aspect of the present disclosure, there is also provided an electronic device capable of implementing the above method.
As will be appreciated by one skilled in the art, aspects of the present invention may be embodied as a system, method or program product. Thus, various aspects of the invention may be embodied in the form of: an entirely hardware embodiment, an entirely software embodiment (including firmware, microcode, etc.) or an embodiment combining hardware and software aspects that may all generally be referred to herein as a "circuit," module "or" system.
An electronic device 700 according to this embodiment of the invention is described below with reference to fig. 7. The electronic device 700 shown in fig. 7 is only an example and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 7, electronic device 700 is embodied in the form of a general purpose computing device. The components of the electronic device 700 may include, but are not limited to: the at least one processing unit 710, the at least one memory unit 720, and a bus 730 that couples various system components including the memory unit 720 and the processing unit 710.
Wherein the storage unit stores program code that can be executed by the processing unit 710 such that the processing unit 710 performs the steps according to various exemplary embodiments of the present invention described in the section "example methods" above in this specification.
The storage unit 720 may include readable media in the form of volatile memory units, such as a random access memory unit (RAM)721 and/or a cache memory unit 722, and may further include a read only memory unit (ROM) 723.
The memory unit 720 may also include programs/utilities 724 having a set (at least one) of program modules 725, such program modules 725 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may comprise an implementation of a network environment.
Bus 730 may be any representation of one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
The electronic device 700 may also communicate with one or more external devices 900 (e.g., keyboard, pointing device, bluetooth device, etc.), with one or more devices that enable a user to interact with the electronic device 700, and/or with any devices (e.g., router, modem, etc.) that enable the electronic device 700 to communicate with one or more other computing devices. Such communication may occur via an input/output (I/O) interface 750. Also, the electronic device 700 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network such as the internet) via the network adapter 760. As shown, the network adapter 760 communicates with the other modules of the electronic device 700 via the bus 730. It should be appreciated that although not shown in the figures, other hardware and/or software modules may be used in conjunction with the electronic device 700, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which may be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the embodiments of the present disclosure.
According to a fourth aspect of the present disclosure, there is also provided a computer-readable storage medium having stored thereon a program product capable of implementing the above-mentioned method of the present specification. In some possible embodiments, aspects of the invention may also be implemented in the form of a program product comprising program code means for causing a terminal device to carry out the steps according to various exemplary embodiments of the invention described in the above section "exemplary methods" of the present description, when said program product is run on the terminal device.
Referring to fig. 8, a program product 800 for implementing the above method according to an embodiment of the present invention is described, which may employ a portable compact disc read only memory (CD-ROM) and include program code, and may be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited in this regard and, in the present document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
A computer readable signal medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable signal medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., through the internet using an internet service provider).
Furthermore, the above-described figures are merely schematic illustrations of processes involved in methods according to exemplary embodiments of the invention, and are not intended to be limiting. It will be readily understood that the processes shown in the above figures are not intended to indicate or limit the chronological order of the processes. In addition, it is also readily understood that these processes may be performed synchronously or asynchronously, e.g., in multiple modules.
It will be understood that the invention is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the invention is limited only by the appended claims.

Claims (10)

1. A system interface interfacing method, the method comprising:
acquiring a corresponding relation between a first parameter on a first system and a second parameter on a second system corresponding to a target interface, so as to be used for butting the target interfaces of the first system and the second system;
acquiring a request address and a request protocol of the target interface;
generating an execution code according to the request address, the request protocol and the corresponding relation;
sending the execution code to the first system so that the first system calls the target interface by using the execution code after receiving an access request needing to call the target interface;
when receiving an execution code analysis request from the first system, acquiring the request address, the request protocol and the corresponding relation corresponding to the execution code by using the execution code in the execution code analysis request, and sends the request address, request protocol and corresponding relation to a preset request execution engine, so that the request execution engine encapsulates the first parameter of the first system according to the corresponding relation, takes the encapsulated first parameter as the second parameter of the second system, and transmitting the encapsulated second parameter to the second system according to the request address and request protocol to call the target interface by the request execution engine, and receiving target data returned by the second system according to the call to the target interface, and returning the target data to a sender of the access request by the request execution engine.
2. The method according to claim 1, wherein the first parameters on the first system corresponding to the target interface include at least one first request parameter and at least one first return parameter, and the second parameters on the second system corresponding to the target interface include at least one second request parameter and at least one second return parameter, where the first request parameters and the second request parameters are the same in number, and the first return parameters and the second return parameters are the same in number, and the obtaining of the correspondence between the first parameters on the first system corresponding to the target interface and the second parameters on the second system for interfacing the target interfaces of the first system and the second system comprises:
and acquiring a corresponding relation between a first request parameter on the first system and a second request parameter on the second system corresponding to the target interface and a corresponding relation between a first return parameter on the first system and a second return parameter on the second system, so as to be used for butting the target interfaces of the first system and the second system.
3. The method according to claim 2, wherein the obtaining of the correspondence between the first request parameter on the first system and the second request parameter on the second system corresponding to the target interface and the correspondence between the first return parameter on the first system and the second return parameter on the second system for interfacing the target interface of the first system and the target interface of the second system comprises:
and receiving the corresponding relation between a first request parameter on the first system and a second request parameter on the second system corresponding to the target interface and the corresponding relation between a first return parameter on the first system and a second return parameter on the second system through the form input boxes correspondingly arranged on the interface so as to be used for butting the target interfaces of the first system and the second system.
4. The method of claim 1, wherein generating the execution code according to the request address, the request protocol, and the correspondence comprises:
performing hash operation on the request address, the request protocol and the corresponding relation respectively to obtain the request address, the request protocol and the summary of the corresponding relation respectively;
and taking a character string formed by sequentially connecting the request address, the request protocol and the abstract of the corresponding relation end to end as an execution code corresponding to the request address, the request protocol and the corresponding relation.
5. The method of claim 1, wherein prior to generating an execution code based on the request address, request protocol, and correspondence, the method further comprises:
inserting the request address, the request protocol and the corresponding relation into a database as records;
the generating of the execution code according to the request address, the request protocol and the corresponding relation includes:
and generating a query statement for the record based on the position of the record in the database, and taking the query statement as an execution code.
6. The method of claim 1, wherein prior to generating an execution code based on the request address, request protocol, and correspondence, the method further comprises:
storing the request address, the request protocol and the corresponding relation into a target file;
the generating of the execution code according to the request address, the request protocol and the corresponding relation includes:
and generating a download link of the target file by using the uniform resource locator pointing to the target file and taking the download link as an execution code.
7. The method of claim 1, wherein generating the execution code according to the request address, the request protocol, and the correspondence comprises:
sending the request address, the request protocol and the corresponding relation to a pre-established configuration center;
and receiving a configuration statement generated by the configuration center according to the request address, the request protocol and the corresponding relation as an execution code.
8. A system interface docking apparatus, the apparatus comprising:
the first acquisition module is configured to acquire a corresponding relation between a first parameter on the first system and a second parameter on the second system corresponding to the target interface, so as to interface the target interfaces of the first system and the second system;
a second obtaining module configured to obtain a request address and a request protocol of the target interface;
the execution code generation module is configured to generate an execution code according to the request address, the request protocol and the corresponding relation;
the execution code sending module is configured to send the execution code to the first system, so that the first system calls the target interface by using the execution code after receiving an access request needing to call the target interface;
an execution code analysis module, when receiving an execution code analysis request from the first system, using the execution code in the execution code analysis request to obtain the request address, the request protocol and the corresponding relation corresponding to the execution code, and sends the request address, request protocol and corresponding relation to a preset request execution engine, so that the request execution engine encapsulates the first parameter of the first system according to the corresponding relation, takes the encapsulated first parameter as the second parameter of the second system, and transmitting the encapsulated second parameter to the second system according to the request address and request protocol to call the target interface by the request execution engine, and receiving target data returned by the second system according to the call to the target interface, and returning the target data to a sender of the access request by the request execution engine.
9. A computer-readable program medium, characterized in that it stores computer program instructions which, when executed by a computer, cause the computer to perform the method according to any one of claims 1 to 7.
10. An electronic device, characterized in that the electronic device comprises:
a processor;
a memory having stored thereon computer readable instructions which, when executed by the processor, implement the method of any of claims 1 to 7.
CN201911265346.3A 2019-12-11 2019-12-11 System interface docking method, device, medium and electronic equipment Pending CN111158661A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911265346.3A CN111158661A (en) 2019-12-11 2019-12-11 System interface docking method, device, medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911265346.3A CN111158661A (en) 2019-12-11 2019-12-11 System interface docking method, device, medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN111158661A true CN111158661A (en) 2020-05-15

Family

ID=70556781

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911265346.3A Pending CN111158661A (en) 2019-12-11 2019-12-11 System interface docking method, device, medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN111158661A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111930534A (en) * 2020-07-29 2020-11-13 北京字节跳动网络技术有限公司 Data calling method and device and electronic equipment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102811230A (en) * 2011-05-30 2012-12-05 深圳市金蝶友商电子商务服务有限公司 Resource call method based on application integration and system thereof
CN105808365A (en) * 2016-03-22 2016-07-27 深圳市宁远科技股份有限公司 HIS (Hospital Information System) interface calling method and HIS interface configuration method
CN108200077A (en) * 2018-01-18 2018-06-22 北京网信云服信息科技有限公司 A kind of method and device of calling interface
CN108234149A (en) * 2016-12-09 2018-06-29 沈阳美行科技有限公司 Network request management method and device
CN108255905A (en) * 2017-05-04 2018-07-06 平安科技(深圳)有限公司 Interface calls data processing method, device and computer equipment
CN109857575A (en) * 2019-01-18 2019-06-07 深圳壹账通智能科技有限公司 Interface call method, device, electronic equipment and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102811230A (en) * 2011-05-30 2012-12-05 深圳市金蝶友商电子商务服务有限公司 Resource call method based on application integration and system thereof
CN105808365A (en) * 2016-03-22 2016-07-27 深圳市宁远科技股份有限公司 HIS (Hospital Information System) interface calling method and HIS interface configuration method
CN108234149A (en) * 2016-12-09 2018-06-29 沈阳美行科技有限公司 Network request management method and device
CN108255905A (en) * 2017-05-04 2018-07-06 平安科技(深圳)有限公司 Interface calls data processing method, device and computer equipment
CN108200077A (en) * 2018-01-18 2018-06-22 北京网信云服信息科技有限公司 A kind of method and device of calling interface
CN109857575A (en) * 2019-01-18 2019-06-07 深圳壹账通智能科技有限公司 Interface call method, device, electronic equipment and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111930534A (en) * 2020-07-29 2020-11-13 北京字节跳动网络技术有限公司 Data calling method and device and electronic equipment

Similar Documents

Publication Publication Date Title
US20060168115A1 (en) Method and system of encapsulating web site transactions for computer-aided generation of web services
CN101697139A (en) Method, device and registry for remote procedure call
CN112187558B (en) Data verification method and device and electronic equipment
CN111221572B (en) Method, device, medium and equipment for automatically adapting to running environment
CN111338623B (en) Method, device, medium and electronic equipment for developing user interface
CN110647316B (en) Method and device for generating universal business object, computer equipment and storage medium
CN111026439B (en) Application program compatibility method, device, equipment and computer storage medium
CN111026634A (en) Interface automation test system, method, device and storage medium
CN103092602A (en) Software development kit and terminal apparatus
CN111694620B (en) Interaction method, device and equipment of third party service and computer storage medium
CN110795181A (en) Application program interface display method and device based on skip protocol and electronic equipment
CN113127108A (en) Service request processing method and device, storage medium and electronic equipment
CN113076153A (en) Interface calling method and device
CN111767229A (en) Performance test method, device and equipment
CN112631590A (en) Component library generation method and device, electronic equipment and computer readable medium
CN108694120B (en) Method and device for testing service component
CN114489622A (en) Js application, electronic device, and storage medium
CN112988588B (en) Client software debugging method and device, storage medium and electronic equipment
CN111752820A (en) Pressure testing method of gPC interface, computer equipment and storage medium
CN110888794A (en) Interface test method and device
CN111158661A (en) System interface docking method, device, medium and electronic equipment
CN101772196A (en) Method and system for processing message sent by mobile terminal and acting server
CN114745313A (en) Terminal remote testing method and device, electronic equipment and readable medium
CN116820663A (en) Mirror image construction method, device, storage medium and apparatus
CN112783903B (en) Method and device for generating update log

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20200515