Interface calling method and device, electronic equipment and storage medium

By obtaining front-end permission requests and user permission information, using service interface routers and annotation classes to determine the matching of user roles and interface roles, the problem of coarse permission control granularity in the existing technology is solved, precise interface calls are realized, and efficiency is improved.

CN118944937APending Publication Date: 2024-11-12CHINA CONSTRUCTION BANK +1
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202411033465.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-30
Publication Date
2024-11-12

AI Technical Summary

Technical Problem

In the prior art, the granularity of user permission control is relatively coarse, making it difficult to achieve refined control of user permissions, and the unified interception of users is complex, affecting the efficiency of interface calling.

Method used

By obtaining the permission request instructions and user permission information sent by the front-end, using the pre-configured service interface router, the target service interface needs to be called centrally from the registered service interface, and parsing the interface permission information based on the service interface annotation class to judge the user role and Whether the target service interface role matches, determines whether to respond to permission requests.

Benefits of technology

It realizes the precise call of service interfaces that meet permissions based on user roles, simplifies permission control, avoids complex permission scope calculation and unified interception, and improves the efficiency of interface calls.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118944937A_ABST
    Figure CN118944937A_ABST
Patent Text Reader

Abstract

The invention provides an interface calling method and device, electronic equipment and a storage medium, and the method comprises the steps: obtaining an authority request instruction sent by a front end and user authority information of a target user in a session with the front end; based on the permission request instruction and the user permission information, determining a target service interface needing to be called and determining a service interface annotation class from a service interface set through a pre-configured service interface router; according to the service interface annotation class, interface permission information of the target service interface is obtained through analysis; and judging whether the role of the target user is matched with at least one role served by the target service interface or not based on the role of the target user in the session indicated by the user permission information, so as to determine whether to respond to the permission request instruction to call the target service interface or not, thereby not needing to perform complex calculation on the permission range of the user again, and improving the user experience. And the users do not need to be intercepted uniformly, so that the service interface conforming to the user permission can be accurately called.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] In the related technology, when the front-end request enters the server, the interceptors and filters at the framework level are usually used to uniformly intercept the data chain called by the front-end request, obtain the user and the method of calling the service interface, and then re-query and judge the user's authority range to determine whether the user has the authority to call the service interface. Therefore, it is more complicated to implement the call service interface through this permission control strategy, and the users are uniformly intercepted, and the granularity of permission control is coarse. Summary of the invention

[0003] The present application aims to solve one of the technical problems in the related art at least to some extent.

[0004] To this end, the first purpose of this application is to propose an interface calling method to achieve refined control of user permissions, and then based on the permissions of the user's role, determine the correspondence between the permissions of the user's role and the service interface, so as to achieve the service interface to be called based on the user's role.

[0005] The second objective of the present application is to provide an interface calling device.

[0006] The third objective of the present application is to provide an electronic device.

[0007] A fourth objective of the present application is to provide a computer-readable storage medium.

[0008] A fifth object of the present application is to provide a computer program product.

[0009] To achieve the above-mentioned purpose, the first aspect of the present application proposes an interface calling method, including: obtaining a permission request instruction sent by a front-end, and obtaining user permission information of a target user having a conversation with the front-end, wherein the permission request instruction is used to request to call a service interface for the conversation; based on the permission request instruction and the user permission information, through a pre-configured service interface router, determine the target service interface to be called from the service interface set registered on the service interface router, and determine the service interface annotation class of the target service interface; according to the service interface annotation class, parse and obtain the interface permission information of the target service interface, wherein the interface permission information is used to represent at least one role of the target service interface service; based on the role of the target user in the conversation indicated by the user permission information, judge whether the role of the target user matches at least one role of the target service interface service to determine a first judgment result; based on the first judgment result, determine whether to call the target service interface in response to the permission request instruction.

[0010] To achieve the above-mentioned purpose, the second aspect of the present application proposes an interface calling device, including: a first acquisition module, used to obtain a permission request instruction sent by a front end, and to obtain user permission information of a target user having a conversation with the front end, wherein the permission request instruction is used to request to call a service interface for the session; a first determination module, used to determine the target service interface to be called from the service interface set registered on the service interface router through a preconfigured service interface router based on the permission request instruction and the user permission information, and to determine the service interface annotation class of the target service interface; a parsing module, used to parse and obtain interface permission information of the target service interface according to the service interface annotation class, wherein the interface permission information is used to represent at least one role of the target service interface service; a judgment module, used to judge whether the role of the target user matches at least one role of the target service interface service based on the role of the target user in the session indicated by the user permission information, so as to determine a first judgment result; a second determination module, used to determine whether to call the target service interface in response to the permission request instruction based on the first judgment result.

