CN112612629B - Method and system for realizing component type data interface - Google Patents

Method and system for realizing component type data interface Download PDF

Info

Publication number
CN112612629B
CN112612629B CN202011583689.7A CN202011583689A CN112612629B CN 112612629 B CN112612629 B CN 112612629B CN 202011583689 A CN202011583689 A CN 202011583689A CN 112612629 B CN112612629 B CN 112612629B
Authority
CN
China
Prior art keywords
interface
service
authorization
data
component
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
CN202011583689.7A
Other languages
Chinese (zh)
Other versions
CN112612629A (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.)
Guangdong Guangyu Technology Development Co Ltd
Original Assignee
Guangdong Guangyu Technology Development 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 Guangdong Guangyu Technology Development Co Ltd filed Critical Guangdong Guangyu Technology Development Co Ltd
Priority to CN202011583689.7A priority Critical patent/CN112612629B/en
Publication of CN112612629A publication Critical patent/CN112612629A/en
Application granted granted Critical
Publication of CN112612629B publication Critical patent/CN112612629B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services
    • G06F9/548Object oriented; Remote method invocation [RMI]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4488Object-oriented
    • G06F9/449Object-oriented method invocation or resolution
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/544Remote

Landscapes

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

Abstract

The invention belongs to the field of data interaction and data transmission, and particularly relates to a method and a system for realizing a modular data interface, wherein the system comprises the following steps: the middle platform service is used for uniformly managing the interface components; an interface component for providing data interface service for the third party service system; the middle service and the interface component realize communication in an RPC calling mode, the RPC calling process is to package calling and encoding/decoding processes, and the middle service and the interface component realize a service end and a client end simultaneously; the server is responsible for realizing specific business logic by using a Rest API mode; the client is responsible for calling relevant business logic according to the Rest API mode. The invention manages and monitors the data interface in a unified way under the scene that a plurality of service systems need to develop the data interface, avoids the disorder conditions of non-unified development standards of each service system and uncontrollable service running environment and state, and solves the problem of delay and even overtime of data response when a large concurrency amount is requested.

Description

