Interface conversion method and device based on asymmetric encryption

Through the interface conversion method based on asymmetric encryption, the three-party interface is uniformly managed and public key encryption is performed, which solves the problems of complex interfaces and poor security, and realizes the security of data transmission and system robustness.

CN118916894APending Publication Date: 2024-11-08INSPUR ZHUOSHU BIG DATA IND DEV CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411079214.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-07
Publication Date
2024-11-08

AI Technical Summary

Technical Problem

The platform business faces the centralized entry of multiple tripartite business lines, resulting in complex interfaces and lack of unified security protection, and there is a risk of data leakage and tampering.

Method used

The interface conversion method based on asymmetric encryption is adopted to unify multiple three-party interfaces into one external interface, and the parameters are processed through public key encryption and private key decryption to ensure the security of data transmission.

Benefits of technology

It effectively guarantees the security of parameter transmission parameters, prevents tampering and leakage, increases the security barrier to the interface, and improves the robustness and flexibility of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118916894A_ABST
    Figure CN118916894A_ABST
Patent Text Reader

Abstract

The invention discloses an interface conversion method and equipment based on asymmetric encryption, belongs to the technical field of Internet, and is used for solving the technical problem of low security of a three-party interface butted to a service platform. The method is applied to an interface conversion platform, the interface conversion platform is used for converting a plurality of three-party interfaces into a unified external interface, and the method comprises the following steps: receiving a calling character string sent by a business front end calling the unified external interface; obtaining a first calling parameter through the calling character string, wherein the first calling parameter is used for indicating a three-party interface for providing service data for the service front end; obtaining a second calling parameter through the calling character string, and calling the three-party interface through the second calling parameter based on the first calling parameter; and returning data returned by the three-party interface to the business front end through the unified external interface.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of Internet technology, and in particular to an interface conversion method and device based on asymmetric encryption. Background Art

[0002] Platform businesses often face the concentrated entry of multiple third-party business lines. For example, grassroots data governance platforms face the entry of multiple data businesses such as elderly care, transportation, and real estate. Some business docking units can provide ready-made page addresses without the need for secondary development, but most of them provide third-party interfaces or third-party libraries, allowing the platform to conduct secondary development before entering the platform. During the secondary development process, if a third-party interface is provided and the interface does not provide a security mechanism, there is a great risk of exposing the interface, which in turn causes data leakage.

[0003] For business platforms, the more businesses there are, the more data interfaces or business interfaces they connect to. All interfaces connected to the business platform are complex and diverse, and the security protection is not unified. Some have extremely high security protection, some have extremely high encryption level requirements but their own interface protection technology is relatively poor, and some interfaces no longer have technical personnel to maintain them. Once data information is leaked when connected to the business platform, the losses will be huge. It is urgent for business platforms to strengthen the security protection of these third-party interfaces connected to the platform.

[0004] For third-party interfaces with high security levels, if effective security protection is not taken, the user information entered, such as mobile phone number, name, ID number, etc., will all be presented on the Internet, and private data will be exposed at a glance. At the same time, the input parameters may also be maliciously tampered with, resulting in interface data leakage. Summary of the invention

[0005] The present invention provides an interface conversion method and device based on asymmetric encryption, which are used to solve at least one of the above technical problems.

[0006] The present invention adopts the following technical solutions:

[0007] In the first aspect, the present invention provides an interface conversion method based on asymmetric encryption, which is applied to an interface conversion platform, wherein the interface conversion platform is used to convert several third-party interfaces into a unified external interface, and the method includes: receiving a call string issued by a business front end calling the unified external interface; obtaining a first call parameter through the call string, and the first call parameter is used to indicate a third-party interface that provides business data to the business front end; obtaining a second call parameter through the call string, and calling the third-party interface through the second call parameter based on the first call parameter; returning the data returned by the third-party interface to the business front end through the unified external interface.

[0008] In a possible implementation of the present invention, before the business front end calls the unified external interface, the calling string is generated, including: determining the parameters required when calling the unified external interface; performing string processing on the parameters using separators, and salting the obtained string; encrypting the salted string using a public key to obtain the calling string, and the public key is issued by the interface conversion platform.

