Data processing, communication method and apparatus
By establishing and managing a collection of content provider components, the problems of high memory consumption and slow startup speed during the application startup phase are solved, enabling on-demand loading and fast startup.
Patent Information
- Application Number
- CN202211088596.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-07
- Publication Date
- 2026-02-27
- Estimated Expiration
- 2042-09-07
AI Technical Summary
High memory usage and slow startup speed during application startup lead to long processing times.
By obtaining multiple aggregated content provider components registered in the application's information description file, a content provider component set is established, the manifest information of each aggregated content provider component is deleted, and its identifier field is added to the manifest information of the shared content provider components, and content provider components are loaded on demand.
It reduces memory usage during application startup, improves application startup speed, and optimizes the time consumption of the ActivityThread#installContentProviders function.
Smart Images

Figure CN115630030B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of client development. More particularly, the present disclosure relates to a data processing and communication method and apparatus. BACKGROUND
[0002] In the related art, with the continuous iteration of applications, more and more content provider components (ContentProvider) are involved, which leads to the instantiation of a large number of content provider components, the calling of life cycle functions, and the cost of cross-process communication every time the application is cold started, directly leading to an increase in the time consumption of the application start phase. SUMMARY
[0003] An exemplary embodiment of the present disclosure is to provide a data processing and communication method and apparatus to at least solve the problems of high memory occupation, slow application startup speed, and long time consumption in the application start phase in the related art.
[0004] According to an exemplary embodiment of the present disclosure, a data processing method is provided, including: obtaining a plurality of aggregated content provider components registered in an information description file of an application, wherein the information description file includes configuration information of the application; based on the plurality of aggregated content provider components, establishing a content provider component set, wherein the content provider component set includes a key-value pair of each aggregated content provider component in the plurality of aggregated content provider components, wherein the key-value pair of each aggregated content provider component includes an identification field of the aggregated content provider component and the aggregated content provider component; deleting manifest information of each aggregated content provider component involved in the content provider component set from the information description file, adding an identification field of each aggregated content provider component involved in the content provider component set to manifest information of a shared content provider component in the information description file, wherein the manifest information includes the identification field; and injecting the content provider component set into a file about the shared content provider component.
[0005] Optionally, the injection of the content provider component set into the file about the shared content provider component can include: injecting the content provider component set into the file about the shared content provider component in the form of bytecode.
[0006] Optionally, the file about the shared content provider component can be a java class file.
[0007] According to an example embodiment of the present disclosure, a communication method is provided, executed by a shared content provider component, comprising: in response to receiving an access request of an application, parsing an identification field of a uniform resource identifier contained in the access request; determining a target content provider component from a content provider component set in a file about a shared content provider component based on the identification field and manifest information of the shared content provider component, wherein the file about the shared content provider component and the manifest information of the shared content provider component are obtained by the data processing method described in the present disclosure; and executing the access request based on the target content provider component.
[0008] Optionally, the access request can be issued by a content resolver component.
[0009] Optionally, the executing the access request based on the target content provider component can include: instantiating the target content provider component; sequentially executing a life cycle function related to the target content provider component; and executing the access request based on an execution result of the life cycle function.
[0010] According to an example embodiment of the present disclosure, a data processing apparatus is provided, comprising: a component acquisition unit configured to acquire a plurality of aggregated content provider components registered in an information description file of an application, wherein the information description file comprises configuration information of the application; a component set establishment unit configured to establish a content provider component set based on the plurality of aggregated content provider components, wherein the content provider component set comprises a key-value pair of each aggregated content provider component in the plurality of aggregated content provider components, wherein the key-value pair of each aggregated content provider component comprises an identification field of the aggregated content provider component and the aggregated content provider component; a file editing unit configured to delete manifest information of each aggregated content provider component involved in the content provider component set from the information description file, and add the identification field of each aggregated content provider component involved in the content provider component set to manifest information of a shared content provider component in the information description file, wherein the manifest information comprises the identification field; and a component set injection unit configured to inject the content provider component set into a file about the shared content provider component.
[0011] Optionally, the key-value pair injection unit can be configured to inject the content provider component set into the file about the shared content provider component in the form of bytecode.
[0012] Optionally, the file about the shared content provider component can be a java class file.
[0013] According to an example embodiment of the present disclosure, a communication apparatus is provided, comprising: an identifier resolving unit configured to, in response to receiving an access request of an application, resolve an identifier field of a uniform resource identifier contained in the access request; a component determining unit configured to determine a target content provider component from a content provider component set in a file about shared content provider components based on the identifier field and manifest information of the shared content provider components, wherein the file about shared content provider components and the manifest information of the shared content provider components are obtained through the data processing method described in the present disclosure; and a request executing unit configured to execute the access request based on the target content provider component.
[0014] Optionally, the access request is issued through a content resolver component.
[0015] Optionally, the request executing unit can be configured to: instantiate the determined content provider component; sequentially execute a life cycle function related to the determined content provider component; and execute the access request based on an execution result of the life cycle function.
[0016] According to an example embodiment of the present disclosure, an electronic device is provided, comprising: a processor; a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to implement a method according to an example embodiment of the present disclosure.
[0017] According to an example embodiment of the present disclosure, a computer readable storage medium is provided, having stored thereon a computer program, which, when executed by a processor of an electronic device, causes the electronic device to perform a method according to an example embodiment of the present disclosure.
[0018] According to an example embodiment of the present disclosure, a computer program product is provided, comprising computer programs / instructions, which, when executed by a processor, implement a method according to an example embodiment of the present disclosure.
[0019] The technical solutions provided by the embodiments of the present disclosure at least bring the following beneficial effects:
[0020] By deleting the independent manifest information of each aggregated content provider component, and adding the identifier field of the aggregated content provider component whose manifest information is deleted to the manifest information of the shared content provider components, it is not necessary to load each content provider component based on the respective manifest information in the starting stage, and the content provider component can be loaded on demand;
[0021] The target content provider component is determined from a key-value pair in a file about the shared content provider component by an identification field parsed based on a uniform resource identifier and manifest information of the shared content provider component, thereby reducing memory occupation in an application starting stage by realizing on-demand loading of the content provider component, improving starting speed of the application, thereby reducing time consumption in the application starting stage, and realizing ActivityThread # installContentProviders function time consumption optimization.
[0022] It should be understood that the foregoing general description and the following detailed description are only exemplary and explanatory, and are not limiting to the present disclosure. BRIEF DESCRIPTION OF DRAWINGS
[0023] The accompanying drawings incorporated in and forming a part of the specification, illustrate embodiments consistent with the present disclosure and serve to explain the principles of the present disclosure, and are not intended to limit the present disclosure.
[0024] Figure 1 An exemplary system architecture 100 in which exemplary embodiments of the present disclosure can be applied is shown.
[0025] Figure 2 A flowchart of a data processing method according to exemplary embodiments of the present disclosure is shown.
[0026] Figure 3 A flowchart of a communication method according to exemplary embodiments of the present disclosure is shown.
[0027] Figure 4 A block diagram of a data processing apparatus according to exemplary embodiments of the present disclosure is shown.
[0028] Figure 5 A block diagram of a communication apparatus according to exemplary embodiments of the present disclosure is shown.
[0029] Figure 6 A block diagram of an electronic device 600 according to exemplary embodiments of the present disclosure is shown. DETAILED DESCRIPTION
[0030] In order for those skilled in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be described clearly and completely below with reference to the drawings.
[0031] It is to be noted that the terms "first", "second", and the like in the description and in the claims of the present disclosure and above-described drawings are intended to distinguish between similar objects and not necessarily in an ordinal sense. It is to be understood that the use of these terms herein is merely to distinguish between two separate and distinct structures, states, and the like, and not to imply that one came before or after the other. The embodiments described in the following examples do not represent all the implementations consistent with the present disclosure. Instead, they are merely examples consistent with some aspects of the present disclosure as detailed in the appended claims.
[0032] It is to be noted that "at least one of a plurality of items" in the present disclosure means any one of the items from the plurality of items, a combination of any one of the items from the plurality of items, all of the items from the plurality of items, and the like. For example, "at least one of A and B" includes any one of the following three cases. (1) a case where A is included, (2) a case where B is included, and (3) a case where both of A and B are included. Also, for example, "at least one of a first step and a second step" includes any one of the following three cases. (1) a case where the first step is performed, (2) a case where the second step is performed, and (3) a case where both of the first step and the second step are performed.
[0033] In the related art, one of the difficulties in the development of an Android application is how to design an algorithm to achieve on-demand loading of a content provider component, thereby reducing the memory occupation in the application startup stage.
[0034] Hereinafter, the data processing, communication method and apparatus according to the exemplary embodiments of the present disclosure will be described with reference to the accompanying drawings. Figures 1 to 6 The data processing, communication method and apparatus according to the exemplary embodiments of the present disclosure will be described in detail below.
[0035] Figure 1 An exemplary system architecture 100 in which exemplary embodiments of the present disclosure can be applied is shown.
[0036] As Figure 1As shown, the system architecture 100 can include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 is a medium for providing a communication link between the terminal devices 101, 102, 103 and the server 105. The network 104 can include various connection types, such as wired, wireless communication links, or fiber optic cables, etc. A user can use the terminal devices 101, 102, 103 to interact with the server 105 through the network 104 to receive or send messages (e.g., data processing requests, access requests), etc. The terminal devices 101, 102, 103 can be installed with various applications. The terminal devices 101, 102, 103 can be hardware or software. When the terminal devices 101, 102, 103 are hardware, they can be various electronic devices, including but not limited to smartphones, tablet computers, laptop computers, desktop computers, etc. When the terminal devices 101, 102, 103 are software, they can be installed in the above-listed electronic devices, and can be implemented as multiple software or software modules (e.g., to provide distributed services) or as a single software or software module. No specific limitation is made herein.
[0037] The terminal devices 101, 102, 103 can be installed with image acquisition devices (e.g., cameras) to acquire video data. In practice, the smallest visual unit constituting a video is a frame. Each frame is a static image. A sequence of frames that are continuous in time are combined together to form a dynamic video. In addition, the terminal devices 101, 102, 103 can also be installed with components for converting electrical signals into sound (e.g., speakers) to play sound, and can also be installed with devices for converting analog audio signals into digital audio signals (e.g., microphones) to acquire sound.
[0038] The server 105 can be a server that provides various services, such as a background server that provides support for multimedia applications installed on the terminal devices 101, 102, 103. The background server can analyze, store, etc. received audio / video data upload requests, etc., and can also receive audio / video data download requests sent by the terminal devices 101, 102, 103, and feed back audio / video data indicated by the audio / video data download requests to the terminal devices 101, 102, 103.
[0039] It should be noted that the server can be hardware or software. When the server is hardware, it can be implemented as a distributed server cluster composed of multiple servers, or as a single server. When the server is software, it can be implemented as multiple software or software modules (e.g., to provide distributed services), or as a single software or software module. No specific limitation is made herein.
[0040] It should be noted that the data processing and communication method provided by the embodiments of the present disclosure is generally executed by a terminal device, but can also be executed by a server, or can also be executed by the terminal device and the server in cooperation. Accordingly, the data processing and communication apparatus can be arranged in the terminal device, the server, or both the terminal device and the server.
[0041] It should be understood that Figure 1 The number of terminal devices, networks and servers in the above description is only illustrative. According to the needs of implementation, there can be any number of terminal devices, networks and servers, and the present disclosure has no limitation on this.
[0042] Figure 2 A flowchart of a data processing method according to an example embodiment of the present disclosure is shown.
[0043] Referring to Figure 2 In step S201, a plurality of aggregated content provider components (aggregated ContentProvider) registered in an information description file (AndroidManifest.xml) of an application are acquired. Here, the information description file includes configuration information of the application. For example, the information description file includes manifest information of the content provider component. The content provider component can be divided into an aggregated content provider component and a non-aggregated content provider component. Here, the application can be an Android application.
[0044] In the example embodiments of the present disclosure, the plurality of aggregated content provider components can be acquired by scanning the information description file.
[0045] In step S202, a content provider component set is established based on the plurality of aggregated content provider components. Here, the content provider component set includes a key-value pair of each aggregated content provider component in the plurality of aggregated content provider components, and each key-value pair of the aggregated content provider component includes an identification field of the aggregated content provider component and the aggregated content provider component.
[0046] For example, a set C of aggregated content provider components can be established, where C={c1, c2...ci...cn}, and node ci is a key-value pair ci=(ai, pi), ai represents an identification field (authorities) of the aggregated content provider component, and pi represents a specific content provider component content provider component.
[0047] In step S203, the list information of each aggregated content provider component involved in the content provider component set is deleted from the information description file, and the identification field of each aggregated content provider component involved in the content provider component set is added to the list information of the shared content provider component in the information description file. Here, the list information includes the identification field. The shared content provider component is a non-aggregated content provider component. The shared content provider component can be one of the non-aggregated content provider components specified in the information description file.
[0048] By the list information of each aggregated content provider component, each aggregated content provider component can be run at the application runtime. By deleting the list information of each aggregated content provider component involved in the content provider component set, each aggregated content provider component can not be run at the application runtime.
[0049] By adding the identification field of each aggregated content provider component involved in the content provider component set to the list information of the shared content provider component in the information description file, at the application runtime, if the identification field resolved from the uniform resource identifier exists in the list information, the content provider component corresponding to the resolved identification field can be found from the content provider component set, only the found content provider component can be run, and other content provider components can not be run, thereby achieving the on-demand loading of the content provider component at the startup stage.
[0050] For example, the list information of all the content provider components involved in the set C is removed, and all the identification fields involved in the set C are added to the list information of U, which is one of the content provider components registered in the information description file of the application, i.e., the shared content provider component.
[0051] In step S204, the content provider component set is injected into the file about the shared content provider component.
[0052] In the exemplary embodiments of the present disclosure, when the content provider component set is injected into the file about the shared content provider component, the content provider component set can be injected into the file (i.e., the U file) about the shared content provider component in the form of bytecode. For example, when the key-value pair of each content provider component is included in the set C, the set C is injected into the U file in the form of bytecode.
[0053] In the exemplary embodiments of the present disclosure, the file about the shared content provider component is a java class file (class file).
[0054] Figure 3A flowchart of a communication method according to an example embodiment of the present disclosure is shown. Figure 3 The communication method in the method can be executed by the shared content provider component.
[0055] Referring to Figure 3 In step S301, in response to receiving an access request of an application, an identification field of a uniform resource identifier contained in the access request is parsed. Here, the uniform resource identifier (URI) is a string used to identify a name of an Internet resource.
[0056] In an example embodiment of the present disclosure, the access request can be issued by a content parser component.
[0057] In step S302, based on the identification field and the manifest information of the shared content provider component, a target content provider component is determined from a content provider component set in a file about the shared content provider component. Here, the file about the shared content provider component and the manifest information of the shared content provider component are obtained by the data processing method described in the present disclosure.
[0058] In an example embodiment of the present disclosure, when determining the target content provider component from the content provider component set in the file about the shared content provider component based on the identification field and the manifest information of the shared content provider component, it can be first determined whether the identification field exists in the manifest information of the shared content provider component, and then in the case that the identification field exists in the manifest information of the shared content provider component, the content provider component corresponding to the identification field is found from the content provider component set, so that only the found content provider component can be run without running other content provider components.
[0059] In step S303, the access request is executed based on the target content provider component.
[0060] In an example embodiment of the present disclosure, when executing the access request based on the target content provider component, the target content provider component can be first instantiated, the life cycle functions related to the target content provider component are executed in sequence, and then the access request is executed based on the execution result of the life cycle functions.
[0061] As an example, when the application sends a request to the shared content provider component U through a ContentResolver, the shared content provider component U parses the identification field of the uniform resource identifier accessed, and finds the content provider component corresponding to the uniform resource identifier, referred to as M, through the set C. Then M is instantiated, and the related life cycle functions are executed in turn, and finally the related request is processed.
[0062] In summary, the target content provider component is determined from the content provider component set in the file about the shared content provider component based on the identification field parsed from the uniform resource identifier and the manifest information of the shared content provider component, and only the found content provider component is run without running other content provider components, thereby realizing the ActivityThread#installContentProviders function time-consuming optimization and reducing the time-consuming of the application startup stage.
[0063] Here, ActivityThread is a very important class in the Android framework, which represents the main thread of an application process (for an application process, the main function of ActivityThread is indeed executed by the main thread of the process), and its responsibility is to schedule and execute the four components running in the thread.
[0064] The above has been described in combination with Figures 1 to 3 A data processing, communication method according to an example embodiment of the present disclosure is described. Hereinafter, a data processing, communication device according to an example embodiment of the present disclosure will be described with reference to Figure 4 and Figure 5 A data processing, communication device and units thereof according to an example embodiment of the present disclosure are described.
[0065] Figure 4 A block diagram of a data processing device according to an example embodiment of the present disclosure is shown.
[0066] With reference to Figure 4 , the data processing device includes a component acquisition unit 41, a component set establishment unit 42, a file editing unit 43, and a component set injection unit 44.
[0067] The component acquisition unit 41 is configured to acquire a plurality of aggregated content provider components registered in an information description file of an application, wherein the information description file includes configuration information of the application.
[0068] The component set establishing unit 42 is configured to establish a content provider component set based on the plurality of aggregated content provider components, wherein the content provider component set comprises a key-value pair of each of the plurality of aggregated content provider components, and wherein the key-value pair of each of the aggregated content provider components comprises an identification field of the aggregated content provider component and the aggregated content provider component.
[0069] The file editing unit 43 is configured to delete, from the information description file, manifest information of each of the aggregated content provider components involved in the content provider component set, and add an identification field of each of the aggregated content provider components involved in the content provider component set to manifest information of a shared content provider component in the information description file, wherein the manifest information comprises the identification field.
[0070] The component set injection unit 44 is configured to inject a key-value pair of each of the plurality of content provider components into a file about a shared content provider component.
[0071] In an exemplary embodiment of the present disclosure, the component set injection unit 44 can be configured to inject the content provider component set into the file about the shared content provider component in the form of bytecode.
[0072] In an exemplary embodiment of the present disclosure, the file about the shared content provider component can be a java class file.
[0073] Figure 5 A block diagram of a communication apparatus according to an exemplary embodiment of the present disclosure is shown.
[0074] Referring to Figure 5 , the communication apparatus comprises an identification resolving unit 51, a component determining unit 52, and a request executing unit 53.
[0075] The identification resolving unit 51 is configured to resolve an identification field of a uniform resource identifier contained in an access request of an application in response to receiving the access request.
[0076] In an exemplary embodiment of the present disclosure, the access request is issued by a content resolver component.
[0077] The component determining unit 52 is configured to determine a target content provider component from a content provider component set in a file about a shared content provider component based on the identification field and manifest information of the shared content provider component, wherein the file about the shared content provider component and the manifest information of the shared content provider component are obtained by the data processing method described in the present disclosure.
[0078] The request execution unit 53 is configured to execute the access request based on the target content provider component.
[0079] In the exemplary embodiments of the present disclosure, the request execution unit 53 can be configured to instantiate the target content provider component, sequentially execute life cycle functions related to the target content provider component, and execute the access request based on the execution result of the life cycle functions.
[0080] As to the apparatus in the above embodiments, the specific manners in which the units perform operations have been described in detail in the embodiments of the method, and thus will not be described in detail here.
[0081] The above has been described in conjunction with Figure 4 and Figure 5 The data processing and communication apparatus according to the exemplary embodiments of the present disclosure are described. Next, the electronic device according to the exemplary embodiments of the present disclosure is described. Figure 6 The electronic device according to the exemplary embodiments of the present disclosure is described.
[0082] Figure 6 is a block diagram of an electronic device 600 according to the exemplary embodiments of the present disclosure.
[0083] Referring to Figure 6 , the electronic device 600 includes at least one memory 601 having a set of computer executable instructions stored therein and at least one processor 602, which executes the set of computer executable instructions when executed by the at least one processor 602, to perform the method according to the exemplary embodiments of the present disclosure.
[0084] In the exemplary embodiments of the present disclosure, the electronic device 600 can be a PC computer, a tablet device, a personal digital assistant, a smart phone, or other apparatus capable of executing the above-mentioned set of instructions. Here, the electronic device 600 is not necessarily a single electronic device, but can be a collection of any apparatus or circuitry capable of executing the above-mentioned instructions (or set of instructions) individually or jointly. The electronic device 600 can also be a part of an integrated control system or a system manager, or can be configured as a portable electronic device that interfaces with a local or remote (e.g., via wireless transmission).
[0085] In the electronic device 600, the processor 602 can include a central processing unit (CPU), a graphics processing unit (GPU), a programmable logic device, a dedicated processor system, a microcontroller, or a microprocessor. By way of example and not limitation, the processor can also include an analog processor, a digital processor, a microprocessor, a multi-core processor, a processor array, a network processor, etc.
[0086] The processor 602 can execute instructions or code stored in the memory 601, which can also store data. Instructions and data can also be sent and received via a network through a network interface device, which can employ any known transmission protocol.
[0087] The memory 601 may be integrated with the processor 602, for example, by placing RAM or flash memory within an integrated circuit microprocessor. Alternatively, the memory 601 may include a separate device, such as an external disk drive, a storage array, or other storage device that can be used by any database system. The memory 601 and the processor 602 may be operatively coupled, or may communicate with each other, for example, via I / O ports, network connections, etc., enabling the processor 602 to read files stored in the memory.
[0088] In addition, the electronic device 600 may also include a video display (such as a liquid crystal display) and a user interaction interface (such as a keyboard, mouse, touch input device, etc.). All components of the electronic device 600 can be interconnected via a bus and / or network.
[0089] According to exemplary embodiments of this disclosure, a computer-readable storage medium including instructions is also provided, such as a memory 601 including instructions, which can be executed by a processor 602 of the device 600 to perform the above-described method. Optionally, the computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.
[0090] According to exemplary embodiments of the present disclosure, a computer program product may also be provided, the computer program product including a computer program / instructions that, when executed by a processor, implement the method according to exemplary embodiments of the present disclosure.
[0091] The above has been referred to Figures 1 to 6 Data processing and communication methods and apparatus according to exemplary embodiments of the present disclosure are described. However, it should be understood that: Figure 4 and Figure 5 The data processing and communication devices and units shown can be configured as software, hardware, firmware, or any combination thereof to perform specific functions. Figure 6 The electronic device shown is not limited to the components shown above, but some components may be added or removed as needed, and the above components may also be combined.
[0092] According to the data processing method and device, by obtaining a plurality of aggregated content provider components registered in an information description file of an application, a content provider component set including a key-value pair of each of the plurality of aggregated content provider components is established based on the plurality of aggregated content provider components; list information including an identification field of each of the aggregated content provider components involved in the content provider component set is deleted from the information description file, the identification field of each of the aggregated content provider components involved in the content provider component set is added to list information of shared content provider components in the information description file, and the content provider component set is injected into a file about the shared content provider components, so that each content provider component does not need to be loaded based on respective list information, and the content provider component can be loaded on demand in a start-up phase.
[0093] In addition, according to the communication method and device, by responding to receiving an access request of an application, an identification field of a uniform resource identifier contained in the access request is parsed, a target content provider component is determined from a content provider component set in a file about shared content provider components obtained by the data processing method according to the disclosure based on the identification field and list information of the shared content provider components obtained by the data processing method according to the disclosure, and the access request is executed based on the target content provider component, so that the memory occupancy in the application start-up phase is reduced by implementing on-demand loading of the content provider component, and the start-up speed of the application is improved, thereby reducing the time consumption in the application start-up phase.
[0094] Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the features disclosed herein. It is intended that the specification and examples be considered as exemplary only, with the true scope and spirit of the disclosure being indicated by the following claims.
[0095] It should be understood that the present disclosure is not limited to the precise construction which has been described above and illustrated in the accompanying drawings, and that various modifications and changes can be made by those skilled in the art without departing from the scope of the present disclosure. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A data processing method, characterized in that, include: Obtain multiple aggregated content provider components registered in the application's information description file, wherein the information description file includes the application's configuration information; Based on the plurality of aggregated content provider components, a content provider component set is established, wherein the content provider component set includes key-value pairs of each aggregated content provider component among the plurality of aggregated content provider components, wherein each key-value pair of aggregated content provider components includes an identifier field of the aggregated content provider component and the aggregated content provider component; Remove the list information of each aggregated content provider component involved in the content provider component set from the information description file, and add the identifier field of each aggregated content provider component involved in the content provider component set to the list information of shared content provider components in the information description file, wherein the list information includes the identifier field; Inject the collection of content provider components into the file about the shared content provider component.
2. The data processing method according to claim 1, characterized in that, The step of injecting the content provider component set into the file about the shared content provider component includes: The content provider component set is injected into the file about the shared content provider component via bytecode.
3. The data processing method according to claim 1, characterized in that, The file concerning the shared content provider component is a Java class file.
4. A communication method, executed by a shared content provider component, characterized in that, include: In response to receiving an access request from an application, the identifier field of the Uniform Resource Identifier contained in the access request is parsed out; Based on the identification field and the list information of the shared content provider components, a target content provider component is determined from the set of content provider components in the file about the shared content provider components, wherein the file about the shared content provider components and the list information of the shared content provider components are obtained by the data processing method as described in any one of claims 1 to 3; The access request is executed based on the target content provider component.
5. The communication method according to claim 4, characterized in that, The access request is issued through the content resolver component.
6. The communication method according to claim 4, characterized in that, The execution of the access request based on the target content provider component includes: Instantiate the target content provider component; Execute the lifecycle functions associated with the target content provider component in sequence; The access request is executed based on the execution result of the lifecycle function.
7. A data processing apparatus, characterized in that, include: The component acquisition unit is configured to acquire multiple aggregated content provider components registered in the application's information description file, wherein the information description file includes the application's configuration information; The component set establishment unit is configured to establish a content provider component set based on the plurality of aggregated content provider components, wherein the content provider component set includes key-value pairs of each aggregated content provider component among the plurality of aggregated content provider components, wherein each key-value pair of aggregated content provider components includes an identifier field of the aggregated content provider component and the aggregated content provider component; The file editing unit is configured to delete the list information of each aggregated content provider component involved in the content provider component set from the information description file, and add the identifier field of each aggregated content provider component involved in the content provider component set to the list information of shared content provider components in the information description file, wherein the list information includes the identifier field; and The component collection injection unit is configured to inject the content provider component collection into a file about the shared content provider component.
8. A communication device, characterized in that, include: The identifier resolution unit is configured to, in response to receiving an access request from an application, parse out the identifier field of the Uniform Resource Identifier contained in the access request; The component determination unit is configured to determine a target content provider component from a set of content provider components in a file about the shared content provider component based on the identification field and the list information of the shared content provider component, wherein the file about the shared content provider component and the list information of the shared content provider component are obtained by the data processing method as described in any one of claims 1 to 3; The request execution unit is configured to execute the access request based on the target content provider component.
9. An electronic device, characterized in that, include: processor; Memory used to store the processor's executable instructions; The processor is configured to execute the instructions to implement the method as described in any one of claims 1 to 6.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor of the electronic device, the electronic device performs the method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Method and device of transmitting information configuration files
CN104202302A
Mapped views of digital content
CN114073100A