Channel information reporting method, electronic device, storage medium and program product

By reading and saving channel information when installing pre-installed applications from the installation package stored before the electronic device is first powered on and shipped from the factory, the problem of inaccurate server statistics is solved, and more accurate statistics on the number of pre-installed applications are achieved.

CN119645755BActive Publication Date: 2026-01-20HONOR DEVICE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411547245.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-31
Publication Date
2026-01-20
Estimated Expiration
2044-10-31

AI Technical Summary

Technical Problem

In existing technologies, servers cannot accurately count the number of pre-installed applications installed via the installation package stored at the factory after the first power-on, because some electronic devices do not install pre-installed applications via the installation package stored at the factory after the first power-on, but instead download and install them during user use, resulting in the channel information being incorrectly counted.

Method used

When installing pre-installed applications using the installation package stored at the factory after the electronic device is first powered on, channel information is read from and saved from the configuration file; otherwise, it is not read or saved, ensuring that channel information is reported only when the installation package stored at the factory is installed.

Benefits of technology

This allows the server to more accurately count the number of pre-installed applications installed via the installation package stored at the factory after the first boot, avoiding miscounting.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119645755B_ABST
    Figure CN119645755B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a channel information reporting method, an electronic device, a storage medium and a program product, which are applied to the technical field of electronics. The method determines whether a pre-installed application needs to be installed according to a configuration file of the pre-installed application in the case of first starting of the electronic device, reads channel information of the pre-installed application from the configuration file in the case of needing to install the pre-installed application, the channel information is used to indicate that an installation channel of the pre-installed application is installed through an installation package stored before leaving the factory after first starting, and the channel information is saved in a first file. In the case of starting the pre-installed application, the channel information is obtained from the first file, and the channel information is reported to a server. In this way, the server can more accurately count the number of pre-installed applications actually installed through the installation package stored before leaving the factory after first starting.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of electronics, and particularly relates to a channel information reporting method, an electronic device, a storage medium and a program product. BACKGROUND

[0002] With the continuous development of electronic technology, electronic devices such as mobile phones and tablet computers become more common tools in people's daily life and work. An electronic device can store some application installation packages in advance before leaving the factory. Such an application that stores an installation package in advance before leaving the factory is referred to as a pre-installed application.

[0003] In some electronic devices, after first booting, the electronic device can automatically run the installation package of the pre-installed application stored in advance before leaving the factory to install the corresponding pre-installed application. After a user opens the pre-installed application, the electronic device can obtain channel information of the pre-installed application from the electronic device and report the channel information to a server. The channel information is used to indicate that the installation channel of the pre-installed application is installed through the installation package stored in advance before leaving the factory after first booting. In other electronic devices, after first booting, the electronic device does not automatically run the installation package of the pre-installed application stored in advance before leaving the factory to install the pre-installed application. Instead, the pre-installed application is downloaded and installed through an application market (also referred to as an application store) or a webpage during use of the electronic device by a user. After the user opens the pre-installed application, the electronic device can also obtain channel information of the pre-installed application from the electronic device and report the channel information to the server. The channel information is still used to indicate that the installation channel of the pre-installed application is installed through the installation package stored in advance before leaving the factory after first booting.

[0004] However, this way can cause the number of pre-installed applications actually installed through the installation package stored in advance before leaving the factory after first booting to be inaccurate in statistics of the server. SUMMARY

[0005] The present application provides a channel information reporting method, an electronic device, a storage medium and a program product, so that the server can more accurately count the number of pre-installed applications actually installed through the installation package stored in advance before leaving the factory after first booting.

[0006] In a first aspect, the embodiments of the present application provide a channel information reporting method, applied to an electronic device. The electronic device stores an installation package and a configuration file of a pre-installed application before leaving the factory. The method comprises: in the case that the electronic device is started for the first time, the electronic device determines whether the pre-installed application needs to be installed according to the configuration file. The first start includes the first start after leaving the factory or the restart after the factory settings are restored. In the case that the pre-installed application needs to be installed, the electronic device reads channel information of the pre-installed application from the configuration file. The channel information is used to indicate the installation channel of the pre-installed application and is installed through the installation package stored before leaving the factory after the first start. The electronic device saves the channel information in a first file. In the case that the pre-installed application is started, the electronic device acquires the channel information from the first file. The electronic device reports the channel information to a server.

[0007] In this way, in the case that the pre-installed application is installed through the installation package stored before leaving the factory after the first start of the electronic device, the channel information of the pre-installed application is read from the configuration file and saved in the first file. When the user opens the pre-installed application, the channel information of the pre-installed application can be acquired from the first file and reported to the server. If the pre-installed application is not installed through the installation package stored before leaving the factory after the first start of the electronic device, the channel information of the pre-installed application is not read from the configuration file and saved in the first file. If the user downloads and installs the pre-installed application through an application market during the use of the electronic device, when the user opens the pre-installed application, the channel information of the pre-installed application cannot be acquired from the first file and reported to the server, so that the channel information of the pre-installed application which is not installed through the installation package stored before leaving the factory after the first start is not counted by the server. In this way, the server can more accurately count the number of pre-installed applications actually installed through the installation package stored before leaving the factory after the first start.

[0008] In a possible implementation, the electronic device saves the channel information in the first file, comprising: the electronic device writes the channel information into a second file, the second file being different from the first file; the electronic device reads the channel information from the second file; the electronic device acquires the installation package name of the pre-installed application from the channel information; and the electronic device saves the installation package name and the channel information in the first file in the form of a key-value pair. In this way, in the case that the pre-installed application is started, the pre-installed application can acquire the channel information from the first file.

[0009] In a possible implementation, the electronic device includes a system service. The electronic device reads channel information of the pre-installed application from the configuration file, including: the pre-installed application reads the channel information from the configuration file. Correspondingly, the electronic device writes the channel information into the second file, including: the pre-installed application sends the channel information to the system service; the system service generates the second file and writes the channel information into the second file. In this way, based on the pre-installed application and the system service, the channel information of the pre-installed application can be written into the second file.

[0010] In a possible implementation, the electronic device further includes a startup customization service. The electronic device reads the channel information from the second file, including: in a case where the channel information is written into the second file, the pre-installed application sets a state of a channel attribute hot update switch to an enabled state; in a case where the state of the channel attribute hot update switch is the enabled state, the startup customization service reads the channel information from the second file. In this way, based on the pre-installed application and the startup customization service, the startup customization service can read the channel information of the pre-installed application from the second file.

[0011] In a possible implementation, in a case where the channel information is written into the second file, the pre-installed application sets the state of the channel attribute hot update switch to the enabled state, including: in a case where the system service writes the channel information into the second file, the system service sends first indication information to the pre-installed application, the first indication information being used to indicate that the channel information has been written into the second file; and the pre-installed application sets the state of the channel attribute hot update switch to the enabled state in response to the first indication information. In this way, the pre-installed application can set the state of the channel attribute hot update switch to the enabled state in a timely manner.

[0012] In a possible implementation, the electronic device further includes an attribute service. In a case where the state of the channel attribute hot update switch is the enabled state, the startup customization service reads the channel information from the second file, including: in a case where the attribute service listens to the state of the channel attribute hot update switch being the enabled state, the attribute service sends second indication information to the startup customization service, the second indication information being used to indicate that the state of the channel attribute hot update switch is the enabled state; and the startup customization service reads the channel information from the second file in response to the second indication information. In this way, the startup customization service can read the channel information of the pre-installed application from the second file in a timely manner.

[0013] In a possible implementation, the electronic device obtains the installation package name of the pre-installed application from the channel information, including: the startup customization service obtains the installation package name of the pre-installed application from the channel information. Correspondingly, the electronic device saves the installation package name and the channel information in the first file in the form of a key-value pair, including: the startup customization service saves the installation package name and the channel information in the first file in the form of a key-value pair. Since the startup customization service provides an external data interface, the pre-installed application can obtain the channel information of the pre-installed application from the first file in the case of starting the pre-installed application.

[0014] In a possible implementation, the electronic device further includes an attribute service. After the startup customization service saves the installation package name and the channel information in the first file in the form of a key-value pair, the method further includes: the startup customization service sets the state of the channel attribute hot update switch to an end state; and the attribute service listens to the state of the channel attribute hot update switch being the end state.

[0015] In a possible implementation, the configuration file includes first subscriber identification module (SIM) card information associated with the pre-installed application. The electronic device determines whether the pre-installed application needs to be installed according to the configuration file, including: the electronic device obtains second SIM card information corresponding to a SIM card installed on the electronic device; and the electronic device determines whether the first SIM card information matches the second SIM card information. In a case where the first SIM card information matches the second SIM card information, the electronic device determines that the pre-installed application needs to be installed; and in a case where the first SIM card information does not match the second SIM card information, the electronic device determines that the pre-installed application does not need to be installed. In this way, a manner of determining whether the pre-installed application needs to be installed based on SIM card information is provided.

[0016] In a possible implementation, the configuration file includes first country information associated with the pre-installed application. The electronic device determines whether the pre-installed application needs to be installed according to the configuration file, including: the electronic device obtains second country information of a country where the electronic device is located; and the electronic device determines whether the first country information matches the second country information. In a case where the first country information matches the second country information, the electronic device determines that the pre-installed application needs to be installed; and in a case where the first country information does not match the second country information, the electronic device determines that the pre-installed application does not need to be installed. In this way, a manner of determining whether the pre-installed application needs to be installed based on country information is provided.

[0017] In a possible implementation, in the case of starting the pre-installed application, the electronic device obtains the channel information from the first file, including: in the case of starting the pre-installed application, the pre-installed application obtains the channel information from the first file based on the installation package name of the pre-installed application. Correspondingly, the electronic device reports the channel information to the server, including: the pre-installed application reports the channel information to the server. In this way, the pre-installed application can quickly obtain the channel information from the first file based on the installation package name.

