CN116781661A - Interface management method, device, equipment and storage medium - Google Patents
Interface management method, device, equipment and storage medium Download PDFInfo
- Publication number
- CN116781661A CN116781661A CN202211430983.3A CN202211430983A CN116781661A CN 116781661 A CN116781661 A CN 116781661A CN 202211430983 A CN202211430983 A CN 202211430983A CN 116781661 A CN116781661 A CN 116781661A
- Authority
- CN
- China
- Prior art keywords
- interface
- server
- information
- target
- cmdb
- 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
Links
- 238000007726 management method Methods 0.000 title claims abstract description 60
- 238000000034 method Methods 0.000 claims abstract description 33
- 238000013507 mapping Methods 0.000 claims description 41
- 238000012545 processing Methods 0.000 claims description 15
- 230000015654 memory Effects 0.000 claims description 13
- 238000004590 computer program Methods 0.000 claims description 11
- 230000003993 interaction Effects 0.000 claims description 9
- 241000208340 Araliaceae Species 0.000 claims description 6
- 235000005035 Panax pseudoginseng ssp. pseudoginseng Nutrition 0.000 claims description 6
- 235000003140 Panax quinquefolius Nutrition 0.000 claims description 6
- 235000008434 ginseng Nutrition 0.000 claims description 6
- 230000008569 process Effects 0.000 claims description 3
- 239000002071 nanotube Substances 0.000 abstract description 8
- 230000006870 function Effects 0.000 description 17
- 238000010586 diagram Methods 0.000 description 6
- 230000002159 abnormal effect Effects 0.000 description 4
- 238000012423 maintenance Methods 0.000 description 4
- 239000000203 mixture Substances 0.000 description 4
- 238000011161 development Methods 0.000 description 3
- 238000012217 deletion Methods 0.000 description 2
- 230000037430 deletion Effects 0.000 description 2
- 229940004975 interceptor Drugs 0.000 description 2
- 238000012544 monitoring process Methods 0.000 description 2
- 238000012546 transfer Methods 0.000 description 2
- KLDZYURQCUYZBL-UHFFFAOYSA-N 2-[3-[(2-hydroxyphenyl)methylideneamino]propyliminomethyl]phenol Chemical compound OC1=CC=CC=C1C=NCCCN=CC1=CC=CC=C1O KLDZYURQCUYZBL-UHFFFAOYSA-N 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 230000003139 buffering effect Effects 0.000 description 1
- 230000015556 catabolic process Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 201000001098 delayed sleep phase syndrome Diseases 0.000 description 1
- 208000033921 delayed sleep phase type circadian rhythm sleep disease Diseases 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000009472 formulation Methods 0.000 description 1
- 210000001503 joint Anatomy 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
Landscapes
- Computer And Data Communications (AREA)
Abstract
The application discloses an interface management method, a device, equipment and a storage medium, wherein the method comprises the following steps: storing the server information and the interface information into a CMDB server model and an interface model; determining target interface information and target server information from a model based on an interface call request sent by a client; and generating a URL address based on the target interface and the target server information, and sending the URL address to the client, so that the client calls the target server interface based on the URL address. Thus, the CMDB is utilized to carry out nano-tube on the service end information and the interface information related to the service end interface, so that a developer can conveniently manage the service end information and the interface information; after the server information and the interface information are managed, the URL address can be directly generated, and a convenient server interface access mode is provided for the client.
Description
Technical Field
The present application relates to the field of micro services, and in particular, to an interface management method, apparatus, device, and storage medium.
Background
The micro-service architecture is a cloud native architecture, which splits a complex application into multiple independent autonomous service components, which are loosely coupled and can be deployed independently. Compared with the traditional integrated architecture (Monolithic Architecure), the micro-service architecture has the characteristics of flexible deployment, technical isomerism, expandability and the like.
Each microservice is a separate entity, and interactions between them typically take the form of a representational state transfer (Representational State Transfer, RESTful) interface. Compared with the traditional architecture, the micro-service developer needs to maintain the interface information of the server, consider various abnormal conditions such as faults, current limiting and the like of the interface server, and manage the information of the server related to the interface. However, the conventional interface management system has limited functions, is limited to management of interface information, and cannot fundamentally reduce the workload of micro-service developers.
Disclosure of Invention
In order to solve the above technical problems, an embodiment of the present application is expected to provide an interface management method, an apparatus, a device, and a storage medium.
The technical scheme of the application is realized as follows:
in a first aspect, there is provided an interface management method, the method comprising:
acquiring server information of at least one server and interface information of at least one server interface bound by each server;
storing the server information into a CMDB server model, and storing the interface information into a CMDB interface model;
receiving an interface calling request sent by a client; wherein the interface call request includes: identification information of the target server interface;
determining target interface information of the target server interface from the CMDB interface model based on the identification information of the target server interface, and determining target server information of a target server bound by the target server interface from the CMDB server model;
generating a URL address based on the target interface information and the target server information;
and sending the URL address to the client so that the client calls the target service interface based on the URL address.
In a second aspect, there is provided an interface management apparatus, the apparatus comprising:
the acquisition module is used for acquiring the server information of at least one server and the interface information of at least one server interface bound by each server;
the processing module is used for storing the server information into a CMDB server model and storing the interface information into a CMDB interface model;
the receiving module is used for receiving an interface calling request sent by the client; wherein the interface call request includes: identification information of the target server interface;
the processing module is further configured to determine, based on the identification information of the target server interface, target interface information of the target server interface from the CMDB interface model, and target server information of a target server to which the target server interface is bound from the CMDB server model; generating a URL address based on the target interface information and the target server information;
and the sending module is used for sending the URL address to the client so that the client can call the target service interface based on the URL address.
In a third aspect, an electronic device is provided, the electronic device comprising: a processor and a memory configured to store a computer program capable of running on the processor, wherein the processor is configured to perform the steps of the aforementioned method when the computer program is run.
In a fourth aspect, a computer storage medium is provided, on which a computer program is stored, wherein the computer program, when being executed by a processor, carries out the steps of the aforementioned method.
The application discloses a method, a device, equipment and a storage medium for managing interfaces, which can facilitate the management of server information and interface information by developers by utilizing a CMDB to carry out the management of the server information and the interface information related to the server interface; after the server information and the interface information are managed, the URL address required by the client can be directly generated, and a convenient access mode of the server interface is provided for the client. .
Drawings
FIG. 1 is a first flow chart of an interface management method according to an embodiment of the application;
FIG. 2 is a flow chart of a request for interface call in OpenFeign in an embodiment of the application;
FIG. 3 is a second flow chart of an interface management method according to an embodiment of the application;
FIG. 4 is a schematic diagram of an interface management system according to an embodiment of the present application;
FIG. 5 is a schematic diagram of the structure of an interface management device according to an embodiment of the present application;
fig. 6 is a schematic diagram of a composition structure of an electronic device according to an embodiment of the present application.
Detailed Description
For a more complete understanding of the nature and the technical content of the embodiments of the present application, reference should be made to the following detailed description of embodiments of the application, taken in conjunction with the accompanying drawings, which are meant to be illustrative only and not limiting of the embodiments of the application.
The embodiment of the application provides an interface management method. Fig. 1 is a first flow chart of an interface management method in an embodiment of the present application, as shown in fig. 1, the interface management method specifically may include:
step 101: acquiring server information of at least one server and interface information of at least one server interface bound by each server;
here, the server information is server information related to a server interface. Exemplary, the server information includes: service ID, service name, transport protocol (http/https), service domain name, ip address, service port, service tag, service description, etc., as shown in table 1 below. The service ID is used for uniquely identifying the interface server information and is bound with different interface information; the service name is used for naming the interface service; the transmission protocol is used for formulating a request protocol of an interface, such as a common http/https protocol; the service domain name is used for mapping the network address of the interface service; the ip address identifies the ip address of the server where the service is located; the service port is used for designating a server access port corresponding to the service; the service tag can be used for grouping management of the server; the service description records detailed information of the service.
TABLE 1 Server side information
Here, the interface information is information related to the server interface. Exemplary, interface information includes: interface ID, interface name, request mode, request path, request header, request parameters, request body, etc. The interface ID is used to uniquely identify an interface (corresponding to identification information of the interface), and a binding relationship exists between the interface ID and a service ID of the server information, and it should be noted that the binding relationship also exists in the interface information, that is, the interface information includes: binding relation between interface information and server information; the interface name is used for naming a certain interface; the request mode is a request method including GET, POST, HEAD, PUT, DELETE, PATCH and the like; the request path is the uniform resource identifier path of the interface, and when path parameters exist, the path parameters can be stored in a mode of { path parameter name }; the request head, the request parameters and the request body are used for storing the parameters which need to be provided by the interface, and the parameters are stored in the database in a json mode, so that the parameters are convenient to analyze.
In practical application, the server information of at least one server and the interface information of at least one server interface bound by each server may be server information and interface information input by interface management received and acquired through a user interface.
Step 102: storing the server information into a CMDB server model, and storing the interface information into a CMDB interface model;
here, the configuration management database CMDB (Configuration Management Database) is essentially a logical database storing configuration data, which is mainly used to store basic information of the full life cycle of configuration items and logical relations between configuration items.
Illustratively, in some embodiments, the method further comprises: receiving a server information management instruction and/or an interface information management instruction; managing the server information in the CMDB server model based on the server information management instruction; and managing the interface information in the CMDB interface model based on the interface information management instruction.
Illustratively, in some embodiments, the method further comprises: and constructing the CMDB server side model according to the server metadata information.
The application fully utilizes the advantages of the CMDB, provides functions of storage, maintenance and the like for the service end information and the interface information related to the service end interface, enables an administrator of the interface management system to check the service end information of different interfaces through the WEB front-end page, and performs operations of creating, updating, deleting and the like on the service end information so as to realize configuration and management of the service end information and the interface information. And because the binding relation between the interface information and the server information is stored in the interface information, an administrator can also realize the calling and the returning of the interface by managing the server information bound by the interface information.
Step 103: receiving an interface calling request sent by a client; wherein the interface call request includes: identification information of the target server interface;
for example, the identification information of the target server interface may be an interface ID of the target server interface.
Step 104: determining target interface information of the target server interface from the CMDB interface model based on the identification information of the target server interface, and determining target server information of a target server bound by the target server interface from the CMDB server model;
here, it should be noted that, the interface information includes a binding relationship between the server and the interface, that is, in the CMDB interface model, the corresponding interface information has a binding relationship with the server information, and the client can implement the call to the server interface by using the service call framework. In general, one server may bind with multiple interfaces, one interface may also be accessed through multiple servers, and the server and the interface may be in a many-to-many relationship. Default before the interface information is entered into the CMDB, the system administrator needs to provide binding of the upper server information, and if no server information is provided, the interface returns mock data corresponding to the interface by default when the interface is called.
Step 105: generating a URL address based on the target interface information and the target server information;
step 106: and sending the URL address to the client so that the client accesses and calls the target service interface based on the URL address.
Here, the URL (Uniform Resource Locator) address is a WWW URL, which is a network address. The client can directly access and call the target server interface through the address.
Illustratively, in some embodiments, the method further comprises: acquiring interaction information between the server and the client; and storing the interaction information as a system log.
The monitoring work of interface call can be realized by recording and acquiring the interaction information between the server and the client, so that an administrator can know the service condition of the interface at any time to complete the automatic operation and maintenance work of the interface.
Here, the execution subject of steps 101 to 106 may be a processor of an electronic device implementing the interface management method according to the embodiment of the present application.
After the server side information and the interface information related to the server side interface are stored by using the CMDB server side model and the interface model, all configuration item information (equivalent to the server side information and the interface information) in the CMDB is transmitted to the CMDB unified nano tube, and a system administrator can complete functions of inputting, editing and the like, so that a developer can conveniently manage the server side information and the interface information; after the server information and the interface information are managed, URL addresses required by the client can be directly generated, and a convenient server interface access mode is provided for the client.
The application can achieve the purpose of standardizing the interface by the interface rule mapping of the CMDB on the basis of the information of the CMDB nano-tube server and the interface information, and reduce the interface development cost of a user.
Illustratively, the following table is interface information including interface mapping rules in the practice of the present application.
Table 2 interface information
The mechanism of the interface mapping rules is further illustrated below.
Illustratively, in some embodiments, the interface information includes: a ginseng mapping rule, the ginseng mapping rule comprising: mapping relation between the request mode of the universal interface and the request mode of the server interface.
Illustratively, when the interface information includes an in-reference mapping rule, the method further includes: receiving a first request body sent by a client through the universal interface; analyzing a second request body corresponding to the first request body based on the parameter entering mapping rule corresponding to the first request body and the target interface information; and sending the second request body to the target server through the target server interface.
Here, the application integrates all the server information and interface information based on the CMDB nanotube server information and interface information, and only exposes one general interface to the outside to complete the call and return of different interfaces under different servers. The entry of different server interfaces, including request header, request parameters and request body, is entered using the request body of the universal interface. Here, the first request body is a request body parsed from request information sent by the client.
The specific design of the universal interface is as follows: the general interface defaults to use a POST request mode, and a system administrator can also customize the request mode of the general interface and the request path of the general interface by means of a CMDB; the universal interface comprises two request parameters, namely serviceId and apiId, wherein the serviceId is an optional parameter and is used for transmitting a service ID of the server information configuration module, when the service ID is not provided, the service ID is called through a default service interface, otherwise, the provided service is used for calling, and a system administrator can use the parameter to configure blue-green or gray; and apiId is an optional parameter for the interface ID of the incoming interface information configuration module. The entry of different interfaces, including request header, request parameters and request body, is entered using the request body of the generic interface. Illustratively, the request body templates herein that provide the generic interface are as follows:
the header is used for the request body information of the interface corresponding to the incoming interface ID, the param is used for the request parameter information of the interface corresponding to the incoming interface ID, and the body is used for the request body information of the interface corresponding to the incoming interface ID.
In order to enhance the flexibility and the customizable capability of the general interface return body structure, in some embodiments, configuration item information of the parameter-out mapping rule is further added in the interface information of the CMDB interface model, and a function of configurable return body mode is provided, so that a system administrator can conveniently define a unified return body mode or required return field data.
Illustratively, in some embodiments, the interface information further comprises: and the parameter outputting mapping rule is used for unifying the returning body returned to the client into a preset returning body mode.
Illustratively, when the interface information includes the out-parameter mapping rule, the method further includes: receiving a first return body sent by a server through a server interface; based on the first return body and the parameter outputting mapping rule, a second return body corresponding to the first return body is analyzed; and sending the second returning body to the client through the universal interface.
An example of the presently applicable out-of-reference mapping rules is as follows:
example one:
the original parameters are:
400
the mapping rule is:
the original parameters are:
example two:
the original parameters are:
the mapping rule is:
the actual parameter is:
example three:
the original parameters are:
the mapping rule is:
the actual parameter is:
the following describes the three examples, in particular: the keys in the mapping rule are used to represent the actual returned keys, and default assignment to the corresponding keys is performed when the value is of a non-string type. When the value is a character string, the application provides a rule analyzer for analyzing the value, wherein the analyzer mainly comprises four key characters, which are respectively: "[ ]", "{ }", ": ", and" ". Wherein, the empty string "" represents the corresponding key incoming return body itself; ": "used as a prefix, means that the corresponding key is imported": the character string after' is taken as a default value; "[ ]" is used as a prefix, indicating that the returned body or current value is of array type; "{ }" is used as a prefix, indicating that the returned body or current value is the object type; "." is used to obtain the subelement of the array or object, obtain the element by index when value is the array, require to be the numeric string, obtain the element by key when value is the object.
The default returned body in the first example is a value type, the mapping rule directly takes the returned body as the value of the code key of the template object, the value of the message key is set as "error", and the value of the data key is null;
the default returned body of the second example is an object type, the mapping rule maps the elements of the object class to the corresponding keys of the template object respectively, and only the object values required by the user are returned;
example three defaults return array types, the rule processor maps each element of the array into the template object through the mapping rule, and a return mode consistent with example one and example two is constructed.
Through the formulation of the rules, a system administrator can normalize various interfaces with different styles into a unique general interface with a POST request mode, and the return of the interface can also be customized into a unified return body structure.
By the establishment of the mapping rules of the input and output parameters, various service end interfaces with different styles can be standardized into a universal interface with a unique POST request mode (or other self-defined request modes), and the return of the universal interface can be customized into a uniform return body structure.
The application can realize the function enhancement of the interface by utilizing the configuration parameters of common components such as a CMDB nanotube interceptor, a fuse and the like on the basis of the information of the CMDB nanotube server and the interface information so as to cope with various abnormal conditions of the interface server.
Illustratively, in some embodiments, the interface information includes: configuration parameters of the functional components; the method further comprises the steps of: and controlling the calling process of the server interface based on the configuration parameters of the functional components.
Illustratively, in some embodiments, the functional component includes at least one of: a fuse assembly, a retry assembly, a current limiter assembly, a buffer assembly, and a signature plug-in.
OpenFeign is a technical framework dedicated to service call in a Spring Cloud technical stack, and provides a declarative annotation mode to realize interface call to a certain service, so that development of a Web service client is simplified. OpenFeign is light enough and has rich functions, and common components such as an Encoder Encoder, a Decoder, a fuse Breaker, a retry Retryer, an interceptor Request Interceptor, a log tool Logger and the like are integrated. For example, fig. 2 is a request flow chart of interface call in Open Feign in the embodiment of the present application, as shown in fig. 2, openFeign is light enough and has rich functions, and common components such as Encoder, decoder, fuse Breaker, retry device, interceptor Request Interceptor, log tool log, etc. are integrated, and when a client calls a server interface, these functional components can be used to cope with various abnormal situations occurring at the interface server, and FeignClient can implement remote call interfaces, so that unified processing is convenient.
Specifically, the fuse component is configured to invoke the interface to return a customized default value when the server cannot access the fuse component. The system administrator may fill in a default return value for each interface on the WEB page, examples of which are as follows:
in addition, the fuse configuration parameters may include basic parameters including the number of interface calls failed to trigger the fuse, the duration of time the fuse is validated, and the like.
And the retrying device component is used for providing a simple interface failure repeated calling function. For example, the number of retries may be 3 by default. Retry rules may also be formulated by managing configuration parameters of the retry components in the CMDB interface model, such as managing configuration parameters of maximum retry times, fixed retry intervals, etc.
A timeout controller component for defining a timeout time for the interface access. The timeout control of the method call can be completed by the timeout controller, and the configuration parameters of the timeout controller comprise connection timeout time, reading timeout time and the like.
And the current limiter component provides a function of controlling the calling frequency of the interface and limits the calling frequency of the service. The system administrator can limit the concurrent request number of the interface reaching the server through the current limiter in a period, thereby achieving the purpose of reducing the real-time flow of the interface and avoiding overload breakdown of the server. The configuration parameters of the current limiter comprise the refreshing time of the interface calling authority, the authority number of the interface which can be called in one period, and the like.
And the buffer function provides a function of calling a return result by the buffer interface. The system administrator can set a triggering condition for calling the interface to use the cache, for example, when a certain parameter value in the returned result is not empty, the cache is triggered; in addition, the system administrator may configure the buffering time for the call interface to return results.
And the signature plug-in function is used for providing signature algorithm plug-ins, such as RSA, DSA and the like, and facilitating interface call and the like requiring signature authentication. The system administrator may manage encryption rules such as encryption parameters, parameter splice mode, whether ordering, signature request mode, whether the returned body needs decryption, etc.
According to the technical scheme provided by the embodiment of the application, the configuration parameters of the functional components are maintained in the CMDB interface information, so that a finer-granularity interface calling control mode is provided for a system administrator, and normal calling of the interface and return of information required by a client can be ensured.
Fig. 3 is a second flow chart of an interface management method in an embodiment of the present application, and as shown in fig. 3, the interface management method specifically may include:
step 301: acquiring server information of at least one server and interface information of at least one server interface bound by each server;
here, the interface information includes: entering parameter mapping rules, exiting parameter mapping rules and configuration parameters of the functional components;
step 302: storing the server information into a CMDB server model, and storing the interface information into a CMDB interface model;
step 303: receiving a server information management instruction and/or an interface information management instruction;
wherein the interface information management instruction includes at least one of: a parameter entering mapping rule management instruction, a parameter exiting mapping rule management instruction, a configuration parameter management instruction of a functional component and a binding relation management instruction;
the binding relation management instruction is used for managing the server information binding the interface information.
Step 304: managing the server information in the CMDB server model based on the server information management instruction;
step 305: and managing the interface information in the CMDB interface model based on the interface information management instruction.
After the server side information and the interface information related to the server side interface are stored by using the CMDB server side model and the interface model, all configuration item information (equivalent to the server side information and the interface information) in the CMDB is transmitted to the CMDB unified nano tube, and a system administrator can complete functions of inputting, editing and the like, so that a developer can conveniently manage the server side information and the interface information; the configurable scheme of the interface return body can be provided by utilizing the mapping rules of the input parameter and the output parameter of the CMDB, so that the unified calling mode of the interface is realized, the workload of a developer for adapting different interfaces is reduced, and the working efficiency of interface joint debugging and butt joint between micro services is greatly improved; the configuration parameters of the CMDB nano-tube functional component are utilized to provide a finer granularity interface calling control mode for a system administrator, so that the normal calling of the interface and the return of information required by a client can be ensured.
Further examples are given on the basis of embodiments of the present application in order to further embody the objects of the present application. Fig. 4 is a schematic structural diagram of an interface management system according to an embodiment of the present application. As shown in fig. 4, the interface management system includes: a User Interface 401 (User Interface), a Service View 402 (Service View), a Business Logic module 403 (Business Logic), a Resource Access module 404 (Resource Access), and a database 405 (Data base).
The user interface 401 is used for performing man-machine interaction with an administrator, receiving an administration instruction input by the administrator, or displaying server information, interface information, system log and the like required by the administrator. As shown in fig. 4, the user interface 401 includes: model creation/update/delete/show interface, configuration entry/edit/delete/show interface, interface control interface.
Specifically, a system administrator can manage the CMDB model through a model creation/update/deletion/presentation interface; configuration item information (such as server information, interface information and the like) in the CMDB model can be managed through configuration input/editing/deleting/displaying interfaces; the interface control interface can be used for performing control operations such as interface addition, interface deletion and the like.
Wherein the service view 402 includes: model topology view, configuration item topology view. The model topology view is used for showing and maintaining a CMDB interface model and a CMBD server model; the configuration item topology view is used to expose and maintain configuration item information in the CMDB model.
Wherein, the service logic module 403 is configured to store and maintain service logic, and includes: model (interface, server) management, configuration (interface, server) management, interface rule mapping, general interface access, log record, and functional component expansion.
The resource access module 404 may include: DB Adapter, ORM, data reference, data Type, etc. Database 405 (Data base) may include: neo4j, mysql, redis, etc.
According to the technical scheme, basic information (including a request mode, a path, a request head, a request parameter, a request body and the like) of the interface is stored while the configuration information of the server is maintained in the CMDB, after the configuration information of the server and the interface is managed, a convenient access mode of the server interface is provided for a user, and even different server addresses can be associated for the same interface; in order to adapt to interface modes of different styles, the application provides a unified interface calling mode for a user, achieves the purpose of standardizing interfaces by configuring mapping rules, and reduces the interface development cost of the user; the application also adds the performance parameter configuration (including the configuration of overtime access, retry times, current limiting, fusing and the like) related to the interface access in the interface model of the CMDB to cope with various abnormal conditions of the interface service end; in view of the complex digital signature authentication and other processes required to be carried out when a part of interfaces are called, the application provides several general digital signature algorithm plug-ins, and the safe call of the interfaces can be completed only by providing a signature related secret key. In addition, the CMDB is used for managing the interface information, so that the interface management system has the characteristics of safety, high efficiency, easy expansion, easy maintenance and the like, and the functions of statistics, monitoring and the like of performance data related to the interface can be easily integrated, so that the automatic operation and maintenance work of the interface can be completed.
Fig. 5 is a schematic diagram of a composition structure of an interface management device in an embodiment of the present application, which shows a device for implementing an interface management method, where the interface management device 50 specifically includes:
an obtaining module 501, configured to obtain server information of at least one server, and interface information of at least one server interface bound by each server;
a processing module 502, configured to store the server side information into a CMDB server side model, and store the interface information into a CMDB interface model;
a receiving module 503, configured to receive an interface call request sent by a client; wherein the interface call request includes: identification information of the target server interface;
the processing module 502 is further configured to determine, based on the identification information of the target server interface, target interface information of the target server interface from the CMDB interface model, and target server information of a target server to which the target server interface is bound from the CMDB server model; generating a URL address based on the target interface information and the target server information;
and the sending module 504 is configured to send the URL address to the client, so that the client invokes the target service interface based on the URL address.
In some embodiments, the interface information includes: a ginseng mapping rule, the ginseng mapping rule comprising: a mapping relation between a request mode of the universal interface and a request mode of the server interface; the receiving module 503 is further configured to receive, through the universal interface, a first request body sent by the client; the processing module 502 is further configured to analyze a second request body corresponding to the first request body based on the parameter entering mapping rule corresponding to the first request body and the target interface information; the sending module 504 is further configured to send the second request body to the target server through the target server interface.
In some embodiments, the interface information further comprises: the parameter outputting mapping rule is used for unifying the returning body returned to the client into a preset returning body mode; the receiving module 503 is further configured to receive, through the server interface, a first return body sent by the server; the processing module 502 is further configured to parse a second returned body corresponding to the first returned body based on the first returned body and the parameter-exiting mapping rule; the sending module 504 is further configured to send the second feedback body to the client through the universal interface.
In some embodiments, the interface information includes: configuration parameters of the functional components; the processing module 503 is further configured to control a calling procedure of the server interface based on the configuration parameters of the functional component.
In some embodiments, the functional component comprises at least one of: a fuse assembly, a retry assembly, a current limiter assembly, a buffer assembly, and a signature plug-in.
In some embodiments, the receiving module 503 is further configured to receive a server side information management instruction and/or an interface information management instruction; the processing module 502 is further configured to manage server information in the CMDB server model based on the server information management instruction; and managing the interface information in the CMDB interface model based on the interface information management instruction.
In some embodiments, the obtaining module 501 is further configured to obtain interaction information between the server and the client; the processing module 502 is further configured to store the interaction information as a system log.
Based on the hardware implementation of each unit in the interface management device, the embodiment of the application also provides electronic equipment. Fig. 6 is a schematic diagram of a composition structure of an electronic device according to an embodiment of the present application. As shown in fig. 6, the apparatus 60 includes: a processor 601 and a memory 602 configured to store a computer program capable of running on the processor;
wherein the processor 601 is arranged to execute the steps of the method in the previous embodiments when running a computer program.
Of course, in actual practice, the various components in the electronic device would be coupled together via a bus system 603, as shown in FIG. 6. It is understood that the bus system 603 is used to enable connected communications between these components. The bus system 603 includes a power bus, a control bus, and a status signal bus in addition to the data bus. But for clarity of illustration the various buses are labeled as bus system 603 in fig. 6.
In practical applications, the processor may be at least one of an application specific integrated circuit (ASIC, application Specific Integrated Circuit), a digital signal processing device (DSPD, digital Signal Processing Device), a programmable logic device (PLD, programmable Logic Device), a Field-programmable gate array (Field-Programmable Gate Array, FPGA), a controller, a microcontroller, and a microprocessor. It will be appreciated that the electronics for implementing the above-described processor functions may be other for different devices, and embodiments of the present application are not particularly limited.
The Memory may be a volatile Memory (RAM) such as Random-Access Memory; or a nonvolatile Memory (non-volatile Memory), such as a Read-Only Memory (ROM), a flash Memory (flash Memory), a Hard Disk (HDD) or a Solid State Drive (SSD); or a combination of the above types of memories and provide instructions and data to the processor.
In an exemplary embodiment, the application also provides a computer-readable storage medium, for example a memory comprising a computer program executable by a processor of an electronic device for performing the steps of the aforementioned method.
It is to be understood that the terminology used herein 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 also be understood that the term "and/or" as used herein refers to and encompasses any or all possible combinations of one or more of the associated listed items. The terms "having," "including," and "containing," or "may include" and "including" are used herein to indicate the presence of a corresponding feature (e.g., an element such as a numerical value, function, operation, or component), but do not exclude the presence of additional features.
It should be understood that although the terms first, second, third, etc. may be used herein to describe various information, these information should not be limited by these terms. These terms are only used to distinguish one type of information from another and do not necessarily describe a particular order or sequence. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the application. The technical schemes described in the embodiments of the present application may be arbitrarily combined without any collision. In the several embodiments provided in the present application, it should be understood that the disclosed method, apparatus and device may be implemented in other manners. The above-described embodiments are merely illustrative, and for example, the division of units is merely a logical function division, and other divisions may be implemented in practice, such as: multiple units or components may be combined or may be integrated into another system, or some features may be omitted, or not performed. In addition, the various components shown or discussed may be coupled or directly coupled or communicatively coupled to each other via some interface, whether indirectly coupled or communicatively coupled to devices or units, whether electrically, mechanically, or otherwise.
The units described as separate units may or may not be physically separate, and units displayed 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 be separately used as one unit, or two or more units may be integrated in one unit; the integrated units may be implemented in hardware or in hardware plus software functional units.
The foregoing is merely illustrative of the present application, and the present application is not limited thereto, and any person skilled in the art will readily recognize that variations or substitutions are within the scope of the present application.
Claims (10)
1. An interface management method, the method comprising:
acquiring server information of at least one server and interface information of at least one server interface bound by each server;
storing the server information into a CMDB server model, and storing the interface information into a CMDB interface model;
receiving an interface calling request sent by a client; wherein the interface call request includes: identification information of the target server interface;
determining target interface information of the target server interface from the CMDB interface model based on the identification information of the target server interface, and determining target server information of a target server bound by the target server interface from the CMDB server model;
generating a URL address based on the target interface information and the target server information;
and sending the URL address to the client so that the client calls the target service interface based on the URL address.
2. The method of claim 1, wherein the interface information comprises: a ginseng mapping rule, the ginseng mapping rule comprising: a mapping relation between a request mode of the universal interface and a request mode of the server interface; the method further comprises the steps of:
receiving a first request body sent by a client through the universal interface;
analyzing a second request body corresponding to the first request body based on the parameter entering mapping rule corresponding to the first request body and the target interface information;
and sending the second request body to the target server through the target server interface.
3. The method of claim 2, wherein the interface information further comprises: the parameter outputting mapping rule is used for unifying the returning body returned to the client into a preset returning body mode; the method further comprises the steps of:
receiving a first return body sent by a server through a server interface;
based on the first return body and the parameter outputting mapping rule, a second return body corresponding to the first return body is analyzed;
and sending the second returning body to the client through the universal interface.
4. The method of claim 1, wherein the interface information comprises: configuration parameters of the functional components; the method further comprises the steps of:
and controlling the calling process of the server interface based on the configuration parameters of the functional components.
5. The method of claim 4, wherein the functional component comprises at least one of: a fuse assembly, a retry assembly, a current limiter assembly, a buffer assembly, and a signature plug-in.
6. The method according to claim 1, wherein the method further comprises:
receiving a server information management instruction and/or an interface information management instruction;
managing the server information in the CMDB server model based on the server information management instruction;
and managing the interface information in the CMDB interface model based on the interface information management instruction.
7. The method according to any one of claims 1-6, further comprising:
acquiring interaction information between a server and a client;
and storing the interaction information as a system log.
8. An interface management apparatus, the apparatus comprising:
the acquisition module is used for acquiring the server information of at least one server and the interface information of at least one server interface bound by each server;
the processing module is used for storing the server information into a CMDB server model and storing the interface information into a CMDB interface model;
the receiving module is used for receiving an interface calling request sent by the client; wherein the interface call request includes: identification information of the target server interface;
the processing module is further configured to determine, based on the identification information of the target server interface, target interface information of the target server interface from the CMDB interface model, and target server information of a target server to which the target server interface is bound from the CMDB server model; generating a URL address based on the target interface information and the target server information;
and the sending module is used for sending the URL address to the client so that the client can call the target service interface based on the URL address.
9. An electronic device, the electronic device comprising: a processor and a memory configured to store a computer program capable of running on the processor,
wherein the processor is configured to perform the steps of the method of any of claims 1 to 7 when the computer program is run.
10. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211430983.3A CN116781661A (en) | 2022-11-15 | 2022-11-15 | Interface management method, device, equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211430983.3A CN116781661A (en) | 2022-11-15 | 2022-11-15 | Interface management method, device, equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116781661A true CN116781661A (en) | 2023-09-19 |
Family
ID=87993685
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211430983.3A Pending CN116781661A (en) | 2022-11-15 | 2022-11-15 | Interface management method, device, equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116781661A (en) |
-
2022
- 2022-11-15 CN CN202211430983.3A patent/CN116781661A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10977269B1 (en) | Selective structure preserving obfuscation | |
WO2018006789A1 (en) | Parameter checking method and apparatus, and network management server and computer storage medium | |
US9646088B1 (en) | Data collection and transmission | |
US20170187577A1 (en) | System for configuring network devices | |
US9135560B1 (en) | Automatic parser selection and usage | |
US8510720B2 (en) | System landscape trace | |
JP4509916B2 (en) | SNMP-based network management apparatus and method | |
US20040078787A1 (en) | System and method for troubleshooting, maintaining and repairing network devices | |
US20080028048A1 (en) | System and method for server configuration control and management | |
CN111683066B (en) | Heterogeneous system integration method, heterogeneous system integration device, computer equipment and storage medium | |
CN104601403A (en) | Automatic test system | |
US10621209B1 (en) | Automatic parser generation | |
US20080301143A1 (en) | Automatic Update System and Method for Using a Meta Mib | |
US8910296B2 (en) | Data privacy for smart services | |
CN102938770A (en) | Method for realizing uniform interface for multi-protocol messages and related device and system | |
US8392548B1 (en) | Method and apparatus for generating diagnostic information for errors detected in a network management protocol | |
CN106713014B (en) | Monitored host in monitoring system, monitoring system and monitoring method | |
CN112543109B (en) | Cloud host creation method, cloud host creation system, server and storage medium | |
CN116781661A (en) | Interface management method, device, equipment and storage medium | |
US9537736B2 (en) | Methods and systems to generate reports including report references for navigation | |
CN111901325B (en) | Service extension method and device for honeypot nodes, electronic device and storage medium | |
Uytterhoeven et al. | Zabbix 4 network monitoring: monitor the performance of your network devices and applications using the all-new Zabbix 4.0 | |
Cisco | CiscoWorks User Guide Software Release 1.0 | |
CN114268569A (en) | Configurable network operation, maintenance, acceptance and test method and device | |
Hommes et al. | Automated source code extension for debugging of openflow based networks |
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 |