[0011] To achieve the above-mentioned purpose, the third aspect embodiment of the present application proposes an electronic device, comprising: a processor; a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to implement the interface calling method as described in the above-mentioned embodiment of the present disclosure.

[0012] To achieve the above-mentioned objectives, the fourth aspect embodiment of the present application proposes a computer-readable storage medium. When the instructions in the computer-readable storage medium are executed by the processor of an electronic device, the electronic device can execute the interface calling method described in the above-mentioned embodiment of the present disclosure.

[0013] To achieve the above objectives, the fifth aspect of the present application proposes a computer program product, a computer program, which, when executed by a processor, implements the interface calling method described in the above embodiments of the present disclosure.

[0014] The interface calling method, device, electronic device and storage medium provided by the present application obtain a permission request instruction sent by a front end, and obtain user permission information of a target user in a conversation with the front end, wherein the permission request instruction is used to request to call a service interface for the conversation; based on the permission request instruction and the user permission information, a target service interface to be called is determined from a service interface set registered on the service interface router through a preconfigured service interface router, and a service interface annotation class of the target service interface is determined; according to the service interface annotation class, interface permission information of the target service interface is parsed, wherein the interface permission information is used to represent at least one role of the target service interface service; based on the role of the target user in the conversation indicated by the user permission information, whether the role of the target user matches at least one role of the target service interface service is judged to determine a first judgment result; based on the first judgment result, whether to call the target service interface in response to the permission request instruction can be determined by judging whether the role of the target user matches at least one role of the target service interface service to determine whether to call the target service interface in response to the permission request instruction, without the need to recalculate the user's permission range in a complex manner, and without the need to uniformly intercept the user, thereby achieving accurate calling of the service interface that meets the user's permissions.

[0015] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:

[0017] Figure 1 A flowchart of an interface calling method provided in an embodiment of the present application;

[0018] Figure 2 A flowchart of another interface calling method provided in an embodiment of the present application;

[0019] Figure 3A schematic diagram of a framework corresponding to the calling service interface provided in an embodiment of the present application;

[0020] Figure 4 An example diagram of the correspondence between the service interface 1, permission groups, roles and users provided in the embodiment of the present application;

[0021] Figure 5 It is a structural diagram of the interface calling device provided in the embodiment of the present application;

[0022] Figure 6 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0023] Embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.

[0024] It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.) and signals involved in this application are all authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards.

[0025] Among them, it should be noted that the acquisition, transmission, storage, use, and processing of data in the technical solution of this application comply with the relevant provisions of relevant laws and regulations. In the embodiments of this application, certain software, components, models, and other existing solutions in the industry may be mentioned. They should be regarded as exemplary. Their purpose is only to illustrate the feasibility of implementing the technical solution of this application, but it does not mean that the applicant has or will necessarily use the solution.

[0026] The following describes the interface calling method, device, electronic device and storage medium of the embodiments of the present application with reference to the accompanying drawings.

[0027] Figure 1 A flowchart of an interface calling method provided in an embodiment of the present application.

[0028] To address this problem, the present application embodiment provides an interface calling method, such as Figure 1 As shown, the interface calling method includes the following steps:

[0029] Step 101, obtaining a permission request instruction sent by the front end, and obtaining user permission information of a target user in conversation with the front end, wherein the permission request instruction is used to request to call a service interface for the conversation.

[0030] It should be noted that the interface calling method provided in the embodiment of the present application can be executed by an interface calling device (also referred to as an interface caller), wherein the interface calling device can be implemented by software and / or hardware. The interface calling device can be an electronic device, or can be configured in an electronic device to implement the interface calling function. The embodiment of the present application is described by taking the interface calling method configured in an electronic device as an example.

[0031] Among them, the electronic device can be any device with computing capabilities, such as a personal computer, a mobile terminal, a server, etc. The mobile terminal can be, for example, a vehicle-mounted device, a mobile phone, a tablet computer, a personal digital assistant, a wearable device, and other hardware devices with various operating systems, touch screens and / or display screens.

