Interface management and control method and device, electronic equipment, storage medium and product

By implementing interface permission management and field filtering on the server-side interface management platform, the problem of low interface control efficiency in existing interface data control solutions is solved, the flexibility and security of the interface are improved, and data security is ensured.

CN119718712APending Publication Date: 2025-03-28CHINA MERCHANTS BANK
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411627689.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-14
Publication Date
2025-03-28

AI Technical Summary

Technical Problem

There is a problem of low interface control efficiency in existing interface data control solutions, which is difficult to implement and maintain efficiently. With the increase in the number of callers and the changes in demand, the interface field adjustment workload is large and error-prone, which reduces the flexibility and speed of interface response.

Method used

An interface control method is proposed, which is applied to the server. By creating and publishing interfaces on the preset interface management platform, receiving interface call requests, determining the client and target interfaces, viewing the client's interface permissions, obtaining the authorization field, and returning the data corresponding to the authorization field in the target interface corresponding data to the client.

Benefits of technology

By customizing the return of the interface field, the targetedness and security of the interface are improved, ensuring that only fields that the client has access are returned, avoiding the risk of data leakage, improving the security and flexibility of interface calls, and meeting the customized needs of the client.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119718712A_ABST
    Figure CN119718712A_ABST
Patent Text Reader

Abstract

The invention discloses an interface management and control method and device, electronic equipment, a storage medium and a product, relates to the technical field of interface management, is applied to a server, the server is used for creating and issuing an interface on a preset interface management platform for a client to call, and comprises the following steps: receiving an interface call request, determining the client sending the interface call request, and sending the interface call request to the server; the target interface is called by the client; viewing the interface permission of the client to the target interface in the preset interface management platform, and obtaining an authorization field of the client in the target interface; and returning target data conforming to the authorization field in the data corresponding to the target interface to the client. The technical problem of how to improve the interface management and control efficiency is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of interface management technology, and in particular to an interface management method, device, electronic device, storage medium and computer program product. Background Art

[0002] The existing interface field return mechanism often lacks the ability to customize requirements for each application and is unable to meet the specific field requirements of each caller. Although customized interface field returns can be achieved through fine-grained field control, it is often difficult to implement and maintain efficiently in actual operations. As the number of callers increases and requirements change, interface field adjustments are not only labor-intensive but also prone to errors, reducing the flexibility and speed of interface responses. Therefore, the current existing interface data control solutions have the problem of low interface control efficiency. Summary of the invention

[0003] The main purpose of this application is to provide an interface management method, device, electronic device, storage medium and computer program product, aiming to solve the technical problem of how to improve the efficiency of interface management.

[0004] To achieve the above purpose, the present application proposes an interface management method, which is applied to a server, wherein the server is used to create and publish an interface on a preset interface management platform for a client to call, and the interface management method includes:

[0005] Receiving an interface call request, determining a client sending the interface call request, and a target interface called by the client;

[0006] Check the interface authority of the client to the target interface in the preset interface management platform to obtain the authorization field of the client in the target interface;

[0007] The target data in the target interface corresponding data that matches the authorization field is returned to the client.

[0008] In one embodiment, the step of determining the client sending the interface call request includes:

[0009] Extracting authentication information from the request header of the interface call request;

[0010] Decrypt the authentication information using a decryption public key through a preset decryption algorithm to obtain a client identifier, wherein the decryption public key corresponds to an encryption private key used by the client to encrypt the authentication information;

[0011] The client sending the interface call request is determined according to the client identifier.

[0012] In one embodiment, the step of checking the interface authority of the client to the target interface in the preset interface management platform to obtain the authorization field of the client in the target interface includes:

[0013] Collecting interface authorization information from the preset interface management platform according to a preset period and updating it in a cache database, wherein the interface authorization information includes interface permissions corresponding to each interface;

[0014] The cache database searches for the interface authority corresponding to the client in the target interface, and determines the authorization field according to the interface authority.

[0015] In one embodiment, the step of returning the target data in the target interface corresponding data that matches the authorization field to the client includes:

[0016] Convert the fields returned by the target interface into JSON format to obtain a return field sequence;

[0017] For any field node in the returned field sequence, determine whether the type of the field node is an object type;

