CN112653618B - Gateway registration method and device of micro-service application API (application program interface) endpoint - Google Patents

Gateway registration method and device of micro-service application API (application program interface) endpoint Download PDF

Info

Publication number
CN112653618B
CN112653618B CN202011419586.7A CN202011419586A CN112653618B CN 112653618 B CN112653618 B CN 112653618B CN 202011419586 A CN202011419586 A CN 202011419586A CN 112653618 B CN112653618 B CN 112653618B
Authority
CN
China
Prior art keywords
api
micro
service application
service
file
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011419586.7A
Other languages
Chinese (zh)
Other versions
CN112653618A (en
Inventor
万哲韬
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Vispractice Technology Co ltd
Original Assignee
Shenzhen Vispractice 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 Shenzhen Vispractice Technology Co ltd filed Critical Shenzhen Vispractice Technology Co ltd
Priority to CN202011419586.7A priority Critical patent/CN112653618B/en
Publication of CN112653618A publication Critical patent/CN112653618A/en
Application granted granted Critical
Publication of CN112653618B publication Critical patent/CN112653618B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/66Arrangements for connecting between networks having differing types of switching systems, e.g. gateways
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
    • H04L67/63Routing a service request depending on the request content or context

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer And Data Communications (AREA)
  • Stored Programmes (AREA)

Abstract

The application is applicable to the technical field of computers, and provides a gateway registration method and device of an API (application program interface) endpoint of a micro service, wherein the method comprises the following steps: acquiring a target micro-service application file corresponding to the micro-service application to be registered; analyzing application service port information corresponding to the target micro-service application file and API call information corresponding to each API endpoint; and executing gateway registration operation on each API endpoint of the target micro-service application file based on the acquired application service port information and API call information. Therefore, the gateway can automatically proxy each API endpoint in the micro-service application, and the implementation of fine management on different API endpoints is facilitated.

Description

Gateway registration method and device of micro-service application API (application program interface) endpoint
Technical Field
The application belongs to the technical field of communication equipment, and particularly relates to a gateway registration method and device of an API (application program interface) endpoint of a micro-service application.
Background
Under the micro-service architecture, an API (Application Programming Interface ) gateway encapsulates the system internal architecture, providing a custom API for each client. The API gateway is responsible for service request routing, combining and protocol conversion, and all requests of clients first pass through the API gateway, and then the requests are routed to the appropriate micro-services by it to implement functions such as authentication, monitoring, load balancing, caching, request fragmentation and management, static response processing, etc.
At present, more and more enterprises are transforming into a micro-service architecture, and the micro-service architecture has the following characteristics: 1) Application classification finer leads to a large increase in the number of interface services. 2) Most of the integration among micro-service applications adopts REST style protocols. 3) Integration is one of the most important technologies in the related art of micro-service application, and a suitable integration technology can enable micro-services to keep autonomy, independently modify and release. 4) And the API gateway management platform under the micro-service architecture are responsible for guaranteeing the safety, high efficiency, traceability and manageability of integration between the micro-service applications.
However, in the transformation process of the micro service architecture, the whole micro service component is generally used as a service agent to the gateway, and a plurality of API endpoints may exist inside the micro service component, which is disadvantageous to the fine management of single API endpoints inside the micro service component, for example, it is difficult to distinguish a security authentication mechanism of the single API endpoint.
In view of the above problems, there is no better solution in the industry.
Disclosure of Invention
In view of this, the embodiments of the present application provide a gateway registration method and device for API endpoints of a micro service application, so as to at least solve the problem that in the prior art, a gateway cannot implement fine management for each API endpoint in the micro service application.
A first aspect of an embodiment of the present application provides a gateway registration method of an API endpoint of a micro service application, applied to a gateway controller, where the micro service application has a plurality of API endpoints, the method including: acquiring a target micro-service application file corresponding to the micro-service application to be registered; analyzing application service port information corresponding to the target micro-service application file and API call information corresponding to each API endpoint; and executing gateway registration operation on each API endpoint of the target micro-service application file based on the acquired application service port information and API call information.
A second aspect of the embodiments of the present application provides a gateway registration apparatus for a micro service application API endpoint, the micro service application having a plurality of API endpoints, the apparatus comprising: the file acquisition unit is configured to acquire a target micro-service application file corresponding to the micro-service application to be registered; the information analysis unit is configured to analyze application service port information corresponding to the target micro-service application file and API call information corresponding to each API endpoint; and the gateway registration unit is configured to execute gateway registration operation on each API endpoint of the target micro-service application file based on the acquired application service port information and the API call information.
A third aspect of the embodiments of the present application provides a mobile terminal comprising a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the steps of the method as described above when executing the computer program.
A fourth aspect of the embodiments of the present application provides a computer-readable storage medium storing a computer program which, when executed by a processor, implements the steps of the method as described above.
A fifth aspect of the embodiments of the present application provides a computer program product for causing a mobile terminal to carry out the steps of the method as described above when the computer program product is run on the mobile terminal.
Compared with the prior art, the embodiment of the application has the beneficial effects that:
according to the embodiment of the application, the gateway controller can acquire the target micro-service application file corresponding to the micro-service application to be registered, and analyze corresponding application service port information and API call information from the file, so that gateway registration operation can be executed for each corresponding API endpoint. Therefore, the gateway controller can register the API endpoints in the micro service application to the gateway by utilizing the micro service application file when the gateway deploys the micro service application, so that the gateway can automatically proxy each API endpoint in the micro service application, and the gateway is convenient to implement the fine management operation for different API endpoints.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following description will briefly introduce the drawings that are needed in the embodiments or the description of the prior art, it is obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 illustrates a flow chart of an example of a gateway registration method for a micro service application API endpoint in accordance with an embodiment of the present application;
FIG. 2 illustrates a flowchart of one example of obtaining a target micro-service application file, according to an embodiment of the present application;
FIG. 3 illustrates a flowchart of one example of determining a target micro-service application file according to an embodiment of the present application;
FIG. 4 illustrates a user interface diagram of a client selecting an example of microservice application information, according to an embodiment of the present application;
FIG. 5 illustrates a user interface schematic diagram of a client of an example of a business service list of a micro-business application in accordance with an embodiment of the present application;
FIG. 6 illustrates a flow chart of an example of API endpoint configuration for a gateway according to an embodiment of the present application;
FIG. 7 illustrates a flowchart of an example of a gateway registration method for a micro service application API endpoint in accordance with an embodiment of the present application;
FIG. 8 illustrates a block diagram of an example of a gateway registration device of a micro service application API endpoint in accordance with an embodiment of the present application;
fig. 9 is a schematic diagram of an example of a mobile terminal according to an embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system configurations, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
In order to illustrate the technical solutions described in the present application, the following description is made by specific examples.
It should be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It is also to be understood that the terminology used in the description of the present application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be further understood that the term "and/or" as used in this specification and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes such combinations.
As used in this specification and the appended claims, the term "if" may be interpreted as "when..once" or "in response to a determination" or "in response to detection" depending on the context. Similarly, the phrase "if a determination" or "if a [ described condition or event ] is detected" may be interpreted in the context of meaning "upon determination" or "in response to determination" or "upon detection of a [ described condition or event ]" or "in response to detection of a [ described condition or event ]".
In particular implementations, the mobile terminals described in embodiments of the present application include, but are not limited to, other portable devices such as mobile phones, laptop computers, or tablet computers having a touch-sensitive surface (e.g., a touch screen display and/or a touch pad). It should also be appreciated that in some embodiments, the above-described devices are not portable communication devices, but rather are computers having a touch-sensitive surface (e.g., a touch screen display).
In the following discussion, a mobile terminal including a display and a touch-sensitive surface is described. However, it should be understood that a mobile terminal may include one or more other physical user interface devices such as a physical keyboard, mouse, and/or joystick.
Various applications that may be executed on the mobile terminal may use at least one common physical user interface device such as a touch-sensitive surface. One or more functions of the touch-sensitive surface and corresponding information displayed on the terminal may be adjusted and/or changed between applications and/or within the corresponding applications. In this way, the common physical architecture (e.g., touch-sensitive surface) of the terminal may support various applications with user interfaces that are intuitive and transparent to the user.
Fig. 1 shows a flowchart of an example of a gateway registration method of a micro service application API endpoint according to an embodiment of the present application. As for the execution subject of the method embodiment of the present application, it may be a gateway controller provided in a gateway device (e.g., kong).
Here, the micro service application has a plurality of API endpoints, and each API endpoint needs to be registered in the gateway, and if the micro service application is numerous and the number of API endpoints in a single micro service application is also huge, considerable gateway service proxy work tends to be caused.
It should be noted that, in the related art at present, after the deployment is completed, the conventional micro service application gateway can proxy and route the entire micro service application through the gateway, and although the operation is simple, the granularity of the gateway on micro service management is thickened. Illustratively, there are 3 endpoints in a microservice application: http:// IP: port/api-001, http:// IP: port/api-002 and http:// IP: port/api-003, the gateway can only implement the proxy and routing of http:// IP: port, but cannot support endpoints api-001, api-002, api-003 to implement different gateway security authentication mechanisms (e.g., IP authentication, oauth2.0, user name password authentication, etc.), respectively.
In some cases, it may be considered that the way the gateway proxies the entire micro-service application becomes each endpoint in the gateway proxy micro-service application, requiring the user to register separately with the gateway for each endpoint. However, if the number of micro-service applications is much larger and the number of API endpoints in a single micro-service application is also much larger, considerable gateway service proxy work tends to result.
As shown in fig. 1, in step 110, the gateway controller obtains a target micro service application file corresponding to a micro service application to be registered. Here, the micro service application file may represent a program installation package corresponding to the micro service application.
In one example of an embodiment of the present application, a gateway controller may receive a target micro-service application file from a client. In another example of an embodiment of the present application, the gateway controller may receive application information from the client and determine a corresponding target micro service application file from a specific storage space, and all fall within the scope of the embodiment of the present application.
In step 120, the gateway controller parses application service port information corresponding to the target micro service application file and API call information corresponding to each API endpoint. Here, the application port information may represent index or path information of the micro service application, and the API call information may represent index or path information of the API endpoint.
In step 130, the gateway controller performs a gateway registration operation on each API endpoint of the target micro service application file based on the acquired application service port information and API call information. Illustratively, the API call information may include an API call address and an API call manner, so that the gateway controller may automatically perform a gateway registration operation using the application service port information and the API call information.
According to the embodiment of the application, the gateway controller can identify the related information of the API endpoints in the micro-service application file, and automatically perform corresponding gateway registration operation without manually configuring each API endpoint, so that the labor cost of micro-service architecture configuration can be reduced, and the registration efficiency of the gateway API endpoints is improved. In this way, an automatic proxy for different API endpoints may be implemented in the gateway, facilitating the gateway to implement fine-grained management operations for the different API endpoints therein. Therefore, convenience can be improved, usability is enhanced, workload in micro-service implementation is reduced, and management granularity and management level of the micro-service application interface are improved.
In some examples of embodiments of the present application, the gateway controller may complete registration operations for individual API endpoints in the micro-service application based on a preset API registry. Specifically, the gateway controller may write the acquired call information of each API endpoint and corresponding application service port information into the API registry, and perform a gateway registration operation based on the API registry. For example, the gateway controller may detect information in the API registry in real time or periodically and perform gateway registration operations using the updated application service port information and API call information when there is an update in the information in the API registry.
Specifically, the technology of an API registry and an open interface which are arranged in front of an API gateway can be adopted, a Swagger component is integrated in the micro-service application, the API registry interface which is arranged in front of the API gateway is automatically called when the micro-service is deployed, the API endpoints in the micro-service application are written into the registry, and the classification is carried out according to the names of the micro-service application. Therefore, according to the front-end API registry of the gateway, the one-key proxy of each API endpoint in the micro-service application can be realized to the gateway through the operations of analyzing the address of the API registry, separating the service and routing attributes, circularly proxy access and the like.
FIG. 2 illustrates a flowchart of one example of obtaining a target micro-service application file, according to an embodiment of the present application.
As shown in fig. 2, in step 210, the gateway controller receives user operation request information from the client. For example, the user may operate the client, establish a communication connection with the gateway controller, and issue corresponding user operation request information.
In step 220, the gateway controller detects whether the user operation request information matches a preset registration operation rule. Here, the registration operation rule may represent a pre-designed operation specification for triggering an API endpoint registration function, for example, a user triggers a registration function for an API endpoint for an operation of a setting control.
If the detection result in step 220 indicates that the user operation request information matches the registration operation rule, the process proceeds to step 230. If the detection result in step 220 indicates that the user registration operation information does not match the registration operation rule, the operation is ended.
In step 230, the gateway controller sends the API registration interface configuration file to the client such that the client displays a file input control based on the API registration interface configuration file. For example, the API registration interface configuration file may be a web page configuration file, and the client may display a corresponding web page based on the API registration interface configuration file, which may have a corresponding display file input control.
In step 240, the gateway controller receives a user interaction based on the file input control to determine a corresponding target micro-service application file. By way of example, the file input control may be a file import control that a user imports a pre-prepared target micro-service application file by interoperating with the control.
Through the embodiment of the application, the user can interoperate with the gateway to customize registration and configuration of the API endpoint in the gateway so as to meet the personalized requirements of the service.
In some examples of embodiments of the present application, after the above step 240, the gateway controller may further detect whether each API endpoint corresponding to the target micro service application file is successfully registered. If each API endpoint is successfully registered, the gateway controller feeds back a notification of successful registration of the application API to the client. Further, if the first API endpoint registration in the target micro service application file fails, the gateway controller feeds back an application API failure registration notification containing information of the first API endpoint to the client. Therefore, the gateway controller can feed back the API registration result to the client, so that the gateway controller can know whether the API endpoint is successfully registered or not, and user interaction service experience is improved. In addition, the user can quickly acquire the information of the first API endpoint which is not successfully registered, so that the user can timely use other strategies (e.g. manual modes) to perform gateway registration operation on the first API endpoint again, and all the API endpoints in the micro-service application can be ensured to be registered in the gateway.
In some examples of embodiments of the present application, the file input control may represent a control corresponding to a list of micro-service applications, and fig. 3 shows a flowchart of an example of determining a target micro-service application file according to an embodiment of the present application.
As shown in fig. 3, in step 310, the gateway controller receives a user interaction based on the list of micro service applications corresponding to the file input control, to determine corresponding target micro service application information.
Fig. 4 illustrates a user interface diagram of a client selecting an example of micro-service application information according to an embodiment of the present application.
As shown in fig. 4, the user may select, for example, through a drop-down menu selection operation, respective target micro-service application information for each application information in the micro-service application list displayed by the client.
In step 320, the gateway controller determines a target micro service application file corresponding to the target application information from the micro service application file library. Here, the micro service application file library stores micro service application files respectively corresponding to the respective micro service application information in the micro service application list. Illustratively, each micro-service application file or installation package file corresponding to each micro-service application information in the micro-service application list is stored in the gateway in advance.
Fig. 5 shows a user interface schematic of a client of an example of a business service list of a micro-business application according to an embodiment of the present application.
As shown in fig. 5, different API endpoints in the micro service application may be assigned a corresponding plurality of service addresses, and the user may also learn related description information configured by the corresponding API interface service, such as API creation time, host IP, and so on.
In the embodiment of the application, the source code transformation is performed on the API gateway, and the routing service of the gateway can be automatically generated by all the API endpoints in all the API registries through selecting the micro service application name in the front API registries to perform one-key proxy operation. Assuming that 100 API endpoints exist in the micro-service application in connection with the application scenario, it may take hours or days if manual operations are performed one by one to configure gateway proxy information. In the real-time flow, the application key proxy can be pressed by using the API registry, so that the quick proxy of all API endpoints in the micro-service application can be completed, a great amount of time and energy of implementation personnel are saved, the problems of fine management and monitoring of the service granularity of the micro-service application are solved, and the management level of the micro-service can be optimized.
Through the embodiment of the application, a user can select a specific micro-service application from the preset micro-service application list, the corresponding micro-service application can be directly registered and installed on the gateway based on the user selection operation without the transmission process of the gateway and the client, and the registration efficiency of the micro-service application and each API endpoint can be improved. Therefore, when the micro service application is deployed, all API endpoints in the micro service component can be automatically registered to an API registry of the gateway, and service services and routing services of the gateway are generated by the API registry according to the application name and one-key proxy.
Fig. 6 shows a flowchart of an example of API endpoint configuration for a gateway according to an embodiment of the present application.
As shown in fig. 6, in step 610, the gateway controller obtains an API personalized service configuration message. Here, the API personalized service configuration message includes target API call information and target service configuration information. By way of example, the service configuration information may have therein some personalized configuration of the user for the API endpoints, such as flow limiting policies for the respective API endpoint, plug-in processing policies, and security authentication mechanisms, among others.
In step 620, the gateway controller determines a target API corresponding to the target API call information.
In step 630, the gateway controller performs a service configuration operation on the target API based on the target service configuration information.
In the embodiment of the application, the user may implement the personalized management process for different API endpoints in the micro service application by sending an API personalized service configuration message to the gateway controller, for example, the API endpoints 1 to 50 may use a first service policy, and the API endpoints 51 to 100 may use a second service policy. Thus, the user can perform personalized service configuration operations for different API endpoints in the micro-service application.
Fig. 7 shows a flowchart of an example of a gateway registration method of a micro service application API endpoint according to an embodiment of the present application.
As shown in fig. 7, in step 710, the user adds registration service development configuration information, such as a registration address, port, user name, password, etc., of a pre-API registry for an installation package of a micro service application.
In step 720, the gateway deploys the micro service application, such as a conventional deployment operation or a containerized deployment operation.
In step 730, the user looks at the API endpoint information in the API registry on the management platform of the gateway to confirm whether each endpoint in the micro-service application has been registered in the pre-library of the gateway.
In step 740, the gateway may select a single application name in the gateway's management platform for one-touch proxy operation. Further, after the proxy is completed, the user can see if the corresponding route and traffic service have been generated peer-to-peer in both traffic and route services of the gateway.
According to the embodiment of the application, the micro-service is applied to the generation of the gateway proxy routing service for quick registration and release, so that the management and monitoring level of the micro-service is improved, the workload required by the micro-service proxy to the gateway is greatly reduced, meanwhile, the probability of error of the traditional gateway proxy is reduced by a fully-automatic processing chain, and the implementation management level of an API (application program interface) endpoint of the gateway is improved.
Fig. 8 shows a block diagram of an example of a gateway registration device of a micro service application API endpoint according to an embodiment of the present application.
As shown in fig. 8, the gateway registration apparatus 800 of the micro service application API endpoint includes a file acquisition unit 810, an information parsing unit 820, and a gateway registration unit 830.
The file obtaining unit 810 is configured to obtain a target micro service application file corresponding to the micro service application to be registered.
The information parsing unit 820 is configured to parse application service port information corresponding to the target micro service application file and API call information corresponding to each of the API endpoints.
The gateway registering unit 830 is configured to perform a gateway registering operation on each API endpoint of the target micro service application file based on the acquired application service port information and API call information.
It should be noted that, because the content of information interaction and execution process between the above devices/units is based on the same concept as the method embodiment of the present application, specific functions and technical effects thereof may be referred to in the method embodiment section, and will not be described herein again.
Fig. 9 is a schematic diagram of an example of a mobile terminal (or gateway device) of an embodiment of the present application. As shown in fig. 9, the mobile terminal 900 of this embodiment includes: a processor 910, a memory 920 and a computer program 930 stored in the memory 920 and executable on the processor 910. The processor 910, when executing the computer program 930, implements the steps of the gateway registration method embodiment of the micro service application API endpoint described above, such as steps 110 through 130 shown in fig. 1. Alternatively, the processor 910, when executing the computer program 930, performs the functions of the modules/units in the apparatus embodiments described above, for example, the functions of the units 810 to 830 shown in fig. 8.
Illustratively, the computer program 930 may be partitioned into one or more modules/units that are stored in the memory 920 and executed by the processor 910 to complete the present application. The one or more modules/units may be a series of computer program instruction segments capable of performing the specified functions, which are used to describe the execution of the computer program 930 in the mobile terminal 900. For example, the computer program 930 may be divided into a file acquisition program module, an information analysis program module, and a gateway registration program module, where each program module specifically functions as follows:
the file acquisition program module is configured to acquire a target micro-service application file corresponding to the micro-service application to be registered.
The information analysis program module is configured to analyze application service port information corresponding to the target micro service application file and API call information corresponding to each of the API endpoints.
The gateway registration program module is configured to perform gateway registration operations on respective API endpoints of the target micro service application file based on the acquired application service port information and API call information.
The mobile terminal 900 may be a computing device such as a desktop computer, a notebook computer, a palm computer, a cloud server, etc. The mobile terminal may include, but is not limited to, a processor 910, a memory 920. It will be appreciated by those skilled in the art that fig. 9 is merely an example of a mobile terminal 900 and is not intended to limit the mobile terminal 900, and may include more or fewer components than shown, or may combine certain components, or may include different components, such as an input-output device, a network access device, a bus, etc.
The processor 910 may be a central processing unit (Central Processing Unit, CPU), or may be another general purpose processor, digital signal processor (Digital Signal Processor, DSP), application specific integrated circuit (Application Specific Integrated Circuit, ASIC), field programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The storage 920 may be an internal storage unit of the mobile terminal 900, for example, a hard disk or a memory of the mobile terminal 900. The memory 920 may also be an external storage device of the mobile terminal 900, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card) or the like, which are provided on the mobile terminal 900. Further, the memory 920 may also include both internal storage units and external storage devices of the mobile terminal 900. The memory 920 is used for storing the computer program and other programs and data required for the mobile terminal. The memory 920 may also be used to temporarily store data that has been output or is to be output.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of the functional units and modules is illustrated, and in practical application, the above-described functional distribution may be performed by different functional units and modules according to needs, i.e. the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-described functions. The functional units and modules in the embodiment may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit, where the integrated units may be implemented in a form of hardware or a form of a software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. For specific working processes of the units and modules in the system, reference may be made to corresponding processes in the foregoing method embodiments.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and in part, not described or illustrated in any particular embodiment, reference is made to the related descriptions of other embodiments.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus/mobile terminal and method may be implemented in other manners. For example, the apparatus/mobile terminal embodiments described above are merely illustrative, e.g., the division of the modules or units is merely a logical function division, and there may be additional divisions in actual implementation, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection via interfaces, devices or units, which may be in electrical, mechanical or other forms.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The above units may be implemented in hardware or in software.
The integrated modules/units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the present application may implement all or part of the flow of the method of the above embodiment, or may be implemented by a computer program to instruct related hardware, where the computer program may be stored in a computer readable storage medium, and when the computer program is executed by a processor, the computer program may implement the steps of each method embodiment described above. Wherein the computer program comprises computer program code which may be in source code form, object code form, executable file or some intermediate form etc. The computer readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), an electrical carrier signal, a telecommunications signal, a software distribution medium, and so forth. It should be noted that the computer readable medium contains content that can be appropriately scaled according to the requirements of jurisdictions in which such content is subject to legislation and patent practice, such as in certain jurisdictions in which such content is subject to legislation and patent practice, the computer readable medium does not include electrical carrier signals and telecommunication signals.
The above embodiments are only for illustrating the technical solution of the present application, and are not limiting; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present application, and are intended to be included in the scope of the present application.