[0032] In some examples, user permission information includes, but is not limited to, the role to which the target user belongs and the permission request path.

[0033] Role: The identity of the target user during the conversation with the front-end.

[0034] For example, the role to which the target user belongs may be an administrator.

[0035] Step 102, based on the permission request instruction and user permission information, through the preconfigured service interface router, determine the target service interface to be called from the service interface set registered on the service interface router, and determine the service interface annotation class of the target service interface.

[0036] In order to accurately determine the target service interface to be called and the service interface annotation class of the target service interface, as a possible implementation method, the target service interface to be called and the service interface annotation class of the target service interface are determined based on the request parameters carried by the permission request instruction and the permission request path included in the user permission information.

[0037] As an example, obtain the request parameters carried by the permission request instruction and the permission request path included in the user permission information; determine the service router through the network server according to the request parameters carried by the permission request instruction; select from the service interface set registered on the service interface router through the service interface router according to the permission request path to determine the target service interface to be called; based on the target service interface, determine the service interface annotation class configured for the target service interface.

[0038] Step 103: According to the service interface annotation class, interface permission information of the target service interface is parsed and obtained, wherein the interface permission information is used to represent at least one role served by the target service interface.

[0039] For example, assuming that the called target service interface can provide modification permission service, the interface permission information of the target service interface is used to indicate the roles that can use the modification service of the target service interface service. For example, the roles that can use the modification service include administrators and level 2 members, then the interface permission information of the target service interface is used to indicate the administrators and level 2 members of the target service interface service.

[0040] Step 104 : Based on the role of the target user in the session indicated by the user authority information, it is determined whether the role of the target user matches at least one role of the target service interface service to determine a first determination result.

[0041] For example, the role of the target user indicated by the user authority information in the session is a level 1 member, and the roles provided by the target service interface include administrator and level 2 member. Therefore, the role of the target user in the session does not match at least one role provided by the target service interface.

[0042] For example, the role of the target user indicated by the user authority information in the session is administrator, and the roles of the target service interface service include administrator and level 2 member, then the role of the target user in the session matches the administrator role of the target service interface service.

[0043] Step 105: Based on the first judgment result, determine whether to call the target service interface in response to the permission request instruction.

[0044] In some examples, when a first judgment result indicates that a role of a target user matches at least one role contained in a target service interface, a response to a permission request instruction is determined, and the target service interface is called; using the target service interface, the target user accesses the permission service provided by the target service interface.

[0045] Correspondingly, when the first judgment result indicates that the role of the target user does not match at least one role included in the target service interface, it is determined not to respond to the permission request instruction and not to call the target service interface.

[0046] The interface calling method provided by the present application obtains a permission request instruction sent by a front end, and obtains user permission information of a target user in a conversation with the front end, wherein the permission request instruction is used to request to call a service interface for the conversation; based on the permission request instruction and the user permission information, a target service interface to be called is determined from a service interface set registered on the service interface router through a preconfigured service interface router, and a service interface annotation class of the target service interface is determined; according to the service interface annotation class, interface permission information of the target service interface is parsed, wherein the interface permission information is used to represent at least one role of the target service interface service; based on the role of the target user in the conversation indicated by the user permission information, whether the role of the target user matches at least one role of the target service interface service is judged to determine a first judgment result; based on the first judgment result, it is determined whether to call the target service interface in response to the permission request instruction, thereby determining whether to call the target service interface in response to the permission request instruction by judging whether the role of the target user matches at least one role of the target service interface service, without the need to recalculate the user's permission range in a complex manner, and without the need to uniformly intercept the user, thereby achieving accurate calling of the service interface that meets the user's permissions.

[0047] In the embodiment of the present application, in order to clearly understand how to pre-set the service router based on the permissions of the role to which the user belongs before obtaining the permission request instruction sent by the front end and obtaining the user permission information of the target user in the conversation with the front end, so as to determine the service interface set registered on the service router, the following is combined with Figure 2 An exemplary description is given of a possible implementation method of presetting a service router based on the authority of a role to which a user belongs, so as to determine a service interface set registered on the service router. Figure 2 A flowchart of another interface calling method is provided for an embodiment of the present application, and this embodiment further refines the interface calling method.

[0048] like Figure 2 As shown, the interface calling method may include the following steps:

[0049] Step 201, obtaining the corresponding permissions of each role in the role set in the permission system.

