Interface calling method, device, terminal equipment and storage medium
By receiving the reported messages of abnormal interface call, obtaining proxy information and generating proxy access links, the security risks and high cost problems caused by relying on the intranet service layer interface in the prior art are solved, and safe and efficient interface call reuse is achieved.
Patent Information
- Application Number
- CN202211407038.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-10
- Publication Date
- 2025-04-15
- Estimated Expiration
- 2042-11-10
AI Technical Summary
The prior art cannot solve interface call exceptions by reusing open interfaces, and relying on the intranet service layer interfaces leads to security risks and high costs.
By receiving the reported message of the target interface call exception, obtaining the proxy identity and proxy key, generating a proxy access link, and accessing the link to reuse the open interface, realizing interface calls that do not rely on the user key.
It realizes the reuse of open interfaces without relying on user keys, which improves security and reduces the cost of exception resolution.
Smart Images

Figure CN115941198B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of communication technology, and in particular to an interface calling method, device, terminal equipment and storage medium. Background Art
[0002] The user end can call the open interface provided by the platform according to the caller identifier (appkey) and the key (appsecret). In the process of calling the open interface, various abnormal situations may occur, such as data loss, access abnormality, etc.
[0003] In the prior art, due to concerns about user information security, the platform development side cannot obtain the user's appsecret, and often needs to indirectly call the intranet business layer interface based on the appkey and other related calling information provided by the user side to resolve exceptions.
[0004] In the process of implementing the present invention, the inventors found that there are at least the following technical problems in the prior art:
[0005] Existing technologies cannot resolve exceptions by reusing open interfaces. Relying on intranet business layer interfaces not only leads to security risks on the platform, but also increases the cost of resolving exceptions. Summary of the invention
[0006] The embodiment of the present invention provides an interface calling method, an apparatus, a terminal device and a storage medium, which can reuse an open interface without relying on a user's key, and has high security and low cost.
[0007] In a first aspect, an embodiment of the present invention provides an interface calling method, comprising:
[0008] Receive a report message of target interface call exception; the report message includes a caller identifier and service parameters;
[0009] Obtaining an agent ID and an agent key corresponding to the agent ID;
[0010] Generate a proxy access link according to the caller identifier, the service parameter, the proxy identifier and the proxy key;
[0011] The proxy access link is accessed to call the target interface.
[0012] In a second aspect, an embodiment of the present invention provides an interface calling device, including:
[0013] A report message receiving module, used to receive a report message of target interface call exception; the report message includes a caller identifier and service parameters;
[0014] An agent information acquisition module, used to acquire an agent identification and an agent key corresponding to the agent identification;
[0015] An agent link generation module, used to generate an agent access link according to the caller identifier, the service parameter, the agent identifier and the agent key;
[0016] The proxy link access module is used to access the proxy access link to call the target interface.
[0017] In a third aspect, an embodiment of the present invention provides a terminal device, including:
[0018] one or more processors;
[0019] A memory for storing one or more programs;
[0020] When the one or more programs are executed by the one or more processors, the one or more processors implement the interface calling method as described in any embodiment of the present invention.
[0021] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the interface calling method as described in any embodiment of the present invention.
[0022] An interface calling method, apparatus, terminal device and storage medium provided by an embodiment of the present invention receive a report message of a target interface calling exception; the report message includes a caller identifier and business parameters. Obtain an agent identifier and a proxy key corresponding to the agent identifier. Generate a proxy access link based on the caller identifier, the business parameters, the agent identifier and the proxy key. According to the embodiment of the present invention, when a target interface calling exception occurs when a user terminal calls the target interface, by generating a proxy access link, it is possible to reuse an open interface without relying on the user's key. By accessing the proxy access link to call the target interface, the calling exception can be reproduced, and can be investigated and resolved based on logs and other data. Compared with the prior art, the embodiment of the present invention can not only reuse open interfaces, but also has high security and low cost. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0024] Figure 1A flowchart of an interface calling method provided by an embodiment of the present invention is shown;
[0025] Figure 2 A flowchart of an optional interface calling method provided by an embodiment of the present invention is shown;
[0026] Figure 3 A flowchart of an interface calling method provided by an embodiment of the present invention is shown;
[0027] Figure 4 A flowchart of an interface calling method provided by an embodiment of the present invention is shown;
[0028] Figure 5 A flowchart of generating a proxy access link based on an interface calling method provided by an embodiment of the present invention is shown;
[0029] Figure 6 A flowchart supporting interface calling in an interface calling method provided by an embodiment of the present invention is shown;
[0030] Figure 7 A logical processing block diagram of an interceptor in an interface calling method provided by an embodiment of the present invention is shown;
[0031] Figure 8 A schematic diagram showing the structure of an interface calling device provided by an embodiment of the present invention is shown;
[0032] Fig. 9 A schematic diagram of the hardware structure of a terminal device provided by an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0033] In order to make the purpose, technical scheme and advantages of the present invention clearer, the technical scheme of the present invention will be clearly and completely described through the implementation method with reference to the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention. In the following embodiments, optional features and examples are provided in each embodiment at the same time. The various features recorded in the embodiments can be combined to form multiple optional schemes, and each numbered embodiment should not be regarded as only one technical scheme. The acquisition, storage, use, processing, etc. of data in the technical scheme of this application comply with the relevant provisions of national laws and regulations.
[0034] Figure 1A flowchart of an interface calling method provided by an embodiment of the present invention is shown. The interface calling method provided by an embodiment of the present invention can be applied to the scenario of calling an interface, and is particularly applicable to the case of reusing an interface with a calling exception. The method can be executed by an interface calling device, which is implemented in software and / or hardware, and is preferably configured in a terminal device, such as a research and development end device of an open platform that provides a target interface.
[0035] like Figure 1 As shown, the interface calling method provided in the embodiment of the present invention may include the following steps:
[0036] S110, receiving a report message of target interface call exception; the report message includes a caller identifier and business parameters.
[0037] Among them, the target interface can be understood as an interface that needs to be called when the user terminal issues a service request, and can be used to provide the user terminal with a business service corresponding to the business request. In actual applications, the target interface call exception may include target interface call failure and target interface call timeout, etc. The reasons for the abnormal problem in the target interface call are: network link abnormality and gateway layer business abnormality, etc. The network link abnormality may include but is not limited to user room network abnormality and domain name resolution abnormality. Gateway layer business abnormality may include at least one of the gateway layer Internet Protocol (Internet Protocol Address, IP) address abnormality, user terminal blacklist error and parameter verification failure. It should be noted that in an embodiment of the present invention, the user terminal can be a computer software user terminal, a computer web user terminal, a mobile phone software user terminal, a mobile phone web user terminal, a TV user terminal, etc.
[0038] In an embodiment of the present invention, the reporting message can be understood as a message of the target interface calling exception fed back by the user end. Optionally, the format of the reporting message can be a message format. The caller identifier included in the reporting message can be understood as the identifier of the user end where the target interface calling exception occurs when calling the target interface. The service parameters included in the reporting message can be understood as the actual parameters for service processing received by the target interface and transmitted by the user end. The number of service parameters can be one, two or more than two. In addition, the reporting message can also include the message generation time and the interface name of the target interface, etc.
[0039] S120: Obtain an agent identifier and an agent key corresponding to the agent identifier.
[0040] The proxy party identifier can be understood as the identifier of the proxy used to handle target interface call exceptions during business processing. In the embodiment of the invention, the proxy key can be a randomly generated random key or a pre-set key.
[0041] In the embodiment of the present invention, there are multiple ways to obtain the agent identifier, and the agent identifier can be obtained in any of the following ways:
[0042] As an optional implementation in an embodiment of the present invention, after determining the caller identifier in the report message, the agent identifier corresponding to the caller identifier in the report message can be determined based on the pre-constructed correspondence between the caller identifier and the agent identifier. It should be noted that the correspondence between the caller identifier and the agent identifier can be constructed according to actual needs. For example, one caller identifier may correspond to one agent identifier, or multiple caller identifiers may correspond to one agent identifier. In other words, an agent can act on behalf of at least one caller to handle the problem of abnormal target interface calls, that is, an agent can reproduce the problem of abnormal interface calls of one or more callers.
[0043] As another optional implementation in the embodiment of the present invention, after determining the service parameters in the report message, the agent identifier corresponding to the service parameters in the report message can be determined based on the mapping relationship between the pre-configured service parameters and the agent identifier. It should be noted that the mapping relationship between the agent identifier and the service parameters can be configured and modified according to specific service requirements.
[0044] As another optional implementation in the embodiment of the present invention, after determining the caller identifier and business parameters in the reporting message, the agent identifier corresponding to the business parameters and the caller identifier can be determined based on the correspondence between the pre-configured agent identifier and the business parameters and the caller identifier.
[0045] The proxy key corresponding to the proxy party identifier can be obtained in any of the following ways:
[0046] In one embodiment, after the agent identifier is determined, the agent key corresponding to the agent identifier can be determined according to the correspondence between the agent identifier and the agent key. It should be noted that the correspondence between the agent identifier and the agent key is one-to-one.
[0047] In another embodiment, after determining the proxy party identifier, a key may be generated by calling a key generation algorithm. The generated key is then used as a proxy key corresponding to the proxy party identifier. It should be noted that the key generation algorithm may be a symmetric cryptography algorithm or an asymmetric cryptography algorithm.
[0048] S130: Generate a proxy access link according to the caller identifier, business parameters, agent identifier and proxy key.
[0049] The proxy access link may be understood as a link for accessing the target interface without relying on the user's key.
[0050] Specifically, a link generation method for generating a proxy access link is predefined. The caller identifier, business parameters, proxy identifier, and proxy key are passed as actual parameters to the formal parameters of the link generation method. After the parameter passing is completed, the proxy access link can be generated by executing the link generation method.
[0051] In an embodiment of the present invention, generating a proxy access link by executing a link generation method may include: by executing the link generation method, combining a caller identifier, a business parameter, an agent identifier and an agent key to form a link that complies with the parameter transfer protocol standard, i.e., a proxy access link.
[0052] In an embodiment of the present invention, after generating a proxy access link, it may also include: sending the proxy access link to the user end corresponding to the reported message, so that the user end can access the proxy access link. The advantage of doing so is that by allowing the user end to access, it is possible to implement abnormal troubleshooting of the entire link (including the user's computer room, etc.). Among them, a timestamp may be spliced into the proxy access link, so that the user can access it within the validity period (for example, 1 minute, 6 minutes, or 15 minutes, etc.), which can improve the security of the platform.
[0053] S140: The access agent accesses the link to call the target interface.
[0054] Specifically, the proxy access link is accessed so that the target interface can be called. In order to avoid the situation where the target interface cannot be called after the proxy access link is accessed, before accessing the proxy access link, it can be determined whether the proxy access link is valid. If the proxy access link is valid, the proxy access link is accessed; if the proxy access link is invalid, a prompt message is generated to prompt that the proxy access link is invalid, and the prompt message is reported.
[0055] Figure 2 A flowchart of an optional interface calling method provided by an embodiment of the present invention is shown. Figure 2According to the technical solution of the embodiment of the present invention, the R&D end of the open platform can generate a proxy access link of the target interface of the open platform based on the caller identifier (appKey) provided by the user end. Then, the R&D end or the user end of the open platform can access the generated proxy access link through a browser to call the target interface of the open platform again, and then obtain the response result, and reproduce the interface problem. The R&D end of the open platform can be understood as the agent. Doing so not only eliminates the need for technical personnel to manually troubleshoot interface call exceptions, but also avoids the risk of user key leakage during the problem troubleshooting process, and realizes the reuse of open interfaces without obtaining user keys, thereby locating exceptions.
[0056] The technical solution of the embodiment of the present invention receives a report message of a target interface call exception; the report message includes a caller identifier and business parameters. Obtain an agent identifier and a proxy key corresponding to the agent identifier. Generate a proxy access link based on the caller identifier, business parameters, agent identifier and proxy key. In the embodiment of the present invention, when a target interface call exception occurs when the user terminal calls the target interface, by generating a proxy access link, it is possible to reuse the open interface without relying on the user's key. By accessing the proxy access link to call the target interface, the call exception can be reproduced, and it can be investigated and resolved based on logs and other data. Compared with the prior art, the embodiment of the present invention can not only reuse open interfaces, but also has high security and low cost.
[0057] Figure 3 A flow chart of an interface calling method provided by an embodiment of the present invention is shown. The method of the embodiment of the present invention can be combined with the various optional schemes in the interface calling method provided in the above embodiment. The interface calling method provided by the embodiment of the present invention is described in detail. Optionally, obtaining an agent identifier and a proxy key corresponding to the agent identifier includes: selecting an agent identifier from each candidate agent identifier applied in advance; wherein each candidate agent identifier is enabled with the calling right of the target interface during the application process; wherein the proxy key corresponding to the agent identifier is a candidate agent key corresponding to the selected candidate agent identifier.
[0058] like Figure 3 As shown, the interface calling method in the embodiment of the present invention may include the following steps:
[0059] S210, receiving a report message of target interface call exception; the report message includes a caller identifier and business parameters.
[0060] S220: Select an agent ID from the candidate agent IDs applied in advance, and determine the agent key corresponding to the selected agent ID.
[0061] Among them, the candidate agent identifier can be understood as the identifier of the agent that is pre-applied for handling interface call exceptions. The number of candidate agent identifiers can be one, two, or more than two. In practical applications, the number of candidate agent identifiers is usually multiple. Each candidate agent identifier is granted the calling permission of the target interface during the application process. The agent key corresponding to the agent identifier is the candidate agent key corresponding to the selected candidate agent identifier. The candidate agent key can be understood as a key that is pre-set or assigned for each candidate agent. It should be noted that the generation method of the candidate agent key can be the same as the generation method of the agent key.
[0062] In the embodiment of the present invention, there are multiple ways to select an agent identifier from the candidate agent identifiers applied in advance. The agent identifier can be selected from the candidate agent identifiers in any of the following ways:
[0063] In one embodiment, a candidate agent identifier may be randomly selected from the candidate agent identifiers of the preset application as the agent identifier.
[0064] In another embodiment, for each candidate agent identifier, the caller identifier and / or service parameters pre-configured for the candidate agent identifier are determined. Thus, the caller identifier and / or service parameters included in the report message are compared with the caller identifier and / or service parameters pre-configured for the candidate agent identifier. If the comparison is consistent, the candidate agent identifier can be used as the agent identifier. If it is inconsistent, it can be determined that the candidate agent identifier is not the agent identifier.
[0065] In the embodiment of the present invention, the benefit of applying for candidate agent identifiers in advance is that it can effectively prevent other agent identifiers from maliciously using the interface proxy access function. The purpose of selecting an agent identifier from the candidate agent identifiers applied in advance is to select an agent identifier that can be reasonably registered to use the interface proxy access function, thereby further improving the security of the interface call.
[0066] Specifically, after selecting an agent identifier from the candidate agent identifiers applied in advance, the key corresponding to the selected candidate agent identifier can be used as the agent key.
[0067] It should be noted that in the embodiment of the present invention, when applying for at least one candidate agent identifier in advance, it is also possible to pre-open a traffic package and set the available balance and other access consumption resources for each candidate agent, so that when the user terminal accesses the proxy access link, it can avoid consuming the user terminal's resources and not affect the user. It is also necessary to note that the amount of the traffic package pre-opened for each candidate agent and the available balance can be the same or different.
[0068] S230: Generate a proxy access link according to the caller identifier, business parameters, agent identifier and proxy key.
[0069] S240: Access the proxy access link to call the target interface.
[0070] Based on the above embodiment, the embodiment of the present invention refines the technical features of obtaining the agent identification and the agent key corresponding to the agent identification. In addition, the interface calling method proposed in the embodiment of the present invention and the above embodiment belongs to the same inventive concept, and the technical details not described in detail in this embodiment can be referred to the above embodiment, and this embodiment has the same beneficial effects as the above embodiment.
[0071] Figure 4 A flow chart of an interface calling method provided by an embodiment of the present invention is shown. The method of the embodiment of the present invention can be combined with the various optional schemes in the interface calling method provided in the above embodiment. The interface calling method provided by the embodiment of the present invention is described in detail. Optionally, generating a proxy access link based on the caller identifier, business parameters, agent identifier and agent key may include: generating proxy business parameters based on the caller identifier and business parameters; determining a signature based on the agent business parameters, agent identifier and agent key; generating a proxy access link based on the signature.
[0072] On this basis, the calling process of the target interface may include: in response to the successful verification of the proxy access link, extracting the proxy business parameters and the proxy party identifier from the proxy access link; when the proxy business parameters include the caller identifier and the proxy user name corresponding to the proxy party identifier is included in the preset user name, using the user name corresponding to the caller identifier to perform business processing.
[0073] like Figure 4 As shown, the interface calling method in the embodiment of the present invention may include the following steps:
[0074] S310, receiving a report message of target interface call exception; the report message includes a caller identifier and business parameters.
[0075] S320: Obtain an agent identifier and an agent key corresponding to the agent identifier.
[0076] S330: Generate proxy service parameters according to the caller identifier and service parameters.
[0077] The proxy service parameters may be obtained by combining the caller identifier and the service parameters. For example, the caller identifier and the service parameters may be concatenated, and the concatenated data may be used as the proxy service parameters. In order to more quickly and effectively identify the caller identifier and / or parameter identifier, the concatenation of the caller identifier and the service parameters may include, but is not limited to, concatenating the caller identifier and the service parameters based on a preset concatenation symbol. The preset concatenation symbol may be pre-set according to actual needs, such as "-", " / " or "*".
[0078] In an embodiment of the present invention, the proxy party identifier and proxy key can be used to simulate the process of a real user terminal accessing a network link based on the caller identifier and the corresponding key, so as to transmit the relevant information of the user terminal to the business layer interface, so that the interface call can be made again based on the relevant information of the user terminal.
[0079] S340: Determine the signature according to the proxy service parameter, the proxy party identifier and the proxy key.
[0080] Specifically, the parameter names corresponding to the proxy service parameters, the proxy party identifier, and the proxy key are determined. Then, the parameter names can be sorted according to the order of the ASCII code table to obtain the sorted order of the parameter names. Then, the sorted parameter names can be spliced together with the corresponding proxy service parameters, the proxy party identifier, and the proxy key to obtain a spliced string. Then, a signature can be generated based on the spliced string and the preset signature algorithm.
[0081] The generation of the signature based on the concatenated string and the preset signature algorithm may include: encoding the concatenated string using utf-8 to obtain an encoded byte stream, and then performing digest processing on the encoded byte stream using the preset signature algorithm, thereby generating the signature.
[0082] It should be noted that the preset signature algorithm can be any algorithm used to generate a signature in the prior art, such as the MD5 Message-Digest Algorithm (MD5 algorithm), the HMAC_MD5 algorithm, etc., which are not specifically limited here. It should also be noted that in the embodiment of the present invention, the signature is determined based on the proxy service parameters, the proxy party identifier and the proxy key to prevent malicious tampering by hackers during the interface call process.
[0083] S350: Generate a proxy access link based on the signature.
[0084] Specifically, after the signature is generated, the signature and other parameters used to generate the proxy access link can be concatenated to obtain a link that complies with the parameter transfer protocol standard, namely the proxy access link. Among them, the other parameters used to generate the proxy access link may include but are not limited to a timestamp.
[0085] Figure 5 The flowchart of the proxy access link generation based on the interface calling method provided by the embodiment of the present invention is shown. Figure 5 , the R&D end of the open platform can add business system parameters (targetAppKey) based on the original input parameters (i.e. business parameters) of the target interface according to the report message of the target interface call exception, and obtain the proxy business parameters; the targetAppKey can be considered as the appKey of the user end. After that, the signature can be calculated by combining the proxy business parameters, the proxy party identifier (proxyAppkey) and the proxy key (appSecret) extracted by the open platform server. Then, the interface access link can be generated based on the calculated signature.
[0086] S360: Access the proxy access link to call the target interface.
[0087] In an embodiment of the invention, the calling process of the target interface may include: in response to successful verification of the proxy access link, extracting the proxy business parameters and the proxy party identifier from the proxy access link; when the proxy business parameters include the caller identifier and the proxy user name corresponding to the proxy party identifier is included in the preset user name, using the user name corresponding to the caller identifier to perform business processing.
[0088] The preset user name may be a pre-set proxy user name corresponding to each proxy party identifier. By pre-setting the proxy user name, malicious calls of the interface can be prevented, thereby avoiding information leakage.
[0089] Specifically, the gateway layer of the open platform can verify the signature of the proxy access link. Since the format of the proxy access link is the same as that of the normal access link, the gateway layer does not need additional logical processing. If the gateway layer verification result is successful, the business layer of the open platform can intercept the proxy access link and perform parameter extraction operations. The business layer can thus extract the proxy business parameters and the proxy party identifier from the proxy access link. If the proxy business parameters include the caller identifier, and the proxy user name corresponding to the proxy party identifier is included in the preset user name, then the user name corresponding to the caller identifier can be used for normal business processing.
[0090] Figure 6 FIG. 1 shows a flowchart of an interface calling method provided by an embodiment of the present invention that supports interface calling. Figure 6After the gateway layer successfully verifies the signature, the business layer can obtain the proxy user name corresponding to the proxy party identifier (i.e. Figure 6 The proxy userId in the proxy service parameter and the caller ID in the proxy service parameter (i.e. Figure 6 Then, the business layer can verify the proxy user name and determine the corresponding user name (i.e. Figure 6 The corresponding user name identified by the caller can then be used for business processing.
[0091] Based on the above embodiment, the calling process of the target interface may further include: when the proxy service parameter does not include the caller identifier, determining the proxy party identifier as the caller identifier.
[0092] Specifically, if the proxy service parameter does not include the caller ID, then this call can be treated as a normal call of the target interface, rather than a proxy call after the call exception. In this case, the proxy ID can be used as the caller ID. This allows normal calls and proxy calls to share the same target interface call logic, reducing the cost of solving exceptions. In this case, the proxy ID can be used to determine the user name corresponding to the caller ID, and then perform service processing.
[0093] Based on the above embodiment, the calling process of the target interface may further include: when the proxy service parameter includes a caller identifier and the proxy user name corresponding to the proxy identifier is not included in the preset user name, feeding back a call failure message.
[0094] Specifically, if the proxy service parameter includes the caller ID, and the proxy user name corresponding to the proxy user ID is not included in the preset user name, then the interface call can be considered as an illegal call. At this time, a call failure message can be generated and feedback can be given.
[0095] Figure 7 The following is a logical processing diagram of an interceptor in an interface calling method provided by an embodiment of the present invention. Figure 7 The interceptor can be an interceptor at the business layer. Obtaining the input parameters of the target interface request through the interceptor can be understood as obtaining the various request parameters that are transmitted to the business layer through the interceptor. After obtaining the request parameters, the interceptor can determine whether there are business system parameters (i.e. Figure 7 If there are business system parameters, it is possible to determine whether the proxy user name corresponding to the proxy party identifier in the request parameter is included in the preset user name, that is, Figure 7Determine whether the userId is a proxy userId. If it is included in the preset user name, you can query the user name corresponding to the targetAPPkey through the business system parameters (i.e. Figure 7 The user ID in the caller ID is used to perform business processing.
[0096] On this basis, if the user name corresponding to the agent identifier in the request parameter is not the agent user name, that is, the agent user name corresponding to the agent identifier in the request parameter is not included in the preset user name, a call failure message can be fed back. If there is no business system parameter in the request parameter, the user name corresponding to the agent identifier in the business system parameter can be used for business processing.
[0097] Based on the above embodiment, the embodiment of the present invention refines the generation of the proxy access link according to the caller identifier, business parameters, agent identifier and agent key. On this basis, the "target interface calling process" is also added. In addition, the interface calling method proposed in the embodiment of the present invention and the above embodiment belongs to the same inventive concept. The technical details not described in detail in this embodiment can be referred to the above embodiment, and this embodiment has the same beneficial effects as the above embodiment.
[0098] Figure 8 The structure diagram of an interface calling device provided by an embodiment of the present invention is shown. The embodiment of the present invention is applicable to the scenario of calling an interface, and is particularly applicable to the situation of reusing an interface with a calling exception. The interface calling device provided by the present invention can implement the interface calling method provided by the above embodiment.
[0099] like Figure 8 As shown, the interface calling device in the embodiment of the present invention may include: a report message receiving module 410, an agent information obtaining module 420, an agent link generating module 430 and an agent link accessing module 440; wherein,
[0100] The report message receiving module 410 is used to receive the report message of the target interface call exception; the report message includes the caller identifier and business parameters; the proxy information acquisition module 420 is used to obtain the agent identifier and the proxy key corresponding to the agent identifier; the proxy link generation module 430 is used to generate a proxy access link according to the caller identifier, business parameters, agent identifier and proxy key; the proxy link access module 440 is used to access the proxy access link to call the target interface.
[0101] An interface calling device provided by an embodiment of the present invention receives a reporting message of a target interface calling exception through a reporting message receiving module; the reporting message includes a caller identifier and business parameters. The agent identifier and the agent key corresponding to the agent identifier are obtained through the agent information acquisition module. A proxy access link is generated according to the caller identifier, business parameters, agent identifier and agent key through the agent link generation module. The proxy access link is accessed through the agent link access module to call the target interface, and the calling exception can be reproduced, and can be investigated and resolved based on log data. Compared with the prior art, the embodiment of the present invention can not only reuse open interfaces, but also has high security and low cost.
[0102] In some optional implementations, the proxy information acquisition module 420 is specifically used to:
[0103] An agent ID is selected from among the candidate agent IDs applied for in advance; wherein each candidate agent ID has the calling authority of the target interface opened during the application process; wherein the agent key corresponding to the agent ID is the candidate agent key corresponding to the selected candidate agent ID.
[0104] In some optional implementations, the proxy link generation module 430 is specifically configured to:
[0105] Generate proxy business parameters according to the caller ID and business parameters; determine the signature according to the proxy business parameters, the proxy ID and the proxy key; and generate a proxy access link according to the signature.
[0106] In some optional implementations, the interface calling device may further include: an interface calling module, configured to:
[0107] In response to successful verification of the proxy access link, extracting the proxy service parameter and the proxy party identifier from the proxy access link;
[0108] When the proxy service parameter includes the caller identifier, and the proxy user name corresponding to the proxy identifier is included in the preset user name, the user name corresponding to the caller identifier is used to perform service processing.
[0109] In some optional implementations, the interface calling module may also be used to:
[0110] When the proxy service parameter does not include the caller identifier, the proxy identifier is determined as the caller identifier.
[0111] In some optional implementations, the interface calling module may also be used to:
[0112] When the proxy service parameter includes the caller identifier and the proxy user name corresponding to the proxy identifier is not included in the preset user name, a call failure message is fed back.
[0113] In some optional implementations, the interface calling device may further include: a link sending module, configured to:
[0114] The proxy access link is sent to the user end corresponding to the report message, so that the user end can access the proxy access link.
[0115] The interface calling device provided in the embodiment of the present invention belongs to the same inventive concept as the interface calling method provided in the above embodiment. The technical details not fully described in the embodiment of the present invention can be referred to the above embodiment, and the embodiment of the present invention has the same beneficial effects as the above embodiment.
[0116] Fig. 9 The hardware structure diagram of a terminal device provided by an embodiment of the present invention is shown. The terminal device in the embodiment of the present invention may include but is not limited to mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Fig. 9 The terminal device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0117] like Fig. 9 As shown, the terminal device 500 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage device 508 to a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the terminal device 500 are also stored. The processing device 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0118] Typically, the following devices may be connected to the I / O interface 505: an input device 506 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 507 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 508 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 509. The communication device 509 may allow the terminal device 500 to communicate with other devices wirelessly or by wire to exchange data. Fig. 9The terminal device 500 is shown as having various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0119] In particular, according to an embodiment of the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present invention includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 509, or installed from the storage device 508, or installed from the ROM 502. When the computer program is executed by the processing device 501, the above-mentioned functions defined in the interface calling method provided by the embodiment of the present invention or are executed.
[0120] The terminal provided in the embodiment of the present invention and the interface calling method provided in the above embodiment belong to the same inventive concept. The technical details not fully described in the embodiment of the present invention can be referred to the above embodiment, and the embodiment of the present invention has the same beneficial effects as the above embodiment.
[0121] An embodiment of the present invention provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the interface calling method provided by or in the above embodiment is implemented.
[0122] It should be noted that the computer-readable storage medium in the embodiment of the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM) or a flash memory (FLASH), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In an embodiment of the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, device or device. In an embodiment of the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer readable signal media may also be any computer readable medium other than computer readable storage media, which may send, propagate, or transmit programs for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0123] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.
[0124] The computer-readable storage medium may be included in the terminal device, or may exist independently without being installed in the terminal device.
[0125] The terminal device stores and carries one or more programs. When the one or more programs are executed by the terminal device, the terminal device:
[0126] Receive a report message of an abnormal target interface call; the report message includes a caller ID and business parameters; obtain an agent ID and a proxy key corresponding to the agent ID; generate a proxy access link based on the caller ID, business parameters, agent ID and proxy key; access the proxy access link to call the target interface.
[0127] Computer program code for performing the operations of the present invention may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0128] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the function pages marked in the square box can occur in a different order from the order marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0129] The units involved in the embodiments of the present invention may be implemented by software or hardware, wherein the name of a unit does not limit the unit itself in some cases.
[0130] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0131] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. An interface calling method, characterized in that: include: Receive a report message of target interface call exception; the report message includes a caller identifier and service parameters; wherein the service parameters are actual parameters for service processing received by the target interface and transmitted by the user end; Obtaining an agent ID and an agent key corresponding to the agent ID; Generate a proxy access link according to the caller identifier, the service parameter, the proxy identifier and the proxy key; The proxy access link is accessed to call the target interface.
2. The method according to claim 1, characterized in that The obtaining of the agent identification and the agent key corresponding to the agent identification includes: Selecting an agent ID from the candidate agent IDs applied for in advance; wherein each candidate agent ID has the calling authority of the target interface opened during the application process; The proxy key corresponding to the proxy identifier is a candidate proxy key corresponding to the selected candidate proxy identifier.
3. The method according to claim 1, characterized in that The generating of the proxy access link according to the caller identifier, the service parameter, the proxy identifier and the proxy key comprises: Generate proxy service parameters according to the caller identifier and the service parameters; Determining a signature according to the proxy service parameter, the proxy party identifier and the proxy key; Based on the signature, a proxy access link is generated.
4. The method according to claim 1, characterized in that: The calling process of the target interface includes: In response to the proxy access link being successfully verified, extracting the proxy service parameter and the proxy party identifier from the proxy access link; When the proxy service parameter includes the caller identifier, and the proxy user name corresponding to the proxy identifier is included in the preset user name, the user name corresponding to the caller identifier is used to perform service processing.
5. The method according to claim 4, characterized in that Also includes: When the proxy service parameter does not include the caller identifier, the proxy identifier is determined as the caller identifier.
6. The method according to claim 4, characterized in that Also includes: When the proxy service parameter includes the caller identifier and the proxy user name corresponding to the proxy identifier is not included in the preset user name, a call failure message is fed back.
7. The method according to claim 1, characterized in that After generating the proxy access link, the method further includes: The proxy access link is sent to a user terminal corresponding to the reporting message, so that the user terminal accesses the proxy access link.
8. An interface calling device, characterized in that: include: A report message receiving module, used to receive a report message of target interface call exception; The report message includes a caller identifier and service parameters; wherein the service parameters are actual parameters for service processing received by the target interface and transmitted by the user end; An agent information acquisition module, used to acquire an agent identification and an agent key corresponding to the agent identification; An agent link generation module, used to generate an agent access link according to the caller identifier, the service parameter, the agent identifier and the agent key; The proxy link access module is used to access the proxy access link to call the target interface.
9. A terminal device, characterized in that: The terminal comprises: one or more processors; A memory for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the interface calling method as described in any one of claims 1-7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the interface calling method as described in any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Resource access method and device
CN112217853A
Problem interface positioning method and device, electronic equipment and storage medium
CN114567543A