A data processing method, apparatus, electronic device and storage medium

By setting initialization properties and merge properties for multiple classes to be initialized in the application development environment, and generating tag collection and class names, the problem of time and resources being spent on obtaining independent ContentProvider classes for each Library component is solved, and the effect of improving application startup efficiency is achieved.

CN114115863BActive Publication Date: 2025-05-30WUBA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111427880.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-26
Publication Date
2025-05-30
Estimated Expiration
2041-11-26

AI Technical Summary

Technical Problem

When the application starts, obtaining independent ContentProvider classes for each Library component will take a lot of time and system resources, reducing startup efficiency.

Method used

Create a ContentProvider class in the application's development environment, and set initialization properties and merge properties for multiple classes to be initialized, generate a set of tags and merge the class names of the classes to be initialized, so that when the application starts, only one ContentProvider class is used to initialize multiple classes to be initialized.

Benefits of technology

By reducing the number of ContentProvider classes, it saves time and system resources for creating classes, and improves the startup efficiency of the application.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114115863B_ABST
    Figure CN114115863B_ABST
Patent Text Reader

Abstract

The present application discloses a data processing method, apparatus, electronic device, and storage medium. During the process of starting the executable file of an application, if it is necessary to initialize multiple classes to be initialized in the executable file respectively, only the tag set in the ContentProvider class in the executable file can be obtained, the class names of the multiple classes to be initialized are obtained from the tag set in the ContentProvider class, and each class to be initialized is respectively obtained from the executable file according to the class names of the respective classes to be initialized in the tag set, and each class to be initialized obtained is initialized based on the ContentProvider class in the executable file. In this way, the initialization of multiple classes to be initialized in the executable file can be completed by using a small number of (for example, only one) ContentProvider classes, thereby reducing the number of ContentProvider classes created, saving the time for creating ContentProvider classes, saving system resources, and improving the efficiency of starting the executable file of the application.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technologies, and particularly to a data processing method, apparatus, electronic device, and storage medium. Background Art

[0002] During the process of a user using an application on a mobile phone, sometimes the application may be switched to the background of the mobile phone's operating system. In this case, the operating system may recycle the threads of the application, that is, close the threads of the application to save the system resources of the mobile phone. Then, when the user switches the application back to the foreground of the operating system, the operating system will start a thread for the application to start the application, and when starting the application, it will initialize the classes to be initialized in each Library component in the application and display the page that was displayed before the previous background operation.

[0003] Among them, in order to be able to initialize the classes to be initialized in each Library component in the application when starting the application, in one way during the development of the source code of the application, the code of the classes to be initialized in each Library component can be written into the onCreate method in their respective ContentProvider (content provider) classes.

[0004] In this way, after compiling the computer program code to obtain the application, during the process of starting the application, in order to initialize the classes to be initialized in each Library component in the application, independent ContentProvider classes corresponding to each Library component can be obtained (independent ContentProvider classes for each Library component have been created in advance during the development of the application), and each ContentProvider class is used to process the classes to be initialized in the corresponding Library component, so as to complete the separate initialization of the classes to be initialized in each Library component.

[0005] However, the inventors found that in the above method, obtaining an independent ContentProvider class for each Library component takes a relatively long time, reducing the efficiency of starting the application. Secondly, obtaining an independent ContentProvider class for each Library component consumes a relatively large amount of system resources. Summary of the Invention

[0006] This application discloses a data processing method, apparatus, electronic device, and storage medium.

[0007] In a first aspect, the present application discloses a data processing method, the method comprising:

[0008] Create a ContentProvider class in the development environment of the application;

[0009] In the development environment, set initialization attributes and merging attributes for merging into the ContentProvider class for multiple classes to be initialized in the application; the multiple classes to be initialized include classes to be initialized in at least two components;

[0010] In the source code of the application in the development environment, find the class names of each class to be initialized having the initialization attributes;

[0011] Generate a tag set in the ContentProvider class in the development environment;

[0012] Add the class names of each class to be initialized to the tag set according to the merging attributes.

[0013] In an alternative implementation, the step of setting initialization attributes and merging attributes for merging into the ContentProvider class for multiple classes to be initialized in the development environment includes:

[0014] For any one of the multiple classes to be initialized, generate a sub-manifest file of the class to be initialized in the development environment;

[0015] Generate a first code segment of the merging attributes of the class to be initialized in the sub-manifest file, the first code segment at least includes the class name of the ContentProvider class and a preset merging tag for indicating merging into the ContentProvider class according to the class name;

[0016] And,

[0017] Generate a second code segment of the initialization attributes of the class to be initialized in the sub-manifest file, the second code segment at least includes the class name of the class to be initialized and a preset initialization tag for indicating that the class corresponding to the class name of the class to be initialized needs to be initialized.

[0018] In an alternative implementation, the step of finding the class names of each class to be initialized having the initialization attributes in the source code includes:

[0019] In the sub-manifest files of each class in the source code, respectively, find whether the preset initialization tag exists;

[0020] Obtain the class name recorded in the second code segment in the sub - manifest file with the preset initialization tag, and use it as the class name of the class to be initialized.

[0021] In an alternative implementation, adding the class names of each class to be initialized to the tag set according to the merged attribute includes:

[0022] For any class to be initialized among the multiple classes to be initialized, obtain the class name of the ContentProvider class and the preset merge tag recorded in the first code segment in the sub - manifest file of the class to be initialized;

[0023] According to the class name of the ContentProvider class and the preset merge tag, add the class name of the class to be initialized to the tag set of the ContentProvider class.

[0024] In an alternative implementation, the method further includes:

[0025] Set initialization sequence parameters for each of the multiple classes to be initialized in the application in the development environment.

[0026] In an alternative implementation, setting initialization sequence parameters for each of the multiple classes to be initialized in the application in the development environment includes:

[0027] For any class to be initialized among the multiple classes to be initialized, set the initialization sequence parameter bound to the class to be initialized in the development environment.

[0028] In an alternative implementation, the method further includes:

[0029] Search for the initialization sequence parameters of each class to be initialized with the initialization attribute in the source code of the application in the development environment.

[0030] In an alternative implementation, searching for the initialization sequence parameters of each class to be initialized with the initialization attribute in the source code of the application in the development environment includes:

[0031] Respectively search in the sub - manifest files of each class in the source code to check if the preset initialization tag exists;

[0032] Search for the initialization sequence parameter bound to the class to be initialized corresponding to the target class name in the source code, where the target class name includes the class name recorded in the second code segment in the sub - manifest file with the preset initialization tag.

[0033] In an alternative implementation, the method further includes:

[0034] Add the initialization sequence parameters of each class to be initialized in the tag set according to the merging attribute.

[0035] In an optional implementation, the step of adding the initialization sequence parameters of each class to be initialized in the tag set according to the merging attribute includes:

[0036] According to the class name of the ContentProvider class and the preset merging tag, add the correspondence between the class name of the class to be initialized and the initialization sequence parameter bound to the class to be initialized in the tag set.

[0037] In a second aspect, the present application discloses a data processing method, the method includes:

[0038] During the process of starting the executable file of the application, obtain the tag set in the ContentProvider class in the executable file;

[0039] Wherein, the tag set includes the class names of multiple classes to be initialized in the executable file; the class names in the tag set include the class names of the classes with initialization attributes found in the source code of the application in the development environment of the application, and the class names in the tag set are added to the tag set according to the merging attributes of multiple classes to be initialized set in the development environment. The initialization attributes of each class to be initialized and the merging attributes for merging into the ContentProvider class are respectively set for multiple classes to be initialized in the application in the development environment;

[0040] Respectively obtain each class to be initialized in the executable file according to the class names of each class to be initialized in the tag set;

[0041] Initialize the multiple classes to be initialized obtained based on the ContentProvider class in the executable file.

[0042] In an optional implementation, the tag set further includes the initialization sequence parameters of each class to be initialized in the executable file; the initialization sequence parameters in the tag set are added to the tag set according to the merging attributes of multiple classes to be initialized set in the development environment, and the initialization sequence parameters of each class to be initialized are respectively set for multiple classes to be initialized in the application in the development environment.

[0043] In an optional implementation, the step of initializing the multiple classes to be initialized obtained based on the ContentProvider class in the executable file includes:

[0044] Based on the ContentProvider class in the executable file, initialize each of the obtained classes to be initialized according to the initialization sequence parameters of each class to be initialized in the tag set.

[0045] In a third aspect, the present application discloses a data processing device, the device includes:

[0046] A creation module, configured to create a content provider ContentProvider class in the development environment of the application;

[0047] A first setting module, configured to respectively set initialization attributes and merging attributes for merging into the ContentProvider class for multiple classes to be initialized in the application in the development environment; the multiple classes to be initialized include classes to be initialized in at least two components;

[0048] A first searching module, configured to search for the class names of each class to be initialized with the initialization attributes in the source code of the application in the development environment;

[0049] A generation module, configured to generate a tag set in the ContentProvider class in the development environment;

[0050] A first adding module, configured to add the class names of each class to be initialized to the tag set according to the merging attributes.

[0051] In an optional implementation manner, the first setting module includes:

