CN110995756A - Method and device for calling service - Google Patents

Method and device for calling service Download PDF

Info

Publication number
CN110995756A
CN110995756A CN201911323188.2A CN201911323188A CN110995756A CN 110995756 A CN110995756 A CN 110995756A CN 201911323188 A CN201911323188 A CN 201911323188A CN 110995756 A CN110995756 A CN 110995756A
Authority
CN
China
Prior art keywords
service
calling
interface
identifier
target interface
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.)
Granted
Application number
CN201911323188.2A
Other languages
Chinese (zh)
Other versions
CN110995756B (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.)
Guangzhou Kugou Computer Technology Co Ltd
Original Assignee
Guangzhou Kugou Computer 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 Guangzhou Kugou Computer Technology Co Ltd filed Critical Guangzhou Kugou Computer Technology Co Ltd
Priority to CN201911323188.2A priority Critical patent/CN110995756B/en
Publication of CN110995756A publication Critical patent/CN110995756A/en
Application granted granted Critical
Publication of CN110995756B publication Critical patent/CN110995756B/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
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/133Protocols for remote procedure calls [RPC]

Landscapes

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

Abstract

The disclosure provides a method and a device for calling a service, and belongs to the technical field of computers. The method comprises the following steps: when a first service calls an interface corresponding to a target interface identifier of a second service, a service management device receives an acquisition request of calling configuration information sent by the first service, wherein the acquisition request carries the target interface identifier of the second service, judges whether an interface to which the target interface identifier of the second service belongs can be called by the first service, and sends the calling configuration information corresponding to the target interface identifier of the second service to the first service under the condition that the interface to which the target interface identifier of the second service belongs can be called by the first service, so that the first service sends the calling request to the second service based on the calling configuration information. By adopting the method and the device, the efficiency of service calling can be improved.

Description