[0050] It can be understood that the role set is a collection of roles to which the historical user has historically belonged. For example, the role set may be composed of an administrator, a level 1 member, and a level 2 member, which is not specifically limited in this embodiment.

[0051] Step 202: grouping the roles based on the permissions corresponding to the roles in the permission system to determine a plurality of permission groups, wherein each permission group includes at least one role and the permissions corresponding to the role.

[0052] For example, the authority system comparison table is shown in Table 1. Assuming the role is an administrator, according to the authority system comparison table, the administrator's corresponding permissions are "query", "modify" and "delete".

[0053] Table 1 Comparison table of authority system

[0054] Role Permissions administrator Query, modify, delete Level 1 Member Query Level 2 Member Query, modify

[0055] It is important to understand that whether to call a service interface is determined by determining whether the permission service provided by the service interface is consistent with the user's permissions. Therefore, in order to make the granularity of user permission control finer, you can focus on the permissions of the role to which the user belongs, and pre-divide multiple permission groups based on the permissions of the role. Then, based on the permissions corresponding to the permission groups, determine the permission services provided by the service interface that are consistent with the permissions corresponding to the permission groups.

[0056] For example, based on the permission system comparison table in Table 1, each role can be divided into a query permission group, a modification permission group and a deletion permission group. The roles in the query permission group can use the query permission service, the roles in the modification permission group can use the modification permission service and the roles in the deletion permission group can use the deletion permission service. Among them, the query permission group includes administrators, level 1 members and level 2 members, the deletion permission group includes administrators, and the modification permission group includes administrators and level 2 members.

[0057] Step 203: Based on each permission group, permission information corresponding to each permission group is determined, and the permission information is configured in the corresponding service interface to determine the interface permission information configured for the corresponding service interface.

[0058] In order to accurately determine the corresponding relationship between the permission group and the service interface, and configure the permission information in the corresponding service interface, as a possible implementation method, the corresponding relationship between the permission group and the service interface is determined based on the permission information of each permission group and the permission service information allowed to be provided by each service interface.

[0059] As an example, obtain the permission service information that each service interface is allowed to provide; based on the permission information of each permission group and the permission service information that each service interface is allowed to provide, determine the correspondence between each permission group and each service interface; based on the correspondence, for any permission group, configure the permission information of the permission group in the corresponding service interface to determine the interface permission information of each service interface.

[0060] It is understandable that the interface permission information configured in different service interfaces is not the same.

[0061] It should be noted that the permission service information allowed to be provided by the service interface is used to indicate the permission services allowed to be provided by the service interface. For example, the query service interface allows the provision of query permission services, the modification service interface allows the provision of modification permission services, and the deletion service interface allows the provision of deletion permission services.

[0062] For example, assuming there are query permission groups, modification permission groups and deletion permission groups, query service interfaces, modification service interfaces and deletion service interfaces, based on the permission information of each permission group and the permission service information allowed to be provided by each service interface, it is determined that there is a correspondence between the query permission group and the query service interface, a correspondence between the modification permission group and the modification service interface, and a correspondence between the deletion permission group and the deletion service interface.

[0063] Correspondingly, the query permission group is configured in the corresponding query service interface to determine the interface permission information of the query service interface, that is, the interface permission information of the query service interface is used to represent the administrator, level 1 member and level 2 member in the role set of the query service interface service.

[0064] Correspondingly, the modification permission group is configured in the corresponding modification service interface to determine the interface permission information of the modification service interface, that is, the interface permission information of the modification service interface is used to represent the administrators in the role set of the modification service interface service.

[0065] Correspondingly, the deletion permission group is configured in the corresponding deletion service interface to determine the interface permission information of the deletion service interface, that is, the interface permission information of the deletion service interface is used to represent the administrator and level 2 member of the deletion service interface service in the role set.

[0066] Step 204: For the service interface that has been configured with interface permission information, a service interface annotation class corresponding to the service interface is set.

[0067] As an example, for service interfaces that have been configured with interface permission information, interface abstraction is performed on all service interfaces that have been configured with interface permission information to determine the abstract classes corresponding to all service interfaces that have been configured with interface permission information; based on the abstract classes, all service interfaces that have been configured with interface permission information are annotated to determine the service interface annotation classes of the corresponding service interfaces.

[0068] Step 205 , mapping the service interfaces for which the service interface annotation classes have been set one by one to the service interface set, and registering the service interface set on the service interface router.