[0018] In the case where the type of the field node is an object type, determining whether the field node is consistent with the authorization field, if consistent, retaining the field content corresponding to the field node, if inconsistent, filtering the field content corresponding to the field node;

[0019] Returns the corresponding field content of each reserved field node to the client.

[0020] In one embodiment, the interface management method further includes:

[0021] When a new interface is added to the preset interface management platform, output each interface template;

[0022] If an interface modification operation is received, modifying the selected interface template according to the interface modification operation, generating a first interface, and publishing the first interface on the preset interface management platform;

[0023] If an interface creation operation is received, a second interface is generated according to the input interface content, and the second interface is converted into an interface template and saved in the template library, and the second interface is published on the preset interface management platform.

[0024] In one embodiment, the interface management method further includes:

[0025] When approving an interface field authorization request from a client, determining an approval type of the interface field authorization request;

[0026] If the approval type is template approval, the content of the interface field authorization request is compared with each field template in the template library, and the comparison result is output;

[0027] If the approval type is field approval, the attribute type of the client is detected, and a recommended authorization field is output according to the attribute type.

[0028] In addition, to achieve the above purpose, the present application also proposes an interface management device, which is applied to a server, and the server is used to create and publish an interface on a preset interface management platform for the client to call. The interface management device includes:

[0029] A receiving module, used to receive an interface call request, determine a client sending the interface call request, and a target interface called by the client;

[0030] A search module, used to check the interface authority of the client to the target interface, and obtain the authorization field of the client in the target interface;

[0031] The filtering module is used to return the target data in the target interface corresponding data that is consistent with the authorization field to the client.

[0032] In addition, to achieve the above-mentioned purpose, the present application also proposes an electronic device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the interface management method described above.

[0033] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by the processor, the steps of the interface management method described above are implemented.

[0034] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of the interface management and control method described above are implemented.

[0035] The present application provides an interface management and control method, which is applied to a server, and the server is used to create and publish an interface on a preset interface management platform for client calls. The interface management and control method includes: receiving an interface call request, determining the client that sends the interface call request, and the target interface called by the client; checking the interface permissions of the client to the target interface in the preset interface management platform, and obtaining the authorization field of the client in the target interface; and returning the target data that matches the authorization field in the corresponding data of the target interface to the client.

[0036] By determining the client and the target interface, the server can perform personalized processing for specific requests, thereby improving the pertinence and security of the interface. Through permission verification, the server can confirm the fields that the client has access to, providing a basis for subsequent filtering operations. Through field filtering, the server can filter the interface fields that the client does not have access to, and return the content of the fields that the client has access to, thereby avoiding the risk of data leakage and improving the security of interface calls. At the same time, it meets the customization needs of the client and improves the flexibility and availability of the interface. Compared with related solutions, which lack the ability to customize the interface return fields for each application, as demand increases, it is not only prone to errors, but also difficult to implement and maintain efficiently. This application provides a preset interface management platform for centralized management of interface permissions, which can efficiently realize customized interface field returns, thereby flexibly adjusting interface fields, improving interface management efficiency and flexibility, and through permission verification and field filtering, it ensures that only fields that the client has access to are returned, thereby avoiding the risk of data leakage. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0038] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0039] Figure 1 A flowchart of the first embodiment of the interface control method of this application is provided;

[0040] Figure 2 A flow chart of the server interface configuration provided for this application interface control method;

[0041] Figure 3 A flowchart of the authorization field selection process provided for this application interface control method;

[0042] Figure 4 A flow chart of field filtering provided for this application interface control method;

[0043] Figure 5 A flowchart of the second embodiment of the interface control method of this application is provided;

[0044] Figure 6 Schematic diagram of the scenario of the newly added interface provided for this application interface control method

[0045] Figure 7This is a schematic diagram of the module structure of the interface control device according to an embodiment of the present application;

[0046] Figure 8 This is a schematic diagram of the device structure of the hardware operating environment involved in the interface control method in the embodiment of the present application.

[0047] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0048] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.

[0049] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0050] The embodiment of the present application is applied to the server, which is used to create and publish interfaces on a preset interface management platform for client calls. The main solution is: receiving an interface call request, determining the client that sends the interface call request, and the target interface called by the client; checking the interface permissions of the client to the target interface in the preset interface management platform, and obtaining the authorization field of the client in the target interface; returning the target data that matches the authorization field in the corresponding data of the target interface to the client.