Method and system for realizing component type data interface
Technical Field
The invention belongs to the field of data interaction and data transmission, and particularly relates to a method and a system for realizing a modular data interface.
Background
The data interface is generally implemented using Web Service, and the Web Service is divided into Restful Web Service (hereinafter referred to as Restful) and Soap Web Service (hereinafter referred to as Soap). The Restful utilizes the original application protocol design concept of Http to the maximum extent because of the high-efficiency, simple and easy-to-use characteristics, can well integrate a plurality of front-end technologies of the current web2.0 to improve the development efficiency, is suitable for a resource type service interface, and is particularly suitable for scenes with high efficiency requirements but low safety requirements.
With the advent of the big data age, the demands for data interaction are increasing, and Restful is becoming more and more widely used. On the other hand, with the increase of service complexity, system data volume and request concurrency, the traditional implementation manner can not meet the service requirement, and logic codes are sequentially executed in the same interface to realize the service requirement, so that the efficiency is low, and when the request concurrency is large, response delay and even response timeout are frequently caused. Secondly, as traffic demands move, restful services become increasingly bulkier. Particularly, data interaction is required for a plurality of service systems, the service systems are not the operation and maintenance scenes of the same company, and the problems of interface scattering, inconsistent calling modes, incapability of uniformly managing data interface services and the like are caused by the traditional data interface development mode.
It follows that the problems of the prior art are mainly represented by insufficient loading capacity and insufficient lateral expansion capacity. Recently, technical choices based on micro services and midst have been proposed. The micro-service emphasizes a divide-and-conquer method, and larger single service is split and further decoupled, namely one service is split into a plurality of services, and each service is executed in a coordinated manner to finish the service together; the micro Service framework is represented by Dubbo and Spring Cloud, load balancing, fault tolerance, routing and the like are carried out on the Service by utilizing a cluster communication mechanism in the framework, and each Web Service is treated and monitored in a Service mode. The middle platform is more divided transversely, namely the common business capability is sunk, and then the service capability is opened to the front application for use. The middle station is not necessarily constructed by adopting micro services, and the requirements of the middle station are met as long as the sinking of the common business capability is met.
Disclosure of Invention
The invention provides a method and a system for realizing a modular data interface, which can uniformly manage and monitor data interfaces under the scene that a plurality of business systems of different companies (namely, each business system is developed and maintained by different companies) need to develop the data interfaces, thereby avoiding the disorder conditions that the development standards of the business systems are not uniform and the service operation environment and state are uncontrollable, and solving the problems of delay and even overtime of data response when a large concurrency is requested.
The system is realized by adopting the following technical scheme: a modular data interface implementation system, comprising:
the middle service is used for uniformly managing the interface components, including load balancing, fault tolerance and routing;
an interface component for providing data interface service for the third party service system;
the middle service and the interface component realize communication in an RPC calling mode, the RPC calling process is to package calling and encoding/decoding processes, and the middle service and the interface component realize a service end and a client end simultaneously; the server is responsible for realizing specific business logic by using a Rest API mode, and comprises registration, stopping, callback, authorization, heartbeat and log functions; the client is responsible for calling related business logic according to a Rest API mode, including registration call, stop call, callback call, authorization call, heartbeat call and log call.
The method is realized by adopting the following technical scheme: the method for realizing the modular data interface is characterized by uniformly managing interface modules through a middle service, and comprises load balancing, fault tolerance and routing; providing data interface service for a third party service system through an interface component; communication between the middle platform service and the interface component is realized in an RPC calling mode, wherein the RPC calling process is to encapsulate calling and encoding/decoding processes, and the middle platform service and the interface component realize a service end and a client end simultaneously; the server is responsible for realizing specific business logic by using a Rest API mode, and comprises registration, stopping, callback, authorization, heartbeat and log functions; the client is responsible for calling related business logic according to a Rest API mode, including registration call, stop call, callback call, authorization call, heartbeat call and log call.
According to the technical scheme, the invention is divided into two parts of the middle-stage service and the interface component, wherein the middle-stage service uniformly manages and monitors the data interface and performs load balancing, fault tolerance, routing and other processes; the interface component provides a unified standard SDK, so that each service system can rapidly develop the interface component of own service according to the standard, register the interface component into the data interface cluster through the middle service, and provide the interface component for each service system to use, thereby realizing transverse expansion. Compared with the prior art, the invention has the following advantages and beneficial effects:
1. the invention adopts component development, which solves the problems that when a large concurrency is requested, the data often has response delay and even response overtime; and the coordination that a plurality of business systems of different companies need to develop data interfaces is perfectly realized, and the data interfaces are uniformly managed and monitored. The conditions of nonuniform development standards of various service systems and uncontrollable service running environments and states are avoided, and the system can be expanded transversely infinitely. Data interface development scenarios particularly suited for government agencies (e.g., public security authorities, social security authorities, etc.); because government agency projects are generally bid and outsourced for third party companies to develop and maintain, as business grows, the number of projects and outsourcing companies must increase, and the data of each project is maintained by its outsourcing company, and the data cannot be directly accessed by others, and when data interaction is needed between projects, development of data interfaces is needed.
2. The invention simplifies the development of the data interface, and only needs to develop one data component and register the data component to the service center. When the data component is developed, only the service logic is concerned, namely the SDK of the interface component is applicable, a basic controller is inherited, each interface method is realized according to the service requirement, and then the service can be started by configuring the machine code, IP, port and interface list of the interface service deployment.
3. On one hand, the invention uniformly monitors and manages the data interface information through the middle-platform service; on one hand, the problem of large request concurrency is solved through the micro-service, the problem of non-uniform development standards of each service system is avoided, and the development interface is simplified and can be laterally expanded. The communication mode between the middle service and the micro service uses RPC (Rest API), and the responsibility is clear when the business system calls the interface; the business system firstly calls the middle platform service to authorize, the middle platform service gives the authorization information to the interface service, and the business system can call the interface service to acquire the needed data.
Drawings
FIG. 1 is a block diagram of a data interface implementation system in an embodiment of the invention;
FIG. 2 is a flow chart of data component registration in an embodiment of the invention;
FIG. 3 is a flow chart of data interface authorization in an embodiment of the invention;
FIG. 4 is a flow chart of the opening of an API interface component to a third party business system in an embodiment of the present invention;
FIG. 5 is a flow chart of an RPC call in an embodiment of the invention.
Detailed Description
Abbreviations and key terms involved in the present invention are defined as follows:
Restful Web Service, an architecture style, the core of which is resource-oriented, is designed and developed specifically for network applications, so as to reduce development complexity and improve system scalability.
SOAP Web Service is based on XML protocol, and has the main core of being activity-oriented, strict specifications and standards, including contents of security, transaction and other aspects, and simultaneously, SOAP emphasizes the separation of an operation method and an operation object, and WSDL file specifications and XSD files are respectively defined for the operation method and the operation object.
RPC, which refers to remote procedure call (Remote Procedure Call Protocol), that is to say two servers A, B, an application is deployed on server a, and wants to call functions/methods provided by the application on server B, and because it is not in a memory space, it cannot be directly called, and needs to express the semantics of the call and communicate the data of the call through the network.
The invention does not use the third party micro service framework to directly carry out secondary development, because the micro service is split on the service, but the service complexity is not reduced due to the split, and on the contrary, the additional technical cost and the cooperation cost are also increased, the whole complexity is increased instead of reduced, and the development efficiency is reduced instead of increased. In the implementation process of the invention, the middle platform and the micro service are basically used, the business is transversely split according to the requirement of the middle platform, so that the common capability is sunk, the sunk common capability is further split into a plurality of business micro service components according to the micro service thought, and the capability opening is performed in a common lightweight API interface mode in the micro service. The present invention will be described in further detail with reference to examples and drawings, but embodiments of the present invention are not limited thereto.
Examples
As shown in fig. 1, in this embodiment, the modular data interface implementation system includes a middle platform service and an interface component (i.e. a data component cluster), where the middle platform service is responsible for performing unified management on load balancing, fault tolerance, routing, and the like on the interface component, and the interface component is responsible for implementing a data interface, where the middle platform service and the interface component implement communication by using RPC (Rest API) call.
The middle platform service is developed based on Spring boot and is used as a unified management and scheduling service program of a data interface, and comprises a management module, a communication module and an API module, and the following specific descriptions are respectively provided:
a) The management module is a WEB management background of the middle-stage service and is mainly used for maintaining functions of business system management, component management, interface management, API (application program interface) related log data and the like.
The service system management provides a display interface, an adding function and an editing function, the added service system data automatically generates a group of account numbers (APP ID) and passwords corresponding to the added service system data, and the added service system data is used for authorization verification when the service system performs interface authorization. In addition, the association function of the service system and the interfaces is provided, which indicates the authority of which interfaces the service system has.
Component management is used to provide a presentation interface and add and edit functions, and the added component data automatically generates a random machine code (unique and non-modifiable) by which the actual component service is registered in match with the component data. The interface management is used to provide a presentation interface that is generated or updated by the interface component upon registration with the middlebox service.
The API related log data includes an API authorization log and an API access log. The API authorization log is used for providing a presentation interface, and log data is generated when the third-party service system initiates interface authorization to the intermediate station. The API access log is used as detailed log content in a corresponding API authorization log and is stored on the interface component in a remote file mode, the file is generated when a third-party service system requests an actual API interface from the interface component, and the content of the remote file is read from the interface component and displayed through a log calling function in a communication module of the middle service.
B) The communication module (middle platform service) is used for maintaining communication between the middle platform service and the data component cluster, is realized by adopting RPC (Rest API), and provides access functions of authorization call, heartbeat call and log call, and accessed functions of registration, stopping and callback.
And after the third party service system requests the authorization in the API module and passes the authorization verification logic, the function is called to push related authorization information, such as an API authorization log, a service system identifier, an API interface identifier, an access upper limit, an access time limit and the like, to the data component.
And calling the function to confirm whether a response exists to the corresponding data component according to the component information at the timing of heartbeat calling, if so, considering that the data component is online, and if not, considering that the data component is not online after overtime, and updating the state into the component information.
And calling the function to read the corresponding remote log file content in the data component by using the API access log identification as a parameter.
Registration is the logic of data component registration (operation), mainly updating the components and interface data of the database. And updating the corresponding information of the component IP, the port, the state (on line) and the like according to the parameters called by the registration parameters by using the machine code, updating the information of the interface list by using the machine code, and responding to the registration calling operation of the data component after completion. The flow is shown in fig. 2.
The stop is logic for stopping the data component, and mainly updates the component data of the database. And updating the corresponding component state (stopping) according to the machine code, and completing the stopping call of the response data component.
And calling back, responding to the calling back of the data component, and expanding the functions.
C) And the API module (middle platform service) is an access interface opened to the third party service system and mainly comprises interface authorization and an interface list.
The interface list obtains the data interface list owned by the appointed third party service system, mainly queries the data of the associated components and interfaces according to the service system, and then collates the data into a list of url addresses of each interface.
And the interface authorization, the authorization operation of the third party service system and the data interface, and the authorization account number, the password and the interface to be called are required to be specified. The method mainly comprises the steps of inquiring the associated component according to the account number, then verifying whether the password is correct, inquiring interface data associated with the component if the password is correct, pushing authorization information to the data component by using an authorization calling method if an interface needing to be called exists, and returning to the url address after success. The authorization flow is as in fig. 3.
And the interface component provides data interface service for the third party service system based on Spring boot development, and comprises a communication module and an API module.
A) And the communication module (interface module) is used for maintaining communication between the data module and the middle service, is realized by adopting RPC (Rest API), and provides access functions of registration call, stop call and callback call and accessed functions of authorization, heartbeat and log.
The registration call, the function is called after the interface component program is started to submit the information of the current interface component, such as machine code, IP, port, interface list and the like, to the service center, and the method is realized by using a Spring boot event monitor.
And (3) stopping calling, and calling the function to submit an instruction of stopping service to the service center before the interface component program stops, wherein the instruction is realized by using a Spring boot event monitor.
Callback calls, which are required to call or notify the middle service operation for a function to be extended, such as an interface component, can be performed using this function.
And authorizing, receiving and caching the authorization information pushed by the middle service, wherein the caching information is used for verifying the authority when the business system requests the interface, and responding to the authorization call of the middle service after the completion.
The heartbeat is directly responsive to the heartbeat call of the midrange service.
And the log reads a local API access log file according to the API authorization log identifier provided by the middle server, returns the file content as information and responds to the log call of the middle server.
B) The API module (interface component) is an access interface opened to the third party service system and mainly comprises authorization verification, call log, interface logic and the like. The flow is as in fig. 4.
Authorization verification is realized by using a Spring interceptor, the method of HandlerInterceptorAdapter is inherited and PREHANDLE is realized, and logic of authorization verification is realized inside. And verifying the authorization parameters of the request with the authorization information pushed during the authorization of the middle station service.
And calling the log, using a Spring interceptor to realize inheritance HandlerInterceptorAdapter and realizing postHandle methods, and writing log files in the log files, wherein the log files comprise calling start time, calling end time, data volume, request IP and the like.
The interface logic is abstract, realizes a basic controller, unifies a control request mode, collates request parameters, calls service logic and unifies a return value format. The specific business logic is to carry out secondary development by each business system inheriting the basic controller, so as to realize the own business logic.
In this embodiment, the RPC of the Rest API style is implemented by using an efficient network communication framework io.netty, as shown in fig. 5, the steps 2-10 of the calling process are well packaged, that is, the calling and encoding/decoding processes are packaged, so that the user feels like calling the local service to call the remote service. The middle service and the interface component both need to realize the service end and the client end at the same time. The server is mainly responsible for realizing specific business logic such as registration, stopping, callback, authorization, heartbeat and log by using a Rest API mode; the client is mainly responsible for calling related business logic according to the call mode of the Rest API, such as registration call, stop call, callback call, authorization call, heartbeat call and log call.
The RPC call process is exactly one http/https request and response process. The different is that according to the parameters and parameter formats defined by the user, the communication modules (client, server, i.e. the middle service and interface component) are respectively encapsulated by the http/https protocol and comprise a request code and a response code, so that the client and the server can directly call. Taking the call situation of user authorization as an example (in the scene of authorization call, the middle service is an RPC client, the interface component is an RPC server), the detailed description of the RPC call process is as follows:
A. the Client (Client) invokes an authorization request method in a Client communication module (Client Stub), and transmits parameters such as a user authorization token, component information (information such as ip and communication port of an interface component) and an interface information list (interface information list corresponding to the interface component, which is submitted when the component is registered).
B. A Client communication module (Client Stub) assembles url of an http/https protocol according to an interface component ip, a communication port and an authorized call name (which is well defined by a Client and a server), and creates a post request by using the url; then serializing the user authorization token and the interface information list into json character strings, and putting the json character strings into a request body; encrypting the RPC communication key (which is well defined by the client and the server and is arranged on the configuration file) by MD5 once, and putting the encrypted RPC communication key into a request head; finally, the post request is executed to send a message over the network.
C. The method for authorizing the Server-side communication module (Server Stub) comprises the following steps: after receiving the post request, the server firstly verifies the communication key transmitted by the client acquired by the request head (note that the transmitted key is encrypted once by MD5, so that the communication key in the configuration file needs to be decrypted once by MD5 and then matched), and if the communication key is incorrect, the authorization fails in response to the request; after the verification is passed, acquiring a user authorization token and a json character string of an interface information list from the request body, and deserializing the json character string into an authorization data object; and finally, creating an authorization Handler object by using the authorization data object as a parameter, and placing the authorization Handler object into a queue for calling.
D. The Server (interface component) realizes the execution logic of the authorization Handler, and mainly caches the authorization data objects for unified management. When the user requests the interface, the data are used for requesting authority verification for different users and different interfaces respectively. Firstly, searching a cache by using a user authorization token, if a corresponding interface information list can be found, combining the new interface information list and the old interface information list into a new list, covering the new list into the cache, and if the new list cannot be found, directly using the user authorization token as an identifier, and writing the interface information list into the cache; then setting the cache timeout time to 120 minutes; and finally, returning the result to a Server-side communication module (Server Stub).
E. The Server communication module (Server Stub) receives the returned result, assembles the result into a response message object, the necessary attributes of the response message object comprise a return code, return information and return data, sequences the response message object into json character strings, and then sends the response message to the Client communication module (Client Stub).
F. the Client communication module (Client Stub) receives the json character string of the response message, deserializes the json character string into a response message object, assembles the response message object into a calling result according to the agreed response return code, and returns the result to the Client.
The pseudo code of the Rest API style implementation is:
Based on the same inventive concept, the embodiment also provides a modular data interface implementation method, which performs unified management on interface modules through a middle server, including load balancing, fault tolerance and routing; providing data interface service for a third party service system through an interface component; communication between the middle platform service and the interface component is realized in an RPC calling mode, wherein the RPC calling process is to encapsulate calling and encoding/decoding processes, and the middle platform service and the interface component realize a service end and a client end simultaneously; the server is responsible for realizing specific business logic by using a Rest API mode, and comprises registration, stopping, callback, authorization, heartbeat and log functions; the client is responsible for calling related business logic according to a Rest API mode, including registration call, stop call, callback call, authorization call, heartbeat call and log call.
In the data interface implementation method of this embodiment, the RPC call procedure is also shown in fig. 5, and is the same as the RPC call procedure in the data interface implementation system.
The above examples are preferred embodiments of the present invention, but the embodiments of the present invention are not limited to the above examples, and any other changes, modifications, substitutions, combinations, and simplifications that do not depart from the spirit and principle of the present invention should be made in the equivalent manner, and the embodiments are included in the protection scope of the present invention.

