CN113778704A - Interface calling method and device - Google Patents

Interface calling method and device Download PDF

Info

Publication number
CN113778704A
CN113778704A CN202110344404.2A CN202110344404A CN113778704A CN 113778704 A CN113778704 A CN 113778704A CN 202110344404 A CN202110344404 A CN 202110344404A CN 113778704 A CN113778704 A CN 113778704A
Authority
CN
China
Prior art keywords
interface
calling
service
parameter object
storage container
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
CN202110344404.2A
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.)
Beijing Jingdong Tuoxian Technology Co Ltd
Original Assignee
Beijing Jingdong Tuoxian Technology 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 Beijing Jingdong Tuoxian Technology Co Ltd filed Critical Beijing Jingdong Tuoxian Technology Co Ltd
Priority to CN202110344404.2A priority Critical patent/CN113778704A/en
Publication of CN113778704A publication Critical patent/CN113778704A/en
Pending legal-status Critical Current

Links

Images

Classifications

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

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer And Data Communications (AREA)

Abstract

The application discloses an interface calling method and device. One embodiment of the method comprises: determining whether an interface called by a calling request sent by an interface calling end is annotated by self-definition; for an interface calling end, responding to the fact that the interface is self-defined and annotated, conducting section interception on the interface, and storing a public parameter object in a calling request into a preset storage container, wherein the preset storage container is used for representing the corresponding relation between each service and the public parameter object in a service calling link; and for the interface providing end, in response to the fact that the interface is self-defined and annotated, obtaining the public parameter object in the calling request from a preset storage container, and executing an information processing process in the interface providing end. The application provides an interface calling method, which avoids the problem of longitudinal transparent transmission of a common parameter object in a service calling link.

Description