[0052] A first generation unit, configured to generate a sub-manifest file of any class to be initialized among the multiple classes to be initialized in the development environment;

[0053] A second generation unit, configured to generate a first code segment of the merging attributes of the class to be initialized in the sub-manifest file, where the first code segment at least includes the class name of the ContentProvider class and a preset merging tag for indicating merging into the ContentProvider class according to the class name;

[0054] A third generation unit, configured to generate a second code segment of the initialization attributes of the class to be initialized in the sub-manifest file, where the second code segment at least includes the class name of the class to be initialized and a preset initialization tag for indicating that the class corresponding to the class name of the class to be initialized needs to be initialized.

[0055] In an optional implementation manner, the first searching module includes:

[0056] A first search unit, configured to separately search in sub - manifest files of each class in the source code to determine whether the preset initialization tag exists;

[0057] A first acquisition unit, configured to acquire the class name recorded in the second code segment in the sub - manifest file where the preset initialization tag exists, and use it as the class name of the class to be initialized.

[0058] In an optional implementation manner, the first addition module includes:

[0059] A second acquisition unit, configured to, for any one of the multiple classes to be initialized, acquire the class name of the ContentProvider class and the preset merge tag recorded in the first code segment in the sub - manifest file of the class to be initialized;

[0060] An addition unit, configured to add the class name of the class to be initialized to the tag set of the ContentProvider class according to the class name of the ContentProvider class and the preset merge tag.

[0061] In an optional implementation manner, the apparatus further includes:

[0062] A second setting module, configured to respectively set initialization sequence parameters for multiple classes to be initialized in the application program in the development environment.

[0063] In an optional implementation manner, the second setting module is specifically configured to: for any one of the multiple classes to be initialized, set the initialization sequence parameter bound to the class to be initialized in the development environment.

[0064] In an optional implementation manner, the apparatus further includes:

[0065] A second search module, configured to search for the initialization sequence parameters of each class to be initialized having the initialization attribute in the source code of the application program in the development environment.

[0066] In an optional implementation manner, the second search module includes:

[0067] A second search unit, configured to separately search in sub - manifest files of each class in the source code to determine whether the preset initialization tag exists;

[0068] A third search unit, configured to search for the initialization sequence parameter bound to the class to be initialized corresponding to the target class name in the source code, where the target class name includes the class name recorded in the second code segment in the sub - manifest file where the preset initialization tag exists.

[0069] In an alternative implementation, the apparatus further includes:

[0070] A second adding module, configured to add initialization sequence parameters of each class to be initialized in the tag set according to the merging attribute.

[0071] In an alternative implementation, the second adding module is specifically configured to: add a correspondence between the class name of the class to be initialized and the initialization sequence parameter bound to the class to be initialized in the tag set according to the class name of the ContentProvider class and the preset merging tag.

[0072] In a fourth aspect, the present application discloses a data processing apparatus, the apparatus includes:

[0073] A first obtaining module, configured to obtain a tag set in a ContentProvider class in the executable file during the process of starting an executable file of an application program;

[0074] Wherein, the tag set includes class names of multiple classes to be initialized in the executable file; the class names in the tag set include class names of classes with initialization attributes found in the source code of the application program in the development environment of the application program, the class names in the tag set are added to the tag set according to merging attributes of multiple classes to be initialized set in the development environment, and the initialization attributes of each class to be initialized and the merging attributes for merging into the ContentProvider class are respectively set for multiple classes to be initialized in the application program in the development environment;

[0075] A second obtaining module, configured to respectively obtain each class to be initialized in the executable file according to the class names of each class to be initialized in the tag set;

[0076] An initialization module, configured to respectively initialize the multiple classes to be initialized obtained based on the ContentProvider class in the executable file.

[0077] In an alternative implementation, the tag set further includes initialization sequence parameters of each class to be initialized in the executable file; the initialization sequence parameters in the tag set are added to the tag set according to merging attributes of multiple classes to be initialized set in the development environment, and the initialization sequence parameters of each class to be initialized are respectively set for multiple classes to be initialized in the application program in the development environment.

[0078] In an alternative implementation, the initialization module is specifically configured to: based on the ContentProvider class in the executable file, initialize each of the obtained classes to be initialized according to the initialization sequence parameters of each class to be initialized in the tag set.

[0079] In a fifth aspect, the present application discloses an electronic device, which includes:

[0080] A processor;

[0081] A memory for storing instructions executable by the processor;

[0082] Wherein, the processor is configured to execute the data processing method as described in the first aspect or the second aspect.

[0083] In a sixth aspect, the present application discloses a non-transitory computer-readable storage medium, when the instructions in the storage medium are executed by the processor of the electronic device, enabling the electronic device to execute the data processing method as described in the first aspect or the second aspect.

[0084] In a seventh aspect, the present application discloses a computer program product, when the instructions in the computer program product are executed by the processor of the electronic device, enabling the electronic device to execute the data processing method as described in the first aspect or the second aspect.

[0085] The technical solution provided by the present application may include the following beneficial effects:

[0086] In the present application, at least one ContentProvider class is created in the development environment of the application; initialization attributes and merging attributes for merging into the ContentProvider class are respectively set for multiple classes to be initialized in the application in the development environment; the multiple classes to be initialized include the classes to be initialized in at least two components; the class names of each class to be initialized with initialization attributes are found in the source code of the application in the development environment; a tag set is generated in the ContentProvider class in the development environment; and the class names of each class to be initialized are added to the tag set according to the merging attributes.

[0087] Through the present application, in the source code developed in the development environment of the application, by respectively setting initialization attributes for multiple classes to be initialized in the application, the electronic device can know which classes in the application are classes to be initialized according to the initialization attributes, and by respectively setting merging attributes for multiple classes to be initialized for merging into the ContentProvider class, multiple classes to be initialized are respectively bound to the ContentProvider class.

[0088] In this way, during the process of starting the executable file of the application, if multiple classes to be initialized need to be initialized separately in the executable file, it is not necessary to create a ContentProvider class for each class to be initialized separately, nor is it necessary to use multiple ContentProvider classes to handle each class to be initialized one by one. Instead, it is possible to obtain at least one tag set in the ContentProvider class in the executable file, obtain the class names of multiple classes to be initialized from the tag set in the ContentProvider class, obtain each class to be initialized separately in the executable file according to the class names of each class to be initialized in the tag set, and initialize each class to be initialized obtained based on the ContentProvider class in the executable file.

[0089] In this way, using a small number of (for example, only one) ContentProvider classes can complete the initialization of multiple classes to be initialized in the executable file, thereby reducing the number of ContentProvider classes created, saving the time for creating ContentProvider classes, saving system resources, and improving the efficiency of starting the executable file of the application. Description of the Drawings

[0090] Figure 1 is a flowchart of the steps of a data processing method of the present application.

[0091] Figure 2 is a flowchart of the steps of a data processing method of the present application.

[0092] Figure 3 is a flowchart of the steps of a data processing method of the present application.

[0093] Figure 4 is a flowchart of the steps of a data processing method of the present application.

[0094] Figure 5 is a block diagram of the structure of a data processing device of the present application.

[0095] Figure 6 is a block diagram of the structure of a data processing device of the present application.

[0096] Figure 7 is a block diagram of an electronic device shown in the present application.

[0097] Figure 8 is a block diagram of an electronic device shown in the present application. Detailed Embodiments

[0098] To make the above objects, features, and advantages of the present application more apparent and understandable, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0099] Refer to Figure 1 , which shows a step flowchart of a data processing method of the present application, applied to an electronic device. The method may specifically include the following steps:

[0100] In step S101, a ContentProvider class is created in the development environment of the application.

[0101] In the present application, a developer can start the development environment in the electronic device and develop the source code of the application in the development environment.

[0102] In one embodiment, the developer has developed a part of the source code of the application in the development environment. The developed source code may at least include multiple classes, and the multiple classes may include classes in different Library components, etc.

[0103] In the present application, the functions of different classes developed for the application are different, etc. Some classes need to be initialized in the executable file during the startup process of the application's executable file, and some classes do not need to be initialized in the executable file during the startup process of the application's executable file, but are enabled or called under specific requirements, services, or scenarios later.

[0104] Thus, it is necessary to set in the development environment which classes need to be initialized during the startup process of the executable file and the initialization method. Among them, for the initialization method, class initialization can be assisted by the ContentProvider class. In one example, class initialization can be assisted by one ContentProvider class, or by more than two ContentProvider classes (in this case, the number of more than two ContentProvider classes is less than the number of Library components where the classes to be initialized are located, etc.).

[0105] In one example, during the development stage, the developer can input a creation request in the development environment of the application to create at least one ContentProvider class in the development environment of the application. The electronic device can receive the creation request and then create at least one ContentProvider class in the development environment of the application according to the creation request.

[0106] In step S102, initialization attributes and merging attributes for merging into the ContentProvider class are respectively set for multiple classes to be initialized in the application in the development environment of the application. The multiple classes to be initialized include the classes to be initialized in at least two components.

[0107] In an embodiment of the present application, some classes in the application need to be initialized in the executable file during the startup process of the executable file of the application. Therefore, it is necessary to set in the development environment of the application which classes need to be initialized during the startup process of the executable file of the application.