Claims (9)

1. A gateway registration method of an API endpoint of a micro service application applied to a gateway controller, the micro service application having a plurality of API endpoints, the method comprising:
the gateway controller obtains a target micro-service application file corresponding to the micro-service application to be registered from the client; the micro-service application file represents a program installation package corresponding to the micro-service application; the obtaining the target micro service application file corresponding to the micro service application to be registered includes:
the gateway controller receives user operation request information from a client;
the gateway controller detects whether the user operation request information is matched with a preset registration operation rule; wherein, the registration operation rule represents a pre-designed operation specification for triggering an API endpoint registration function;
when the user operation request information is matched with the registration operation rule, the gateway controller sends an API registration interface configuration file to the client so that the client displays a file input control based on the API registration interface configuration file; wherein the API registration interface configuration file is a web page configuration file, and the client can display a corresponding web page based on the API registration interface configuration file, wherein the web page has a corresponding file input control;
the gateway controller receives user interaction operation based on the file input control to determine a corresponding target micro-service application file; the file input control is a file import control, and a user imports a target micro-service application file prepared in advance by performing interactive operation on the control;
analyzing application service port information corresponding to the target micro-service application file and API call information corresponding to each API endpoint; the application service port information represents index or path information of the micro service application, and the API call information represents index or path information of the API endpoint;
based on the obtained application service port information and API call information, performing gateway registration operation on each API endpoint of the target micro-service application file, including: and integrating a Swagger component in the micro-service application by adopting an API registry and an open interface which are arranged in front of the API gateway, automatically calling the API open interface which is arranged in front of the API gateway when the micro-service is deployed, writing the API endpoints in the micro-service application into the registry, and classifying according to the names of the micro-service applications.
2. The method of claim 1, wherein the performing gateway registration operations for the respective API endpoints of the target micro service application file based on the acquired application service port information and API call information comprises:
writing the acquired calling information of each API endpoint and the corresponding application service port information into an API registry;
and executing gateway registration operation based on the API registry.
3. The method of claim 1, wherein after performing gateway registration operations on respective API endpoints of the target micro service application file, the method further comprises:
detecting whether each API endpoint corresponding to the target micro-service application file is successfully registered;
if all the API endpoints are successfully registered, an application API successful registration notification is fed back to the client;
and if the registration of the first API endpoint in the target micro-service application file fails, feeding back an application API failure registration notification containing the information of the first API endpoint to the client.
4. The method of claim 1, wherein the receiving user interaction based on the file input control to determine the corresponding target micro-service application file comprises:
receiving user interaction operation based on a micro-service application list corresponding to the file input control to determine corresponding target micro-service application information;
and determining a target micro-service application file corresponding to the target micro-service application information from a micro-service application file library, wherein the micro-service application file library stores micro-service application files respectively corresponding to the micro-service application information in the micro-service application list.
5. The method of claim 1, wherein after performing gateway registration operations on respective API endpoints of the target micro service application file, the method further comprises:
acquiring an API personalized service configuration message, wherein the API personalized service configuration message comprises target API calling information and target service configuration information;
determining a target API corresponding to the target API call information;
and executing service configuration operation on the target API based on the target service configuration information.
6. The method of claim 1, wherein the API call information includes an API call address and an API call mode.
7. A gateway registration apparatus of a micro service application API endpoint, the micro service application having a plurality of API endpoints, the apparatus comprising:
the file acquisition unit is configured to acquire a target micro-service application file corresponding to the micro-service application to be registered from the client by the gateway controller; the micro-service application file represents a program installation package corresponding to the micro-service application; the obtaining the target micro service application file corresponding to the micro service application to be registered includes:
the gateway controller receives user operation request information from a client;
the gateway controller detects whether the user operation request information is matched with a preset registration operation rule; wherein, the registration operation rule represents a pre-designed operation specification for triggering an API endpoint registration function;
when the user operation request information is matched with the registration operation rule, the gateway controller sends an API registration interface configuration file to the client so that the client displays a file input control based on the API registration interface configuration file; wherein the API registration interface configuration file is a web page configuration file, and the client can display a corresponding web page based on the API registration interface configuration file, wherein the web page has a corresponding file input control;
the gateway controller receives user interaction operation based on the file input control to determine a corresponding target micro-service application file; the file input control is a file import control, and a user imports a target micro-service application file prepared in advance by performing interactive operation on the control;
the information analysis unit is configured to analyze application service port information corresponding to the target micro-service application file and API call information corresponding to each API endpoint; the application service port information represents index or path information of the micro service application, and the API call information represents index or path information of the API endpoint;
a gateway registration unit configured to perform gateway registration operations on respective API endpoints of the target micro service application file based on the acquired application service port information and API call information, including: and integrating a Swagger component in the micro-service application by adopting an API registry and an open interface which are arranged in front of the API gateway, automatically calling the API open interface which is arranged in front of the API gateway when the micro-service is deployed, writing the API endpoints in the micro-service application into the registry, and classifying according to the names of the micro-service applications.
8. A mobile terminal comprising a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the steps of the gateway registration method of a micro service application API endpoint according to any of claims 1-6 when the computer program is executed.
9. A computer readable storage medium storing a computer program which, when executed by a processor, implements the steps of a gateway registration method of a micro service application API endpoint according to any of claims 1-6.
CN202011419586.7A 2020-12-07 2020-12-07 Gateway registration method and device of micro-service application API (application program interface) endpoint Active CN112653618B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011419586.7A CN112653618B (en) 2020-12-07 2020-12-07 Gateway registration method and device of micro-service application API (application program interface) endpoint

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011419586.7A CN112653618B (en) 2020-12-07 2020-12-07 Gateway registration method and device of micro-service application API (application program interface) endpoint