[0051] In this embodiment, for ease of description, the following description is made with the server as the execution subject.

[0052] Although the existing technology can realize customized interface field returns, the process of returning different fields for each application call is often cumbersome and inefficient, lacking an efficient automated processing mechanism. In addition, the field control process is cumbersome and lacks a user-friendly visual interface, which makes it complicated for managers to configure and maintain field permissions, and it is difficult for them to take effect in real time, affecting the security and management efficiency of interface data.

[0053] This application provides a solution that introduces a preset interface management platform to centrally manage interface permissions and efficiently implement customized field returns, thereby flexibly adjusting interface fields, improving interface management efficiency and flexibility, and through permission verification and field filtering mechanisms, ensuring that only fields that the client has access to are returned, effectively preventing data leakage risks.

[0054] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, a server, etc. The following takes the server as an example to illustrate this embodiment and the following embodiments.

[0055] Based on this, the present application embodiment provides an interface management method, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the interface control method of the present application.

[0056] In this embodiment, the server is used to create and publish an interface on a preset interface management platform for the client to call. The interface management method includes steps S01 to S03:

[0057] Step S01, receiving an interface call request, determining a client sending the interface call request and a target interface called by the client;

[0058] It should be noted that the server refers to the application that provides the interface, the client refers to the application that needs to call the interface, the preset interface management platform refers to the platform used to centrally manage interface permissions, field configuration and other information, the interface call request refers to the interface call request initiated by the client to the server, and the target interface refers to the interface requested to be called by the client.

[0059] In addition, it should be noted that in the preset interface management platform, the server has published the interface and defined all the fields of the interface. At the same time, the client has also selected the authorization fields required in the interface before initiating the interface call request. Figure 2 and Figure 3 As shown, Figure 2 Provides a flow chart of the server interface configuration. Figure 3 Provides a flowchart for selecting authorization fields. Figure 2 In the configuration interface, the server defines the application name, interface name, request method, etc. Figure 3 For a defined interface content, the client can select one of the fields as the authorization field, such as Figure 3 As shown in the figure, for each field in interface P, the user selected the "field1" field and the "field2" field as the authorization field. When the client subsequently calls interface P, only the content corresponding to the "field1" field and the "field2" field will be returned. The server receives the interface call request from the client through the interface it deploys, and parses the information in the interface call request to determine the identity of the client sending the interface call request and the target interface requested by the client.

[0060] It is understandable that since existing solutions often lack an efficient automated processing mechanism, the process of receiving and processing interface call requests is cumbersome and inefficient. Therefore, step S01 is performed. Through the preset interface management platform, the server can efficiently receive and process interface call requests, which significantly improves the processing speed and accuracy. By accurately identifying the client sending the request and the target interface to be called, it provides a basis for subsequent steps.

[0061] Step S02, checking the interface authority of the client to the target interface in the preset interface management platform, and obtaining the authorization field of the client in the target interface;

[0062] It should be noted that once the client and target interface are determined, the server will view the client's interface permissions for the target interface through the preset interface management platform. Interface permissions refer to the client's access rights to a specific interface, including accessible fields, etc. The server will extract the fields in the target interface that the client is authorized to use, namely the authorization fields, based on the configured interface permission information.

[0063] It is understandable that since the existing solutions lack a user-friendly visual interface in the process of field control, it makes it complicated for managers to configure and maintain field permissions. Therefore, step S02 is performed to introduce a preset interface management platform to achieve centralized management and dynamic update of interface permissions. The server can obtain and verify the client's interface permissions to the target interface in real time without manual configuration updates. This not only improves the accuracy and efficiency of permission verification, but also enables managers to manage and maintain interface permissions more conveniently, reducing the risk of errors.

[0064] Step S03, returning the target data in the target interface corresponding data that is consistent with the authorization field to the client.

[0065] It should be noted that after determining the authorization field, the server uses a recursive algorithm to process the fields returned by the target interface. Among all the returned fields, the fields that are inconsistent with the authorization field are filtered out, and only the fields that are consistent with the authorization field are retained. The field contents corresponding to these fields are returned. The field content refers to the field value corresponding to the authorization field in the data returned by the interface.