[0009] In a possible implementation of the present invention, obtaining the first call parameter through the call string includes: receiving the interface name transmitted by the interface request header; determining the third-party interface providing business data through the interface name, and determining the private key corresponding to the third-party interface.

[0010] In a possible implementation of the present invention, if the third-party interface is not successfully found through the interface name in the interface conversion platform, a no such interface error is returned to the business front end.

[0011] In a possible implementation of the present invention, obtaining the second call parameter through the call string includes: accepting the encrypted string passed by the parameter body; decrypting the encrypted string using the private key corresponding to the three-party interface; if the encrypted string is parsed into a normal parameter type, calling the three-party interface to return business data.

[0012] In a possible implementation of the present invention, if the encrypted string is not successfully decrypted into a normal parameter type, a decryption error is returned to the service front end.

[0013] In a possible implementation of the present invention, the interface conversion platform converts several third-party interfaces into a unified external interface, including: receiving registration information of several third-party interfaces so that the several third-party interfaces are successfully registered on the interface conversion platform, the registration information including interface registration information filled in through the platform page and interface registration information obtained when registering through the registration interface; after registration is completed, the URL of the three-party interface and the interface name provided to the outside are bound to a data table.

[0014] In a possible implementation of the present invention, after the registration is completed, the method further includes: providing a corresponding public key for the successfully registered three-party interface, and sending the public key to the service front end.

[0015] In the second aspect, the present invention also provides an interface conversion device based on asymmetric encryption, the device comprising: a receiving module, receiving a call string issued by a business front end calling a unified external interface; an acquisition module, acquiring a first call parameter through the call string, the first call parameter being used to indicate a third-party interface that provides business data to the business front end; a calling module, acquiring a second call parameter through the call string, and calling the third-party interface through the second call parameter based on the first call parameter; and a return module, returning the data returned by the third-party interface to the business front end through the unified external interface.

[0016] In the third aspect, the present invention also provides an interface conversion device based on asymmetric encryption, the device comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor so that the at least one processor can execute an interface conversion method based on asymmetric encryption as described in any one of the above items.

[0017] The present invention provides an interface conversion method and device based on asymmetric encryption, which has the following beneficial effects:

[0018] The interface conversion method based on asymmetric encryption manages all three-party interfaces in a unified manner, and encrypts and protects the parameters transmitted externally through a unified external interface, effectively ensuring that the parameters transmitted are not parsed out and tampered with, while also avoiding the problem of service paralysis caused by high-frequency malicious interface flashing, and adding an effective security barrier to the original three-party interface; when performing interface conversion based on asymmetric encryption, the interface conversion platform uses a unified interface address externally, and distinguishes different three-party interface addresses called by the business front end according to the interface name in the interface request header. The interface parameter of the unified external interface is an encrypted string, that is, the parameter required to call the three-party interface is a string encrypted with a public key. If the interface is captured, only a string of encrypted strings can be seen, and there is no corresponding private key, and the corresponding original three-party interface parameters cannot be decrypted. This ensures the security of the interface parameter data, while preventing business data from being tampered with or intercepted during the retrieval process, avoiding the loss of important related data. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings described below are only some embodiments recorded in the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:

[0020] Figure 1A flow chart of an interface conversion method based on asymmetric encryption provided by the present invention;

[0021] Figure 2 A business architecture diagram of an interface conversion platform provided by the present invention;

[0022] Figure 3 A complete process diagram of data calling provided by the present invention;

[0023] Figure 4 A structural diagram of an interface conversion device based on asymmetric encryption provided by the present invention. DETAILED DESCRIPTION

[0024] In order to enable those skilled in the art to better understand the technical solutions in the present invention, the technical solutions in the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0025] The present invention provides an interface conversion platform for all three-party interfaces. The platform uniformly performs asymmetric encryption processing. The external interface is unique. The three-party interfaces are different, and the parameters passed in when calling are different. The public key encrypts the parameters and then transmits them. The interface conversion platform decrypts them according to the business-specific private key. The interface conversion platform then calls the three-party interface. The asymmetric encryption call of the interface conversion platform directly avoids the parameters compared to the direct call of the front end, and the security of the interface and data is greatly improved.