Claims (8)

1. A modular data interface implementation system, comprising:
the middle service is used for uniformly managing the interface components, including load balancing, fault tolerance and routing;
An interface component for providing unified data interface service for the third party service system;
The middle service and the interface component realize communication in an RPC calling mode, the RPC calling process is to package calling and encoding/decoding processes, and the middle service and the interface component realize a service end and a client end simultaneously; the server is responsible for realizing specific business logic by using a Rest API mode, and comprises registration, stopping, callback, authorization, heartbeat and log functions; the client is responsible for calling related business logic according to a Rest API mode, including registration call, stop call, callback call, authorization call, heartbeat call and log call;
The middle station service comprises the following steps:
the management module is used for maintaining service system management, component management, interface management and API related log data;
the communication module is used for maintaining communication between the middle station service and the interface component, providing access functions of authorization call, heartbeat call and log call, and the accessed functions of registration, stopping and callback;
The API module is an access interface opened to the third party service system and comprises interface authorization and an interface list; the interface list acquires a data interface list owned by a specified third party service system, and the interface authorizes the authorization operation of the specified third party service system and the data interface;
the component management of the management module in the middle service is used for providing a display interface and adding and editing functions, the added component data automatically generates a unique random machine code which can not be modified, and the actual component service is matched and registered with the component data by means of the random machine code; the interface management of the management module in the middle-stage service is used for providing a display interface, and the display interface is generated or updated when the interface component registers with the middle-stage service;
The service system management of the management module in the middle service provides a display interface, an adding function and an editing function, the added service system data automatically generates a group of account numbers and passwords corresponding to the added service system data, and the service system is used for authorization verification when the service system performs interface authorization; the service system management of the middle service management module also provides the association function of the service system and the interface;
The interface component provides a unified standard SDK, so that each service system develops the interface component of own service according to the standard, registers the interface component into the data interface cluster through the middle service, and provides the interface component for each service system.
2. The modular data interface implementation system of claim 1, wherein the API-related log data includes an API authorization log and an API access log; the API authorization log is used for providing a display interface, and log data are generated when a third party service system initiates interface authorization to the middle station service; the API access log is used as detailed log content in a corresponding API authorization log, is stored on the interface component in a remote file mode, is generated when a third-party service system requests an actual API interface from the interface component, and reads and displays the content of the remote file from the interface component through a log calling function in a communication module of the middle service.
3. The modular data interface implementation system of claim 1, wherein the interface module comprises:
the communication module is used for maintaining communication between the interface component and the middle service, and is realized by adopting an RPC calling mode, and provides access functions of registration calling, stop calling and callback calling, and accessed functions of authorization, heartbeat and log;
And the API module is an access interface opened to the third-party service system and comprises authorization verification, call log and interface logic.
4. The system according to claim 1, wherein the RPC call process is an http/https request and response process, and the communication modules of the client and the server are respectively encapsulated in the client and the server by means of an http/https protocol, and include a request code and a response code, so that the client and the server can directly call.
5. The modular data interface implementation system as claimed in claim 4, wherein the RPC call authorized for the user comprises the steps of:
A. The client calls an authorization request in the client communication module and transmits parameters including a user authorization token, component information and an interface information list; the component information is provided with an ip and a communication port of the interface component;
B. The client communication module assembles url of an http/https protocol according to the interface component ip, the communication port, the authorized call names agreed by the client and the server, and creates a post request by using the url; then serializing the user authorization token and the interface information list into json character strings, and putting the json character strings into a request body; encrypting the RPC communication key agreed by the client and the server once again, and putting the encrypted RPC communication key into a request head; finally, executing the post request to send a message through the network;
C. The server communication module authorizes, after receiving the post request, the server firstly verifies the communication key transmitted by the client acquired by the request head, and if the communication key is incorrect, the response request authorization fails; after the verification is passed, acquiring a user authorization token and a json character string of an interface information list from the request body, and deserializing the json character string into an authorization data object; finally, using the authorization data object as a parameter to create an authorization Handler object, and placing the authorization Handler object into a queue for calling;
D. The server side realizes the execution logic of the authorization Handler, caches the authorization data object and performs unified management; when a user requests an interface, the data are used for respectively requesting permission verification for different users and different interfaces; firstly, searching a cache by using a user authorization token, if a corresponding interface information list can be found, combining the new interface information list and the old interface information list into a new list, covering the new list into the cache, and if the new list cannot be found, directly using the user authorization token as an identifier, and writing the interface information list into the cache; returning a result to the server communication module;
E. The server communication module receives the returned result, assembles the result into a response message object, the necessary attribute of the response object comprises a returned code, returned information and returned data, sequences the response message object into json character strings, and then sends the response message to the client communication module;
F. The client communication module receives the json character string of the response message, deserializes the json character string into a response message object, and then respectively assembles a calling result according to the agreed response return code, and returns the result to the client.
6. The method for realizing the modular data interface is characterized by comprising the following steps:
the interface components are uniformly managed through the middle service, including load balancing, fault tolerance and routing;
Providing unified data interface service for a third party service system through an interface component;
Communication between the middle platform service and the interface component is realized in an RPC calling mode, wherein the RPC calling process is to encapsulate calling and encoding/decoding processes, and the middle platform service and the interface component realize a service end and a client end simultaneously; the server is responsible for realizing specific business logic by using a Rest API mode, and comprises registration, stopping, callback, authorization, heartbeat and log functions; the client is responsible for calling related business logic according to a Rest API mode, including registration call, stop call, callback call, authorization call, heartbeat call and log call;
the middle station service comprises the following steps:
the management module is used for maintaining service system management, component management, interface management and API related log data;
the communication module is used for maintaining communication between the middle station service and the interface component, providing access functions of authorization call, heartbeat call and log call, and the accessed functions of registration, stopping and callback;
The API module is an access interface opened to the third party service system and comprises interface authorization and an interface list; the interface list acquires a data interface list owned by a specified third party service system, and the interface authorizes the authorization operation of the specified third party service system and the data interface;
the component management of the management module in the middle service is used for providing a display interface and adding and editing functions, the added component data automatically generates a unique random machine code which can not be modified, and the actual component service is matched and registered with the component data by means of the random machine code; the interface management of the management module in the middle-stage service is used for providing a display interface, and the display interface is generated or updated when the interface component registers with the middle-stage service;
The service system management of the management module in the middle service provides a display interface, an adding function and an editing function, the added service system data automatically generates a group of account numbers and passwords corresponding to the added service system data, and the service system is used for authorization verification when the service system performs interface authorization; the service system management of the middle service management module also provides the association function of the service system and the interface;
The interface component provides a unified standard SDK, so that each service system develops the interface component of own service according to the standard, registers the interface component into the data interface cluster through the middle service, and provides the interface component for each service system.
7. The method of claim 6, wherein the RPC call process is an http/https request and response process, and the communication modules of the client and the server are respectively encapsulated in the client and the server by means of an http/https protocol, and include a request code and a response code, so that the client and the server can call directly.
8. The method of claim 7, wherein the step of invoking the RPC authorized by the user comprises:
A. The client calls an authorization request in the client communication module and transmits parameters including a user authorization token, component information and an interface information list; the component information is provided with an ip and a communication port of the interface component;
B. The client communication module assembles url of an http/https protocol according to the interface component ip, the communication port, the authorized call names agreed by the client and the server, and creates a post request by using the url; then serializing the user authorization token and the interface information list into json character strings, and putting the json character strings into a request body; encrypting the RPC communication key agreed by the client and the server once again, and putting the encrypted RPC communication key into a request head; finally, executing the post request to send a message through the network;
C. The server communication module authorizes, after receiving the post request, the server firstly verifies the communication key transmitted by the client acquired by the request head, and if the communication key is incorrect, the response request authorization fails; after the verification is passed, acquiring a user authorization token and a json character string of an interface information list from the request body, and deserializing the json character string into an authorization data object; finally, using the authorization data object as a parameter to create an authorization Handler object, and placing the authorization Handler object into a queue for calling;
D. The server side realizes the execution logic of the authorization Handler, caches the authorization data object and performs unified management; when a user requests an interface, the data are used for respectively requesting permission verification for different users and different interfaces; firstly, searching a cache by using a user authorization token, if a corresponding interface information list can be found, combining the new interface information list and the old interface information list into a new list, covering the new list into the cache, and if the new list cannot be found, directly using the user authorization token as an identifier, and writing the interface information list into the cache; returning a result to the server communication module;
E. The server communication module receives the returned result, assembles the result into a response message object, the necessary attribute of the response object comprises a returned code, returned information and returned data, sequences the response message object into json character strings, and then sends the response message to the client communication module;
F. The client communication module receives the json character string of the response message, deserializes the json character string into a response message object, and then respectively assembles a calling result according to the agreed response return code, and returns the result to the client.
CN202011583689.7A 2020-12-28 2020-12-28 Method and system for realizing component type data interface Active CN112612629B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011583689.7A CN112612629B (en) 2020-12-28 2020-12-28 Method and system for realizing component type data interface

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011583689.7A CN112612629B (en) 2020-12-28 2020-12-28 Method and system for realizing component type data interface

