CN110287037B - Distributed intelligent API asynchronous callback method and device - Google Patents

Distributed intelligent API asynchronous callback method and device Download PDF

Info

Publication number
CN110287037B
CN110287037B CN201910418187.XA CN201910418187A CN110287037B CN 110287037 B CN110287037 B CN 110287037B CN 201910418187 A CN201910418187 A CN 201910418187A CN 110287037 B CN110287037 B CN 110287037B
Authority
CN
China
Prior art keywords
api
api interface
request information
data message
data
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
CN201910418187.XA
Other languages
Chinese (zh)
Other versions
CN110287037A (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.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen 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 Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN201910418187.XA priority Critical patent/CN110287037B/en
Publication of CN110287037A publication Critical patent/CN110287037A/en
Priority to PCT/CN2019/117893 priority patent/WO2020233012A1/en
Application granted granted Critical
Publication of CN110287037B publication Critical patent/CN110287037B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Telephonic Communication Services (AREA)
  • Computer And Data Communications (AREA)
  • Stored Programmes (AREA)

Abstract

The application relates to the field of monitoring, in particular to a service node monitoring technology through software, and specifically discloses a distributed intelligent API asynchronous callback method: the server receives API interface request information; performing data decryption on the API interface request information according to a preset decryption rule, wherein the decrypted API interface request information comprises an API interface identifier, a user identifier and a data message format; verifying the user identification; according to the API interface identification, an API platform comprising the called API interface is screened from a plurality of API platforms according to a preset screening rule, and the called API interface is the API interface indicated by the API interface identification; based on the API platform comprising the called API interface, the asynchronous callback identifies the indicated API interface. The application discloses a distributed intelligent API asynchronous callback device. The application has higher data security and function construction flexibility.

Description

Distributed intelligent API asynchronous callback method and device
Technical Field
The application relates to the field of monitoring, in particular to a service node monitoring technology through software, and particularly discloses a distributed intelligent API asynchronous callback method and device.
Background
In the face of a rapidly changing market environment, an enterprise can adapt to the market environment by changing a business process, and the business process management of the enterprise is realized by depending on a management system, so that the enterprise frequently re-builds the functions of the management system, however, in the process of re-building the functions of the management system, we find that in the prior art, the mode of re-building the functions of the management system is usually to rewrite a function module, and the rewritten function module has high dependence with other original modules in the management system, low decoupling degree, and thus the function building of the management system is not flexible enough, long in building period and high in building cost.
Disclosure of Invention
In order to solve the problems, the application discloses a distributed intelligent API asynchronous callback method and device.
The first aspect of the application discloses a distributed intelligent API asynchronous callback method, which comprises the following steps:
the server receives API interface request information;
performing data decryption on the API interface request information according to a preset decryption rule, wherein the decrypted API interface request information comprises an API interface identifier, a user identifier and a data message format;
verifying the user identification;
according to the API interface identification, an API platform comprising the called API interface is screened from a plurality of API platforms according to a preset screening rule, and the called API interface is the API interface indicated by the API interface identification;
based on the API platform comprising the called API interface, the asynchronous callback identifies the indicated API interface.
As an optional implementation manner, in the first aspect of the present application, before receiving the API interface request information, the method further includes:
receiving a public key request, and generating an authentication public key and an authentication secret key according to the public key request;
and sending the authentication public key.
As an optional implementation manner, in the first aspect of the present application, between receiving the API interface request information and decrypting the data of the API interface request information according to the preset decryption rule, the method further includes:
and verifying the API interface request information by using the authentication key.
As an optional implementation manner, in the first aspect of the present application, between decrypting the data of the API interface request message according to the preset decryption rule and verifying the user identifier, the method further includes:
comparing the data message format in the API interface request information with a data message format set by a default of a server, and if the data message format in the PI interface request information is inconsistent with the data message format set by the default, performing format conversion on the API interface request information according to the data message format set by the default.
In a first aspect of the present application, according to the API interface identifier, the filtering the API platform including the called API interface according to the preset filtering rule from the plurality of API platforms includes:
and according to the API interface identification, selecting the API platform with the smallest current access amount from the plurality of API platforms.
As an optional implementation manner, in the first aspect of the present application, the API interface request information further includes service task data;
and, after asynchronously calling back the API interface identifier of the API interface indicated, the method further comprises:
and sending a callback result, wherein the callback result is generated by the API interface indicated by the API interface identifier according to the service task data.
As an optional implementation manner, in the first aspect of the present application, before sending the callback result, the method further includes:
performing data format conversion on the callback result according to the data message format in the API interface request information;
and encrypting the callback result according to the callback result encryption rule.
The second aspect of the present application discloses a server, which includes:
the first receiving module is used for receiving the API interface request information;
the decryption module is used for carrying out data decryption on the API interface request information according to a preset decryption rule, wherein the decrypted API interface request information comprises an API interface identifier, a user identifier and a data message format;
the verification module is used for verifying the user identifier;
the screening module is used for screening the API platform comprising the called API interface from a plurality of API platforms according to the API interface identification and a preset screening rule, wherein the called API interface is the API interface indicated by the API interface identification;
and the interface calling module is used for asynchronously calling back the API interface based on the API platform comprising the called API interface, wherein the API interface identifies the indicated API interface.
As an alternative embodiment, in the second aspect of the present application, the first receiving module is further configured to receive a public key request, and further the apparatus further includes a public key generating module and a transmitting module, where,
the public key generation module is used for generating an authentication public key and an authentication secret key according to the public key request;
and the sending module is used for sending the authentication public key.
As an optional implementation manner, in the second aspect of the present application, the verification module is further configured to verify the API interface request information using the authentication key.
In a second aspect of the present application, the apparatus further includes a conversion module, where the conversion module is configured to compare the data message format in the API interface request message with a default data message format, and if the data message format in the PI interface request message is inconsistent with the default data message format, perform format conversion on the API interface request message according to the default data message format.
As an alternative embodiment, in the second aspect of the present application, the screening module is specifically configured to: and according to the API interface identification, selecting the API platform with the smallest current access amount from the plurality of API platforms.
As an optional implementation manner, in the second aspect of the present application, the API interface request information further includes service task data; and the sending module is further used for sending a callback result, wherein the callback result is generated by the API indicated by the API identifier according to the service task data.
As an optional implementation manner, in the second aspect of the present application, the conversion module is further configured to perform data format conversion on the callback result according to the data packet format in the API interface request message; and the device also comprises an encryption module, wherein the encryption module is used for:
and encrypting the callback result according to the callback result encryption rule.
The third aspect of the present application discloses a distributed intelligent API asynchronous callback device, which comprises:
at least 1 memory cell;
a processing unit coupled to the at least 1 memory unit;
wherein the at least 1 memory unit is configured to store computer instructions;
the processing unit is used for calling the computer instruction to execute the distributed intelligent API asynchronous callback method disclosed in the first aspect of the application.
A fourth aspect of the present application discloses a computer storage medium, where the computer storage medium stores computer instructions, where the computer instructions, when invoked, are used to perform the distributed intelligent API asynchronous callback method disclosed in the first aspect of the present application.
Therefore, the application can asynchronously call back the API interface of the distributed setting so as to call the functions provided by the API interface of the distributed setting, thereby realizing the quick construction of a quick function module, and simultaneously encrypting the request data and the data returned by the API interface, thereby realizing higher data transmission security.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present application, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic flow diagram of a distributed intelligent API asynchronous callback method according to an embodiment of the present application;
FIG. 2 is a schematic flow chart of a distributed intelligent API asynchronous callback method according to a second embodiment of the present application;
FIG. 3 is a schematic structural diagram of a distributed intelligent API asynchronous callback device according to the third embodiment of the present application;
fig. 4 is a schematic structural diagram of a distributed intelligent API asynchronous callback device according to the fourth embodiment of the present application.
Fig. 5 is a schematic structural diagram of a distributed intelligent API asynchronous callback device according to the present disclosure.
Detailed Description
In order that those skilled in the art will better understand the present application, a technical solution in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
The terms first, second and the like in the description and in the claims and in the above-described figures are used for distinguishing between different objects and not necessarily for describing a sequential or chronological order. Furthermore, the terms "comprise" and "have," as well as any variations thereof, are intended to cover a non-exclusive inclusion. For example, a process, method, apparatus, article, or device that comprises a list of steps or elements is not limited to the list of steps or elements but may, in the alternative, include other steps or elements not expressly listed or inherent to such process, method, article, or device.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the application. The appearances of such phrases in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. Those of skill in the art will explicitly and implicitly appreciate that the embodiments described herein may be combined with other embodiments.
In the face of a rapidly changing market environment, an enterprise can adapt to the market environment by changing a business process, and the business process management of the enterprise is realized by depending on a management system, so that the enterprise frequently re-builds the functions of the management system, however, in the process of re-building the functions of the management system, we find that in the prior art, the mode of re-building the functions of the management system is usually to rewrite a function module, and the rewritten function module has high dependence with other original modules in the management system, low decoupling degree, and thus the function building of the management system is not flexible enough, long in building period and high in building cost. Aiming at the scene, the application discloses a distributed intelligent API asynchronous callback method and device.
The following describes the distributed intelligent API asynchronous callback method and device in detail in connection with the specific embodiment of the present application.
Example 1
Referring to fig. 1, fig. 1 is a schematic flow chart of a distributed intelligent API asynchronous callback method according to an embodiment of the present application, where the method is executed at a server. As shown in fig. 1, a distributed intelligent API asynchronous callback method according to a first embodiment of the present application includes:
101. and the server receives the API interface request information.
As an optional implementation manner, in the embodiment of the present application, before the server receives the API interface request information sent by the request end, the distributed intelligent API asynchronous callback method in the embodiment of the present application further includes:
the server receives the public key request and generates an authentication public key and an authentication secret key;
the server sends the authentication public key.
102. And the server decrypts the data of the API interface request information according to a preset decryption rule.
After receiving the API interface request information, the server receives the API interface request information and decrypts the data of the API interface request information to analyze the user identifier, the API interface identifier, the request data content and the data message format.
As an optional implementation manner, in the embodiment of the present application, the server uses the authentication key to verify the API interface request information.
In the embodiment of the application, optionally, the server compares the data message format in the API interface request information with the data message format set by the server by default, and if the data message format in the API interface request information is inconsistent with the data message format set by the server by default, the server performs format conversion on the API interface request information according to the data message format set by the server by default.
If the format of the data message of the API interface request information is an XML format, the default data message format of the server is a JSON data format, and the data message format is compared by the server, and if the data message format and the JSON data format are inconsistent, the server performs node interpretation on the API interface request information, and the interpretation mode is mainly to traverse all nodes in the data message of the API interface request information in a depth-first traversal mode. The node contains a plurality of values, and the example is defined as a root node, otherwise, the example is defined as a child node.
In the embodiment of the application, the process of traversing all nodes in the data message of the API interface request information is as follows:
traversing all nodes in a mode of root-node or root-node-root-node to the next root-node until the last node, and ending the traversing process.
In the embodiment of the application, the data conversion of the API interface request information is performed while traversing all nodes of the data message of the API interface request information, so that the API interface request information is expressed by a JSON data name. For example, assume that a data packet of API interface request information is:
after data conversion is performed on the data of the API interface request information, two JSON data are generated, namely logic and content, wherein nesting exists in the content, and the method is as follows:
login{userId:test;password:test123};
content{data:{extdata:1;welcome:test}}。
103. the server verifies the user identification, and the user identification is obtained from the data content obtained after the server decrypts the API interface request information according to a preset decryption rule.
In the embodiment of the application, optionally, the user identifier comprises a user identity identifier and a user authority identifier.
Correspondingly, the verification of the user identifier by the server side may include:
the server verifies the user identity;
and the server verifies the user authority identification.
In the embodiment of the present application, further optionally, the verifying, by the server, the user identity may include:
comparing the user identity with a user identity database, if the user identity database contains the user identity, returning user identity verification success information by the server, and if the user identity database does not contain the user identity, returning user identity verification failure information by the server, so that when the user terminal receives the user identity verification failure information and resubmisses API interface request information.
In the embodiment of the present application, further optionally, the verifying, by the server, the user permission identifier may include:
and comparing the user authority identification with a user authority database, returning user authority verification success information by the server if the user authority database contains the user authority identification, and returning user authority verification failure information by the server if the user authority database does not contain the user authority identification.
In the embodiment of the application, the user identity database and the user authority database can be any one of relational databases such as mysql, orcal, sqlserver and the like, and the mysql is a lightweight database and has more convenient portability, so that the expansion and the maintenance are convenient.
104. And the server screens the API platform comprising the called API interface from the plurality of API platforms according to the API interface identification and the preset screening rule, wherein the called API interface is the API interface indicated by the API interface identification.
In the embodiment of the present application, optionally, the server screens an API platform including the called API interface from a plurality of API platforms according to a preset screening rule according to the API interface identifier, including:
and the server screens the API platform with the minimum current access amount from the plurality of API platforms according to the API interface identification.
105. Based on the API platform including the called API interface, the server asynchronous callback API interface identifies the indicated API interface.
In the embodiment of the application, optionally, the request result is returned according to a preset data format. The request results are returned, for example, in JSON format.
In the embodiment of the present application, optionally, the preset data format in the request result returned according to the preset data format may be determined by the following steps:
in an embodiment of the present application, optionally, the API interface request information further includes service task data, and, based on the API platform including the called API interface, after the server side asynchronous callback API interface identifier indicates the API interface, the method further includes:
and sending a callback result, wherein the callback result is generated by the API interface indicated by the API interface identification according to the service task data.
In an embodiment of the present application, optionally, before the server sends the callback result, the method further includes:
the server side converts the data format of the callback result according to the data message format in the API interface request information;
and the server encrypts the callback result according to the callback result encryption rule.
In the embodiment of the application, optionally, the callback result encryption rule can be an RSA encryption algorithm, and the confidentiality is acknowledged in the industry because the RSA encryption algorithm is difficult to crack, and although the security is not clearly demonstrated, in the practical application, no example of cracking the RSA encryption algorithm exists, so the RSA encryption algorithm has higher data security.
In the embodiment of the application, optionally, the callback result encryption rule may be a Base64 encryption algorithm
It should be noted that, the request result may be determined according to a specific service requirement of the caller, and the present application does not limit the specific content of the request result.
Therefore, according to the embodiment of the application, the function modules with the same functions in different platforms can be integrated according to the function similarity, so that a general interface which is open to the outside is generated, and when a calling requester needs to call the function modules deployed on different platforms, the calling requester only needs to call the general interface and provide relevant field identifications, and the calling of the API interface between multiple platforms can be completed. On the other hand, the embodiment of the application can encrypt the data, so that the transmission of the data has higher security.
Example two
Referring to fig. 2, fig. 2 is a flow chart of a distributed intelligent API asynchronous callback method according to a second embodiment of the present application, which is executed at a client. As shown in fig. 2, a distributed intelligent API asynchronous callback method according to a second embodiment of the present application includes:
201. the client encapsulates API interface request information, wherein the interface request information comprises a user identifier, an API interface identifier and a data message format.
202. And the client encrypts the packaged API interface request information according to a preset encryption rule.
In the embodiment of the application, optionally, the preset encryption rule may be an RSA encryption algorithm, and the confidentiality is acknowledged in the industry because the RSA encryption algorithm is difficult to crack, and although the security is not clearly demonstrated, in practical application, no example of cracking the RSA encryption algorithm is generated, so that the RSA encryption algorithm has higher data security.
In the embodiment of the present application, optionally, the preset encryption rule may be a Base64 encryption algorithm.
As an optional implementation manner, in the embodiment of the present application, before the client encrypts the encapsulated API interface request information according to the preset encryption rule, a distributed intelligent API asynchronous callback method in the second embodiment of the present application further includes:
the client sends a public key request and receives an authentication public key.
203. The client sends the encrypted API interface request information in a POST mode.
When a client initiates a request, the client needs to encapsulate API interface request information borne on a request protocol, wherein the API interface request information comprises a user identifier, an API interface identifier and a data message format, the data message format is optional, and if the data message format is not filled in, the data message format defaults to a JSON format. Further optionally, in an embodiment of the present application, the data packet format is JSON format.
It should be noted that, the client is not limited to APP, web page, desktop application, etc., and any platform supporting http transport protocol may be used, which is not limited by the embodiment of the present application.
It should be noted that, regarding the POST request manner and the GET request manner, please refer to the description in the prior art, and the embodiments of the present application are not described in detail herein.
In the embodiment of the present application, optionally, after the client sends the encrypted API interface request information in the POST manner, a distributed intelligent API asynchronous callback method further includes:
and setting callback monitoring and sending results.
In the embodiment of the application, optionally, the client sends the encrypted API interface request information in a GET manner.
204. The client receives the tuning result back.
In the embodiment of the present application, optionally, after the client receives the callback result, the client decrypts the callback result.
In the embodiment of the application, optionally, an RSA algorithm is adopted to decrypt the callback result.
Therefore, according to the embodiment of the application, the API interfaces deployed on different platforms can be called by accessing the universal interface, and the embodiment of the application can encrypt the data in the callback request, so that the embodiment of the application has higher flexibility and data security.
Example III
Referring to fig. 3, fig. 3 is a schematic structural diagram of a server disclosed in a third embodiment of the present application, where the server may be used to execute a distributed intelligent API asynchronous callback method disclosed in the present application. As shown in fig. 3, the server includes:
the first receiving module 301 is configured to receive API interface request information.
The decryption module 302 is configured to decrypt the data of the API interface request message according to a preset decryption rule, where the decrypted API interface request message includes an API interface identifier, a user identifier, and a data message format.
The server side further comprises:
and the verification module 303 is configured to verify the user identifier.
As an optional implementation manner, in the embodiment of the present application, the user identifier includes a user identity identifier and a user authority identifier; and, the verification module 303 performs verification on the user identifier specifically as follows:
verifying the user identity;
and verifying the user authority identification.
In the embodiment of the present application, optionally, the verification module 303 performs verification on the user id, which is more specifically:
comparing the user identity with a user identity database, returning user identity verification success information if the user identity database contains the user identity, and returning user identity verification failure information if the user identity database does not contain the user identity.
In the embodiment of the present application, optionally, the verification module 303 verifies the user permission identifier more specifically:
comparing the user authority identification with a user authority database, returning user authority verification success information if the user authority database contains the user authority identification, and returning user authority verification failure information if the user authority database does not contain the user authority identification.
In the embodiment of the application, the user identity database and the user authority database can be any one of relational databases such as mysql, orcal, sqlserver and the like, and the mysql is a lightweight database and has more convenient portability, so that the expansion and the maintenance are convenient.
As an alternative implementation manner, in an embodiment of the present application, the verification module 303 is further configured to verify the API interface request information using the authentication key.
After the first receiving module 301 receives the API request information, the verifying module 303 decrypts the data of the API request information to parse the API request information to obtain the request data, the API identifier, the content of the request data, and the format of the data message.
The server side further comprises:
and the screening module 304 is configured to screen an API platform including the called API interface from the plurality of API platforms according to the API interface identifier and a preset screening rule, where the called API interface is an API interface indicated by the API interface identifier.
The server side further comprises:
the interface calling module 305 is configured to identify the indicated API interface based on the API platform including the called API interface.
As an optional implementation manner, in an embodiment of the present application, the first receiving module is further configured to receive a public key request, and further the apparatus further includes a public key generating module 306 and a sending module 307, where,
a public key generation module 306, configured to generate an authentication public key and an authentication key according to the public key request;
a sending module 307, configured to send the authentication public key.
As an optional implementation manner, in this embodiment of the present application, the apparatus further includes a conversion module 308, where the conversion module 308 is configured to compare a data message format in the API interface request message with a data message format set by default, and if the data message format in the PI interface request message is inconsistent with the data message format set by default, perform format conversion on the API interface request message according to the data message format set by default.
For example, if the format of the data message of the API request information is in XML format, the default data message format of the server is in JSON data format, and the two data message formats are compared by the conversion module 308 and are inconsistent, the server performs node interpretation on the API request information, and the interpretation mode is mainly to traverse all nodes in the data message of the API request information in a depth-first traversal mode. The node contains a plurality of values, and the example is defined as a root node, otherwise, the example is defined as a child node.
In the embodiment of the application, the process of traversing all nodes in the data message of the API interface request information is as follows:
traversing all nodes in a mode of root-node or root-node-root-node to the next root-node until the last node, and ending the traversing process.
In the embodiment of the application, the data conversion of the API interface request information is performed while traversing all nodes of the data message of the API interface request information, so that the API interface request information is expressed by a JSON data name. For example, assume that a data packet of API interface request information is:
after data conversion is performed on the data of the API interface request information, two JSON data are generated, namely logic and content, wherein nesting exists in the content, and the method is as follows:
login{userId:test;password:test123};
content{data:{extdata:1;welcome:test}}。
as an optional implementation manner, in the embodiment of the present application, the screening module 304 is specifically configured to: and according to the API interface identification, selecting the API platform with the smallest current access amount from a plurality of API platforms.
As an optional implementation manner, in the embodiment of the present application, the API interface request information further includes service task data; and the sending module 307 is further configured to send a callback result, where the callback result is that the API interface indicated by the API interface identifier is generated according to the service task data.
As an optional implementation manner, in this embodiment of the present application, the conversion module 308 is further configured to perform data format conversion on the callback result according to the data packet format in the API interface request message; and, the apparatus further comprises an encryption module 309, the encryption module 309 being configured to:
and encrypting the callback result according to the callback result encryption rule.
In the embodiment of the application, optionally, the callback result encryption rule can be an RSA encryption algorithm, and the confidentiality is acknowledged in the industry because the RSA encryption algorithm is difficult to crack, and although the security is not clearly demonstrated, in the practical application, no example of cracking the RSA encryption algorithm exists, so the RSA encryption algorithm has higher data security.
In the embodiment of the application, optionally, the callback result encryption rule may be a Base64 encryption algorithm
It should be noted that, the request result may be determined according to a specific service requirement of the caller, and the present application does not limit the specific content of the request result.
Therefore, according to the embodiment of the application, the function modules with the same functions in different platforms can be integrated according to the function similarity, so that a general interface which is open to the outside is generated, and when a calling requester needs to call the function modules deployed on different platforms, the calling requester only needs to call the general interface and provide relevant field identifications, and the calling of the API interface between multiple platforms can be completed. On the other hand, the embodiment of the application can encrypt the data, so that the transmission of the data has higher security.
Example IV
Referring to fig. 4, fig. 4 is a schematic structural diagram of a client disclosed in a fourth embodiment of the present application, where the client may be used to execute a distributed intelligent API asynchronous callback method disclosed in a second embodiment of the present application. As shown in fig. 4, the client includes:
the encapsulation module 401 is configured to encapsulate the API interface request information, where the interface request information includes the user identifier, the API interface identifier, and/or the data message format.
When a client initiates a request, the client needs to encapsulate API interface request information borne on a request protocol, wherein the API interface request information comprises a user identifier, an API interface identifier and a data message format, the data message format is optional, and if the data message format is not filled in, the data message format defaults to a JSON format. Further optionally, in an embodiment of the present application, the data packet format is JSON format.
It should be noted that, the client is not limited to APP, web page, desktop application, etc., and any platform supporting http transport protocol may be used, which is not limited by the embodiment of the present application.
It should be noted that, regarding the POST request mode and the GET request mode, please refer to the description in the prior art, and the embodiment of the present application will not be repeated here
The client also includes:
the request information encryption module 402 is configured to encrypt the packaged API interface request information according to a preset encryption rule.
In the embodiment of the application, optionally, the preset encryption rule may be an RSA encryption algorithm, and the confidentiality is acknowledged in the industry because the RSA encryption algorithm is difficult to crack, and although the security is not clearly demonstrated, in practical application, no example of cracking the RSA encryption algorithm is generated, so that the RSA encryption algorithm has higher data security.
In the embodiment of the present application, optionally, the preset encryption rule may be a Base64 encryption algorithm.
As an optional implementation manner, in an embodiment of the present application, the client further includes:
and the sending module 403 is configured to send the encrypted API interface request information by using a POST method.
As an optional implementation manner, in an embodiment of the present application, the sending module 403 is further configured to send a public key request; and, the client further includes a second receiving module 404, where the second receiving module 404 is configured to receive the authentication public key.
In an embodiment of the present application, optionally, the client further includes:
and the monitoring module 405 is configured to set a callback monitoring sending result.
In an embodiment of the present application, optionally, the second receiving module 404 is further configured to receive a callback result.
In an embodiment of the present application, optionally, the client further includes:
and the callback result decryption module 406 is configured to decrypt the callback result.
In the embodiment of the application, optionally, the client sends the encrypted API interface request information in a GET manner.
In the embodiment of the application, optionally, an RSA algorithm is adopted to decrypt the callback result.
Therefore, according to the embodiment of the application, the API interfaces deployed on different platforms can be called by accessing the universal interface, and the embodiment of the application can encrypt the data in the callback request, so that the embodiment of the application has higher flexibility and data security.
Example five
Referring to fig. 5, fig. 5 is a schematic diagram of a distributed intelligent API asynchronous callback device according to a fifth embodiment of the present application. As shown in fig. 5, the apparatus 50 includes:
at least 1 memory cell 501;
a processing unit 502 coupled to the at least 1 memory unit;
wherein at least 1 memory unit is used for storing computer instructions;
the processing unit is used for calling the computer instruction to execute the distributed intelligent API asynchronous callback method disclosed in the first aspect of the application.
According to the embodiment of the application, the function modules with the same functions in different platforms can be integrated according to the function similarity, so that a pair of general interfaces which are open to the outside are generated, and when a calling requester needs to call the function modules deployed on different platforms, the calling requester only needs to call the general interfaces and provide relevant field identifications, and the calling of the API interfaces between multiple platforms can be completed. On the other hand, the embodiment of the application can encrypt the data, so that the transmission of the data has higher security.
Example six
An embodiment six of the present application discloses a computer-readable storage medium storing a computer program for electronic data exchange, where the computer program causes a computer to execute the steps in the distributed intelligent API asynchronous callback method described in any one of the first embodiment and the second embodiment.
According to the embodiment of the application, the function modules with the same functions in different platforms can be integrated according to the function similarity, so that a pair of general interfaces which are open to the outside are generated, and when a calling requester needs to call the function modules deployed on different platforms, the calling requester only needs to call the general interfaces and provide relevant field identifications, and the calling of the API interfaces between multiple platforms can be completed. On the other hand, the embodiment of the application can encrypt the data, so that the transmission of the data has higher security.
Example seven
An embodiment of the present application discloses a computer program product, where the computer program product includes a non-transitory computer readable storage medium storing a computer program, and the computer program is operable to cause a computer to perform the steps in the distributed intelligent API asynchronous callback method described in any one of the first embodiment and the second embodiment.
According to the embodiment of the application, the function modules with the same functions in different platforms can be integrated according to the function similarity, so that a pair of general interfaces which are open to the outside are generated, and when a calling requester needs to call the function modules deployed on different platforms, the calling requester only needs to call the general interfaces and provide relevant field identifications, and the calling of the API interfaces between multiple platforms can be completed. On the other hand, the embodiment of the application can encrypt the data, so that the transmission of the data has higher security.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and for parts of one embodiment that are not described in detail, reference may be made to related descriptions of other embodiments.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable memory. Based on such understanding, the technical solution of the present application may be embodied essentially or partly in the form of a software product, or all or part of the technical solution, which is stored in a memory, and includes several instructions for causing a computer device (which may be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present application. And the aforementioned memory includes: a U-disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a removable hard disk, a magnetic disk, or an optical disk, or other various media capable of storing program codes.
Those of ordinary skill in the art will appreciate that all or a portion of the steps in the various methods of the above embodiments may be implemented by a program that instructs associated hardware, and the program may be stored in a computer readable memory, which may include: flash disk, read-Only Memory (ROM), random access Memory (Random Access Memory, RAM), magnetic disk or optical disk.
The foregoing has outlined rather broadly the more detailed description of embodiments of the application, wherein the principles and embodiments of the application are explained in detail using specific examples, the above examples being provided solely to facilitate the understanding of the method and core concepts of the application; meanwhile, as those skilled in the art will have variations in the specific embodiments and application scope in accordance with the ideas of the present application, the present description should not be construed as limiting the present application in view of the above.

Claims (8)

1. A distributed intelligent API asynchronous callback method is applied to a server and is characterized by comprising the following steps:
step one, receiving API interface request information;
step two, data decryption is carried out on the API interface request information according to a preset decryption rule, and the decrypted API interface request information comprises an API interface identifier, a user identifier and a data message format;
comparing the data message format in the API interface request information with a data message format default set by a server side; if the format of the data message in the API interface request information is inconsistent with the default data message format, converting the format of the API interface request information according to the default data message format;
step three, verifying the user identification;
step four, according to the API interface identification, an API platform comprising the called API interface is screened from a plurality of API platforms according to a preset screening rule, wherein the called API interface is the API interface indicated by the API interface identification;
and step five, based on the API platform comprising the called API interface, asynchronously calling back the API interface to identify the indicated API interface.
2. The distributed intelligent API asynchronous callback method of claim 1, wherein prior to said step of receiving said API interface request message, said method further comprising:
receiving a public key request, and generating an authentication public key and an authentication secret key according to the public key request;
and sending the authentication public key.
3. The distributed intelligent API asynchronous callback method of claim 2, wherein between said step one and said step two, said method further comprises:
and verifying the API interface request information by using the authentication key.
4. The distributed intelligent API asynchronous callback method of claim 1, wherein screening the API platform including the called API interface from the plurality of API platforms according to the preset screening rule according to the API interface identification comprises:
and according to the API interface identification, selecting the API platform with the smallest current access amount from the plurality of API platforms.
5. The distributed intelligent API asynchronous callback method as claimed in any one of claims 1-2,
the API interface request information also comprises service task data;
and, after asynchronously calling back the API interface identifier of the API interface indicated, the method further comprises:
and sending a callback result, wherein the callback result is generated by the API interface indicated by the API interface identifier according to the service task data.
6. The distributed intelligent API asynchronous callback method of claim 5, wherein prior to said sending the callback result, said method further comprises:
performing data format conversion on the callback result according to the data message format in the API interface request information;
and encrypting the callback result according to the callback result encryption rule.
7. A server, comprising:
at least 1 memory cell;
a processing unit coupled to the at least 1 memory unit;
wherein the at least 1 memory unit is configured to store computer instructions;
the processing unit is configured to invoke the computer instructions to perform the steps of:
step one, receiving API interface request information;
step two, data decryption is carried out on the API interface request information according to a preset decryption rule, and the decrypted API interface request information comprises an API interface identifier, a user identifier and a data message format;
comparing the data message format in the API interface request information with a data message format default set by a server side; if the format of the data message in the API interface request information is inconsistent with the default data message format, converting the format of the API interface request information according to the default data message format;
step three, verifying the user identification;
step four, according to the API interface identification, an API platform comprising the called API interface is screened from a plurality of API platforms according to a preset screening rule, wherein the called API interface is the API interface indicated by the API interface identification;
and step five, based on the API platform comprising the called API interface, asynchronously calling back the API interface to identify the indicated API interface.
8. A computer storage medium having stored thereon computer instructions for performing the distributed intelligent API asynchronous callback method of any of claims 1-6 when called.
CN201910418187.XA 2019-05-20 2019-05-20 Distributed intelligent API asynchronous callback method and device Active CN110287037B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201910418187.XA CN110287037B (en) 2019-05-20 2019-05-20 Distributed intelligent API asynchronous callback method and device
PCT/CN2019/117893 WO2020233012A1 (en) 2019-05-20 2019-11-13 Distributed smart api asynchronous callback method, device, client terminal, service terminal, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910418187.XA CN110287037B (en) 2019-05-20 2019-05-20 Distributed intelligent API asynchronous callback method and device

Publications (2)

Publication Number Publication Date
CN110287037A CN110287037A (en) 2019-09-27
CN110287037B true CN110287037B (en) 2023-11-03

Family

ID=68002360

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910418187.XA Active CN110287037B (en) 2019-05-20 2019-05-20 Distributed intelligent API asynchronous callback method and device

Country Status (2)

Country Link
CN (1) CN110287037B (en)
WO (1) WO2020233012A1 (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110287037B (en) * 2019-05-20 2023-11-03 平安科技(深圳)有限公司 Distributed intelligent API asynchronous callback method and device
CN112272211A (en) * 2020-09-29 2021-01-26 京东数字科技控股股份有限公司 Service request processing method, device and system
CN112667371A (en) * 2020-12-07 2021-04-16 深圳市远行科技股份有限公司 Asynchronous task processing method, device, equipment and storage medium
CN113010372A (en) * 2020-12-08 2021-06-22 云智慧(北京)科技有限公司 Distributed implementation method and system for API monitoring
CN113609366A (en) * 2021-08-04 2021-11-05 深圳市元征科技股份有限公司 Data acquisition method and device, terminal equipment and readable storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1937811A (en) * 2006-08-28 2007-03-28 华为技术有限公司 Terminal and server communication method, system and device
CN102792269A (en) * 2010-03-12 2012-11-21 微软公司 System and method for providing information as a service via web services
CN103220259A (en) * 2012-01-20 2013-07-24 华为技术有限公司 Using method, call method, device and system of Oauth application programming interface (API)
CN106101258A (en) * 2016-07-08 2016-11-09 腾讯科技(深圳)有限公司 A kind of interface interchange method of mixed cloud, Apparatus and system
CN107291567A (en) * 2017-06-20 2017-10-24 山东浪潮通软信息科技有限公司 A kind of data calling method, device and system
CN107395648A (en) * 2017-09-06 2017-11-24 深圳峰创智诚科技有限公司 Authority control method and service end

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101616136B (en) * 2008-06-26 2013-05-01 阿里巴巴集团控股有限公司 Method for supplying internet service and service integrated platform system
CN102779255B (en) * 2012-07-16 2014-11-12 腾讯科技(深圳)有限公司 Method and device for judging malicious program
US10540190B2 (en) * 2017-03-21 2020-01-21 International Business Machines Corporation Generic connector module capable of integrating multiple applications into an integration platform
US11245706B2 (en) * 2017-03-27 2022-02-08 Oracle Systems Corporation Protection configuration for application programming interfaces
CN108830099A (en) * 2018-05-04 2018-11-16 平安科技(深圳)有限公司 Call verification method, device, computer equipment and the storage medium of api interface
CN108881448B (en) * 2018-06-27 2021-06-04 杭州贝购科技有限公司 API request processing method and device
CN109391689A (en) * 2018-10-08 2019-02-26 郑州云海信息技术有限公司 A kind of method and device that micro services application programming interface is called
CN110287037B (en) * 2019-05-20 2023-11-03 平安科技(深圳)有限公司 Distributed intelligent API asynchronous callback method and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1937811A (en) * 2006-08-28 2007-03-28 华为技术有限公司 Terminal and server communication method, system and device
CN102792269A (en) * 2010-03-12 2012-11-21 微软公司 System and method for providing information as a service via web services
CN103220259A (en) * 2012-01-20 2013-07-24 华为技术有限公司 Using method, call method, device and system of Oauth application programming interface (API)
CN106101258A (en) * 2016-07-08 2016-11-09 腾讯科技(深圳)有限公司 A kind of interface interchange method of mixed cloud, Apparatus and system
CN107291567A (en) * 2017-06-20 2017-10-24 山东浪潮通软信息科技有限公司 A kind of data calling method, device and system
CN107395648A (en) * 2017-09-06 2017-11-24 深圳峰创智诚科技有限公司 Authority control method and service end

Also Published As

Publication number Publication date
CN110287037A (en) 2019-09-27
WO2020233012A1 (en) 2020-11-26

Similar Documents

Publication Publication Date Title
CN110287037B (en) Distributed intelligent API asynchronous callback method and device
CN112218294B (en) 5G-based access method and system for Internet of things equipment and storage medium
US20190205540A1 (en) Host attestation
US11153085B2 (en) Secure distributed storage of encryption keys
US11677734B2 (en) System and method for pool-based identity authentication for service access without use of stored credentials
WO2017045552A1 (en) Method and device for loading digital certificate in ssl or tls communication
US9781109B2 (en) Method, terminal device, and network device for improving information security
US20150163211A1 (en) Unclonable id based chip-to-chip communication
US20180343258A1 (en) Access control values
CN104639534A (en) Website safety information uploading method and browser device
JP4843320B2 (en) Method and system for securely authenticating a service user of a remote service interface to a storage medium
WO2019178942A1 (en) Method and system for performing ssl handshake
US8977857B1 (en) System and method for granting access to protected information on a remote server
CN111800378B (en) Login authentication method, device, system and storage medium
CN110430065B (en) Application service calling method, device and system
WO2019165667A1 (en) Account migration method, apparatus, terminal device, and storage medium
US11811739B2 (en) Web encryption for web messages and application programming interfaces
CN114244508B (en) Data encryption method, device, equipment and storage medium
WO2022246997A1 (en) Service processing method and apparatus, server, and storage medium
CN112436936B (en) Cloud storage method and system with quantum encryption function
CN110933112B (en) Network access authentication method, device and storage medium
CN104767766A (en) Web Service interface verification method, Web Service server and client side
TW201430608A (en) Single-sign-on system and method
CN114175079A (en) System and method for biometric protocol standards
US11032708B2 (en) Securing public WLAN hotspot network access

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