[0069] It is understandable that each time a service interface is started and called, the service interfaces with the set service interface annotation class can be mapped one by one and saved into the service interface set, and the service interface set can be registered on the service interface router through the preconfigured service interface router.

[0070] Step 206, obtaining the permission request instruction sent by the front end, and obtaining the user permission information of the target user in the conversation with the front end, wherein the permission request instruction is used to request to call a service interface for the conversation.

[0071] Step 207, based on the permission request instruction and the user permission information, through the preconfigured service interface router, determine the target service interface to be called from the service interface set registered on the service interface router, and determine the service interface annotation class of the target service interface.

[0072] Step 208: parsing the target service interface annotation class to obtain interface permission information of the target service interface, wherein the interface permission information is used to represent at least one role served by the target service interface.

[0073] Step 209: Based on the role of the target user in the session indicated by the user authority information, it is determined whether the role of the target user matches at least one role of the target service interface service to determine a first determination result.

[0074] Step 210: Based on the first judgment result, determine whether to call the target service interface in response to the permission request instruction.

[0075] It should be noted that the execution process of steps 206 to 210 can be implemented in any of the ways in the embodiments of the present application, and the embodiments of the present application do not limit this and will not be described in detail.

[0076] In this embodiment, the corresponding permissions of each role in the role set in the permission system are obtained; based on the permissions corresponding to each role in the permission system, each role is grouped to determine multiple permission groups, wherein each permission group includes at least one role and the permissions corresponding to the role; based on each permission group, the permission information corresponding to each permission group is determined, and the permission information is configured in the corresponding service interface to determine the interface permission information configured for the corresponding service interface; for the service interface that has been configured with the interface permission information, a service interface annotation class corresponding to the service interface is set; the service interfaces that have been set with the service interface annotation class are mapped one by one to the service interface set, and the service interface set is registered on the service interface router, thereby, based on the permissions corresponding to each role in the permission system, multiple permission groups are determined, focusing on the permissions of the role to which the user belongs, the granularity of permission control is fine, and the corresponding relationship between the permission group and the service interface is determined, and the permission group and the service interface are connected, so that it is only necessary to judge whether the permissions of the role to which the user belongs match the role of the service interface service to determine whether to call the corresponding service interface, which greatly simplifies the complexity of the interface call and improves the efficiency of the interface call.

[0077] For example, the framework diagram corresponding to calling the service interface can be as follows Figure 3 As shown, based on the front-end permission request instruction and the user permission information of the target user in the front-end conversation, the service interface service is started, and service interface 1, service interface 2 and service interface 3 are mapped one by one and saved in the service interface set. Through the pre-configured service interface router, the target service interface to be called is determined from the service interface set registered on the service interface router, assuming that the target service interface is service interface 1.

[0078] It can be understood that, according to the request parameters carried by the front-end permission request instruction and the permission request path included in the user permission information of the target user in the front-end session, the service interface calling service is started to determine the target service interface to be called.

[0079] For example, taking service interface 1 as an example, the example diagram of the correspondence between service interface 1, permission group, role and user is as follows: Figure 4 As shown, there is a many (N) to 1 relationship between the service interface and the permission group, a 1 to many (N) relationship between the permission group and the role, and a many (N) to many (N) relationship between the role and the user.

[0080] In order to implement the above embodiment, the present application also proposes an interface calling device.

[0081] Figure 5 A schematic diagram of the structure of an interface calling device provided in an embodiment of the present application.

[0082] like Figure 5 As shown, the interface calling device 500 includes: a first acquisition module 501, a first determination module 502, a parsing module 503, a judgment module 504 and a second determination module 505.

[0083] The first acquisition module 501 is used to acquire the permission request instruction sent by the front end, and to acquire the user permission information of the target user in the conversation with the front end, wherein the permission request instruction is used to request to call a service interface for the conversation;

[0084] The first determination module 502 is used to determine the target service interface to be called from the service interface set registered on the service interface router through a preconfigured service interface router based on the permission request instruction and the user permission information, and determine the service interface annotation class of the target service interface;

[0085] A parsing module 503 is used to parse and obtain interface permission information of a target service interface according to a service interface annotation class, wherein the interface permission information is used to indicate at least one role served by the target service interface;

[0086] A judgment module 504 is used to judge whether the role of the target user matches at least one role of the target service interface service based on the role of the target user in the session indicated by the user authority information, so as to determine a first judgment result;