[0108] The classes to be initialized may include classes in the Library component in the application, etc.

[0109] Specifically, a developer may input a first setting request in the development environment of the application for respectively setting initialization attributes for multiple classes to be initialized in the application in the development environment. The electronic device may receive the first setting request, and then respectively set the initialization attributes for multiple classes to be initialized in the application in the development environment according to the first setting request.

[0110] In another embodiment of the present application, since it is necessary to use the ContentProvider class to complete the initialization of multiple classes to be initialized in the executable file of the application, and the ContentProvider class and the multiple classes to be initialized in the executable file of the application are independent of each other, it is necessary to merge the class names of the multiple classes to be initialized into the ContentProvider class so that the ContentProvider class can initialize the multiple classes to be initialized in the executable file of the application according to the class names of the multiple classes to be initialized.

[0111] Specifically, a developer may input a second setting request in the development environment of the application for respectively setting merging attributes for merging into the ContentProvider class for multiple classes to be initialized in the application in the development environment. The electronic device may receive the second setting request, and then respectively set the merging attributes for merging into the ContentProvider class for multiple classes to be initialized in the application in the development environment according to the second setting request.

[0112] In one embodiment, when setting initialization attributes for multiple classes to be initialized in an application in a development environment and setting merging attributes for merging with a ContentProvider class for multiple classes to be initialized in the application in the development environment, for any one of the multiple classes to be initialized in the application, a sub-manifest file of the class to be initialized can be generated in the development environment, and then a first code segment of the merging attributes of the class to be initialized can be generated in the sub-manifest file of the class to be initialized. The first code segment at least includes the class name of the ContentProvider class and a preset merging tag for indicating merging with the ContentProvider class according to the class name of the ContentProvider class.

[0113] Among them, the class name of the ContentProvider class and the preset merging tag can reflect the merging attributes for merging with the ContentProvider class.

[0114] And, a second code segment of the initialization attributes of the class to be initialized can be generated in the sub-manifest file of the class to be initialized. The second code segment at least includes the class name of the class to be initialized and a preset initialization tag for indicating that the class to be initialized corresponding to the class name of the class to be initialized needs to be initialized.

[0115] Among them, the class name of the class to be initialized and the preset initialization tag can reflect the initialization attributes that the class to be initialized needs to be initialized during the startup of the executable file of the application.

[0116] In step S103, find the class names of each class to be initialized with initialization attributes in the source code of the application in the development environment.

[0117] The source code of the application developed in the development environment at least includes a ContentProvider class, multiple classes to be initialized, the initialization attributes of each class to be initialized, and the merging attributes of each class to be initialized for merging with the ContentProvider class. Of course, it may also include the code of other functions of the application, such as other classes that do not need to be initialized during the startup of the executable file of the application, etc., which will not be elaborated here.

[0118] In this application, after the developer finishes writing the source code of the application in the development environment, the developer can input a compilation request for compiling the source code of the application developed in the development environment in the electronic device. The electronic device can receive the compilation request and compile the source code of the application developed in the development environment according to the compilation request to obtain the executable file of the application.

[0119] Among them, in the sub-manifest file of the class to be initialized in the development environment, there are initialization attributes and merging attributes for merging into the ContentProvider class, etc.

[0120] In this way, during the process of the electronic device compiling the source code of the application developed in the development environment, the class to be initialized can be found in the source code. For example, the class to be initialized can be found in the source code according to the initialization attributes.

[0121] For example, for any class in the application, if there is a preset initialization tag in the sub-manifest file of this class, then this class is often the class to be initialized; if there is no preset initialization tag in the sub-manifest file of this class, then this class is often not the class to be initialized. The same is true for each of the other classes in the application.

[0122] Therefore, in this step, the electronic device can separately check whether there is a preset initialization tag in the sub-manifest files of each class in the source code of the application developed in the development environment. Then obtain the class name recorded in the second code segment of the sub-manifest file with the preset initialization tag, and use it as the class name of the class to be initialized. Then execute step S104.

[0123] In step S104, a tag set is generated in the ContentProvider class in the development environment, and the class names of each class to be initialized are added to the tag set according to the merging attributes of each class to be initialized.

[0124] In this application, for any one of the multiple classes to be initialized in the application, the class name of the ContentProvider class and the preset merging tag recorded in the first code segment of the sub-manifest file of this class to be initialized can be obtained.

[0125] Among them, according to the class name of the ContentProvider class and the preset merging tag recorded in the first code segment, it can be known that the class name of this class to be initialized needs to be merged into the ContentProvider class corresponding to the class name of the ContentProvider class.

[0126] In this way, the class name of this class to be initialized can be added to the tag set of the ContentProvider class according to the class name of the ContentProvider class and the preset merging tag.

[0127] For example, the tag set in the ContentProvider class can be found according to the class name of the ContentProvider class. The function of the preset merge tag can be used to indicate the merge function. For example, a merge function for merging the class name can be added to the ContentProvider class. The preset merge tags include "merge", etc. Therefore, it can be known from the preset merge tag that the class name of the class to be initialized can be added to the tag set of the ContentProvider class. In this way, the class name of the class to be initialized can be added to the tag set.

[0128] For each of the other classes to be initialized in the application, the above operations are also performed.

[0129] In this way, after the executable file of the application is compiled, the executable file has a ContentProvider class. The ContentProvider class has a tag set, and the tag set of the ContentProvider class has the class names of each class to be initialized in the application. For the case of starting the executable file of the application later, when it is necessary to initialize the class to be initialized in the executable file, the tag set in the ContentProvider class in the executable file can be obtained, the class names of multiple classes to be initialized can be obtained from the tag set in the ContentProvider class, and each class to be initialized can be obtained separately in the executable file according to the class names of each class to be initialized in the tag set. Each class to be initialized obtained based on the ContentProvider class is initialized in the executable file. Thus, the task of initializing multiple classes to be initialized in the executable file based on the ContentProvider class is achieved.

[0130] The specific initialization method can refer to Figure 2 the embodiments shown, which will not be elaborated here.

[0131] For each ContentProvider class, steps S102 to S104 are executed.

[0132] In this application, at least one ContentProvider class is created in the development environment of the application; initialization attributes and merge attributes for merging into the ContentProvider class are respectively set for multiple classes to be initialized in the development environment; the multiple classes to be initialized include the classes to be initialized in at least two components; the class names of each class to be initialized with initialization attributes are found in the source code of the application in the development environment; a tag set is generated in the ContentProvider class in the development environment; and the class names of each class to be initialized are added to the tag set according to the merge attributes.

[0133] Through the present application, in the source code developed in the development environment of the application, by respectively setting initialization attributes for multiple classes to be initialized in the application, the electronic device can know which classes in the application are classes to be initialized according to the initialization attributes, and by respectively setting merging attributes for the multiple classes to be initialized for merging with the ContentProvider class, the multiple classes to be initialized are respectively bound to the ContentProvider class.

[0134] In this way, during the process of starting the executable file of the application, if it is necessary to initialize multiple classes to be initialized in the executable file, it is not necessary to create a ContentProvider class for each class to be initialized respectively, nor to use multiple ContentProvider classes to process each class to be initialized one by one. Instead, it is possible to only obtain the tag set in at least one ContentProvider class in the executable file, obtain the class names of the multiple classes to be initialized from the tag set in the ContentProvider class, respectively obtain each class to be initialized in the executable file according to the class names of the multiple classes to be initialized in the tag set, and initialize each class to be initialized obtained based on the ContentProvider class in the executable file.

[0135] In this way, using a small number of (for example, only one) ContentProvider classes can complete the initialization of multiple classes to be initialized in the executable file, thereby reducing the number of ContentProvider classes created, saving the time for creating ContentProvider classes, saving system resources, and improving the efficiency of starting the executable file of the application.

[0136] Referring to Figure 2 , a step flowchart of a data processing method according to the present application is shown, which is applied to an electronic device. The method may specifically include the following steps:

[0137] In step S201, during the process of starting the executable file of the application, obtain the tag set in the ContentProvider class in the executable file.

[0138] Among them, the tag set includes the class names of multiple classes to be initialized in the executable file; the class names in the tag set include the class names of the classes with initialization attributes found in the source code of the application in the development environment of the application, and the class names in the tag set are added to the tag set according to the merging attributes of multiple classes to be initialized set in the development environment. The initialization attributes of each class to be initialized and the merging attributes for merging into the ContentProvider class are respectively set for multiple classes to be initialized in the application in the development environment.

[0139] In this application, during the process of running the executable file of the application in the electronic device, the electronic device can respectively initialize multiple classes to be initialized in the executable file of the application. When initializing, it can obtain the tag set in at least one ContentProvider class in the executable file of the application.

[0140] The tag set in the ContentProvider class can be located in the manifest file of the ContentProvider class.

[0141] In this application, when the executable file is started in the electronic device, the electronic device loads the executable file into the memory of the electronic device, and the electronic device can allocate a memory address for the executable file. For example, the memory address of the executable file can be the memory address between a certain address and another address in the memory, etc.