Interface calling method and device
Technical Field
The embodiment of the application relates to the technical field of computers, in particular to an interface calling method and device.
Background
In the actual development of the micro-service, a scene of vertical transparent transmission of a common parameter object is often involved, and some key parameters need to be constructed into the common parameter object to run through the whole service calling link. Generally, an RPC (Remote Procedure Call) interface Call between cross-services constructs a common parameter object at an interface Call end, for example, information such as a Call end IP (Internet Protocol), a user Pin (Personal Identification Number), a token, a Call service source, and the like; within the service, the common parameter object is passed vertically as a method parameter.
Disclosure of Invention
The embodiment of the application provides an interface calling method and device.
In a first aspect, an embodiment of the present application provides an interface calling method, including: determining whether an interface called by a calling request sent by an interface calling end is annotated by self-definition; for an interface calling end, responding to the fact that the interface is self-defined and annotated, conducting section interception on the interface, and storing a public parameter object in a calling request into a preset storage container, wherein the preset storage container is used for representing the corresponding relation between each service and the public parameter object in a service calling link; and for the interface providing end, in response to the fact that the interface is self-defined and annotated, obtaining the public parameter object in the calling request from a preset storage container, and executing an information processing process in the interface providing end.
In some embodiments, the above method further comprises: verifying an interface calling process between an interface calling end and an interface providing end through a preset verification rule in a method body of a tangent plane; in response to the passing of the authentication, an information processing procedure in the interface providing side is performed.
In some embodiments, the above method further comprises: and in response to the failure of the verification, forbidding the interface calling terminal to call the interface providing terminal.
In some embodiments, the method body of the tangent plane comprises a preset processing method for performing logic processing on the common parameter object in the preset storage container; and the above method further comprises: and according to a preset processing method, carrying out logic processing on the common parameter object related to the service call link to obtain target data.
In some embodiments, the preset storage container stores the corresponding relationship between each service in the service call link and the common parameter object in the form of key value pairs.
In a second aspect, an embodiment of the present application provides an interface invoking device, including: the determining unit is configured to determine whether an interface called by a calling request sent by an interface calling end is annotated by self-definition; the intercepting unit is configured to respond to the self-defined annotation of the interface to the interface calling end, intercept the section of the interface and store the public parameter object in the calling request into a preset storage container, wherein the preset storage container is used for representing the corresponding relation between each service in the service calling link and the public parameter object; and the acquisition unit is configured to respond to the interface providing end and determine that the interface is self-defined and annotated, acquire the common parameter object in the calling request from a preset storage container and execute the information processing process in the interface providing end.
In some embodiments, the above apparatus further comprises: the verification unit is configured to verify an interface calling process between the interface calling end and the interface providing end through a preset verification rule in the tangent method body; in response to the passing of the authentication, an information processing procedure in the interface providing side is performed.
In some embodiments, the authentication unit is further configured to disable the call of the interface call terminal to the interface providing terminal in response to the failure of the authentication.
In some embodiments, the method body of the tangent plane comprises a preset processing method for performing logic processing on the common parameter object in the preset storage container; and the above apparatus further comprises: and the processing unit is configured to perform logic processing on the common parameter object related to the service call link according to a preset processing method to obtain target data.
In some embodiments, the preset storage container stores the corresponding relationship between each service in the service call link and the common parameter object in the form of key value pairs.
In a third aspect, the present application provides a computer readable medium, on which a computer program is stored, wherein the program, when executed by a processor, implements the method as described in any implementation manner of the first aspect.
In a fourth aspect, an embodiment of the present application provides an electronic device, including: one or more processors; a storage device having one or more programs stored thereon, which when executed by one or more processors, cause the one or more processors to implement a method as described in any implementation of the first aspect.
The interface calling method and the device provided by the embodiment of the application determine whether the interface called by the calling request sent by the interface calling end is annotated by self-definition; for an interface calling end, responding to the fact that the interface is self-defined and annotated, conducting section interception on the interface, and storing a public parameter object in a calling request into a preset storage container, wherein the preset storage container is used for representing the corresponding relation between each service in a service calling link and the public parameter object; and for the interface providing end, responding to the self-defined annotation of the interface, acquiring the public parameter object in the calling request from the preset storage container, and executing the information processing process in the interface providing end, so that the interface calling method is provided, and the problem of longitudinal transparent transmission of the public parameter object in the service calling link is solved.
Drawings
Other features, objects and advantages of the present application will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
FIG. 1 is an exemplary system architecture diagram in which one embodiment of the present application may be applied;
FIG. 2 is a flow diagram according to one embodiment of an interface call method of the present application;
FIG. 3 is a diagram illustrating an application scenario of an interface call method according to the present embodiment;
FIG. 4 is a flow diagram of yet another embodiment of an interface call method according to the present application;
FIG. 5 is a block diagram of one embodiment of an interface invocation device according to the present application;
FIG. 6 is a block diagram of a computer system suitable for use in implementing embodiments of the present application.
Detailed Description
The present application will be described in further detail with reference to the following drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
FIG. 1 illustrates an exemplary architecture 100 to which the interface call method and apparatus of the present application may be applied.
As shown in fig. 1, the system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The communication connections between the terminal devices 101, 102, 103 form a topological network, and the network 104 serves to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The terminal devices 101, 102, 103 may be hardware devices or software that support network connectivity for data interaction and data processing. When the terminal devices 101, 102, 103 are hardware, they may be various electronic devices supporting network connection, information acquisition, interaction, display, processing, and the like, including but not limited to smart phones, tablet computers, e-book readers, laptop portable computers, desktop computers, and the like. When the terminal apparatuses 101, 102, 103 are software, they can be installed in the electronic apparatuses listed above. It may be implemented, for example, as multiple pieces of software or software modules to provide distributed services, or as a single piece of software or software module. And is not particularly limited herein.
The server 105 may be a server providing various services, for example, a background processing server that obtains operation requests sent by target persons through the terminal devices 101, 102, and 103 and performs business processing according to the operation requests. In each interface calling process in the business processing process, for the interface with the user-defined annotation, the common parameter object in the calling request of the interface calling end is stored in a preset storage container, so that the interface providing end obtains the common parameter object from the preset storage container. As an example, the server 105 may be a cloud server.
The server may be hardware or software. When the server is hardware, it may be implemented as a distributed server cluster formed by multiple servers, or may be implemented as a single server. When the server is software, it may be implemented as multiple pieces of software or software modules (e.g., software or software modules for providing distributed services) or as a single piece of software or software module. And is not particularly limited herein.
It should be further noted that the interface calling method provided by the embodiment of the present disclosure may be executed by a server, or may be executed by a terminal device, or may be executed by the server and the terminal device in cooperation with each other. Accordingly, each part (for example, each unit) included in the interface calling apparatus may be entirely provided in the server, may be entirely provided in the terminal device, and may be separately provided in the server and the terminal device.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation. When the electronic device on which the interface calling method is executed does not need to perform data transmission with other electronic devices, the system architecture may include only the electronic device (e.g., a server or a terminal device) on which the interface calling method is executed.
With continued reference to FIG. 2, a flow 200 of one embodiment of an interface invocation method is shown, including the steps of:
step 201, determining whether the interface called by the call request sent by the interface calling terminal is annotated by self-definition.
In this embodiment, an execution subject (for example, the server in fig. 1) of the interface calling method may determine whether an interface called by a call request issued by the interface calling terminal is annotated by a custom.
The interface calling end may be any service related to the execution main body in the information processing process. It is understood that, the information processing process performed by the execution subject for the operation request of the target user may involve a plurality of services, and a call relationship exists between the services to form a service call link. The two services with calling relation are transmitted via interface, when one service calls the other service, the service can be used as interface calling end (service calling end), and the other service can be used as interface providing end (service providing end).
When the interface calling terminal initiates calling, a parameter object required by the called interface needs to be constructed, and after the construction is completed, the parameter object is transmitted to the called interface. Wherein the parameter object comprises a common parameter object and a service parameter object. The common parameter object includes information such as a calling terminal IP (Internet Protocol), a user PIN (Personal Identification Number), a token, and a calling service source. The service parameter object represents parameters in a service processing process related in an interface providing end. The required business parameter objects are different if the information processing processes involved in the service are different.
In this embodiment, each service in the service invocation link may be a microservice. The whole architecture of the microservice is realized by a spring framework.
In this embodiment, the interface of each interface provider in the service call link may be self-defined. An annotation is a type of metadata that can be added to Java (computer programming language) code. In this embodiment, the custom annotation represents an identifier for performing determination, and by determining the custom annotation, a subsequent step may be selected to perform corresponding processing.
Step 202, for the interface calling end, responding to the fact that the interface is self-defined and annotated, conducting section interception on the interface, and storing the public parameter object in the calling request into a preset storage container.
In this embodiment, for the interface calling end, the execution main body may perform section interception on the interface in response to determining that the interface is annotated by self-definition, and store the common parameter object in the call request in a preset storage container. The preset storage container is used for representing the corresponding relation between each service in the service calling link and the common parameter object
In this embodiment, the execution body may perform AOP (Aspect organized Programming) section interception on the interface. The execution main body intercepts the interface in a tangent mode, so that the public parameter object in the call request received by the interface is intercepted, and the intercepted public parameter object is not transmitted to the interface providing end through the interface but is stored in a preset storage container.
The preset storage container may be any container having a storage function. As an example, the preset storage container may be thread local. The function of ThreadLocal is to provide local variables in a thread, and the variables play a role in the life cycle of the thread, so that the complexity of transferring some common variables among multiple functions or components in the same thread is reduced. There is a static declared Map in the thread class for storing a variable copy of each thread, the key of the element in the Map is the thread object, and the value corresponds to the variable copy of the thread. The corresponding relation between each service in the service call link and the common parameter object can be accurately stored through the mode of the key value pair.
Step 203, for the interface providing end, in response to determining that the interface is self-defined, obtaining the common parameter object in the call request from the preset storage container, and executing the information processing process in the interface providing end.
In this embodiment, for the interface provider, the execution entity may, in response to determining that the interface is annotated by the user, obtain the common parameter object in the call request from the preset storage container, and execute an information processing procedure in the interface provider.
In this embodiment, for the common parameter object, when the interface of the interface providing end is annotated by self-definition, the common parameter is no longer transmitted in a transparent transmission manner between services having a call relationship, but the common parameter object in the call request is acquired in a preset storage container. Aiming at the service parameter object, the service parameter object is not acquired from a preset storage container, but acquired in a mode of transparent transmission between services.
In the whole information processing process corresponding to the service call link, each service in the service call link can be alternately used as an interface call end and an interface providing end. By way of example, the service invocation link includes service A, service B, and service C. In the process of calling the service B by the service A, the service A is used as an interface calling end, and the service B is used as an interface providing end; and in the process of calling the service C by the service B, the service B is used as an interface calling end, and the service C is used as an interface providing end. For each interface invocation process in the service invocation link, the execution subject may make the interface invocation according to the method shown in the above step 201 and 203.
With continued reference to fig. 3, fig. 3 is a schematic diagram 300 of an application scenario of the interface call method according to the present embodiment. In the application scenario of fig. 3, a target user 301 sends an operation request to a server 303 through a terminal device 302. The operation requested by the operation request includes a service 3031, a service 3032, a service 3033, and a service 3034. The calling relationship among the services is as follows: service 3031- > service 3032- > service 3033- > service 3034. In the service calling process, aiming at each interface calling process, the server 303 determines whether an interface called by a calling request sent by an interface calling end is annotated by self definition; for the interface calling end, the server 303 performs section interception on the interface in response to determining that the interface is annotated by self-definition, and stores the common parameter object in the calling request into a preset storage container. The preset storage container is used for representing the corresponding relation between each service in the service call link and the public parameter object; for the interface provider, the server 303, in response to determining that the interface is self-defined, obtains the common parameter object in the call request from the preset storage container, and executes an information processing procedure in the interface provider. As an example, the server 301 determines whether the interface 30321 called by the call request issued by the interface calling terminal 3031 is annotated by self-definition; for the interface calling terminal 3031, in response to determining that the interface is annotated by the user-defined annotation, the interface is intercepted by a tangent plane, and the common parameter object in the calling request is stored in the preset storage container 305. For the interface provider 3032, in response to determining that the interface 30321 is self-defined, the common parameter object in the call request is acquired from the preset storage container 305, and the information processing procedure in the interface provider 3032 is executed.
According to the method provided by the embodiment of the disclosure, whether the interface called by the calling request sent by the interface calling end is annotated by self-definition is determined; for an interface calling end, responding to the fact that the interface is self-defined and annotated, conducting section interception on the interface, and storing a public parameter object in a calling request into a preset storage container, wherein the preset storage container is used for representing the corresponding relation between each service in a service calling link and the public parameter object; and for the interface providing end, responding to the self-defined annotation of the interface, acquiring the public parameter object in the calling request from the preset storage container, and executing the information processing process in the interface providing end, so that the interface calling method is provided, and the problem of longitudinal transparent transmission of the public parameter object in the service calling link is solved.
It can be understood that, when there is a problem of vertical transparent transmission of the common parameter object in the service invocation link, the common parameter object and the service parameter object are transmitted step by step in each service in the service invocation link in a method form, and all the invoked methods use the form to transmit the common parameter object and the service parameter object to the next invocation level (i.e. the next service). This results in the public and business form being annotated and passed through together. According to the design mode of the service, the service method body in the service only needs to realize the service function, and the logic processing function of the common parameter object is not doped. When the longitudinal transparent transmission problem of the public parameter object exists in the service calling link, the logic processing process of the public parameter object exists in the service method body in the service, so that the responsibility division of the service parameter object and the public parameter object is not clear, and cross contamination is easily caused; moreover, code redundancy in the business method body inside the service is caused, and the business code of the method body is cumbersome and low in reproducibility. Due to the above problems, further, when a system including a service call link is reconfigured, there is a problem that the reconfiguration cost of the system is high. The method and the device solve the problems of unclear division of responsibilities of the service parameter object and the public parameter object, complex service codes, high reconstruction cost and the like because the problem of longitudinal transparent transmission of the public parameter object in the service calling link is avoided.
In some optional implementation manners of this embodiment, the execution main body may verify an interface calling process between the interface calling end and the interface providing end through a preset verification rule in the tangent method body; in response to the passing of the authentication, an information processing procedure in the interface providing side is performed.
The preset check rule can be specifically set according to the actual situation. As an example, the preset check rule may be a check on user identity information and login state information of the user. And responding to the verification, the execution main body can acquire the common parameter object from the preset storage container and execute the information processing process in the interface providing end.
In some optional implementations of this embodiment, the execution subject prohibits the interface calling side from calling the interface providing side in response to the failure of the authentication.
In this implementation manner, when the interface calling process between the interface calling end and the interface providing end is not verified, the interface calling process between the interface calling end and the interface providing end is not performed any more.
In some optional implementations of this embodiment, the method body of the tangent plane includes a preset processing method for performing logic processing on the common parameter object in the preset storage container. The preset processing method may be any method set as required. For example, the preset processing method may be a method of characterizing the canonical log printing information, statistically analyzing the processing time of each service, and determining the performance of interface call according to a UUID (universal Unique Identifier).
The execution main body can perform logic processing on the common parameter object related to the service call link according to a preset processing method to obtain target data. As an example, when the preset processing method represents the standard log printing information, the obtained target data is a log obtained according to the set standard information; when the preset processing method represents the performance judgment of interface calling according to the UUID, the obtained target data is the performance information of the interface calling.
With continuing reference to FIG. 4, an exemplary flow 400 of one embodiment of an interface invocation method according to the present application is shown, including the steps of:
step 401, determining whether the interface called by the call request sent by the interface call end is annotated by self-definition.
And 402, responding to the interface calling end and determining that the interface is self-defined and annotated, performing section interception on the interface, and storing the public parameter object in the calling request into a preset storage container.
The preset storage container is used for representing the corresponding relation between each service and the common parameter object in the service call link
And 403, verifying the interface calling process between the interface calling end and the interface providing end through a preset verification rule in the method body of the section.
In this embodiment, in response to passing the verification, the following step 404 is performed; in response to failing to verify, the next step 406 is performed.
And step 404, responding to the verification, responding to the interface providing end and determining that the interface is self-defined and annotated, acquiring the public parameter object in the calling request from a preset storage container, and executing an information processing process in the interface providing end.
And 405, performing logic processing on the common parameter object related to the service call link according to a preset processing method to obtain target data.
And step 406, in response to the failure of the verification, prohibiting the calling of the interface calling terminal to the interface providing terminal.
As can be seen from this embodiment, compared with the embodiment corresponding to fig. 2, the flow 400 of the interface calling method in this embodiment specifically illustrates a verification process of an interface calling process between an interface calling end and an interface providing end, and a logic processing process of a common parameter object related to a service calling link, so as to improve the security of the interface calling process; moreover, the preset storage container stores the public parameter object in the whole service calling process of the service calling link, so that the public parameter object in the preset storage container can be conveniently processed, and the convenience for processing the public parameter object is improved.
With continuing reference to fig. 5, as an implementation of the method shown in the above-mentioned figures, the present disclosure provides an embodiment of an interface invoking device, where the embodiment of the device corresponds to the embodiment of the method shown in fig. 2, and the device may be applied to various electronic devices.
As shown in fig. 5, the interface calling means includes: the method comprises the following steps: a determining unit 501, configured to determine whether an interface called by a call request sent by an interface calling end is annotated by a user-defined method; the intercepting unit 502 is configured to intercept a section of the interface in response to determining that the interface is self-defined and annotated, and store a common parameter object in a calling request into a preset storage container, wherein the preset storage container is used for representing a corresponding relation between each service in a service calling link and the common parameter object; the obtaining unit 503 is configured to, for the interface provider, in response to determining that the interface is self-defined and annotated, obtain the common parameter object in the call request from the preset storage container, and execute an information processing procedure in the interface provider.
In some embodiments, the above apparatus further comprises: a verification unit (not shown in the figure) configured to verify an interface calling process between the interface calling terminal and the interface providing terminal by a preset verification rule in a method body of the section; in response to the passing of the authentication, an information processing procedure in the interface providing side is performed.
In some embodiments, the verification unit (not shown in the figures) is further configured to disable the call of the interface calling terminal to the interface providing terminal in response to the failure of the verification.
In some embodiments, the method body of the tangent plane comprises a preset processing method for performing logic processing on the common parameter object in the preset storage container; and the above apparatus further comprises: and the processing unit (not shown in the figure) is configured to perform logic processing on the common parameter object related to the service calling link according to a preset processing method to obtain target data.
In some embodiments, the preset storage container stores the corresponding relationship between each service in the service call link and the common parameter object in the form of key value pairs.
In this embodiment, a determining unit in the interface calling device determines whether an interface called by a calling request sent by an interface calling end is annotated by a user-defined method; the intercepting unit responds to the interface calling end and determines that the interface is self-defined and annotated, cuts the interface to intercept, and stores the public parameter object in the calling request into a preset storage container, wherein the preset storage container is used for representing the corresponding relation between each service in the service calling link and the public parameter object; the obtaining unit responds to the determined interface self-defined annotation for the interface providing end, obtains the public parameter object in the calling request from the preset storage container, and executes the information processing process in the interface providing end, so that the interface calling device is provided, and the problem of longitudinal transparent transmission of the public parameter object in the service calling link is solved.
Reference is now made to FIG. 6, which illustrates a structural schematic diagram of a computer system 600 suitable for use in implementing the devices of the present application (e.g., devices 101, 102, 103, 105 shown in FIG. 1). The apparatus shown in fig. 6 is only an example, and should not bring any limitation to the function and use range of the embodiments of the present application.
As shown in fig. 6, the computer system 600 includes a processor (e.g., CPU, central processing unit) 601 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage section 608 into a Random Access Memory (RAM) 603. In the RAM603, various programs and data necessary for the operation of the system 600 are also stored. The processor 601, the ROM602, and the RAM603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
The following components are connected to the I/O interface 605: an input portion 606 including a keyboard, a mouse, and the like; an output portion 607 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 608 including a hard disk and the like; and a communication section 609 including a network interface card such as a LAN card, a modem, or the like. The communication section 609 performs communication processing via a network such as the internet. The driver 610 is also connected to the I/O interface 605 as needed. A removable medium 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 610 as necessary, so that a computer program read out therefrom is mounted in the storage section 608 as necessary.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program containing program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 609, and/or installed from the removable medium 611. The computer program, when executed by the processor 601, performs the above-described functions defined in the method of the present application.
It should be noted that the computer readable medium of the present application can be a computer readable signal medium or a computer readable storage medium or any combination of the two. The computer readable storage medium can 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 of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, 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. In the present application, a computer 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. In this application, however, a computer readable signal medium may include a propagated data signal with computer 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 computer readable signal medium may also be any computer readable medium that is not a computer 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 computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present application may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, 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 client computer, partly on the client computer, as a stand-alone software package, partly on the client computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the client computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present application may be implemented by software or hardware. The described units may also be provided in a processor, and may be described as: a processor includes a determination unit, an interception unit, and an acquisition unit. For example, the intercepting unit may also be described as a unit that performs section interception on the interface in response to determining that the interface is annotated by the custom, and stores the common parameter object in the call request into a preset storage container.
As another aspect, the present application also provides a computer-readable medium, which may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by the apparatus, cause the computer device to: determining whether an interface called by a calling request sent by an interface calling end is annotated by self-definition; for an interface calling end, responding to the fact that the interface is self-defined and annotated, cutting the interface, and storing a public parameter object in a calling request into a preset storage container, wherein the preset storage container is used for representing the corresponding relation between each service and the public parameter object in a service calling link; and for the interface providing end, in response to the fact that the interface is confirmed to be self-defined annotated, obtaining the public parameter object in the calling request from a preset storage container, and executing an information processing process in the interface providing end.
The above description is only a preferred embodiment of the application and is illustrative of the principles of the technology employed. It will be appreciated by a person skilled in the art that the scope of the invention as referred to in the present application is not limited to the embodiments with a specific combination of the above-mentioned features, but also covers other embodiments with any combination of the above-mentioned features or their equivalents without departing from the inventive concept as defined above. For example, the above features may be replaced with (but not limited to) features having similar functions disclosed in the present application.