[0087] The second determination module 505 is used to determine whether to call the target service interface in response to the permission request instruction based on the first judgment result.

[0088] In one embodiment of the present application, the device further includes a configuration module, specifically configured to:

[0089] Get the corresponding permissions of each role in the role set in the permission system;

[0090] Based on the permissions corresponding to each role in the permission system, group each role to determine a plurality of permission groups, wherein each permission group includes at least one role and the permissions corresponding to the role;

[0091] Based on each permission group, determining permission information corresponding to each permission group, and configuring the permission information in the corresponding service interface to determine interface permission information configured for the corresponding service interface;

[0092] For the service interface that has been configured with interface permission information, set the service interface annotation class of the corresponding service interface;

[0093] The service interfaces of the service interface annotation class are mapped one by one to the service interface set, and the service interface set is registered on the service interface router.

[0094] In one embodiment of the present application, the configuration module is further specifically used for:

[0095] Get the permission service information that each service interface is allowed to provide;

[0096] Based on the permission information of each permission group and the permission service information allowed to be provided by each service interface, determine the corresponding relationship between each permission group and each service interface;

[0097] Based on the corresponding relationship, for any permission group, the permission information of the permission group is configured in the corresponding service interface to determine the interface permission information of each service interface.

[0098] In one embodiment of the present application, the first determining module 502 is specifically configured to:

[0099] Obtain the request parameters carried by the permission request instruction, and obtain the permission request path included in the user permission information;

[0100] Determine the service router through the network server according to the request parameters carried by the permission request instruction;

[0101] According to the permission request path, through the service interface router, a selection is made from the service interface set registered on the service interface router to determine the target service interface to be called;

[0102] Based on the target service interface, determine the service interface annotation class configured for the target service interface.

[0103] In one embodiment of the present application, the second determining module 505 is specifically configured to:

[0104] If the first judgment result indicates that the role of the target user matches at least one role included in the target service interface, determining to respond to the permission request instruction and calling the target service interface;

[0105] Using the target service interface, the target user accesses the permission service provided by the target service interface.

[0106] In one embodiment of the present application, the second determining module 505 is specifically configured to:

[0107] When the first judgment result indicates that the role of the target user does not match at least one role included in the target service interface, it is determined not to respond to the permission request instruction and not to call the target service interface.

[0108] It should be noted that the aforementioned explanation of the interface calling method embodiment is also applicable to the interface calling device of this embodiment, and will not be repeated here.

[0109] The interface calling device provided by the present application obtains a permission request instruction sent by a front end, and obtains user permission information of a target user in a conversation with the front end, wherein the permission request instruction is used to request to call a service interface for the conversation; based on the permission request instruction and the user permission information, through a pre-configured service interface router, the target service interface to be called is determined from the service interface set registered on the service interface router, and the service interface annotation class of the target service interface is determined; according to the service interface annotation class, the interface permission information of the target service interface is parsed, wherein the interface permission information is used to represent at least one role of the target service interface service; based on the role of the target user in the conversation indicated by the user permission information, whether the role of the target user matches at least one role of the target service interface service is judged to determine a first judgment result; based on the first judgment result, it is determined whether to call the target service interface in response to the permission request instruction, thereby determining whether to call the target service interface in response to the permission request instruction by judging whether the role of the target user matches at least one role of the target service interface service, without the need to recalculate the user's permission range in a complex manner, and without the need to uniformly intercept the user, thereby achieving accurate calling of the service interface that meets the user's permissions.

[0110] In an exemplary embodiment, an electronic device is also provided.

[0111] Among them, electronic equipment includes:

[0112] processor;

[0113] a memory for storing processor-executable instructions;

[0114] The processor is configured to execute instructions to implement the interface calling method proposed in any of the aforementioned embodiments.

[0115] As an example, Figure 6 is a schematic diagram of the structure of an electronic device 600 shown in an exemplary embodiment of the present disclosure, such as Figure 6 As shown, the electronic device 600 may further include:

[0116] The memory 610 and the processor 620, a bus 630 connecting different components (including the memory 610 and the processor 620), the memory 610 stores a computer program, and when the processor 620 executes the program, the interface calling method described in the embodiment of the present disclosure is implemented.

[0117] Bus 630 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus architectures. By way of example, these architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MAC) bus, an Enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.