[0142] In this application, the memory address of the ContentProvider class in the executable file can be obtained by using methods such as class.self. Of course, the memory address of the ContentProvider class in the executable file can also be obtained through other methods, and this application does not limit the specific acquisition method.

[0143] After obtaining the memory address of the ContentProvider class, the electronic device can obtain the tag set in the ContentProvider class according to the memory address of the ContentProvider class, and then can execute step S202.

[0144] Among them, the method of obtaining the tag set in the ContentProvider class according to the memory address of the ContentProvider class includes:

[0145] 2011. Obtain the offset of the tag set in the ContentProvider class in the memory address of the ContentProvider class.

[0146] This step can be implemented through the following process, including:

[0147] 11) Determine the memory structure of the ContentProvider class.

[0148] In this application, the ContentProvider class often has multiple contents, and the positions of different contents in the ContentProvider class are often fixed. Therefore, the memory structure of the ContentProvider class is fixed.

[0149] 12) Determine the offset of the tag set in the memory address of the ContentProvider class according to the memory structure of the ContentProvider class.

[0150] In this application, the ContentProvider class has a memory address in the memory, which is allocated to the ContentProvider class when the electronic device allocates a memory address for the executable file. The offset of the tag set in the memory address of the ContentProvider class can be understood as: the distance between the starting memory address of the tag set in the ContentProvider class and the first address in the memory address of the ContentProvider class.

[0151] After the memory structure of the ContentProvider class is determined, it is determined what contents are included in the ContentProvider class in order, and the space sizes occupied by each content in the ContentProvider class are also determined.

[0152] In this way, the position order of the tag set in the ContentProvider class can be determined, and then it can be determined what contents are before the tag set in the ContentProvider class and the space sizes occupied by these contents respectively. Therefore, the offset of the tag set in the memory address of the ContentProvider class can be determined in the ContentProvider class according to what contents are before the tag set in the ContentProvider class and the space sizes occupied by these contents respectively.

[0153] 2012. Obtain the tag set in the ContentProvider class according to the offset.

[0154] In step S202, each class to be initialized is obtained separately in the executable file according to the class name of each class to be initialized in the tag set.

[0155] In this application, each class to be initialized in the tag set can be separately obtained in the executable file through reflection technology based on the class names of the classes to be initialized. Of course, each class to be initialized in the tag set can also be separately obtained in the executable file according to other methods. This application does not limit the specific obtaining method.

[0156] In step S203, each obtained class to be initialized is initialized based on the ContentProvider class in the executable file.

[0157] Through this application, in the source code developed in the development environment of the application, by separately setting initialization attributes for multiple classes to be initialized in the application, the electronic device can know which classes in the application are classes to be initialized according to the initialization attributes. And by separately setting merging attributes for the multiple classes to be initialized for merging with the ContentProvider class, the multiple classes to be initialized are separately bound to the ContentProvider class.

[0158] In this way, during the process of starting the executable file of the application, if it is necessary to separately initialize multiple classes to be initialized in the executable file, it is not necessary to separately create a ContentProvider class for each class to be initialized, nor is it necessary to use multiple ContentProvider classes to separately process each class to be initialized one by one. Instead, it is possible to only obtain the tag set in at least one ContentProvider class in the executable file, obtain the class names of the multiple classes to be initialized in the tag set of the ContentProvider class, separately obtain each class to be initialized in the executable file according to the class names of the classes to be initialized in the tag set, and initialize each obtained class to be initialized based on the ContentProvider class in the executable file.

[0159] In this way, the initialization of multiple classes to be initialized in the executable file can be completed using a small number (for example, only one can be used) of ContentProvider classes, thereby reducing the number of created ContentProvider classes, saving the time for creating ContentProvider classes, saving system resources, and improving the efficiency of starting the executable file of the application.

[0160] Refer to Figure 3 , which shows a flowchart of the steps of a data processing method of this application, applied to an electronic device. The method may specifically include the following steps:

[0161] In step S301, a ContentProvider class is created in the development environment of the application.

[0162] In this application, a developer can start a development environment in an electronic device and develop the source code of an application in the development environment.

[0163] In one embodiment, the developer has developed a part of the source code of the application in the development environment. The developed source code may at least include multiple classes, and the multiple classes may include classes in different Library components, etc.

[0164] In this application, the functions of different classes developed for the application are different, etc. Some classes need to be initialized in the executable file during the startup process of the application's executable file, and some classes do not need to be initialized in the executable file during the startup process of the application's executable file, but are enabled or called under specific requirements, services, or scenarios later, etc.

[0165] Thus, it is necessary to set in the development environment which classes need to be initialized during the startup process of the executable file and the initialization method. Among them, for the initialization method, class initialization can be achieved by means of the ContentProvider class. In one example, class initialization can be achieved by means of one ContentProvider class, or by means of more than two ContentProvider classes (in this case, the number of more than two ContentProvider classes is less than the number of Library components where the classes to be initialized are located, etc.).

[0166] In one example, during the development stage, the developer can input a creation request in the development environment of the application to create at least one ContentProvider class in the development environment of the application. The electronic device can receive the creation request and then create at least one ContentProvider class in the development environment of the application according to the creation request.

[0167] In step S302, initialization attributes, initialization sequence parameters, and merging attributes for merging into the ContentProvider class are respectively set for multiple classes to be initialized in the application in the development environment of the application. The multiple classes to be initialized include classes to be initialized in at least two components.

[0168] In one embodiment of this application, some classes in the application need to be initialized in the executable file during the startup process of the application's executable file. Therefore, it is necessary to set in the development environment of the application which classes need to be initialized during the startup process of the application's executable file.

[0169] The classes to be initialized may include classes in the Library components of the application, etc.

[0170] Specifically, a developer may input a first setting request in the development environment of the application to respectively set initialization attributes for multiple classes to be initialized in the application in the development environment. The electronic device may receive the first setting request, and then respectively set the initialization attributes for the multiple classes to be initialized in the application in the development environment according to the first setting request.

[0171] In another embodiment of the present application, since it is necessary to use the ContentProvider class to complete the initialization of multiple classes to be initialized in the executable file of the application, and the ContentProvider class is independent of the multiple classes to be initialized in the executable file of the application, therefore, it is necessary to merge the class names of the multiple classes to be initialized into the ContentProvider class so that the ContentProvider class can initialize the multiple classes to be initialized in the executable file of the application according to the class names of the multiple classes to be initialized.

[0172] Specifically, a developer may input a second setting request in the development environment of the application to respectively set merging attributes for merging into the ContentProvider class for multiple classes to be initialized in the application in the development environment. The electronic device may receive the second setting request, and then respectively set the merging attributes for merging into the ContentProvider class for the multiple classes to be initialized in the application in the development environment according to the second setting request.

[0173] In another embodiment of the present application, since the initialization orders of the multiple classes to be initialized are not all the same, therefore, it is necessary to respectively set initialization order parameters for the multiple classes to be initialized in the application in the development environment, and the initialization order parameters may represent the priority of the initialization order, etc.

[0174] For example, the class to be initialized with a higher priority of the initialization order is initialized earlier, and the class to be initialized with a lower priority of the initialization order is initialized later.

[0175] The initialization order parameters include 0 to 255 in the order of decreasing priority. The initialization order parameter 0 has the highest priority, and the initialization order parameter 255 has the lowest priority.

[0176] Specifically, a developer may input a third setting request in the development environment of the application to respectively set initialization order parameters for multiple classes to be initialized in the application in the development environment. The electronic device may receive the third setting request, and then respectively set the initialization order parameters for the multiple classes to be initialized in the application in the development environment according to the third setting request.

[0177] In one embodiment, when setting initialization attributes for multiple classes to be initialized in an application, setting initialization sequence parameters for multiple classes to be initialized in an application, and setting merging attributes for merging into the ContentProvider class for multiple classes to be initialized in an application in a development environment, for any one of the multiple classes to be initialized in the application, the initialization sequence parameter bound to the class to be initialized can be set in the development environment. For example, the initialization sequence parameter of the class to be initialized can be set at the location where the source code of the class to be initialized is located in the development environment, and the class to be initialized can be bound to the set initialization sequence parameter through a specific string, etc.

[0178] And, a sub-manifest file of the class to be initialized can be generated in the development environment, and then a first code segment of the merging attribute of the class to be initialized can be generated in the sub-manifest file of the class to be initialized. The first code segment at least includes the class name of the ContentProvider class and a preset merging label for indicating merging into the ContentProvider class according to the class name of the ContentProvider class.

[0179] Among them, the class name of the ContentProvider class and the preset merging label can reflect the merging attribute for merging into the ContentProvider class.

[0180] And, a second code segment of the initialization attribute of the class to be initialized can be generated in the sub-manifest file of the class to be initialized. The second code segment at least includes the class name of the class to be initialized and a preset initialization label for indicating that the class to be initialized corresponding to the class name of the class to be initialized needs to be initialized.

[0181] Among them, the class name of the class to be initialized and the preset initialization label can reflect the initialization attribute that the class to be initialized needs to be initialized during the startup process of the executable file of the application.

[0182] In step S303, the class names of each class to be initialized with initialization attributes and the initialization sequence parameters of each class to be initialized are searched for in the source code of the application in the development environment.