Claims (12)

1. An interface calling method, comprising:
determining whether an interface called by a calling request sent by an interface calling end is annotated by self-definition;
for the interface calling end, responding to the fact that the interface is self-defined and annotated, conducting section interception on the interface, and storing a public parameter object in the calling request into a preset storage container, wherein the preset storage container is used for representing the corresponding relation between each service and the public parameter object in a service calling link;
and for the interface providing end, in response to the fact that the interface is determined to be self-defined annotated, obtaining the public parameter object in the calling request from the preset storage container, and executing an information processing process in the interface providing end.
2. The method of claim 1, further comprising:
verifying the interface calling process between the interface calling end and the interface providing end through a preset verification rule in a method body of a tangent plane;
and executing an information processing procedure in the interface providing terminal in response to passing the verification.
3. The method of claim 2, further comprising:
and in response to failing to pass the verification, prohibiting the calling of the interface calling terminal to the interface providing terminal.
4. The method of claim 1, wherein the method body of the section comprises a preset processing method for performing logic processing on the common parameter object in the preset storage container; and
further comprising: and according to the preset processing method, carrying out logic processing on the public parameter object related to the service call link to obtain target data.
5. The method according to claim 1, wherein the preset storage container stores the corresponding relationship between each service in the service invocation link and the common parameter object in the form of key value pairs.
6. An interface invocation apparatus, comprising:
the determining unit is configured to determine whether an interface called by a calling request sent by an interface calling end is annotated by self-definition;
the intercepting unit is configured to respond to the interface calling end and determine that the interface is self-defined and annotated, conduct section interception on the interface, and store a public parameter object in the calling request into a preset storage container, wherein the preset storage container is used for representing the corresponding relation between each service and the public parameter object in a service calling link;
and the obtaining unit is configured to respond to the interface providing end and determine that the interface is self-defined and annotated, obtain the common parameter object in the calling request from the preset storage container, and execute the information processing process in the interface providing end.
7. The apparatus of claim 6, further comprising:
the verification unit is configured to verify an interface calling process between the interface calling end and the interface providing end through a preset verification rule in a method body of a tangent plane; and executing an information processing procedure in the interface providing terminal in response to passing the verification.
8. The apparatus of claim 7, wherein the authentication unit is further configured to disable the call of the interface call terminal to the interface providing terminal in response to failing the authentication.
9. The device of claim 6, wherein the method body of the section comprises a preset processing method for performing logic processing on the common parameter object in the preset storage container; and
further comprising: and the processing unit is configured to perform logic processing on the common parameter object related to the service call link according to the preset processing method to obtain target data.
10. The apparatus according to claim 6, wherein the preset storage container stores the correspondence between each service in the service invocation link and the common parameter object in the form of key value pairs.
11. A computer-readable medium, on which a computer program is stored, wherein the program, when executed by a processor, implements the method of any one of claims 1-5.
12. An electronic device, comprising:
one or more processors;
a storage device having one or more programs stored thereon,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-5.
CN202110344404.2A 2021-03-29 2021-03-29 Interface calling method and device Pending CN113778704A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110344404.2A CN113778704A (en) 2021-03-29 2021-03-29 Interface calling method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110344404.2A CN113778704A (en) 2021-03-29 2021-03-29 Interface calling method and device

