WO2022135015A1 - 服务信息获取方法、装置、计算机设备和存储介质 - Google Patents

服务信息获取方法、装置、计算机设备和存储介质 Download PDF

Info

Publication number
WO2022135015A1
WO2022135015A1 PCT/CN2021/133071 CN2021133071W WO2022135015A1 WO 2022135015 A1 WO2022135015 A1 WO 2022135015A1 CN 2021133071 W CN2021133071 W CN 2021133071W WO 2022135015 A1 WO2022135015 A1 WO 2022135015A1
Authority
WO
WIPO (PCT)
Prior art keywords
service information
requested
application
permission
permission value
Prior art date
Application number
PCT/CN2021/133071
Other languages
English (en)
French (fr)
Inventor
杨羚
Original Assignee
深圳市万普拉斯科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳市万普拉斯科技有限公司 filed Critical 深圳市万普拉斯科技有限公司
Publication of WO2022135015A1 publication Critical patent/WO2022135015A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/953Querying, e.g. by the use of web search engines

Definitions

  • the present application relates to the field of terminal technology, and in particular, to a service information acquisition method, apparatus, computer equipment and storage medium.
  • an application including a third-party application
  • IPC Inter-Process Communication
  • the server will start the thread pool and dispatch the threads of the thread pool to complete the client's request, while the number of thread pool threads of the System Server (system service) is only 16, and the thread pool of the Telephony module (telephone module) server side Also only 16. If there are many applications consulted by the system server, or an application calls the server process multiple times in a short period of time due to an exception, the thread pool of the System Server will be exhausted, which will bring greater pressure to the system. .
  • the present application provides a service information acquisition method, apparatus, computer equipment and storage medium.
  • a first aspect of the present application relates to a method for acquiring service information, the method comprising:
  • the preset container According to the first acquisition request, query whether the preset container stores a permission value corresponding to the application for acquiring the service information to be requested; the preset container corresponds to the service information to be requested. component association;
  • the to-be-requested service information is queried, the to-be-requested service information is returned to the application.
  • a second aspect of the present application relates to an apparatus for acquiring service information, the apparatus comprising:
  • a request receiving module configured to receive a first acquisition request sent by an application for the service information to be requested
  • a permission value query module configured to query whether a permission value corresponding to the application program for obtaining the service information to be requested is stored in the preset container according to the first acquisition request; the preset container is connected to the The components corresponding to the service information to be requested are associated;
  • an information query module configured to query whether the to-be-requested service information is stored in the preset container if the permission value is queried;
  • An information return module configured to return the to-be-requested service information to the application if the to-be-requested service information is queried.
  • a third aspect of the present application relates to a computer device, comprising a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:
  • the preset container According to the first acquisition request, query whether the preset container stores a permission value corresponding to the application for acquiring the service information to be requested; the preset container corresponds to the service information to be requested. component association;
  • the to-be-requested service information is queried, the to-be-requested service information is returned to the application.
  • a fourth aspect of the present application relates to a computer-readable storage medium having a computer program stored thereon, the computer program implementing the following steps when executed by a processor:
  • the preset container According to the first acquisition request, query whether the preset container stores a permission value corresponding to the application for acquiring the service information to be requested; the preset container corresponds to the service information to be requested. component association;
  • the to-be-requested service information is queried, the to-be-requested service information is returned to the application.
  • 1 is an application scenario diagram of a method for acquiring service information in one embodiment
  • FIG. 2 is a schematic flowchart of a method for acquiring service information in one embodiment
  • FIG. 3 is a schematic flowchart of a step of acquiring service information in one embodiment
  • FIG. 4 is a schematic flowchart of a method for acquiring service information in an application embodiment
  • FIG. 5 is a structural block diagram of an apparatus for obtaining service information in one embodiment
  • FIG. 6 is a diagram of the internal structure of a computer device in one embodiment.
  • FIG. 1 is the architecture diagram of the Andriod operating system, including four parts: application, application framework layer, core class library and linux kernel.
  • An application program interface in you can obtain the corresponding object according to the incoming object name, and then convert it into the corresponding service object) method to obtain various system services.
  • the application obtains a component in the application framework layer through the getSystemService method, such as the phone manager, the component receives the first obtaining request sent by the application for the service information to be requested, and according to the first obtaining Request to query whether the preset container corresponding to the component stores the permission value corresponding to the application to obtain the service information to be requested. If the permission value is queried, query whether the service information to be requested is stored in the preset container. If service information is requested, the service information to be requested is returned to the application.
  • a method for acquiring service information comprising the following steps:
  • Step S202 Receive a first obtaining request for the service information to be requested sent by the application.
  • the service information to be requested represents the service information that the application program needs to acquire, for example, telephone service and status information, location information, International Mobile Equipment Identity (International Mobile Equipment Identity), and the like.
  • the first acquisition request represents a request sent by the application to the component corresponding to the service information to be requested.
  • the service information to be requested is location information.
  • the application may send a first acquisition request to the location manager of the application framework layer in FIG. 1 , where the first acquisition request is an acquisition request for location information.
  • a first acquisition request can be sent to the telephony manager of the application framework layer in FIG. 1, then the service information to be requested is telephony service or status information, and the first acquisition request is Is a get request for telephony service or status information.
  • Step S204 according to the first acquisition request, query whether the preset container stores a permission value corresponding to the application for acquiring the service information to be requested; the preset container is associated with the component corresponding to the service information to be requested.
  • step S204 specifically includes: according to the application identifier carried in the first acquisition request, querying whether the preset container stores an application identifier corresponding to the application for acquiring The permission value of the service information to be requested.
  • the first acquisition request is a request generated by an application for telephony service information
  • the component corresponding to the telephony service information is the telephony manager of the application framework layer shown in FIG.
  • the application identifier is used to query whether the preset container corresponding to the phone manager stores a permission value corresponding to the application program for obtaining phone service information.
  • different service information to be requested corresponds to different components, and each component has a corresponding container for storing the permission value of each application to obtain the service information corresponding to the component.
  • the preset container may be a HashMap container.
  • the step of querying whether the preset container stores the permission value corresponding to the application for obtaining the service information to be requested can be performed without cross-process.
  • the step of receiving the first obtaining request for the service information to be requested sent by the application and the step of querying whether the preset container stores the permission value corresponding to the application for obtaining the service information to be requested may be in the same process implement.
  • Step S206 if the permission value is found in the query, it is queried whether the service information to be requested is stored in the preset container.
  • step S206 specifically includes: if the authority value is queried, obtaining the authority identifier corresponding to the authority value; if the authority identifier is a preset authority identifier, querying whether the service information to be requested is stored in the preset container , the preset authority identifier is used to identify the authority to obtain the service information to be requested.
  • different permission values have corresponding permission identifiers, and the permission identifiers can be divided into those with permission and without permission.
  • the permission value of the application After the permission value of the application is queried in the preset container, it is also necessary to determine whether the application has the permission to obtain the service information to be requested according to the permission identifier corresponding to the permission value.
  • the permission identifier corresponding to the queried permission value is permission, it is further queried whether the service information to be requested is stored in the preset container.
  • the container corresponding to the telephone manager stores the permission value for obtaining the telephone service information corresponding to the application that sent the first request, it indicates that the application
  • the program has sent a first get request for telephony service information to the telephony manager.
  • the authority identifier of the authority value also needs to be determined. If the authority identifier corresponding to the authority value is authorized, it is further inquired whether the preset container stores telephone service information. If the permission identifier corresponding to the permission value is no permission, indicating that the application cannot obtain the telephone service information, the step of querying whether the service information to be requested is stored in the preset container is not performed.
  • Step S208 if the service information to be requested is queried, the service information to be requested is returned to the application.
  • the telephony service information to be acquired by the application is queried in the preset container corresponding to the telephony manager, it can be directly obtained from the preset container corresponding to the telephony manager.
  • the container obtains the telephony service information and returns the telephony service information to the application.
  • the operation of obtaining the service information to be requested from the preset container can be performed without cross-process. In other words, the operations of steps S202, S204, S206 and S208 may be performed in the same process.
  • the preset container stores the service to be requested corresponding to the application.
  • the permission value of the information If the permission value is queried, it is queried whether the service information to be requested is stored in the preset container. If the service information to be requested is queried, the service information to be requested is directly returned to the application.
  • This method can reduce the number of cross-processes and code execution by temporarily storing the permission value and the return value of the service information to be requested when the application performs cross-process operations on the server, without the need to query the service information to be requested every time. It needs at least two IPC requests to achieve this, thereby improving the operating efficiency of the application on the system and improving the user experience. When the system is busy, it can also prevent the thread pool from running out of threads, causing device ANR or device restart.
  • step S204 it further includes:
  • Step S302 if the permission value is not queried, send a second acquisition request to the activity management component, and trigger the activity management component to query across processes whether the application has the permission to acquire the service information to be requested;
  • Step S304 Receive the query result returned by the activity management component, and store the query result in a preset container.
  • step S304 specifically includes: if the query result is that the application program has the permission to obtain the service information to be requested, generating a first permission value; if the query result is that the application program does not have the permission to obtain the service information to be requested, generating a second permission value. Permission value; after the first permission value or the second permission value is associated with the application, it is stored in the preset container.
  • the activity management component is an important part of the Android framework, responsible for the creation of a new ActivityThread (activity process), and the maintenance of the Activity (activity) life cycle, that is, the activity manager in the application framework layer in Figure 1.
  • the second acquisition request represents an IPC (Inter-Process Communication, inter-process communication) request sent by the component corresponding to the service information to be requested acquired by the application to the activity management component.
  • IPC Inter-Process Communication, inter-process communication
  • the permission value of the application program is not queried in the container corresponding to the phone manager, it means that the application program has not sent the first acquisition request for the phone service information to
  • the phone manager needs to send a second acquisition request to the activity management component, and the activity management component queries across processes whether the application has the right to acquire phone service information, and receives the query result returned by the activity management component. If the query result is that the application has the right to obtain the phone service information, a first permission value is generated, the first permission value is associated with the application identifier of the application, and stored in a container corresponding to the phone manager. If the query result is that the application program does not have the right to obtain the phone service information, a second permission value is generated, the second permission value is associated with the application identifier of the application program, and stored in the container corresponding to the phone manager.
  • the activity management component when the permission value of the application is not queried, the activity management component is used to query across processes whether the application has the permission to obtain the service information to be requested, and the query result is associated with the application and stored in the preset container , so that when the application obtains the service information to be requested again in the future, it can directly query whether the application has the permission to obtain the service information to be requested from the preset container. It reduces the occupancy of the process and reduces the time for obtaining query results.
  • the method further includes: if the service information to be requested is not queried in the preset container, sending a data acquisition request to the telephony component, and triggering the telephony component to obtain the service information to be requested; receiving the telephony component
  • the returned service information to be requested is stored in a preset container after associating the service information to be requested with the application.
  • the activity management component will send a data acquisition request to the telephony component across the process, so that the telephony component can obtain the telephony service information from the lower frame.
  • the telephony component returns the acquired telephony service information to the telephony manager, and the telephony manager returns the telephony service information to the application program.
  • the telephony manager will also store the telephony service information returned by the telephony component in the container corresponding to the telephony manager after associating it with the application identifier of the application.
  • the container for storing the service information to be requested is associated with the component corresponding to the service information to be requested.
  • the preset container for storing the permission value and the container for storing the service information to be requested may be the same container or different containers.
  • the container for storing the service information to be requested may be another HashMap container.
  • the to-be-requested service information to be acquired by the application program is not queried, the to-be-requested service information is acquired through the telephony component, and the received to-be-requested service information is associated with the application program and stored in a preset container,
  • the subsequent application program it can directly obtain the to-be-requested service information from the preset container, and it is no longer necessary to return the to-be-requested service information through the phone component, reducing the application program's acquisition of the to-be-requested service information. time, greatly improving the efficiency of the application to obtain the service information to be requested.
  • the method further includes: clearing the permission value of the application and the service information to be requested stored in the preset container when receiving a message that the permission state of the application program changes to the service information to be requested.
  • the permission of an application to obtain a certain service information to be requested may be modified.
  • AppOpsManager a component for dynamic detection of application permissions
  • detects that the permission of an application for a certain service information to be requested A notification message will be sent to the component corresponding to the to-be-requested service information, so that the component clears the permission value associated with the application and the to-be-requested service information stored in the corresponding container.
  • AppOpsManager will send a notification message to the phone manager, so that the phone manager will store the application's permission value and phone service information in its corresponding container. are cleared.
  • the permission value of the application program and the service information to be requested stored in the preset container are cleared, so as to realize synchronous update with the permission status of the application program and consistency.
  • FIG. 4 is a schematic flowchart of a method for acquiring service information in an application example.
  • the specific process of the method is as follows:
  • step (1) the Application (application program) sends a first acquisition request for the Device ID (device identification code, as an example of the service information to be requested) to the TelephonyManager (telephony manager).
  • Device ID device identification code, as an example of the service information to be requested
  • Step (2) TelephonyManager (telephony manager) checks whether there is a permission value for the application to obtain Device ID temporarily stored in the preset container, if yes, go to step (3), if not, go to step (2.1).
  • TelephonyManager sends a second acquisition request to ActivityManager (activity management component), triggering ActivityManager to query across processes whether the application has access to the Device ID, and store the query results in the above-mentioned preset container, and check the results It can include permission values that indicate permission and permission values that indicate no permission.
  • Step (3) TelephonyManager checks whether there is a stored Device ID in the preset container, if so, go to step (4), if not, go to step (3.1).
  • Step (3.1) send a data acquisition request to the Phone module (telephone module, as the phone component in the above-mentioned embodiment), obtain the Device ID by the Phone module, and then enter step (3.2).
  • the Phone module telephone module, as the phone component in the above-mentioned embodiment
  • step (3.2) the Phone module returns the acquired Device ID to the PhoneInterfaceManager, and returns it to the TelephonyManager (telephone manager) through the PhoneInterfaceManager, and the TelephonyManager stores the returned Device ID in the preset container, and then enters step (4).
  • Step (4) obtain the Device ID from the preset container, and return the Device ID to the application.
  • Step (5) if the permission value of the device ID obtained by the application program changes (for example, the user manually clears the permission value of the application), the AppOpsManager will send a notification message to the TelephonyManager.
  • step (6) the permission value and Device ID of the application stored in the preset container are cleared by the TelephonyManager.
  • the TelephonyManager In the method for obtaining service information provided by this embodiment, in an Android device, when an application performs a cross-process operation on the server, it can temporarily store the permission value and the return value of the service information to be requested to reduce the number of cross-processes and reduce The code is executed, thereby improving the operating efficiency of the application program on the system, improving the user experience, and preventing the thread pool from running out of threads when the system is busy, resulting in device ANR or device restart.
  • a service information acquisition device including: a request receiving module 502, an authority value query module 504, an information query module 506 and an information return module 508, wherein:
  • a request receiving module 502 configured to receive a first acquisition request sent by an application for the service information to be requested
  • the permission value query module 504 is configured to query whether a permission value corresponding to the application program for obtaining the service information to be requested is stored in the preset container according to the first acquisition request; the preset container is related to the component corresponding to the service information to be requested. link;
  • the information query module 506 is configured to query whether the information to be requested is stored in the preset container if the permission value is queried;
  • the information return module 508 is configured to return the to-be-requested service information to the application if the to-be-requested service information is queried.
  • the first acquisition request carries an application identifier of the application; the above-mentioned permission value query module 504 is specifically configured to, according to the application identifier carried in the first acquisition request, query whether the preset container stores a corresponding application program The permission value used to obtain the service information to be requested.
  • the above-mentioned information query module 506 is specifically configured to obtain a permission identifier corresponding to the permission value if the permission value is queried; if the permission identifier is a preset permission identifier, query whether the service to be requested is stored in the preset container information, and the preset authority identifier is used to identify the authority to obtain the service information to be requested.
  • the above-mentioned permission value query module 504 is further configured to send a second acquisition request to the activity management component if the permission value is not queried, and trigger the activity management component to query across processes whether the application has the service information to be requested. Permission; receive the query result returned by the activity management component, and store the query result in the preset container.
  • the above permission value query module 504 is further configured to generate a first permission value if the query result is that the application program has the permission to obtain the service information to be requested; if the query result is that the application program does not have the permission to obtain the service to be requested information permission, the second permission value is generated; after the first permission value or the second permission value is associated with the application, it is stored in the preset container.
  • the above-mentioned information query module 506 is further configured to send a data acquisition request to the telephony component if the service information to be requested is not queried, and trigger the telephony component to obtain the service information to be requested; receive the service to be requested returned by the telephony component information, after associating the service information to be requested with the application, and storing it in the preset container.
  • the above-mentioned apparatus further includes:
  • the clearing module is used for clearing the permission value of the application program and the service information to be requested stored in the preset container when receiving a message that the permission state of the application program for the service information to be requested has changed.
  • the service information acquisition device of the present application corresponds to the service information acquisition method of the present application, and the technical features and beneficial effects described in the embodiments of the service information acquisition method are applicable to the implementation of the service information acquisition device In an example, for the specific content, reference may be made to the description in the method embodiment of the present application, which will not be repeated here, but is hereby declared.
  • each module in the above-mentioned apparatus for obtaining service information may be implemented in whole or in part by software, hardware, or a combination thereof.
  • the above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
  • a computer device is provided, and the computer device may be a terminal, and its internal structure diagram may be as shown in FIG. 6 .
  • the computer equipment includes a processor, memory, a communication interface, a display screen, and an input device connected by a system bus.
  • the processor of the computer device is used to provide computing and control capabilities.
  • the memory of the computer device includes a non-volatile storage medium, an internal memory.
  • the nonvolatile storage medium stores an operating system and a computer program.
  • the internal memory provides an environment for the execution of the operating system and computer programs in the non-volatile storage medium.
  • the communication interface of the computer device is used for wired or wireless communication with an external terminal, and the wireless communication can be realized by WIFI, operator network, NFC (Near Field Communication) or other technologies.
  • the computer program implements a service information acquisition method when executed by the processor.
  • the display screen of the computer equipment may be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment may be a touch layer covered on the display screen, or a button, a trackball or a touchpad set on the shell of the computer equipment , or an external keyboard, trackpad, or mouse.
  • FIG. 6 is only a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer equipment to which the solution of the present application is applied. Include more or fewer components than shown in the figures, or combine certain components, or have a different arrangement of components.
  • a computer device including a memory and a processor, the memory stores a computer program, and the processor implements the above-mentioned method for obtaining service information when the computer program is executed. In one embodiment, the following steps are included:
  • the preset container According to the first acquisition request, query whether the preset container stores a permission value corresponding to the application for acquiring the service information to be requested; the preset container is associated with the component corresponding to the service information to be requested;
  • the to-be-requested service information is queried, the to-be-requested service information is returned to the application.
  • a computer-readable storage medium on which a computer program is stored.
  • the above-mentioned method for obtaining service information is implemented. In one embodiment, the following steps are included:
  • the preset container According to the first acquisition request, query whether the preset container stores a permission value corresponding to the application for acquiring the service information to be requested; the preset container is associated with the component corresponding to the service information to be requested;
  • the to-be-requested service information is queried, the to-be-requested service information is returned to the application.
  • the steps implemented in the above-mentioned computer-readable storage medium embodiments correspond to the steps of the aforementioned service information acquisition method, and the technical features and beneficial effects described in the above-mentioned embodiments of the user equipment capability information processing method are applicable to the computer-readable storage medium.
  • the specific limitation may refer to the limitation on the service information acquisition method above, which will not be repeated here.
  • Non-volatile memory may include read-only memory (Read-Only Memory, ROM), magnetic tape, floppy disk, flash memory, or optical memory, and the like.
  • Volatile memory may include random access memory (RAM) or external cache memory.
  • the RAM may be in various forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM).

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Stored Programmes (AREA)