[0183] The source code of the application developed in the development environment at least includes the ContentProvider class, multiple classes to be initialized, the initialization attributes of each class to be initialized, the initialization sequence parameters of each class to be initialized, and the merging attributes of each class to be initialized for merging into the ContentProvider class. Of course, it may also include the code for other functions of the application, such as other classes that do not need to be initialized during the startup of the executable file of the application, etc., which will not be elaborated here.

[0184] In this application, after the developer finishes writing the source code of the application in the development environment, the developer can input a compilation request for compiling the source code of the application developed in the development environment in the electronic device. The electronic device can receive the compilation request and compile the source code of the application developed in the development environment according to the compilation request to obtain the executable file of the application.

[0185] Among them, in the development environment, there are initialization sequence parameters for the classes to be initialized.

[0186] Among them, in the submanifest file of the class to be initialized in the development environment, there are initialization attributes and merging attributes for merging into the ContentProvider class, etc.

[0187] In this way, when the electronic device compiles the source code of the application developed in the development environment, it can search for the classes to be initialized in the source code. For example, search for the classes to be initialized according to the initialization attributes in the source code.

[0188] For example, for any class in the application, if there is a preset initialization label in the submanifest file of this class, then this class is often a class to be initialized. If there is no preset initialization label in the submanifest file of this class, then this class is often not a class to be initialized. The same applies to each of the other classes in the application.

[0189] Therefore, in this step, the electronic device can separately search for whether there is a preset initialization label in the submanifest files of each class in the source code of the application developed in the development environment. Then obtain the class name recorded in the second code segment of the submanifest file with the preset initialization label and use it as the class name of the class to be initialized. And search for the initialization sequence parameter bound to the class to be initialized corresponding to the class name in the source code. Then execute step S304.

[0190] Among them, the initialization sequence parameter of the class to be initialized can be found at the location where the source code of the class to be initialized is located in the development environment. For example, in the location where the source code of the class to be initialized is located in the development environment, the initialization sequence parameter bound to the class to be initialized can be found through a specific string.

[0191] In step S304, a tag set is generated in the ContentProvider class in the development environment, and the class name of each class to be initialized and the initialization sequence parameter of each class to be initialized are added to the tag set according to the combined attributes of each class to be initialized.

[0192] In this application, for any one of the multiple classes to be initialized in the application, the class name of the ContentProvider class and the preset merge tag recorded in the first code segment in the sub-manifest file of the class to be initialized can be obtained.

[0193] Among them, according to the class name of the ContentProvider class and the preset merge tag recorded in the first code segment, it can be known that the class name of the class to be initialized and the initialization sequence parameter of the class to be initialized need to be merged into the ContentProvider class corresponding to the class name of the ContentProvider class. In this way, the tag set in the ContentProvider class can be found according to the class name of the ContentProvider class. The class name of the class to be initialized and the initialization sequence parameter of the class to be initialized are added to the tag set in the ContentProvider class.

[0194] For example, the tag set in the ContentProvider class can be found according to the class name of the ContentProvider class. The function of the preset merge tag can be used to indicate the merge function. For example, it can be the merge function of merging class names into the ContentProvider class. The preset merge tag includes "merge", etc. Therefore, according to the preset merge tag, it can be known that the class name of the class to be initialized can be added to the tag set in the ContentProvider class. In this way, the corresponding relationship between the class name of the class to be initialized and the initialization sequence parameter bound to the class to be initialized can be added to the tag set.

[0195] For each of the other classes to be initialized in the application, the above operations are also performed.

[0196] Thus, after compiling to obtain the executable file of the application, there is at least one ContentProvider class in the executable file. The ContentProvider class has a tag set, and the tag set of the ContentProvider class has the class names of each class to be initialized in the application and the initialization order parameters of each class to be initialized, so that when starting the executable file of the application later, when it is necessary to initialize multiple classes to be initialized in the executable file, the tag set in at least one ContentProvider class in the executable file can be obtained, the class names of each class to be initialized and the initialization order parameters of each class to be initialized are obtained from the tag set in the ContentProvider class, each class to be initialized is respectively obtained in the executable file according to the class names of each class to be initialized in the tag set, and based on the ContentProvider class in the executable file, according to the initialization order parameters of each class to be initialized in the tag set, each obtained class to be initialized is respectively initialized. Thus, the task of initializing multiple classes to be initialized in the executable file based on the ContentProvider class according to the actual order requirements is realized.

[0197] Among them, for each ContentProvider class, steps S302 to S304 are executed.

[0198] The specific initialization method can refer to Figure 2 the embodiments shown, and details are not described here.

[0199] In this application, at least one ContentProvider class is created in the development environment of the application. In the development environment of the application, initialization attributes, initialization order parameters, and merging attributes for merging into the ContentProvider class are respectively set for multiple classes to be initialized in the application. The multiple classes to be initialized include the classes to be initialized in at least two components. The class names of each class to be initialized with initialization attributes and the initialization order parameters of each class to be initialized are found in the source code of the application in the development environment. A tag set is generated in the ContentProvider class in the development environment, and the class names of each class to be initialized and the initialization order parameters of each class to be initialized are added to the tag set according to the merging attributes of each class to be initialized.

[0200] Through the present application, in the source code developed in the development environment of an application, by respectively setting initialization attributes for multiple classes to be initialized in the application, so that the electronic device can know which classes in the application are classes to be initialized according to the initialization attributes, by respectively setting initialization sequence parameters for the multiple classes to be initialized, so that the electronic device can know the initialization sequence of each class to be initialized according to the initialization sequence parameters of each class to be initialized, and by respectively setting merging attributes for the multiple classes to be initialized for merging with the ContentProvider class, so that the multiple classes to be initialized are respectively bound to the ContentProvider class.

[0201] In this way, during the process of starting the executable file of the application, if it is necessary to initialize multiple classes to be initialized in the executable file respectively, it is not necessary to create a ContentProvider class for each class to be initialized respectively, nor is it necessary to use multiple ContentProvider classes to process each class to be initialized one by one. Instead, it is possible to only obtain the tag set in at least one ContentProvider class in the executable file, obtain the class names of each class to be initialized and the initialization sequence parameters of each class to be initialized from the tag set in the ContentProvider class, respectively obtain each class to be initialized in the executable file according to the class names of each class to be initialized in the tag set, and initialize each obtained class to be initialized in the executable file based on the ContentProvider class according to the initialization sequence parameters of each class to be initialized in the tag set.

[0202] In this way, using a small number (such as only one, etc.) of ContentProvider classes can complete the initialization of multiple classes to be initialized in the executable file, thereby reducing the number of ContentProvider classes created, saving the time for creating ContentProvider classes, saving system resources and improving the efficiency of starting the executable file of the application.

[0203] Secondly, by initializing each to-be-initialized class obtained according to the initialization sequence parameters of each to-be-initialized class, it is possible to initialize each to-be-initialized class in sequence according to the actual sequence requirements. And it is not necessary to "record the class name of another to-be-initialized class in a to-be-initialized class in the source code of the application program to indicate that this arbitrary to-be-initialized class is initialized only after the other to-be-initialized class corresponding to the class name is initialized", and the initialization sequence parameters of each to-be-initialized class in the source code only represent its own initialization sequence and have nothing to do with the initialization sequences of other to-be-initialized classes. Therefore, the coupling between each to-be-initialized class in the source code of the application program can be reduced, the dependency relationship between each to-be-initialized class in the source code of the application program can be simplified, and further the maintenance cost of the source code of the application program in the later stage can be reduced.

[0204] Refer to Figure 4 , which shows a flowchart of the steps of a data processing method of the present application, applied to an electronic device. The method may specifically include the following steps:

[0205] In step S401, during the process of starting the executable file of the application program, obtain the tag set in the ContentProvider class in the executable file. The tag set includes the class names of multiple to-be-initialized classes in the executable file and the initialization sequence parameters of each to-be-initialized class.

[0206] Among them, the class names in the tag set include the class names of the classes with initialization attributes found in the source code of the application program in the development environment of the application program. The class names and initialization sequence parameters in the tag set are added to the tag set according to the merging attributes of multiple to-be-initialized classes set in the development environment. The initialization attributes, initialization sequence parameters, and merging attributes for merging into the ContentProvider class of each to-be-initialized class are respectively set for multiple to-be-initialized classes in the application program in the development environment.

[0207] In the present application, during the process of running the executable file of the application program in the electronic device, the electronic device can initialize multiple to-be-initialized classes of the executable file of the application program respectively. When initializing, it can obtain the tag set in at least one ContentProvider class in the executable file of the application program.

[0208] The tag set in the ContentProvider class can be located in the manifest file of the ContentProvider class.

[0209] In this application, when an executable file is launched in an electronic device, the electronic device loads the executable file into the memory of the electronic device, and the electronic device can allocate a memory address for the executable file. For example, the memory address of the executable file can be the memory address between a certain address and another address in the memory, etc.

[0210] In this application, the memory address of the ContentProvider class in the executable file can be obtained by using methods such as class.self. Of course, the memory address of the ContentProvider class in the executable file can also be obtained by other means, and this application does not limit the specific obtaining method.