[0026] The method of the present invention is described in detail below with reference to the accompanying drawings.

[0027] Figure 1 A flow chart of an interface conversion method based on asymmetric encryption provided by the present invention, such as Figure 1 As shown, the interface conversion method in the present invention at least includes the following execution steps:

[0028] Step 101: Receive a call string sent by a business front end calling a unified external interface.

[0029] The present invention realizes interface conversion based on an interface conversion platform. Figure 2 As shown, by unifying several connected three-party interfaces, a unified external interface is obtained, thereby ensuring the security of the interface and the security of the data.

[0030] In a possible implementation of the present invention, before the interface conversion platform is put into use, the three-party interface needs to be registered on the interface conversion platform. Specifically, Figure 2When the third-party interface is registered and bound on the interface conversion platform, a unique interface request name is generated on the platform, hereinafter referred to as: requestName. There are two ways to bind and register. You can directly register through the registration interface, or fill in the original third-party interface information on the platform page to complete the registration operation. The core of registration is to bind the URL of the original third-party interface and the external requestName to the data table. At the same time, the platform provides the ability to modify and delete the URL and parameters of the bound interface.

[0031] After the registration of the three-party interface is completed, the interface conversion platform provides a unique unified external interface to the outside world. When the business front end calls any registered three-party interface to obtain data, it will be implemented through the unified external interface. However, before calling the unified external interface, the business front end needs to generate a call string. Specifically, the parameters required for calling the unified external interface are determined according to the data source that the business front end wants to obtain. The data source here refers to the three-party interface that the business front end wants to call. After the required parameters are string processed and salted, they are encrypted using the public key issued by the interface conversion platform to obtain the call string. It should be noted that the string processing and salting processes here can be implemented through existing solutions or algorithms, and the present invention will not be repeated here.

[0032] The business front end sends the generated call string to the interface conversion platform to call the unified external interface.

[0033] Step 102: Obtain a first calling parameter by calling a character string.

[0034] In one example, when different business front ends call the unified external interface, the interface name in the request header is different depending on the three-party interface being called. The interface name parameter in the unified external interface request header is used to distinguish different interfaces. The interface conversion platform finds the corresponding bound original three-party interface based on the interface name passed in the request header, i.e., the aforementioned requestName. That is, the aforementioned first call parameter is the interface name.

[0035] Therefore, after the interface conversion platform receives the call string sent by the business front end, it finds the corresponding third-party interface according to the interface name passed in the interface request header, and obtains the private key corresponding to the third-party interface.

[0036] If the corresponding third-party interface is not found by the interface name in the interface conversion platform, an error indicating that there is no such interface is returned to the business front end.

[0037] Step 103: Obtain a second calling parameter through the calling string, and call the third-party interface through the second calling parameter based on the first calling parameter.

[0038] After successfully finding the interface name and private key, use the private key to decrypt the string encrypted by the public key to obtain the parameters required by the three-party interface. After calling the three-party interface with this parameter to obtain the business data, it is returned normally to the business front end for business processing.

[0039] That is, the aforementioned second call parameter is the encrypted string passed by the parameter body. After finding the private key through the first call parameter, that is, the interface name, the second call parameter, that is, the encrypted string, is decrypted using the private key to obtain the normal parameter type.

[0040] If the normal parameter type cannot be obtained after decrypting the encrypted string, a decryption error is returned to the business front end. The normal parameter type here refers to the original parameter required when calling the third-party interface.

[0041] Step 104: Return the data returned by the three-party interface to the business front end through the unified external interface.

[0042] After successfully calling the third-party interface according to the normal parameter type, the third-party interface returns the business data, and then returns the business data to the business front end through the unified external interface, completing the process of calling the interface to obtain data.