Publications (2)

Publication Number Publication Date
CN112653618A CN112653618A (en) 2021-04-13
CN112653618B true CN112653618B (en) 2023-08-08

Family

ID=75351034

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011419586.7A Active CN112653618B (en) 2020-12-07 2020-12-07 Gateway registration method and device of micro-service application API (application program interface) endpoint

Country Status (1)

Country Link
CN (1) CN112653618B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113973129B (en) * 2021-09-30 2024-02-20 广西中科曙光云计算有限公司 Gateway supporting multiple registry micro services
CN114218608B (en) * 2021-12-31 2023-02-14 深圳达实旗云健康科技有限公司 API registration type-based data privacy protection method, storage medium and system
CN114866617A (en) * 2022-04-28 2022-08-05 济南浪潮数据技术有限公司 Micro-service request processing method, device, equipment and medium
CN114817821B (en) * 2022-06-30 2022-09-16 数字广东网络建设有限公司 Display method and device of government affair information, electronic equipment and storage medium
CN115242761A (en) * 2022-07-01 2022-10-25 浪潮云信息技术股份公司 Dynamic OpenAPI automatic registration method
CN115514633A (en) * 2022-08-29 2022-12-23 中国电信股份有限公司 Dynamic configuration method and device of API gateway, and electronic equipment
CN115857935A (en) * 2023-02-15 2023-03-28 北京微吼时代科技有限公司 Front-end development method and device independent of framework
CN116319090B (en) * 2023-05-18 2023-08-11 中国电子信息产业集团有限公司第六研究所 Power and environment monitoring system and method based on micro-service

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107612955A (en) * 2016-07-12 2018-01-19 深圳市远行科技股份有限公司 Micro services provide method, apparatus and system
CN108306917A (en) * 2017-01-13 2018-07-20 中国移动通信集团江西有限公司 The register method and device of data processing method and device, micro services module
CN109542796A (en) * 2018-12-28 2019-03-29 深圳云天励飞技术有限公司 Test method and Related product
CN110278284A (en) * 2019-07-10 2019-09-24 中国民航信息网络股份有限公司 A kind of service calling method and device
CN110990081A (en) * 2019-12-10 2020-04-10 北京懿医云科技有限公司 Microservice registration and discovery method and device, storage medium and electronic equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107612955A (en) * 2016-07-12 2018-01-19 深圳市远行科技股份有限公司 Micro services provide method, apparatus and system
CN108306917A (en) * 2017-01-13 2018-07-20 中国移动通信集团江西有限公司 The register method and device of data processing method and device, micro services module
CN109542796A (en) * 2018-12-28 2019-03-29 深圳云天励飞技术有限公司 Test method and Related product
CN110278284A (en) * 2019-07-10 2019-09-24 中国民航信息网络股份有限公司 A kind of service calling method and device
CN110990081A (en) * 2019-12-10 2020-04-10 北京懿医云科技有限公司 Microservice registration and discovery method and device, storage medium and electronic equipment