[0211] After obtaining the memory address of the ContentProvider class, the electronic device can obtain the tag set in the ContentProvider class according to the memory address of the ContentProvider class, and then step S402 can be executed.

[0212] Among them, the method of obtaining the tag set in the ContentProvider class according to the memory address of the ContentProvider class includes:

[0213] 4011. Obtain the offset of the tag set in the ContentProvider class in the memory address of the ContentProvider class.

[0214] This step can be implemented through the following process, including:

[0215] 11). Determine the memory structure of the ContentProvider class.

[0216] In this application, the ContentProvider class often has multiple contents, and the positions of different contents in the ContentProvider class are often fixed. Therefore, the memory structure of the ContentProvider class is fixed.

[0217] 12). Determine the offset of the tag set in the memory address of the ContentProvider class according to the memory structure of the ContentProvider class.

[0218] In this application, the ContentProvider class has a memory address in memory, which is allocated to the ContentProvider class when the electronic device allocates a memory address for the executable file. The offset of the tag set in the memory address of the ContentProvider class can be understood as: the distance between the starting memory address of the tag set in the ContentProvider class and the first address in the memory address of the ContentProvider class.

[0219] After the memory structure of the ContentProvider class is determined, what contents are included in the ContentProvider class in sequence is determined, and the space size occupied by each content in the ContentProvider class is also determined.

[0220] In this way, the position order of the tag set in the ContentProvider class can be determined. Furthermore, what contents are before the tag set in the ContentProvider class and the space size occupied by each of these contents can be determined. Therefore, according to what contents are before the tag set in the ContentProvider class and the space size occupied by each of these contents, the offset of the tag set in the memory address of the ContentProvider class can be determined in the ContentProvider class.

[0221] 4012. Obtain the tag set in the ContentProvider class according to the offset.

[0222] In step S402, each class to be initialized is obtained separately in the executable file according to the class name of each class to be initialized in the tag set.

[0223] In this application, each class to be initialized can be obtained separately in the executable file according to the class name of each class to be initialized in the tag set through reflection technology. Of course, each class to be initialized can also be obtained separately in the executable file according to other methods. This application does not limit the specific obtaining method.

[0224] In step S403, based on the ContentProvider class in the executable file, each obtained class to be initialized is initialized respectively according to the initialization sequence parameter of each class to be initialized in the tag set.

[0225] In this application, the classes to be initialized with the same initialization sequence parameter are combined into a class set.

[0226] For any class set, when there are at least two classes to be initialized included in the class set, allocate at least two threads for the class set; for example, when the executable file has a main thread, at least one child thread can be generated. The main thread and at least one child thread can be used to initialize the classes to be initialized included in the class set respectively. In this way, the at least two threads can be used to initialize the classes to be initialized included in the class set respectively.

[0227] In addition, after initializing the classes to be initialized included in the class set, the at least two threads allocated for the class set can be recycled to save threads and thus save system resources, and it can also avoid thread chaos.

[0228] The same applies to every other class set.

[0229] In this way, the time required to initialize multiple classes to be initialized can be reduced, and the initialization efficiency can be improved.

[0230] Through this application, in the source code developed in the development environment of the application, by setting initialization attributes for multiple classes to be initialized in the application respectively, the electronic device can know which classes in the application are classes to be initialized according to the initialization attributes. By setting initialization sequence parameters for multiple classes to be initialized respectively, the electronic device can know the initialization sequence of each class to be initialized according to the initialization sequence parameters of each class to be initialized. And by setting merging attributes for multiple classes to be initialized respectively for merging with the ContentProvider class, multiple classes to be initialized are bound to the ContentProvider class respectively.

[0231] In this way, when starting the executable file of the application, if it is necessary to initialize multiple classes to be initialized in the executable file, it is not necessary to create a ContentProvider class for each class to be initialized respectively, nor is it necessary to use multiple ContentProvider classes to process each class to be initialized one by one. It is only necessary to obtain the tag set in at least one ContentProvider class in the executable file, obtain the class names of each class to be initialized and the initialization sequence parameters of each class to be initialized in the tag set of the ContentProvider class, obtain each class to be initialized respectively in the executable file according to the class names of each class to be initialized in the tag set, and initialize each obtained class to be initialized in the executable file based on the ContentProvider class according to the initialization sequence parameters of each class to be initialized in the tag set.

[0232] In this way, by using a small number of (e.g., only one) ContentProvider classes, the initialization of multiple classes to be initialized in the executable file can be completed, thereby reducing the number of ContentProvider classes created, saving the time for creating ContentProvider classes, saving system resources, and improving the efficiency of starting the executable file of the application.

[0233] Secondly, by initializing each class to be initialized obtained according to the initialization sequence parameters of each class to be initialized respectively, it is possible to initialize each class to be initialized in sequence according to the actual sequence requirements. And it is not necessary to "record the class name of another class to be initialized in a class to be initialized in the source code of the application to indicate that this arbitrary class to be initialized is initialized after the other class to be initialized corresponding to the class name is initialized", and the initialization sequence parameters of each class to be initialized in the source code only represent their own initialization sequence and have nothing to do with the initialization sequences of other classes to be initialized. Thus, the coupling between each class to be initialized in the source code of the application can be reduced, the dependency relationship between each class to be initialized in the source code of the application can be simplified, and further the maintenance cost of the source code of the application in the later stage can be reduced.

[0234] It should be noted that for the method embodiments, for simplicity of description, they are all expressed as a series of action combinations. However, those skilled in the art should know that this application is not limited by the described action sequences, because according to this application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all optional embodiments, and the actions involved are not necessarily required by this application.

[0235] Refer to Figure 5 , which shows a structural block diagram of a data processing device of this application. The device may specifically include the following modules:

[0236] A creation module 11, configured to create a content provider ContentProvider class in the development environment of the application;

[0237] A first setting module 12, configured to respectively set initialization attributes and merging attributes for merging into the ContentProvider class for multiple classes to be initialized in the application in the development environment; the multiple classes to be initialized include classes to be initialized in at least two components;

[0238] A first searching module 13, configured to search for the class names of each class to be initialized with the initialization attribute in the source code of the application in the development environment;

[0239] A generation module 14, configured to generate a tag set in the ContentProvider class in the development environment;

[0240] A first addition module 15, configured to add the class names of the respective classes to be initialized to the tag set according to the merging attributes.

[0241] In an optional implementation, the first setting module includes:

[0242] A first generation unit, configured to generate a submanifest file of any class to be initialized in the development environment for any one of the multiple classes to be initialized;

[0243] A second generation unit, configured to generate a first code segment of the merging attributes of the class to be initialized in the submanifest file, where the first code segment at least includes the class name of the ContentProvider class and a preset merging tag for indicating merging to the ContentProvider class according to the class name;

[0244] A third generation unit, configured to generate a second code segment of the initialization attributes of the class to be initialized in the submanifest file, where the second code segment at least includes the class name of the class to be initialized and a preset initialization tag for indicating that the class corresponding to the class name of the class to be initialized needs to be initialized.

[0245] In an optional implementation, the first search module includes:

[0246] A first search unit, configured to separately search whether the preset initialization tag exists in the submanifest files in each class in the source code;

[0247] A first acquisition unit, configured to acquire the class name recorded in the second code segment in the submanifest file where the preset initialization tag exists, and use it as the class name of the class to be initialized.

[0248] In an optional implementation, the first addition module includes:

[0249] A second acquisition unit, configured to acquire the class name of the ContentProvider class and the preset merging tag recorded in the first code segment in the submanifest file of any class to be initialized for any one of the multiple classes to be initialized;

[0250] An addition unit, configured to add the class name of the class to be initialized to the tag set of the ContentProvider class according to the class name of the ContentProvider class and the preset merging tag.

[0251] In an alternative implementation, the apparatus further comprises:

[0252] A second setting module, configured to set initialization sequence parameters for multiple classes to be initialized in the application program in the development environment.

[0253] In an alternative implementation, the second setting module is specifically configured to: for any class to be initialized among the multiple classes to be initialized, set the initialization sequence parameter bound to the class to be initialized in the development environment.

[0254] In an alternative implementation, the apparatus further comprises:

[0255] A second search module, configured to search for the initialization sequence parameters of each class to be initialized having the initialization attribute in the source code of the application program in the development environment.

[0256] In an alternative implementation, the second search module comprises:

[0257] A second search unit, configured to separately search for whether the preset initialization tag exists in the submanifest files of each class in the source code;

[0258] A third search unit, configured to search for the initialization sequence parameter bound to the class to be initialized corresponding to the target class name in the source code, where the target class name includes the class name recorded in the second code segment in the submanifest file where the preset initialization tag exists.

[0259] In an alternative implementation, the apparatus further comprises:

[0260] A second adding module, configured to add the initialization sequence parameters of each class to be initialized to the tag set according to the merging attribute.

[0261] In an alternative implementation, the second adding module is specifically configured to: add the correspondence between the class name of the class to be initialized and the initialization sequence parameter bound to the class to be initialized to the tag set according to the class name of the ContentProvider class and the preset merging tag.