[0018] In a second aspect, an electronic device is provided, including a memory and a processor, the memory is configured to store a computer program, and the processor is configured to invoke the computer program to execute the reporting method of the channel information.

[0019] In a third aspect, a computer readable storage medium is provided, and the computer readable storage medium stores a computer program or instructions, when the computer program or instructions are executed, the reporting method of the channel information is implemented.

[0020] In a fourth aspect, a computer program product is provided, including a computer program, when the computer program is executed, the computer program causes a computer to execute the reporting method of the channel information.

[0021] The possible implementation manners of the second aspect to the fourth aspect have similar effects to the first aspect and the possible design of the first aspect, and details are not described herein. BRIEF DESCRIPTION OF DRAWINGS

[0022] Figure 1 A flowchart of a reporting method of channel information provided for related technologies is shown in FIG. 1;

[0023] Figure 2 A hardware system structure schematic diagram of an electronic device provided for an embodiment of the present application is shown in FIG. 2;

[0024] Figure 3 A software system structure schematic diagram of an electronic device provided for an embodiment of the present application is shown in FIG. 3;

[0025] Figure 4 A flowchart of a reporting method of channel information provided for an embodiment of the present application is shown in FIG. 4;

[0026] Figure 5 A flowchart of another reporting method of channel information provided for an embodiment of the present application is shown in FIG. 5;

[0027] Figure 6 A module interaction schematic diagram of saving channel information in a first file provided for an embodiment of the present application is shown in FIG. 6;

[0028] Figure 7 A structure schematic diagram of a reporting device of channel information provided for an embodiment of the present application is shown in FIG. 7;

[0029] Figure 8 A structure schematic diagram of a chip is provided in the embodiments of the present application. DETAILED DESCRIPTION

[0030] In order to clearly describe the technical solutions of the embodiments of the present application, in the embodiments of the present application, the words "first", "second", etc. are used to distinguish the same or similar items with basically the same function and role. For example, the first chip and the second chip are merely used to distinguish different chips, and do not limit the sequence. Those skilled in the art can understand that the words "first", "second", etc. do not limit the quantity and execution sequence, and the words "first", "second", etc. also do not necessarily mean different.

[0031] It should be noted that in the embodiments of the present application, the words "exemplary" or "for example" are used to represent an example, illustration or description. Any embodiment or design scheme described as "exemplary" or "for example" in the present application should not be interpreted as more preferred or more advantageous than other embodiments or design schemes. Rather, the words "exemplary" or "for example" are intended to present the relevant concept in a specific manner.

[0032] In the embodiments of the present application, "at least one" means one or more, and "multiple" means two or more. The association relationship of the associated objects is described, which means that there can be three kinds of relationships, for example, A and / or B, which can represent the following three cases: A exists alone, A and B exist together, and B exists alone, wherein A and B can be singular or plural. The character " / " generally represents an "or" relationship between the associated objects before and after it. "At least one of the following" or similar expressions means any combination of these items, including any combination of single item or multiple items. For example, at least one of a, b, or c can represent a, b, c, a-b, a-c, b-c, or a-b-c, wherein a, b, and c can be single or multiple.

[0033] Before explaining the reporting method of channel information provided by the embodiments of the present application, the application scenarios of the embodiments of the present application are introduced.

[0034] Firstly, the "pre-installed application" involved in the present application can also be referred to as "pre-installed application software" or "pre-installed application program". Those skilled in the art should understand that the meanings of "application", "application software" and "application program" are the same, which all refer to the part of software in the electronic device to meet the application needs of users in different fields and different problems.

[0035] In some embodiments, the applications in the electronic device can include pre-installed applications and non-pre-installed applications. The pre-installed application refers to an application with an installation package pre-stored before the electronic device is shipped. In the case that the electronic device is powered on for the first time, some electronic devices can install the pre-installed application based on the installation package pre-stored before the electronic device is shipped. The non-pre-installed application refers to an application without an installation package pre-stored before the electronic device is shipped, and is downloaded and installed by the user during the use of the electronic device.

[0036] It should be understood that the pre-installed application can be a cooperative application negotiated by the electronic device manufacturer and a third-party software development company, or a self-owned application of the electronic device manufacturer, which is not limited herein. For example, the pre-installed application can be an instant messaging application, a social application, a game application, a phonebook, a browser, a camera, etc.

[0037] At present, for the electronic device launched globally, before the electronic device is shipped, the electronic device manufacturer can formulate a corresponding version plan according to the result of negotiation with the user group to which the electronic device belongs, determine the installation package of the pre-installed application required by the user group under the version plan, and store it in the electronic device. In addition, before the electronic device is shipped, the configuration file and channel information of the pre-installed application are also stored in the electronic device, and the channel information is used to indicate that the installation channel of the pre-installed application is installed through the installation package pre-stored before the electronic device is shipped after the first power-on.

[0038] Optionally, the user group can be divided in a specific region, country, operator, enterprise, etc. The division method of the user group is not limited in the embodiments of the present application.

[0039] In one example, taking the case that the user group is divided in a specific region as an example, the user group M is all the electronic devices in region A, and the user group N is all the electronic devices in region B. For example, the specific region can be the European region or the Asia-Africa-Latin America region, etc. One specific region can include multiple different countries, such as the Asia-Africa-Latin America region which can include A country and non-A country.

[0040] In another example, taking the case that the user group is divided by the operator as an example, the electronic devices in the user group M are all the electronic devices supporting the operator m, and the electronic devices in the user group N are all the electronic devices supporting the operator n.

[0041] It should be noted that the electronic devices included in one user group have the same demand for pre-installed applications, that is, the installation package of the pre-installed application pre-stored in the electronic devices belonging to the same user group can be the same, and the installation package of the pre-installed application pre-stored in the electronic devices belonging to different user groups can be different.

[0042] Taking the case that the user group is divided in a specific region, and the specific region is the Asia-Africa-Latin America region which includes A country and non-A country as an example. For example, Figure 1As shown, in the related art, the reporting method of channel information can specifically include the following steps:

[0043] S101, in all electronic devices shipped to the Asia-Africa-Latin America region, the installation package of the pre-installed application X, the configuration file of the pre-installed application X, and the channel information of the pre-installed application X are stored before leaving the factory, and the channel information is used to indicate that the installation channel of the pre-installed application X is installed through the installation package stored before leaving the factory after the first boot.

[0044] That is, the electronic device shipped to the A country will store the installation package of the pre-installed application X, the configuration file of the pre-installed application X, and the channel information of the pre-installed application X before leaving the factory; the electronic device shipped to the non-A country will also store the installation package of the pre-installed application X, the configuration file of the pre-installed application X, and the channel information of the pre-installed application X before leaving the factory.

[0045] Among them, the installation package of the pre-installed application X, the configuration file of the pre-installed application X, and the channel information of the pre-installed application X are stored separately in the electronic device, and they can all be stored under the system file of the electronic device. In an implementation manner, the installation package of the pre-installed application X can be stored under the preload file of the electronic device, for example, the pre-installed application X is Zhihu, and the storage path of the installation package thereof can be: preload / app / zhihu / zhihu.apk; the configuration file of the pre-installed application X can be stored under the preload file of the electronic device; and the channel information of the pre-installed application X can be stored under the system file of the electronic device.

[0046] S102, for the electronic device shipped to the A country, it is determined according to the configuration file of the pre-installed application X that the pre-installed application X needs to be installed after the first boot.

[0047] S103, the electronic device shipped to the A country installs the pre-installed application X after the first boot.

[0048] S104, for the electronic device shipped to the non-A country, it is determined according to the configuration file of the pre-installed application X that the pre-installed application X does not need to be installed after the first boot.

[0049] S105, the electronic device shipped to the non-A country does not install the pre-installed application X after the first boot, but downloads and installs the pre-installed application X through the application market during use.

[0050] In some scenarios, the configuration file of the pre-installed application X indicates that the electronic device shipped to the A country needs to install the pre-installed application X after the first boot, and the electronic device shipped to the non-A country does not need to install the pre-installed application X after the first boot.

[0051] For the electronic device shipped to the A country, the installation package of the pre-installed application X stored before factory shipment can be automatically run to install the pre-installed application X after the first start (including the first start after factory shipment or the restart after factory settings are restored). For the electronic device shipped to the non-A country, the installation package of the pre-installed application X stored before factory shipment is not automatically run to install the pre-installed application X after the first start, but the pre-installed application X is downloaded and installed through an application market or a webpage during use of the electronic device by a user.

[0052] In S106, in the case where the pre-installed application X is started, the channel information of the pre-installed application X stored is acquired and reported to the server.

[0053] For the electronic device shipped to the A country, after the pre-installed application X is installed after the first start, a user in the A country can open and use the pre-installed application X. In this way, in the case where the pre-installed application X is started, the electronic device shipped to the A country can acquire the channel information of the pre-installed application X stored before factory shipment, and report the channel information of the pre-installed application X to the server, which indicates that the installation channel of the pre-installed application X is installed through the installation package stored before factory shipment after the first start.

[0054] For the electronic device shipped to the non-A country, after the pre-installed application X is not installed after the first start, but the pre-installed application X is downloaded and installed through an application market during use of the electronic device by a user, a user in the non-A country can open and use the pre-installed application X downloaded and installed through the application market. In this way, in the case where the pre-installed application X is started, the electronic device shipped to the non-A country can also acquire the channel information of the pre-installed application X stored before factory shipment, and report the channel information of the pre-installed application X to the server, which still indicates that the installation channel of the pre-installed application X is installed through the installation package stored before factory shipment after the first start.

[0055] In S107, the server counts the number of pre-installed applications X installed through the installation package stored before factory shipment after the first start based on the channel information of the pre-installed application X.

[0056] The server can count the number of pre-installed applications installed through the installation channel indicated by the channel information of the pre-installed application X based on the channel information of the pre-installed application X.