Abstract

一种服务信息获取方法、装置、计算机设备和存储介质。所述方法包括:接收应用程序发送的针对待请求服务信息的第一获取请求(S202);根据所述第一获取请求,查询预设容器中是否存储有与所述应用程序对应的获取所述待请求服务信息的权限值;所述预设容器与所述待请求服务信息对应的组件相关联(S204);若查询到所述权限值,则查询所述预设容器中是否存储有所述待请求服务信息(S206);若查询到所述待请求服务信息,则将所述待请求服务信息返回给所述应用程序(S208)。

Description

服务信息获取方法、装置、计算机设备和存储介质
相关申请的交叉引用
本申请要求于2020年12月22日提交中国专利局、申请号为2020115304965、发明名称为“服务信息获取方法、装置、计算机设备和存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及终端技术领域,特别是涉及一种服务信息获取方法、装置、计算机设备和存储介质。
背景技术
目前在Android(安卓)系统中,当应用程序(包含三方应用)需要查询系统服务端相关资讯时,需要做至少两次IPC(Inter-Process Communication,进程间通信)请求。当做IPC请求时,服务端会启动线程池,分派线程池的线程完成客户端的请求,而System Server(系统服务)的线程池线程数量只有16个,Telephony模组(电话模组)服务端线程池也只有16个。若查询系统服务端咨询的应用较多,或某个应用由于异常,出现短时间多次呼叫服务端进程的问题,都将会造成System Server的线程池用尽,给系统带来较大的压力。
发明内容
本申请提供一种服务信息获取方法、装置、计算机设备和存储介质。
本申请的第一方面涉及一种服务信息获取方法,所述方法包括:
接收应用程序发送的针对待请求服务信息的第一获取请求;
根据所述第一获取请求,查询预设容器中是否存储有与所述应用程序对应的用于获取所述待请求服务信息的权限值;所述预设容器与所述待请求服务信息对应的组件相关联;
若查询到所述权限值,则查询所述预设容器中是否存储有所述待请求服务信息;
若查询到所述待请求服务信息,则将所述待请求服务信息返回给所述应用程序。
本申请的第二方面涉及一种服务信息获取装置,所述装置包括:
请求接收模块,用于接收应用程序发送的针对待请求服务信息的第一获取请求;
权限值查询模块,用于根据所述第一获取请求,查询预设容器中是否存储有与所述应用程序对应的用于获取所述待请求服务信息的权限值;所述预设容器与所述待请求服务信息对应的组件相关联;
信息查询模块,用于若查询到所述权限值,则查询所述预设容器中是否存储有所述待请求服务信息;
信息返回模块,用于若查询到所述待请求服务信息,则将所述待请求服务信息返回给所述应用程序。
本申请的第三方面涉及一种计算机设备,包括存储器和处理器,所述存储器存储有计算机程序,所述处理器执行所述计算机程序时实现以下步骤:
接收应用程序发送的针对待请求服务信息的第一获取请求;
根据所述第一获取请求,查询预设容器中是否存储有与所述应用程序对应的用于获取所述待请求服务信息的权限值;所述预设容器与所述待请求服务信息对应的组件相关联;
若查询到所述权限值,则查询所述预设容器中是否存储有所述待请求服务信息;
若查询到所述待请求服务信息,则将所述待请求服务信息返回给所述应用程序。
本申请的第四方面涉及一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现以下步骤:
接收应用程序发送的针对待请求服务信息的第一获取请求;
根据所述第一获取请求,查询预设容器中是否存储有与所述应用程序对应的用于获取所述待请求服务信息的权限值;所述预设容器与所述待请求服务信息对应的组件相关联;
若查询到所述权限值,则查询所述预设容器中是否存储有所述待请求服务信息;
若查询到所述待请求服务信息,则将所述待请求服务信息返回给所述应用程序。
附图说明
为了更清楚地说明本申请实施例的技术方案,下面将对实施例中所需要使用的附图作 简单地介绍,应当理解,以下附图仅示出了本申请的某些实施例,因此不应被看作是对范围的限定,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他相关的附图。
图1为一个实施例中服务信息获取方法的应用场景图;
图2为一个实施例中服务信息获取方法的流程示意图;
图3为一个实施例中服务信息获取步骤的流程示意图;
图4为一个应用实施例中服务信息获取方法的流程示意图;
图5为一个实施例中服务信息获取装置的结构框图;
图6为一个实施例中计算机设备的内部结构图。
具体实施方式
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。
当呼叫服务端进程被多次呼叫时,将影响整个Android装置的系统,严重时会发生服务端ANR(Application Not Responding,进程间通讯应用程序无响应),更严重会造成装置重启。因此,目前的应用程序查询系统服务端信息的方法存在容易造成系统负担。
本申请提供的服务信息获取方法,可以应用于如图1所示的应用环境中。图1为Andriod操作系统的架构图,包括应用程序、应用程序框架层、核心类库和linux内核四部分,在Andriod系统中,当应用程序查询系统服务端相关咨询时,可以通过getSystemService(安卓系统中的一个应用程序接口,可以根据传入的对象名称来取得对应的对象,然后转换成相应的服务对象)方法来获取各种系统服务。在本申请的应用场景中,应用程序通过getSystemService方法获取应用程序框架层中的一个组件,如电话管理器,该组件接收应用程序发送的针对待请求服务信息的第一获取请求,根据第一获取请求查询该组件对应的预设容器中是否存储有与应用程序对应的获取待请求服务信息的权限值,若查询到权限值,则查询预设容器中是否存储有待请求服务信息,若查询到待请求服务信息,则将待请求服务信息返回给应用程序。
在一个实施例中,如图2所示,提供了一种服务信息获取方法,包括以下步骤:
步骤S202,接收应用程序发送的针对待请求服务信息的第一获取请求。
其中,待请求服务信息表示应用程序需要获取的服务信息,例如,电话服务和状态信息、位置信息、国际移动装置识别码(International Mobile Equipment Identity)等。
其中,第一获取请求表示应用程序发送给与待请求服务信息对应的组件的请求。
例如,若应用程序需要获取终端当前位置信息,则待请求服务信息为位置信息。应用程序可以发送第一获取请求至图1中应用程序框架层的位置管理器,第一获取请求为针对位置信息的获取请求。又例如,若应用程序需要获取电话服务或状态信息,可以发送第一获取请求至图1中应用程序框架层的电话管理器,则待请求服务信息为电话服务或状态信息,第一获取请求则为针对电话服务或状态信息的获取请求。
步骤S204,根据第一获取请求,查询预设容器中是否存储有与应用程序对应的用于获取待请求服务信息的权限值;预设容器与待请求服务信息对应的组件相关联。
在一个实施例中,第一获取请求携带有应用程序的应用标识,则步骤S204具体包括:根据第一获取请求携带的应用标识,查询预设容器中是否存储有与应用程序对应的用于获取待请求服务信息的权限值。
例如,若第一获取请求为应用程序针对电话服务信息生成的请求,电话服务信息对应的组件为图1所示应用程序框架层的电话管理器,则由电话管理器根据第一获取请求携带的应用标识,查询电话管理器对应的预设容器中是否存储有与应用程序对应的获取电话服务信息的权限值。其中,不同的待请求服务信息对应不同的组件,每一种组件分别具有对应的容器,用于存储各个应用程序获取该组件对应的服务信息的权限值。示例性地,预设容器可以是HashMap容器。
应当理解,不需要跨进程即可执行查询预设容器中是否存储有与应用程序对应的用于获取待请求服务信息的权限值的步骤。换言之,接收应用程序发送的针对待请求服务信息的第一获取请求的步骤与查询预设容器中是否存储有与应用程序对应的用于获取待请求服务信息的权限值的步骤可以在同一进程中执行。
步骤S206,若查询到权限值,则查询预设容器中是否存储有待请求服务信息。
进一步地,在一个实施例中,步骤S206具体包括:若查询到权限值,则获取权限值 对应的权限标识;若权限标识为预设权限标识,则查询预设容器中是否存储有待请求服务信息,预设权限标识用于标识获取待请求服务信息的权限。
具体实现中,不同的权限值具有对应的权限标识,权限标识可分为有权限和无权限。在预设容器中查询到应用程序的权限值后,还需要根据该权限值对应的权限标识,确定应用程序是否具有获取待请求服务信息的权限。当查询到的权限值对应的权限标识为有权限时,进一步查询预设容器中是否存储有待请求服务信息。
例如,以电话服务信息为待请求服务信息为例,当查询到电话管理器对应的容器中存储有与发送第一请求的应用程序对应的用于获取电话服务信息的权限值时,表明该应用程序曾发送过针对电话服务信息的第一获取请求至电话管理器。在该实施例中,还需确定该权限值的权限标识,若该权限值对应的权限标识为有权限,则进一步查询预设容器中是否存储有电话服务信息。若该权限值对应的权限标识为无权限,表明该应用程序不能获取电话服务信息,则不执行查询预设容器中是否存储有待请求服务信息的步骤。
步骤S208,若查询到待请求服务信息,则将待请求服务信息返回给应用程序。
例如,还以电话服务信息为待请求服务信息为例,若在电话管理器对应的预设容器中查询到应用程序所要获取的电话服务信息时,则可直接从与电话管理器对应的预设容器获取该电话服务信息,并将该电话服务信息返回给应用程序。应当理解,不需要跨进程即可执行从预设容器获取待请求服务信息的操作。换言之,步骤S202、S204、S206和S208的操作可以在同一进程中执行。
上述服务信息获取方法中,在接收到应用程序发送的针对待请求服务信息的第一获取请求时,根据第一获取请求,直接查询预设容器中是否存储有与应用程序对应的获取待请求服务信息的权限值,若查询到权限值,则查询预设容器中是否存储有待请求服务信息,若查询到待请求服务信息,则直接将待请求服务信息返回给应用程序。该方法在应用程序做跨进程对服务端操作时,可以通过暂存权限值和暂存待请求服务信息的返回值的方式减少跨进程次数以及减少代码的执行,无需每次查询待请求服务信息时需要通过至少两次IPC请求来实现,由此提高应用程序对系统的操作效率,提升用户体验,在系统忙碌的时候,也可以防止线程池的线程耗尽,造成装置ANR或者装置重启。
在一个实施例中,如图3所示,在上述步骤S204之后,还包括:
步骤S302,若未查询到权限值,则发送第二获取请求至活动管理组件,触发活动管理组件跨进程查询应用程序是否具有获取待请求服务信息的权限;
步骤S304,接收活动管理组件返回的查询结果,并将查询结果存储在预设容器中。
进一步地,步骤S304具体包括:若查询结果为应用程序具有获取待请求服务信息的权限,则生成第一权限值;若查询结果为应用程序不具有获取待请求服务信息的权限,则生成第二权限值;将第一权限值或第二权限值,与应用程序关联后,存储在预设容器中。
其中,活动管理组件为Android框架的一个重要部分,负责新的ActivityThread(活动进程)的创建,Activity(活动)生命周期的维护,即图1中应用程序框架层中的活动管理器。
其中,第二获取请求表示应用程序所获取的待请求服务信息对应的组件发送给活动管理组件的IPC(Inter-Process Communication,进程间通信)请求。
具体实现中,以电话服务信息为待请求服务信息为例,若在电话管理器对应的容器中未查询到应用程序的权限值,表明应用程序没有发送过针对电话服务信息的第一获取请求至电话管理器,则电话管理器需发送第二获取请求至活动管理组件,由活动管理组件跨进程查询应用程序是否具有获取电话服务信息的权限,并接收活动管理组件返回的查询结果。若查询结果为应用程序具有获取电话服务信息的权限,则生成第一权限值,将第一权限值与应用程序的应用标识进行关联并存储至电话管理器对应的容器中。若查询结果为应用程序不具有获取电话服务信息的权限,则生成第二权限值,将第二权限值与应用程序的应用标识进行关联并存储至电话管理器对应的容器中。
本实施例中,在未查询到应用程序的权限值时,通过活动管理组件跨进程查询应用程序是否具有获取待请求服务信息的权限,并将查询结果与应用程序进行关联后存储在预设容器中,以便于后续该应用程序再次获取该待请求服务信息时,可直接从预设容器中查询该应用程序是否具有获取待请求服务信息的权限,无需再通过活动管理组件跨进程查询,既减少了进程的占用,也减少了获取查询结果的时间。
在一个实施例中,在上述步骤S206之后,还包括:若在预设容器中未查询到待请求 服务信息,则发送数据获取请求至电话组件,触发电话组件获取待请求服务信息;接收电话组件返回的待请求服务信息,将待请求服务信息与应用程序进行关联后,存储在预设容器中。
例如,若在电话管理器对应的容器中未查询到应用程序所需获取的电话服务信息,则活动管理组件将跨进程发送数据获取请求至电话组件,使电话组件到下层框架中获取电话服务信息,电话组件将获取的电话服务信息返回给电话管理器,由电话管理器将该电话服务信息返回给应用程序。同时,电话管理器还将把电话组件返回的电话服务信息,与应用程序的应用标识进行关联后,存储在电话管理器对应的容器中。
在上述实施例中,用于存储待请求服务信息的容器与待请求服务信息对应的组件相关联。用于存储权限值的预设容器与用于存储待请求服务信息的容器可以是同一容器,也可以是不同的容器。例如,用于存储待请求服务信息的容器可以是另一HashMap容器。
本实施例中,在未查询到应用程序所要获取的待请求服务信息时,通过电话组件获取待请求服务信息,并将接收的待请求服务信息与应用程序进行关联后存储在预设容器中,以便于后续该应用程序再次获取该待请求服务信息时,可直接从预设容器中获取该待请求服务信息,无需再通过电话组件去返回待请求服务信息,减少了应用程序获取待请求服务信息的时间,极大地提高了应用程序获取待请求服务信息的效率。
在一个实施例中,还包括:当接收到应用程序针对待请求服务信息的权限状态改变的消息时,清除预设容器中存储的应用程序的权限值和待请求服务信息。
具体实现中,应用程序获取某一待请求服务信息的权限可能会被修改,当AppOpsManager(一种应用程序权限动态检测的组件)检测到应用程序针对某一待请求服务信息的权限发生改变时,将会发送通知消息至该待请求服务信息对应的组件,使该组件清除对应容器中存储的与该应用程序关联的权限值和待请求服务信息。
例如,若应用程序获取电话服务信息的权限由有权限变为无权限时,AppOpsManager将发送通知消息至电话管理器,使电话管理器将其对应容器中存储的应用程序的权限值和电话服务信息均清除。
本实施例中,在接收到应用程序针对待请求服务信息的权限状态改变的消息时,清除预设容器中存储的应用程序的权限值和待请求服务信息,实现与应用程序权限状态的同 步更新和一致性。
为了更清晰阐明本申请实施例提供的技术方案,以下将结合图4对该方案进行说明,图4为一个应用实例中服务信息获取方法的流程示意图,该方法的具体流程如下:
步骤(1),Application(应用程序)向TelephonyManager(电话管理器)发送针对Device ID(装置识别码,作为待请求服务信息的示例)的第一获取请求。
步骤(2),TelephonyManager(电话管理器)检查预设容器中是否暂存有该应用程序获取Device ID的权限值,如果有进入步骤(3),如果没有进入步骤(2.1)。
步骤(2.1),TelephonyManager向ActivityManager(活动管理组件)发送第二获取请求,触发ActivityManager跨进程查询该应用程序是否有存取Device ID的权限,并且把查询结果存储至上述预设容器中,检查结果可以包括表示有权限的权限值和表示没有权限的权限值。
步骤(3),TelephonyManager检查预设容器中是否有存储的Device ID,如果有进入步骤(4),如果没有进入步骤(3.1)。
步骤(3.1),发送数据获取请求至Phone模组(电话模组,作为上述实施例中的电话组件),由Phone模组获取Device ID,然后进入步骤(3.2)。
步骤(3.2),Phone模组将所获取的Device ID返回给PhoneInterfaceManager,通过PhoneInterfaceManager返回给TelephonyManager(电话管理器),由TelephonyManager将返回的Device ID存储在预设容器中,然后进入步骤(4)。
步骤(4),从预设容器中获取Device ID,并将Device ID返回给应用程序。
步骤(5),如果应用程序获取Device ID的权限值有变化(例如,用户手动清除应用的权限值),则AppOpsManager将发送通知消息至TelephonyManager。
步骤(6),由TelephonyManager将预设容器中存储的该应用程序的权限值和Device ID清除。本实施例提供的服务信息获取方法,在Android装置中,应用程序做跨进程对服务端操作时,可以通过暂存权限值和暂存待请求服务信息的返回值的方式减少跨进程次数以及减少代码的执行,由此提高应用程序对系统的操作效率,提升用户体验,在系统忙碌的时候,也可以防止线程池的线程耗尽,造成装置ANR或者装置重启。
应该理解的是,虽然图2-4的流程图中的各个步骤按照箭头的指示依次显示,但是这 些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,图2-4中的至少一部分步骤可以包括多个子步骤或者多个阶段,这些子步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些子步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤的子步骤或者阶段的至少一部分轮流或者交替地执行。
在一个实施例中,如图5所示,提供了一种服务信息获取装置,包括:请求接收模块502、权限值查询模块504、信息查询模块506和信息返回模块508,其中:
请求接收模块502,用于接收应用程序发送的针对待请求服务信息的第一获取请求;
权限值查询模块504,用于根据第一获取请求,查询预设容器中是否存储有与应用程序对应的用于获取待请求服务信息的权限值;预设容器与待请求服务信息对应的组件相关联;
信息查询模块506,用于若查询到权限值,则查询预设容器中是否存储有待请求服务信息;
信息返回模块508,用于若查询到待请求服务信息,则将待请求服务信息返回给应用程序。
在一个实施例中,第一获取请求携带有应用程序的应用标识;上述权限值查询模块504,具体用于根据第一获取请求携带的应用标识,查询预设容器中是否存储有与应用程序对应的用于获取待请求服务信息的权限值。
在一个实施例中,上述信息查询模块506,具体用于若查询到权限值,则获取权限值对应的权限标识;若权限标识为预设权限标识,则查询预设容器中是否存储有待请求服务信息,预设权限标识用于标识获取待请求服务信息的权限。
在一个实施例中,上述权限值查询模块504,还用于若未查询到权限值,则发送第二获取请求至活动管理组件,触发活动管理组件跨进程查询应用程序是否具有获取待请求服务信息的权限;接收活动管理组件返回的查询结果,并将查询结果存储在预设容器中。
在一个实施例中,上述权限值查询模块504,还用于若查询结果为应用程序具有获取待请求服务信息的权限,则生成第一权限值;若查询结果为应用程序不具有获取待请求服 务信息的权限,则生成第二权限值;将第一权限值或第二权限值,与应用程序关联后,存储在预设容器中。
在一个实施例中,上述信息查询模块506,还用于若未查询到待请求服务信息,则发送数据获取请求至电话组件,触发电话组件获取待请求服务信息;接收电话组件返回的待请求服务信息,将待请求服务信息与应用程序进行关联后,存储在预设容器中。
在一个实施例中,上述装置还包括:
清除模块,用于当接收到应用程序针对待请求服务信息的权限状态改变的消息时,清除预设容器中存储的应用程序的权限值和待请求服务信息。
需要说明的是,本申请的服务信息获取装置与本申请的服务信息获取方法一一对应,在上述服务信息获取方法的实施例阐述的技术特征及其有益效果均适用于服务信息获取装置的实施例中,具体内容可参见本申请方法实施例中的叙述,此处不再赘述,特此声明。
此外,上述服务信息获取装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。
在一个实施例中,提供了一种计算机设备,该计算机设备可以是终端,其内部结构图可以如图6所示。该计算机设备包括通过系统总线连接的处理器、存储器、通信接口、显示屏和输入装置。其中,该计算机设备的处理器用于提供计算和控制能力。该计算机设备的存储器包括非易失性存储介质、内存储器。该非易失性存储介质存储有操作系统和计算机程序。该内存储器为非易失性存储介质中的操作系统和计算机程序的运行提供环境。该计算机设备的通信接口用于与外部的终端进行有线或无线方式的通信,无线方式可通过WIFI、运营商网络、NFC(近场通信)或其他技术实现。该计算机程序被处理器执行时以实现一种服务信息获取方法。该计算机设备的显示屏可以是液晶显示屏或者电子墨水显示屏,该计算机设备的输入装置可以是显示屏上覆盖的触摸层,也可以是计算机设备外壳上设置的按键、轨迹球或触控板,还可以是外接的键盘、触控板或鼠标等。
本领域技术人员可以理解,图6中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定,具体的计算机设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。
在一个实施例中,提供了一种计算机设备,包括存储器和处理器,存储器存储有计算机程序,处理器执行计算机程序时实现上述服务信息获取方法,在一实施例中,包括以下步骤:
接收应用程序发送的针对待请求服务信息的第一获取请求;
根据第一获取请求,查询预设容器中是否存储有与应用程序对应的用于获取待请求服务信息的权限值;预设容器与待请求服务信息对应的组件相关联;
若查询到权限值,则查询预设容器中是否存储有待请求服务信息;
若查询到待请求服务信息,则将待请求服务信息返回给应用程序。
上述计算机设备实施例中所实现的步骤与前述服务信息获取方法的步骤对应,在上述用户设备能力信息处理方法的实施例阐述的技术特征及其有益效果均适用于计算机设备的实施例中,具体限定可以参见上文中对于服务信息获取方法的限定,在此不再赘述。
在一个实施例中,提供了一种计算机可读存储介质,其上存储有计算机程序,计算机程序被处理器执行时实现上述服务信息获取方法,在一实施例中,包括以下步骤:
接收应用程序发送的针对待请求服务信息的第一获取请求;
根据第一获取请求,查询预设容器中是否存储有与应用程序对应的用于获取待请求服务信息的权限值;预设容器与待请求服务信息对应的组件相关联;
若查询到权限值,则查询预设容器中是否存储有待请求服务信息;
若查询到待请求服务信息,则将待请求服务信息返回给应用程序。
上述计算机可读存储介质实施例中所实现的步骤与前述服务信息获取方法的步骤对应,在上述用户设备能力信息处理方法的实施例阐述的技术特征及其有益效果均适用于计算机可读存储介质的实施例中,具体限定可以参见上文中对于服务信息获取方法的限定,在此不再赘述。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一非易失性计算机可读取存储介质中,该计算机程序在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和易失性存储器中的至少一种。非易失性存储器可包括只读存储器 (Read-Only Memory,ROM)、磁带、软盘、闪存或光存储器等。易失性存储器可包括随机存取存储器(Random Access Memory,RAM)或外部高速缓冲存储器。作为说明而非局限,RAM可以是多种形式,比如静态随机存取存储器(Static Random Access Memory,SRAM)或动态随机存取存储器(Dynamic Random Access Memory,DRAM)等。
以上实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。
以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对本申请专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。