Publications (1)

Publication Number Publication Date
CN113778704A true CN113778704A (en) 2021-12-10

Family

ID=78835591

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110344404.2A Pending CN113778704A (en) 2021-03-29 2021-03-29 Interface calling method and device

Country Status (1)

Country Link
CN (1) CN113778704A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114268646A (en) * 2021-12-13 2022-04-01 深圳供电局有限公司 Method and system for communication through unified communication slot

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114268646A (en) * 2021-12-13 2022-04-01 深圳供电局有限公司 Method and system for communication through unified communication slot
CN114268646B (en) * 2021-12-13 2024-03-01 深圳供电局有限公司 Method and system for communication through unified communication slot

Similar Documents

Publication Publication Date Title
CA2928729C (en) Automated sdk ingestion
JP5961638B2 (en) System and method for application certification
CN111045756B (en) Method, apparatus, computing device and medium for generating interface service
EP3610623B1 (en) Protocol-level identity mapping
US10116642B2 (en) Identity management over multiple identity providers
US11381564B2 (en) Resource security integration platform
US20220261894A1 (en) Method and apparatus for issuing smart contract
CN110764979A (en) Log identification method, system, electronic device and computer readable medium
CN111556080A (en) Network node monitoring method, device, medium and electronic equipment
CN113132400B (en) Business processing method, device, computer system and storage medium
CN113778704A (en) Interface calling method and device
WO2022081334A1 (en) Systems and methods for autonomous program detection
US9405933B2 (en) Secure access to running client application features from a browser application
CN115374207A (en) Service processing method and device, electronic equipment and computer readable storage medium
CN113709136B (en) Access request verification method and device
US20220038447A1 (en) Systems and methods for autonomous program detection and management
CN113190812A (en) Login method, system, electronic equipment and storage medium
CN113592645A (en) Data verification method and device
CN113542238A (en) Risk judgment method and system based on zero trust
CN112261072A (en) Service calling method, device, equipment and storage medium
CN111371745B (en) Method and apparatus for determining SSRF vulnerability
US11909720B2 (en) Secure remote support of systems deployed in a private network
CN115859355B (en) Log desensitization method, device, electronic equipment and computer readable medium
US20230088655A1 (en) Automatic non-code test suite generation from api specification
CN116700716A (en) Data processing method and system for webpage development

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