[0057] In the related art, the number of pre-installed applications X installed through the installation package stored before factory shipment after the first start counted by the server based on the channel information of the pre-installed application X reported by the electronic device includes the number of pre-installed applications X used by the electronic device shipped to the A country and the number of pre-installed applications X used by the electronic device shipped to the non-A country.

[0058] In fact, for the electronic device shipped to the non-A country, after the first boot, the pre-installed application X is not installed through the installation package stored before the factory shipment, but is downloaded and installed through the application market during the use of the electronic device by the user, but the channel information of the pre-installed application X is still reported to the server, so that the channel information of the pre-installed application X which is not installed through the installation package stored before the factory shipment after the first boot is also counted by the server, thereby causing the number of the pre-installed application X actually installed through the installation package stored before the factory shipment after the first boot counted by the server to be inaccurate.

[0059] It should be understood that the user group is not limited to being divided by a specific region, and can also be divided by a country or the like. Taking the case that the user group is divided by a country and a certain country includes the operator m and the operator n as an example. The electronic device supporting the operator m stores the installation package of the pre-installed application X, the configuration file of the pre-installed application X and the channel information of the pre-installed application X before the factory shipment, and the channel information is used to indicate that the installation channel of the pre-installed application X is installed through the installation package stored before the factory shipment after the first boot. The electronic device supporting the operator n also stores the installation package of the pre-installed application X, the configuration file of the pre-installed application X and the channel information of the pre-installed application X before the factory shipment, and the channel information is also used to indicate that the installation channel of the pre-installed application X is installed through the installation package stored before the factory shipment after the first boot.

[0060] For the electronic device supporting the operator m, after the first boot, it is determined according to the configuration file of the pre-installed application X that the pre-installed application X needs to be installed, and then the installation package of the pre-installed application X stored before the factory shipment is automatically run after the first boot to install the pre-installed application X. In the case of starting the pre-installed application X, the electronic device supporting the operator m can acquire the channel information of the pre-installed application X stored before the factory shipment and report the channel information of the pre-installed application X to the server.

[0061] For the electronic device supporting the operator n, after the first boot, it is determined according to the configuration file of the pre-installed application X that the pre-installed application X does not need to be installed, and then the installation package of the pre-installed application X stored before the factory shipment is not automatically run after the first boot to install the pre-installed application X, but the pre-installed application X is downloaded and installed through the application market or a webpage or the like during the use of the electronic device by the user. In the case of starting the pre-installed application X, the electronic device supporting the operator n can also acquire the channel information of the pre-installed application X stored before the factory shipment and report the channel information of the pre-installed application X to the server.

[0062] In this way, the server counts the number of pre-installed applications X installed through the installation package stored before factory according to the channel information of the pre-installed application X reported by the electronic device, including the number of pre-installed applications X used by the electronic device supporting operator m and the number of pre-installed applications X used by the electronic device supporting operator n.

[0063] In fact, for the electronic device supporting operator n, the pre-installed application X is not installed through the installation package stored before factory after the first boot, but is downloaded and installed through the application market during the use of the electronic device by the user, but the channel information of the pre-installed application X is still reported to the server, so that the channel information of the pre-installed application X which is not installed by itself through the installation package stored before factory after the first boot is also counted by the server, thereby causing the number of pre-installed applications X actually installed through the installation package stored before factory after the first boot counted by the server to be inaccurate.

[0064] In summary, in the related art, in some electronic devices, the installation package of the pre-installed application stored before factory can be automatically run after the first boot to install the corresponding pre-installed application, and after the pre-installed application is opened by the user, the channel information of the pre-installed application can be obtained from the electronic device and reported to the server, and the channel information is used to indicate that the installation channel of the pre-installed application is through the installation package stored before factory after the first boot; in other electronic devices, the installation package of the pre-installed application stored before factory is not automatically run to install the pre-installed application after the first boot, but the pre-installed application is downloaded and installed through the application market or webpage during the use of the electronic device by the user, and after the pre-installed application is opened by the user, the channel information of the pre-installed application can also be obtained from the electronic device and reported to the server, and the channel information is still used to indicate that the installation channel of the pre-installed application is through the installation package stored before factory after the first boot.

[0065] In this way, some electronic devices do not install the pre-installed application through the installation package stored before factory after the first boot, but download and install the pre-installed application through the application market during the use of the electronic device by the user, but the channel information of the pre-installed application is still reported to the server, so that the channel information of the pre-installed application which is not installed by itself through the installation package stored before factory after the first boot is also counted by the server, thereby causing the number of pre-installed applications X actually installed through the installation package stored before factory after the first boot counted by the server to be inaccurate.

[0066] Based on this, the embodiment of the present application provides a reporting method of channel information. In the case that an electronic device is started for the first time, whether a pre-installed application needs to be installed is determined according to a configuration file of the pre-installed application stored before the electronic device is manufactured. In the case that the pre-installed application needs to be installed, channel information of the pre-installed application is read from the configuration file, the channel information is used to indicate that an installation channel of the pre-installed application is installed through an installation package stored before the electronic device is manufactured after the electronic device is started for the first time, and the channel information is saved in a first file. In the case that the pre-installed application is started, the channel information is acquired from the first file, and the channel information is reported to a server.

[0067] Therefore, the embodiment of the present application can increase the channel information of the pre-installed application in the configuration file of the pre-installed application, and bind the channel information of the pre-installed application with installation of the pre-installed application. In the case that the pre-installed application is installed through the installation package stored before the electronic device is manufactured after the electronic device is started for the first time, the channel information of the pre-installed application is read from the configuration file and saved in the first file. In this way, when the pre-installed application is opened by a user, the channel information of the pre-installed application can be acquired from the first file and reported to the server. If the pre-installed application is not installed through the installation package stored before the electronic device is manufactured after the electronic device is started for the first time, the channel information of the pre-installed application is not read from the configuration file, and the channel information of the pre-installed application is not saved in the first file. If the pre-installed application is downloaded and installed by the user through an application market in the process of using the electronic device, when the pre-installed application is opened by the user, the channel information of the pre-installed application cannot be acquired because the channel information of the pre-installed application is not saved in the first file, and the channel information of the pre-installed application is not reported to the server. Therefore, the channel information of the pre-installed application which is not installed through the installation package stored before the electronic device is manufactured after the electronic device is started for the first time is not counted by the server. In this way, the server can more accurately count the number of the pre-installed applications which are actually installed through the installation package stored before the electronic device is manufactured after the electronic device is started for the first time.

[0068] A channel information reporting method provided by an embodiment of the present application can be applied to an electronic device. The electronic device includes a terminal device, which can also be referred to as a terminal, a user equipment (UE), a mobile station (MS), a mobile terminal (MT), etc. The electronic device can be a mobile phone, a smart television, a wearable device, a tablet computer (Pad), a computer with wireless transceiver function, a virtual reality (VR) device, an augmented reality (AR) device, a wireless terminal in industrial control, a wireless terminal in self-driving, a wireless terminal in remote medical surgery, a wireless terminal in smart grid, a wireless terminal in transportation safety, a wireless terminal in smart city, a wireless terminal in smart home, etc. Embodiments of the present application do not limit the specific technology and specific device form of the electronic device.

[0069] In order to better understand the embodiments of the present application, the structure of the electronic device of the embodiments of the present application is introduced as follows.

[0070] Figure 2 A structural schematic diagram of the electronic device 200 is shown. The electronic device 200 can include a processor 210, an external memory interface 220, an internal memory 221, a universal serial bus (USB) interface 230, a charge management module 240, a power management module 241, a battery 242, an antenna 1, an antenna 2, a mobile communication module 250, a wireless communication module 260, an audio module 270, a loudspeaker 270A, a receiver 270B, a microphone 270C, a headset interface 270D, a sensor module 280, a key 290, a motor 291, an indicator 292, a camera 293, a display screen 294, and a SIM card interface 295, etc.

[0071] It can be understood that the structure shown in the embodiments of the present application does not constitute a specific limitation on the electronic device 200. In other embodiments of the present application, the electronic device 200 can include more or fewer components than shown, or combine certain components, or split certain components, or different arrangement of components. The components shown can be implemented in hardware, software or a combination of software and hardware.

[0072] The processor 210 can include one or more processing units, for example: the processor 210 can include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Among them, different processing units can be independent devices, or can be integrated in one or more processors.

[0073] The controller can generate operation control signals according to instruction operation codes and timing signals, complete the control of fetching instructions and executing instructions.

[0074] The processor 210 can also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 210 is a cache memory. The memory can save instructions or data that the processor 210 has just used or repeatedly uses. If the processor 210 needs to use the instructions or data again, it can be called from the memory. Avoiding repeated access reduces the waiting time of the processor 210, thus improving the efficiency of the system.

[0075] The charging management module 240 is configured to receive charging input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 240 can receive the charging input of the wired charger through the USB interface 230. In some wireless charging embodiments, the charging management module 240 can receive the wireless charging input through the wireless charging coil of the electronic device 200. The charging management module 240 can charge the battery 242 while also supplying power to the electronic device through the power management module 241.

[0076] The power management module 241 is configured to connect the battery 242, the charging management module 240, and the processor 210. The power management module 241 receives the input of the battery 242 and / or the charging management module 240, and supplies power to the processor 210, the internal memory 221, the display screen 294, the camera 293, and the wireless communication module 260, etc. In other embodiments, the power management module 241 can also be arranged in the processor 210. In other embodiments, the power management module 241 and the charging management module 240 can also be arranged in the same device.

[0077] The wireless communication function of the electronic device 200 can be implemented by the antenna 1, the antenna 2, the mobile communication module 250, the wireless communication module 260, the modem processor, and the baseband processor, etc.

[0078] The antenna 1 and the antenna 2 are used for transmitting and receiving electromagnetic wave signals. The antennas in the electronic device 200 can be used to cover a single or multiple communication frequency bands. Different antennas can also be multiplexed to improve the utilization of the antennas. For example, the antenna 1 can be multiplexed as a diversity antenna of a wireless local area network. In some other embodiments, the antennas can be used in combination with a tuning switch.