[0262] In the present application, a ContentProvider class is created in the development environment of the application; initialization attributes and merging attributes for merging into the ContentProvider class are respectively set for multiple classes to be initialized in the application in the development environment; the multiple classes to be initialized include the classes to be initialized in at least two components; the class names of the respective classes to be initialized with initialization attributes are found in the source code of the application in the development environment; a tag set is generated in the ContentProvider class in the development environment; and the class names of the respective classes to be initialized are added to the tag set according to the merging attributes.

[0263] Through the present application, in the source code developed in the development environment of the application, by respectively setting initialization attributes for multiple classes to be initialized in the application, the electronic device can know which classes in the application are the classes to be initialized according to the initialization attributes, and by respectively setting merging attributes for the multiple classes to be initialized for merging into the ContentProvider class, the multiple classes to be initialized are respectively bound to the ContentProvider class.

[0264] In this way, during the process of starting the executable file of the application, if it is necessary to respectively initialize multiple classes to be initialized in the executable file, it is not necessary to respectively create a ContentProvider class for each class to be initialized, nor is it necessary to use multiple ContentProvider classes to respectively process each class to be initialized one by one. Instead, at least one tag set in the ContentProvider class in the executable file can be obtained, the class names of the multiple classes to be initialized are obtained from the tag set in the ContentProvider class, the respective classes to be initialized are respectively obtained in the executable file according to the class names of the respective classes to be initialized in the tag set, and the respective classes to be initialized obtained based on the initialization of the ContentProvider class are initialized in the executable file.

[0265] In this way, the initialization of multiple classes to be initialized in the executable file can be completed by using a small number of (for example, only one) ContentProvider classes, thereby reducing the number of ContentProvider classes to be created, saving the time for creating ContentProvider classes, saving system resources, and improving the efficiency of starting the executable file of the application.

[0266] Refer to Figure 6 , which shows a structural block diagram of a data processing device according to the present application. The device may specifically include the following modules:

[0267] The first acquisition module 21 is configured to acquire a tag set in a ContentProvider class in the content of the executable file during the process of starting the executable file of the application program;

[0268] Wherein, the tag set includes class names of multiple classes to be initialized in the executable file; the class names in the tag set include class names of classes with initialization attributes found in the source code of the application program in the development environment of the application program, and the class names in the tag set are added to the tag set according to the merging attributes of multiple classes to be initialized set in the development environment. The initialization attributes of each class to be initialized and the merging attributes for merging into the ContentProvider class are respectively set for multiple classes to be initialized in the application program in the development environment;

[0269] The second acquisition module 22 is configured to respectively acquire each class to be initialized in the executable file according to the class names of each class to be initialized in the tag set;

[0270] The initialization module 23 is configured to respectively initialize the multiple classes to be initialized acquired based on the ContentProvider class in the executable file.

[0271] In an optional implementation manner, the tag set further includes initialization sequence parameters of each class to be initialized in the executable file; the initialization sequence parameters in the tag set are added to the tag set according to the merging attributes of multiple classes to be initialized set in the development environment, and the initialization sequence parameters of each class to be initialized are respectively set for multiple classes to be initialized in the application program in the development environment.

[0272] In an optional implementation manner, the initialization module is specifically configured to: respectively initialize each class to be initialized acquired based on the ContentProvider class in the executable file according to the initialization sequence parameters of each class to be initialized in the tag set.

[0273] Through the present application, in the source code developed in the development environment of the application program, by respectively setting initialization attributes for multiple classes to be initialized in the application program, the electronic device can know which classes in the application program are classes to be initialized according to the initialization attributes, and by respectively setting merging attributes for merging into the ContentProvider class for multiple classes to be initialized, multiple classes to be initialized are respectively bound to the ContentProvider class.

[0274] In this way, during the process of starting the executable file of the application, if it is necessary to initialize multiple classes to be initialized in the executable file respectively, it is not necessary to create a ContentProvider class for each class to be initialized, nor to use multiple ContentProvider classes to process each class to be initialized one by one. Instead, it is possible to only obtain the tag set in at least one ContentProvider class in the executable file, obtain the class names of multiple classes to be initialized from the tag set in the ContentProvider class, obtain each class to be initialized in the executable file according to the class names of the classes to be initialized in the tag set, and initialize each class to be initialized obtained based on the ContentProvider class in the executable file.

[0275] In this way, using a small number of (for example, only one) ContentProvider classes can complete the initialization of multiple classes to be initialized in the executable file, thereby reducing the number of ContentProvider classes created, saving the time for creating ContentProvider classes, saving system resources, and improving the efficiency of starting the executable file of the application.

[0276] For the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiment.

[0277] Figure 7 It is a block diagram of an electronic device 800 shown in the present application. For example, the electronic device 800 can be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

[0278] Referring to Figure 7 , the electronic device 800 may include one or more of the following components: a processing component 802, a memory 804, a power component 806, a multimedia component 808, an audio component 810, an input / output (I / O) interface 812, a sensor component 814, and a communication component 816.

[0279] The processing component 802 generally controls the overall operation of the electronic device 800, such as operations associated with display, telephone call, data communication, camera operation, and recording operation. The processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above method. In addition, the processing component 802 may include one or more modules to facilitate the interaction between the processing component 802 and other components. For example, the processing component 802 may include a multimedia module to facilitate the interaction between the multimedia component 808 and the processing component 802.

[0280] The memory 804 is configured to store various types of data to support the operation of the device 800. Examples of such data include instructions for any application or method operating on the electronic device 800, contact data, phone book data, messages, images, videos, and the like. The memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, a magnetic disk, or an optical disk.

[0281] The power supply component 806 provides power to various components of the electronic device 800. The power supply component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the electronic device 800.

[0282] The multimedia component 808 includes a screen that provides an output interface between the electronic device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen can be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors can not only sense the boundaries of the touch or swipe actions but also detect the duration and pressure associated with the touch or swipe operation. In some embodiments, the multimedia component 808 includes a front camera and / or a rear camera. When the device 800 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera can receive external multimedia data. Each of the front camera and the rear camera can be a fixed optical lens system or have a focal length and optical zoom capabilities.

[0283] The audio component 810 is configured to output and / or input audio signals. For example, the audio component 810 includes a microphone (MIC) that is configured to receive external audio signals when the electronic device 800 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals can be further stored in the memory 804 or transmitted via the communication component 816. In some embodiments, the audio component 810 further includes a speaker for outputting audio signals.

[0284] The I / O interface 812 provides an interface between the processing component 802 and a peripheral interface module, which can be a keyboard, a click wheel, buttons, etc. These buttons can include, but are not limited to: a home button, a volume button, a power-on button, and a lock button.

[0285] The sensor assembly 814 includes one or more sensors for providing an assessment of various aspects of the status of the electronic device 800. For example, the sensor assembly 814 can detect the on / off state of the device 800, the relative positioning of components, such as the display and keypad of the electronic device 800. The sensor assembly 814 can also detect a change in the position of the electronic device 800 or a component of the electronic device 800, the presence or absence of user contact with the electronic device 800, the orientation or acceleration / deceleration of the electronic device 800, and a change in the temperature of the electronic device 800. The sensor assembly 814 can include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 814 can also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 can also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0286] The communication component 816 is configured to facilitate communication between the electronic device 800 and other devices in a wired or wireless manner. The electronic device 800 can access a wireless network based on communication standards, such as WiFi, a carrier network (such as 2G, 3G, 4G, or 5G), or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast operation information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 further includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.

[0287] In an exemplary embodiment, the electronic device 800 can be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components for performing the above-described method.

[0288] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions, such as a memory 804 including instructions, is also provided. The above instructions can be executed by the processor 820 of the electronic device 800 to complete the above-described method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device, etc.

[0289] Figure 8is a block diagram of an electronic device 1900 shown in the present application. For example, the electronic device 1900 may be provided as a server.

[0290] Referring to Figure 8 , the electronic device 1900 includes a processing component 1922, which further includes one or more processors, and memory resources represented by a memory 1932 for storing instructions executable by the processing component 1922, such as application programs. The application programs stored in the memory 1932 may include one or more modules each corresponding to a set of instructions. In addition, the processing component 1922 is configured to execute instructions to perform the above method.

[0291] The electronic device 1900 may also include a power component 1926 configured to perform power management of the electronic device 1900, a wired or wireless network interface 1950 configured to connect the electronic device 1900 to a network, and an input / output (I / O) interface 1958. The electronic device 1900 may operate based on an operating system stored in the memory 1932, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM or the like.

[0292] Each embodiment in this specification is described in a progressive manner. The key point of each embodiment is to illustrate the differences from other embodiments. The same or similar parts among the embodiments can be referred to each other.

[0293] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a device, or a computer program product. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk memory, CD-ROM, optical memory, etc.) containing computer-usable program code.

[0294] The present application is described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the present application. It should be understood that each process and / or block in the flowcharts and / or block diagrams, and the combination of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to the processors of general-purpose computers, special-purpose computers, embedded processors, or other programmable data processing terminal devices to generate a machine, so that the instructions executed by the processors of the computer or other programmable data processing terminal devices generate for implementing in the process Figure 1 a process or multiple processes and / or blocks Figure 1means for the functions specified in one or more boxes.

