CN115174650B - Open service platform, service response method, device, equipment and storage medium - Google Patents

Open service platform, service response method, device, equipment and storage medium Download PDF

Info

Publication number
CN115174650B
CN115174650B CN202211081139.4A CN202211081139A CN115174650B CN 115174650 B CN115174650 B CN 115174650B CN 202211081139 A CN202211081139 A CN 202211081139A CN 115174650 B CN115174650 B CN 115174650B
Authority
CN
China
Prior art keywords
service
platform
interface
external
target
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
CN202211081139.4A
Other languages
Chinese (zh)
Other versions
CN115174650A (en
Inventor
曹世锋
饶维立
武志保
叶柳珍
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Lingzhu Technology Co ltd
Original Assignee
Shenzhen Lingzhu Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Lingzhu Technology Co ltd filed Critical Shenzhen Lingzhu Technology Co ltd
Priority to CN202211081139.4A priority Critical patent/CN115174650B/en
Publication of CN115174650A publication Critical patent/CN115174650A/en
Application granted granted Critical
Publication of CN115174650B publication Critical patent/CN115174650B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • H04L63/0807Network architectures or network communication protocols for network security for authentication of entities using tickets, e.g. Kerberos

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application relates to an open service platform, a service response method, a service response device, equipment and a storage medium. The open service platform includes: the system comprises an open platform gateway, a platform adaptation unit, an interface call service unit and a notification callback unit. The open platform gateway determines whether the first external platform is contained in an active session group list or not when receiving a first service calling request sent by the first external platform based on the target adaptation interface, determines a first service calling route in a targeted manner according to a judgment result, calls a first target service based on the first service calling route to respond to the first service calling request, and further informs the first external platform to disable a corresponding calling function when the first target service is removed. Under the close cooperation of the open platform gateway, the platform adaptation unit, the interface call service unit and the notification callback unit, the self-adaptive matching of an external platform is realized, and the use efficiency of the open platform is effectively improved.

Description

Open service platform, service response method, device, equipment and storage medium
Technical Field
The present application relates to the field of network technologies, and in particular, to an open service platform, a service response method, an apparatus, a computer device, and a storage medium.
Background
With the development of network technology, an open platform appears. The open platform opens the service resource to the third party platform by means of API (application program interface). The traditional open platform mainly comprises a service access platform, an API management platform, a background management platform and the like. However, the conventional open platform requires a third party platform to match the interface of the open platform, so that the use efficiency of the open platform is not high.
It is noted that the information disclosed in the above background section is only for enhancement of understanding of the background of the invention and therefore it may contain information that does not form the prior art that is already known to a person of ordinary skill in the art.
Disclosure of Invention
In view of the foregoing, it is desirable to provide an open service platform, a service response method, a service response apparatus, a computer device, and a storage medium, which can improve the utilization efficiency of the open platform.
An open service platform comprising: the system comprises an open platform gateway, a platform adaptation unit, an interface call service unit and a notification callback unit;
the platform adaptation unit is used for encapsulating the developed service interface according to the internal standard of the open interface and distributing the encapsulated target adaptation interface when the service interface of the first target service is determined to be developed; wherein the first target service is an independently integrated service matched with a first external platform; the target adaptation interface is adapted to an interface of the first external platform;
the open platform gateway is configured to:
when a first service call request sent by a first external platform is received through the target adaptation interface, acquiring a mapping relation between an external interface and an internal interface which are dynamically configured based on the integrated universal routing stream corresponding to micro-service registration discovery, and determining whether the first external platform is included in an active session group list based on the first service call request; the time difference value between the time of the last connection between the external platform and the open service platform contained in the active session group name list and the current time is less than a preset time threshold value;
when the first service call is contained in the active session group list, triggering the interface call service unit to determine a first service call route based on the mapping relation;
when the first external platform is not included in the active session group list, an external auxiliary authentication service unit is called to authenticate the first external platform, and after an authentication passing identifier sent by the auxiliary authentication service unit is received, the interface call service unit is triggered to determine a first service call route based on the mapping relation;
generating a first external docking message based on the first service call route to call the first target service in the platform adaptation unit, and outputting response information of the first target service to the first service call request to the first external platform through the target adaptation interface;
and the notification callback unit is used for generating a second external docking message based on the callback address of the first external platform when receiving the removal information of the first target service sent by the platform adaptation unit, and sending the second external docking message through the target adaptation interface so as to notify the first external platform of forbidding a calling function of the first target service.
In an optional embodiment, further comprising: a service unit;
the service unit is further configured to package the developed service interface according to an internal standard of the open interface and distribute a target external interface obtained by the package when it is determined that the development of the service interface of the second target service is completed;
the open platform gateway is further configured to, when a second service invocation request sent by a second external platform is received through the target external interface, trigger the interface call service unit to determine a second service invocation route based on the mapping relationship, generate a first internal message based on the second service invocation route, invoke the second target service in the service unit according to the first internal message, and output response information of the second target service to the second service invocation request to the second external interface through the target external interface;
and the notification callback unit is used for generating a second internal message based on the callback address of the second external platform when receiving the removal information of the second target service sent by the service unit, and sending the second internal message through the target external interface so as to notify the second external platform of forbidding a calling function of the second target service.
In an optional embodiment, the first target service comprises admin basic service and appenter application center service;
the open platform gateway is further configured to:
when the second service calling request is a request associated with user organization management and control, calling the admin basic service in the business service unit to respond to the second service calling request;
and when the second service calling request is a request associated with a service application, calling the appcore application center service in the service unit to respond to the second service calling request.
In an optional embodiment, the system further comprises a unified authentication unit;
the unified authentication unit is used for sending an APPKEY and an APPSECRET to a target external platform; the target external platform includes the first external platform and the second external platform;
the open platform gateway is further configured to:
when an authentication request sent by the target external platform is received through a uniform authentication interface, determining whether the authentication request carries APPKEY and APPSECRET; when determining to carry the APPKEY and the APPSECRET, judging that the authentication is passed; obtaining a pre-stored token from a redis, and returning the token to the target external platform, so that the target external platform carries the token when requesting the target adaptation interface or the target external interface;
when the first service call request sent by the first external platform is received through the target adaptation interface, determining whether the token is carried by the first service call request, and when the token is carried by the first service call request, executing a step of judging and responding to the first service call request;
when the second service calling request sent by the second external platform is received through the target external interface, determining whether the second service calling request carries the token, and when the token is carried, executing a judging response step of the second service calling request.
In an optional embodiment, the open platform gateway is further configured to:
when a target external platform sends a service calling request based on a URL (uniform resource locator), calling a sentinel component so that the sentinel component carries out access limitation on the URL of the target external platform when the service calling request is determined to exceed the preset bucket capacity; wherein the target external platform includes the first external platform and the second external platform.
A service response method is applied to an open platform gateway in an open service platform; the open service platform includes: the system comprises an open platform gateway, a platform adaptation unit, an interface call service unit and a notification callback unit;
the method comprises the following steps:
when a first service call request sent by a first external platform is received through a target adaptation interface, acquiring a mapping relation between an external interface and an internal interface which are dynamically configured based on an integrated universal routing stream corresponding to micro-service registration discovery, and determining whether the first external platform is included in an active session group list based on the first service call request; when the platform adaptation unit determines that the development of the business interface of the first target service is completed, the target adaptation interface encapsulates and issues the developed business interface according to the internal standard of the open interface; the first target service is an independently integrated service matched with a first external platform; the target adaptation interface is adapted to an interface of the first external platform; the time difference value between the time of the last connection between the external platform and the open service platform contained in the active session group name list and the current time is smaller than a preset time threshold value;
when the first service call is contained in the active session group list, triggering the interface call service unit to determine a first service call route based on the mapping relation;
when the first external platform is not included in the active session group list, an external auxiliary authentication service unit is called to authenticate the first external platform, and after an authentication passing identifier sent by the auxiliary authentication service unit is received, the interface call service unit is triggered to determine a first service call route based on the mapping relation;
generating a first external docking message based on the first service invocation route so as to invoke the first target service in the platform adaptation unit, and outputting response information of the first target service to the first service invocation request to the first external platform through the target adaptation interface;
when the removal information of the second target service sent by the service unit is received, the notification callback unit is triggered to generate a second external docking message based on the callback address of the first external platform, and the second external docking message is sent through the target adapter interface to notify the first external platform that the calling function of the first target service is forbidden.
In an optional embodiment, the open service platform further includes a service unit;
when a second service call request sent by a second external platform is received through a target external interface, triggering the interface call service unit to determine a second service call route based on the mapping relation, generating a first internal message based on the second service call route, calling the second target service in the service unit according to the first internal message, and outputting response information of the second target service to the second service call request to the second external interface through the target external interface; when the business service unit determines that the development of the business interface of the second target service is completed, the target external interface packages and releases the developed business interface based on the internal standard of the open interface;
and when receiving the removal information of the second target service sent by the service unit, triggering the notification callback unit to generate a second internal message based on the callback address of the second external platform, and sending the second internal message through the target external interface to notify the second external platform to disable the calling function of the second target service.
A service response device is applied to an open platform gateway in an open service platform; the open service platform includes: the system comprises an open platform gateway, a platform adaptation unit, an interface call service unit and a notification callback unit;
the device comprises:
the active list judging module is used for acquiring a mapping relation between an external interface and an internal interface which are dynamically configured based on integrated general routing streams corresponding to micro-service registration discovery when a first service calling request sent by a first external platform is received through a target adaptation interface, and determining whether the first external platform is contained in an active session group list or not based on the first service calling request; when the platform adaptation unit determines that the development of the business interface of the first target service is completed, the target adaptation interface encapsulates and issues the developed business interface according to the internal standard of the open interface; the first target service is an independently integrated service matched with a first external platform; the target adaptation interface is adapted to an interface of the first external platform; the time difference value between the time of the last connection between the external platform and the open service platform contained in the active session group name list and the current time is less than a preset time threshold value;
a first route determining module, configured to trigger the interface call service unit to determine a first service invocation route based on the mapping relationship when the first route determining module is included in the active session group list;
the second route determining module is used for calling an external auxiliary authentication service unit to authenticate the first external platform when the second route determining module is not included in the active session group list, and triggering the interface calling service unit to determine a first service calling route based on the mapping relation after receiving an authentication passing identifier sent by the auxiliary authentication service unit;
a request response module, configured to generate a first external docking message based on the first service invocation route, so as to invoke the first target service in the platform adaptation unit, and output response information of the first target service to the first service invocation request to the first external platform through the target adaptation interface;
and the message callback module is used for triggering the notification callback unit to generate a second external docking message based on the callback address of the first external platform when receiving the removal information of the second target service, which is sent by the service unit, and sending the second external docking message through the target adapter interface so as to notify the first external platform of forbidding a calling function of the first target service.
A computer device comprising a memory storing a computer program and a processor implementing the above-described service response method when the processor executes the computer program.
A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the above-mentioned service response method.
In the open service platform, the platform adaptation unit issues the target adaptation interface, when receiving a first service invocation request sent by a first external platform based on the target adaptation interface, the open platform gateway directly determines a first service invocation route if determining that the first external platform is included in the active session group list, authenticates by using the auxiliary authentication service unit if determining that the first external platform is not included in the active session group list, determines the first service invocation route after the authentication is passed, and then invokes the first target service based on the first service invocation route to respond to the first service invocation request, and further notifies the first external platform through the target adaptation interface when the first target service is removed, so that the first external platform disables the corresponding invocation function. Under the close cooperation of the open platform gateway, the platform adaptation unit, the interface call service unit and the notification callback unit, the self-adaptive matching of an external platform is realized, and the use efficiency of the open platform is effectively improved. Accordingly, the service response method, device, equipment and storage medium provided by the application also have the technical effects.
Drawings
FIG. 1 is a block diagram of an open services platform in one embodiment;
FIG. 2 is a block diagram of an open services platform in accordance with another embodiment;
FIG. 3 is a block diagram of an open services platform in accordance with yet another embodiment;
FIG. 4 is a flow diagram that illustrates a method for service response in one embodiment;
FIG. 5 is a block diagram showing the structure of a service response apparatus according to an embodiment;
FIG. 6 is a diagram illustrating an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
In an alternative embodiment, as shown in fig. 1, there is provided an open service platform, comprising: an open platform gateway 101, a platform adaptation unit 102, an interface call service unit 103, and a notification callback unit 104. The open platform gateway 101 is connected to the platform adaptation unit 102, the interface call service unit 103, and the notification callback unit 104, where the open platform gateway 101 may communicate with a first external platform, and the first external platform may call a service provided by the open service platform through communication with the open platform gateway 101. The open platform gateway may communicate with the platform adaptation unit via external docking messages and the open platform gateway may communicate with the interface call service unit and the notification callback unit via internal messages.
Alternatively, the external platform may also be referred to as a third-party system, and in a case that no specific description is given, the external platform in this embodiment includes a first external platform and a second external platform, that is, the corresponding embodiments may be applicable to both the first external platform and the second external platform.
Further, the first external platform may be a platform that cannot adapt to an interface provided by the open service platform, and the platform adaptation unit needs to convert the interface of the provided first target service to adapt to the first external platform. Furthermore, the number of the first external platforms can be multiple, and different first external platforms can have the platform adaptation units uniquely corresponding to the first external platforms, so that each external platform has the platform adaptation unit adapted to the first external platform.
Optionally, the open platform gateway provides an access port to the outside in a unified manner. The open platform gateway mainly completes the functions of authentication, routing and current limiting of the interface. Furthermore, each service develops its own service interface and encapsulates a set of development interfaces based on the internal standard of the open interface to provide services through the open platform gateway.
The platform adapting unit 102 is configured to, when it is determined that development of a service interface of a first target service is completed, encapsulate the developed service interface according to an internal standard of an open interface and distribute an encapsulated target adapting interface; wherein the first target service is an independently integrated service matched with a first external platform; the target adaptation interface is adapted to an interface of the first external platform.
Optionally, the platform adaptation unit is a unit opposite to the business service unit, similar to but distinct from the functions implemented by the business service unit. Similarly, both can service responses to call requests sent by the external platform. The difference is that the services in the platform adaptation unit are integrated independently, and the platform adaptation unit is mainly used for processing the special integration of some special external platforms, the special external platforms do not have development capability or have special requirements on the integration, the open service platform can develop the services for the external platforms, and the developed services are all placed in the platform adaptation unit; and the business service unit provides common services of the open service platform, namely, any external platform can realize the calling of the services in the business service unit. In some embodiments, the platform adaptation unit may also be referred to as an adaptation layer, or adapter.
Optionally, the open platform gateway may implement external communication in a rabbitmq manner. Further, the open platform gateway communicates with the platform adaptation unit in a rabbitmq manner, so that the platform adaptation unit communicates with the first external platform.
The open platform gateway 101 is configured to:
when a first service call request sent by a first external platform is received through the target adaptation interface, acquiring a mapping relation between an external interface and an internal interface which are dynamically configured based on a micro-service registration discovery corresponding integrated general routing stream, and determining whether the first external platform is included in an active session group list based on the first service call request; the time difference value between the time of the last connection between the external platform and the open service platform contained in the active session group name list and the current time is smaller than a preset time threshold value;
when the list is included in the active session group list, triggering the interface call service unit 103 to determine a first service call route based on the mapping relationship;
when the first external platform is not included in the active session group list, an external auxiliary authentication service unit is called to authenticate the first external platform, and after an authentication passing identifier sent by the auxiliary authentication service unit is received, the interface call service unit is triggered to determine a first service call route based on the mapping relation;
generating a first external docking message based on the first service call route to call the first target service in the platform adaptation unit, and outputting response information of the first target service to the first service call request to the first external platform through the target adaptation interface;
optionally, the micro service registration is accessed to discover the integrated universal route circulation, so that the mapping relationship from the external interface to the internal interface can be dynamically configured, and the problem of externally integrating the uniform URL path is solved.
Optionally, the active session group name list includes an external platform currently in an active state, that is, an external platform whose time to reserve the connection with the open service platform is short, where the connection may be a network connection or a network communication connection (that is, a session procedure exists between the external platform and the open service platform). By the method, the external platforms which are not communicated with the open service platform for a long time can be removed through the active session group list, and the external platforms in the active session group list can directly call the service, so that the external platforms can realize quick service calling, the authentication time of the open service platform to the external platforms is shortened, and the use efficiency of the open service platform is improved.
Optionally, when receiving the first service invocation request, the open platform gateway authenticates the first service invocation request, and if the authentication is passed, determines whether current flow limitation needs to be performed on the first service invocation request, and if the current flow limitation is not performed, determines the first service invocation route, so as to implement invocation of the service based on the first service invocation route. When service calling is carried out, the header of the calling instruction carries the apid (first external platform number), secret (secret key), domain and the like, and the platform adaptation unit generates service response information corresponding to the apid after determining that secret verification and domain pass the requirement, and returns to the non-first external platform through the target adaptation interface.
Optionally, as shown in fig. 2, the first external platform may send the first service invocation request by means of http call. And the open platform gateway can perform service response to the first external platform in an http callback mode or needs to send a callback message.
Optionally, when there are a large number of external platforms connected, the call request of the external platform may be received in a highly concurrent manner. Furthermore, high concurrency processing of the call request can be realized based on the golang, and the problem of high concurrency performance of the gateway is solved.
The notification callback unit 104 is configured to, when receiving the removal information of the first target service sent by the platform adaptation unit, generate a second external docking message based on the callback address of the first external platform, and send the second external docking message through the target adaptation interface, so as to notify the first external platform that the function of calling the first target service is disabled.
Optionally, the second external docking message is sent concurrently through the target adaptation interface to notify each connected external platform of disabling the function of calling the first target service. Further, when the number of connected external platforms is large, an external docking message may be transmitted to the external platforms in a highly concurrent manner. Further, high concurrency of information transmission can be achieved based on golang.
Optionally, the first targeted service removal may be considered a data change. The first external platform may also be notified in the same manner when other data changes occur. These other data changes may include: user information modification, department information modification, organization modification, application subscription, authority role modification and the like.
Optionally, the notification callback unit may send the second external docking message in a rabbitmq manner.
Further, after the basic data of the service system changes, in order to notify the external platform, the service unit notifies the changed message to the message queue, the message queue notifies the open platform gateway, and then the external platform is called to implement the callback processing of the data change. Optionally, after receiving the data change message, the external platform may modify its service call information, and stop requesting services from the open service platform.
In the open service platform, a platform adaptation unit issues a target adaptation interface, when receiving a first service invocation request sent by a first external platform based on the target adaptation interface, if the first external platform is determined to be included in an active session group list, an open platform gateway directly determines a first service invocation route, if the first external platform is determined not to be included in the active session group list, the first external platform is authenticated by an auxiliary authentication service unit, after the authentication is passed, the first service invocation route is determined, then a first target service is invoked based on the first service invocation route to respond to the first service invocation request, and further, when the first target service is removed, the first external platform is notified through the target adaptation interface so that the first external platform disables a corresponding invocation function. Under the close cooperation of the open platform gateway, the platform adaptation unit, the interface call service unit and the notification callback unit, the self-adaptive matching of an external platform is realized, and the use efficiency of the open platform is effectively improved.
In an alternative embodiment, as shown in fig. 3, the open service platform further includes: a service unit; the service unit is further configured to package the developed service interface according to an internal standard of the open interface and distribute a target external interface obtained by the package when it is determined that the development of the service interface of the second target service is completed; the open platform gateway is further configured to, when a second service invocation request sent by a second external platform is received through the target external interface, trigger the interface call service unit to determine a second service invocation route based on the mapping relationship, generate a first internal message based on the second service invocation route, invoke the second target service in the service unit according to the first internal message, and output response information of the second target service to the second service invocation request to the second external interface through the target external interface; and the notification callback unit is used for generating a second internal message based on the callback address of the second external platform when receiving the removal information of the second target service sent by the service unit, and sending the second internal message through the target external interface so as to notify the second external platform of forbidding a calling function of the second target service.
Alternatively, the second external platform may be a platform that can be adapted to an interface provided by the open service platform, different from the first external platform.
Optionally, after the open service platform completes development of the common service, the service unit implements response processing on service invocation.
Optionally, the second targeted service removal may be considered a data change. The second external platform may also be notified in the same manner when other data changes occur. These other data changes may include: user information modification, department information modification, organization modification, application subscription, authority role modification and the like. Further, as shown in fig. 2, when the data change occurs, the service unit sends a notification to the open platform gateway through an internal message nat, so that the open platform gateway calls back the second external platform.
It should be noted that, when processing the call request, except for the different implementation manners described above, other functions implemented by the service unit are consistent with those of the platform adaptation unit, and may be referred to each other, which is not described herein again.
In the above embodiment, through the cooperation of the service unit, the open platform gateway, and the target external interface, a quick and accurate response to the service invocation request sent by the second external platform is realized, and the use efficiency of the open platform is ensured.
In an optional embodiment, the open service platform further includes basic open platform interfaces, which are implemented in each basic service inside the open service platform, for example, a user interface, an organization interface, a role interface are in the basic service, and an application subscription interface is in the application center service. In addition, the open service platform responds to the first external platform and the second external platform in different modes, so that ordered management of services can be realized, quick calling of the external platforms can be guaranteed, and the service efficiency of the open service platform is guaranteed.
Further, the first target service comprises admin basic service and appcore application center service; the open platform gateway is further configured to: when the second service calling request is a request associated with user organization management and control, calling the admin basic service in the business service unit to respond to the second service calling request; and when the second service calling request is a request associated with a service application, calling the appcore application center service in the service unit to respond to the second service calling request.
In an optional embodiment, the system further comprises a unified authentication unit; the unified authentication unit is used for sending an APPKEY and an APPSECRET to a target external platform; the target external platform includes the first external platform and the second external platform; the open platform gateway is further configured to: when an authentication request sent by the target external platform is received through a uniform authentication interface, determining whether the authentication request carries APPKEY and APPSECRET; when determining to carry the APPKEY and the APPSECRET, judging that the authentication is passed; obtaining a pre-stored token from a redis, and returning the token to the target external platform, so that the target external platform carries the token when requesting the target adaptation interface or the target external interface; when the first service invocation request sent by the first external platform is received through the target adaptation interface, determining whether the first service invocation request carries the token, and when the token is carried, executing a judgment response step of the first service invocation request; when the second service calling request sent by the second external platform is received through the target external interface, determining whether the second service calling request carries the token, and when the token is carried, executing a judging response step of the second service calling request.
In the embodiment, the user-defined token processing mechanism is adopted, the external authentication strategy is unified, and the safety of the external interface is ensured.
In an optional embodiment, the open platform gateway is further configured to: when a target external platform sends a service calling request based on a URL (uniform resource locator), calling a sentinel component so that the sentinel component carries out access limitation on the URL of the target external platform when the service calling request is determined to exceed the preset bucket capacity; wherein the target external platform includes the first external platform and the second external platform.
Optionally, an open-source sentinel component may be used to implement IP current limiting. IP throttling uses a funnel algorithm. The funnel rules are set according to different URLs, specifying the capacity of the bucket over a period of time to throttle QPS (query per second). The processing speed of the open service platform can be ensured.
Based on the same idea as the open service platform in the above embodiment, the present invention also provides a service response method. As shown in fig. 4, a service response method is provided, and this embodiment is illustrated by applying the method to a server, it is to be understood that the method may also be applied to a terminal, and may also be applied to a system including the terminal and the server, and is implemented through interaction between the terminal and the server. The terminal can be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers and portable wearable devices, and the server can be implemented by an independent server or a server cluster consisting of a plurality of servers.
The service response method provided by this embodiment is applied to an open platform gateway in an open service platform; the open service platform includes: the system comprises an open platform gateway, a platform adaptation unit, an interface call service unit and a notification callback unit;
the method comprises the following steps:
s401, when a first service call request sent by a first external platform is received through a target adaptation interface, acquiring a mapping relation between an external interface and an internal interface which are dynamically configured based on a micro-service registration discovery corresponding integrated general routing stream, and determining whether the first external platform is included in an active session group list based on the first service call request; when the platform adaptation unit determines that the development of the business interface of the first target service is completed, the target adaptation interface encapsulates and issues the developed business interface according to the internal standard of the open interface; the first target service is an independently integrated service matched with a first external platform; the target adaptation interface is adapted to an interface of the first external platform; the time difference value between the time of the last connection between the external platform and the open service platform contained in the active session group name list and the current time is smaller than a preset time threshold value;
s402, when the session is included in the active session group list, triggering the interface call service unit to determine a first service call route based on the mapping relation;
s403, when the first external platform is not included in the active session group list, an external auxiliary authentication service unit is called to authenticate the first external platform, and after an authentication passing identifier sent by the auxiliary authentication service unit is received, the interface call service unit is triggered to determine a first service call route based on the mapping relation;
s404, generating a first external docking message based on the first service call route so as to call the first target service in the platform adaptation unit, and outputting response information of the first target service to the first service call request to the first external platform through the target adaptation interface;
s405, when the removal information of the second target service sent by the service unit is received, triggering the notification callback unit to generate a second external docking message based on the callback address of the first external platform, and sending the second external docking message through the target adaptation interface to notify the first external platform to disable the calling function of the first target service.
In the service response method, the platform adaptation unit issues the target adaptation interface, the open platform gateway directly determines the first service invocation route if determining that the first external platform is included in the active session group list when receiving the first service invocation request sent by the first external platform based on the target adaptation interface, authenticates by the auxiliary authentication service unit if determining that the first external platform is not included in the active session group list, determines the first service invocation route after the authentication is passed, and then invokes the first target service based on the first service invocation route to respond to the first service invocation request, and further notifies the first external platform through the target adaptation interface when the first target service is removed, so that the first external platform disables the corresponding invocation function. Under the close cooperation of the open platform gateway, the platform adaptation unit, the interface call service unit and the notification callback unit, the self-adaptive matching of an external platform is realized, and the use efficiency of the open platform is effectively improved.
In an optional embodiment, the open service platform further includes a business service unit;
when a second service call request sent by a second external platform is received through a target external interface, triggering the interface call service unit to determine a second service call route based on the mapping relation, generating a first internal message based on the second service call route, calling a second target service in the service unit according to the first internal message, and outputting response information of the second target service to the second service call request to the second external interface through the target external interface; when the business service unit determines that the development of the business interface of the second target service is completed, the target external interface packages and releases the developed business interface based on the internal standard of the open interface;
and when receiving the removal information of the second target service sent by the service unit, triggering the notification callback unit to generate a second internal message based on the callback address of the second external platform, and sending the second internal message through the target external interface to notify the second external platform to disable the calling function of the second target service.
For specific definition of the service response method, see the above definition of the open service platform, which is not described herein again. It should be understood that, although the steps in the above-described flowcharts are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a part of the steps in the above flowcharts may include multiple steps or multiple stages, which are not necessarily performed at a uniform time, but may be performed at different times, and the order of performing the steps or stages is not necessarily sequential, but may be performed alternately or alternately with other steps or at least a part of the steps or stages in other steps.
Based on the same idea as the service response method in the above-described embodiment, the present invention also provides a service response apparatus that can be used to execute the above-described service response method. For convenience of explanation, the structure of the embodiment of the service response device is only shown in the schematic diagram, and those skilled in the art will understand that the illustrated structure does not limit the device, and may include more or less components than those illustrated, or combine some components, or arrange different components.
In one embodiment, as shown in fig. 5, a service response apparatus 500 is provided, which may be a part of a computer device using a software module or a hardware module, or a combination of the two, and is applied to an open platform gateway in an open service platform; the open service platform includes: the system comprises an open platform gateway, a platform adaptation unit, an interface call service unit and a notification callback unit;
the device comprises:
an active list determining module 501, configured to, when a first service invocation request sent by a first external platform is received through a target adaptation interface, obtain a mapping relationship between an external interface and an internal interface that are dynamically configured based on a micro-service registration discovery corresponding integrated generic routing stream, and determine, based on the first service invocation request, whether the first external platform is included in an active session group list; when the platform adaptation unit determines that the development of the business interface of the first target service is completed, the target adaptation interface encapsulates and issues the developed business interface according to the internal standard of the open interface; the first target service is an independently integrated service matched with a first external platform; the target adaptation interface is adapted to an interface of the first external platform; the time difference value between the time of the last connection between the external platform and the open service platform contained in the active session group name list and the current time is smaller than a preset time threshold value;
a first route determining module 502, configured to trigger the interface call service unit to determine, based on the mapping relationship, a first service invocation route when the first route is included in the active session group list;
a second route determining module 503, configured to, when the second route is not included in the active session group list, invoke an external auxiliary authentication service unit to authenticate the first external platform, and after receiving an authentication pass identifier sent by the auxiliary authentication service unit, trigger the interface call service unit to determine, based on the mapping relationship, a first service invocation route;
a request response module 504, configured to generate a first external docking message based on the first service invocation route, so as to invoke the first target service in the platform adaptation unit, and output response information of the first target service to the first service invocation request to the first external platform through the target adaptation interface;
a message callback module 505, configured to, when receiving removal information of the second target service sent by the service unit, trigger the notification callback unit to generate a second external docking message based on the callback address of the first external platform, and send the second external docking message through the target adapter interface, so as to notify the first external platform that a call function for the first target service is disabled.
In the service response device, the platform adaptation unit issues a target adaptation interface, the open platform gateway directly determines a first service invocation route if determining that the first external platform is included in an active session group list when receiving a first service invocation request sent by a first external platform based on the target adaptation interface, authenticates by using the auxiliary authentication service unit if determining that the first external platform is not included in the active session group list, determines the first service invocation route after the authentication is passed, invokes a first target service based on the first service invocation route to respond to the first service invocation request, and further notifies the first external platform through the target adaptation interface when the first target service is removed, so that the first external platform disables a corresponding invocation function. Under the close cooperation of the open platform gateway, the platform adaptation unit, the interface call service unit and the notification callback unit, the self-adaptive matching of an external platform is realized, and the use efficiency of the open platform is effectively improved.
In an optional embodiment, the open service platform further includes a service unit; the device further comprises:
a request receiving module, configured to, when a second service call request sent by a second external platform is received through a target external interface, trigger the interface call service unit to determine a second service call route based on the mapping relationship, generate a first internal message based on the second service call route, call the second target service in the service unit according to the first internal message, and output response information of the second target service to the second service call request to the second external interface through the target external interface; when the business service unit determines that the development of the business interface of the second target service is completed, the target external interface packages and releases the developed business interface based on the internal standard of the open interface;
and the callback module is used for triggering the notification callback unit to generate a second internal message based on a callback address of the second external platform when receiving the removal information of the second target service, which is sent by the service unit, and sending the second internal message through the target external interface so as to notify the second external platform to disable the calling function of the second target service.
For specific limitations of the service response device, reference may be made to the above limitations for the request response, which are not described herein again. The modules in the service response device can be wholly or partially implemented by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a server, and the internal structure thereof may be as shown in fig. 6. The computer device includes a processor, a memory, and a network interface connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operating system and the computer program to run on the non-volatile storage medium. The database of the computer device is used for storing data. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a service response method.
It will be appreciated by those skilled in the art that the configuration shown in fig. 6 is a block diagram of only a portion of the configuration associated with the present application, and is not intended to limit the computing device to which the present application may be applied, and that a particular computing device may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is further provided, which includes a memory and a processor, the memory stores a computer program, and the processor implements the steps of the above method embodiments when executing the computer program.
In an embodiment, a computer-readable storage medium is provided, in which a computer program is stored which, when being executed by a processor, carries out the steps of the above-mentioned method embodiments.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database or other medium used in the embodiments provided herein can include at least one of non-volatile and volatile memory. Non-volatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, or the like. Volatile Memory can include Random Access Memory (RAM) or external cache Memory. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), for example.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, and these are all within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. An open service platform, comprising: the system comprises an open platform gateway, a platform adaptation unit, an interface call service unit and a notification callback unit;
the platform adaptation unit is used for encapsulating the developed service interface according to the internal standard of the open interface and distributing the encapsulated target adaptation interface when the service interface of the first target service is determined to be developed; wherein the first target service is an independently integrated service matched with a first external platform; the target adaptation interface is adapted to an interface of the first external platform;
the open platform gateway is configured to:
when a first service call request sent by a first external platform is received through the target adaptation interface, acquiring a mapping relation between an external interface and an internal interface which are dynamically configured based on a micro-service registration discovery corresponding integrated general routing stream, and determining whether the first external platform is included in an active session group list based on the first service call request; the time difference value between the time of the last connection between the external platform and the open service platform contained in the active session group name list and the current time is less than a preset time threshold value;
when the session is included in the active session group list, triggering the interface call service unit to determine a first service call route based on the mapping relation;
when the first external platform is not included in the active session group list, an external auxiliary authentication service unit is called to authenticate the first external platform, and after an authentication passing identifier sent by the auxiliary authentication service unit is received, the interface call service unit is triggered to determine a first service call route based on the mapping relation;
generating a first external docking message based on the first service call route to call the first target service in the platform adaptation unit, and outputting response information of the first target service to the first service call request to the first external platform through the target adaptation interface;
and the notification callback unit is used for generating a second external docking message based on the callback address of the first external platform when receiving the removal information of the first target service sent by the platform adaptation unit, and sending the second external docking message through the target adaptation interface so as to notify the first external platform of forbidding a calling function of the first target service.
2. The open service platform of claim 1, further comprising: a service unit;
the service unit is further configured to package the developed service interface according to an internal standard of the open interface and distribute a target external interface obtained by the package when it is determined that the development of the service interface of the second target service is completed;
the open platform gateway is further configured to, when a second service invocation request sent by a second external platform is received through the target external interface, trigger the interface call service unit to determine a second service invocation route based on the mapping relationship, generate a first internal message based on the second service invocation route, invoke the second target service in the service unit according to the first internal message, and output response information of the second target service to the second service invocation request to the second external platform through the target external interface;
and the notification callback unit is used for generating a second internal message based on the callback address of the second external platform when receiving the removal information of the second target service sent by the service unit, and sending the second internal message through the target external interface so as to notify the second external platform of forbidding a calling function of the second target service.
3. The open service platform of claim 2, wherein the first target service comprises an admin base service and an appcore application center service;
the open platform gateway is further configured to:
when the second service calling request is a request associated with user organization management and control, calling the admin basic service in the business service unit to respond to the second service calling request;
and when the second service calling request is a request associated with a service application, calling the appcore application center service in the service unit to respond to the second service calling request.
4. The open service platform of claim 2, further comprising a unified authentication unit;
the unified authentication unit is used for sending APPKEY and APPSECRET to the target external platform; the target external platform includes the first external platform and the second external platform;
the open platform gateway is further configured to:
when an authentication request sent by the target external platform is received through a uniform authentication interface, determining whether the authentication request carries APPKEY and APPSECRET; when determining to carry the APPKEY and the APPSECRET, judging that the authentication is passed; obtaining a pre-stored token from a redis, and returning the token to the target external platform, so that the target external platform carries the token when requesting the target adaptation interface or the target external interface;
when the first service call request sent by the first external platform is received through the target adaptation interface, determining whether the token is carried by the first service call request, and when the token is carried by the first service call request, executing a step of judging and responding to the first service call request;
when the second service calling request sent by the second external platform is received through the target external interface, determining whether the second service calling request carries the token, and when the token is carried, executing a judging response step of the second service calling request.
5. The open service platform of claim 2, wherein the open platform gateway is further configured to:
when a target external platform sends a service calling request based on a URL (uniform resource locator), calling a sentinel component so that the sentinel component carries out access limitation on the URL of the target external platform when the service calling request is determined to exceed the preset bucket capacity; wherein the target external platform includes the first external platform and the second external platform.
6. A service response method is characterized in that the method is applied to an open platform gateway in an open service platform; the open service platform includes: the system comprises an open platform gateway, a platform adaptation unit, an interface call service unit and a notification callback unit;
the method comprises the following steps:
when a first service call request sent by a first external platform is received through a target adaptation interface, acquiring a mapping relation between an external interface and an internal interface which are dynamically configured based on a micro-service registration discovery corresponding integrated universal routing stream, and determining whether the first external platform is included in an active session group list based on the first service call request; when the platform adaptation unit determines that the development of the business interface of the first target service is completed, the target adaptation interface encapsulates and issues the developed business interface according to the internal standard of the open interface; the first target service is an independently integrated service matched with a first external platform; the target adaptation interface is adapted to an interface of the first external platform; the time difference value between the time of the last connection between the external platform and the open service platform contained in the active session group name list and the current time is less than a preset time threshold value;
when the first service call is contained in the active session group list, triggering the interface call service unit to determine a first service call route based on the mapping relation;
when the first external platform is not included in the active session group list, an external auxiliary authentication service unit is called to authenticate the first external platform, and after an authentication passing identifier sent by the auxiliary authentication service unit is received, the interface call service unit is triggered to determine a first service call route based on the mapping relation;
generating a first external docking message based on the first service call route to call the first target service in the platform adaptation unit, and outputting response information of the first target service to the first service call request to the first external platform through the target adaptation interface;
when the removal information of the first target service sent by the platform adaptation unit is received, the notification callback unit is triggered to generate a second external docking message based on the callback address of the first external platform, and the second external docking message is sent through the target adaptation interface to notify the first external platform that the calling function of the first target service is forbidden.
7. The method of claim 6, wherein the open service platform further comprises a business service unit;
when a second service call request sent by a second external platform is received through a target external interface, triggering the interface call service unit to determine a second service call route based on the mapping relation, generating a first internal message based on the second service call route, calling a second target service in the service unit according to the first internal message, and outputting response information of the second target service to the second service call request to the second external platform through the target external interface; when the business service unit determines that the development of the business interface of the second target service is completed, the target external interface packages and releases the developed business interface based on the internal standard of the open interface;
and when receiving the removal information of the second target service sent by the service unit, triggering the notification callback unit to generate a second internal message based on the callback address of the second external platform, and sending the second internal message through the target external interface to notify the second external platform to disable the calling function of the second target service.
8. The service response device is characterized by being applied to an open platform gateway in an open service platform; the open service platform includes: the system comprises an open platform gateway, a platform adaptation unit, an interface call service unit and a notification callback unit;
the device comprises:
the active list judging module is used for acquiring a mapping relation between an external interface and an internal interface which are dynamically configured based on integrated general routing streams corresponding to micro-service registration discovery when a first service calling request sent by a first external platform is received through a target adaptation interface, and determining whether the first external platform is contained in an active session group list or not based on the first service calling request; when the platform adaptation unit determines that the development of the business interface of the first target service is completed, the target adaptation interface encapsulates and issues the developed business interface according to the internal standard of the open interface; the first target service is an independently integrated service matched with a first external platform; the target adaptation interface is adapted to an interface of the first external platform; the time difference value between the time of the last connection between the external platform and the open service platform contained in the active session group name list and the current time is less than a preset time threshold value;
a first route determining module, configured to trigger the interface call service unit to determine a first service invocation route based on the mapping relationship when the first route determining module is included in the active session group list;
the second route determining module is used for calling an external auxiliary authentication service unit to authenticate the first external platform when the second route determining module is not included in the active session group list, and triggering the interface calling service unit to determine a first service calling route based on the mapping relation after receiving an authentication passing identifier sent by the auxiliary authentication service unit;
a request response module, configured to generate a first external docking message based on the first service invocation route, so as to invoke the first target service in the platform adaptation unit, and output response information of the first target service to the first service invocation request to the first external platform through the target adaptation interface;
and the message callback module is used for triggering the notification callback unit to generate a second external docking message based on the callback address of the first external platform when receiving the removal information of the first target service, which is sent by the platform adaptation unit, and sending the second external docking message through the target adaptation interface so as to notify the first external platform of forbidding a calling function of the first target service.
9. A computer device comprising a memory and a processor, the memory storing a computer program, wherein the processor implements the steps of the method of claim 6 or 7 when executing the computer program.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method as claimed in claim 6 or 7.
CN202211081139.4A 2022-09-06 2022-09-06 Open service platform, service response method, device, equipment and storage medium Active CN115174650B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211081139.4A CN115174650B (en) 2022-09-06 2022-09-06 Open service platform, service response method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211081139.4A CN115174650B (en) 2022-09-06 2022-09-06 Open service platform, service response method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN115174650A CN115174650A (en) 2022-10-11
CN115174650B true CN115174650B (en) 2022-12-06