[0043] Figure 3 A complete process diagram of data calling provided by the present invention, such as Figure 3 As shown in the figure, in this implementation process, the business front end first encrypts the input parameters, which prevents the input parameters from being intercepted or modified during the interface call process. The number and name of the input parameters are not visible, and the intercepted interface cannot copy or forge data to access the interface illegally. Specifically, the parameters are first processed as strings. For example, the parameters {a:b,c:d,e:f} become "a:b&c:d&e:f" after string processing. A salted string is added to this string, and finally the salted string is encrypted with the public key, and the encrypted string is used to call the unified external interface.

[0044] Furthermore, the unified external interface obtains two main parameters. The first main parameter is the interface name requestName passed by the interface request header. According to this interface name, the specific third-party interface to be called is found, and the private key corresponding to the third-party interface is obtained. If the corresponding third-party interface is not found in this step, the error of no such interface will be directly returned to the business front end; if the third-party interface and private key are successfully found, the second main parameter, that is, the encrypted string passed by the parameter body Body, is used to start decrypting the string using the corresponding private key, and a decrypted string is obtained. The salted string and separator are removed to parse out the normal parameter type. At this time, there are two situations. One is that it is successfully parsed into a normal parameter type and the corresponding third-party interface is called. The business data returned by the three-party interface call is returned to the business front end normally by the unified external interface; the second is that the encrypted string cannot be successfully parsed into a normal parameter type. At this time, it means that there are problems with parameter transmission or string encryption errors. At this time, the unified external interface can return the corresponding error to the business front end.

[0045] Based on the same inventive concept, the present invention also provides an interface conversion device based on asymmetric encryption.

[0046] Figure 4 The present invention provides a schematic diagram of an interface conversion device based on asymmetric encryption. Figure 4 As shown, the interface conversion device 400 based on asymmetric encryption in the present invention specifically includes: at least one processor 401; and a memory 403 that is communicatively connected to the at least one processor 401 (connected via a bus 402); wherein the memory 403 stores instructions that can be executed by the at least one processor 401, so that the at least one processor 401 can execute an interface conversion method based on asymmetric encryption as described in the above embodiment.

[0047] In one possible implementation of the present invention, the aforementioned processor is used to execute, receiving a call string issued by a business front end calling the unified external interface; obtaining a first call parameter through the call string, wherein the first call parameter is used to indicate a third-party interface that provides business data to the business front end; obtaining a second call parameter through the call string, and calling the third-party interface through the second call parameter based on the first call parameter; and returning the data returned by the third-party interface to the business front end through the unified external interface.

[0048] In addition, an interface conversion device based on asymmetric encryption provided in the present invention may also include: a receiving module, receiving a call string issued by a business front end calling a unified external interface; an acquisition module, acquiring a first call parameter through the call string, wherein the first call parameter is used to indicate a third-party interface that provides business data to the business front end; a calling module, acquiring a second call parameter through the call string, and calling the third-party interface through the second call parameter based on the first call parameter; and a return module, returning the data returned by the third-party interface to the business front end through the unified external interface.

[0049] The present invention provides an interface conversion method and device based on asymmetric encryption, which also has the following beneficial effects:

[0050] 1) The three-party interfaces registered on the interface conversion platform are unified into a unified external interface using asymmetric encryption, and the parameter privacy protection of the unified external interface is realized using public and private keys, which improves the security and standardization of the program code, makes the system more flexible, and also improves the robustness of program operation.

[0051] 2) Unified into one external interface for management, which is convenient for the platform to manage. Various third-party interfaces are unified into one interface for external opening, making the diversity of interfaces more standardized and unified, easier for front-end development to connect, and the connection documents are more concise and unified, which greatly improves the connection capabilities of the business layer, improves R&D efficiency, and makes the system more standardized and unified.

[0052] 3) All interfaces are managed in a unified manner on one platform. For errors or failures in third-party interfaces, there is no need to modify the front-end program or repackage and re-upload the interface. The platform can directly add, delete, modify, and query the original interface. At the same time, the interface can be added or removed at any time according to the requirements of the business end, making the program more flexible.

