CN114629945A - Micro-service architecture based interface calling method and device and computer equipment - Google Patents

Micro-service architecture based interface calling method and device and computer equipment Download PDF

Info

Publication number
CN114629945A
CN114629945A CN202210288992.7A CN202210288992A CN114629945A CN 114629945 A CN114629945 A CN 114629945A CN 202210288992 A CN202210288992 A CN 202210288992A CN 114629945 A CN114629945 A CN 114629945A
Authority
CN
China
Prior art keywords
calling
interface
information
interface calling
configurator
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
CN202210288992.7A
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.)
OneConnect Financial Technology Co Ltd Shanghai
Original Assignee
OneConnect Financial Technology Co Ltd Shanghai
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 OneConnect Financial Technology Co Ltd Shanghai filed Critical OneConnect Financial Technology Co Ltd Shanghai
Priority to CN202210288992.7A priority Critical patent/CN114629945A/en
Publication of CN114629945A publication Critical patent/CN114629945A/en
Pending legal-status Critical Current

Links

Images

Abstract

The embodiment of the application belongs to the field of research and development management, and relates to an interface calling method and device based on a micro-service architecture, computer equipment and a storage medium, wherein the method comprises the following steps: when an interface calling request sent by a calling node is received, sending the interface calling request to a docking configurator; analyzing the interface calling request through the docking configurator to obtain interface calling information, wherein the interface calling information comprises a service identifier; sending the interface calling information to a service node corresponding to the service identifier, and receiving calling feedback information returned by the service node according to the interface calling information; packing the call feedback information according to the configuration information in the butt joint configurator to obtain a call feedback data packet; and sending the call feedback data packet to a call node. In addition, the present application also relates to block chain techniques, where configurations may be stored in a block chain. The method and the device improve the interface calling efficiency in the micro-service architecture.

Description