Method and device for calling service
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method and an apparatus for invoking a service.
Background
Currently, in a system, services and services need to be invoked, such as an account service invoking a payment service, and the like. The service and the reason why the service can be called are as follows: assuming that the service A calls the service B, in the development stage of the service A and the service B, the developer of the service B informs the developer of the service A, and the signature encryption algorithm of the call request is sent when the service A calls the service B. The developer of the service a configures a signature encryption algorithm or the like of a call request for calling the service B in the service a. Therefore, when the subsequent service A calls the service B, the call request is sent to the service B based on the signature encryption algorithm of the call request, and the call of the service A to the service B is realized.
Thus, the service B may be called by multiple services, and the developer of the service B needs to inform the multiple developers who call the service B of the signature encryption algorithm of the call request, which results in low efficiency of service call.
Disclosure of Invention
In order to solve the problems in the prior art, embodiments of the present disclosure provide a method and apparatus for invoking a service, a computer device, and a storage medium. The technical scheme is as follows:
in a first aspect, a method for calling a service is provided, and is applied to a service management device, where the method includes:
receiving an acquisition request for calling configuration information sent by a first service, wherein the acquisition request carries a target interface identifier of a second service;
judging whether an interface to which a target interface identifier of the second service belongs can be called by the first service;
and under the condition that the interface to which the target interface identifier of the second service belongs can be called by the first service, sending calling configuration information corresponding to the target interface identifier of the second service to the first service, so that the first service sends a calling request to the second service based on the calling configuration information, wherein the calling configuration information comprises a signature encryption algorithm.
In a possible implementation manner, the receiving an acquisition request for invoking configuration information sent by a first service includes:
and receiving an acquisition request of the calling configuration information, which is sent by the first service when the calling configuration information is not stored.
In one possible implementation, the method further includes:
receiving a first service registration request sent by the first service, wherein the first service registration request carries a name of the first service;
sending, to the first service, an identification and a first key assigned for the first service;
receiving a first interface registration request sent by a first service, wherein the first interface registration request is encrypted by using the first key, the first interface registration request comprises an identifier of the first service and first calling information corresponding to an interface for other services to call in the first service, the first calling information comprises calling configuration information and service information, and the service information is information capable of calling the service of the interface in the first service;
and correspondingly storing the first calling information and the identification of the first service.
In one possible implementation, the method further includes:
receiving a second service registration request sent by the second service, wherein the second service registration request carries a name of the second service;
sending, to the second service, an identification and a second key assigned for the second service;
receiving a second interface registration request sent by a second service, wherein the second interface registration request is encrypted by using the second key, the second interface registration request comprises an identifier of the second service and second calling information corresponding to an interface for other services to call in the second service, the second calling information comprises calling configuration information and service information, and the service information is information capable of calling the service of the interface in the second service;
and correspondingly storing the second calling information and the identifier of the second service.
In one possible implementation, the method further includes:
when detecting that second calling information corresponding to an interface to which a target interface identifier of the second service belongs is updated, acquiring the updated second calling information;
and sending the updated second calling information to the first service so that the first server stores the updated second calling information.
In a second aspect, a method for calling a service is provided, and is applied to a first service, and the method includes:
sending an acquisition request for calling configuration information to service management equipment, wherein the acquisition request carries a target interface identifier of a second service;
receiving calling configuration information corresponding to a target interface identifier of the second service, wherein the calling configuration information comprises a signature encryption algorithm;
and sending a calling request of an interface to which the target interface identifier belongs to the second service based on the signature encryption algorithm so as to realize the calling of the interface, wherein the calling request carries the identifier of the first service and the target interface identifier.
In one possible implementation, the method further includes:
sending a first service registration request to the service management device, wherein the first service registration request carries a name of the first service;
receiving an identifier and a first key which are distributed for the first service and sent by the service management equipment;
sending a first interface registration request to the service management device, where the first interface registration request is encrypted by using the first key, the first interface registration request includes an identifier of the first service and first call information corresponding to an interface, which is called by another service, in the first service, the first call information includes call configuration information and service information, and the service information is information that can call a service of an interface in the first service.
In a third aspect, a method for calling a service is provided, and is applied to a second service, and the method includes:
receiving a calling request of an interface to which a target interface identifier sent by a first service belongs, wherein the calling request carries the identifier of the first service and the target interface identifier;
according to the signature encryption algorithm corresponding to the target interface identifier, if the calling request is decrypted and the signature passes, whether the interface to which the target interface identifier belongs can be called by the first service is judged;
and when the interface to which the target interface identifier belongs can be called by the first service, calling the interface to which the target interface identifier belongs for the first service.
In one possible implementation, the method further includes:
sending a second service registration request to the service management device, wherein the second service registration request carries a name of the second service;
receiving an identifier and a second key which are distributed for the second service and sent by the service management equipment;
and sending a second interface registration request to the service management device, wherein the second interface registration request is encrypted by using the second key, the second interface registration request includes an identifier of the second service and second calling information corresponding to an interface for other services in the second service, the second calling information includes calling configuration information and service information, and the service information is information capable of calling the service of the interface in the second service.
In a fourth aspect, an apparatus for invoking a service is provided, where the apparatus is applied to a service management device, and the apparatus includes:
the system comprises a receiving module, a configuration information calling module and a configuration information receiving module, wherein the receiving module is used for receiving an acquisition request of calling configuration information sent by a first service, and the acquisition request carries a target interface identifier of a second service;
the judging module is used for judging whether an interface to which the target interface identifier of the second service belongs can be called by the first service;
and a sending module, configured to send, to the first service, invocation configuration information corresponding to a target interface identifier of the second service when an interface to which the target interface identifier of the second service belongs can be invoked by the first service, so that the first service sends an invocation request to the second service based on the invocation configuration information, where the invocation configuration information includes a signature encryption algorithm.
In a possible implementation manner, the receiving module is configured to:
and receiving an acquisition request of the calling configuration information, which is sent by the first service when the calling configuration information is not stored.
In a possible implementation manner, the receiving module is further configured to receive a first service registration request sent by the first service, where the first service registration request carries a name of the first service;
the sending module is further configured to send, to the first service, an identifier and a first key allocated to the first service;
the receiving module is further configured to receive a first interface registration request sent by a first service, where the first interface registration request is encrypted by using the first key, the first interface registration request includes an identifier of the first service and first call information corresponding to an interface, called by another service, in the first service, the first call information includes call configuration information and service information, and the service information is information that can call a service of an interface in the first service;
the device further comprises: and the first storage module is used for correspondingly storing the first calling information and the identifier of the first service.
In a possible implementation manner, the receiving module is further configured to receive a second service registration request sent by the second service, where the second service registration request carries a name of the second service;
the sending module is further configured to send, to the second service, an identifier and a second key that are allocated to the second service;
the receiving module is further configured to receive a second interface registration request sent by a second service, where the second interface registration request is encrypted by using the second key, the second interface registration request includes an identifier of the second service and second call information corresponding to an interface, called by another service, in the second service, the second call information includes call configuration information and service information, and the service information is information that can call a service of an interface in the second service;
the device further comprises: and the second storage module is used for correspondingly storing the second calling information and the identifier of the second service.
In a possible implementation manner, the sending module is further configured to obtain updated second call information when it is detected that second call information corresponding to an interface to which a target interface identifier of the second service belongs is updated; and sending the updated second calling information to the first service so that the first server stores the updated second calling information.
In a fifth aspect, an apparatus for invoking a service is provided, where the apparatus is applied to a first service, and the apparatus includes: the sending module is used for sending an acquisition request for calling configuration information to the service management equipment, wherein the acquisition request carries a target interface identifier of a second service;
a receiving module, configured to receive call configuration information corresponding to a target interface identifier of the second service, where the call configuration information includes a signature encryption algorithm, and the target interface identifier of the second service is sent by the service management device;
the sending module is further configured to send, based on the signature encryption algorithm, a call request of an interface to which the target interface identifier belongs to the second service, so as to implement call of the interface, where the call request carries the identifier of the first service and the target interface identifier;
the receiving module is further configured to receive a call result sent by the second service.
In a possible implementation manner, the sending module is further configured to send a first service registration request to the service management device, where the first service registration request carries a name of the first service;
the receiving module is further configured to receive an identifier and a first key that are sent by the service management device and allocated to the first service;
the sending module is further configured to send a first interface registration request to the service management device, where the first interface registration request is encrypted by using the first key, the first interface registration request includes an identifier of the first service and first call information corresponding to an interface, called by another service, in the first service, the first call information includes call configuration information and service information, and the service information is information that can call a service of an interface in the first service.
In a sixth aspect, an apparatus for invoking a service is provided, which is applied to a second service, and includes:
a receiving module, configured to receive a call request of an interface to which a target interface identifier sent by a first service belongs, where the call request carries the identifier of the first service and the target interface identifier;
the judging module is used for judging whether the interface to which the target interface identifier belongs can be called by the first service or not if the calling request is decrypted and the signature passes through the signature encryption algorithm corresponding to the target interface identifier;
the calling module is used for calling the interface to which the target interface identifier belongs for the first service when the interface to which the target interface identifier belongs can be called by the first service;
and the sending module is used for sending the calling result to the first service.
In a possible implementation manner, the sending module is further configured to send a second service registration request to the service management device, where the second service registration request carries a name of the second service;
the receiving module is further configured to receive an identifier and a second key that are sent by the service management device and allocated to the second service;
the sending module is further configured to send a second interface registration request to the service management device, where the second interface registration request is encrypted by using the second key, the second interface registration request includes an identifier of the second service and second call information corresponding to an interface, which is called by another service, in the second service, the second call information includes call configuration information and service information, and the service information is information that can call a service of an interface in the second service.
In a seventh aspect, a computer device is provided, which includes a processor and a memory, where at least one instruction is stored in the memory, and the instruction is loaded and executed by the processor to implement the method for calling a service according to the first aspect.
In an eighth aspect, there is provided a computer device comprising a processor and a memory, wherein the memory stores at least one instruction, and the instruction is loaded and executed by the processor to implement the method for invoking a service according to the second aspect.
In a ninth aspect, there is provided a computer device comprising a processor and a memory, the memory having stored therein at least one instruction, the instruction being loaded and executed by the processor to implement the method of invoking a service according to the third aspect.
In a tenth aspect, there is provided a computer-readable storage medium having stored therein at least one instruction, which is loaded and executed by a processor to implement the method of invoking a service according to the first aspect.
In an eleventh aspect, there is provided a computer-readable storage medium having at least one instruction stored therein, the at least one instruction being loaded and executed by a processor to implement the method for invoking a service according to the second aspect.
In a twelfth aspect, a computer-readable storage medium is provided, wherein at least one instruction is stored in the computer-readable storage medium, and the at least one instruction is loaded and executed by a processor to implement the method for calling a service according to the third aspect.
In a thirteenth aspect, a system for invoking a service is provided, where the system includes a service management device, a first service and a second service, where the service management device is the service management device according to the fourth aspect, the first service is the first service according to the fifth aspect, and the second service is the second service according to the sixth aspect.
The beneficial effects brought by the technical scheme provided by the embodiment of the disclosure at least comprise:
in the embodiment of the disclosure, when a first service calls an interface corresponding to a target interface identifier of a second service, a service management device receives an acquisition request of calling configuration information sent by the first service, where the acquisition request carries the target interface identifier of the second service, determines whether an interface to which the target interface identifier of the second service belongs can be called by the first service, and sends the calling configuration information corresponding to the target interface identifier of the second service to the first service under the condition that the interface to which the target interface identifier of the second service belongs can be called by the first service, so that the first service sends the calling request to the second service based on the calling configuration information. In this way, the first service can acquire the calling configuration information corresponding to the target interface identifier from the calling management device without acquiring the calling configuration information manually, so that the service calling efficiency can be improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present disclosure, and it is obvious for those skilled in the art to obtain other drawings based on the drawings without creative efforts.
FIG. 1 is a system diagram of a call service provided by an embodiment of the present disclosure;
FIG. 2 is a flow chart of a method for invoking a service provided by an embodiment of the present disclosure;
FIG. 3 is a flow chart of a method for invoking a service provided by an embodiment of the present disclosure;
FIG. 4 is a schematic structural diagram of an apparatus for invoking a service according to an embodiment of the present disclosure;
FIG. 5 is a schematic structural diagram of an apparatus for invoking a service according to an embodiment of the present disclosure;
FIG. 6 is a schematic structural diagram of an apparatus for invoking a service according to an embodiment of the present disclosure;
FIG. 7 is a schematic structural diagram of an apparatus for invoking a service according to an embodiment of the present disclosure;
FIG. 8 is a schematic structural diagram of an apparatus for invoking a service according to an embodiment of the present disclosure;
fig. 9 is a schematic structural diagram of a computer device according to an embodiment of the present disclosure.
Detailed Description
To make the objects, technical solutions and advantages of the present disclosure more apparent, embodiments of the present disclosure will be described in detail with reference to the accompanying drawings.
The embodiment of the disclosure provides a method for calling a service, and an execution subject of the method can serve a management device, a first service and a second service. The service management device may be a server. The first service and the second service are different services, the first service is a service in one system except the second service, and the second service is a service in one system except the first service. For example, the first service may be an account service, the second service may be a refund service, and so on.
The first service and the second service may be located on the same device (e.g., on the same server); or the first service and the second service may be located on different devices (e.g., on different servers; the first service is located on the terminal, the second service is located on the server; the first service is located on the server, the second service is located on the terminal, etc.). In the disclosed embodiment, one service may be one process, or a plurality of services may be one process.
The service management device is provided with a processor, a memory, a transceiver and the like, wherein the processor can be used for calling the service process, the memory can be used for storing data required in the calling of the service process and generated data, and the transceiver can be used for receiving and transmitting the data.
In the embodiment of the present disclosure, the first service calls the second service as an example, that is, the first service is a service caller, and the second service is a service provider. The general service comprises a plurality of interfaces, some interfaces can be called by other services, and other services can call only one interface when calling the service.
Currently, in a system, services and services need to be invoked. For example, in a live system, an account service calls a payment service, and so on. It is desirable to provide a method for calling services that is efficient.
Before implementation, an application scenario of the embodiment of the present disclosure is first introduced:
as shown in fig. 1, the service management apparatus establishes a connection (the connection may be a long link, that is, after the connection is established, communication may be continued, and even if there is no data transmission at present, a heartbeat detection packet may be sent to detect whether or not the other party exists) with a plurality of services (a first service to an nth service, N being a positive integer greater than 2) in one system. The service management device may manage the invocation of the plurality of services, i.e. manage the interfaces provided by the plurality of services that are available for invocation by other services. Of course, the service management device may be short-circuited with the service, but only after a connection is established each time a message is sent.
When the first service is online, a first service registration request may be sent to the service management device, where the first service registration request carries a name of the first service. After receiving the registration request sent by the first service, the service management device may resolve the name of the first service from the registration request (the name of the first service may be used for being displayed to a worker of the service management device). The service management device then assigns an identifier (which may be referred to as an identifier of the first service) to the first service, where the identifier is a unique identifier in a system in which the first service is located, and uniquely indicates the first service. The service management device then sends the first service an identification of the first service and an encryption key (i.e., a first key) that is used for subsequent encryption when the first service sends a message to the service management device.
The first service is also provided with a public Jar package developed by using Java, the public Jar package comprises Java annotation classes, and developers of the first service identify the first calling information by using the Java annotation classes. For each interface, the first calling information includes calling configuration information and service information, and the calling configuration information includes a signature encryption algorithm and the like. The signature encryption algorithm is used for indicating the signature encryption algorithm used when the call request of the call interface is sent; the service information is information of a service (e.g., an IP (Internet Protocol, interconnection Protocol between networks) address field, an identifier of the service, etc.) that can call an interface in the first service. In addition, the first call information may further include an authorization method, a current limiting method, a degradation threshold, and the like. The authorization mode is used for indicating a policy for authorizing calling, for example, a certain time period can be called, or a certain time period cannot be called, or some services can be called; the current limiting mode is used for indicating the calling times in unit time length and the like; the downgrade threshold is used for indicating the number of call failures, and when the number of call failures of the interface reaches the downgrade threshold, an error prompt message is returned, or the interface executes other processes to return a correct result to the caller. In addition, the calling configuration information may further include an authorization method, a current limiting method, and the like.
After receiving the identifier and the encryption key of the first service sent by the service management device, the first service may use the encryption key to encrypt the content corresponding to the Java annotation class and the identifier of the first service, so as to obtain the first interface registration request. The first service then sends a first interface registration request to the service management device. After receiving the first service registration request, the service management device may decrypt the first interface registration request using a decryption key corresponding to the encryption key to obtain the identifier of the first service and the first call information. And then the service management equipment stores the first calling information and the identification of the first service. In this way, the service management device stores the interface identifiers of the interfaces in the first service that can be called by other services, the call configuration information used when calling these interfaces, and the interfaces in the first service that can be called by those services.
Similarly, the processing for the second service is exactly the same as the above processing for the first service, and the processing is: the service management device receives a second service registration request sent by a second service, wherein the second service registration request carries a name of the second service. The service management device sends the identifier and the second key distributed for the second service to the second service; the service management equipment receives a second interface registration request sent by a second service, wherein the second interface registration request is encrypted by using a second secret key, the second interface registration request comprises an identifier of the second service and second calling information corresponding to interfaces for calling other services in the second service, the second calling information comprises calling configuration information and service information, and the service information is information capable of calling the services of the interfaces in the second service; and the service management equipment correspondingly stores the second calling information and the identifier of the second service.
In this embodiment, the processing procedure is the same as that of the first service, and is not described herein again.
In a possible implementation manner, a developer of the second service may possibly change the second call information corresponding to the target interface identifier of the second service, and the developer of the second service may directly update the second call information corresponding to the target interface identifier in the service management device through a manager of the service management device. The developer of the second service can also update the public Jar package, update the second calling information corresponding to the target interface identifier therein, and then trigger the second service to send an update request of the second calling information to the service management device, wherein the update request carries the identifier of the second service, the target interface identifier and the updated second calling information corresponding to the target interface identifier. And encrypted using a second encryption key. After receiving the update request, the service management device may analyze the identifier of the second service, the target interface identifier, and the updated second call information corresponding to the target interface identifier, and then replace the currently stored second call information corresponding to the target interface identifier with the updated second call information. In this way, the updating of the second calling information corresponding to the target interface identifier is realized.
Of course, only the service information corresponding to the interface identifier may be updated or only the call configuration information corresponding to the interface identifier may be updated, and the updating process may refer to updating the second call information, which is not described herein again.
The above is only described by taking the second call information corresponding to the update target interface identifier as an example, and the update process of the call configuration information corresponding to each interface identifier is similar to that, and is not described herein again.
It should be noted that the call information of the different interfaces may be the same or different.
Through the above process, it is equivalent to that the service management device stores the calling information corresponding to the interface available for calling in the service. The subsequent service may obtain the invocation information from the service management device.
The flow of invoking a service is described below in conjunction with fig. 2.
In step 201, a first service sends an acquisition request for calling configuration information to a service management device.
The obtaining request carries a target interface identifier of the second service, where the target interface identifier of the second service is used to indicate an interface of the second service to be called by the first service, for example, the second service includes 8 interfaces, and the first service calls a 3 rd interface of the second service.
In this embodiment, when the first service calls the second service, the first service may generate an acquisition request for calling the configuration information, and add a target interface identifier of the second service to the acquisition request. The device where the first service is located then sends the acquisition request to the service management device.
In a possible implementation manner, the obtaining request may be an obtaining request encrypted by the first key.
In a possible implementation manner, when the first service calls the target interface (the interface to which the target interface identifier belongs) of the second service, it may be determined whether the first service stores the calling configuration information corresponding to the target interface identifier, and when the first service does not store the calling configuration information corresponding to the target interface identifier, the first service may perform the processing of step 201, so that the calling processing time may be saved. If the calling configuration information corresponding to the target interface identifier is stored, the processing after step 206 (including step 206) is continued. In this case, after detecting that the second call information is updated, the service management device may send the updated second call information to the services requesting the second call information within a period of time most recent before the current time point, so that the services store the latest second call information.
Certainly, in order to ensure that all the calling configuration information corresponding to the target interface identifier acquired by the first service is the latest calling configuration information, the processing in step 201 may be performed by the first service each time the target interface of the second service is called.
In step 202, the service management apparatus receives an acquisition request for invoking configuration information sent by a first service.
In step 203, the service management apparatus determines whether the interface to which the target interface identifier of the second service belongs can be called by the first service.
In this embodiment, when receiving an acquisition request for calling configuration information, the service management device may parse the acquisition request to acquire a target interface identifier of the second service. The service management device may then use the target interface identification of the second service to find out, among all interfaces of the second service, whether the interface indicated by the target interface identification of the second service can be called by the first service. Specifically, if the identifier of the service that can call the interface to which the target interface identifier belongs is stored in correspondence to the target interface identifier of the second service, the service management device may check whether the identifier of the service includes the identifier of the first service. If the identifiers of the services comprise the identifier of the first service, the service management device determines that the interface to which the target interface identifier belongs can be called by the first service. If the identification of the first service is not included in the identifications of the services, the service management device determines that the interface to which the target interface identification belongs cannot be called by the first service. If the IP address field of the service that can call the interface to which the target interface identifier belongs is stored corresponding to the target interface identifier of the second service, the service management device may check whether the IP address field includes the IP address of the device where the first service is located. If the IP section comprises the IP address of the equipment where the first service is located, the service management equipment determines that the interface to which the target interface identifier belongs can be called by the first service. If the IP segment does not include the IP address of the device where the first service is located, the service management device determines that the interface to which the target interface identifier belongs cannot be called by the first service. Of course, other ways may also be adopted to determine whether the interface to which the target interface identifier of the second service belongs can be called by the first service, and the embodiment of the present disclosure is not limited.
Step 204, in a case that the interface to which the target interface identifier of the second service belongs can be called by the first service, the service management device sends calling configuration information corresponding to the target interface identifier of the second service to the first service, so that the first service sends a calling request to the second service based on the calling configuration information, where the calling configuration information includes a signature encryption algorithm.
In this embodiment, when the service management device determines that the interface to which the target interface identifier of the second service belongs can be called by the first service, the service management device may use the target interface identifier of the second service to search for the calling configuration information corresponding to the target interface identifier. The service management device may then send the calling configuration information corresponding to the target interface identifier to the first service.
In addition, when the service management device determines that the interface to which the target interface identifier of the second service belongs cannot be called by the first service, the service management device sends wrong prompt information to the first service.
Step 205, the first service receives call configuration information corresponding to the target interface identifier of the second service, where the call configuration information includes a signature encryption algorithm, and the call configuration information is sent by the service management device.
In step 206, the first service sends a call request of the interface to which the target interface identifier belongs to the second service based on the signature encryption algorithm, so as to call the interface.
In this embodiment, the first service may generate a call request corresponding to an interface of the second service to be called, where the call request carries an identifier of the first service and an identifier of a target interface. The first service then encrypts and signs the invocation request using a signature encryption algorithm, and sends the invocation request to the second service.
The signature encryption algorithm is any algorithm for performing encryption and signature, such as an asymmetric signature encryption algorithm.
In addition, when the calling configuration information further includes an authorization manner, if the authorization manner is the callable time period, the first service may further determine whether the current time belongs to the callable time period, if the current time belongs to the callable time period, the calling process is performed, otherwise, the calling process is not performed.
In addition, when the calling configuration information also comprises a current limiting mode, whether the calling times exceed the unit time length is determined, and when the calling times do not exceed the calling times, calling processing can be carried out, otherwise, the calling processing is not carried out.
Step 207, the second service receives a call request of the interface sent by the first service, where the call request carries an identifier of the first service.
And step 208, the second service judges whether the interface to which the target interface identifier belongs can be called by the first service according to the signature encryption algorithm corresponding to the target interface identifier if the calling request is decrypted and the signature passes.
In this embodiment, the call request uses a signature encryption algorithm to encrypt the signature, the second service may decrypt and verify the call request based on the signature encryption algorithm in the call configuration information corresponding to the target interface identifier, if the decryption and verification pass, the identifier of the first service carried in the call request may be obtained, and based on the identifier of the first service, it is determined whether the first service can call the target interface corresponding to the target interface identifier. Specifically, the second service determines whether the identifier of the first service belongs to a white list corresponding to the target interface identifier, and if the white list corresponding to the target interface identifier includes the identifier of the first service, it is determined that the target interface corresponding to the target interface identifier can be called by the first service, otherwise, it cannot be called by the first service. Or, the second service determines whether the identifier of the first service belongs to a blacklist corresponding to the target interface identifier, and if the blacklist corresponding to the target interface identifier does not include the identifier of the first service, it is determined that the target interface corresponding to the target interface identifier can be called by the first service, otherwise, the target interface cannot be called by the first service. Or, the second service determines whether the IP address corresponding to the identifier of the first service belongs to the IP address field corresponding to the identifier of the target interface, and if so, determines that the target interface corresponding to the identifier of the target interface can be called by the first service, otherwise, determines that the target interface cannot be called by the first service. In this way, since the call processing is executed only by decryption and signature verification, illegal calls can be prevented as much as possible, and thus the call of the service can be made safer.
In addition, the white list, the black list and the IP address field corresponding to the target interface identifier may be configured in the service management device by a technician and issued to the second service by the service management device. The second service may be stored after it is received.
In one possible implementation, the public Jar package includes a filter, and the processing of step 208 may be processed by the filter.
Step 209, the second service calls the interface for the first service when the interface can be called by the first service, and returns a call result to the first service.
In this embodiment, when determining that the target interface corresponding to the target interface identifier can be called by the first service, the second service may execute processing to be executed by the first service calling the target interface, obtain a calling result, and send the calling result to the first service. Therefore, the first service can obtain the calling result, and the execution of the interface process corresponding to the calling target interface identifier is finished.
In addition, when the second service determines that the target interface corresponding to the target interface identifier can be called by the first service, the second service may obtain a current limiting mode corresponding to the target interface identifier. And if the number of the services of the current calling target interface of the second service exceeds a preset value, carrying out current limiting treatment, namely adding the identifier of the first service into a current limiting queue, and calling the target interface for the first service when the calling treatment of the first service is executed.
In addition, the second service may obtain a degradation threshold corresponding to the target interface identifier when it is determined that the target interface corresponding to the target interface identifier can be called by the first service. And if the failure times when the calling of the target interface is executed reach the preset number, executing another section of codes in the first service, and returning a correct result for the first service or directly returning a calling failure message.
In addition, when determining that the target interface corresponding to the target interface identifier can be called by the first service, the second service may obtain an authorization manner corresponding to the target interface identifier, check whether the current time period belongs to a time period that can be called, and execute processing for calling the target interface if the current time period belongs to the time period that can be called.
In addition, after the first service successfully calls the target interface, the second service may further record a call record of the target interface identifier, that is, add the call record of the first service in the call record of the target interface identifier, where the call record includes the call time and the identifier of the first service.
In addition, the flowchart shown in fig. 3 is also provided to facilitate understanding of the embodiments of the present disclosure.
In the embodiment of the disclosure, when a first service calls an interface corresponding to a target interface identifier of a second service, a service management device receives an acquisition request of calling configuration information sent by the first service, where the acquisition request carries the target interface identifier of the second service, determines whether an interface to which the target interface identifier of the second service belongs can be called by the first service, and sends the calling configuration information corresponding to the target interface identifier of the second service to the first service under the condition that the interface to which the target interface identifier of the second service belongs can be called by the first service, so that the first service sends the calling request to the second service based on the calling configuration information. In this way, the first service can acquire the calling configuration information corresponding to the target interface identifier from the calling management device without acquiring the calling configuration information manually, so that the service calling efficiency can be improved.
Based on the same technical concept, an embodiment of the present disclosure further provides a device for invoking a service, which is applied to a service management device, and as shown in fig. 4, the device includes:
a receiving module 410, configured to receive an obtaining request for invoking configuration information sent by a first service, where the obtaining request carries a target interface identifier of a second service;
a determining module 420, configured to determine whether an interface to which a target interface identifier of the second service belongs can be called by the first service;
a sending module 430, configured to send, to the first service, invocation configuration information corresponding to a target interface identifier of the second service when an interface to which the target interface identifier of the second service belongs can be invoked by the first service, so that the first service sends an invocation request to the second service based on the invocation configuration information, where the invocation configuration information includes a signature encryption algorithm.
In a possible implementation manner, the receiving module 410 is configured to:
and receiving an acquisition request of the calling configuration information, which is sent by the first service when the calling configuration information is not stored.
In a possible implementation manner, the method is further configured to receive a first service registration request sent by the first service, where the first service registration request carries a name of the first service;
the sending module 430 is further configured to send, to the first service, the identifier and the first key allocated to the first service;
the receiving module 410 is further configured to receive a first interface registration request sent by a first service, where the first interface registration request is encrypted by using the first key, the first interface registration request includes an identifier of the first service and first call information corresponding to an interface, called by another service, in the first service, the first call information includes call configuration information and service information, and the service information is information that can call a service of an interface in the first service;
as shown in fig. 5, the apparatus further includes: a first storage module 440, configured to correspondingly store the first invocation information and the identifier of the first service.
In a possible implementation manner, the receiving module 410 is further configured to receive a second service registration request sent by the second service, where the second service registration request carries a name of the second service;
the sending module 430 is further configured to send, to the second service, an identifier and a second key allocated to the second service;
the receiving module 410 is further configured to receive a second interface registration request sent by a second service, where the second interface registration request is encrypted by using the second key, the second interface registration request includes an identifier of the second service and second call information corresponding to an interface, called by another service, in the second service, the second call information includes call configuration information and service information, and the service information is information that can call a service of an interface in the second service;
as shown in fig. 6, the apparatus further includes: a second storage module 450, configured to correspondingly store the second invocation information and the identifier of the second service.
In a possible implementation manner, the sending module 430 is further configured to obtain updated second call information when it is detected that the second call information corresponding to the interface to which the target interface identifier of the second service belongs is updated; and sending the updated second calling information to the first service so that the first server stores the updated second calling information.
Based on the same technical concept, an embodiment of the present disclosure further provides a device for invoking a service, which is applied to a first service, and as shown in fig. 7, the device includes:
a sending module 710, configured to send an obtaining request for invoking configuration information to a service management device, where the obtaining request carries a target interface identifier of a second service;
a receiving module 720, configured to receive call configuration information corresponding to a target interface identifier of the second service, where the call configuration information includes a signature encryption algorithm, and the target interface identifier of the second service is sent by the service management device;
the sending module 710 is further configured to send, based on the signature encryption algorithm, a call request of an interface to which the target interface identifier belongs to the second service, so as to implement call of the interface, where the call request carries the identifier of the first service and the target interface identifier;
the receiving module 720 is further configured to receive a call result sent by the second service.
In a possible implementation manner, the sending module 710 is further configured to send a first service registration request to the service management device, where the first service registration request carries a name of the first service;
the receiving module 720 is further configured to receive the identifier and the first key that are sent by the service management apparatus and allocated for the first service;
the sending module 710 is further configured to send a first interface registration request to the service management device, where the first interface registration request is encrypted by using the first key, the first interface registration request includes an identifier of the first service and first call information corresponding to an interface, called by another service, in the first service, the first call information includes call configuration information and service information, and the service information is information that can call a service of an interface in the first service.
Based on the same technical concept, an embodiment of the present disclosure further provides a device for invoking a service, which is applied to a second service, and as shown in fig. 8, the device includes:
a receiving module 810, configured to receive a call request of an interface to which a target interface identifier sent by a first service belongs, where the call request carries the identifier of the first service and the target interface identifier;
a determining module 820, configured to determine, according to a signature encryption algorithm corresponding to the target interface identifier, whether an interface to which the target interface identifier belongs can be called by the first service if the calling request is decrypted and the signature passes through the signature verification;
a calling module 830, configured to, when the interface to which the target interface identifier belongs can be called by the first service, call the interface to which the target interface identifier belongs for the first service, and obtain a calling result;
a sending module 840, configured to send a call result to the first service.
In a possible implementation manner, the sending module 840 is further configured to send a second service registration request to the service management device, where the second service registration request carries a name of the second service;
the receiving module 810 is further configured to receive an identifier and a second key that are sent by the service management device and allocated to the second service;
the sending module 840 is further configured to send a second interface registration request to the service management device, where the second interface registration request is encrypted by using the second key, the second interface registration request includes an identifier of the second service and second call information corresponding to an interface, called by another service, in the second service, the second call information includes call configuration information and service information, and the service information is information that can call a service of an interface in the second service.
In the embodiment of the disclosure, when a first service calls an interface corresponding to a target interface identifier of a second service, a service management device receives an acquisition request of calling configuration information sent by the first service, where the acquisition request carries the target interface identifier of the second service, determines whether an interface to which the target interface identifier of the second service belongs can be called by the first service, and sends the calling configuration information corresponding to the target interface identifier of the second service to the first service under the condition that the interface to which the target interface identifier of the second service belongs can be called by the first service, so that the first service sends the calling request to the second service based on the calling configuration information. In this way, the first service can acquire the calling configuration information corresponding to the target interface identifier from the calling management device without acquiring the calling configuration information manually, so that the service calling efficiency can be improved.
It should be noted that: in the device for calling a service according to the above embodiment, when calling a service, only the division of the functional modules is illustrated, and in practical applications, the function distribution may be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the apparatus for invoking a service and the method for invoking a service provided in the above embodiments belong to the same concept, and specific implementation processes thereof are detailed in the method embodiments and will not be described herein again.
The embodiment of the present disclosure further provides a system for invoking a service, where the system for invoking a service includes a first service, a second service and a service management device, where the first service is the first service shown in the flow of fig. 2, the second service is the second service shown in the flow of fig. 2, and the service management device is the service management device shown in the flow of fig. 2.
Fig. 9 is a schematic structural diagram of a computer device 900 according to an embodiment of the present disclosure, where the computer device 900 may have a relatively large difference due to different configurations or performances, and may include one or more processors (CPUs) 901 and one or more memories 902, where the memory 902 stores at least one instruction, and the at least one instruction is loaded and executed by the processor 901 to implement the method steps of invoking the service.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only exemplary of the present disclosure and is not intended to limit the present disclosure, so that any modification, equivalent replacement, or improvement made within the spirit and principle of the present disclosure should be included in the scope of the present disclosure.