Claims (18)

  1. 一种服务信息获取方法,包括:
    接收应用程序发送的针对待请求服务信息的第一获取请求;
    根据所述第一获取请求,查询预设容器中是否存储有与所述应用程序对应的用于获取所述待请求服务信息的权限值;所述预设容器与所述待请求服务信息对应的组件相关联;
    若查询到所述权限值,则查询所述预设容器中是否存储有所述待请求服务信息;
    若查询到所述待请求服务信息,则将所述待请求服务信息返回给所述应用程序。
  2. 根据权利要求1所述的方法,其中,所述第一获取请求携带有所述应用程序的应用标识;
    所述根据所述第一获取请求,查询预设容器中是否存储有与所述应用程序对应的用于获取所述待请求服务信息的权限值,包括:
    根据所述第一获取请求携带的应用标识,查询预设容器中是否存储有与所述应用程序对应的用于获取所述待请求服务信息的权限值。
  3. 根据权利要求1所述的方法,其中,所述若查询到所述权限值,则查询所述预设容器中是否存储有所述待请求服务信息,包括:
    若查询到所述权限值,则获取所述权限值对应的权限标识;
    若所述权限标识为预设权限标识,则查询所述预设容器中是否存储有所述待请求服务信息,所述预设权限标识用于标识获取所述待请求服务信息的权限。
  4. 根据权利要求1所述的方法,其中,在查询预设容器中是否存储有与所述应用程序对应的获取所述待请求服务信息的权限值之后,还包括:
    若未查询到所述权限值,则发送第二获取请求至活动管理组件,触发所述活动管理组件跨进程查询所述应用程序是否具有获取所述待请求服务信息的权限;
    接收所述活动管理组件返回的查询结果,并将所述查询结果存储在所述预设容器中。
  5. 根据权利要求4所述的方法,其中,所述将所述查询结果存储在所述容器中,包括:
    若所述查询结果为所述应用程序具有获取所述待请求服务信息的权限,则生成第一权限值;
    若所述查询结果为所述应用程序不具有获取所述待请求服务信息的权限,则生成第二权限值;
    将所述第一权限值或所述第二权限值,与所述应用程序关联后,存储在所述预设容器中。
  6. 根据权利要求1所述的方法,其中,在查询所述预设容器中是否存储有所述待请求服务信息之后,还包括:
    若未查询到所述待请求服务信息,则跨进程发送数据获取请求至电话组件,触发所述电话组件获取所述待请求服务信息;
    接收所述电话组件返回的所述待请求服务信息,将所述待请求服务信息与所述应用程序进行关联后,存储在所述预设容器中。
  7. 根据权利要求1-6任一项所述的方法,还包括:
    当接收到所述应用程序针对所述待请求服务信息的权限状态改变的消息时,清除所述预设容器中存储的与所述应用程序对应的用于获取所述待请求服务信息的权限值和所述待请求服务信息。
  8. 根据权利要求7所述的方法,其中,清除所述预设容器中存储的所述应用程序的权限值和待请求服务信息包括:
    发送通知消息至所述待请求服务信息对应的组件,使所述组件清除与其关联的预设容器中存储的与所述应用程序对应的用于获取所述待请求服务信息的权限值以及所述待请求服务信息。
  9. 一种服务信息获取装置,其中,所述装置包括:
    请求接收模块,用于接收应用程序发送的针对待请求服务信息的第一获取请求;
    权限值查询模块,用于根据所述第一获取请求,查询预设容器中是否存储有与所述应用程序对应的用于获取所述待请求服务信息的权限值;所述预设容器与所述待请求服务信息对应的组件相关联;
    信息查询模块,用于若查询到所述权限值,则查询所述预设容器中是否存储有所述待请求服务信息;
    信息返回模块,用于若查询到所述待请求服务信息,则将所述待请求服务信息返回给 所述应用程序。
  10. 根据权利要求9所述的服务信息获取装置,其中,所述第一获取请求携带有应用程序的应用标识;
    所述权限值查询模块还用于,根据所述第一获取请求携带的应用标识,查询预设容器中是否存储有与所述应用程序对应的用于获取所述待请求服务信息的权限值。
  11. 根据权利要求9所述的服务信息获取装置,其中,所述信息查询模块还用于:
    若查询到所述权限值,则获取所述权限值对应的权限标识;
    若所述权限标识为预设权限标识,则查询所述预设容器中是否存储有所述待请求服务信息,所述预设权限标识用于标识获取所述待请求服务信息的权限。
  12. 根据权利要求9所述的服务信息获取装置,其中,所述权限值查询模块还用于:
    若未查询到所述权限值,则发送第二获取请求至活动管理组件,触发所述活动管理组件跨进程查询所述应用程序是否具有获取所述待请求服务信息的权限;
    接收所述活动管理组件返回的查询结果,并将所述查询结果存储在所述预设容器中。
  13. 根据权利要求12所述的服务信息获取装置,其中,所述权限值查询模块还用于:
    若所述查询结果为所述应用程序具有获取所述待请求服务信息的权限,则生成第一权限值;
    若所述查询结果为所述应用程序不具有获取所述待请求服务信息的权限,则生成第二权限值;
    将所述第一权限值或所述第二权限值,与所述应用程序关联后,存储在所述预设容器中。
  14. 根据权利要求1所述的服务信息获取装置,其中,所述信息查询模块还用于:
    若未查询到所述待请求服务信息,则跨进程发送数据获取请求至电话组件,触发所述电话组件获取所述待请求服务信息;
    接收所述电话组件返回的所述待请求服务信息,将所述待请求服务信息与所述应用程序进行关联后,存储在所述预设容器中。
  15. 根据权利要求9-14任一项所述的服务信息获取装置,还包括清除模块,用于当接收到应用程序针对待请求服务信息的权限状态改变的消息时,清除所述预设容器中存储 的与所述应用程序对应的用于获取所述待请求服务信息的权限值和所述待请求服务信息。
  16. 根据权利要求15所述的服务信息获取装置,其中,所述清除模块还用于,发送通知消息至所述待请求服务信息对应的组件,使所述组件清除与其关联的预设容器中存储的与所述应用程序对应的用于获取所述待请求服务信息的权限值以及所述待请求服务信息。
  17. 一种计算机设备,包括存储器和处理器,所述存储器存储有计算机程序,其中,所述处理器执行所述计算机程序时实现权利要求1至8中任一项所述方法。
  18. 一种计算机可读存储介质,其上存储有计算机程序,其中,所述计算机程序被处理器执行时实现权利要求1至8中任一项所述的方法。