[0079] The mobile communication module 250 can provide a solution including 2G / 3G / 4G / 5G wireless communication applied to the electronic device 200. The mobile communication module 250 can include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 250 can receive electromagnetic waves by the antenna 1, and perform filtering, amplification, etc. on the received electromagnetic waves, and transmit the processed electromagnetic waves to the modem processor for demodulation. The mobile communication module 250 can also amplify the signals modulated by the modem processor, and convert the signals into electromagnetic waves radiated by the antenna 1. In some embodiments, at least part of the functional modules of the mobile communication module 250 can be arranged in the processor 210. In some embodiments, at least part of the functional modules of the mobile communication module 250 and at least part of the modules of the processor 210 can be arranged in the same device.

[0080] The modem processor can include a modulator and a demodulator. The modulator is used to modulate a low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. The low-frequency baseband signal processed by the baseband processor is transmitted to the application processor. The application processor outputs a sound signal through an audio device (not limited to the loudspeaker 270A, the microphone 270B, etc.), or displays an image or a video through the display screen 294. In some embodiments, the modem processor can be an independent device. In some other embodiments, the modem processor can be independent of the processor 210, and arranged in the same device as the mobile communication module 250 or other functional modules.

[0081] The wireless communication module 260 can provide a solution for wireless communication, including wireless local area networks (WLAN) (e.g., wireless fidelity (Wi-Fi) network), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR) technology, etc., which are applied to the electronic device 200. The wireless communication module 260 can be one or more devices that integrate at least one communication processing module. The wireless communication module 260 receives electromagnetic waves via the antenna 2, frequency-modulates and filters the electromagnetic wave signals, and transmits the processed signals to the processor 210. The wireless communication module 260 can also receive signals to be transmitted from the processor 210, frequency-modulate them, amplify them, and radiate them as electromagnetic waves via the antenna 2.

[0082] In some embodiments, antenna 1 and mobile communication module 250 of electronic device 200 are coupled, and antenna 2 and wireless communication module 260 are coupled, so that electronic device 200 can communicate with a network and other devices through wireless communication technology. The wireless communication technology can include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology, etc. The GNSS can include a global positioning system (GPS), a global navigation satellite system (GLONASS), a beidu navigation satellite system (BDS), a quasi-zenith satellite system (QZSS), and / or a satellite based augmentation systems (SBAS).

[0083] Electronic device 200 can implement a display function through a GPU, a display 294, and an application processor, etc. The GPU is a microprocessor for image processing, which is connected to the display 294 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 210 can include one or more GPUs that execute program instructions to generate or change display information.

[0084] Electronic device 200 can implement a photographing function through an ISP, a camera 293, a video codec, a GPU, a display 294, and an application processor, etc.

[0085] The external memory interface 220 can be used to connect an external memory card, such as a Micro SD card, to extend the storage capacity of the electronic device 200. The external memory card communicates with the processor 210 through the external memory interface 220 to implement a data storage function. For example, files such as music, videos, and the like are stored in the external memory card.

[0086] The internal memory 221 can be used to store computer executable program codes, which include instructions. The internal memory 221 can include a program storage area and a data storage area. The program storage area can store an operating system, at least one application program required by a function (such as a sound playing function, an image playing function, and the like), and the like. The data storage area can store data created during use of the electronic device 200 (such as audio data, a phone book, and the like), and the like. In addition, the internal memory 221 can include a high-speed random access memory, and can also include a non-volatile memory such as at least one magnetic disk storage device, a flash memory device, a universal flash storage (UFS), and the like. The processor 210 executes various function applications and data processing of the electronic device 200 by running instructions stored in the internal memory 221 and / or instructions stored in a memory disposed in the processor.

[0087] The electronic device 200 can implement an audio function through an audio module 270, a speaker 270A, a receiver 270B, a microphone 270C, an earphone interface 270D, an application processor, and the like. For example, music playing, recording, and the like.

[0088] The keys 290 include a power-on key, a volume key, and the like. The keys 290 can be mechanical keys. They can also be touch keys. The electronic device 200 can receive key inputs and generate key signal inputs related to user settings and function control of the electronic device 200. The motor 291 can generate a vibration prompt. The motor 291 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. The indicator 292 can be an indicator light, which can be used to indicate a charging state, a power change, and can also be used to indicate a message, a missed call, a notification, and the like.

[0089] The SIM card interface 295 is configured to connect a SIM card. The SIM card can be connected to or disconnected from the electronic device 200 by being inserted into or withdrawn from the SIM card interface 295. The electronic device 200 can support one or more SIM card interfaces. The SIM card interface 295 can support Nano SIM cards, Micro SIM cards, SIM cards, or the like. Multiple cards can be inserted into the same SIM card interface 295. The types of the multiple cards can be the same or different. The SIM card interface 295 can support different types of SIM cards. The SIM card interface 295 can also support external memory cards. The electronic device 200 can interact with a network through the SIM card to perform functions such as communication and data communication. In some embodiments, the electronic device 200 uses an eSIM, i.e., an embedded SIM card. The eSIM card can be embedded in the electronic device 200 and cannot be separated from the electronic device 200.

[0090] The software system of the electronic device 200 can use a layered architecture, an event-driven architecture, a microkernel architecture, a microservices architecture, or a cloud architecture. The embodiments of the present application exemplarily illustrate the software structure of the electronic device 200 using a layered architecture of an Android system.

[0091] Figure 3 FIG. 1 is a software structure block diagram of the electronic device 200 according to an embodiment of the present application. The layered architecture divides the software into several layers, each of which has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom, an application layer, an application framework layer, an Android runtime and system library, and a kernel layer.

[0092] The application layer can include a series of application packages. As shown in FIG. 2, the application packages can include pre-installed applications and non-pre-installed applications. Figure 3

[0093] The application framework layer provides application programming interfaces (APIs) and programming frameworks for the applications of the application layer. The application framework layer includes a number of pre-defined functions.

[0094] As shown in FIG. 3, the application framework layer can include a system service (system server), a boot customization service (hncust_init service), and a property service, etc. Figure 3

[0095] ​​In some embodiments, after the electronic device first boots up by running its installation package stored before factory shipment to install the pre-installed application, the system service can generate a second file and write the channel information of the pre-installed application into the second file. The system service can also be referred to as a system framework.

[0096] The boot customization service is a service located in the application framework layer, which is mainly used for customization services when the electronic device boots up. In some embodiments, in the case that the state of the channel attribute hot update switch is the starting state, the boot customization service can read the channel information of the pre-installed application from the second file, then obtain the installation package name of the pre-installed application from the channel information of the pre-installed application, and save the installation package name of the pre-installed application and the channel information of the pre-installed application in the first file in the form of key-value pairs.

[0097] In some embodiments, the attribute service is used to listen to the state of the channel attribute hot update switch in real time.

[0098] The Android runtime includes a core library and a virtual machine. The Android runtime is responsible for the scheduling and management of the Android system.

[0099] The core library contains two parts: one part is the function function that the java language needs to call, and the other part is the core library of Android.

[0100] The application layer and the application framework layer run in the virtual machine. The virtual machine executes the java files of the application layer and the application framework layer into binary files. The virtual machine is used to perform object lifecycle management, stack management, thread management, security and exception management, and garbage collection functions.

[0101] The system library can include multiple functional modules. For example: surface manager, media library, three-dimensional graphics processing library (such as: OpenGL ES), two-dimensional graphics engine (such as: SGL) and the like.

[0102] The surface manager is used to manage the display subsystem, and provides 2D and 3D layer fusion for multiple applications.

[0103] The media library supports multiple commonly used audio, video format playback and recording, and static image files and the like. The media library can support multiple audio and video encoding formats, such as: MPEG2, H.262, MP3, AAC, AMR, JPG, PNG and the like.

[0104] The three-dimensional graphics processing library is used to realize three-dimensional graphics drawing, image rendering, synthesis and layer processing and the like. The two-dimensional graphics engine is a drawing engine for 2D drawing.

[0105] The kernel layer is a layer between hardware and software. The kernel layer at least includes a camera driver, a sensor driver, and a display driver, etc.

[0106] It should be noted that although the embodiments of the present application are described with respect to the Android system, the principle of the channel information reporting method is also applicable to electronic devices running iOS or windows operating systems.

[0107] The technical solutions of the present application and how the technical solutions of the present application solve the above technical problems will be described in detail below with specific embodiments. The following specific embodiments can be implemented independently or in combination. For the same or similar concepts or processes, some embodiments may not be described again.

[0108] For example, Figure 4 A flowchart of a channel information reporting method provided by an embodiment of the present application can be applied to an electronic device. The electronic device stores an installation package of a preinstalled application and a configuration file of the preinstalled application before leaving the factory, and the configuration file of the preinstalled application includes channel information of the preinstalled application. Referring to Figure 4 The channel information reporting method can specifically include the following steps:

[0109] S401, in the case of first booting of the electronic device, the electronic device determines whether the preinstalled application needs to be installed according to the configuration file; the first booting includes first booting after leaving the factory or restarting after factory reset.

[0110] In some embodiments, the electronic device stores an installation package of a preinstalled application before leaving the factory. The installation package of the preinstalled application can be an application package (APK) file.

[0111] In addition, the electronic device also stores a configuration file of the preinstalled application before leaving the factory. The channel information of the preinstalled application is added in the configuration file of the preinstalled application, so that the configuration file of the preinstalled application can include the channel information of the preinstalled application. The channel information is used to indicate that the installation channel of the preinstalled application is installed through the installation package stored before leaving the factory after the first booting. For example, the preinstalled application is Zhihu, and the channel information in the configuration file can be represented as ro.honor.channel.zhihu = honor_preinstall.