[0118] The electronic device 600 typically includes a variety of electronic device readable media. These media can be any available media that can be accessed by the electronic device 600, including volatile and non-volatile media, removable and non-removable media.

[0119] The memory 610 may also include computer system readable media in the form of volatile memory, such as random access memory (RAM) 640 and / or cache memory 650. The server 600 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 660 may be used to read and write non-removable, non-volatile magnetic media ( Figure 6 not shown, often referred to as a "hard drive packager"). Although Figure 6Not shown in the figure, a disk driver package for reading and writing a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk driver package for reading and writing a removable non-volatile optical disk (e.g., a CD-ROM, a DVD-ROM, or other optical media) may be provided. In these cases, each driver package can be connected to the bus 630 via one or more data medium interfaces. The memory 610 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present disclosure.

[0120] A program / utility 680 having a set (at least one) of program modules 670 may be stored, for example, in the memory 610, such program modules 670 including but not limited to an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. The program modules 670 generally perform the functions and / or methods of the embodiments described in the present disclosure.

[0121] The electronic device 600 may also communicate with one or more external devices 660 (e.g., keyboard, pointing device, display 691, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 600, and / or communicate with any device that enables the electronic device 600 to communicate with one or more other computing devices (e.g., network card, modem, etc.). Such communication may be performed via an input / output (I / O) interface 692. In addition, the electronic device 600 may also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN) and / or public network, such as the Internet) via a network adapter 693. As shown, the network adapter 693 communicates with other modules of the electronic device 600 via a bus 630. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 600, including but not limited to: microcode, device driver package, redundant processing unit, external disk driver package array, RAID system, tape driver package, and data backup storage system, etc.

[0122] The processor 620 executes various functional applications and data processing by running the programs stored in the memory 610 .

[0123] It should be noted that the implementation process and technical principles of the electronic device of this embodiment refer to the aforementioned explanation of the interface calling method of the embodiment of the present disclosure, which will not be repeated here.

[0124] In an exemplary embodiment, a computer-readable storage medium including instructions is also provided, such as a memory including instructions, and the above instructions can be executed by a processor of an electronic device to complete the interface calling method proposed in any of the above embodiments. Optionally, the computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0125] In an exemplary embodiment, a computer program product is also provided, including a computer program / instruction, characterized in that when the computer program / instruction is executed by a processor, the interface calling method proposed in any of the above embodiments is implemented.

[0126] The collection, storage, access, processing, transmission, provision and disclosure of user personal information involved in this application are in compliance with relevant laws and regulations and do not violate public order and good morals.

[0127] It should be noted that personal information from users should be collected for legitimate and reasonable purposes and not shared or sold outside of these legitimate accesses. In addition, such collection / sharing should be carried out after receiving the user's informed consent, including but not limited to notifying the user to read the user agreement / user notice before the user accesses the function, and signing the agreement / authorization including authorization of relevant user information. In addition, any necessary steps should be taken to protect and safeguard access to such personal information data and ensure that others who have access to personal information data comply with its privacy policy and procedures.

[0128] The present application is expected to provide an implementation scheme for users to selectively block access to or access to personal information data. That is, the present disclosure is expected to provide hardware and / or software to prevent or block access to such personal information data. Once the personal information data is no longer needed, the risk can be minimized by limiting data collection and deleting the data. In addition, when applicable, such personal information is de-identified to protect the privacy of the user.

[0129] In the description of the aforementioned embodiments, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.

[0130] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of this application, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.

[0131] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code comprising one or more executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present application belong.

[0132] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.

[0133] In addition, each functional unit in each embodiment of the present application may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or accessed as an independent product, it may also be stored in a computer-readable storage medium.

[0134] The storage medium mentioned above may be a read-only memory, a magnetic disk or an optical disk, etc. Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limiting the present application. A person of ordinary skill in the art may change, modify, replace and modify the above embodiments within the scope of the present application.

Claims

1. An interface calling method, characterized in that: The following steps are involved: Obtaining a permission request instruction sent by the front end, and obtaining user permission information of a target user in a conversation with the front end, wherein the permission request instruction is used to request to call a service interface for the conversation; Based on the permission request instruction and the user permission information, through a preconfigured service interface router, determine the target service interface to be called from the service interface set registered on the service interface router, and determine the service interface annotation class of the target service interface; According to the service interface annotation class, parsing obtains interface permission information of the target service interface, wherein the interface permission information is used to represent at least one role served by the target service interface; Based on the role of the target user in the session indicated by the user authority information, judging whether the role of the target user matches at least one role of the target service interface service to determine a first judgment result; Based on the first judgment result, it is determined whether to call the target service interface in response to the permission request instruction.