PCT/CN2021/133071 2020-12-22 2021-11-25 服务信息获取方法、装置、计算机设备和存储介质 WO2022135015A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011530496.5A CN114721840A (zh) 2020-12-22 2020-12-22 服务信息获取方法、装置、计算机设备和存储介质
CN202011530496.5 2020-12-22

Publications (1)

Publication Number Publication Date
WO2022135015A1 true WO2022135015A1 (zh) 2022-06-30

Family

ID=82157356

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/133071 WO2022135015A1 (zh) 2020-12-22 2021-11-25 服务信息获取方法、装置、计算机设备和存储介质

Country Status (2)

Country Link
CN (1) CN114721840A (zh)
WO (1) WO2022135015A1 (zh)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110213800A1 (en) * 2008-11-03 2011-09-01 Telefonaktiebolaget Lm Ericsson (Publ) Pre-Fetching of Data in a Mobile Communications Environment
CN103731799A (zh) * 2012-10-11 2014-04-16 中兴通讯股份有限公司 非实时位置信息获取方法、移动终端及通信系统
CN104837117A (zh) * 2015-05-18 2015-08-12 严文发 一种定位终端定位方法和系统
CN106713580A (zh) * 2016-06-17 2017-05-24 腾讯科技(深圳)有限公司 一种电话号码识别方法、安全服务器以及终端
CN106851583A (zh) * 2017-04-07 2017-06-13 广东欧珀移动通信有限公司 移动终端的位置信息获取方法、装置及移动终端

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110213800A1 (en) * 2008-11-03 2011-09-01 Telefonaktiebolaget Lm Ericsson (Publ) Pre-Fetching of Data in a Mobile Communications Environment
CN103731799A (zh) * 2012-10-11 2014-04-16 中兴通讯股份有限公司 非实时位置信息获取方法、移动终端及通信系统
CN104837117A (zh) * 2015-05-18 2015-08-12 严文发 一种定位终端定位方法和系统
CN106713580A (zh) * 2016-06-17 2017-05-24 腾讯科技(深圳)有限公司 一种电话号码识别方法、安全服务器以及终端
CN106851583A (zh) * 2017-04-07 2017-06-13 广东欧珀移动通信有限公司 移动终端的位置信息获取方法、装置及移动终端