Publications (2)

Publication Number Publication Date
CN112612629A CN112612629A (en) 2021-04-06
CN112612629B true CN112612629B (en) 2024-05-24

Family

ID=75248385

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011583689.7A Active CN112612629B (en) 2020-12-28 2020-12-28 Method and system for realizing component type data interface

Country Status (1)

Country Link
CN (1) CN112612629B (en)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113485824A (en) * 2021-04-24 2021-10-08 中电长城网际系统应用广东有限公司 API (application programming interface) interface management method of integrated operation and maintenance platform
CN113419713A (en) * 2021-07-20 2021-09-21 国家电网有限公司客户服务中心 API packaging arrangement method for network national network service capability
CN113742615A (en) * 2021-09-13 2021-12-03 国泰君安证券股份有限公司 System, method and device for realizing dynamic data component application, processor and computer readable storage medium thereof
CN113535439B (en) * 2021-09-15 2021-12-28 北京奇虎科技有限公司 Service request processing method, device, equipment and storage medium
CN113923200A (en) * 2021-10-12 2022-01-11 上海中通吉网络技术有限公司 Method and device for realizing massive API gateway service
CN114338783A (en) * 2021-11-08 2022-04-12 浙江高信技术股份有限公司 API management platform based on technical middlebox and management method thereof
CN114567621B (en) * 2022-04-29 2022-07-12 成都瑞华康源科技有限公司 Client-side adaptive response content control system, method and storage medium
CN115396493A (en) * 2022-08-17 2022-11-25 融慧金科金融服务外包(北京)有限公司 Management system and method for distributed dynamic control API (application program interface) overtime response
CN115756399B (en) * 2022-09-27 2023-12-15 广州云徙科技有限公司 Scene type assembled middle-stage service integration method and system
CN116541441B (en) * 2023-05-22 2024-05-24 广西壮族自治区环境信息中心 Ecological environment middle platform system based on micro-service

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106155697A (en) * 2016-07-30 2016-11-23 北京慧摩尔科技有限公司 A kind of service-oriented Development Framework (YC Framework)
CN108650262A (en) * 2018-05-09 2018-10-12 聚龙股份有限公司 A kind of cloud platform extended method and system based on micro services framework
CN111181727A (en) * 2019-12-16 2020-05-19 北京航天智造科技发展有限公司 Open API full life cycle management method based on micro service
CN111865920A (en) * 2020-06-18 2020-10-30 多加网络科技(北京)有限公司 Gateway authentication and identity authentication platform and method thereof

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106155697A (en) * 2016-07-30 2016-11-23 北京慧摩尔科技有限公司 A kind of service-oriented Development Framework (YC Framework)
CN108650262A (en) * 2018-05-09 2018-10-12 聚龙股份有限公司 A kind of cloud platform extended method and system based on micro services framework
CN111181727A (en) * 2019-12-16 2020-05-19 北京航天智造科技发展有限公司 Open API full life cycle management method based on micro service
CN111865920A (en) * 2020-06-18 2020-10-30 多加网络科技(北京)有限公司 Gateway authentication and identity authentication platform and method thereof