Family

ID=83481283

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211081139.4A Active CN115174650B (en) 2022-09-06 2022-09-06 Open service platform, service response method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115174650B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110365751A (en) * 2019-06-26 2019-10-22 口碑(上海)信息技术有限公司 Method for processing business, device and the equipment of gateway system
CN111131416A (en) * 2019-12-12 2020-05-08 京东数字科技控股有限公司 Business service providing method and device, storage medium and electronic device
CN111212142A (en) * 2020-01-03 2020-05-29 北京辰森世纪科技股份有限公司 Service processing method, integrated open docking platform and computer storage medium
CN113377369A (en) * 2021-05-17 2021-09-10 广州有信科技有限公司 Universal method and device for interfacing third-party service system and terminal equipment

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20150103220A (en) * 2012-12-31 2015-09-09 후아웨이 테크놀러지 컴퍼니 리미티드 System architecture, subsystem, and method for opening of telecommunication network capability
CN107995603A (en) * 2016-10-27 2018-05-04 中兴通讯股份有限公司 A kind of ability open implementation method and device
WO2020159089A2 (en) * 2019-02-01 2020-08-06 비씨카드(주) Interface management system and method for supporting communication between plurality of devices

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110365751A (en) * 2019-06-26 2019-10-22 口碑(上海)信息技术有限公司 Method for processing business, device and the equipment of gateway system
CN111131416A (en) * 2019-12-12 2020-05-08 京东数字科技控股有限公司 Business service providing method and device, storage medium and electronic device
CN111212142A (en) * 2020-01-03 2020-05-29 北京辰森世纪科技股份有限公司 Service processing method, integrated open docking platform and computer storage medium
CN113377369A (en) * 2021-05-17 2021-09-10 广州有信科技有限公司 Universal method and device for interfacing third-party service system and terminal equipment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
面向移动互联网的业务能力开放平台设计与应用;胡尼亚等;《信息通信技术》;20130815(第04期);全文 *