Also Published As

Publication number Publication date
CN114721840A (zh) 2022-07-08

Similar Documents

Publication Publication Date Title
CN107241281B (zh) 一种数据处理方法及其装置
CN107832100B (zh) 一种apk插件的加载方法及其终端
CN109064345A (zh) 消息处理方法、系统以及计算机可读存储介质
US20210097476A1 (en) Container Management Method, Apparatus, and Device
WO2021031905A1 (zh) 数据管理方法、装置、设备、系统及计算机可读存储介质
US20220171652A1 (en) Distributed container image construction scheduling system and method
US20230046979A1 (en) Microservice call method and apparatus, device, and medium
US20190012087A1 (en) Method, apparatus, and system for preventing loss of memory data
CN115328625A (zh) 线程池参数处理方法、系统、计算机设备、介质及程序产品
WO2022135015A1 (zh) 服务信息获取方法、装置、计算机设备和存储介质
US11614957B1 (en) Native-hypervisor based on-demand code execution system
WO2018068655A1 (zh) 一种许可管理方法和系统
US10846156B2 (en) Methods, devices and computer program products for managing software function
CN109005465B (zh) 弹幕消息分发方法、装置、设备及存储介质
CN108197029B (zh) 一种获取进程信息的方法和设备
CN116366634A (zh) 一种文件下载方法、装置、终端、源服务器及介质
CN113535439B (zh) 业务请求处理方法、装置、设备及存储介质
CN115373886A (zh) 服务群组容器停机方法、装置、计算机设备和存储介质
CN109144639B (zh) 弹幕消息分发方法、装置、设备及存储介质
CN113407419A (zh) 内存泄漏检测方法、装置、计算机设备和存储介质
CN112417533A (zh) 防截屏方法、装置、计算机设备和存储介质
CN112702270B (zh) 基于事件分发机制的节点调用方法、系统及存储介质
CN114327828B (zh) 一种共享数据的无锁并发访问方法、装置、设备及介质
CN117453423B (zh) Gpu显存管理方法和系统,存储介质和电子设备
CN109168079B (zh) 弹幕消息分发方法、装置、设备及存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21909014

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 021123)

122 Ep: pct application non-entry in european phase

Ref document number: 21909014

Country of ref document: EP

Kind code of ref document: A1