Micro-service architecture based interface calling method and device and computer equipment
Technical Field
The present application relates to the field of research and development management technologies, and in particular, to a method and an apparatus for invoking an interface based on a micro service architecture, a computer device, and a storage medium.
Background
With the development of computer technology, the micro-service architecture becomes the primary choice of a plurality of items, the micro-service architecture can realize the advantages of high concurrency, easy expansion and the like, and the service modules can be refined, decoupled and split. In micro-service architectures, interfacing between different nodes has also become common.
In the conventional docking technology, a docking service party provides an interface document, and a calling party develops an interface according to the interface document. The micro-service architecture may involve many nodes, interface calling situations between different nodes may be different, and a large amount of time is spent on communication and interface development before interface calling, so that interface calling efficiency in the micro-service architecture is low.
Disclosure of Invention
An object of the embodiments of the present application is to provide an interface calling method and apparatus based on a micro service architecture, a computer device, and a storage medium, so as to solve the problem of low interface calling efficiency in the micro service architecture.
In order to solve the above technical problem, an embodiment of the present application provides an interface calling method based on a micro service architecture, which adopts the following technical solutions:
when an interface calling request sent by a calling node is received, sending the interface calling request to a docking configurator;
analyzing the interface calling request through the docking configurator to obtain interface calling information, wherein the interface calling information comprises a service identifier;
sending the interface calling information to a service node corresponding to the service identifier, and receiving calling feedback information returned by the service node according to the interface calling information;
packing the calling feedback information according to the configuration information in the docking configurator to obtain a calling feedback data packet;
and sending the calling feedback data packet to the calling node.
In order to solve the above technical problem, an embodiment of the present application further provides an interface calling device based on a micro service architecture, which adopts the following technical solutions:
the system comprises a request receiving module, a docking configurator and a data processing module, wherein the request receiving module is used for sending an interface calling request to the docking configurator when receiving the interface calling request sent by a calling node;
the request analysis module is used for analyzing the interface calling request through the butt joint configurator to obtain interface calling information, and the interface calling information comprises a service identifier;
the information sending module is used for sending the interface calling information to the service node corresponding to the service identifier and receiving calling feedback information returned by the service node according to the interface calling information;
the information packaging module is used for packaging the calling feedback information according to the configuration information in the butt joint configurator to obtain a calling feedback data packet;
and the feedback sending module is used for sending the calling feedback data packet to the calling node.
In order to solve the above technical problem, an embodiment of the present application further provides a computer device, which adopts the following technical solutions:
when an interface calling request sent by a calling node is received, sending the interface calling request to a docking configurator;
analyzing the interface calling request through the docking configurator to obtain interface calling information, wherein the interface calling information comprises a service identifier;
sending the interface calling information to a service node corresponding to the service identifier, and receiving calling feedback information returned by the service node according to the interface calling information;
packing the calling feedback information according to the configuration information in the docking configurator to obtain a calling feedback data packet;
and sending the calling feedback data packet to the calling node.
In order to solve the above technical problem, an embodiment of the present application further provides a computer-readable storage medium, which adopts the following technical solutions:
when an interface calling request sent by a calling node is received, sending the interface calling request to a docking configurator;
analyzing the interface calling request through the docking configurator to obtain interface calling information, wherein the interface calling information comprises a service identifier;
sending the interface calling information to a service node corresponding to the service identifier, and receiving calling feedback information returned by the service node according to the interface calling information;
packing the call feedback information according to the configuration information in the butt joint configurator to obtain a call feedback data packet;
and sending the calling feedback data packet to the calling node.
Compared with the prior art, the embodiment of the application mainly has the following beneficial effects: when receiving an interface calling request sent by a calling node, sending the interface calling request to a docking configurator, wherein the docking configurator is coupled with each node in the micro-service architecture and manages the interface calling; the docking configurator can analyze the interface calling request according to preset configuration information to obtain interface calling information, wherein the interface calling information comprises a service identifier of a service node to be accessed by the calling node; sending the interface calling information to a service node corresponding to the service identifier, responding the interface calling information by the service node, and returning calling feedback information; packaging the calling feedback information according to the configuration information to obtain a calling feedback data packet, and sending the calling feedback data packet to a calling node to complete interface calling; according to the method and the system, the interface calling in the micro-service framework is uniformly controlled and managed through the butt joint configurator, so that the interface calling and the service processing are respectively and independently realized, developers do not need to pay attention to the realization of the interface calling frequently, and the interface calling efficiency in the micro-service framework is improved.
Drawings
In order to more clearly illustrate the solution of the present application, the drawings used in the description of the embodiments of the present application will be briefly described below, and it is obvious that the drawings in the description below are some embodiments of the present application, and that other drawings may be obtained by those skilled in the art without inventive effort.
FIG. 1 is an exemplary system architecture diagram to which the present application may be applied;
FIG. 2 is a flow diagram of one embodiment of a microservice architecture-based interface invocation method according to the present application;
FIG. 3 is a block diagram illustrating an embodiment of a microservice architecture-based interface invocation mechanism according to the present application;
FIG. 4 is a schematic block diagram of one embodiment of a computer device according to the present application.
Detailed Description
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs; the terminology used in the description of the application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application; the terms "including" and "having," and any variations thereof, in the description and claims of this application and the description of the above figures are intended to cover non-exclusive inclusions. The terms "first," "second," and the like in the description and claims of this application or in the above-described drawings are used for distinguishing between different objects and not for describing a particular order.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings.
As shown in fig. 1, the system architecture 100 may include terminal devices 101, 102, calling nodes 103, 104, a network 105 and serving nodes 106, 107. The network 105 serves to provide a medium of communication links between the terminal devices 101, 102, the invoking nodes 103, 104 and the serving nodes 106, 107. Network 105 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may use the terminal device 101, 102 to interact with the invoking node 103, 104 via the network 105 to receive or send messages or the like. The terminal devices 101 and 102 may have various communication client applications installed thereon, such as a web browser application, a shopping application, a search application, an instant messaging tool, a mailbox client, social platform software, and the like.
The terminal devices 101 and 102 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, e-book readers, MP3 players (Moving Picture experts Group Audio Layer III, mpeg compression standard Audio Layer 3), MP4 players (Moving Picture experts Group Audio Layer IV, mpeg compression standard Audio Layer 4), laptop portable computers, desktop computers, and the like.
The service nodes 106, 107 may be servers providing various interface services.
It should be noted that, the interface calling method based on the micro service architecture provided in the embodiments of the present application is generally executed by a server, and accordingly, the interface calling apparatus based on the micro service architecture is generally disposed in the server.
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.
With continued reference to FIG. 2, a flowchart of one embodiment of a microservice architecture-based interface invocation method in accordance with the present application is shown. The interface calling method based on the microservice architecture comprises the following steps:
step S201, when receiving an interface call request sent by a call node, sending the interface call request to a docking configurator.
In this embodiment, an electronic device (for example, a server shown in fig. 1) on which the interface calling method based on the micro service architecture operates may communicate with the terminal through a wired connection manner or a wireless connection manner. It should be noted that the wireless connection means may include, but is not limited to, a 3G/4G/5G connection, a WiFi connection, a bluetooth connection, a WiMAX connection, a Zigbee connection, a uwb (ultra wideband) connection, and other wireless connection means now known or developed in the future.
Wherein the calling node may be the node that initiates the interface call. The calling node may be a node inside the micro service architecture, or may be a node outside the micro service architecture and obtaining a service through the micro service architecture.
The docking configurator is a pre-programmed program, performs unified control and management on interface calls in the micro service architecture, and is coupled to each node related to the micro service architecture, including nodes inside the micro service architecture and nodes outside the micro service architecture.
In one embodiment, the docking configurator may be implemented by java language, and may be integrated in the spring boot project. The docking configurator comprises two parts: an external interface manager and a calling device. The external Interface manager is used as a service node, is a software architecture style for Representational State transfer (Representational State transfer) and is a design and development mode aiming at network application, can reduce development complexity and improve system scalability) architecture constraint basis, controls a controller layer (controller layer) to perform specific service module process, calls an Interface of a service layer to control a service process in the layer, and the service layer is mainly responsible for logic application design of a service module) Interface process to be packaged, and realizes unified implementation of an Interface (Request Unit Interface ), an Interface calling strategy, encryption and decryption, power realization, an authentication mark, a message format, Interface calling process information, Interface performance information and the like, thereby realizing the unified implementation of outter API annotation (the service node calls the Interface through the @ API annotation Interface to explain, and the like, The description indicates the interface call, for example, which functions can be implemented through the @ outer api annotation display interface, which nodes can access which interfaces, how to perform encapsulation, encryption, decryption, and the like when the interfaces are called, and adds a service name (ServiceName), a call method parameter, a request number (requestId), an encryption manner (authType), and other parameters to implement calling the corresponding service node, uniformly returning a message format, and implementing operations such as power.
The calling device is used as a calling node, the calling party can directly transmit the service identification and the interface name to be called through a uniform calling tool inlet in the butt joint configurator in the service, the message is assembled and encrypted according to the certificate information provided by the service party, and the returned message is decrypted.
Specifically, in the calling party, the service layer initiates an interface call, and sends an initial interface call request to the docking configurator in the calling node. And the caller in the docking configurator assembles the request parameters in the initial interface request, encrypts the request parameters to obtain an outgoing interface calling request, and sends the interface calling request to the docking configurator of the service party by the docking configurator.
When the butt joint configurator assembles and encrypts the request parameters, the assembly mode and the encryption key corresponding to the service identifier are inquired in the configuration file of the butt joint configurator according to the service identifier in the initial interface request, the request parameters are assembled according to the assembly mode, and then the assembled request parameters are encrypted by using the encryption key.
The service identifier may be an identifier of an interface service to be called, or the service identifier may also be an interface identifier.
The configuration information exists in the docking configurator, and the docking configurator controls and manages the interface access according to the configuration information.
It is emphasized that, to further ensure the privacy and security of the configuration information, the configuration information may also be stored in a node of a blockchain.
The block chain referred by the application is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
Step S202, the interface calling request is analyzed through the docking configurator to obtain interface calling information, and the interface calling information comprises a service identifier.
Specifically, after receiving the interface call request, the interface call request is checked according to the docking configurator to determine whether the call node has a related call authority. And then, analyzing the interface calling request according to the decryption key recorded in the docking configurator to obtain interface calling information. The interface calling information records the detailed information of the calling node for interface calling, wherein the detailed information comprises the service identifier.
Step S203, the interface calling information is sent to the service node corresponding to the service identifier, and calling feedback information returned by the service node according to the interface calling information is received.
Specifically, a service node corresponding to the service identifier is queried in the docking configurator, and different service nodes provide different services. And sending the interface calling information to a service node bound with the service identifier, so as to obtain the service through the service node, realize interface calling, and receive calling feedback information returned by the service node according to the interface calling feedback information.
And step S204, packing the call feedback information according to the configuration information in the docking configurator to obtain a call feedback data packet.
Specifically, the calling node and the service node communicate in a data packet mode, and package processing is performed on the calling feedback information after the calling feedback information is received; during packaging, a preset encryption algorithm can be selected to encrypt the call feedback information according to the configuration information in the butt joint configurator so as to ensure data security.
And step S205, sending the call feedback data packet to the call node.
Specifically, the call feedback data packet is sent to the call node, and the call node decrypts the call feedback data packet to obtain call feedback information, so that interface call is completed.
In this embodiment, when an interface call request sent by a call node is received, the interface call request is sent to a docking configurator, and the docking configurator is coupled to each node in the micro-service architecture to manage interface calls; the docking configurator can analyze the interface calling request according to preset configuration information to obtain interface calling information, wherein the interface calling information comprises a service identifier of a service node to be accessed by the calling node; sending the interface calling information to a service node corresponding to the service identifier, responding the interface calling information by the service node, and returning calling feedback information; packaging the calling feedback information according to the configuration information to obtain a calling feedback data packet, and sending the calling feedback data packet to a calling node to complete interface calling; according to the method and the system, the interface calling in the micro-service framework is uniformly controlled and managed through the butt joint configurator, so that the interface calling and the service processing are respectively and independently realized, developers do not need to pay attention to the realization of the interface calling frequently, and the interface calling efficiency in the micro-service framework is improved.
Further, before the step S201, the method may further include: acquiring configurator setting information from a dynamic configuration management server; and setting the docking configurator according to the configurator setting information.
Specifically, the docking configurator is configured and managed by a dynamic configuration management server in which configurator setting information of the docking configurator is stored. The developer can upload the configurator setting information to the dynamic configuration management server, and then each node in the micro service architecture acquires the configurator setting information from the dynamic configuration management server and sets the docking configurator according to the configurator setting information.
The dynamic configuration management server can be built based on Apollo (Appolo), Apollo is a configuration management center, can be used for centrally managing the configurations of different application environments and different clusters, and can take effect in real time after configuration modification without system offline restart. And constructing a dynamic configuration management server based on Apollo, and modifying the butt joint configurator in each node in real time.
In this embodiment, the dynamic configuration management server configures the docking configurator in each node, so that the docking configurator can be modified and configured in time, and the flexibility of interface access is improved.
Further, after the step S201, the method may further include: acquiring a calling certificate in a docking configurator; and when the calling node is determined to be the calling node according to the calling certificate, analyzing the interface calling request through the docking configurator to obtain interface calling information.
Specifically, a calling node identifier may be extracted from the interface calling request, where the calling node identifier may uniquely identify one calling node, and the calling node identifier may be a number of the calling node or an IP Address (Internet Protocol Address, which refers to an Internet Protocol Address) of the calling node.
The calling certificate is preconfigured certificate information, and can record which calling nodes can call the interfaces in the service node, that is, can determine whether the calling nodes have access rights to some interfaces. The calling certificate may also include an encryption key, a decryption key, etc., which are generated by the service node and sent to the calling node. The calling certificate is stored in a designated directory of the node, and the docking configurator can directly read the calling certificate from the designated directory, so as to control the interface calling.
And determining whether the calling node corresponding to the calling node identifier has a calling authority or not according to the calling certificate, wherein when the calling node has the calling authority, the calling node is the calling node, and the interface calling request can be analyzed through the docking configurator to obtain interface calling information.
In this embodiment, whether the calling node has the calling authority is determined according to the certificate, and when the calling node is the calling node, the interface calling information is processed, so that the security of interface access is ensured.
Further, the step S202 may include: reading a calling node identifier in an interface calling request; inquiring an encryption mode corresponding to the calling node identification in the configuration information of the docking configurator; acquiring a decryption key corresponding to the encryption mode; and decrypting the interface calling request according to the decryption key to obtain interface calling information, wherein the interface calling information comprises a service identifier.
In particular, encrypted communication can be performed between nodes in the micro service architecture to improve security. Reading a calling node identifier from an interface calling request through a docking configurator, then inquiring an encryption mode corresponding to the node identifier in configuration information of the docking configurator, then acquiring a decryption key corresponding to the encryption mode, and decrypting the interface calling request according to the decryption key to obtain interface calling information. The interface calling information includes the service identification to be called.
The docking configurator may have various Encryption modes built in, including AES (Advanced Encryption Standard), RSA (i.e., RSA algorithm), SM1-SM4 (cryptographic algorithms including SM1, SM2, SM3, SM4), and the like.
In this embodiment, the calling node identifier is extracted, and in the docking configurator, the decryption key is obtained through the calling node identifier for decryption, so that the interface calling information can be accurately obtained.
Further, the step S203 may include: inquiring an interface calling strategy corresponding to the service identifier through the docking configurator; according to the service identifier and the interface calling strategy, sending interface calling information to a service node corresponding to the service identifier to initiate interface calling; and receiving call feedback information returned by the service node.
Specifically, an interface calling policy corresponding to the service identifier is queried from configuration information of the docking configurator, and the interface calling policy is a calling method required for calling the interface. And sending the interface calling information to the service node corresponding to the service identifier according to the interface calling strategy, thereby initiating interface calling to the service node corresponding to the service identifier. The service node responds to the interface call and returns call feedback information, which may be service information, related to the specific service.
In the embodiment, interface calling is initiated according to the interface calling strategy in the docking configurator, so that smooth implementation of the interface calling is ensured.
Further, after step S205, the method may further include: acquiring interface calling record information generated by a docking configurator, wherein the interface calling record information comprises calling process information and interface performance information; and storing the interface calling record information into a preset database.
Specifically, the interface calling condition may be monitored by the docking configurator to obtain interface calling record information, where the interface calling record information includes interface calling process information and interface performance information. The interface calling process information is equivalent to a log, and the whole interface calling process is recorded; the interface performance information is used for recording the performance of the interface, including the time required by the interface call, and may also include the number of times the interface is called within a preset time. The interface calling record information can be stored in a preset database, so that the record of interface calling is completed, and subsequent data analysis and troubleshooting are realized.
In this embodiment, the interface call record information generated by the docking configurator is stored in the preset database, so that data backup is realized, and a data basis is provided for subsequent interface detection.
Further, after the step of storing the interface call record information in the preset database, the method may further include: acquiring interface performance information in the interface calling record information; performing interface performance detection according to the interface performance information to obtain an interface performance detection result; when the abnormal interface is determined to exist according to the interface performance detection result, generating early warning information according to the interface performance detection result; and sending the early warning information to a terminal logged in by a preset account.
Specifically, the interface performance information may be extracted from the interface call record information, and the interface performance detection may be performed through the interface performance information, where the interface performance detection may be performed by comparing a relevant index in the interface performance information with a preset index value to obtain an interface performance detection result.
And when the abnormal interface is determined to exist according to the interface performance detection result, generating early warning information, wherein the abnormal interface can be an index value which some indexes in the interface performance information do not accord with the preset indexes. And then sending the early warning information to a terminal logged in by a preset account. The preset account may be an account of a developer, so that the developer can detect and repair an interface with an abnormality. For example, when the time required for calling the interface in the interface performance information is greater than a preset time threshold, the interface may be determined as an abnormal interface.
In one embodiment, the calling node may also record interface call record information. When the calling node determines that an abnormal interface exists according to the interface performance information in the interface calling record information, the calling node can access another address of the interface, so that the interface calling is realized. In the present application, there may be multiple IP addresses per interface, which are all stored in the configuration information of the docking configurator.
In one embodiment, when the calling node determines that the interface call fails, the interface call request may be re-initiated, and the number of re-initiated requests may have a number threshold, a number threshold of re-requests, and a re-request manner, and may also be stored in the configuration information of the docking configurator.
In this embodiment, the performance of the interface is detected according to the interface performance information, so that an abnormal interface is found in time, and smooth implementation of interface access is ensured.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and can include the processes of the embodiments of the methods described above when the computer program is executed. The storage medium may be a non-volatile storage medium such as a magnetic disk, an optical disk, a Read-Only Memory (ROM), or a Random Access Memory (RAM).
It should be understood that, although the steps in the flowcharts of the figures are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and may be performed in other orders unless explicitly stated herein. Moreover, at least a portion of the steps in the flow chart of the figure may include multiple sub-steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed alternately or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
With further reference to fig. 3, as an implementation of the method shown in fig. 2, the present application provides an embodiment of an interface invoking device based on a micro service architecture, 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 in particular.
As shown in fig. 3, the interface invoking device 300 based on microservice architecture according to the embodiment includes: a request receiving module 301, a request parsing module 302, an information sending module 303, an information packing module 304, and a feedback sending module 305, wherein:
the request receiving module 301 is configured to, when receiving an interface call request sent by a call node, send the interface call request to the docking configurator.
The request parsing module 302 is configured to parse the interface call request through the docking configurator to obtain interface call information, where the interface call information includes a service identifier.
The information sending module 303 is configured to send the interface calling information to the service node corresponding to the service identifier, and receive calling feedback information returned by the service node according to the interface calling information.
And an information packing module 304, configured to pack the call feedback information according to the configuration information in the docking configurator, so as to obtain a call feedback data packet.
And a feedback sending module 305, configured to send the call feedback data packet to the calling node.
In this embodiment, when an interface call request sent by a call node is received, the interface call request is sent to a docking configurator, and the docking configurator is coupled to each node in the micro-service architecture to manage interface calls; the docking configurator can analyze the interface calling request according to preset configuration information to obtain interface calling information, wherein the interface calling information comprises a service identifier of a service node to be accessed by the calling node; sending the interface calling information to a service node corresponding to the service identifier, responding the interface calling information by the service node, and returning calling feedback information; packaging the calling feedback information according to the configuration information to obtain a calling feedback data packet, and sending the calling feedback data packet to a calling node to complete interface calling; according to the method and the system, the interface calling in the micro-service framework is uniformly controlled and managed through the butt joint configurator, so that the interface calling and the service processing are respectively and independently realized, developers do not need to pay attention to the realization of the interface calling frequently, and the interface calling efficiency in the micro-service framework is improved.
In some optional implementations of the present embodiment, the interface invoking device 300 based on the micro service architecture may further include: a setting acquisition module and a configurator setting module, wherein:
and the setting acquisition module is used for acquiring configurator setting information from the dynamic configuration management server.
And the configurator setting module is used for setting the docking configurator according to the configurator setting information.
In this embodiment, the dynamic configuration management server configures the docking configurator in each node, so that the docking configurator can be modified and configured in time, and the flexibility of interface access is improved.
In some optional implementations of the present embodiment, the interface invoking device 300 based on the micro service architecture may further include a certificate obtaining module, where:
and the certificate acquisition module is used for acquiring the calling certificate in the docking configurator.
The request parsing module 302 is further configured to parse the interface invocation request through the docking configurator to obtain interface invocation information when the invocation node is determined to be the callable node according to the invocation certificate.
In this embodiment, whether the calling node has the calling authority is determined according to the certificate, and when the calling node is the calling node, the interface calling information is processed, so that the security of interface access is ensured.
In some optional implementations of this embodiment, the request parsing module 302 may include: the system comprises an identification reading sub-module, a mode query sub-module, a key acquisition sub-module and a request decryption sub-module, wherein:
and the identification reading submodule is used for reading the calling node identification in the interface calling request.
And the mode query submodule is used for querying the encryption mode corresponding to the calling node identifier in the configuration information of the docking configurator.
And the key obtaining submodule is used for obtaining a decryption key corresponding to the encryption mode.
And the request decryption submodule is used for decrypting the interface calling request according to the decryption key to obtain interface calling information, and the interface calling information comprises the service identifier.
In this embodiment, the calling node identifier is extracted, and in the docking configurator, the decryption key is obtained through the calling node identifier for decryption, so that the interface calling information can be accurately obtained.
In some optional implementations of this embodiment, the information sending module 303 may include: strategy inquiry submodule, call initiation submodule and feedback receiving submodule, wherein:
and the strategy query submodule is used for querying the interface corresponding to the service identifier through the docking configurator to call the strategy.
And the calling initiating submodule is used for sending the interface calling information to the service node corresponding to the service identifier according to the service identifier and the interface calling strategy so as to initiate the interface calling.
And the feedback receiving submodule is used for receiving the calling feedback information returned by the service node.
In the embodiment, interface calling is initiated according to the interface calling strategy in the docking configurator, so that smooth implementation of the interface calling is ensured.
In some optional implementations of the present embodiment, the interface invoking device 300 based on the micro service architecture may further include: record acquisition module and record storage module, wherein:
and the record acquisition module is used for acquiring the interface calling record information generated by the docking configurator, wherein the interface calling record information comprises calling process information and interface performance information.
And the record storage module is used for storing the interface calling record information into a preset database.
In this embodiment, the interface call record information generated by the docking configurator is stored in the preset database, so that data backup is realized, and a data basis is provided for subsequent interface detection.
In some optional implementations of the present embodiment, the interface invoking device 300 based on the microservice architecture may further include: the system comprises a performance acquisition module, a performance detection module, an early warning generation module and an early warning sending module, wherein:
and the performance acquisition module is used for acquiring the interface performance information in the interface calling record information.
And the performance detection module is used for detecting the interface performance according to the interface performance information to obtain an interface performance detection result.
And the early warning generation module is used for generating early warning information according to the interface performance detection result when the abnormal interface is determined to exist according to the interface performance detection result.
And the early warning sending module is used for sending the early warning information to a terminal logged by a preset account.
In this embodiment, the performance of the interface is detected according to the interface performance information, so that an abnormal interface is found in time, and smooth implementation of interface access is ensured.
In order to solve the technical problem, an embodiment of the present application further provides a computer device. Referring to fig. 4 in particular, fig. 4 is a block diagram of a basic structure of a computer device according to the embodiment.
The computer device 4 comprises a memory 41, a processor 42, a network interface 43 communicatively connected to each other via a system bus. It is noted that only computer device 4 having components 41-43 is shown, but it is understood that not all of the shown components are required to be implemented, and that more or fewer components may be implemented instead. As will be understood by those skilled in the art, the computer device is a device capable of automatically performing numerical calculation and/or information processing according to a preset or stored instruction, and the hardware includes, but is not limited to, a microprocessor, an Application Specific Integrated Circuit (ASIC), a Programmable Gate Array (FPGA), a Digital Signal Processor (DSP), an embedded device, and the like.
The computer device can be a desktop computer, a notebook, a palm computer, a cloud server and other computing devices. The computer equipment can carry out man-machine interaction with a user through a keyboard, a mouse, a remote controller, a touch panel or voice control equipment and the like.
The memory 41 includes at least one type of readable storage medium including a flash memory, a hard disk, a multimedia card, a card type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a Read Only Memory (ROM), an Electrically Erasable Programmable Read Only Memory (EEPROM), a Programmable Read Only Memory (PROM), a magnetic memory, a magnetic disk, an optical disk, etc. In some embodiments, the memory 41 may be an internal storage unit of the computer device 4, such as a hard disk or a memory of the computer device 4. In other embodiments, the memory 41 may also be an external storage device of the computer device 4, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the computer device 4. Of course, the memory 41 may also include both an internal storage unit of the computer device 4 and an external storage device thereof. In this embodiment, the memory 41 is generally used for storing an operating system and various application software installed on the computer device 4, such as computer readable instructions of an interface calling method based on a microservice architecture. Further, the memory 41 may also be used to temporarily store various types of data that have been output or are to be output.
The processor 42 may be a Central Processing Unit (CPU), controller, microcontroller, microprocessor, or other data Processing chip in some embodiments. The processor 42 is typically used to control the overall operation of the computer device 4. In this embodiment, the processor 42 is configured to execute the computer readable instructions stored in the memory 41 or process data, for example, execute the computer readable instructions of the micro service architecture based interface calling method.
The network interface 43 may comprise a wireless network interface or a wired network interface, and the network interface 43 is generally used for establishing communication connection between the computer device 4 and other electronic devices.
The computer device provided in this embodiment may execute the interface calling method based on the micro service architecture. The interface calling method based on the microservice architecture can be the interface calling method based on the microservice architecture of the above embodiments.
In this embodiment, when an interface call request sent by a call node is received, the interface call request is sent to a docking configurator, and the docking configurator is coupled to each node in the micro-service architecture to manage interface calls; the docking configurator can analyze the interface calling request according to preset configuration information to obtain interface calling information, wherein the interface calling information comprises a service identifier of a service node to be accessed by the calling node; sending the interface calling information to a service node corresponding to the service identifier, responding the interface calling information by the service node, and returning calling feedback information; packaging the calling feedback information according to the configuration information to obtain a calling feedback data packet, and sending the calling feedback data packet to a calling node to complete interface calling; according to the method and the system, the interface calling in the micro-service framework is uniformly controlled and managed through the butt joint configurator, so that the interface calling and the service processing are respectively and independently realized, developers do not need to pay attention to the realization of the interface calling frequently, and the interface calling efficiency in the micro-service framework is improved.
The present application further provides another embodiment, which is to provide a computer-readable storage medium storing computer-readable instructions executable by at least one processor to cause the at least one processor to perform the steps of the microservice architecture-based interface invocation method as described above.
In this embodiment, when an interface call request sent by a call node is received, the interface call request is sent to a docking configurator, and the docking configurator is coupled to each node in the micro-service architecture to manage interface calls; the docking configurator can analyze the interface calling request according to preset configuration information to obtain interface calling information, wherein the interface calling information comprises a service identifier of a service node to be accessed by the calling node; sending the interface calling information to a service node corresponding to the service identifier, responding the interface calling information by the service node, and returning calling feedback information; packaging the calling feedback information according to the configuration information to obtain a calling feedback data packet, and sending the calling feedback data packet to a calling node to complete interface calling; according to the method and the system, the interface calling in the micro-service framework is uniformly controlled and managed through the butt joint configurator, so that the interface calling and the service processing are respectively and independently realized, developers do not need to pay attention to the realization of the interface calling frequently, and the interface calling efficiency in the micro-service framework is improved.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present application may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present application.
It is to be understood that the above-described embodiments are merely illustrative of some, but not restrictive, of the broad invention, and that the appended drawings illustrate preferred embodiments of the invention and do not limit the scope of the invention. This application is capable of embodiments in many different forms and is provided for the purpose of enabling a thorough understanding of the disclosure of the application. Although the present application has been described in detail with reference to the foregoing embodiments, it will be apparent to one skilled in the art that the present application may be practiced without modification or with equivalents of some of the features described in the foregoing embodiments. All equivalent structures made by using the contents of the specification and the drawings of the present application are directly or indirectly applied to other related technical fields and are within the protection scope of the present application.

Claims (10)

1. An interface calling method based on micro service architecture is characterized by comprising the following steps:
when an interface calling request sent by a calling node is received, sending the interface calling request to a docking configurator;
analyzing the interface calling request through the docking configurator to obtain interface calling information, wherein the interface calling information comprises a service identifier;
sending the interface calling information to a service node corresponding to the service identifier, and receiving calling feedback information returned by the service node according to the interface calling information;
packing the call feedback information according to the configuration information in the butt joint configurator to obtain a call feedback data packet;
and sending the calling feedback data packet to the calling node.
2. The interface calling method based on micro service architecture as claimed in claim 1, wherein before sending the interface calling request to the docking configurator when receiving the interface calling request sent by the calling node, further comprising:
acquiring configurator setting information from a dynamic configuration management server;
and setting a docking configurator according to the configurator setting information.
3. The interface calling method based on micro service architecture as claimed in claim 1, wherein after sending the interface calling request to the docking configurator when receiving the interface calling request sent by the calling node, further comprising:
acquiring a calling certificate in the docking configurator;
and when the calling node is determined to be the calling node according to the calling certificate, analyzing the interface calling request through the docking configurator to obtain interface calling information.
4. The interface calling method based on micro service architecture according to claim 1, wherein the parsing the interface calling request by the docking configurator to obtain interface calling information comprises:
reading a calling node identifier in the interface calling request;
inquiring an encryption mode corresponding to the calling node identification in the configuration information of the docking configurator;
acquiring a decryption key corresponding to the encryption mode;
and decrypting the interface calling request according to the decryption key to obtain interface calling information, wherein the interface calling information comprises a service identifier.
5. The interface calling method based on the micro-service architecture according to claim 1, wherein the sending the interface calling information to the service node corresponding to the service identifier and receiving the calling feedback information returned by the service node according to the interface calling information comprises:
inquiring an interface calling strategy corresponding to the service identifier through the docking configurator;
according to the service identifier and the interface calling strategy, sending the interface calling information to a service node corresponding to the service identifier to initiate interface calling;
and receiving call feedback information returned by the service node.
6. The interface calling method based on micro service architecture as claimed in claim 1, further comprising, after the sending the call feedback packet to the calling node:
acquiring interface calling record information generated by the docking configurator, wherein the interface calling record information comprises calling process information and interface performance information;
and storing the interface calling record information into a preset database.
7. The interface calling method based on micro service architecture as claimed in claim 6, further comprising, after storing the interface calling record information in a preset database:
acquiring interface performance information in the interface calling record information;
performing interface performance detection according to the interface performance information to obtain an interface performance detection result;
when the abnormal interface is determined to exist according to the interface performance detection result, generating early warning information according to the interface performance detection result;
and sending the early warning information to a terminal logged in by a preset account.
8. An interface calling apparatus based on micro service architecture, comprising:
the system comprises a request receiving module, a docking configurator and a service module, wherein the request receiving module is used for sending an interface calling request to the docking configurator when receiving the interface calling request sent by a calling node;
the request analysis module is used for analyzing the interface calling request through the butt joint configurator to obtain interface calling information, and the interface calling information comprises a service identifier;
the information sending module is used for sending the interface calling information to the service node corresponding to the service identifier and receiving calling feedback information returned by the service node according to the interface calling information;
the information packaging module is used for packaging the calling feedback information according to the configuration information in the butt joint configurator to obtain a calling feedback data packet;
and the feedback sending module is used for sending the calling feedback data packet to the calling node.
9. A computer device comprising a memory having computer readable instructions stored therein and a processor which when executed implements the steps of the micro-service architecture based interface invocation method of any of claims 1-7.
10. A computer readable storage medium having computer readable instructions stored thereon which, when executed by a processor, implement the steps of the micro service architecture based interface invocation method of any of claims 1-7.
CN202210288992.7A 2022-03-22 2022-03-22 Micro-service architecture based interface calling method and device and computer equipment Pending CN114629945A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210288992.7A CN114629945A (en) 2022-03-22 2022-03-22 Micro-service architecture based interface calling method and device and computer equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210288992.7A CN114629945A (en) 2022-03-22 2022-03-22 Micro-service architecture based interface calling method and device and computer equipment

Publications (1)

Publication Number Publication Date
CN114629945A true CN114629945A (en) 2022-06-14

Family

ID=81904115

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210288992.7A Pending CN114629945A (en) 2022-03-22 2022-03-22 Micro-service architecture based interface calling method and device and computer equipment

Country Status (1)

Country Link
CN (1) CN114629945A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108989356A (en) * 2018-09-10 2018-12-11 四川长虹电器股份有限公司 A kind of method that API gateway realizes protocol conversion
CN109560895A (en) * 2018-12-27 2019-04-02 北京百佑科技有限公司 Data transmission method and device
CN110808948A (en) * 2019-09-23 2020-02-18 中移(杭州)信息技术有限公司 Remote procedure calling method, device and system
CN111221511A (en) * 2020-01-02 2020-06-02 航天信息股份有限公司 Development system of plug-in type micro-service interface
CN112019332A (en) * 2020-08-26 2020-12-01 平安国际智慧城市科技股份有限公司 Encryption and decryption method based on micro-service, API gateway system and equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108989356A (en) * 2018-09-10 2018-12-11 四川长虹电器股份有限公司 A kind of method that API gateway realizes protocol conversion
CN109560895A (en) * 2018-12-27 2019-04-02 北京百佑科技有限公司 Data transmission method and device
CN110808948A (en) * 2019-09-23 2020-02-18 中移(杭州)信息技术有限公司 Remote procedure calling method, device and system
CN111221511A (en) * 2020-01-02 2020-06-02 航天信息股份有限公司 Development system of plug-in type micro-service interface
CN112019332A (en) * 2020-08-26 2020-12-01 平安国际智慧城市科技股份有限公司 Encryption and decryption method based on micro-service, API gateway system and equipment

Similar Documents

Publication Publication Date Title
CN111914269B (en) Data security sharing method and system in blockchain and cloud storage environment
CN109802957B (en) Interface docking method and device, computer equipment and storage medium
WO2021003980A1 (en) Blacklist sharing method and apparatus, computer device and storage medium
CN111400676A (en) Service data processing method, device, equipment and medium based on sharing authority
US11546348B2 (en) Data service system
US10250613B2 (en) Data access method based on cloud computing platform, and user terminal
CN111740966B (en) Data processing method based on block chain network and related equipment
CN112131298B (en) Data conversion method and device based on block chain
CN111131416A (en) Business service providing method and device, storage medium and electronic device
CN112308561A (en) Block chain-based evidence storing method and system, computer equipment and storage medium
CN112988674A (en) Method and device for processing big data file, computer equipment and storage medium
WO2022095518A1 (en) Automatic interface test method and apparatus, and computer device and storage medium
CN111488372A (en) Data processing method, device and storage medium
EP4350556A1 (en) Information verification method and apparatus
CN112468409A (en) Access control method, device, computer equipment and storage medium
CN113242331A (en) Different types of address translation methods, different types of address translation devices, different types of computer equipment and different types of storage media
CN111813418A (en) Distributed link tracking method, device, computer equipment and storage medium
CN110189440A (en) A kind of smart lock monitoring equipment and its method based on block chain
CN109286604B (en) Method and device for realizing container service and electronic equipment
CN116244682A (en) Database access method, device, equipment and storage medium
CN114338527B (en) IPv6 active identifier processing method and system
CN112448909A (en) Electronic lock management method, device, system and storage medium
CN114629945A (en) Micro-service architecture based interface calling method and device and computer equipment
CN114726597A (en) Data transmission method, device, system and storage medium
CN113489723A (en) Data transmission method, system, computer device and storage medium

Legal Events

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