[0066] It is understandable that, since in existing solutions, field filtering usually relies on hard-coded filtering logic or simple string matching algorithms, it is often inefficient and error-prone when processing complex data structures or a large number of fields. Therefore, step S03 is performed to perform field filtering through a recursive algorithm to achieve fast and accurate processing of complex data structures. At the same time, through the preset interface management platform, the client can flexibly configure and select the fields to be returned, which not only improves the efficiency and accuracy of field filtering, but also enables the client to dynamically adjust the returned field content as needed, thereby enhancing the flexibility and scalability of the interface.

[0067] In a feasible implementation manner, in step S01, the step of determining the client sending the interface call request includes steps A01 to A03:

[0068] Step A01, extracting authentication information from the request header of the interface call request;

[0069] It should be noted that in HTTP requests, the request header contains various metadata about the request. HTTP (Hypertext Transfer Protocol) requests are the basis for communication between clients and servers, allowing clients to request data from servers. The server extracts a specific piece of information from the request header of the received interface call request. This piece of information is called authentication information. The authentication information is generated by the client when initiating the request through a preset encryption algorithm (such as the encryption part of an asymmetric encryption algorithm). It contains information that can uniquely identify the client. It is sent to the server along with the request as part of the request header.

[0070] Step A02, decrypting the authentication information using a decryption public key through a preset decryption algorithm to obtain a client identifier, wherein the decryption public key corresponds to the encryption private key used by the client to encrypt the authentication information;

[0071] It should be noted that the server has a decryption public key corresponding to the client's encryption private key. The server uses a preset decryption algorithm (such as the decryption part of the asymmetric encryption algorithm) to decrypt the authentication information using the decryption public key, thereby restoring the original plaintext information, namely the client identifier.

[0072] Step A03: determine the client sending the interface call request according to the client identifier.

[0073] It should be noted that after obtaining the client identifier, the server determines the identity of the client sending the request by searching a pre-stored client information database or configuration table.

[0074] In this implementation, by extracting the authentication information, the server can preliminarily identify the source of the request, providing a basis for subsequent identity authentication and permission control. By decrypting the authentication information and matching the client identifier, the server can accurately identify the true source of the request, that is, which specific client initiated the request.

[0075] In a feasible implementation manner, in step S02, the step of checking the interface authority of the client to the target interface in the preset interface management platform and obtaining the authorization field of the client in the target interface includes steps A11 to A12:

[0076] Step A11, collecting interface authorization information from a preset interface management platform according to a preset period and updating it in a cache database, wherein the interface authorization information includes interface permissions corresponding to each interface;

[0077] It should be noted that the preset period refers to the fixed time interval at which the server collects interface authorization information from the interface management platform. This period can be adjusted according to actual needs to ensure timely updating of information. The server automatically sends a request to the preset interface management platform according to the preset period (such as every hour, every day, etc.) to obtain the latest interface authorization information. This information includes the interface permissions corresponding to each interface, that is, which clients have the right to call which interfaces and which fields they can access. After obtaining this information, it is updated to the cache database for fast access. The cache database is an in-memory database that stores interface authorization information, which can quickly provide data access services and improve the response speed of the system.

[0078] Step A12, searching the cache database for the interface authority corresponding to the client in the target interface, and determining the authorization field according to the interface authority.

[0079] It should be noted that when the server receives an interface call request, it searches the cache database for the interface permissions corresponding to the client's interface based on the target interface name in the request. Interface permissions refer to the control and restriction of interface call behavior, including which interfaces the client can call and which fields can be called. Based on these interface permissions, it determines the fields that the client that initiates the request can access in the target interface.

[0080] In this implementation, by automatically collecting and updating interface authorization information, the server can ensure the accuracy and timeliness of the interface authorization information. By automatically searching and matching interface permissions, the server can accurately determine the fields that the client can access based on the client's identity and the target interface requested.

[0081] In a feasible implementation manner, in step S03, the step of returning the target data in the target interface corresponding data that matches the authorization field to the client includes steps A21 to A24:

[0082] Step A21, converting the fields returned by the target interface into JSON format to obtain a return field sequence;

[0083] It should be noted that JSON (JavaScript Object Notation) is a lightweight data exchange format. It is based on a subset of ECMAScript (js specification developed by the European Computer Association) and uses a completely language-independent text format to store and represent data. It is easy for people to read and write, and easy for machines to parse and generate. After the server receives the response data from the target interface, it needs to convert this data into JSON format. Through the conversion, the server can get a sequence containing all the return fields, that is, the return field sequence. This sequence is represented in the form of a JSON object, in which each field corresponds to a key-value pair.