2. The method according to claim 1, characterized in that Before obtaining the permission request instruction sent by the front end and obtaining the user permission information of the target user in the conversation with the front end, the method includes: Get the corresponding permissions of each role in the role set in the permission system; Based on the permissions corresponding to each role in the permission system, grouping each role to determine a plurality of permission groups, wherein each permission group includes at least one role and the permissions corresponding to the role; Based on each of the permission groups, determining the permission information corresponding to each of the permission groups, and configuring the permission information in the corresponding service interface to determine the interface permission information configured for the corresponding service interface; For the service interface that has been configured with the interface permission information, setting the service interface annotation class corresponding to the service interface; The service interfaces for which the service interface annotation class has been set are mapped one by one to the service interface set, and the service interface set is registered on the service interface router.

3. The method according to claim 2, characterized in that The determining, based on each of the permission groups, the permission information corresponding to each of the permission groups, and configuring the permission information in the corresponding service interface to determine the interface permission information configured for the corresponding service interface includes: Obtaining the permission service information that each service interface is allowed to provide; Based on the permission information of each permission group and the permission service information allowed to be provided by each service interface, determining the correspondence between each permission group and each service interface; Based on the corresponding relationship, for any of the permission groups, the permission information of the permission group is configured in the corresponding service interface to determine the interface permission information of each of the service interfaces.

4. The method according to any one of claims 1 to 3, characterized in that: Based on the permission request instruction and the user permission information, a target service interface to be called is determined from a service interface set registered on the service interface router through a preconfigured service interface router, and a service interface annotation class of the target service interface is determined, including: Obtaining the request parameters carried by the permission request instruction, and obtaining the permission request path included in the user permission information; Determine the service router through a network server according to the request parameter carried by the permission request instruction; According to the permission request path, through the service interface router, selecting from the service interface set registered on the service interface router to determine the target service interface to be called; Based on the target service interface, the service interface annotation class configured for the target service interface is determined.

5. The method according to any one of claims 1 to 3, characterized in that: The determining, based on the first judgment result, whether to call the target service interface in response to the permission request instruction comprises: In a case where the first judgment result indicates that the role of the target user matches at least one role included in the target service interface, determining to respond to the permission request instruction and calling the target service interface; Using the target service interface, the target user accesses the authority service provided by the target service interface.

6. The method according to any one of claims 1 to 3, characterized in that: The determining, based on the first judgment result, whether to call the target service interface in response to the permission request instruction comprises: When the first judgment result indicates that the role of the target user does not match at least one role included in the target service interface, it is determined not to respond to the permission request instruction and not to call the target service interface.

7. An interface calling device, characterized in that: include: A first acquisition module, configured to acquire a permission request instruction sent by a front end, and to acquire user permission information of a target user having a conversation with the front end, wherein the permission request instruction is used to request to call a service interface for the conversation; A first determination module is used to determine, based on the permission request instruction and the user permission information, a target service interface to be called from a service interface set registered on the service interface router through a preconfigured service interface router, and determine a service interface annotation class of the target service interface; A parsing module, used to parse and obtain interface permission information of the target service interface according to the service interface annotation class, wherein the interface permission information is used to represent at least one role served by the target service interface; a judgment module, configured to judge whether the role of the target user matches at least one role of the target service interface service based on the role of the target user in the session indicated by the user authority information, so as to determine a first judgment result; The second determination module is used to determine whether to call the target service interface in response to the permission request instruction based on the first judgment result.

8. An electronic device, characterized in that: include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 6 when executed by a processor.

10. A computer program product, characterized in that The invention comprises a computer program, which implements the method according to any one of claims 1 to 6 when being executed by a processor.

Citation Information

Patent Citations

  • Authentication method and device for interface calling, equipment and storage medium

    CN113179243A

  • Cloud platform interface authority control method and device, equipment and medium

    CN113872991A

  • Service request response method and device, equipment and medium

    CN114844950A

  • Interface authority control method and device and electronic equipment

    CN116257293A

  • Permission determination method and device, equipment and storage medium

    CN117272344A