Service request processing method, device, system, and storage medium
By introducing an authorization proxy module to handle authorization requests during permission checks, the problem of high development workload caused by explicit calls to system interfaces in existing technologies is solved, thereby improving application development efficiency and increasing the transparency of the authorization process.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ZEBRED NETWORK TECH CO LTD
- Filing Date
- 2022-08-30
- Publication Date
- 2026-05-15
AI Technical Summary
In existing technologies, applications need to explicitly call system interfaces to trigger dialog boxes when requesting permissions, resulting in a large workload and low development efficiency.
An authorization proxy module is introduced. This module handles authorization requests during the permission check process, eliminating the need for applications to explicitly call system interfaces. The authorization proxy module requests user authorization on behalf of the application and determines whether to continue the service request.
It reduces the amount of code development required for requesting authorization input in application development, improves application development efficiency, and makes the request authorization process transparent to the application.
Smart Images

Figure CN115422520B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a method, apparatus, system and storage medium for processing service requests. Background Technology
[0002] Applications (APPs) on terminal devices run in isolated sandboxes and have only very limited permissions. Relevant regulations and industry standards clearly require that when an application needs to access a user's private information, it must request the corresponding permissions and inform the user through pop-up dialog boxes or other means, allowing the user to choose whether to grant permission. Only when the user chooses to grant permission can the application perform the corresponding operation to obtain the user's private information; otherwise, the application's access to the user's private information will be denied.
[0003] In related technologies, the operating system includes a permission service module, a service module, and a dialog interface service module. Before an application calls the target business function interface, the application first sends an authorization request to the permission service module. Upon receiving the authorization request, the permission service module first checks the application's authorization status. If the authorization status is "questionable," it requests the dialog interface service module to display an authorization dialog box and waits for user input. When the user inputs, the dialog interface service module returns the user's input to the permission service module, which then updates the locally stored authorization status of the application based on the user's input and returns the updated authorization status to the application. If the updated authorization status is "allowed," the application calls the target business function interface and sends an inter-process communication (IPC) message to the service module to request the service provided by the target business function interface; if the updated authorization status is "denied," the service request is interrupted.
[0004] The above-mentioned service request process requires a significant amount of development work, resulting in low application development efficiency. Summary of the Invention
[0005] This application provides a method, apparatus, system, and storage medium for processing service requests, in order to improve application development efficiency.
[0006] Firstly, this application provides a method for processing service requests, applied to an operating system. The operating system includes an authorization proxy module, a service module, a permission service module, and a dialog box interface service module. The processing method includes:
[0007] When the application calls the target business function interface, the authorization proxy module receives the first message from the application. The first message is used to request the service provided by the target business function interface.
[0008] The authorization agent module sends the first message to the service module;
[0009] Upon receiving the first message, the service module sends an application permission authorization request to the permission service module to obtain the application's authorization status for the target information. The authorization request is used to query whether the application has the permission to obtain the target information required for the service.
[0010] If the authorization status of the service request is "question", the service module instructs the authorization agent module to request authorization from the permission service module through a pop-up dialog box, so that the authorization agent module can obtain the updated authorization status based on the authorization input;
[0011] The authorization proxy module determines whether to request services from the service module based on the updated authorization status.
[0012] Optionally, the service module instructs the authorization agent module to request authorization via a pop-up dialog box from the permission service module, so that the authorization agent module obtains the updated authorization status based on the authorization input, including:
[0013] The service module instructs the authorization agent module to request authorization via a pop-up dialog box from the permission service module;
[0014] The permission service module requests an authorization dialog box, which is displayed in the interface service module to send the obtained authorization input to the permission service module.
[0015] The authorization service module sends the updated authorization status to the authorization agent module based on the authorization input.
[0016] Optionally, the service module instructs the authorization agent module to request authorization via a pop-up dialog box from the permission service module, including:
[0017] The service module constructs a reply message based on the first message. The reply message carries a set tag, which is used to instruct the authorized agent module to recognize the reply message.
[0018] The service module sends a reply message to the authorization agent module;
[0019] The authorization agent module requests authorization from the permission service module via a pop-up dialog box.
[0020] Optionally, the reply message also carries metadata that generated the first message, and the processing methods also include:
[0021] After receiving the reply message, the authorization agent module extracts and caches the metadata in the reply message.
[0022] Optionally, the permission service module sends the updated authorization status to the authorization agent module based on the authorization input, including:
[0023] The permission service module updates the authorization status of applications stored locally based on the authorization input, and obtains the updated authorization status;
[0024] The permission service module sends the updated authorization status to the authorization agent module.
[0025] Optionally, the authorization proxy module determines whether to request services from the service module based on the updated authorization status, including:
[0026] If the updated authorization status is allowed, the authorization proxy module requests services from the service module and performs the following operations:
[0027] Based on the metadata that generated the first message, the second message is reconstructed. The second message is used to request the services provided by the target business function interface.
[0028] The authorization proxy module sends a second message to the service module in order to obtain the processing result from the service module's response to the second message.
[0029] Optionally, the authorization proxy module sends a second message to the service module to obtain the processing result from the service module's response to the second message, including:
[0030] The authorization proxy module sends a second message to the service module;
[0031] If the second message carries the updated authorization status, the service module responds to the processing result obtained from the second message; or, if the second message does not carry the updated authorization status, the service module queries the permission service module to obtain the updated authorization status. If the updated authorization status is allowed, the service module responds to the processing result obtained from the second message.
[0032] The service module sends the processing results to the application.
[0033] Optionally, after receiving the first message from the application, the authorization proxy module also includes:
[0034] The authorization proxy module caches the first message;
[0035] The authorization proxy module determines whether to request services from the service module based on the updated authorization status, including:
[0036] If the updated authorization status is allowed, the authorization proxy module requests services from the service module and performs the following operations:
[0037] The authorization proxy module sends the first message to the service module to obtain the processing result from the service module's response to the first message.
[0038] Optionally, the authorization proxy module determines whether to request services from the service module based on the updated authorization status, including:
[0039] If the updated authorization status is denied, the authorization proxy module will refuse to request services from the service module and send an indication message to the application to deny services.
[0040] Optionally, the processing method also includes: if the authorization status of the service request is allowed, the service module responds to the first message to obtain the processing result and sends the processing result to the application;
[0041] If the authorization status of the service request is denied, the service module sends an indication message to the application to deny the service.
[0042] Secondly, this application provides a method for processing service requests, applied to an application, the method including:
[0043] When an application calls the target business function interface, it sends a first message to the operating system. The first message is used to request the service provided by the target business function interface.
[0044] Receive the response from the operating system. The response includes indication information for denying service, and the processing result of the first response message.
[0045] Thirdly, this application provides a service request processing apparatus applied to an operating system, the processing apparatus comprising:
[0046] The calling module is used to receive the first message from the application when the application calls the target business function interface. The first message is used to request the service provided by the target business function interface.
[0047] The sending module is used to authorize the proxy module to send the first message to the service module;
[0048] The response module is used by the service module to send an application permission authorization request to the permission service module in response to receiving the first message, so as to obtain the authorization status of the application for the target information. The authorization request is used to query whether the application has the permission to obtain the target information required to obtain the service.
[0049] The request module is used to instruct the authorization proxy module to request authorization from the permission service module by displaying a dialog box if the authorization status of the service request is "questioning". This allows the authorization proxy module to obtain the updated authorization status based on the authorization input.
[0050] The determination module is used by the authorization agent module to determine whether to request services from the service module based on the updated authorization status.
[0051] Fourthly, this application provides a service request processing apparatus for an application, the processing apparatus comprising:
[0052] The sending module is used to send a first message to the operating system when the application calls the target business function interface. The first message is used to request the service provided by the target business function interface.
[0053] The receiving module is used to receive the response results sent by the operating system. The response results include indication information for denial of service, and the processing result of the first response message.
[0054] Fifthly, this application provides an electronic device, including: a memory and a processor;
[0055] Memory, used to store executable instructions;
[0056] The processor is configured to execute executable instructions to implement the first or second aspect of the processing method.
[0057] Sixthly, this application provides a service request processing system, comprising:
[0058] The operating system is used to execute the processing methods of the first aspect.
[0059] The application is used to execute the processing method of the second aspect.
[0060] In a seventh aspect, this application provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the processing method of the first aspect or the second aspect.
[0061] Eighth aspect. This application provides a computer program product, including a computer program that, when executed, implements the processing method of the first aspect or the second aspect.
[0062] The service request processing method, device, system, and storage medium provided in this application, when an application calls a target business function interface, involves an authorization proxy module receiving and sending a first message from the application to the service module. In response to receiving the first message, the service module sends an application permission authorization request to the permission service module to obtain the application's authorization status for the target information. If the authorization status of the service request is "inquiry," the service module instructs the authorization proxy module to request authorization via a pop-up dialog box from the permission service module, allowing the authorization proxy module to obtain an updated authorization status based on the authorization input. The authorization proxy module then determines whether to request service from the service module based on the updated authorization status. This process, by introducing an authorization proxy module, achieves a transparent request authorization processing mechanism for the application. That is, the request authorization process involved in the permission check is handled by the operating system, and the application sending the service request is unaware of this. This eliminates the need to explicitly call system interfaces at the code level to trigger the pop-up dialog box during application development. Therefore, it reduces the workload of application development and improves application development efficiency. Attached Figure Description
[0063] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0064] Figure 1 This is a flowchart illustrating the permission request process in related technologies.
[0065] Figure 2 A flowchart illustrating a service request processing method provided in an embodiment of this application;
[0066] Figure 3 A flowchart illustrating the update of the authorization status provided in one embodiment of this application;
[0067] Figure 4 A flowchart of the service module response when the authorization status is allowed, provided as an embodiment of this application;
[0068] Figure 5 A flowchart illustrating a service request processing method provided in another embodiment of this application;
[0069] Figure 6 An interactive signaling diagram of a service request processing method provided in an embodiment of this application;
[0070] Figure 7 A schematic diagram of a service request processing apparatus provided in an embodiment of this application;
[0071] Figure 8 A schematic diagram of a service request processing apparatus provided for another embodiment of this application;
[0072] Figure 9 A schematic diagram of the structure of an electronic device provided in another embodiment of this application;
[0073] Figure 10 This is a block diagram of a terminal provided in an embodiment of this application.
[0074] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0075] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0076] When applications on a terminal device need to access external data and services, they must request the corresponding permissions and call the access interfaces provided by the operating system through methods such as IPC. Each application contains a Manifest file, which determines the permissions the application must have to access the protected API (Application Programming Interface) portions. In the Manifest file, permissions are divided into several different protection levels, such as normal permissions and dangerous permissions. Normal permissions have virtually no impact on user privacy or other applications; if normal permissions are declared in the Manifest file, the system will automatically grant the application those permissions. Dangerous permissions, however, can affect user privacy information, user-stored data, or other applications; for example, reading a user's contacts is a dangerous permission. If a dangerous permission is declared in the application's Manifest, the system will not automatically grant the application those permissions; the user must decide whether to grant them.
[0077] Figure 1 This is a flowchart illustrating the permission request process in related technologies. (Refer to...) Figure 1Before an application calls the target business function interface, it first needs to send an authorization request for application permissions to the permission service module via an interface call. This interface can be the Request Permission interface. Upon receiving the request, the permission service module first checks the application's authorization status. If the authorization status is "allow" or "deny," the permission service module returns the authorization status directly to the application. If the authorization status is "questionable," the permission service module requests the dialog box interface service module to display an authorization dialog box and waits for user input. The dialog box interface service module then returns the user's input to the permission service module. Upon receiving the user's input, the permission service module first updates the locally stored authorization status and returns the updated authorization status to the application. After receiving the updated authorization status, if the updated authorization status is "allow" or the initial authorization status was "allow," the application calls the target business function interface and sends an IPC message to the service module requesting the service provided by the target business function interface. At this time, the service module sends a request to the permission service module to check the application's permissions, and the permission service module returns "allow." Upon receiving "allow," the service module responds to the application's request and returns the response result to the application. If the updated authorization status is "deny" or the initial authorization status was "deny," the service request is interrupted.
[0078] To implement the aforementioned permission request process, application developers must explicitly call the Request Permission interface at the application code level to actively trigger the authorization dialog box, requesting and waiting for user input. Simultaneously, developers must implement different business logic within the application code based on different user inputs. Therefore, during application development, developers need to clearly understand the required permission protection levels and handle different levels of permissions differently. For dangerous permissions, in addition to declaring the protection level in the Manifest file, developers also need to modify the code to enable the application to request user authorization. This approach results in a significant workload and high difficulty for application developers, leading to low development efficiency.
[0079] To address the aforementioned issues, this application provides a service request processing method. When the authorization status is in the "questioning" phase, the authorization proxy module can obtain user input (hereinafter referred to as "authorization input") on behalf of the application and determine whether to request service from the service module based on the user's input. Correspondingly, the application only needs to send request information (hereinafter referred to as "first information") and receive the response result. This reduces application development costs and difficulty, thereby improving application development efficiency.
[0080] The technical solution of this application and how it solves the above-mentioned technical problems will be described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will be described below with reference to the accompanying drawings.
[0081] Figure 2 This is a flowchart illustrating a service request processing method provided in one embodiment of this application. The method is applied to an operating system, which includes an authorization proxy module, a service module, a permission service module, and a dialog box interface service module.
[0082] like Figure 2 As shown, the methods for processing service requests include:
[0083] S201, When the application calls the target business function interface, the authorization proxy module receives the first message from the application.
[0084] The first message is used to request services provided by the target business function interface. The target business function includes, but is not limited to, using the camera, viewing contacts, or viewing photos. The application requests services by calling the target business function interface and sending the first message to the authorization agent module.
[0085] The first message can be a Msg request service sent via IPC or other means.
[0086] S202, the authorized agent module sends the first message to the service module.
[0087] The first message is forwarded to the service module via the authorized agent module.
[0088] S203, upon receiving the first message, the service module sends an application permission authorization request to the permission service module to obtain the application's target-oriented authorization status.
[0089] The authorization request is used to query whether the application has the permission to obtain the target information required to access the service. When the service module receives the first message, it sends an application permission authorization request to the permission service module to query the application's permissions, specifically whether the application has the permission to obtain the target information required to access the service requested in the first message. For example, if the service requested in the first message is "Read Contacts," then the authorization request is used to query whether the application has permission to access "Contacts."
[0090] Optionally, the authorization status can be one of three types: Allow, Deny, and Inquire. An Allowed authorization status means the application has permission to obtain the target information required for the service; a Deny authorization status means the application does not have permission to obtain the target information required for the service; and an Inquired authorization status means that the application's permission to obtain the target information required for the service can only be determined after questioning the user. Therefore, in some embodiments, if the authorization status of the service request is Allowed, the service module responds to the first message to obtain the processing result and sends the processing result to the application. If the authorization status of the service request is Deny, the service module sends an indication message to the application to deny the service. If the authorization status of the service request is Inquired, step S204 is executed.
[0091] Generally, the processing result sent can be the target information requested by the application.
[0092] S204, the service module instructs the authorization agent module to request authorization from the permission service module via a pop-up dialog box, so that the authorization agent module can obtain the updated authorization status based on the authorization input.
[0093] When the authorization status of a service request is "questioning," the authorization status needs to be updated by prompting the user and obtaining their authorization input. Therefore, the service module will instruct the authorization proxy module to request authorization from the permission service module through a pop-up dialog box, in which the user can select or enter the updated authorization status.
[0094] S205, The authorization agent module determines whether to request services from the service module based on the updated authorization status.
[0095] The updated authorization status is either allowed or denied. If the updated authorization status is allowed, the service is requested from the service module. If the updated authorization status is denied, the service is not requested from the service module; or, after requesting the service from the service module, the requesting module denies the service.
[0096] In this embodiment, when an application calls a target business function interface, the authorization proxy module receives and sends a first message from the application to the service module. In response to receiving the first message, the service module sends an authorization request for application permissions to the permission service module to obtain the application's authorization status for the target information. If the authorization status of the service request is "inquiry," the service module instructs the authorization proxy module to request authorization via a pop-up dialog box from the permission service module, so that the authorization proxy module obtains the updated authorization status based on the authorization input. The authorization proxy module determines whether to request service from the service module based on the updated authorization status. This process, by introducing the authorization proxy module, implements a transparent request authorization processing mechanism for the application. That is, the request authorization process involved in the permission check is handled by the operating system, and the application sending the service request is unaware of this. Thus, when developing an application, it is not necessary to explicitly call system interfaces at the code level to trigger the pop-up dialog box. Therefore, it can reduce the workload of application development and improve the efficiency of application development.
[0097] Figure 3 A flowchart illustrating the update of the authorization status according to an embodiment of this application. (Refer to...) Figure 3 The following provides a further explanation of step S204. In some embodiments, step S204 includes:
[0098] S301, the service module instructs the authorization agent module to request authorization from the permission service module via a pop-up dialog box.
[0099] Optionally, step S301 can be implemented through the following process: the service module constructs a reply message based on the first message, the reply message carries a setting tag, the setting tag is used to instruct the authorization agent module to recognize the reply message; the service module sends the reply message to the authorization agent module; the authorization agent module requests authorization from the permission service module through a pop-up dialog box.
[0100] The aforementioned tag settings can be achieved by setting specific fields in the message header of the reply message.
[0101] Furthermore, although the process of constructing the reply message is executed by the service module, the entire process is not displayed, so users will not be aware of it when using it.
[0102] When the authorization status is in the "question" state, the service module will construct a reply message based on the first message received previously and set a setting tag in the reply message. When the service module sends a message to the authorization agent module, the setting tag enables the authorization agent module to recognize the reply message. Triggered by the reply message, the authorization agent module will request authorization from the permission service module through a pop-up dialog box.
[0103] In some embodiments, the reply message may be sent only to the authorization agent module, rather than being sent to the authorization agent module. In this case, due to the existence of the set tag, the authorization agent module can intercept the reply message carrying the set tag.
[0104] S302, the authorization service module requests an authorization dialog box. The interface service module pops up an authorization dialog box to send the obtained authorization input to the authorization service module.
[0105] When the dialog box service module pops up the authorization dialog box, the user can fill in or select information in the authorization dialog box, thereby enabling the dialog box service module to obtain authorization input, which will then be sent to the permission service module.
[0106] S303, The authorization service module sends the updated authorization status to the authorization agent module based on the authorization input.
[0107] The updated authorization status is either allowed or denied.
[0108] Since the process of updating the authorization status does not require the application's participation, the amount of code related to it can be reduced during application development, thereby reducing the workload of application development.
[0109] Figure 4 This is a flowchart illustrating the updated service module response when the authorization status is "Allowed," provided as an embodiment of this application. (Refer to...) Figure 4 Further explanation of step S205: Specifically, step S205 includes:
[0110] S401, Reconstruct the second message based on the metadata used to generate the first message.
[0111] If the updated authorization status is allowed, then you need to re-request the services provided by the target business function interface. The second message is used to request the services provided by the target business function interface.
[0112] In some embodiments, after receiving a response message, the authorization agent module extracts and caches the metadata from the response message. Therefore, when the updated authorization status is allowed, the second message is reconstructed based on the metadata. The second message serves the same purpose as the first message described above. Since the second message can be reconstructed, there is no need to store the first message, reducing storage space usage.
[0113] S402, the authorized agent module sends a second message to the service module to obtain the processing result obtained by the service module in response to the second message.
[0114] There are several ways for the service module to respond to the second message. In one scenario, the authorization proxy module sends a second message to the service module; the service module responds with the processing result obtained from the second message, as the second message already contains the authorization status. In this method, since the second message already contains the authorization status, the service module can directly respond based on the authorization status without needing to interact with the authorization service module again.
[0115] In another scenario, if the second message does not carry the updated authorization status, the service module queries the permission service module for the updated authorization status. If the updated authorization status is allowed, the module responds with the processing result obtained from the second message. In this approach, the permission service module is required to update the authorization status of the application stored locally based on the authorization input to obtain the updated authorization status. Only in this way can the service module query the updated authorization status from the permission service module.
[0116] Similarly, the first message can also carry the authorization status. In this case, when the service module receives the first message, the service module does not need to send an application permission authorization request to the permission service module, but can directly respond based on the authorization status carried in the first message.
[0117] S403, the service module sends the processing result to the application.
[0118] If the updated authorization status is allowed, the service module ultimately needs to send the processing result to the application.
[0119] In some embodiments, if the updated authorization status is denied, the authorization proxy module refuses to request services from the service module and sends an indication message for denying services to the application. The indication message may be "No Permission".
[0120] Optionally, if the updated authorization status is denied, upon receiving the updated authorization status, the authorization proxy module can also send a second message to the service module. Upon the service module's response, it sends an indication message for denying service to the application based on the response result. The source of the second message here is the same as that in step S401. Furthermore, the second message may or may not carry the updated authorization status. If the second message carries the updated authorization status, the service module directly sends the indication message for denying service to the application; if the second message does not carry the updated authorization status, the service module queries the authorization service module for the updated authorization status and then sends the indication message for denying service to the application based on this status.
[0121] Optionally, after receiving the first message from the application, the authorization proxy module may also cache the first message. In this case, step S205 includes: if the updated authorization status is allowed, the authorization proxy module requests service from the service module and performs the following operations: the authorization proxy module sends the first message to the service module to obtain the processing result obtained by the service module in response to the first message.
[0122] In this scenario, when the authorization proxy module receives the updated authorization status, it can directly send the first message to the service module instead of reconstructing the second message. The service module then sends the application permission authorization request to the permission service module again based on the first message to obtain the updated authorization status.
[0123] Figure 5 A flowchart illustrating a service request processing method provided in another embodiment of this application. This processing method is applied to an application, see below. Figure 5 The processing methods include:
[0124] S501 sends a first message to the operating system when the application calls the target business function interface.
[0125] The first message is used to request services provided by the target business function interface.
[0126] S502, receive the response result sent by the operating system, the response result includes indication information for denial of service, and the processing result of the first response message.
[0127] The method provided in this embodiment eliminates the need for application developers to develop additional code to request user authorization, as the application only needs to send the first message and receive the final response. This reduces the workload and difficulty of application development and improves application development efficiency and experience.
[0128] Figure 6 This is an interactive signaling diagram illustrating a service request processing method provided in one embodiment of this application. (See diagram for example.) Figure 6 As shown, this implementation includes the following steps:
[0129] S601, the application sends the first message to the authorization agent module.
[0130] S602, the authorized agent module sends the first message to the service module.
[0131] S603, the service module sends an application permission authorization request to the permission service module.
[0132] S604, the authorization service module sends the authorization status to the service module.
[0133] If the authorization status is allowed, proceed to step S605; if the authorization status is denied, proceed to step S606; if the authorization status is inquired, proceed to steps S607-S622.
[0134] S605, the service module responds to the first message to obtain the processing result, and then sends the processing result to the application.
[0135] S606, the service module sends an instruction message to the application for denying service.
[0136] S607, the service module constructs a reply message based on the first message.
[0137] S608, the service module sets a label on the reply message.
[0138] S609, the service module sends a reply message to the authorized agent module.
[0139] S610, the authorization agent module extracts and caches metadata from the reply message.
[0140] S611, the authorization agent module requests authorization from the permission service module by displaying a dialog box.
[0141] S612, the authorization dialog box of the permission service module pops up in the interface service module.
[0142] S613, the dialog box interface service module receives authorized input.
[0143] S614, The dialog box interface service module sends authorization input to the permission service module.
[0144] S615, the authorization service module updates the authorization status and obtains the updated authorization status.
[0145] S616, the permission service module sends the updated authorization status to the authorization agent module.
[0146] S617, Reconstruct the second message based on the metadata used to generate the first message.
[0147] S618, the authorized agent module sends a second message to the service module.
[0148] S619, the service module sends an application permission authorization request to the permission service module.
[0149] S620, the authorization service module sends the updated authorization status to the service module.
[0150] If the updated authorization status is allowed, proceed to step S621; if the updated authorization status is denied, proceed to step S622.
[0151] S621, the service module responds to the first message to obtain the processing result, and then sends the processing result to the application.
[0152] S622, the service module sends an instruction message to the application for denying service.
[0153] In summary, this application has at least the following advantages:
[0154] First, the authorization proxy module requests authorization input on behalf of the application, thus reducing the amount of code that needs to be developed for requesting authorization input in application development;
[0155] Second, the entire process of requesting authorization input is transparent to the application and the application is unaware of it.
[0156] The following are embodiments of the apparatus described in this application, which can be used to execute the embodiments of the method described in this application. For details not disclosed in the apparatus embodiments of this application, please refer to the embodiments of the method described in this application.
[0157] Figure 7 This is a schematic diagram of a service request processing apparatus provided according to an embodiment of this application. This application provides a processing apparatus applied to an operating system, such as… Figure 7 As shown, the processing device 70 includes: a calling module 701, a sending module 702, a response module 703, a request module 704, and a determining module 705.
[0158] in:
[0159] The calling module 701 is used to receive the first message from the application when the application calls the target business function interface. The first message is used to request the service provided by the target business function interface.
[0160] Sending module 702 is used by the authorized agent module to send the first message to the service module;
[0161] The response module 703 is used by the service module to send an application permission authorization request to the permission service module in response to receiving the first message, so as to obtain the authorization status of the application's target information. The authorization request is used to query whether the application has the permission to obtain the target information required to obtain the service.
[0162] The request module 704 is used to instruct the authorization agent module to request authorization from the permission service module by popping up a dialog box if the authorization status of the service request is "questioning", so that the authorization agent module can obtain the updated authorization status based on the authorization input.
[0163] The determination module 705 is used by the authorization agent module to determine whether to request services from the service module based on the updated authorization status.
[0164] Optionally, when the request module 704 instructs the service module to direct the authorization agent module to request authorization from the permission service module via a pop-up dialog box, so that the authorization agent module can obtain the updated authorization status based on the authorization input, it is specifically used for:
[0165] The service module instructs the authorization agent module to request authorization via a pop-up dialog box from the permission service module;
[0166] The permission service module requests an authorization dialog box, which is displayed in the interface service module to send the obtained authorization input to the permission service module.
[0167] The authorization service module sends the updated authorization status to the authorization agent module based on the authorization input.
[0168] Optionally, when the request module 704 is used by the service module to instruct the authorization agent module to request authorization from the permission service module via a pop-up dialog box, it is specifically used for:
[0169] The service module constructs a reply message based on the first message. The reply message carries a set tag, which is used to instruct the authorized agent module to recognize the reply message.
[0170] The service module sends a reply message to the authorization agent module;
[0171] The authorization agent module requests authorization from the permission service module via a pop-up dialog box.
[0172] In some embodiments, the reply message also carries metadata that generated the first message, and the request module 704 is further configured to: extract and cache the metadata in the reply message after the authorization agent module receives the reply message.
[0173] Optionally, when the request module 704 is used to allow the authorization proxy module to determine whether to request services from the service module based on the updated authorization status, it is specifically used for: the permission service module updating the authorization status of the application stored locally based on the authorization input to obtain the updated authorization status; and the permission service module sending the updated authorization status to the authorization proxy module.
[0174] Optionally, module 705 is specifically used to: if the updated authorization status is allowed, the authorization agent module requests services from the service module and performs the following operations:
[0175] Based on the metadata that generated the first message, the second message is reconstructed. The second message is used to request the services provided by the target business function interface.
[0176] The authorization proxy module sends a second message to the service module in order to obtain the processing result from the service module's response to the second message.
[0177] Optionally, the determination module 705, in the process of having the authorization agent module send a second message to the service module to obtain the processing result obtained by the service module in response to the second message, is specifically used for: the authorization agent module sending a second message to the service module;
[0178] If the second message carries the updated authorization status, the service module responds to the processing result obtained from the second message; or, if the second message does not carry the updated authorization status, the service module queries the permission service module to obtain the updated authorization status. If the updated authorization status is allowed, the service module responds to the processing result obtained from the second message.
[0179] The service module sends the processing results to the application.
[0180] Optionally, the response module 703 is also used for: the authorization proxy module caching the first message. In this case, the determination module 705 is used for: if the updated authorization status is allowed, the authorization proxy module requests service from the service module and performs the following operations:
[0181] The authorization proxy module sends the first message to the service module to obtain the processing result from the service module's response to the first message.
[0182] Optionally, the determination module 705 is further configured to: if the updated authorization status is denied, then the authorization agent module refuses to request service from the service module and sends an indication message for denying service to the application.
[0183] Optionally, the response module 703 is further configured to: if the authorization status of the service request is allowed, the service module responds to the first message to obtain the processing result and sends the processing result to the application;
[0184] If the authorization status of the service request is denied, the service module sends an indication message to the application to deny the service.
[0185] Figure 8 This is a schematic diagram of a service request processing apparatus provided according to another embodiment of this application. Embodiments of this application provide a processing apparatus applied to, such as… Figure 8 As shown, the processing device 80 includes a transmitting module 801 and a receiving module 802. Wherein:
[0186] The sending module 801 is used to send a first message to the operating system when the application calls the target business function interface. The first message is used to request the service provided by the target business function interface.
[0187] The receiving module 802 is used to receive the response result sent by the operating system. The response result includes indication information for denial of service, and the processing result of the response to the first message.
[0188] It should be noted that the processing device provided in this application embodiment can be used to execute the corresponding processing method embodiment described above. Its implementation principle and technical effect are similar, and will not be described again here.
[0189] It should be noted that the division of the various modules in the above device is merely a logical functional division. In actual implementation, they can be fully or partially integrated into a single physical entity, or they can be physically separated. Furthermore, these modules can be implemented entirely in software via processing element calls; they can be fully implemented in hardware; or some modules can be implemented by processing element calls to software, while others are implemented in hardware. For example, a processing module can be a separate processing element, or it can be integrated into a chip within the device. Alternatively, it can be stored as program code in the device's memory, and its functions can be called and executed by a processing element. The implementation of other modules is similar. Moreover, these modules can be fully or partially integrated together, or they can be implemented independently. The processing element here can be an integrated circuit with signal processing capabilities. During implementation, each step of the above method or each of the above modules can be completed through integrated logic circuits in the hardware of the processor element or through software instructions.
[0190] For example, these modules can be one or more integrated circuits configured to implement the above methods, such as one or more Application Specific Integrated Circuits (ASICs), one or more Digital Signal Processors (DSPs), or one or more Field Programmable Gate Arrays (FPGAs). As another example, when a module is implemented using processing element scheduler code, the processing element can be a general-purpose processor, such as a Central Processing Unit (CPU) or other processor capable of calling program code. Furthermore, these modules can be integrated together as a System-On-a-Chip (SOC).
[0191] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. A computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the flow or function according to the embodiments of this application is generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)).
[0192] Figure 9 A schematic diagram of the structure of an electronic device provided in another embodiment of this application. (Refer to...) Figure 9 The electronic device 90 includes a memory 901 and a processor 902. The memory 901 is used to store executable instructions; the processor 902 is configured to execute the executable instructions to implement the processing method described above.
[0193] Figure 10 This is a block diagram of a terminal provided in an embodiment of this application. This application provides a terminal for performing the above-described processing method. The terminal may be a mobile phone, tablet device, personal digital assistant, etc.
[0194] Terminal 100 may include one or more of the following components: processing component 1001, memory 1002, power supply component 1003, multimedia component 1004, audio component 1005, input / output interface 1006, sensor component 1007, and communication component 1008. The input / output interface may also be referred to as an "I / O interface".
[0195] Processing component 1001 typically controls the overall operation of terminal 100, such as operations associated with display, telephone calls, data communication, camera operation, and recording. Processing component 1001 may include one or more processors 1009 to execute instructions to complete all or part of the steps of the methods described above. Furthermore, processing component 1001 may include one or more modules to facilitate interaction between processing component 1001 and other components. For example, processing component 1001 may include a multimedia module to facilitate interaction between multimedia component 1004 and processing component 1001.
[0196] Memory 1002 is configured to store various types of data to support operation on terminal 100. Examples of this data include instructions for any application or method operating on terminal 100, contact data, phonebook data, messages, pictures, videos, etc. Memory 1002 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read Only Memory (EEPROM), Electrically Programmable Read Only Memory (EPROM), Programmable Read Only Memory (PROM), Read Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
[0197] The power supply component 1003 provides power to various components of the terminal 100. The power supply component 1003 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the terminal 100.
[0198] Multimedia component 1004 includes a screen that provides an output interface between terminal 100 and the user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a Touch Panel, the screen may be implemented as a touchscreen to receive input signals from the user. The Touch Panel includes one or more touch sensors to sense touches, swipes, and gestures on the Touch Panel. The touch sensors may sense not only the boundaries of touch or swipe actions but also the duration and pressure associated with the touch or swipe operation. In some embodiments, multimedia component 1004 includes a front-facing camera and / or a rear-facing camera. When terminal 100 is in an operating mode, such as a shooting mode or a video mode, the front-facing camera and / or rear-facing camera may receive external multimedia data. Each front-facing camera and rear-facing camera may be a fixed optical lens system or have focal length and optical zoom capabilities.
[0199] Audio component 1005 is configured to output and / or input audio signals. For example, audio component 1005 includes a microphone (MIC) configured to receive external audio signals when terminal 100 is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 1002 or transmitted via communication component 1008. In some embodiments, audio component 1005 also includes a speaker for outputting audio signals.
[0200] I / O interface 1006 provides an interface between processing component 1001 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to, home buttons, volume buttons, power buttons, and lock buttons.
[0201] Sensor assembly 1007 includes one or more sensors for providing state assessments of various aspects of terminal 100. For example, sensor assembly 1007 may detect the on / off state of terminal 100, the relative positioning of components such as the display and keypad of terminal 100, changes in the position of terminal 100 or a component of terminal 100, the presence or absence of user contact with terminal 100, the orientation or acceleration / deceleration of terminal 100, and temperature changes of terminal 100. Sensor assembly 1007 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 1007 may also include an optical sensor, such as a CMOS (Complementary Metal-Oxide Semiconductor) or CCD (Charge Coupled Device) image sensor, for use in imaging applications. In some embodiments, sensor assembly 1007 may also include an accelerometer, gyroscope, magnetometer, pressure sensor, or temperature sensor.
[0202] Communication component 1008 is configured to facilitate wired or wireless communication between terminal 100 and other devices. Terminal 100 can access wireless networks based on communication standards, such as WiFi, 2G, or 3G, or combinations thereof. In one exemplary embodiment, communication component 1008 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 1008 also includes a Near Field Communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID), Infrared Data Association (IrDA), Ultra Wide Band (UWB), Bluetooth, and other technologies.
[0203] This application also provides a service request processing system, which includes an operating system and an application. The operating system executes the operating system execution steps in the above method, and the application executes the application execution steps in the above method.
[0204] This application also provides a computer-readable storage medium storing computer-executable instructions, which are executed by a processor to implement the above-described processing method.
[0205] The aforementioned computer-readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The computer-readable storage medium can be any available medium accessible to a general-purpose or special-purpose computer.
[0206] An exemplary readable storage medium is coupled to a processor, enabling the processor to read information from and write information to the readable storage medium. Alternatively, the readable storage medium can be an integral part of the processor. The processor and the readable storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and the readable storage medium can exist as discrete components in a hole detection device.
[0207] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described processing method.
[0208] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.
[0209] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this disclosure, and are not intended to limit them. Although this disclosure has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this disclosure.
Claims
1. A method for processing service requests, characterized in that, Applied to an operating system, the operating system includes an authorization agent module, a service module, a permission service module, and a dialog box interface service module, and the processing method includes: When an application calls a target business function interface, the authorization proxy module receives a first message from the application, which is used to request the service provided by the target business function interface. The authorization agent module sends the first message to the service module; In response to receiving the first message, the service module sends an application permission authorization request to the permission service module to obtain the authorization status of the application for target information. The authorization request is used to query whether the application has the permission to obtain the target information required by the service. If the authorization status of the service request is "question", the service module instructs the authorization proxy module to request authorization from the permission service module through a pop-up dialog box, so that the authorization proxy module can obtain the updated authorization status based on the authorization input; The authorization proxy module determines whether to request the service from the service module based on the updated authorization status. The service module instructs the authorization proxy module to request authorization via a pop-up dialog box from the permission service module, so that the authorization proxy module obtains the updated authorization status based on the authorization input, including: The service module constructs a reply message based on the first message. The reply message carries a set tag, which is used to instruct the authorization agent module to recognize the reply message. The service module sends the reply message to the authorized agent module; The authorization proxy module requests authorization via a pop-up dialog box from the permission service module; The permission service module requests a dialog box, and the interface service module pops up an authorization dialog box to send the obtained authorization input to the permission service module. The permission service module sends the updated authorization status to the authorization agent module based on the authorization input.
2. The processing method according to claim 1, characterized in that, The reply message also carries metadata that generated the first message, and the processing method further includes: After receiving the reply message, the authorization agent module extracts and caches the metadata in the reply message.
3. The processing method according to claim 1, characterized in that, The permission service module sends the updated authorization status to the authorization proxy module based on the authorization input, including: The permission service module updates the authorization status of the application stored locally based on the authorization input, and obtains the updated authorization status; The permission service module sends the updated authorization status to the authorization agent module.
4. The processing method according to any one of claims 1 to 3, characterized in that, The authorization proxy module determines whether to request the service from the service module based on the updated authorization status, including: If the updated authorization status is allowed, the authorization proxy module requests the service from the service module and performs the following operations: Based on the metadata that generated the first message, a second message is reconstructed, the second message being used to request the services provided by the target business function interface; The authorization proxy module sends the second message to the service module to obtain the processing result obtained by the service module in response to the second message.
5. The processing method according to claim 4, characterized in that, The authorization proxy module sends the second message to the service module to obtain the processing result obtained by the service module in response to the second message, including: The authorization agent module sends the second message to the service module; If the updated authorization status is carried in the second message, the service module responds to the processing result obtained from the second message; or, if the updated authorization status is not carried in the second message, the service module queries the permission service module to obtain the updated authorization status, and if the updated authorization status is allowed, it responds to the processing result obtained from the second message. The service module sends the processing result to the application.
6. The processing method according to any one of claims 1 to 3, characterized in that, After receiving the first message from the application, the authorization proxy module further includes: The authorization proxy module caches the first message; The authorization proxy module determines whether to request the service from the service module based on the updated authorization status, including: If the updated authorization status is allowed, the authorization proxy module requests the service from the service module and performs the following operations: The authorization proxy module sends the first message to the service module to obtain the processing result obtained by the service module in response to the first message.
7. The processing method according to any one of claims 1 to 3, characterized in that, The authorization proxy module determines whether to request the service from the service module based on the updated authorization status, including: If the updated authorization status is denied, the authorization proxy module refuses to request the service from the service module and sends an indication message for denying the service to the application.
8. The processing method according to any one of claims 1 to 3, characterized in that, Also includes: If the authorization status of the service request is allowed, the service module responds to the first message to obtain the processing result and sends the processing result to the application; If the authorization status of the service request is denied, the service module sends an indication message to the application to deny the service.
9. A method for processing service requests, characterized in that, Applied to the application, the processing method includes: When the application calls the target business function interface, it sends a first message to the operating system. The first message is used to request the service provided by the target business function interface. The system receives a response from the operating system, the response including indication information for denying service, and a processing result obtained in response to the first message; wherein the operating system includes an authorization proxy module, a service module, a permission service module, and a dialog box interface service module; when the authorization status of the service request is in the query state, the service module constructs a reply message based on the first message, the reply message carrying a set tag, the set tag being used to instruct the authorization proxy module to recognize the reply message; the service module sends the reply message to the authorization proxy module; the authorization proxy module requests the permission service module to display a dialog box for authorization; the permission service module requests the dialog box interface service module to display an authorization dialog box to send the obtained authorization input to the permission service module; the permission service module sends the updated authorization status to the authorization proxy module based on the authorization input.
10. A service request processing apparatus, characterized in that, Applied to an operating system, the operating system includes an authorization agent module, a service module, a permission service module, and a dialog box interface service module, and the processing device includes: The calling module is used to receive a first message from the application when the application calls the target business function interface. The first message is used to request the service provided by the target business function interface. The sending module is used for the authorization proxy module to send the first message to the service module; The response module is used by the service module to send an application permission authorization request to the permission service module in response to receiving the first message, so as to obtain the authorization status of the application for target information. The authorization request is used to query whether the application has the permission to obtain the target information required by the service. The request module is configured to, if the authorization status of the service request is "question", instruct the authorization proxy module to request authorization from the permission service module via a pop-up dialog box, so that the authorization proxy module can obtain the updated authorization status based on the authorization input; A determination module is used by the authorization proxy module to determine whether to request the service from the service module based on the updated authorization status; The request module is specifically configured to: have the service module construct a reply message based on the first message, the reply message carrying a set tag, the set tag being used to instruct the authorization proxy module to recognize the reply message; have the service module send the reply message to the authorization proxy module; have the authorization proxy module request the permission service module to display an authorization dialog box; have the permission service module request the dialog box interface service module to display an authorization dialog box to send the obtained authorization input to the permission service module; and have the permission service module, based on the authorization input, send the obtained updated authorization status to the authorization proxy module.
11. A service request processing apparatus, characterized in that, The processing device, applied to an application, includes: The sending module is used to send a first message to the operating system when the application calls the target business function interface, the first message being used to request the service provided by the target business function interface; A receiving module is configured to receive a response result sent by the operating system. The response result includes an indication for denying service and a processing result obtained in response to the first message. The operating system includes an authorization proxy module, a service module, a permission service module, and a dialog box interface service module. When the authorization status of the service request is "inquiry," the service module constructs a reply message based on the first message. The reply message carries a set tag, which instructs the authorization proxy module to identify the reply message. The service module sends the reply message to the authorization proxy module. The authorization proxy module requests the permission service module to display a dialog box for authorization. The permission service module requests the dialog box interface service module to display an authorization dialog box to send the obtained authorization input to the permission service module. The permission service module sends the updated authorization status to the authorization proxy module based on the authorization input.
12. An electronic device, characterized in that, include: Memory, processor; The memory is used to store executable instructions; The processor is configured to execute the executable instructions to implement the processing method as described in any one of claims 1 to 8, or to implement the processing method as described in claim 9.
13. A service request processing system, characterized in that, include: An operating system for executing the processing method as described in any one of claims 1 to 8; An application for performing the processing method as described in claim 9.
14. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the processing method as described in any one of claims 1 to 8, or to implement the processing method as described in claim 9.