[0084] Step A22: for any field node in the returned field sequence, determine whether the type of the field node is an object type;

[0085] It should be noted that the server recursively traverses each field node in the returned field sequence and determines whether its type is an object type. In JSON format, data can be represented as objects (consisting of key-value pairs), arrays (a collection of ordered values), strings (text), numbers (integers or floating-point numbers), Boolean values ​​(true or false), or null (empty value). A field node refers to an element in a JSON object, which consists of a key and a value. The key is the field name and the value is the field content. This value can be another object, array, string, number, Boolean value, or null. In JSON format, the object type is a set of key-value pairs surrounded by curly braces "{}". Each key-value pair is separated by a comma. The key is a string type and the value can be any data type supported by JSON.

[0086] Step A23, when the type of the field node is an object type, determine whether the field node is consistent with the authorization field, if they are consistent, retain the field content corresponding to the field node, if they are inconsistent, filter the field content corresponding to the field node;

[0087] It should be noted that for field nodes of object type, the server traverses the authorization field list and compares it with the authorization field of the client in the target interface. If the field node is consistent with the authorization field, the corresponding field content of the field node is retained; if the field node is inconsistent with the authorization field, the corresponding field content of the field node is filtered.

[0088] Step A24, returning the corresponding field content of each retained field node to the client.

[0089] It should be noted that after completing the comparison and filtering of the field nodes, the server returns the field contents corresponding to the retained field nodes to the client. These field contents are determined according to the client's permission configuration and are expressed in JSON format, including the field contents corresponding to all fields that the client has access to.

[0090] For example, to help understand the technical concept or technical principle of this application, please refer to Figure 4 , Figure 4 A flowchart of field filtering is provided. For any field node in the returned field sequence, first determine whether it is empty (null). If it is empty, directly return the output null value. If it is not empty, further determine whether the field node is an object type. If it is not an object type, directly return the output. If it is an object type, continue to determine whether the field node is consistent with the authorized field. If they are consistent, retain the field content corresponding to the field node. If they are inconsistent, filter the field content corresponding to the field node, and finally obtain the field content corresponding to the field node consistent with the authorized field and output it.

[0091] In this implementation, since the original response data may exist in multiple formats, such as XML, CSV, etc., which are not easy for machines to directly process and compare, after conversion to JSON format, the server can process the data in a unified manner, which facilitates subsequent field filtering, and JSON data may contain nested structures, that is, the object may contain other objects or arrays. Therefore, the server needs to determine the type of the field node for subsequent recursive processing or field filtering. By automatically comparing and filtering field nodes, the server can accurately return the corresponding field content according to the client's permission configuration, thereby improving the efficiency and accuracy of interface management and control, ensuring that only clients with corresponding permissions can access specific field content, and ensuring data security and privacy by returning only field content that the client has the right to access, while reducing unnecessary data transmission and processing overhead.

[0092] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can be referred to the above introduction, and will not be repeated in the following. Figure 5 The interface control method further includes steps S11 to S13:

[0093] Step S11, when a new interface is added to the preset interface management platform, output each interface template;

[0094] It should be noted that when a new interface requirement is triggered on the preset interface management platform, the system automatically outputs a predefined interface template. The interface template is a standardized framework designed in advance based on common interface requirements and specifications. It contains basic information about the interface (such as interface name, request method, request parameters, response format, etc.) and necessary code snippets, including defined interface fields. Interface fields refer to specific fields in the data returned by the interface, such as "user name" and "age" in the user information interface. These fields are important components of the interface design and define the structure and content of the data returned by the interface.

[0095] Step S12: if an interface modification operation is received, modify the selected interface template according to the interface modification operation, generate a first interface, and publish the first interface on a preset interface management platform;

[0096] It should be noted that the interface modification operation refers to the user's adjustment or change operation on the interface template, including but not limited to the increase or decrease of parameters, modification of data types, etc. The first interface refers to the modified interface template, which is a new interface instance that is ready to be released on the platform. The system parses the interface modification operation submitted by the user, identifies the interface template that needs to be modified and the specific modification content (such as parameter name, data type, response format, etc.), and modifies the selected interface template to generate a new interface definition, namely the first interface. At the same time, it performs syntax and semantic checks to ensure that the modified interface definition is legal and compliant with the specification. After the modified first interface is reviewed, the system will publish it to the preset interface management platform for other systems or applications to call.