Also Published As

Publication number Publication date
CN115174650A (en) 2022-10-11

Similar Documents

Publication Publication Date Title
US11146569B1 (en) Escalation-resistant secure network services using request-scoped authentication information
WO2021115449A1 (en) Cross-domain access system, method and device, storage medium, and electronic device
CN108200146B (en) Method for realizing lightweight microservice architecture
US8584231B2 (en) Service opening method and system, and service opening server
WO2020264431A1 (en) Connection pooling for scalable network services
US9648052B2 (en) Real-time communications gateway
EP4189541A1 (en) Cross cloud workload identity virtualization
EA012640B1 (en) Arrangement for using erp-system on, preferably, mobile devices
KR102080230B1 (en) System and method for multiway call processing of rest api service
CN112953745B (en) Service calling method, system, computer device and storage medium
US20230239326A1 (en) Microservice-Based Service Mesh System and Service Oriented Architecture Governance Method
Fysarakis et al. Policy-based access control for DPWS-enabled ubiquitous devices
CN114679274A (en) Cross-subnet interactive permission control method and device, electronic equipment and storage medium
CN114338682A (en) Flow identity mark transmission method and device, electronic equipment and storage medium
CN115174650B (en) Open service platform, service response method, device, equipment and storage medium
US9374391B2 (en) Composite endpoint mechanism
CN115296866B (en) Access method and device for edge node
KR20100060130A (en) System for protecting private information and method thereof
CN115348082A (en) Data desensitization method and device, computer equipment and storage medium
CN115550468A (en) Service request processing method, device, equipment and medium
CN112165529A (en) Method, device, equipment and medium for low-cost cross-network data exchange
US11470048B1 (en) Virtual private network environments for serverless code executions
KR100492381B1 (en) Security services for wireless devices
CN112153109B (en) Method, device, computer equipment and storage medium for establishing communication connection
CN114584398B (en) Charging management method and system

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