Claims (12)

1. A method for calling a service, which is applied to a service management device, the method comprising:
receiving an acquisition request for calling configuration information sent by a first service, wherein the acquisition request carries a target interface identifier of a second service;
judging whether an interface to which a target interface identifier of the second service belongs can be called by the first service;
and under the condition that the interface to which the target interface identifier of the second service belongs can be called by the first service, sending calling configuration information corresponding to the target interface identifier of the second service to the first service, so that the first service sends a calling request to the second service based on the calling configuration information, wherein the calling configuration information comprises a signature encryption algorithm.
2. The method of claim 1, wherein receiving the request for obtaining the calling configuration information sent by the first service comprises:
and receiving an acquisition request of the calling configuration information, which is sent by the first service when the calling configuration information is not stored.
3. The method according to claim 1 or 2, characterized in that the method further comprises:
receiving a first service registration request sent by the first service, wherein the first service registration request carries a name of the first service;
sending, to the first service, an identification and a first key assigned for the first service;
receiving a first interface registration request sent by a first service, wherein the first interface registration request is encrypted by using the first key, the first interface registration request comprises an identifier of the first service and first calling information corresponding to an interface for other services to call in the first service, the first calling information comprises calling configuration information and service information, and the service information is information capable of calling the service of the interface in the first service;
and correspondingly storing the first calling information and the identification of the first service.
4. The method according to claim 1 or 2, characterized in that the method further comprises:
receiving a second service registration request sent by the second service, wherein the second service registration request carries a name of the second service;
sending, to the second service, an identification and a second key assigned for the second service;
receiving a second interface registration request sent by a second service, wherein the second interface registration request is encrypted by using the second key, the second interface registration request comprises an identifier of the second service and second calling information corresponding to an interface for other services to call in the second service, the second calling information comprises calling configuration information and service information, and the service information is information capable of calling the service of the interface in the second service;
and correspondingly storing the second calling information and the identifier of the second service.
5. The method of claim 4, further comprising:
when detecting that second calling information corresponding to an interface to which a target interface identifier of the second service belongs is updated, acquiring the updated second calling information;
and sending the updated second calling information to the first service so that the first server stores the updated second calling information.
6. A method of invoking a service, applied to a first service, the method comprising:
sending an acquisition request for calling configuration information to service management equipment, wherein the acquisition request carries a target interface identifier of a second service;
receiving calling configuration information corresponding to a target interface identifier of the second service, wherein the calling configuration information comprises a signature encryption algorithm;
and sending a calling request of an interface to which the target interface identifier belongs to the second service based on the signature encryption algorithm so as to realize the calling of the interface, wherein the calling request carries the identifier of the first service and the target interface identifier.
7. The method of claim 6, further comprising:
sending a first service registration request to the service management device, wherein the first service registration request carries a name of the first service;
receiving an identifier and a first key which are distributed for the first service and sent by the service management equipment;
sending a first interface registration request to the service management device, where the first interface registration request is encrypted by using the first key, the first interface registration request includes an identifier of the first service and first call information corresponding to an interface, which is called by another service, in the first service, the first call information includes call configuration information and service information, and the service information is information that can call a service of an interface in the first service.
8. A method of invoking a service, applied to a second service, the method comprising:
receiving a calling request of an interface to which a target interface identifier sent by a first service belongs, wherein the calling request carries the identifier of the first service and the target interface identifier;
according to the signature encryption algorithm corresponding to the target interface identifier, if the calling request is decrypted and the signature passes, whether the interface to which the target interface identifier belongs can be called by the first service is judged;
when the interface to which the target interface identifier belongs can be called by the first service, calling the interface to which the target interface identifier belongs for the first service to obtain a calling result;
and sending a calling result to the first service.
9. The method of claim 8, further comprising:
sending a second service registration request to the service management device, wherein the second service registration request carries a name of the second service;
receiving an identifier and a second key which are distributed for the second service and sent by the service management equipment;
and sending a second interface registration request to the service management device, wherein the second interface registration request is encrypted by using the second key, the second interface registration request includes an identifier of the second service and second calling information corresponding to an interface for other services in the second service, the second calling information includes calling configuration information and service information, and the service information is information capable of calling the service of the interface in the second service.
10. An apparatus for invoking a service, applied to a service management device, the apparatus comprising:
the system comprises a receiving module, a configuration information calling module and a configuration information receiving module, wherein the receiving module is used for receiving an acquisition request of calling configuration information sent by a first service, and the acquisition request carries a target interface identifier of a second service;
the judging module is used for judging whether an interface to which the target interface identifier of the second service belongs can be called by the first service;
and a sending module, configured to send, to the first service, invocation configuration information corresponding to a target interface identifier of the second service when an interface to which the target interface identifier of the second service belongs can be invoked by the first service, so that the first service sends an invocation request to the second service based on the invocation configuration information, where the invocation configuration information includes a signature encryption algorithm.
11. An apparatus for invoking a service, applied to a first service, the apparatus comprising:
the sending module is used for sending an acquisition request for calling configuration information to the service management equipment, wherein the acquisition request carries a target interface identifier of a second service;
a receiving module, configured to receive call configuration information corresponding to a target interface identifier of the second service, where the call configuration information includes a signature encryption algorithm, and the target interface identifier of the second service is sent by the service management device;
the sending module is further configured to send, based on the signature encryption algorithm, a call request of an interface to which the target interface identifier belongs to the second service, so as to implement call of the interface, where the call request carries the identifier of the first service and the target interface identifier;
the receiving module is further configured to receive a call result sent by the second service.
12. An apparatus for invoking a service, applied to a second service, the apparatus comprising:
a receiving module, configured to receive a call request of an interface to which a target interface identifier sent by a first service belongs, where the call request carries the identifier of the first service and the target interface identifier;
the judging module is used for judging whether the interface to which the target interface identifier belongs can be called by the first service or not if the calling request is decrypted and the signature passes through the signature encryption algorithm corresponding to the target interface identifier;
the calling module is used for calling the interface to which the target interface identifier belongs for the first service to obtain a calling result when the interface to which the target interface identifier belongs can be called by the first service;
and the sending module is used for sending the calling result to the first service.
CN201911323188.2A 2019-12-20 2019-12-20 Method and device for calling service Active CN110995756B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911323188.2A CN110995756B (en) 2019-12-20 2019-12-20 Method and device for calling service

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911323188.2A CN110995756B (en) 2019-12-20 2019-12-20 Method and device for calling service