[0053] 4) Use asymmetric encryption to perform public key encryption and private key decryption on parameters, so that when irregular input parameters and abnormal encryption parameters are transmitted, they can be effectively intercepted at the unified interface layer of the conversion platform, reducing the number of invalid calls to the business layer interface and avoiding service paralysis caused by calling the original business interface due to irregular parameters. The above behavior characteristics make the program run more robust.

[0054] The various embodiments of the present invention are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0055] The device and method provided by the present invention correspond one to one, and therefore, the device embodiment also has similar beneficial technical effects as the corresponding method. Since the beneficial technical effects of the method have been described in detail above, the beneficial technical effects of the device embodiment will not be repeated here.

[0056] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0057] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0058] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0059] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0060] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0061] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0062] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0063] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0064] The above are only embodiments of the present invention and are not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. An interface conversion method based on asymmetric encryption, characterized in that: Applied to an interface conversion platform, the interface conversion platform is used to convert a number of three-party interfaces into a unified external interface, the method includes: Receiving a call string sent by the business front end calling the unified external interface; Acquire a first call parameter through the call string, where the first call parameter is used to indicate a third-party interface that provides business data to the business front end; Acquire a second calling parameter through the calling string, and call the third-party interface through the second calling parameter based on the first calling parameter; The data returned by the three-party interface is returned to the business front end through the unified external interface.

2. The interface conversion method based on asymmetric encryption according to claim 1, characterized in that: Before the business front end calls the unified external interface, the calling string is generated, including: Determine the parameters required when calling the unified external interface; Perform string processing on the parameter using a separator, and perform salt processing on the obtained string; The calling string is obtained by encrypting the salted string with a public key, and the public key is issued by the interface conversion platform.

3. The interface conversion method based on asymmetric encryption according to claim 1, characterized in that: Obtaining a first calling parameter through the calling character string includes: The interface name passed by the receiving interface request header; The third-party interface that provides business data is determined by the interface name, and the private key corresponding to the third-party interface is determined.

4. The interface conversion method based on asymmetric encryption according to claim 3 is characterized in that: If the third-party interface is not successfully found through the interface name in the interface conversion platform, an error indicating that there is no such interface is returned to the business front end.

5. The interface conversion method based on asymmetric encryption according to claim 1, characterized in that: Obtaining a second calling parameter through the calling string includes: Accept the encrypted string passed by the parameter body; Decrypting the encrypted string using the private key corresponding to the three-party interface; If the encrypted string is parsed into a normal parameter type, the third-party interface is called to return the business data.

6. The interface conversion method based on asymmetric encryption according to claim 5, characterized in that: If the encrypted string is not successfully decrypted into a normal parameter type, a decryption error is returned to the business front end.

7. The interface conversion method based on asymmetric encryption according to claim 1, characterized in that: The interface conversion platform converts several third-party interfaces into a unified external interface, including: Receive registration information of several third-party interfaces so that the several third-party interfaces are successfully registered on the interface conversion platform, the registration information including interface registration information filled in through the platform page and interface registration information obtained when registering through the registration interface; After registration is completed, the URL of the third-party interface and the interface name provided to the outside are bound to the data table.

8. The interface conversion method based on asymmetric encryption according to claim 7, characterized in that: After the registration is completed, the method further includes: The corresponding public key is provided for the successfully registered third-party interface, and the public key is sent to the service front end.

9. An interface conversion device based on asymmetric encryption, characterized in that: The device comprises: The receiving module receives the call string sent by the business front end calling the unified external interface; An acquisition module, which acquires a first call parameter through the call string, where the first call parameter is used to indicate a third-party interface that provides business data to the business front end; A calling module, which obtains a second calling parameter through the calling string, and calls the third-party interface through the second calling parameter based on the first calling parameter; The return module returns the data returned by the three-party interface to the business front end through the unified external interface.

10. An interface conversion device based on asymmetric encryption, characterized in that: The device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, so that the at least one processor can execute the interface conversion method based on asymmetric encryption according to any one of claims 1-8.