[0112] The installation package of the preinstalled application and the configuration file of the preinstalled application are stored separately in the electronic device, and both of them can be stored under the system file of the electronic device. In an implementation, the installation package of the preinstalled application can be stored under the preload file of the electronic device, and the configuration file of the preinstalled application can also be stored under the preload file of the electronic device.

[0113] In some scenarios, the pre-installed applications that need to be installed after the first boot of the electronic device shipped to different countries can be different, and the pre-installed applications that need to be installed after the first boot of the electronic device supporting different operators can also be different. Therefore, in the case of the first boot of the electronic device, whether the pre-installed application needs to be installed can be determined according to the configuration file.

[0114] In the case where the electronic device determines that the pre-installed application needs to be installed according to the configuration file, the steps of S402 to S406 below are executed; and in the case where the electronic device determines that the pre-installed application does not need to be installed according to the configuration file, the steps of S402 to S406 below do not need to be executed.

[0115] Specifically, the configuration file of the pre-installed application can include first SIM card information associated with the pre-installed application or first country information associated with the pre-installed application, and the electronic device determines whether the pre-installed application needs to be installed based on the first SIM card information associated with the pre-installed application or the first country information associated with the pre-installed application.

[0116] In an implementation manner, the configuration file of the pre-installed application can include first SIM card information associated with the pre-installed application. The electronic device obtains second SIM card information corresponding to the SIM card installed on the electronic device; and the electronic device determines whether the first SIM card information matches the second SIM card information. In the case where the first SIM card information matches the second SIM card information, the electronic device determines that the pre-installed application needs to be installed; and in the case where the first SIM card information does not match the second SIM card information, the electronic device determines that the pre-installed application does not need to be installed.

[0117] In the configuration file of the pre-installed application, the first SIM card information associated with the pre-installed application can be represented by a field “cardinfo”. In the configuration file of the pre-installed application, the first SIM card information associated with the pre-installed application can be a public land mobile network (PLMN), and the second SIM card information corresponding to the SIM card installed on the electronic device can also be a PLMN. The PLMN can include a mobile country code (MCC) and a mobile network code (MNC).

[0118] For example, the PLMN of China Mobile can include 46000, 46002, 46004, 46007 and 46008; the PLMN of China Unicom can include 46001, 46006, 46009 and 46010; and the PLMN of China Telecom can include 46003, 46011 and 46012.

[0119] For example, in the configuration file of the pre-installed application, the first SIM card information associated with the pre-installed application can include 46002, 46004 and 46007. If the second SIM card information corresponding to the SIM card installed on an electronic device is 46002, that is, the SIM card installed on the electronic device is a SIM card of China Mobile, it is determined that the first SIM card information matches the second SIM card information, and the electronic device determines that the pre-installed application needs to be installed in the case of first booting. If the second SIM card information corresponding to the SIM card installed on an electronic device is 46001, that is, the SIM card installed on the electronic device is a SIM card of China Unicom, it is determined that the first SIM card information does not match the second SIM card information, and the electronic device determines that the pre-installed application does not need to be installed in the case of first booting.

[0120] In another implementation, the configuration file of the pre-installed application can include first country information associated with the pre-installed application. The electronic device obtains second country information of a country where the electronic device is located; and the electronic device determines whether the first country information matches the second country information. In a case where the first country information matches the second country information, the electronic device determines that the pre-installed application needs to be installed; and in a case where the first country information does not match the second country information, the electronic device determines that the pre-installed application does not need to be installed.

[0121] In one approach, the second country information of the country where the electronic device is located can be input by a user in a boot guide page. For example, when the electronic device is booted for the first time, a boot guide page is displayed, the boot guide page can include a plurality of country options, the user can select one of the country options in the boot guide page, and the electronic device can determine the second country information of the country where the electronic device is located based on the country option selected by the user.

[0122] For example, the plurality of country options included in the boot guide page are A country, B country and C country, and the country option selected by the user is A country, and it is determined that the second country information of the country where the electronic device is located is A country.

[0123] In another approach, the second country information of the country where the electronic device is located can be determined based on a matching factor. The matching factor includes, but is not limited to, at least one of a language type, an operator connected to the electronic device or network information.

[0124] For example, when the language type is “Simplified Chinese”, it is determined that the second country information of the country where the electronic device is located is A country, and when the language type is “English”, it is determined that the second country information of the country where the electronic device is located is C country.

[0125] For example, in the configuration file of the pre-installed application, the first country information associated with the pre-installed application can be country A. If the second country information of the country where the electronic device is located is country A, it is determined that the first country information matches the second country information, and the electronic device determines that the pre-installed application needs to be installed in the case of first booting. If the second country information of the country where the electronic device is located is country C, it is determined that the first country information does not match the second country information, and the electronic device determines that the pre-installed application does not need to be installed in the case of first booting.

[0126] In addition, the configuration file of the pre-installed application can further include at least one of the following: an operation type of the pre-installed application, an installation package name of the pre-installed application, an installation package path of the pre-installed application, an application category of the pre-installed application, and an uninstall attribute of the pre-installed application.

[0127] The operation type of the pre-installed application can be represented by a field “actiontype”. When the value of the field “actiontype” is different, the operation type represented by the field “actiontype” is different. The value of the field “actiontype” can be set according to actual conditions, which is not limited by the embodiments of the application. For example, when the field “actiontype=1”, it indicates that the application is a pre-installed application; when the field “actiontype=0”, it indicates that the application is an application that is not installed; and when the field “actiontype=2”, it indicates that the application is an application that needs to be uninstalled.

[0128] The installation package name of the pre-installed application can be represented by a field “apkpackagename”, and the installation package path of the pre-installed application can be represented by a field “apkpath”.

[0129] The application category of the pre-installed application can be represented by a field “systemflag”. For example, when the field “systemflag” is “nosys”, it indicates that the pre-installed application is a non-system application; and when the field “systemflag” is “sys”, it indicates that the pre-installed application is a system application.

[0130] The uninstall attribute of the pre-installed application can be represented by a field “uninstallflag”. For example, when the field “uninstallflag” is “true”, it indicates that the pre-installed application can be uninstalled; and when the field “uninstallflag” is “flase”, it indicates that the pre-installed application cannot be uninstalled.

[0131] S402, in the case of needing to install the pre-installed application, the electronic device reads the channel information of the pre-installed application from the configuration file; the channel information is used to indicate that the installation channel of the pre-installed application is to install the installation package stored before leaving the factory after first booting.

[0132] S403, the electronic device writes the channel information into a second file.

[0133] In a case where the electronic device determines, according to the configuration file, that the pre-installed application needs to be installed, the electronic device can automatically run the installation package of the pre-installed application stored before factory shipment to install the pre-installed application. After the installation of the pre-installed application is completed, the electronic device can read the channel information of the pre-installed application from the configuration file and write it into the second file.

[0134] For example, the storage path of the second file can be / data / system / auto_install / auto_install.prop, and the second file can be an auto_install.prop file.

[0135] In some scenarios, in a case where the electronic device installs multiple pre-installed applications by running the installation packages of the multiple pre-installed applications stored before factory shipment after the electronic device is started for the first time, the electronic device can write the read channel information of the multiple pre-installed applications into the same second file, that is, the channel information of the multiple pre-installed applications can be located in the same second file, and each line of information in the second file represents the channel information of one pre-installed application.

[0136] S404, the electronic device reads the channel information from the second file.

[0137] S405, the electronic device obtains the installation package name of the pre-installed application from the channel information.

[0138] S406, the electronic device saves the installation package name and the channel information in the first file in the form of a key-value pair; the second file is different from the first file.

[0139] After the electronic device writes the channel information of the pre-installed application into the second file, the electronic device can also read the channel information of the pre-installed application from the second file and analyze the channel information of the pre-installed application to obtain the installation package name of the pre-installed application from the channel information of the pre-installed application.

[0140] For example, the channel information of the pre-installed application is ro.honor.channel.zhihu=honor_preinstall, and the installation package name of the pre-installed application obtained from the channel information of the pre-installed application can be zhihu.

[0141] After the electronic device obtains the installation package name of the pre-installed application from the channel information of the pre-installed application, the installation package name of the pre-installed application and the channel information of the pre-installed application are saved in the first file in the form of a key-value pair. In the key-value pair, the key can be the installation package name of the pre-installed application, and the value can be the channel information of the pre-installed application.

[0142] Therefore, according to the execution steps of S403 to S406 described above, the electronic device saves the channel information in the first file.

[0143] It should be noted that after the electronic device writes the channel information of the pre-installed application into the second file, the electronic device further reads the channel information of the pre-installed application from the second file and saves the channel information of the pre-installed application to the first file again, because the pre-installed application cannot obtain the channel information from the second file when starting the pre-installed application, but the pre-installed application can obtain the channel information from the first file.

[0144] S407, in the case of starting the pre-installed application, the electronic device obtains the channel information from the first file.

[0145] S408, the electronic device reports the channel information to the server.

[0146] When the user opens the pre-installed application, that is, in the case of starting the pre-installed application, the electronic device can obtain the channel information of the pre-installed application from the first file based on the installation package name of the pre-installed application; then, the electronic device sends the obtained channel information of the pre-installed application to the server. The server can be an application server corresponding to the pre-installed application.

[0147] Specifically, the pre-installed application already installed in the electronic device can obtain the channel information of the pre-installed application from the first file; and the pre-installed application in the electronic device sends the channel information of the pre-installed application to the server.

[0148] It can be understood that after the pre-installed application is installed, the channel information of the pre-installed application can be obtained from the first file and reported to the server in the scenario of opening the pre-installed application for the first time; after the pre-installed application is installed, the channel information of the pre-installed application can also be obtained from the first file and reported to the server in the scenario of opening the pre-installed application for the first time. The specific timing of obtaining the channel information of the pre-installed application from the first file and reporting to the server can be set by the pre-installed application, and the embodiments of the present application do not limit this.