[0295] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal device to work in a specific manner, such that the instructions stored in the computer-readable memory produce a manufactured article including an instruction means that implements the functions specified in one Figure 1 one process or more processes and / or boxes Figure 1 one box or more boxes.

[0296] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device, such that a series of operation steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable terminal device provide steps for implementing the functions specified in one Figure 1 one process or more processes and / or boxes Figure 1 one box or more boxes.

[0297] Although the preferred embodiments of the present application have been described, those skilled in the art can make additional changes and modifications once they learn the basic creative concepts. Therefore, the appended claims are intended to be construed as including the preferred embodiments and all changes and modifications falling within the scope of the present application.

[0298] Finally, it should also be noted that in this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, such that a process, method, article or terminal device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or also includes elements inherent to such process, method, article or terminal device. Without further limitation, an element defined by the statement "including one..." does not exclude the presence of additional identical elements in the process, method, article or terminal device including the said element.

[0299] The above has introduced in detail a data processing method, device, electronic device and storage medium provided by the present application. Specific examples are used in this article to elaborate on the principle and implementation manner of the present application. The description of the above embodiments is only used to help understand the method and its core idea of the present application; at the same time, for those of ordinary skill in the art, according to the idea of the present application, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to the present application.

Claims

1. A data processing method, characterized in that, the method includes: creating a ContentProvider class in the development environment of the application; respectively setting initialization attributes and merging attributes for merging into the ContentProvider class for multiple classes to be initialized in the application in the development environment; the multiple classes to be initialized include classes to be initialized in at least two components; finding the class names of the respective classes to be initialized with the initialization attributes in the sub-manifest files in each class in the source code of the application in the development environment; generating a tag set in the ContentProvider class in the development environment, and the tag set is located in the manifest file of the ContentProvider class; adding the class names of the respective classes to be initialized to the tag set according to the merging attributes; the step of respectively setting initialization attributes and merging attributes for merging into the ContentProvider class for multiple classes to be initialized in the application in the development environment includes: for any one of the multiple classes to be initialized, generating a sub-manifest file of the class to be initialized in the development environment; generating a first code segment of the merging attribute of the class to be initialized in the sub-manifest file; generating a second code segment of the initialization attribute of the class to be initialized in the sub-manifest file.

2. The method according to claim 1, characterized in that, at least the class name of the ContentProvider class and a preset merging tag for indicating merging into the ContentProvider class according to the class name are included in the first code segment; at least the class name of the class to be initialized and a preset initialization tag for indicating that the class corresponding to the class name of the class to be initialized needs to be initialized are included in the second code segment.

3. The method according to claim 2, characterized in that, the step of finding the class names of the respective classes to be initialized with the initialization attributes in the source code includes: respectively finding whether the preset initialization tag exists in the sub-manifest files in each class in the source code; acquiring the class name recorded in the second code segment in the sub-manifest file where the preset initialization tag exists, and using it as the class name of the class to be initialized.

4. The method according to claim 2, characterized in that, the step of adding the class names of the respective classes to be initialized to the tag set according to the merging attributes includes: for any one of the multiple classes to be initialized, acquiring the class name of the ContentProvider class and the preset merging tag recorded in the first code segment in the sub-manifest file of the class to be initialized; adding the class name of the class to be initialized to the tag set in the ContentProvider class according to the class name of the ContentProvider class and the preset merging tag.

5. The method according to claim 2, characterized in that, the method further includes: Set initialization sequence parameters for multiple classes to be initialized in the application program in the development environment respectively.

6. The method according to claim 5, wherein, the step of setting initialization sequence parameters for multiple classes to be initialized in the application program in the development environment respectively includes: For any class to be initialized among the multiple classes to be initialized, set the initialization sequence parameter bound to the class to be initialized in the development environment.

7. The method according to claim 5, wherein, the method further includes: Search for the initialization sequence parameters of each class to be initialized having the initialization attribute in the source code of the application program in the development environment.

8. The method according to claim 7, wherein, the step of searching for the initialization sequence parameters of each class to be initialized having the initialization attribute in the source code of the application program in the development environment includes: Respectively search in the sub-manifest files of each class in the source code to check if the preset initialization tag exists; Search in the source code for the initialization sequence parameter bound to the class to be initialized corresponding to the target class name, where the target class name includes the class name recorded in the second code segment in the sub-manifest file where the preset initialization tag exists.

9. The method according to claim 5, wherein, the method further includes: Add the initialization sequence parameters of each class to be initialized to the tag set according to the merging attribute.

10. The method according to claim 9, wherein, the step of adding the initialization sequence parameters of each class to be initialized to the tag set according to the merging attribute includes: According to the class name of the ContentProvider class and the preset merging tag, add the correspondence between the class name of the class to be initialized and the initialization sequence parameter bound to the class to be initialized to the tag set.

11. A data processing method, wherein, the method includes: During the process of starting the executable file of the application program, obtain the tag set in the ContentProvider class in the executable file, and the tag set is located in the manifest file of the ContentProvider class; Among them, the tag set includes the class names of multiple classes to be initialized in the executable file; the class names in the tag set include the class names of the classes with initialization attributes found in the sub-manifest files of each class in the source code of the application in the development environment of the application. The class names in the tag set are added to the tag set according to the merging attributes of multiple classes to be initialized set in the development environment. The initialization attributes of each class to be initialized and the merging attributes for merging into the ContentProvider class are respectively set for multiple classes to be initialized in the application in the development environment, including: for any one of the multiple classes to be initialized, generating a sub-manifest file of the class to be initialized in the development environment; generating a first code segment of the merging attributes of the class to be initialized in the sub-manifest file; generating a second code segment of the initialization attributes of the class to be initialized in the sub-manifest file; Respectively obtaining each class to be initialized in the executable file according to the class names of each class to be initialized in the tag set; Initializing the multiple classes to be initialized obtained respectively based on the ContentProvider class in the executable file.

12. The method according to claim 11, wherein, The tag set further includes the initialization sequence parameters of each class to be initialized in the executable file; the initialization sequence parameters in the tag set are added to the tag set according to the merging attributes of multiple classes to be initialized set in the development environment. The initialization sequence parameters of each class to be initialized are respectively set for multiple classes to be initialized in the application in the development environment.

13. The method according to claim 12, wherein, The initializing the multiple classes to be initialized obtained respectively based on the ContentProvider class in the executable file includes: Based on the ContentProvider class in the executable file, initializing each of the obtained classes to be initialized according to the initialization sequence parameters of each class to be initialized in the tag set.

14. A data processing device, wherein, The device includes: A creation module for creating a content provider ContentProvider class in the development environment of the application; A first setting module for respectively setting initialization attributes and merging attributes for merging into the ContentProvider class for multiple classes to be initialized in the application in the development environment; the multiple classes to be initialized include the classes to be initialized in at least two components; A first searching module for searching for the class names of each class to be initialized with the initialization attributes in the sub-manifest files of each class in the source code of the application in the development environment; A generation module, configured to generate a tag set in the ContentProvider class in the development environment, where the tag set is located in the manifest file of the ContentProvider class; A first addition module, configured to add the class names of respective classes to be initialized to the tag set according to the merging attribute; The first setting module includes: A first generation unit, configured to generate a sub-manifest file of any class to be initialized among the multiple classes to be initialized in the development environment; A second generation unit, configured to generate a first code segment of the merging attribute of the class to be initialized in the sub-manifest file; A third generation unit, configured to generate a second code segment of the initialization attribute of the class to be initialized in the sub-manifest file.

15. A data processing device, characterized in that the device includes: A first acquisition module, configured to acquire a tag set in a ContentProvider class in an executable file of an application program during the process of starting the executable file, where the tag set is located in the manifest file of the ContentProvider class; wherein, the tag set includes the class names of multiple classes to be initialized in the executable file; the class names in the tag set include the class names of classes having initialization attributes found in sub-manifest files of respective classes in the source code of the application program in the development environment of the application program, the class names in the tag set are added to the tag set according to the merging attributes of multiple classes to be initialized set in the development environment, the initialization attributes of respective classes to be initialized and the merging attributes for merging into the ContentProvider class are respectively set for multiple classes to be initialized in the application program in the development environment, including: for any class to be initialized among the multiple classes to be initialized, generating a sub-manifest file of the class to be initialized in the development environment; generating a first code segment of the merging attribute of the class to be initialized in the sub-manifest file; generating a second code segment of the initialization attribute of the class to be initialized in the sub-manifest file; A second acquisition module, configured to respectively acquire the respective classes to be initialized in the executable file according to the class names of the respective classes to be initialized in the tag set; An initialization module, configured to respectively initialize the multiple acquired classes to be initialized based on the ContentProvider class in the executable file.

16. An electronic device, characterized in that the electronic device includes: a processor; a memory for storing processor-executable instructions; wherein, the processor is configured to execute the data processing method according to any one of claims 1-13.

17. A non-transitory computer-readable storage medium, when instructions in the storage medium are executed by a processor of an electronic device, enabling the electronic device to execute the data processing method according to any one of claims 1-13.