Also Published As

Publication number Publication date
CN112653618A (en) 2021-04-13

Similar Documents

Publication Publication Date Title
CN112653618B (en) Gateway registration method and device of micro-service application API (application program interface) endpoint
CN110535831B (en) Kubernetes and network domain-based cluster security management method and device and storage medium
JP7389791B2 (en) Implementing Compliance Settings with Mobile Devices to Adhere to Configuration Scenarios
US8661502B2 (en) Determining a sensitivity label of document information in real time
CN108572833B (en) Automatic application updates
US9753786B2 (en) Client server communication system
US9990214B2 (en) Dynamic agent delivery
US20210194762A1 (en) Honeypot asset cloning
CN109597643A (en) Using gray scale dissemination method, device, electronic equipment and storage medium
US20170033980A1 (en) Agent manager for distributed transaction monitoring system
CN114143191A (en) Distributed gateway-based micro-service arranging method and device and related equipment
US11593296B2 (en) Edge component redirect for IoT analytics groups
US9760412B2 (en) Client server communication system
CN114185734A (en) Cluster monitoring method and device and electronic equipment
CN111722994A (en) Task request response method and device
CN116170274A (en) Web application access method, device, system and computing equipment
CN114070889B (en) Configuration method, traffic forwarding device, storage medium, and program product
CN114124475A (en) Network asset port scanning and service identification method and device
CN113779122A (en) Method and apparatus for exporting data
CN111193717A (en) FTP black and white list control method and device and electronic equipment
US20240028745A1 (en) System and method for hunt, incident response, and forensic activities on an agnostic platform
CN116225576B (en) Application program data environment switching method and device, electronic equipment and medium
CN115277506B (en) Load balancing equipment testing method and system
CN115208671A (en) Firewall configuration method and device, electronic equipment and storage medium
CN115022053A (en) Method, device and system for accessing block chain network

Legal Events

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