[0149] Therefore, the embodiment of the present application can add the channel information of the pre-installed application in the configuration file of the pre-installed application, and bind the channel information of the pre-installed application with the installation of the pre-installed application. In the scenario that the electronic device installs the pre-installed application through the installation package stored before factory shipment after the first start-up, the channel information of the pre-installed application is read from the configuration file and written into the second file, then the channel information of the pre-installed application is read from the second file, and the installation package name of the pre-installed application and the channel information of the pre-installed application are saved in the first file in the form of key-value pair. In this way, when the user opens the pre-installed application, the channel information of the pre-installed application can be obtained from the first file and reported to the server. If the electronic device does not install the pre-installed application through the installation package stored before factory shipment after the first start-up, the channel information of the pre-installed application will not be read from the configuration file, and the channel information of the pre-installed application will not be written into the second file. Correspondingly, the channel information of the pre-installed application will not be read from the second file and saved into the first file again. If the user downloads and installs the pre-installed application through the application market during the use of the electronic device, when the user opens the pre-installed application, the channel information of the pre-installed application cannot be obtained because the channel information of the pre-installed application is not saved in the first file, and the channel information of the pre-installed application will not be reported to the server. Therefore, the channel information of the pre-installed application which is not installed by itself through the installation package stored before factory shipment after the first start-up will not be counted by the server. In this way, the server can more accurately count the number of pre-installed applications actually installed through the installation package stored before factory shipment after the first start-up.

[0150] In one example, the user group adopts a specific regional division, and the specific region is the Asia-Africa-Latin America region, which includes A countries and non-A countries. Figure 5 As shown in the figure, in the embodiment of the present application, the reporting method of the channel information can include the following steps:

[0151] S501, in all electronic devices shipped to the Asia-Africa-Latin America region, the installation package and the configuration file of the pre-installed application X are stored before factory shipment. The configuration file includes channel information, which indicates that the installation channel of the pre-installed application X is through the installation package stored before factory shipment after the first start-up.

[0152] That is, the electronic device shipped to the A country will store the installation package of the pre-installed application X and the configuration file of the pre-installed application X before factory shipment. The configuration file of the pre-installed application X can include the channel information of the pre-installed application X. The electronic device shipped to the non-A country will also store the installation package of the pre-installed application X and the configuration file of the pre-installed application X before factory shipment. The configuration file of the pre-installed application X can also include the channel information of the pre-installed application X.

[0153] S502, for the electronic device shipped to the A country, determining that the pre-installed application X needs to be installed according to the configuration file of the pre-installed application X after the first boot.

[0154] S503, the electronic device shipped to the A country installs the pre-installed application X after the first boot, and saves the channel information in the configuration file to the first file.

[0155] S504, in the case of starting the pre-installed application X, obtaining the channel information of the pre-installed application X from the first file and reporting to the server.

[0156] In some scenarios, the configuration file of the pre-installed application X indicates that the electronic device shipped to the A country needs to install the pre-installed application X after the first boot, and the electronic device shipped to the non-A country does not need to install the pre-installed application X after the first boot.

[0157] For the electronic device shipped to the A country, the installation package of the pre-installed application X stored before the factory shipment can be automatically run to install the pre-installed application X after the first boot (including the first boot after the factory shipment or the restart after the factory reset).

[0158] After the electronic device shipped to the A country installs the pre-installed application X after the first boot, the electronic device shipped to the A country can read the channel information of the pre-installed application X from the configuration file of the pre-installed application X, and then save the channel information of the pre-installed application X to the first file by using the steps corresponding to S403 to S406.

[0159] For the electronic device shipped to the A country, after installing the pre-installed application X after the first boot, the user of the A country can open and use the pre-installed application X. In this way, in the case of starting the pre-installed application X, the electronic device shipped to the A country can obtain the channel information of the pre-installed application X from the first file, and report the channel information of the pre-installed application X to the server, which is used to indicate that the installation channel of the pre-installed application X is installed through the installation package stored before the factory shipment after the first boot.

[0160] S505, for the electronic device shipped to the non-A country, determining that the pre-installed application X does not need to be installed according to the configuration file of the pre-installed application X after the first boot.

[0161] S506, the electronic device shipped to the non-A country does not install the pre-installed application X after the first boot, but downloads and installs the pre-installed application X through the application market during use.

[0162] S507, in the case of starting the pre-installed application X, the channel information of the pre-installed application X cannot be obtained, and the channel information of the pre-installed application X is not reported to the server.

[0163] For the electronic device shipped to the non-A country, if the installation package of the pre-installed application X stored before the factory shipment is not automatically run to install the pre-installed application X after the first start (including the first start after the factory shipment or the restart after the factory settings are restored), the electronic device shipped to the non-A country will not read the channel information of the pre-installed application X from the configuration file of the pre-installed application X, and will not save the channel information of the pre-installed application X into the first file by using the steps corresponding to S403 to S406.

[0164] For the electronic device shipped to the non-A country, if the pre-installed application X is not installed after the first start, but is downloaded and installed by the user through the application market or a webpage during the use of the electronic device, the user in the non-A country can open and use the pre-installed application X downloaded and installed by the application market. In this way, in the case of starting the pre-installed application X, the electronic device shipped to the non-A country cannot obtain the channel information of the pre-installed application X from the first file, and cannot report the channel information of the pre-installed application X to the server.

[0165] S508, the server counts the number of pre-installed applications X installed through the installation package stored before the factory shipment after the first start based on the channel information of the pre-installed application X.

[0166] The server can count the number of pre-installed applications installed through the installation channel indicated by the channel information of the pre-installed application X based on the channel information of the pre-installed application X.

[0167] In the embodiment of the present application, the number of pre-installed applications X installed through the installation package stored before the factory shipment after the first start counted by the server based on the channel information of the pre-installed application X reported by the electronic device includes the number of pre-installed applications X used by the electronic device shipped to the A country, and does not include the number of pre-installed applications X used by the electronic device shipped to the non-A country, so that the channel information of the pre-installed application X which is not installed by the installation package stored before the factory shipment after the first start will not be counted by the server. In this way, the server can more accurately count the number of pre-installed applications X actually installed through the installation package stored before the factory shipment after the first start.

[0168] In another example, the user group is divided by country, and a country includes both operator m and operator n. An electronic device supporting operator m stores an installation package of pre-installed application X and a configuration file of pre-installed application X before leaving the factory, and the configuration file of pre-installed application X can include channel information of pre-installed application X, which indicates that the installation channel of pre-installed application X is the installation package stored before leaving the factory. An electronic device supporting operator n also stores an installation package of pre-installed application X and a configuration file of pre-installed application X before leaving the factory, and the configuration file of pre-installed application X can also include channel information of pre-installed application X, which also indicates that the installation channel of pre-installed application X is the installation package stored before leaving the factory.

[0169] For an electronic device supporting operator m, if it is determined according to the configuration file of pre-installed application X that pre-installed application X needs to be installed after the first boot, the electronic device can automatically run the installation package of pre-installed application X stored before leaving the factory after the first boot to install pre-installed application X. After the electronic device supporting operator m installs pre-installed application X after the first boot, the electronic device can read the channel information of pre-installed application X from the configuration file and save the channel information of pre-installed application X to the first file. In this way, when pre-installed application X is started, the electronic device supporting operator m can obtain the channel information of pre-installed application X from the first file and report it to the server.

[0170] For an electronic device supporting operator n, if it is determined according to the configuration file of pre-installed application X that pre-installed application X does not need to be installed after the first boot, the electronic device does not automatically run the installation package of pre-installed application X stored before leaving the factory to install pre-installed application X after the first boot. Therefore, the electronic device supporting operator n does not read the channel information of pre-installed application X from the configuration file, nor does it save the channel information of pre-installed application X to the first file. If pre-installed application X is downloaded and installed through an application market or a webpage during use of the electronic device, in the case of starting pre-installed application X, the electronic device supporting operator n cannot obtain the channel information of pre-installed application X from the first file, nor can it report the channel information of pre-installed application X to the server.

[0171] In this way, the server counts the number of pre-installed applications X installed through the installation package stored before factory according to the channel information of the pre-installed application X reported by the electronic device, including the number of pre-installed application X used by the electronic device supporting the operator m, and excluding the number of pre-installed application X used by the electronic device supporting the operator n, so that the channel information of the pre-installed application X not installed by the electronic device through the installation package stored before factory after the first boot is not counted by the server. In this way, the server can more accurately count the number of pre-installed applications X actually installed through the installation package stored before factory after the first boot.

[0172] It should be understood that the scenarios to which the embodiments of the present application are applicable are not limited to the above-mentioned scenarios of the electronic device shipped to the A country and the electronic device shipped to the non-A country, and the scenarios of the electronic device supporting the operator m and the electronic device supporting the operator n. As long as the two types of electronic devices store the installation package and the configuration file of a certain pre-installed application before factory, but one type of electronic device determines that the pre-installed application needs to be installed according to the configuration file of the pre-installed application after the first boot, and the other type of electronic device determines that the pre-installed application does not need to be installed according to the configuration file of the pre-installed application after the first boot, the scenarios are applicable to the present application.

[0173] For example, Figure 6 The module interaction schematic diagram provided by the embodiments of the present application for saving the channel information in the first file is shown in FIG. 1. Figure 6 As shown in FIG. 1, the electronic device can include a pre-installed application, a system service, a boot customization service and an attribute service, and the process of saving the channel information in the first file can include the following steps:

[0174] S601, in the case of the first boot of the electronic device, the pre-installed application determines whether the pre-installed application needs to be installed according to the configuration file.

[0175] In some embodiments, the electronic device stores the installation package of the pre-installed application and the configuration file of the pre-installed application before factory, and the configuration file of the pre-installed application can include channel information of the pre-installed application, which is used to indicate that the installation channel of the pre-installed application is installed through the installation package stored before factory after the first boot.

[0176] In the case of the first boot of the electronic device, the pre-installed application can determine whether the pre-installed application needs to be installed according to the configuration file of the pre-installed application.