[0097] Step S13: if an interface creation operation is received, a second interface is generated according to the input interface content, and the second interface is converted into an interface template and saved in a template library, and the second interface is published on a preset interface management platform.

[0098] It should be noted that the interface creation operation refers to the behavior of users manually entering interface-related information on the platform to create a new interface based on actual needs, and the second interface refers to a new interface instance created based on user-defined content. The system receives the interface content entered by the user, including the interface name, description, request method, parameter list, response format, etc., and parses and verifies this information to ensure the legality and integrity of the input. Based on the parsed interface content, a new interface definition, namely the second interface, is generated, the second interface is converted into an interface template, and saved in the template library. Other users or developers can reuse this interface template in the subsequent development process. At the same time, after the generated second interface is reviewed and tested, the system publishes it to the preset interface management platform.

[0099] For example, to help understand the technical concept or technical principle of this application, please refer to Figure 6 , Figure 6 A scenario diagram of the newly added interface is provided. Module A is the interface content entered by the user, and module B is a tree diagram corresponding to the interface content in module A, which is convenient for users to view the relationship between interfaces. After the interface content is completed, click the interface template button C to convert the interface content in module A into an interface template and save it to the template library.

[0100] In this embodiment, by providing interface templates, developers can quickly select and develop based on the templates, thereby saving a lot of time and energy. By automatically modifying the interface templates and generating new interfaces, the automation and efficiency of interface modification are achieved, manual intervention and error rates are reduced, and the modification efficiency is greatly improved. By automatically generating interfaces and converting them into templates, the automation and templating of interface creation are achieved. At the same time, the newly generated interface templates can be reused by other developers, further improving development efficiency.

[0101] In a feasible implementation manner, the interface management and control method further includes steps S21 to S23:

[0102] Step S21, when approving the interface field authorization request of the client, determining the approval type of the interface field authorization request;

[0103] It should be noted that an interface field authorization request refers to a request sent by a client to a server, requesting authorization to access certain fields of a specific interface. Approval type refers to the strategy or method adopted by the server when approving an interface field authorization request, including template approval and field approval. When the server receives an interface field authorization request submitted by a client, it pre-processes the interface field authorization request to determine its approval type.

[0104] Step S22: if the approval type is template approval, the content of the interface field authorization request is compared with each field template in the template library, and the comparison result is output;

[0105] It should be noted that template approval refers to the server using a pre-defined field template to approve the client's interface field authorization request, which is suitable for scenarios that need to follow a unified data structure and field specifications. When the approval type is template approval, the server needs to compare the content of the interface field authorization request submitted by the client with the field templates in the template library, including parsing and comparing JSON data, to determine whether the fields in the request match the fields in the template.

[0106] Step S23: If the approval type is field approval, the attribute type of the client is detected, and the recommended authorization field is output according to the attribute type.

[0107] It should be noted that field approval refers to the server approving the interface field authorization request based on the specific needs and business scenarios of the client, which is applicable to scenarios that need to meet different client and data requirements. When the approval type is field approval, the server detects the client's attribute type through a predefined algorithm model. The attribute type refers to the characteristics or attributes that the client has when applying for interface field authorization, such as application type (mobile application, Web application, etc.), business scenario (user registration, product query, etc.), etc. According to these attribute types, the recommended authorization field is output to manually determine whether the authorization field of the interface field authorization request is compliant. The recommended authorization field refers to the interface field generated by the server based on the client's attribute type and needs and recommended for authorization to the client.

[0108] In this implementation, by judging the approval type, the server can adopt different processing strategies for different types of requests, thereby improving the efficiency and accuracy of approval. When the approval type is template approval, by comparing the request content with the field template, the server can quickly determine whether the request is legal and compliant. When the approval type is field approval, by detecting the client's attribute type and outputting recommended fields, manual reference can be made to determine whether the authorization fields requested by the client are compliant, thereby improving the efficiency of approval.

[0109] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the interface management method of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.