Publications (2)

Publication Number Publication Date
CN110995756A true CN110995756A (en) 2020-04-10
CN110995756B CN110995756B (en) 2022-07-05

Family

ID=70073307

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911323188.2A Active CN110995756B (en) 2019-12-20 2019-12-20 Method and device for calling service

Country Status (1)

Country Link
CN (1) CN110995756B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113760398A (en) * 2020-09-29 2021-12-07 北京沃东天骏信息技术有限公司 Interface calling method, server, system and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106453519A (en) * 2016-09-21 2017-02-22 合网络技术(北京)有限公司 Interface call method and device
CN107124431A (en) * 2017-06-22 2017-09-01 浙江数链科技有限公司 Method for authenticating, device, computer-readable recording medium and right discriminating system
US20170371723A1 (en) * 2016-06-28 2017-12-28 Vmware, Inc. Notification service in a decentralized control plane of a computing system
CN107659581A (en) * 2017-10-19 2018-02-02 郑州云海信息技术有限公司 A kind of resource transfer method and apparatus
CN108449315A (en) * 2018-02-05 2018-08-24 平安科技(深圳)有限公司 Ask calibration equipment, method and the computer readable storage medium of legitimacy
CN110535971A (en) * 2019-09-16 2019-12-03 腾讯科技(深圳)有限公司 Interface configuration processing method, device, equipment and storage medium based on block chain

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170371723A1 (en) * 2016-06-28 2017-12-28 Vmware, Inc. Notification service in a decentralized control plane of a computing system
CN106453519A (en) * 2016-09-21 2017-02-22 合网络技术(北京)有限公司 Interface call method and device
CN107124431A (en) * 2017-06-22 2017-09-01 浙江数链科技有限公司 Method for authenticating, device, computer-readable recording medium and right discriminating system
CN107659581A (en) * 2017-10-19 2018-02-02 郑州云海信息技术有限公司 A kind of resource transfer method and apparatus
CN108449315A (en) * 2018-02-05 2018-08-24 平安科技(深圳)有限公司 Ask calibration equipment, method and the computer readable storage medium of legitimacy
CN110535971A (en) * 2019-09-16 2019-12-03 腾讯科技(深圳)有限公司 Interface configuration processing method, device, equipment and storage medium based on block chain

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113760398A (en) * 2020-09-29 2021-12-07 北京沃东天骏信息技术有限公司 Interface calling method, server, system and storage medium

