Methods, apparatus and computer devices for invoking encrypted data service interfaces
By generating the access request message body and generating the access request message based on parameter configuration rules, the problem of customized development of data service interfaces in Internet finance risk control is solved, and stability and access speed are improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-19
- Publication Date
- 2026-04-03
AI Technical Summary
In internet finance risk control, calling encrypted data service interfaces from different data service providers requires customized code development, resulting in a large development workload, complex testing, and poor system stability, making it impossible to quickly meet business needs.
By obtaining the configuration information of the encrypted data service interface, the body of the access request message is generated, and the access request message is generated based on the preset parameter configuration rules, reducing the development of customized code and adapting to the frequent updates of the data service provider.
It reduced the cost of human and material resources and improved the stability and access speed of the encrypted data service interface calling system.
Smart Images

Figure CN115426142B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of internet risk control technology, and in particular to a method, apparatus and computer device for calling an encrypted data service interface. Background Technology
[0002] In the field of internet finance risk control technology, in order to better assess user risk, it is necessary to query users' credit data. Obtaining this credit data requires calling the data service interface (API) provided by the data service provider. These data service interfaces are generally implemented based on the HTTP protocol, and different interfaces have different signatures and encryption methods. Financial institutions need to invest a lot of manpower in code development to achieve the integration of data service interfaces.
[0003] HTTP protocol messages consist of URL, Query, Header, Method, and Body. To ensure the security of internet transmission, the parameters and signature verification mechanisms of HTTP APIs provided by different data service providers are generally different. This results in the need for customized code development for each interface connection, especially since the signature and encryption / decryption methods of each data service provider are different, requiring a significant investment of development resources. Moreover, each connection adds a large amount of new calling code, often leading to a huge workload for development and complex testing, making it difficult to quickly meet the requirements of business development. In addition, since the interfaces of data service providers are often adjusted, this leads to frequent updates and releases of the caller's code, which can affect the stability of the system.
[0004] Therefore, there is an urgent need to propose a method, apparatus, and computer equipment for calling encrypted data service interfaces that can reduce code development work and improve the access speed of HTTP APIs. Summary of the Invention
[0005] Therefore, it is necessary to provide a method, apparatus, and computer device for calling encrypted data service interfaces that can reduce code development and improve the access speed of HTTP APIs, in order to address the above-mentioned technical problems.
[0006] On the one hand, a method for calling an encrypted data service interface is provided, the method comprising:
[0007] Step A: Obtain the configuration information of the encrypted data service interface and generate the access request message body;
[0008] Step B: Obtain the configuration data of the encrypted data service interface and the input parameters of the upstream business system;
[0009] Step C: Based on the access request message body, the configuration data of the encrypted data service interface, and the input parameters of the upstream business system, an access request message is generated according to the preset parameter configuration rules;
[0010] Step D: Send the access request message to the encrypted data server interface to invoke the encrypted data service interface.
[0011] In one embodiment, the preset parameter configuration rules include: configuring the access request message body to which the request parameter belongs, wherein the access request message body includes HTTP Header, HTTP Query Parameter, and HTTPBody, and the request parameter includes configuration data of the encrypted data service interface, input parameters of the upstream business system, and built-in functions; obtaining the type of the request parameter based on the request message body and the request parameter; obtaining the source of the request parameter based on the type of the request parameter, configuring the request parameter to the access request message body according to the preset request parameter processing rules; and generating an access request message based on the access request message body.
[0012] In one embodiment, the preset parameter processing rules include: if the source of the request parameter is a constant, then directly read the request parameter constant and configure the request parameter constant to the access request message body; if the source of the request parameter is an input parameter variable, then obtain the input parameter of the upstream business system and configure the input parameter of the upstream business system to the access request message body; if the source of the request parameter is an environment variable, then obtain the configuration data of the encrypted data service interface and configure the configuration data of the encrypted data service interface to the access request message body; if the source of the request parameter is a system variable, then generate parameter information based on the built-in function and configure the parameter information to the access request message body.
[0013] In one embodiment, the preset parameter processing rule further includes: after obtaining the source of the request parameter, determining whether the request parameter is configured with a conversion function; if the request parameter is configured with a conversion function, then converting the request parameter based on the conversion function, and configuring the converted request parameter to the access request message body.
[0014] In one embodiment, when the request parameters are configured with conversion functions, the method further includes: determining the number of conversion functions; if the number of conversion functions is one, then converting the request parameters based on the conversion functions; if the number of conversion functions is greater than one, then generating a conversion function chain based on the conversion functions, and converting the request parameters based on the conversion function chain.
[0015] In one embodiment, when converting the request parameters based on the conversion function chain, the process includes: sequentially obtaining the conversion functions in the conversion function chain from beginning to end; obtaining the type of the conversion function; and calling the conversion function based on the type of the conversion function, wherein the conversion function includes built-in functions and script functions; and after each conversion function converts the request parameters, determining whether there are any uncalled conversion functions in the conversion function chain, until there are no uncalled conversion functions in the conversion function chain.
[0016] In one embodiment, if the number of conversion functions is greater than one, a conversion function chain is generated based on the conversion functions. When the request parameters are converted based on the conversion function chain, the method includes: sequentially obtaining the conversion functions in the conversion function chain from front to back; determining whether there is a conversion function before the conversion function; if there is no conversion function before the conversion function, then using the request parameters as the input parameters of the conversion function; if there is a conversion function before the conversion function, then using the output parameters of the conversion function before the conversion function as the input parameters of the conversion function.
[0017] In one embodiment, if the number of conversion functions is greater than one, a conversion function chain is generated based on the conversion functions. When the request parameters are converted based on the conversion function chain, the method includes: determining whether there is a conversion function after the conversion function; if there are conversion parameters after the conversion function, using the output parameter of the conversion function as the input parameter of the conversion function after the conversion function; if there is no conversion function after the conversion function, configuring the converted request parameters to the access request message body.
[0018] On the other hand, an apparatus for invoking an encrypted data service interface is provided, the apparatus comprising:
[0019] The acquisition and generation unit is used to acquire configuration information of the encrypted data service interface, generate the access request message body, and also to acquire configuration data of the encrypted data service interface and input parameters of the upstream business system.
[0020] The request message generation unit is used to generate an access request message based on the access request message body, the configuration data of the encrypted data service interface and the input parameters of the upstream business system, according to a preset parameter configuration rule.
[0021] A sending unit is used to send the access request message to the encrypted data server interface to invoke the encrypted data service interface.
[0022] In another aspect, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to perform the following steps:
[0023] Step A: Obtain the configuration information of the encrypted data service interface and generate the access request message body;
[0024] Step B: Obtain the configuration data of the encrypted data service interface and the input parameters of the upstream business system;
[0025] Step C: Based on the access request message body, the configuration data of the encrypted data service interface, and the input parameters of the upstream business system, an access request message is generated according to the preset parameter configuration rules;
[0026] Step D: Send the access request message to the encrypted data server interface to invoke the encrypted data service interface.
[0027] In another aspect, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, performs the following steps:
[0028] Step A: Obtain the configuration information of the encrypted data service interface and generate the access request message body;
[0029] Step B: Obtain the configuration data of the encrypted data service interface and the input parameters of the upstream business system;
[0030] Step C: Based on the access request message body, the configuration data of the encrypted data service interface, and the input parameters of the upstream business system, an access request message is generated according to the preset parameter configuration rules;
[0031] Step D: Send the access request message to the encrypted data server interface to invoke the encrypted data service interface.
[0032] The aforementioned method, apparatus, and computer device for invoking an encrypted data service interface include: obtaining configuration information of the encrypted data service interface and generating an access request message body; obtaining configuration data of the encrypted data service interface and input parameters from an upstream business system; generating an access request message based on the access request message body, the configuration data of the encrypted data service interface, and the input parameters from the upstream business system, according to preset parameter configuration rules; and sending the access request message to the encrypted data server interface to invoke the encrypted data service interface. By using a configurable approach to invoke the encrypted data service interface, on the one hand, customized code development is eliminated for each encrypted data service interface, especially for data service providers with different signature and decryption methods, reducing the need for significant development and testing resources and lowering human and material costs; on the other hand, it adapts to the frequent updates and releases of encrypted data service interfaces by data service providers, contributing to improved stability of the entire encrypted data service interface invocation system. Attached Figure Description
[0033] Figure 1 The flow of calling the encrypted data service interface in one embodiment is intended;
[0034] Figure 2 The flow of calling the encrypted data service interface in one embodiment is intended;
[0035] Figure 3 The flow of calling the encrypted data service interface in one embodiment is intended;
[0036] Figure 4 This is a structural block diagram of a device that invokes an encrypted data service interface in one embodiment;
[0037] Figure 5 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0038] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0039] Example 1
[0040] In one embodiment, a method for invoking an encrypted data service interface is provided, such as... Figure 1As shown, after a client establishes a connection with the data caller server through the business system, it sends a request to the data caller server to invoke the encrypted data service interface. The request format includes: request address, data type, request method, and request message. Upon receiving the request, the server provides corresponding response information, a success or error code, followed by the returned access response message. This method is implemented based on a third-party data management backend. Invoking the encrypted data service interface relies on a pre-generated third-party data management backend to achieve configurable and automated access to the HTTP API. HTTP (Hypertext Transfer Protocol) is an application layer protocol used to transmit hypermedia documents (such as HTML). HTTP is designed for communication between web browsers and web servers. A client sending an HTTP request to the server consists of four parts: request line, request headers, a blank line, and request data. The request line includes the Method, URL (resource access), etc., and the request data is also called the body. An API is a computing interface that defines the interaction between multiple software intermediaries, the types of calls or requests that can be made, how to make calls or send requests, the data format to be used, and the conventions to be followed.
[0041] In one embodiment, system configuration in the third-party data management backend includes: configuring the input parameters of the data service interface to be called, wherein the request input parameters include: request protocol, request method and input parameter variable configuration, and the input parameter configuration diagram is shown in Figure 1.
[0042] In one embodiment, system configuration in the third-party data management backend includes: request message configuration; wherein, the request message configuration includes request message body configuration. Specifically, the HTTP protocol includes HTTP Header, HTTP Query Parameter, and HTTP Body. Header and Query Parameter are one-dimensional key-value format data, while Body is most commonly in Form and JSON formats. Form format is also a key-value format; JSON format Body is a multi-dimensional data body that can be nested, and JSON contains data types such as Boolean, String, Number, Array, and Object. Both data formats can be configured through a nested tree structure. Each parameter in the third-party request message requires a related configuration, which includes key configuration information such as position, type, source parameter, and processing function. The parameter position configuration includes identifying which part of the HTTP Header, Query Parameter, or Request Body the request parameter belongs to. The parameter type configuration includes: the data type of the request parameter, supporting Boolean, String, Number, Array, and Object types. The parameter source configuration includes: the source configuration of the request parameter, which can be configured as a constant, variable, or function. The processing function can be configured in conjunction with the parameter source; that is, after obtaining the source of the request parameters, the request parameters are further processed based on the processing function. It should be understood that there can be multiple processing functions, and when there are multiple processing functions, a processing function chain can be generated based on each processing function.
[0043] In one embodiment, constants can be directly input; variables include upstream input parameters, data service provider environment variables (such as data service provider authorized account keys, etc.), system variables (UUID, timestamps, etc.); functions can also be directly selected, including encryption / decryption functions, signature functions, logic functions, etc.; encryption / decryption functions are used to encrypt and decrypt the requested data, signature functions are used to generate a signature for the request to prevent data forgery, and logic functions support complex logical operations.
[0044] In one embodiment, system configuration in the third-party data management backend includes: encrypted data service interface authentication configuration. Specifically, the signature verification mechanism is a crucial and complex part of calling the encrypted data service interface, typically divided into two authentication mechanisms: AK / SK and Token authentication. AK / SK authentication can be implemented using a signature function, which obtains the context, retrieves and processes the corresponding parameters, and finally generates a signature. Token authentication is similar to the interface configuration process; it requires first calling an interface from the data service provider to obtain a token, and then extracting the token based on the data returned by the interface. We added the token acquisition path and validity period configuration to the interface configuration. The context is used to store all data and related functions involved in the entire process of calling the encrypted service data interface.
[0045] In one embodiment, system configuration in the third-party data management backend includes: transmission data encryption / decryption configuration. The transmission data encryption / decryption configuration is to encrypt and send the request message sent by the client to the data service provider, and to decrypt the access response message returned by the data service provider to the client. The transmission data encryption / decryption configuration of different data service providers is implemented by using custom functions. For example, the encryption and decryption of transmission data can be implemented through function chaining, such as: interface input parameters -> sorting - filtering non-empty input parameters -> processing using the function implode -> adding the private key of the data service provider -> performing MD5 processing -> converting to uppercase.
[0046] In one embodiment, system configuration in the third-party data management backend also includes function configuration. Specifically, functions are small pieces of code with single responsibility, and they do not depend on each other, used to implement complex and flexible configurations.
[0047] In one embodiment, the function includes built-in functions and user-defined functions. Built-in functions are functions with pre-embedded code, while user-defined functions are implemented through configured Groovy scripts. Currently, the functions are mainly divided into encryption / decryption functions, signature functions, and logic functions. The function processing is as follows: After obtaining parameters, in addition to normal assignment, the parameters need to be processed, such as generating signatures or hashing the parameters. To achieve configuration and automation, Groovy language is used for processing. These processing methods are abstracted into functions; each new processing method is a new function, and the function's input parameter is the context. In this application, all relevant request parameters are placed in this context. The context's data storage uses a Map data structure, which is a key-value data structure. This allows for easy retrieval of context parameter values within the function. For example, when signing, it is often necessary to obtain upstream and downstream parameters, which can be obtained through the Context object. To maximize function reusability, chained functions can be used, with multiple functions executed sequentially.
[0048] Example 2
[0049] In one embodiment, such as Figure 2 As shown, a method for calling an encrypted data service interface is provided, the method comprising:
[0050] Step A: Obtain the configuration information of the encrypted data service interface and generate the access request message body;
[0051] Step B: Obtain the configuration data of the encrypted data service interface and the input parameters of the upstream business system;
[0052] Step C: Based on the access request message body, the configuration data of the encrypted data service interface, and the input parameters of the upstream business system, an access request message is generated according to the preset parameter configuration rules;
[0053] Step D: Send the access request message to the encrypted data server interface to invoke the encrypted data service interface.
[0054] Based on the above method of calling encrypted data service interfaces, the calls to encrypted data service interfaces are completed in a configurable manner. On the one hand, there is no need to develop customized code for each encrypted data service interface. Especially for data service providers with different signing and decryption methods, it is not necessary to invest a lot of development and testing resources, which can reduce the investment costs of human and material resources. On the other hand, it can adapt to the frequent updates and releases of encrypted data service interfaces by data service providers, which helps to improve the stability of the entire encrypted data service interface calling system.
[0055] In one embodiment, the preset parameter configuration rules include: configuring the access request message body to which the request parameter belongs, wherein the access request message body includes HTTP Header, HTTP Query Parameter, and HTTPBody, and the request parameter includes configuration data of the encrypted data service interface, input parameters of the upstream business system, and built-in functions; obtaining the type of the request parameter based on the request message body and the request parameter; obtaining the source of the request parameter based on the type of the request parameter, configuring the request parameter to the access request message body according to the preset request parameter processing rules; and generating an access request message based on the access request message body.
[0056] Specifically, in practical application scenarios, the HTTP Header also includes relevant information for identifying the user; the HTTP Query Parameter includes operation information sent by the client, such as retrieving resources (GET operation) or sending an HTML form (POST operation); the HTTP Body includes the main information content, such as GET HTTP requests needing to include URL Query request parameters, POST HTTP requests generally sending transmission form information, or JSON format messages sent to the server; the types of the request parameters include String, Number, Boolean, Array, and Object.
[0057] In one embodiment, generating an access request message based on the access request message body includes: first, setting the request message body to an HTTPRequest transport object; then, setting the various data portions of the HTTPRequest transport object to the relevant objects of the HTTPClient tool; and finally, calling the data interface based on HTTPClient.
[0058] In one embodiment, the preset parameter processing rules include: if the source of the request parameter is a constant, then directly read the request parameter constant and configure the request parameter constant to the access request message body; if the source of the request parameter is an input parameter variable, then obtain the input parameter of the upstream business system and configure the input parameter of the upstream business system to the access request message body; if the source of the request parameter is an environment variable, then obtain the configuration data of the encrypted data service interface and configure the configuration data of the encrypted data service interface to the access request message body; if the source of the request parameter is a system variable, then generate parameter information based on the built-in function and configure the parameter information to the access request message body.
[0059] Specifically, when the request parameter is `appid`, it is determined that the source of the request parameter is a constant, and the configuration is directly based on the fixed value allocated by the data service provider. When the request parameter is `idcard`, it is determined that the source of the request parameter is an input variable, and the request parameter needs to be converted using a conversion function based on the interface call requirements of the data service provider. For example, two conversion functions, `Md5Hash` and `toUpperCase`, are configured for chained processing to generate MD5 hashes, and then the hashes are converted to uppercase. When the request parameter is `name`, it is determined that the source of the request parameter is an input variable, and the input parameters from the upstream business system are directly obtained, and the request parameter is converted using a conversion function based on the interface call requirements of the data service provider. When the request parameter is `requestid` or `timestam`, it is determined that the request parameter is a system variable, and a request parameter format conforming to the interface call requirements of the data service provider is generated based on built-in functions (`UUID` and `TIMESTAMP`).
[0060] In one embodiment, the preset parameter processing rule further includes: after obtaining the source of the request parameter, determining whether the request parameter is configured with a conversion function; if the request parameter is configured with a conversion function, then converting the request parameter based on the conversion function, and configuring the converted request parameter to the access request message body.
[0061] In one embodiment, such as Figure 3 As shown, when the request parameters are configured with conversion functions, the method further includes: determining the number of conversion functions; if the number of conversion functions is one, then converting the request parameters based on the conversion functions; if the number of conversion functions is greater than one, then generating a conversion function chain based on the conversion functions, and converting the request parameters based on the conversion function chain.
[0062] In one embodiment, when converting the request parameters based on the conversion function chain, the process includes: sequentially obtaining the conversion functions in the conversion function chain from beginning to end; obtaining the type of the conversion function; and calling the conversion function based on the type of the conversion function, wherein the conversion function includes built-in functions and script functions; and after each conversion function converts the request parameters, determining whether there are any uncalled conversion functions in the conversion function chain, until there are no uncalled conversion functions in the conversion function chain.
[0063] In one embodiment, if the number of conversion functions is greater than one, a conversion function chain is generated based on the conversion functions. When the request parameters are converted based on the conversion function chain, the method includes: sequentially obtaining the conversion functions in the conversion function chain from front to back; determining whether there is a conversion function before the conversion function; if there is no conversion function before the conversion function, then using the request parameters as the input parameters of the conversion function; if there is a conversion function before the conversion function, then using the output parameters of the conversion function before the conversion function as the input parameters of the conversion function.
[0064] In one embodiment, if the number of conversion functions is greater than one, a conversion function chain is generated based on the conversion functions. When the request parameters are converted based on the conversion function chain, the method includes: determining whether there is a conversion function after the conversion function; if there are conversion parameters after the conversion function, using the output parameter of the conversion function as the input parameter of the conversion function after the conversion function; if there is no conversion function after the conversion function, configuring the converted request parameters to the access request message body.
[0065] In one embodiment, the method further includes: the encrypted data service provider receiving the access request message through the encrypted data service interface; the encrypted data service provider generating an access request response based on the access request message, and generating an access request response ciphertext by encrypting the access request response; using the access request response ciphertext as an input parameter of a preset decryption function to decrypt the access request response ciphertext, and returning the decrypted access request response to the caller of the encrypted data service interface, i.e., the upstream business system.
[0066] It should be understood that, although Figure 1-3 The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order in which these steps are executed, and they can be performed in other orders. Figure 1-3 At least some of the steps in the process may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.
[0067] Example 3
[0068] In one embodiment, such as Figure 4As shown, an apparatus for invoking an encrypted data service interface is provided, comprising: an acquisition and generation unit, a request message generation unit, and a sending unit, wherein:
[0069] The acquisition and generation unit is used to acquire configuration information of the encrypted data service interface, generate the access request message body, and also to acquire configuration data of the encrypted data service interface and input parameters of the upstream business system.
[0070] The request message generation unit is used to generate an access request message based on the access request message body, the configuration data of the encrypted data service interface and the input parameters of the upstream business system, according to a preset parameter configuration rule.
[0071] A sending unit is used to send the access request message to the encrypted data server interface to invoke the encrypted data service interface.
[0072] In one embodiment, the apparatus further includes a configuration unit for configuring the access request message body to which the request parameters belong. The access request message body includes an HTTP Header, an HTTP Query Parameter, and an HTTP Body. The request parameters include configuration data of the encrypted data service interface, input parameters of the upstream business system, and built-in functions. The acquisition and generation unit is further configured to acquire the type of the request parameters based on the request message body and the request parameters. The configuration unit is further configured to acquire the source of the request parameters based on the type of the request parameters and configure the request parameters to the access request message body according to preset request parameter processing rules. The acquisition and generation unit is further configured to generate an access request message based on the access request message body.
[0073] In one embodiment, the acquisition and generation unit is further configured to: directly read the request parameter constant if the source of the request parameter is a constant; acquire the input parameters of the upstream business system if the source of the request parameter is an input parameter variable; acquire the configuration data of the encrypted data service interface if the source of the request parameter is an environment variable; and generate parameter information based on the built-in function if the source of the request parameter is a system variable. The configuration unit is further configured to: configure the request parameter constant to the access request message body; configure the input parameters of the upstream business system to the access request message body; configure the configuration data of the encrypted data service interface to the access request message body; and configure the parameter information to the access request message body.
[0074] In one embodiment, the apparatus further includes a judging unit and a conversion unit; the judging unit is used to determine whether the request parameter is configured with a conversion function after obtaining the source of the request parameter; the conversion unit is used to convert the request parameter based on the conversion function if the request parameter is configured with a conversion function; the configuration unit is used to configure the converted request parameter to the access request message body.
[0075] In one embodiment, the determining unit is further configured to determine the number of conversion functions; the conversion unit is further configured to convert the request parameters based on the conversion functions if the number of conversion functions is one; and generate a conversion function chain based on the conversion functions and convert the request parameters based on the conversion function chain if the number of conversion functions is greater than one.
[0076] In one embodiment, the conversion unit is configured to sequentially obtain the conversion functions in the conversion function chain from front to back; obtain the type of the conversion function; and call the conversion function based on the type of the conversion function, wherein the conversion function includes built-in functions and script functions; the judgment unit is further configured to determine whether there are any uncalled conversion functions in the conversion function chain after each conversion function has converted the request parameters, until there are no uncalled conversion functions in the conversion function chain.
[0077] In one embodiment, the conversion unit is further configured to sequentially obtain the conversion functions in the conversion function chain from front to back; the judgment unit is further configured to determine whether there is a conversion function before the conversion function; the conversion unit is further configured to, if there is no conversion function before the conversion function, use the request parameter as the input parameter of the conversion function; if there is a conversion function before the conversion function, use the output parameter of the conversion function before the conversion function as the input parameter of the conversion function.
[0078] Specific limitations regarding the apparatus for invoking the encrypted data service interface can be found in the limitations regarding the method for invoking the encrypted data service interface above, and will not be repeated here. Each module in the aforementioned apparatus for invoking the encrypted data service interface can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in the computer device in hardware form, or stored in the memory of the computer device in software form, so that the processor can invoke and execute the operations corresponding to each module.
[0079] Example 4
[0080] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 5As shown, the computer device includes a processor, memory, network interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The network interface is used to communicate with external terminals via a network connection. When executed by the processor, the computer program implements a method for calling an encrypted data service interface. The display screen can be an LCD screen or an e-ink screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad mounted on the computer device casing, or an external keyboard, touchpad, or mouse.
[0081] Those skilled in the art will understand that Figure 5 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0082] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to perform the following steps:
[0083] Step A: Obtain the configuration information of the encrypted data service interface and generate the access request message body;
[0084] Step B: Obtain the configuration data of the encrypted data service interface and the input parameters of the upstream business system;
[0085] Step C: Based on the access request message body, the configuration data of the encrypted data service interface, and the input parameters of the upstream business system, an access request message is generated according to the preset parameter configuration rules;
[0086] Step D: Send the access request message to the encrypted data server interface to invoke the encrypted data service interface.
[0087] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0088] Configure the access request message body to which the configuration request parameters belong. The access request message body includes HTTP Header, HTTP Query Parameter, and HTTP Body. The request parameters include configuration data of the encrypted data service interface, input parameters of the upstream business system, and built-in functions. Based on the request message body and the request parameters, obtain the type of the request parameters. Based on the type of the request parameters, obtain the source of the request parameters. Configure the request parameters to the access request message body according to preset request parameter processing rules. Generate an access request message based on the access request message body.
[0089] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0090] If the source of the request parameter is a constant, the request parameter constant is directly read and configured into the access request message body; if the source of the request parameter is an input parameter variable, the input parameter of the upstream business system is obtained and configured into the access request message body; if the source of the request parameter is an environment variable, the configuration data of the encrypted data service interface is obtained and configured into the access request message body; if the source of the request parameter is a system variable, parameter information is generated based on the built-in function and configured into the access request message body.
[0091] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0092] After obtaining the source of the request parameters, it is determined whether the request parameters are configured with a conversion function; if the request parameters are configured with a conversion function, the request parameters are converted based on the conversion function, and the converted request parameters are configured in the body of the access request message.
[0093] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0094] Determine the number of conversion functions; if the number of conversion functions is one, then convert the request parameters based on the conversion functions; if the number of conversion functions is greater than one, then generate a conversion function chain based on the conversion functions, and convert the request parameters based on the conversion function chain.
[0095] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0096] The conversion functions in the conversion function chain are obtained sequentially from front to back; the type of the conversion function is obtained, and the conversion function is called based on the type of the conversion function. The conversion functions include built-in functions and script functions; after each conversion function converts the request parameters, it is determined whether there are any uncalled conversion functions in the conversion function chain, until there are no uncalled conversion functions in the conversion function chain.
[0097] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0098] The conversion functions in the conversion function chain are obtained sequentially from front to back; it is determined whether there is a conversion function before the conversion function; if there is no conversion function before the conversion function, the request parameter is used as the input parameter of the conversion function; if there is a conversion function before the conversion function, the output parameter of the conversion function before the conversion function is used as the input parameter of the conversion function.
[0099] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0100] Determine whether a conversion function exists after the conversion function; if a conversion parameter exists after the conversion function, use the output parameter of the conversion function as the input parameter of the conversion function after the conversion function; if no conversion function exists after the conversion function, configure the converted request parameter to the body of the access request message.
[0101] Example 5
[0102] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:
[0103] Step A: Obtain the configuration information of the encrypted data service interface and generate the access request message body;
[0104] Step B: Obtain the configuration data of the encrypted data service interface and the input parameters of the upstream business system;
[0105] Step C: Based on the access request message body, the configuration data of the encrypted data service interface, and the input parameters of the upstream business system, an access request message is generated according to the preset parameter configuration rules;
[0106] Step D: Send the access request message to the encrypted data server interface to invoke the encrypted data service interface.
[0107] In one embodiment, when the computer program is executed by a processor, it further performs the following steps:
[0108] Configure the access request message body to which the configuration request parameters belong. The access request message body includes HTTP Header, HTTP Query Parameter, and HTTP Body. The request parameters include configuration data of the encrypted data service interface, input parameters of the upstream business system, and built-in functions. Based on the request message body and the request parameters, obtain the type of the request parameters. Based on the type of the request parameters, obtain the source of the request parameters. Configure the request parameters to the access request message body according to preset request parameter processing rules. Generate an access request message based on the access request message body.
[0109] In one embodiment, when the computer program is executed by a processor, it further performs the following steps:
[0110] If the source of the request parameter is a constant, the request parameter constant is directly read and configured into the access request message body; if the source of the request parameter is an input parameter variable, the input parameter of the upstream business system is obtained and configured into the access request message body; if the source of the request parameter is an environment variable, the configuration data of the encrypted data service interface is obtained and configured into the access request message body; if the source of the request parameter is a system variable, parameter information is generated based on the built-in function and configured into the access request message body.
[0111] In one embodiment, when the computer program is executed by a processor, it further performs the following steps:
[0112] After obtaining the source of the request parameters, it is determined whether the request parameters are configured with a conversion function; if the request parameters are configured with a conversion function, the request parameters are converted based on the conversion function, and the converted request parameters are configured in the body of the access request message.
[0113] In one embodiment, when the computer program is executed by a processor, it further performs the following steps:
[0114] Determine the number of conversion functions; if the number of conversion functions is one, then convert the request parameters based on the conversion functions; if the number of conversion functions is greater than one, then generate a conversion function chain based on the conversion functions, and convert the request parameters based on the conversion function chain.
[0115] In one embodiment, when the computer program is executed by a processor, it further performs the following steps:
[0116] The conversion functions in the conversion function chain are obtained sequentially from front to back; the type of the conversion function is obtained, and the conversion function is called based on the type of the conversion function. The conversion functions include built-in functions and script functions; after each conversion function converts the request parameters, it is determined whether there are any uncalled conversion functions in the conversion function chain, until there are no uncalled conversion functions in the conversion function chain.
[0117] In one embodiment, when the computer program is executed by a processor, it further performs the following steps:
[0118] The conversion functions in the conversion function chain are obtained sequentially from front to back; it is determined whether there is a conversion function before the conversion function; if there is no conversion function before the conversion function, the request parameter is used as the input parameter of the conversion function; if there is a conversion function before the conversion function, the output parameter of the conversion function before the conversion function is used as the input parameter of the conversion function.
[0119] In one embodiment, when the computer program is executed by a processor, it further performs the following steps:
[0120] Determine whether a conversion function exists after the conversion function; if a conversion parameter exists after the conversion function, use the output parameter of the conversion function as the input parameter of the conversion function after the conversion function; if no conversion function exists after the conversion function, configure the converted request parameter to the body of the access request message.
[0121] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0122] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0123] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.
Claims
1. A method for invoking an encrypted data service interface, characterized in that, The method includes: Obtain the configuration information of the encrypted data service interface and generate the access request message body; Obtain the configuration data of the encrypted data service interface and the input parameters of the upstream business system; Based on the access request message body, the configuration data of the encrypted data service interface and the input parameters of the upstream business system, an access request message is generated according to preset parameter configuration rules. The access request message is sent to the encrypted data server interface to invoke the encrypted data service interface, wherein the encrypted data is implemented through function chaining; The preset parameter configuration rules include: Configure the access request message body to which the request parameters belong. The access request message body includes HTTP Header, HTTP Query Parameter and HTTP Body. The request parameters include the configuration data of the encrypted data service interface, the input parameters of the upstream business system and the built-in functions. Based on the request message body and the request parameters, the type of the request parameters is obtained. The types of the request parameters include String, Number, Boolean, Array, and Object. Based on the type of the request parameter, the source of the request parameter is obtained, and the request parameter is configured into the body of the access request message according to the preset request parameter processing rules; Based on the access request message body, an access request message is generated; The preset request parameter processing rules include: After obtaining the source of the request parameters, it is determined whether the request parameters are configured with a conversion function; wherein the conversion function includes an encryption / decryption function, a signature function, and / or a logic function. If the request parameters are configured with conversion functions, determine the number of conversion functions; If the number of conversion functions is one, then the request parameters are converted based on the conversion functions; If the number of conversion functions is greater than one, then a conversion function chain is generated based on the conversion functions, and the request parameters are converted based on the conversion function chain; Configure the transformed request parameters into the body of the access request message; The encrypted data is implemented through a function chain, which includes: sequentially passing in interface parameters, sorting, filtering non-empty parameters, processing with the function implode, adding the private key of the data service provider, performing MD5 processing, and then converting to uppercase.
2. The method for invoking the encrypted data service interface according to claim 1, characterized in that, The preset parameter processing rules include: If the source of the request parameter is a constant, then the request parameter constant is read directly and configured into the body of the access request message; If the source of the request parameters is an input parameter variable, then obtain the input parameters of the upstream business system and configure the input parameters of the upstream business system into the body of the access request message; If the source of the request parameter is an environment variable, then obtain the configuration data of the encrypted data service interface and configure the configuration data of the encrypted data service interface into the body of the access request message; If the source of the request parameters is a system variable, then parameter information is generated based on the built-in function, and the parameter information is configured into the body of the access request message.
3. The method for invoking the encrypted data service interface according to claim 1, characterized in that, When converting the request parameters based on the aforementioned conversion function chain, the following steps are included: Obtain the transformation functions in the transformation function chain sequentially from front to back; Obtain the type of the conversion function, and call the conversion function based on the type of the conversion function. The conversion function includes built-in functions and script functions. After each of the conversion functions converts the request parameters, it is determined whether there are any uncalled conversion functions in the conversion function chain, until there are no uncalled conversion functions in the conversion function chain.
4. The method for invoking the encrypted data service interface according to claim 3, characterized in that, If the number of conversion functions is greater than one, a conversion function chain is generated based on the conversion functions. When converting the request parameters based on the conversion function chain, the method includes: Obtain the transformation functions in the transformation function chain sequentially from front to back; Determine whether a transformation function exists before the stated transformation function; If no conversion function exists before the conversion function, then the request parameters are used as input parameters of the conversion function; If a conversion function exists before the conversion function, then the output parameter of the conversion function before the conversion function is used as the input parameter of the conversion function.
5. The method for invoking the encrypted data service interface according to claim 4, characterized in that, If the number of conversion functions is greater than one, a conversion function chain is generated based on the conversion functions. When converting the request parameters based on the conversion function chain, the method includes: Determine whether a transformation function exists after the stated transformation function; If there are transformation parameters after the transformation function, then the output parameter of the transformation function is used as the input parameter of the transformation function after the transformation function; If no conversion function exists after the conversion function, then the converted request parameters are configured into the body of the access request message.
6. An apparatus for invoking an encrypted data service interface to implement the method for invoking an encrypted data service interface as described in any one of claims 1-5, characterized in that, The device includes: The acquisition and generation unit is used to acquire configuration information of the encrypted data service interface, generate the access request message body, and also to acquire configuration data of the encrypted data service interface and input parameters of the upstream business system. The request message generation unit is used to generate an access request message based on the access request message body, the configuration data of the encrypted data service interface and the input parameters of the upstream business system, according to a preset parameter configuration rule. A sending unit is used to send the access request message to the encrypted data server interface to invoke the encrypted data service interface; wherein, the encrypted data is implemented through function chaining; The preset parameter configuration rules include: Based on the type of the request parameter, the source of the request parameter is obtained, and the request parameter is configured into the body of the access request message according to the preset request parameter processing rules; The preset parameter processing rules also include: After obtaining the source of the request parameters, it is determined whether the request parameters are configured with a conversion function; wherein the conversion function includes an encryption / decryption function, a signature function, and / or a logic function. If the request parameters are configured with a conversion function, then the request parameters are converted based on the conversion function, and the converted request parameters are configured in the body of the access request message; A judgment unit is used to determine the number of the transformation functions; A conversion unit is configured to convert the request parameters based on the conversion functions if the number of conversion functions is one; and generate a conversion function chain based on the conversion functions and convert the request parameters based on the conversion function chain if the number of conversion functions is greater than one. The encrypted data is implemented through a function chain, which includes: sequentially passing in interface parameters, sorting, filtering non-empty parameters, processing with the function implode, adding the private key of the data service provider, performing MD5 processing, and then converting to uppercase.
7. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Joint debugging interface access method and device, computer equipment and storage medium
CN111416816A
Message generation method and device, electronic equipment and storage medium
CN111953540A
Message conversion method and device, equipment and medium
CN114070886A
Business processing method and device, equipment, storage medium and program
CN114201241A