[0110] The present application also provides an interface management device, which is applied to the server side, and the server side is used to create and publish interfaces on a preset interface management platform for client calls, please refer to Figure 7 , the interface control device includes:

[0111] The receiving module 10 is used to receive an interface call request, determine the client sending the interface call request, and the target interface called by the client;

[0112] A search module 20 is used to check the interface authority of the client to the target interface in the preset interface management platform, and obtain the authorization field of the client in the target interface;

[0113] The filtering module 30 is used to return the target data that matches the authorization field in the target interface corresponding data to the client.

[0114] Optionally, the receiving module 10 is further used for:

[0115] Extract authentication information from the request header of the interface call request;

[0116] Decrypt the authentication information using a decryption public key through a preset decryption algorithm to obtain a client identifier, wherein the decryption public key corresponds to the encryption private key used by the client to encrypt the authentication information;

[0117] The client sending the interface call request is determined according to the client identifier.

[0118] Optionally, the search module 20 is further used for:

[0119] Collecting interface authorization information from a preset interface management platform according to a preset period and updating it in a cache database, wherein the interface authorization information includes the interface permissions corresponding to each interface;

[0120] Look up the interface permissions corresponding to the client in the target interface in the cache database, and determine the authorization field based on the interface permissions.

[0121] Optionally, the filtering module 30 is further used for:

[0122] Convert the fields returned by the target interface into JSON format to obtain the returned field sequence;

[0123] For any field node in the returned field sequence, determine whether the type of the field node is an object type;

[0124] When the type of the field node is an object type, determine whether the field node is consistent with the authorization field. If they are consistent, retain the field content corresponding to the field node; if they are inconsistent, filter the field content corresponding to the field node;

[0125] Returns the corresponding field content of each reserved field node to the client.

[0126] Optionally, the interface management and control device includes an adding module 40, and the adding module 40 is further used for:

[0127] When adding new interfaces to the preset interface management platform, output each interface template;

[0128] If an interface modification operation is received, the selected interface template is modified according to the interface modification operation, a first interface is generated, and the first interface is published on a preset interface management platform;

[0129] If an interface creation operation is received, a second interface is generated according to the input interface content, and the second interface is converted into an interface template and saved in a template library, and the second interface is published on a preset interface management platform.

[0130] Optionally, the interface control device includes an approval module 50, and the approval module 50 is further used for:

[0131] When approving the interface field authorization request of the client, determining the approval type of the interface field authorization request;

[0132] If the approval type is template approval, the content of the interface field authorization request is compared with the field templates in the template library, and the comparison result is output;

[0133] If the approval type is field approval, the client's attribute type is detected and the recommended authorization field is output based on the attribute type.

[0134] The interface control device provided by the present application adopts the interface control method in the above embodiment, which can solve the technical problem of how to improve the efficiency of interface control. Compared with the prior art, the beneficial effects of the interface control device provided by the present application are the same as the beneficial effects of the interface control method provided by the above embodiment, and other technical features in the interface control device are the same as the features disclosed in the above embodiment method, which will not be repeated here.

[0135] The present application provides an electronic device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the interface management method in the above-mentioned embodiment one.

[0136] Reference below Figure 8 , which shows a schematic diagram of the structure of an electronic device suitable for implementing the embodiments of the present application. The electronic device in the embodiments of the present application may include but is not limited to mobile terminals such as mobile phones, notebook computers, etc. and fixed terminals such as digital TVs, desktop computers, etc. Figure 8 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0137] like Figure 8As shown, the electronic device may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the electronic device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. Although the electronic device with various systems is shown in the figure, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems may be implemented or have instead.

[0138] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.

[0139] The electronic device provided by the present application adopts the interface control method in the above embodiment to solve the technical problem of how to improve the efficiency of interface control. Compared with the prior art, the beneficial effects of the electronic device provided by the present application are the same as the beneficial effects of the interface control method provided by the above embodiment, and the other technical features in the electronic device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.

[0140] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0141] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0142] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the interface management and control method in the above-mentioned embodiment.

[0143] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM: Random Access Memory), a read-only memory (ROM: Read Only Memory), an erasable programmable read-only memory (EPROM: Erasable Programmable Read Only Memory or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM: CD-Read Only Memory), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency: Radio Frequency), etc., or any suitable combination of the above.