Also Published As

Publication number Publication date
CN110995756B (en) 2022-07-05

Similar Documents

Publication Publication Date Title
CN107483509B (en) A kind of auth method, server and readable storage medium storing program for executing
CN108923908B (en) Authorization processing method, device, equipment and storage medium
CN107483419B (en) Method, device and system for authenticating access terminal by server, server and computer readable storage medium
CN108540433B (en) User identity verification method and device
US7979532B2 (en) Systems and methods for using an access point for testing multiple devices and using several consoles
WO2016029595A1 (en) Method, device, and equipment for calling open platform and non-volatile computer storage medium
CN108933789B (en) Method for preventing personal information leakage and third-party application server
CN111132305B (en) Method for 5G user terminal to access 5G network, user terminal equipment and medium
CN111614548A (en) Message pushing method and device, computer equipment and storage medium
CN111414640B (en) Key access control method and device
CN110995756B (en) Method and device for calling service
CN116737598B (en) Page debugging method, device, electronic equipment and computer readable medium
CN111371811B (en) Resource calling method, resource calling device, client and service server
CN109587134B (en) Method, apparatus, device and medium for secure authentication of interface bus
CN114338795B (en) Data communication method and device of blockchain client
CN112751800A (en) Authentication method and device
CN114567678B (en) Resource calling method and device for cloud security service and electronic equipment
CN113472545B (en) Equipment network access method, device, equipment, storage medium and communication system
CN111049795B (en) Method and device for detecting sensitive data unencrypted vulnerability of distributed Web application
CN112911577B (en) Abnormal condition processing method and device, mobile equipment, user equipment and system
CN116011000B (en) Access method, device and computing equipment
CN117834312B (en) Network access method, network access device, and computer-readable storage medium
CN113114705B (en) Credible and programmable video internet of things terminal endogenous security detection method and device
CN115941198A (en) Interface calling method and device, terminal equipment and storage medium
CN114386047A (en) Application vulnerability detection method and device, electronic equipment and storage medium

Legal Events

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