[0177] Specifically, the configuration file of the pre-installed application can include first SIM card information associated with the pre-installed application or first country information associated with the pre-installed application. The electronic device determines whether the pre-installed application needs to be installed based on the first SIM card information associated with the pre-installed application or the first country information associated with the pre-installed application. The specific determination manner can refer to the implementation manner corresponding to S401, which will not be described here.

[0178] In a case where the pre-installed application determines, according to the configuration file, that the pre-installed application needs to be installed, the steps of S602 to S613 are performed; and in a case where the pre-installed application determines, according to the configuration file, that the pre-installed application does not need to be installed, the steps of S602 to S613 do not need to be performed.

[0179] S602, in a case where the pre-installed application needs to be installed, the pre-installed application reads channel information from the configuration file.

[0180] S603, the pre-installed application sends the channel information to the system service.

[0181] In a case where it is determined, according to the configuration file, that the pre-installed application needs to be installed, the installation package of the pre-installed application stored by the electronic device before factory shipment can be automatically run to install the pre-installed application. After the pre-installed application is installed, the pre-installed application can read the channel information of the pre-installed application from the configuration file.

[0182] Then, the pre-installed application calls an interface provided by the system service, and sends the channel information of the pre-installed application to the system service. For example, the pre-installed application calls an interface provided by the system service, and sends a saveAutoInstallChannelProrerties instruction containing the channel information of the pre-installed application to the system service.

[0183] S604, the system service generates a second file, and writes the channel information into the second file.

[0184] After receiving the channel information of the pre-installed application sent by the pre-installed application, the system service generates a second file under the data directory, and writes the channel information of the pre-installed application into the second file.

[0185] In some scenarios, in a case where the electronic device installs multiple pre-installed applications by running installation packages of the multiple pre-installed applications stored by the electronic device before factory shipment after the electronic device is started for the first time, the system service can generate a second file after the multiple pre-installed applications are all installed, and then the system service writes the channel information of the multiple pre-installed applications into the second file at one time.

[0186] S605, in a case where the system service writes the channel information into the second file, the system service sends first indication information to the pre-installed application; the first indication information is used to indicate that the channel information has been written into the second file.

[0187] S606, the pre-installed application sets a state of the channel attribute hot update switch to an enabled state in response to the first indication information.

[0188] After the system service writes the channel information of the pre-installed application into the second file, the system service can send the first indication information to the pre-installed application to indicate that the channel information of the pre-installed application has been written into the second file.

[0189] After the pre-installed application receives the first indication information sent by the system service, the pre-installed application sets the state of the channel attribute hot update switch to the enabled state (i.e., start state) in response to the first indication information.

[0190] Therefore, according to the execution steps of S605 and S606 described above, in a case where the channel information is written into the second file, the pre-installed application sets the state of the channel attribute hot update switch to the enabled state.

[0191] S607, the attribute service listens to the state of the channel attribute hot update switch being the enabled state.

[0192] S608, in a case where the attribute service listens to the state of the channel attribute hot update switch being the enabled state, the attribute service sends second indication information to the startup customization service; the second indication information is used to indicate that the state of the channel attribute hot update switch is the enabled state.

[0193] The startup customization service can register a channel hot update event and a processing function (i.e., mscw.auto_install.prop_liveupdate), and the channel hot update event and the processing function are used to listen to the state of the channel attribute hot update switch. In some embodiments, the channel hot update event and the processing function can be an rc file, which can be understood as a file with an rc suffix.

[0194] The attribute service can listen to the state of the channel attribute hot update switch in real time based on the channel hot update event and the processing function. Therefore, after the pre-installed application sets the state of the channel attribute hot update switch to the enabled state, the attribute service can listen to the state of the channel attribute hot update switch being the enabled state.

[0195] In a case where the attribute service listens to the state of the channel attribute hot update switch being the enabled state, the attribute service sends the second indication information to the startup customization service to indicate that the state of the channel attribute hot update switch is the enabled state.

[0196] S609. The startup customization service reads the channel information from the second file in response to the second indication information.

[0197] After receiving the second indication information sent by the attribute service, the startup customization service reads the channel information of the pre-installed application from the second file in response to the second indication information.

[0198] Therefore, according to the execution steps of S607 to S609 described above, in the case where the state of the channel attribute hot update switch is the start state, the startup customization service reads the channel information from the second file.

[0199] S610. The startup customization service obtains the installation package name of the pre-installed application from the channel information.

[0200] S611. The startup customization service saves the installation package name and the channel information in the first file in the form of a key-value pair.

[0201] After the startup customization service reads the channel information of the pre-installed application from the second file, the startup customization service can parse the channel information of the pre-installed application, and obtain the installation package name of the pre-installed application from the channel information of the pre-installed application. Then, the startup customization service can save the installation package name of the pre-installed application and the channel information of the pre-installed application in the first file in the form of a key-value pair.

[0202] It should be noted that after the system service writes the channel information of the pre-installed application into the second file, the startup customization service still needs to read the channel information of the pre-installed application from the second file and save the channel information of the pre-installed application to the first file again, because the system service does not have an external data interface, and the upper-layer application (such as the pre-installed application) cannot directly obtain the channel information of the pre-installed application from the second file. The startup customization service provides an external data interface, so that the upper-layer application (such as the pre-installed application) can obtain the channel information of the pre-installed application from the first file.

[0203] Moreover, since the startup customization service cannot directly obtain the channel information sent by the pre-installed application, the startup customization service can read the channel information from the second file only after the system service obtains the channel information sent by the pre-installed application and writes it into the second file.

[0204] In some embodiments, the first file where the boot-up customization service stores channel information can be a system cache file. When the electronic device stops working (e.g., is powered off), the channel information of the pre-installed applications stored in the first file will be lost. Therefore, each time the electronic device is powered on, the boot-up customization service reads the channel information of the pre-installed applications from the second file once and saves it in the first file once. The system service only writes the channel information of the pre-installed applications into the second file once after the electronic device is powered on for the first time.

[0205] S612, the startup customization service sets the channel attribute hot update switch to the off state.

[0206] S613, the attribute service has detected that the channel attribute hot update switch is in the off state.

[0207] After saving the installation package name and channel information in the form of key-value pairs in the first file, the boot customization service can set the status of the channel attribute hot update switch to the end state (i.e., finish state).

[0208] The attribute service can monitor the status of the channel attribute hot update switch in real time based on the channel hot update event and its handling function. Therefore, after the startup customization service sets the channel attribute hot update switch to the off state, the attribute service can detect that the channel attribute hot update switch is in the off state.

[0209] After the execution steps of S611, that is, after the channel information is saved in the first file, when the pre-installed application is started, the pre-installed application obtains the channel information from the first file based on the installation package name of the pre-installed application; the pre-installed application reports the channel information to the server.

[0210] When a user opens the pre-installed application, i.e., when the pre-installed application is launched, the pre-installed application can obtain the channel information of the pre-installed application from the first file based on the installation package name of the pre-installed application; then, the pre-installed application sends the obtained channel information to the server.

[0211] For example, a pre-installed application can send its channel information to a server via a communication module. The communication module is used to enable data transmission between devices. This communication module may include a mobile communication module or a wireless communication module; this embodiment does not limit the specific type of module.

[0212] The above combination Figures 4 to 6 The method for reporting channel information provided in the embodiments of this application has been described. The apparatus for executing the above method provided in the embodiments of this application is described below. Figure 7 As shown, Figure 7A structural diagram of a channel information reporting device is provided in the embodiments of the present application. The channel information reporting device can be an electronic device or a chip or chip system in the electronic device in the embodiments of the present application.

[0213] As shown in Figure 7 The channel information reporting device 700 includes a processing unit 701 and a communication unit 702. The processing unit 701 is configured to support the channel information reporting device 700 to perform the processing steps described above. The communication unit 702 is configured to support the channel information reporting device 700 to perform the data sending and data receiving steps described above. The communication unit 702 can be an input or output interface, a pin or a circuit, etc.

[0214] Specifically, the processing unit 701 is configured to determine whether a pre-installed application needs to be installed according to a configuration file in a first booting of the electronic device, the first booting including a first booting after factory delivery or a restart after a factory reset. The processing unit 701 is configured to read channel information of the pre-installed application from the configuration file in a case where the pre-installed application needs to be installed, the channel information being used to indicate an installation channel of the pre-installed application and being installed through an installation package stored before factory delivery after the first booting. The processing unit 701 is configured to save the channel information in a first file. The processing unit 701 is configured to acquire the channel information from the first file in a case where the pre-installed application is started. The communication unit 702 is configured to report the channel information to a server.

[0215] In a possible implementation, the channel information reporting device 700 further includes a storage unit 703. The storage unit 703 is connected to the processing unit 701 through a line. The storage unit 703 can include one or more memories, and the memory can be a device for storing programs or data in one or more devices or circuits. The storage unit 703 can exist independently and be connected to the processing unit 701 through a communication bus. The storage unit 703 can also be integrated with the processing unit 701.

[0216] The storage unit 703 can store computer execution instructions of a method in the electronic device, so as to enable the processing unit 701 to perform the method in the above embodiments. The storage unit 703 can be a register, a cache or a random access memory (RAM), etc. The storage unit 703 can be integrated with the processing unit 701. The storage unit 703 can be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions. The storage unit 703 can exist independently of the processing unit 701.

[0217] Figure 8 A structural diagram of a chip is provided in the embodiments of the present application. As shown inFigure 8 As shown, the chip 800 includes one or more (including two) processors 801, a communication line 802 and a communication interface 803. Optionally, the chip 800 further includes a memory 804.

[0218] In some embodiments, the memory 804 stores the following elements: executable modules or data structures, or a subset thereof, or an extended set thereof.