[0144] The computer-readable storage medium may be included in the electronic device, or may exist independently without being installed in the electronic device.

[0145] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by an electronic device, the interface management device is applied to the server, and the server is used to create and publish an interface on a preset interface management platform for the client to call. The interface management device can: receive an interface call request, determine the client that sends the interface call request, and the target interface called by the client; check the interface permissions of the client to the target interface in the preset interface management platform, and obtain the authorization field of the client in the target interface; return the target data that matches the authorization field in the corresponding data of the target interface to the client.

[0146] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0147] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0148] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.

[0149] The readable storage medium provided in this application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned interface control method, and can solve the technical problem of how to improve the efficiency of interface control. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as the beneficial effects of the interface control method provided in the above-mentioned embodiment, and will not be repeated here.

[0150] The present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned interface management and control method when executed by a processor.

[0151] The computer program product provided in this application can solve the technical problem of how to improve the efficiency of interface management and control. Compared with the prior art, the beneficial effects of the computer program product provided in this application are the same as the beneficial effects of the interface management and control method provided in the above embodiment, which will not be repeated here.

[0152] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.

Claims

1. An interface management and control method, characterized in that: Applied to the server, the server is used to create and publish an interface on a preset interface management platform for the client to call. The interface management method includes: Receiving an interface call request, determining a client sending the interface call request, and a target interface called by the client; Check the interface authority of the client to the target interface in the preset interface management platform to obtain the authorization field of the client in the target interface; The target data in the target interface corresponding data that matches the authorization field is returned to the client.

2. The interface management method according to claim 1, characterized in that: The step of determining the client sending the interface call request comprises: Extracting authentication information from the request header of the interface call request; Decrypt the authentication information using a decryption public key through a preset decryption algorithm to obtain a client identifier, wherein the decryption public key corresponds to an encryption private key used by the client to encrypt the authentication information; The client sending the interface call request is determined according to the client identifier.

3. The interface management method according to claim 1, characterized in that: The step of checking the interface authority of the client to the target interface in the preset interface management platform to obtain the authorization field of the client in the target interface includes: Collecting interface authorization information from the preset interface management platform according to a preset period and updating it in a cache database, wherein the interface authorization information includes interface permissions corresponding to each interface; The cache database searches for the interface authority corresponding to the client in the target interface, and determines the authorization field according to the interface authority.

4. The interface management method according to claim 1, characterized in that: The step of returning the target data in the target interface corresponding data that matches the authorization field to the client comprises: Convert the fields returned by the target interface into JSON format to obtain a return field sequence; For any field node in the returned field sequence, determine whether the type of the field node is an object type; In the case where the type of the field node is an object type, determining whether the field node is consistent with the authorization field, if consistent, retaining the field content corresponding to the field node, if inconsistent, filtering the field content corresponding to the field node; Returns the corresponding field content of each reserved field node to the client.

5. The interface management method according to claim 1, characterized in that: The interface control method further includes: When a new interface is added to the preset interface management platform, outputting each interface template, wherein each interface template is stored in a template library; If an interface modification operation is received, modifying the selected interface template according to the interface modification operation, generating a first interface, and publishing the first interface on the preset interface management platform; If an interface creation operation is received, a second interface is generated according to the input interface content, and the second interface is converted into an interface template and saved in the template library, and the second interface is published on the preset interface management platform.

6. The interface management method according to claim 5, characterized in that: The interface control method further includes: When approving an interface field authorization request from a client, determining an approval type of the interface field authorization request; If the approval type is template approval, the content of the interface field authorization request is compared with each field template in the template library, and the comparison result is output; If the approval type is field approval, the attribute type of the client is detected, and a recommended authorization field is output according to the attribute type.

7. An interface control device, characterized in that: Applied to the server, the server is used to create and publish an interface on a preset interface management platform for the client to call the interface management device, including: A receiving module, used to receive an interface call request, determine a client sending the interface call request, and a target interface called by the client; A search module, used to check the interface authority of the client to the target interface, and obtain the authorization field of the client in the target interface; The filtering module is used to return the target data in the target interface corresponding data that is consistent with the authorization field to the client.

8. An electronic device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the interface management method according to any one of claims 1 to 6.

9. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the interface management and control method according to any one of claims 1 to 6 are implemented.

10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the interface management and control method according to any one of claims 1 to 6 are implemented.