Also Published As

Publication number Publication date
CN112612629A (en) 2021-04-06

Similar Documents

Publication Publication Date Title
CN112612629B (en) Method and system for realizing component type data interface
US10749856B2 (en) System and method for multi-tenant SSO with dynamic attribute retrieval
US8769650B2 (en) Establishing and maintaining an improved single sign-on (SSO) facility
US10484385B2 (en) Accessing an application through application clients and web browsers
US8955037B2 (en) Access management architecture
CN103209223B (en) distributed application session information sharing method, system and application server
US6665674B1 (en) Framework for open directory operation extensibility
US7984162B2 (en) Methods, systems, and software for providing service integration framework
CA3071430A1 (en) System and method for providing an interface for a blockchain cloud service
CN110765484B (en) Credit data processing method and electronic equipment
US8868786B1 (en) Apparatus, systems and methods for transformation services
CN107924411A (en) The recovery of UI states in transaction system
US20150215308A1 (en) Secure communication between processes in cloud
CN112788031B (en) Micro-service interface authentication system, method and device based on Envoy architecture
US8725857B2 (en) Dynamic query services and methods
US20050278384A1 (en) External authentication against a third-party directory
CN109379363B (en) A kind of single-sign-on integrated approach and system based on intensive platform
CN108881111B (en) Method and device for realizing multi-tenant system
CN109379336A (en) A kind of uniform authentication method, distributed system and computer readable storage medium
CN112149079A (en) Planning review management platform based on micro-service architecture and user access authorization method
CN112035822A (en) Multi-application single sign-on method, device, equipment and storage medium
US8356075B2 (en) Distributed business process management system with local resource utilization
CN109413040A (en) Message authentication method, equipment, system and computer readable storage medium
CN112559010B (en) Multi-application system data isolation implementation method and system based on micro-service
US11411812B2 (en) Dynamic service creation for microservice-based integration service

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