[0219] The method described in the above embodiments of the present application can be applied to the processor 801 or implemented by the processor 801. The processor 801 can be an integrated circuit chip having a processing capability. In the implementation process, each step of the above method can be completed by the integrated logic circuit or the instruction in the form of software in the processor 801. The processor 801 described above can be a general processor (for example, a microprocessor or a conventional processor), a digital signal processor, an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component. The processor 801 can implement or execute the disclosed methods, steps and logic block diagrams in the embodiments of the present application.

[0220] The steps of the method disclosed in the embodiments of the present application can be directly embodied as a hardware decoding processor for execution, or a combination of hardware and software modules in the decoding processor for execution. Among them, the software module can be located in a mature storage medium in the art such as random access memory, read-only memory, programmable read-only memory or electrically erasable programmable read-only memory (EEPROM). The storage medium is located in the memory 804, and the processor 801 reads the information in the memory 804 and combines the hardware to complete the steps of the above method.

[0221] The processor 801, the memory 804 and the communication interface 803 can communicate through the communication line 802.

[0222] In the above embodiments, the instructions stored in the memory for the processor to execute can be implemented in the form of a computer program product. Among them, the computer program product can be written in the memory in advance, or downloaded and installed in the memory in the form of software.

[0223] The embodiments of the present application further provide a computer program product comprising one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions according to the embodiments of the present application are wholly or partially generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network or other programmable devices. The computer instructions can be stored in a computer readable storage medium or transferred from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions can be transferred from one website, computer, server or data center to another website, computer, server or data center through a wired (for example, coaxial cable, optical fiber, digital subscriber line (DSL) or wireless (for example, infrared, wireless, microwave, etc.) manner. The computer readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. integrated with one or more available media. For example, the available media can include magnetic media (for example, floppy disk, hard disk or magnetic tape), optical media (for example, digital versatile disc (DVD)) or semiconductor media (for example, solid state disk (SSD)) and the like.

[0224] The embodiments of the present application provide an electronic device, which comprises a processor and a memory. The memory is configured to store a computer program, and the processor is configured to execute the computer program to perform the channel information reporting method described above.

[0225] The embodiments of the present application provide a chip. The chip comprises a processor configured to invoke a computer program in a memory to execute the technical solutions in the above embodiments. The implementation principles and technical effects are similar to those of the above related embodiments, which will not be described here.

[0226] The embodiments of the present application further provide a computer readable storage medium. The computer readable storage medium stores computer programs or instructions. The computer programs or instructions are executed by the processor to implement the above method. The method described in the above embodiments can be wholly or partially implemented by software, hardware, firmware or any combination thereof. If implemented in software, the functions can be stored as one or more instructions or codes on a computer readable medium or transmitted on a computer readable medium. The computer readable medium can include computer storage medium and communication medium, and can also include any medium that can transfer computer programs from one place to another. The storage medium can be any target medium accessible by a computer.

[0227] As a possible design, the computer readable medium can include a compact disc read-only memory (CD-ROM), a RAM, a ROM, an EEPROM, or other optical disk storage; the computer readable medium can include a magnetic disk storage or other magnetic disk storage device. Moreover, any connection line can also be properly referred to as a computer readable medium. For example, if software is transmitted from a website, a server, or other remote source using a coaxial cable, an optical fiber cable, a twisted pair, a DSL, or wireless technology (such as infrared, radio, and microwave), the coaxial cable, the optical fiber cable, the twisted pair, the DSL, or the wireless technology (such as infrared, radio, and microwave) is included in the definition of the medium. As used herein, a disk and a disc include a compact disc (CD), a laser disc, an optical disc, a DVD, a floppy disk, and a Blu-ray disc, where a disk usually reproduces data magnetically, while a disc reproduces data optically with a laser. Combinations of the above should also be included in the scope of the computer readable medium.

[0228] Embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, as well as combinations of flows 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 a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing apparatus to produce a machine, so that the instructions executed by the computer or other programmable data processing apparatus generate a means for implementing the functions specified in the flowcharts and / or block diagrams. Figure 1 one or more flows and / or blocks Figure 1 an apparatus that carries out the functions specified in one or more flows or blocks.

[0229] The above detailed description of the application is further detailed to explain the purposes, technical solutions, and beneficial effects of the present application. It should be understood that the above is only a specific embodiment of the present application, and is not used to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made on the basis of the technical solutions of the present application should be included in the protection scope of the present application.

Claims

1. A method for reporting channel information, characterized in that, The method is applied to an electronic device, and the electronic device stores an installation package and a configuration file of a pre-installed application before leaving a factory, and the method comprises the following steps: In the case that the electronic device is started for the first time, the electronic device determines whether the pre-installed application needs to be installed according to the configuration file; the first start includes a first start after leaving the factory or a restart after a factory setting is restored; In the case that the pre-installed application needs to be installed, the electronic device reads channel information of the pre-installed application from the configuration file; the channel information is used to indicate an installation channel of the pre-installed application, and is installed through the installation package stored before leaving the factory after the first start; The electronic device writes the channel information into a second file; The electronic device reads the channel information from the second file; The electronic device obtains an installation package name of the pre-installed application from the channel information; The electronic device saves the installation package name and the channel information of the pre-installed application in a first file, and the second file is different from the first file; In the case that the pre-installed application is started, the electronic device obtains the channel information from the first file; The electronic device reports the channel information to a server.

2. The method of claim 1, wherein, The electronic device saves the installation package name and the channel information of the pre-installed application in a first file, and the electronic device comprises the following steps: The electronic device saves the installation package name and the channel information of the pre-installed application in the first file in the form of a key-value pair.

3. The method of claim 1, wherein, The electronic device comprises a system service; the electronic device reads the channel information of the pre-installed application from the configuration file, and the electronic device comprises the following steps: The pre-installed application reads the channel information from the configuration file; Correspondingly, the electronic device writes the channel information into a second file, and the electronic device comprises the following steps: The pre-installed application sends the channel information to the system service; The system service generates the second file and writes the channel information into the second file.

4. The method of claim 3, wherein, The electronic device further comprises a start customization service; the electronic device reads the channel information from the second file, and the electronic device comprises the following steps: In the case that the channel information is written into the second file, the pre-installed application sets a state of a channel attribute hot update switch to an enabled state; In the case that the state of the channel attribute hot update switch is the enabled state, the start customization service reads the channel information from the second file.

5. The method of claim 4, wherein, The case that the pre-installed application sets the state of the channel attribute hot update switch to the enabled state in the case that the channel information is written into the second file, and the case comprises the following steps: In the case that the system service writes the channel information into the second file, the system service sends first indication information to the pre-installed application; the first indication information is used to indicate that the channel information has been written into the second file; The pre-installed application sets the state of the channel attribute hot update switch to the enabled state in response to the first indication information.

6. The method of claim 4, wherein, The electronic device further comprises an attribute service; in a case where the state of the channel attribute hot update switch is the starting state, the boot customization service reads the channel information from the second file, comprising: In a case where the attribute service listens to the state of the channel attribute hot update switch being the starting state, the attribute service sends second indication information to the boot customization service; the second indication information is used to indicate that the state of the channel attribute hot update switch is the starting state; The boot customization service reads the channel information from the second file in response to the second indication information.

7. The method of claim 4, wherein, The electronic device obtains the installation package name of the pre-installed application from the channel information, comprising: The boot customization service obtains the installation package name of the pre-installed application from the channel information; Correspondingly, the electronic device saves the installation package name of the pre-installed application and the channel information in the form of key-value pairs in the first file, comprising: The boot customization service saves the installation package name of the pre-installed application and the channel information in the form of key-value pairs in the first file.

8. The method of claim 7, wherein, The electronic device further comprises an attribute service; after the boot customization service saves the installation package name of the pre-installed application and the channel information in the form of key-value pairs in the first file, further comprising: The boot customization service sets the state of the channel attribute hot update switch to an ending state; The attribute service listens to the state of the channel attribute hot update switch being the ending state.

9. The method according to any one of claims 1 to 8, characterized in that, The configuration file comprises first SIM card information associated with the pre-installed application; The electronic device determines whether the pre-installed application needs to be installed according to the configuration file, comprising: The electronic device obtains second SIM card information corresponding to a SIM card installed on the electronic device; The electronic device determines whether the first SIM card information matches the second SIM card information; Wherein, in a case where the first SIM card information matches the second SIM card information, the electronic device determines that the pre-installed application needs to be installed; in a case where the first SIM card information does not match the second SIM card information, the electronic device determines that the pre-installed application does not need to be installed.

10. The method according to any one of claims 1 to 8, characterized in that, The configuration file comprises first country information associated with the pre-installed application; The electronic device determines whether the pre-installed application needs to be installed according to the configuration file, comprising: The electronic device obtains second country information of a country where the electronic device is located; The electronic device determines whether the first country information matches the second country information; Wherein, in a case where the first country information matches the second country information, the electronic device determines that the pre-installed application needs to be installed; in a case where the first country information does not match the second country information, the electronic device determines that the pre-installed application does not need to be installed.

11. The method of claim 2, wherein, The electronic device obtains the channel information from the first file in a case where the pre-installed application is started, comprising: In a case that the pre-installed application is started, the pre-installed application acquires the channel information from the first file based on a package name of the pre-installed application; Correspondingly, the electronic device reports the channel information to a server, including: The pre-installed application reports the channel information to the server.

12. An electronic device, comprising: The electronic device includes a memory and a processor, the memory is configured to store a computer program, and the processor is configured to invoke the computer program to execute the reporting method of the channel information according to any one of claims 1 to 11.

13. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program or instructions, when the computer program or instructions are executed, the reporting method of the channel information according to any one of claims 1 to 11 is implemented.

14. A computer program product, characterised in that, The computer program is included, when the computer program is executed, the reporting method of the channel information according to any one of claims 1 to 11 is implemented.

Citation Information

Patent Citations

  • Application program information reporting and receiving method and device

    CN110737563A

  • Method and device for determining source channel, equipment and computer storage medium

    CN111367963A