Information acquisition method and apparatus, electronic device, and medium

By utilizing the reflection mechanism in the SMS application to obtain the IMS module registration result callback method, the problem of high cost of SIM card number acquisition in the existing technology is solved, and low-cost SIM card number acquisition without modifying the framework layer is achieved.

WO2026124392A1PCT designated stage Publication Date: 2026-06-18VIVO MOBILE COMM CO LTD

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
VIVO MOBILE COMM CO LTD
Filing Date
2025-12-08
Publication Date
2026-06-18

AI Technical Summary

Technical Problem

The existing methods for obtaining SIM card numbers in electronic devices are costly, especially the high cost of sending and receiving SMS messages, and the high cost of improving the framework layer.

Method used

By utilizing reflection in the SMS application to obtain the IMS registration result callback method of the IP Multimedia Subsystem (IMS) module from the framework layer, the registration result information is listened to and extracted to obtain the SIM card number, thus avoiding SMS sending and receiving charges and framework layer improvements.

🎯Benefits of technology

It enables low-cost acquisition of SIM card numbers, saving on tariffs and improvement costs, and is suitable for electronic devices running older versions of Android.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025140631_18062026_PF_FP_ABST
    Figure CN2025140631_18062026_PF_FP_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of electronic devices, and discloses an information acquisition method and apparatus, an electronic device, and a medium. The method is applied to an electronic device, and comprises: on the basis of a short message application, using a reflection mechanism to acquire, from a framework layer, an IMS registration result callback method corresponding to an IP multimedia subsystem (IMS) module, wherein the IMS registration result callback method comprises a predefined class, the predefined class comprises registration result information of an IMS service, the predefined class further comprises a monitoring method, and the monitoring method is configured for extracting the registration result information from the predefined class; extracting the registration result information from the predefined class on the basis of the monitoring method, wherein the registration result information comprises SIM card number information; and obtaining the SIM card number information on the basis of the registration result information.
Need to check novelty before this filing date? Find Prior Art

Description

Information acquisition methods, devices, electronic equipment and media

[0001] Cross-references to related applications

[0002] This application claims priority to Chinese Patent Application No. 202411833125.2, filed on December 12, 2024, entitled “Information Acquisition Method, Apparatus, Electronic Device and Medium”, the entire contents of which are incorporated herein by reference. Technical Field

[0003] This application relates to the field of electronic equipment technology, and in particular to an information acquisition method, apparatus, electronic device, and medium. Background Technology

[0004] Current electronic devices all support system-level push services, which typically send messages to user devices based on the device's unique identifier. The push messages received by user devices are actually sent by various push service providers based on the device's unique identifier. Before these services can send messages, the device must first establish a mapping between its unique identifier and the Subscriber Identification Module (SIM) card number installed within it.

[0005] Before establishing the correspondence between the unique identifier of an electronic device and the SIM card number installed in the electronic device, the SIM card number installed in the electronic device must first be obtained. However, the current method of obtaining the SIM card number installed in the electronic device is costly. Summary of the Invention

[0006] The purpose of this application is to provide an information acquisition method, apparatus, electronic device, and medium to acquire the number information of a SIM card installed in an electronic device at low cost.

[0007] In a first aspect, embodiments of this application provide an information acquisition method, the method comprising:

[0008] Based on the SMS application, the IMS registration result callback method corresponding to the IP Multimedia Subsystem (IMS) module is obtained from the framework layer using a reflection mechanism. The IMS registration result callback method includes a preset class, which includes the registration result information of the IMS service. The preset class includes a listening method, which is used to extract the registration result information from the preset class.

[0009] Based on the monitoring method, the registration result information is extracted from the preset class, wherein the registration result information includes the SIM card number information;

[0010] Based on the registration result information, the SIM card number information is obtained.

[0011] Secondly, embodiments of this application provide an information acquisition device, which includes:

[0012] The first acquisition module is used to obtain the IMS registration result callback method corresponding to the IP Multimedia Subsystem (IMS) module from the framework layer based on the SMS application using a reflection mechanism. The IMS registration result callback method includes a preset class, which includes the registration result information of the IMS service. The preset class includes a listening method, which is used to extract the registration result information from the preset class.

[0013] The first extraction module is used to extract the registration result information from the preset class based on the monitoring method, wherein the registration result information includes SIM card number information;

[0014] The first determining module is used to obtain the SIM card number information based on the registration result information.

[0015] Thirdly, embodiments of this application also provide an electronic device, the device including a processor and a memory, the memory storing a program or instructions executable on the processor, the program or instructions, when executed by the processor, implementing the steps of the method as described in the first aspect.

[0016] Fourthly, embodiments of this application also provide an electronic device configured to perform the information acquisition method as described in the first aspect.

[0017] Fifthly, embodiments of this application provide a readable storage medium on which a program or instructions are stored, which, when executed by a processor, implement the steps of the method described in the first aspect.

[0018] In a sixth aspect, embodiments of this application provide a chip, the chip including a processor and a communication interface, the communication interface being coupled to the processor, the processor being used to run programs or instructions to implement the method as described in the first aspect.

[0019] In a seventh aspect, embodiments of this application provide a computer program product stored in a storage medium, which is executed by at least one processor to implement the method described in the first aspect.

[0020] In this embodiment, a reflection mechanism is used to reflectively call the registration result callback method corresponding to the IP Multimedia Subsystem module in the framework layer of the SMS application. The preset class of the registration result callback method includes the registration result information of the IP Multimedia Subsystem service. The listening method in the preset class is used to listen for the registration result information to be fed back to the IP Multimedia Subsystem service in the framework layer. This allows the SMS application to obtain the registration result information of the IP Multimedia Subsystem service, and then obtain the SIM card number information based on the registration result information. In this way, the SIM card number information can be obtained in the application layer of the electronic device without the cost of sending and receiving SMS messages or the need to improve the framework layer. This saves on cost and the cost of improving the framework layer, and achieves the effect of obtaining the SIM card number information installed in the electronic device at a low cost. Attached Figure Description

[0021] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments of this application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0022] Figure 1 is a flowchart illustrating the information acquisition method provided in some embodiments of this application;

[0023] Figure 2 is a flowchart illustrating the information acquisition method provided in some embodiments of this application;

[0024] Figure 3 is a schematic diagram of the structure of an information acquisition device shown in some embodiments of this application;

[0025] Figure 4 is a schematic diagram of the structure of an electronic device shown in some embodiments of this application;

[0026] Figure 5 is a schematic diagram of the hardware structure of an electronic device shown in some embodiments of this application. Detailed Implementation

[0027] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.

[0028] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.

[0029] Before introducing the technical solutions of the embodiments of this application, the background technology of the embodiments of this application will be introduced first:

[0030] Currently, the application layer of electronic devices obtains the SIM card number information installed in the electronic device in the following ways:

[0031] 1. After the SIM card is installed in an electronic device, the electronic device actively sends specific content to a specific mobile phone number. Based on the service provider corresponding to the specific mobile phone number, the number information of the SIM card can be obtained.

[0032] 2. The service provider (SP) sends specific SMS content to the electronic device. The SMS application encrypts the SMS content and sends a receipt to the SP to match the SIM card number with the device identifier of the electronic device.

[0033] Third, by using the operating system of the electronic device to call the native interface function, the SIM card number can be obtained.

[0034] Fourth, after an electronic device registers the IP Multimedia Subsystem (IMS) service, the registration result information of the IMS service will be fed back to the framework layer of the electronic device. The registration result information of the IMS service will include the SIM card number information, so the SIM card number can be obtained based on the interface of the framework layer.

[0035] Of the methods for obtaining a SIM card number mentioned above, the first and second methods have no specific requirements for the chip type and version of the electronic device, but sending and receiving SMS messages incurs higher costs. The third method is only supported by chip version 13 and above. The fourth method requires the Original Equipment Manufacturer (OEM) to improve the framework layer structure because the existing framework layer can only temporarily receive IMS service registration result information and cannot store it. Therefore, the framework layer structure needs to be improved to save the IMS service registration result information to a specific interface of the framework layer for the application layer to call. However, improving the framework layer structure is costly.

[0036] In summary, existing methods for obtaining the SIM card number installed in a device are costly. To address this issue, this application provides an information acquisition method, apparatus, electronic device, and medium. Based on a reflection mechanism, the method uses reflection to call the registration result callback method corresponding to the IP Multimedia Subsystem module in the framework layer of the SMS application. The preset class of this registration result callback method includes registration result information of the IP Multimedia Subsystem service. By using a listening method in the preset class to monitor the registration result information of the IP Multimedia Subsystem service, the SMS application can listen for the registration result information fed back to the framework layer, enabling it to obtain the registration result information of the IP Multimedia Subsystem service. Based on this registration result information, the SIM card number information can be obtained. This eliminates the need for SMS sending and receiving costs and framework layer modifications, allowing the SIM card number information to be obtained directly at the application layer of the electronic device. This saves on costs and framework layer modification costs, achieving a low-cost method for obtaining the SIM card number information installed in the electronic device.

[0037] Before introducing the solutions of the embodiments of this application, let's first introduce the technical terms involved in the embodiments of this application:

[0038] The IMS module is used to support IP Multimedia Subsystem (IMS) functions. IMS is a technology used to support IP multimedia services such as Voice over LTE (VoLTE) and Video over LTE (ViLTE). The IMS module provides a set of classes and interfaces for managing IMS functions on the Android platform, including call handling, call processing, and message passing.

[0039] IMS service registration: In a communication network, IMS service registration is a fundamental step for electronic devices to access the network and conduct communication.

[0040] Sub Id: The index of the SIM card in the electronic device. Each electronic device has one and only one Sub Id for each SIM card. The Sub Id corresponds to the identity (ID) of the card slot used to place the SIM card in the electronic device.

[0041] Reflection mechanism: a mechanism that allows a program to dynamically access class attributes and methods. In this embodiment, it is used for SMS applications to call classes and methods within the framework layer across modules.

[0042] The technical solution of this application embodiment can be applied to the scenario of obtaining the SIM card number in an electronic device with a low version of Android system. Here, the low version of Android system can be Android system version 8.0-12.0, because electronic devices with Android system version higher than 12.0 can obtain the SIM card number by relying on the third method in the background technology.

[0043] The information acquisition method provided in this application will be described in detail below with reference to the accompanying drawings, through specific embodiments and application scenarios.

[0044] Figure 1 is a flowchart illustrating an information acquisition method provided in an embodiment of this application. The subject executing the information acquisition method can be an electronic device, which may be, but is not limited to, a personal computer (PC), a smartphone, a tablet computer, or a personal digital assistant (PDA).

[0045] It should be noted that the operating system of the electronic device in this application embodiment is a first operating system within a preset version range, which can be version 8.0-12.0, and the first operating system can be the Android operating system.

[0046] As shown in Figure 1, the information acquisition method provided in this application embodiment may include steps 110-130.

[0047] Step 110: Based on the SMS application, use the reflection mechanism to obtain the IMS registration result callback method corresponding to the IP Multimedia Subsystem (IMS) module from the framework layer.

[0048] The IMS registration result callback method can be a method used to call back the registration result of the IMS service.

[0049] The IMS registration result callback method differs depending on the operating system version. For example, for operating systems 11-12, the IMS registration result callback method can be the `addRegistrationCallback(RegistrationManager.RegistrationCallback callback)` method in the `ImsManager` class. For operating system 10.0, the IMS registration result callback method can be the `addRegistrationCallback(ImsMmTelManager.RegistrationCallback callback)` method in the `ImsManager` class. For operating system 9.0, the IMS registration result callback method can be the `addRegistrationCallback(android.telephony.ims.stub.ImsRegistrationImplBase.Callback callback)` method in the `ImsManager` class. For operating system 8.1, the IMS registration result callback method can be the `addRegistrationListener(com.android.ims.ImsConnectionStateListenerlistener)` method in the `ImsManager` class.

[0050] To better understand the IMS registration result callback methods for reflection calls in different versions of electronic devices, please refer to Table 1, which shows the IMS registration result callback methods for reflection calls in different versions of electronic devices:

[0051] Table 1

[0052] The aforementioned IMS registration result callback method may include a preset class, such as the ImsConnectionStateListener class. This preset class may include the registration result information of the IMS service, which may include the SIM card number information.

[0053] The registration result information of the aforementioned IMS service can be fed back to the preset class through the operation server after the IMS service registration is completed. The specific registration process of the IMS service will be described in detail in the later embodiments.

[0054] The aforementioned preset class may include a listener method, which can be used to extract registration result information from the preset class.

[0055] It should be noted that the SMS application is located in the application layer of the electronic device, that is, the method of this application embodiment is applied in the application layer of the electronic device.

[0056] In some embodiments of this application, when the SMS application uses the reflection mechanism to obtain the IMS registration result callback method corresponding to the IP Multimedia Subsystem (IMS) module from the framework layer, it is necessary to determine that the SMS application is in the startup state. Specifically, the SMS application startup can be triggered by the electronic device being powered on or by a change in the insertion or removal status of the SIM card.

[0057] In some embodiments of this application, prior to step 110, the method described above may further include:

[0058] If the SMS application receives a preset broadcast, it sends a registration request for the IMS service to the operator's server, so that the operator's server registers the IMS service based on the registration request and feeds back the registration result information of the IMS service to the preset class.

[0059] The preset broadcast can be any of the following: power-on broadcast or broadcast of SIM card insertion / removal status changes.

[0060] A registration request can be a request sent by an electronic device to the operator's server to register for IMS services.

[0061] In some embodiments of this application, when the SMS application receives a preset broadcast, it can send a registration request for the IMS service to the operator server. After receiving the registration request, the operator server can register the IMS service based on the registration request and feed back the registration result information of the IMS service to the preset class.

[0062] It should be noted that the IMS registration result callback method includes multiple classes. When the operator server sends the IMS service registration result information to the IMS registration result callback method, the specific class it sends the information to can be set according to requirements, and is not limited in this embodiment. For example, the operator server may randomly send the IMS service registration result information to a certain class in the IMS registration result callback method. After randomly sending the IMS service registration result information to a certain class in the IMS registration result callback method, the operator server can send the same class information to the electronic device so that the subsequent electronic device can obtain the registration result information based on that class.

[0063] In the fourth method of obtaining SIM card number information in the prior art, in electronic devices of version 12.0, the registration result information of IMS service is fed back to the ImsConnectionStateListener class of the electronic device. Referring to the prior art, the preset class in the embodiment of this application is the ImsConnectionStateListener class.

[0064] In the embodiments of this application, when it is determined that the SMS application has received a preset broadcast, it can send an IMS service registration request to the operator server, so that the operator server registers the IMS service based on the registration request and feeds back the IMS service registration result information to the preset class. In this way, the SMS application of the electronic device can obtain the SIM card number information through the IMS registration result callback method containing the preset class called by reflection.

[0065] In some embodiments of this application, to improve the flexibility of the preset broadcast received by the electronic device, determining that the SMS application has received the preset broadcast may include:

[0066] If the chip type of the electronic device is Type 1, and the electronic device is detected to be restarted or the SIM card insertion / removal status is updated, it is determined that the SMS application of the electronic device has received a power-on broadcast or a SIM card insertion / removal status change broadcast.

[0067] If the chip type of the electronic device is type 2, and the electronic device is detected to have restarted, it is determined that the SMS application of the electronic device received a power-on broadcast.

[0068] The first type and the second type can be two types of chips in electronic devices, and the developers of the first type and the second type of chips are different.

[0069] In some embodiments of this application, for electronic devices with a chip type of type 1, when it is detected that the electronic device has restarted or the insertion / removal status of the SIM card has been updated, it is determined that the SMS application of the electronic device has received a power-on broadcast or a broadcast on the change in the insertion / removal status of the SIM card.

[0070] For electronic devices with a chip type of type 2, if a restart of the electronic device is detected, it is determined that the SMS application of the electronic device has received a power-on broadcast.

[0071] In the embodiments of this application, different chip types of electronic devices receive different preset broadcasts, which improves the flexibility of the preset broadcasts received by the electronic devices.

[0072] In some embodiments of this application, the timing of executing step 110 differs for different operating systems and different chip types of electronic devices. To improve the flexibility of reflecting and calling the IMS registration result callback method, step 110 may specifically include:

[0073] When the operating system version of the electronic device is version 1, the chip type of the electronic device is type 1, and the interface registration of the IMS module is completed, the SMS application uses the reflection mechanism to obtain the IMS registration result callback method corresponding to the IP Multimedia Subsystem IMS module from the framework layer.

[0074] When the chip type of the electronic device is type 2, and it is determined that the SMS application has received a preset broadcast, the SMS application uses a reflection mechanism to obtain the IMS registration result callback method corresponding to the IP Multimedia Subsystem (IMS) module from the framework layer.

[0075] The first version could be version 8.1.

[0076] It should be noted that the IMS module interface can be registered when the manufacturer produces the interface.

[0077] In some embodiments of this application, the timing of the reflection call to the IMS registration result callback method differs for different versions of electronic devices. Specifically, for electronic devices with a second chip type and an operating system version of 9.0-12.0, the reflection call to the IMS registration result callback method is performed when registering for the IMS service. For electronic devices with a first chip type and an operating system version of 8.0, the reflection call to the IMS registration result callback method can be performed when registering the IMS interface, without waiting for power-on or SIM card insertion / removal.

[0078] Specifically, if the electronic device's operating system version is 1, the chip type is 1, and the IMS module's interface registration is complete, the SMS application can use reflection to retrieve the IMS registration result callback method corresponding to the IP Multimedia Subsystem IMS module from the framework layer. If the electronic device's chip type is 2, and it is confirmed that the SMS application has received a preset broadcast, the SMS application can use reflection to retrieve the IMS registration result callback method corresponding to the IP Multimedia Subsystem IMS module from the framework layer.

[0079] It should be noted that, upon confirming that the SMS application has received the preset broadcast, the application can utilize reflection to retrieve the IMS registration result callback method corresponding to the IP Multimedia Subsystem (IMS) module from the framework layer. Simultaneously, the IMS service begins its registration process. The specific IMS service registration process will be described in detail in subsequent embodiments. Furthermore, for the SMS application to receive the preset broadcast, the electronic device must first agree to the user agreement.

[0080] It should be noted that for electronic devices with a chip type of type 1 and an operating system version of 8.0, the timing for reflecting and calling the IMS registration result callback method can be executed when registering the IMS interface. However, in practical applications, the IMS registration result callback method can also be reflected and called when the SMS application receives a preset broadcast, rather than when registering the IMS interface. This is because, in practical applications, if it is not for obtaining SIM card number information, reflecting and calling the IMS registration result callback method has no other additional function. Therefore, in order to save computing resources, for electronic devices with a chip type of type 1 and an operating system version of 8.0, the IMS registration result callback method can also be reflected and called when the SMS application receives a preset broadcast.

[0081] In the embodiments of this application, depending on the chip type and operating system version of the electronic device, the IMS registration result callback method corresponding to the IMS module can be obtained from the framework layer at different times based on the SMS application using a reflection mechanism, thereby improving the flexibility of reflection invocation of the IMS registration result callback method.

[0082] In some embodiments of this application, the preset class and the listening method under the preset class in the IMS registration result callback method in the framework layer are not used to listen to the registration result information of the IMS service. In order to make the preset class and the listening method under the preset class in the IMS registration result callback method usable for listening to the registration result information of the IMS service in the SMS application, it is necessary to override the preset class and the listening method under the preset class in the IMS registration result callback method in the SMS application. This overriding can be understood as redefining the role of the preset class and the listening method under the preset class in the IMS registration result callback method.

[0083] The above-mentioned way of redefining the role of the preset class and the listening method under the preset class in the IMS registration result callback method can be as follows: write program code to define the role of the preset class and the listening method under the preset class in the IMS registration result callback method, and then compile the written program code. In this way, the preset class and the listening method under the preset class in the IMS registration result callback method can be used in the SMS application to listen for the registration result information of the IMS service.

[0084] That is, after step 110, the method described above may further include:

[0085] In the SMS application, override the preset class and the listener methods under the preset class so that the listener methods under the preset class can be used to extract registration result information from the preset class.

[0086] In some embodiments of this application, a preset class and a listening method under the preset class can be overridden in the SMS application so that the listening method under the preset class can be used to extract registration result information from the preset class, so that the registration result information can be obtained in the SMS application based on the listening method.

[0087] It should be noted that the overridden preset class and the listening method under the preset class in the SMS application can be executed before or after step 110, and this embodiment of the application is not limited to either. However, if the preset class and the listening method under the preset class are overridden in the SMS application and executed before step 110, the electronic device needs to specify which class in the IMS registration result callback method the registration result information belongs to.

[0088] In the embodiments of this application, by overriding the preset class and the listening method under the preset class in the SMS application, the listening method under the preset class can be used to extract registration result information from the preset class, thereby obtaining the SIM card number information in the SMS application.

[0089] Prior to step 110, the method described above may further include:

[0090] The permission control method corresponding to the IMS module in the framework layer is invoked based on the reflection mechanism, so as to filter and execute the permission call process involved in the IMS registration result callback method based on the permission control method.

[0091] The permission control method can be a method in the framework layer corresponding to the IMS module that controls the permissions involved in the IMS registration result callback method.

[0092] In some embodiments of this application, when the operating system of the electronic device is version 8.1, the SMS application in the operating system of the electronic device uses reflection to obtain the IMS registration result callback method corresponding to the IMS module from the framework layer. This IMS registration result callback method contains a process that needs to call other permissions of the electronic device. However, in the solution of this application embodiment, it is not necessary to call other permissions of the electronic device. Therefore, in order to avoid the problem of permission missing exceptions when the part that needs to call other permissions is executed during the execution of the IMS registration result callback method, the permission control method corresponding to the IMS module in the framework layer is called based on the reflection mechanism. Based on this permission control method, the part that needs to call other permissions can be bypassed during the execution of the IMS registration result callback method. That is, based on this permission control method, the permission call process involved in the IMS registration result callback method can be filtered and executed, so that the problem of permission missing exceptions will not occur.

[0093] The permission control method mentioned above can be the `unregisterBroadcastReceiver` method in the `com.android.ims.ImsManager` class. Based on this `unregisterBroadcastReceiver` method, the permission call process involved in the IMS registration result callback method is filtered and executed. This can avoid the `com.mediatek.ims.config.provider.PERMISSION.WRITE` permission missing exception during the execution of the IMS registration result callback method corresponding to the IMS module obtained from the framework layer by the SMS application using reflection mechanism.

[0094] In the embodiments of this application, before the SMS application uses reflection to obtain the IMS registration result callback method corresponding to the IMS module from the framework layer, the corresponding permission control method of the IMS module in the framework layer is called based on reflection. The permission call process involved in the IMS registration result callback method is filtered and executed based on the permission control method. This can avoid the situation of permission missing anomaly when the electronic device of the first version of the operating system executes the IMS registration result callback method, and ensure the normal execution of the SMS application's reflection call to the IMS registration result callback method, thereby obtaining the SIM card number information.

[0095] Step 120: Extract registration result information from the preset class based on the listening method.

[0096] In some embodiments of this application, since the listening method is overridden in the IMS registration result callback method, the registration result information can be directly extracted from the preset class based on the listening method.

[0097] It should be noted that since the communication framework process may not have started after the electronic device is powered on, the SMS application may fail to call the IMS registration result callback method by reflection. In this case, after the failure of the reflection call to the IMS registration result callback method, it is necessary to wait 1-3 seconds and then call the IMS registration result callback method by reflection again. Repeat this process multiple times to listen for the registration result information of the IMS service.

[0098] To facilitate a better understanding of the registration result information, Tables 2 and 3 below show the timing of the IMS registration result callback method for each version of electronic devices with different chip types, as well as the format of the registration result information listened to and fed back to the IMS service at the framework layer. Specifically, Table 2 shows the timing of the IMS registration result callback method for each version of electronic devices with chip type 1, as well as the format of the registration result information listened to and fed back to the IMS service at the framework layer; Table 3 shows the timing of the IMS registration result callback method for each version of electronic devices with chip type 2, as well as the format of the registration result information listened to and fed back to the IMS service at the framework layer.

[0099] Table 2

[0100] Table 3

[0101] Step 130: Based on the registration result information, obtain the SIM card number information.

[0102] In some embodiments of this application, since the registration result information includes the SIM card number information, specifically in the format shown in Tables 2 and 3 above, the SIM card number information can be obtained based on the registration result information.

[0103] In some embodiments of this application, the format of the registration result information monitored by the electronic device is different depending on the chip type. Therefore, different parsing methods can be used to obtain the SIM card number information from the registration result information according to different chip types. In order to improve the flexibility of obtaining the SIM card number information, step 130 may specifically include:

[0104] When the chip type of the electronic device is type 2, the SIM card number information is extracted from the registration result information using regular expressions.

[0105] In some embodiments of this application, when the chip type of the electronic device is of the first type, as shown in Table 2, the registration result information directly contains the SIM card number information, so the SIM card number information can be directly obtained from the registration result information.

[0106] When the chip type of the electronic device is type 2, as shown in Table 3, the registration result information contains SIM card number information and other information. Therefore, it is necessary to extract the SIM card number information from the registration result information. Specifically, the SIM card number information can be extracted from the registration result information based on regular expressions.

[0107] It should be noted that when the chip type of the electronic device is Type II, the meanings of each piece of information in the registration result information are as follows: Taking the registration result information corresponding to the electronic device of version 11.0 as an example: sip:+8618805199037@js.ims.mnc000.mcc460.3gpnetwork.org, "sip:" is the protocol header, "+8618805199037" is the SIM card number information, and "@js.ims.mnc000.mcc460.3gpnetwork.org" is the protocol tail.

[0108] In the embodiments of this application, different parsing methods are used to obtain the SIM card number information from the registration result information according to different chip types, thereby improving the flexibility of obtaining the SIM card number information.

[0109] In some embodiments of this application, since the state of the IMS registration result callback method is changed after reflection invocation, failure to change the state back may affect the use of the subsequent communication framework layer. Therefore, to avoid affecting the use of the subsequent communication framework layer, after step 130, the method described above may further include:

[0110] The anti-registration method of the IMS registration result callback method is invoked using reflection mechanism to make the IMS registration result callback method fall back to the initial state.

[0111] Among them, the unregistration method can be a method to unregister the IMS registration result callback method, which can make the IMS registration result callback method fall back to the initial state.

[0112] The initial state can be the state before the IMS registration result callback method is invoked by the SMS application via reflection.

[0113] In some embodiments of this application, as shown in Table 1 above, the IMS registration result callback methods corresponding to different versions of electronic devices are different, and therefore the unregistration methods corresponding to the IMS registration result callback methods are also different, as shown in Table 1 above.

[0114] In some embodiments of this application, the unregistration method removeRegistrationListener of the ImsManager class can be invoked via reflection to avoid affecting the subsequent communication framework process.

[0115] In the embodiments of this application, the unregistration method of the IMS registration result callback method is invoked based on the reflection mechanism, so that the IMS registration result callback method can be rolled back to the initial state, thereby avoiding affecting the subsequent communication framework process.

[0116] In some embodiments of this application, each electronic device has one and only one SIM card slot Sub Id for each SIM card. After obtaining the SIM card number information, it needs to be stored in the electronic device. During storage, the correspondence between the SIM card number information and Sub Id needs to be recorded at the same time, that is, the number information corresponding to each SIM card slot in the device is saved.

[0117] It should be noted that the location where the SIM card number information is stored varies depending on the screen state of the electronic device. Therefore, after step 150, the method described above may further include:

[0118] Based on the screen status of the electronic device, the SIM card number information is stored in the target storage location.

[0119] Among them, the screen status of an electronic device can be whether the screen of the electronic device is on or off, specifically whether the screen of the electronic device is locked or unlocked.

[0120] The aforementioned lock screen state can be when the user has not entered a lock screen password, meaning the electronic device is not on its home screen. The unlock screen state can be when a lock screen password has been entered, the electronic device screen has been opened, and the home screen has been displayed.

[0121] The target storage location can be the location where the SIM card's number information is stored based on the screen status of the electronic device.

[0122] In some embodiments of this application, when the electronic device's screen is locked, the electronic device is in File-Based Encryption (FBE) mode. In this state, files cannot be written to the data / data directory, so the SIM card's number information needs to be saved in the DE (data / user_de / 0) directory. If the electronic device is unlocked, the SIM card's number information can be saved in the data / data directory.

[0123] In the embodiments of this application, the SIM card number information can be stored in different storage locations of the electronic device according to the screen status of the electronic device, thereby improving the flexibility of the storage location of the SIM card number information.

[0124] In some embodiments of this application, after obtaining the SIM card number information, the SIM card number information and the device identifier of the electronic device can be uploaded to the server, such as the server of the electronic device, to obtain the correspondence between the SIM card number information and the device identifier of the electronic device. Messages can then be pushed to the electronic device based on this correspondence.

[0125] To better understand the solutions of the embodiments of this application, specific scenarios will now be used to illustrate the solutions of the embodiments of this application.

[0126] As shown in Figure 2, the information acquisition method provided in this application embodiment may include steps 201-212.

[0127] Step 201: Determine the chip type of the electronic device. If it is the first type, proceed to step 202; if it is the second type, proceed to step 203.

[0128] Step 202: Power-on or SIM card insertion / removal status change, the electronic device issues a power-on broadcast or a SIM card insertion / removal status change broadcast.

[0129] When the chip type of the electronic device is Type 1, the SMS application starts after the electronic device sends a power-on broadcast or a broadcast indicating a change in the insertion or removal status of the SIM card. The SMS application can receive the power-on broadcast or the broadcast indicating a change in the insertion or removal status of the SIM card.

[0130] Step 203: Power-on complete, the electronic device emits a power-on broadcast.

[0131] When the chip type of the electronic device is type 2, the SMS application starts after the electronic device sends a power-on broadcast, and the SMS application can receive the power-on broadcast.

[0132] After the electronic device broadcasts a power-on message or a SIM card insertion / removal status change, the electronic device proceeds with the IMS service registration process. Once the IMS service registration is complete, the registration result information can be fed back to the preset class of the IMS registration result callback method in the framework layer.

[0133] Step 204: Determine if the operating system version of the electronic device is equal to the first version. If yes, proceed to step 205; otherwise, proceed to step 206.

[0134] Step 205: Reflection calls the permission control method corresponding to the IMS module in the framework layer.

[0135] In step 205, the permission control method corresponding to the IMS module in the framework layer is invoked by reflection, which can avoid the permission missing anomaly during the execution of the IMS registration result callback method.

[0136] Step 206: Based on the SMS application, use reflection mechanism to obtain the IMS registration result callback method corresponding to the IMS module from the framework layer.

[0137] After step 206, it can be determined whether the IMS registration result callback method was successfully invoked via reflection. If yes, step 207 is executed; otherwise, step 206 is executed again after waiting for 1-3 seconds.

[0138] Step 207: In the SMS application, override the preset class and the listener method under the preset class in the IMS registration result callback method.

[0139] Step 208: Listen for the registration result information of the IMS service using the listener method in the IMS registration result callback method.

[0140] Step 209: Based on the registration result information, obtain the SIM card number information.

[0141] Steps 208-209 above are the same as steps 120-130 in the above embodiment, and will not be repeated here.

[0142] Step 210: Use reflection to call the IMS registration result callback method to unregister the method.

[0143] Step 211: Save the SIM card number information to the target storage location.

[0144] In step 211, the SIM card number information can be saved to the target storage location according to the screen status of the electronic device. The specific implementation method can be referred to the above embodiment, and will not be repeated here.

[0145] Step 212: Upload the SIM card number information and the device identifier of the electronic device to the server.

[0146] The method provided in this application embodiment can reduce the cost of obtaining SIM card number information, and has high accuracy, covers a wide range of electronic devices, and has high application value.

[0147] The information acquisition method provided in this application can be executed by an information acquisition device. This application uses an information acquisition device executing the information acquisition method as an example to illustrate the information acquisition device provided in this application.

[0148] Figure 3 is a schematic diagram of an information acquisition device according to an exemplary embodiment. This information acquisition device can be applied to an electronic device. As shown in Figure 3, the information acquisition device 300 may include:

[0149] The first acquisition module 310 is used to obtain the IMS registration result callback method corresponding to the IP Multimedia Subsystem (IMS) module from the framework layer based on the SMS application using a reflection mechanism. The IMS registration result callback method includes a preset class, which includes the registration result information of the IMS service. The preset class includes a listening method, which is used to extract the registration result information from the preset class.

[0150] The first extraction module 320 is used to extract the registration result information from the preset class based on the monitoring method, wherein the registration result information includes SIM card number information;

[0151] The first determining module 330 is used to obtain the SIM card number information based on the registration result information.

[0152] In the embodiments of this application, a registration result callback method corresponding to the IP Multimedia Subsystem module in the framework layer is invoked in the SMS application based on a reflection mechanism. The preset class of the registration result callback method includes the registration result information of the IP Multimedia Subsystem service. The registration result information fed back to the IP Multimedia Subsystem service in the framework layer is listened to by a listening method in the preset class, so that the SMS application can obtain the registration result information of the IP Multimedia Subsystem service. Based on the registration result information, the SIM card number information can be obtained. In this way, the SIM card number information can be obtained in the application layer of the electronic device without the cost of sending and receiving SMS messages or the need to improve the framework layer. This saves on cost and the cost of improving the framework layer, and achieves the effect of obtaining the SIM card number information installed in the electronic device at a low cost.

[0153] In some embodiments of this application, the apparatus described above may further include:

[0154] The rewrite module is used to rewrite the preset class and the listening method under the preset class in the SMS application after the SMS application obtains the IMS registration result callback method corresponding to the IP Multimedia Subsystem (IMS) module from the framework layer using the reflection mechanism, so that the listening method under the preset class can be used to extract the registration result information from the preset class.

[0155] In some embodiments of this application, the apparatus described above may further include:

[0156] The sending module is configured to, before the SMS application obtains the IMS registration result callback method corresponding to the IP Multimedia Subsystem (IMS) module from the framework layer using a reflection mechanism, send a registration request for the IMS service to the operator server when it is determined that the SMS application has received a preset broadcast, so that the operator server registers the IMS service based on the registration request and feeds back the registration result information of the IMS service to the preset class.

[0157] In some embodiments of this application, the preset broadcast includes any one of the following: power-on broadcast, broadcast of the SIM card insertion / removal status change;

[0158] The sending module may include:

[0159] The first determining unit is configured to determine, when the chip type of the electronic device is of the first type, that the SMS application of the electronic device has received a power-on broadcast or a broadcast on the change in the insertion / removal status of the SIM card, if the electronic device is detected to be restarted or the insertion / removal status of the SIM card is updated.

[0160] The second determining unit is configured to determine, when the electronic device is detected to have restarted, that the SMS application of the electronic device has received a power-on broadcast, provided that the chip type of the electronic device is of the second type; wherein the chip of the first type and the chip of the second type are from different manufacturers.

[0161] In some embodiments of this application, when the operating system version of the electronic device is a first version, the aforementioned apparatus may further include:

[0162] The second acquisition module is used to call the permission control method corresponding to the IMS module in the framework layer based on the reflection mechanism before obtaining the IMS registration result callback method corresponding to the IMS module in the framework layer based on the reflection mechanism, so as to filter and execute the permission call process involved in the IMS registration result callback method based on the permission control method.

[0163] In some embodiments of this application, the apparatus described above may further include:

[0164] The third acquisition module is used to, after obtaining the SIM card number information based on the registration result information, reflectively call the unregistration method of the IMS registration result callback method based on the reflection mechanism, so that the IMS registration result callback method reverts to the initial state.

[0165] In some embodiments of this application, the apparatus described above may further include:

[0166] The storage module is used to store the SIM card number information in a target storage location according to the screen state of the electronic device after obtaining the SIM card number information based on the registration result information.

[0167] The information acquisition device in this application embodiment can be an electronic device or a component within an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other devices besides a terminal. For example, the electronic device can be a mobile phone, tablet computer, laptop computer, PDA, in-vehicle electronic device, mobile internet device (MID), augmented reality (AR) / virtual reality (VR) device, robot, wearable device, ultra-mobile personal computer (UMPC), netbook, or personal digital assistant (PDA), etc. It can also be a server, network attached storage (NAS), personal computer (PC), television set (TV), ATM, or self-service machine, etc. This application embodiment does not specifically limit the device.

[0168] The information acquisition device in this application embodiment can be a device with an operating system. The operating system can be the Android operating system.

[0169] The information acquisition device provided in this application embodiment can implement the various processes implemented in the method embodiment of FIG1. ​​To avoid repetition, it will not be described again here.

[0170] Optionally, as shown in FIG4, this application embodiment also provides an electronic device 400, including a processor 401 and a memory 402. The memory 402 stores a program or instructions that can run on the processor 401. When the program or instructions are executed by the processor 401, they implement the various steps of the above-described information acquisition method embodiment and can achieve the same technical effect. To avoid repetition, they will not be described again here.

[0171] It should be noted that the electronic devices in the embodiments of this application include the mobile electronic devices and non-mobile electronic devices described above.

[0172] Figure 5 is a schematic diagram of the hardware structure of an electronic device that implements an embodiment of this application.

[0173] The electronic device 500 includes, but is not limited to, components such as: radio frequency unit 501, network module 502, audio output unit 503, input unit 504, sensor 505, display unit 506, user input unit 507, interface unit 508, memory 509, and processor 510.

[0174] Those skilled in the art will understand that the electronic device 500 may also include a power supply (such as a battery) for powering various components. The power supply can be logically connected to the processor 510 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. The electronic device structure shown in Figure 5 does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown, or combine certain components, or have different component arrangements, which will not be elaborated here.

[0175] The processor 510 is configured to obtain the IMS registration result callback method corresponding to the IP Multimedia Subsystem (IMS) module from the framework layer using a reflection mechanism based on the SMS application. The IMS registration result callback method includes a preset class containing registration result information for the IMS service. The preset class includes a listening method for extracting the registration result information from the preset class; extracting the registration result information from the preset class based on the listening method; and obtaining the SIM card number information based on the registration result information.

[0176] Thus, based on the reflection mechanism, the SMS application reflects and calls the registration result callback method corresponding to the IP Multimedia Subsystem module in the framework layer. The preset class of this registration result callback method includes the registration result information of the IP Multimedia Subsystem service. Through the listening method in the preset class used to listen for the registration result information, the SMS application can listen for the registration result information fed back to the IP Multimedia Subsystem service in the framework layer, so that the SMS application can obtain the registration result information of the IP Multimedia Subsystem service. Based on the registration result information, the SIM card number information can be obtained. In this way, the cost of sending and receiving SMS messages can be eliminated, and the framework layer can be improved without any modifications. This saves on cost and framework layer improvement costs, and achieves the effect of obtaining the SIM card number information installed in the electronic device at a low cost.

[0177] Optionally, the processor 510 is further configured to, after the SMS application obtains the IMS registration result callback method corresponding to the IP Multimedia Subsystem (IMS) module from the framework layer using a reflection mechanism, rewrite the preset class and the listening method under the preset class in the SMS application, so that the listening method under the preset class is used to extract the registration result information from the preset class.

[0178] Thus, by overriding the preset class and the listening method under the preset class in the SMS application, the listening method under the preset class can be used to extract registration result information from the preset class, and then the SIM card number information can be obtained in the SMS application.

[0179] Optionally, the processor 510 is further configured to, before the SMS application obtains the IMS registration result callback method corresponding to the IP Multimedia Subsystem (IMS) module from the framework layer using a reflection mechanism, send a registration request for the IMS service to the operator server when it is determined that the SMS application has received a preset broadcast, so that the operator server registers the IMS service based on the registration request and feeds back the registration result information of the IMS service to the preset class.

[0180] Thus, if it is determined that the SMS application has received the preset broadcast, it can send an IMS service registration request to the operator server, so that the operator server can register the IMS service based on the registration request and feed back the IMS service registration result information to the preset class. In this way, the SMS application of the electronic device can obtain the SIM card number information through the IMS registration result callback method containing the preset class called by reflection.

[0181] Optionally, the preset broadcast includes any one of the following: a power-on broadcast, a broadcast of the insertion / removal status change of the SIM card; the processor 510 is further configured to, when the chip type of the electronic device is of the first type, determine that the SMS application of the electronic device has received a power-on broadcast or a broadcast of the insertion / removal status change of the SIM card when a restart of the electronic device or an update of the insertion / removal status of the SIM card is detected; and when the chip type of the electronic device is of the second type, determine that the SMS application of the electronic device has received a power-on broadcast when a restart of the electronic device is detected; wherein the chip of the first type and the chip of the second type are from different manufacturers.

[0182] In this way, electronic devices with different chip types receive different preset broadcasts, which improves the flexibility of the preset broadcasts received by electronic devices.

[0183] Optionally, the processor 510 is further configured to, when the operating system version of the electronic device is a first version, before the SMS application uses a reflection mechanism to obtain the IMS registration result callback method corresponding to the IMS module in the framework layer, call the permission control method corresponding to the IMS module in the framework layer based on the reflection mechanism, so as to control the permissions involved in the IMS registration result callback method based on the permission control method.

[0184] Thus, before the SMS application uses reflection to obtain the IMS registration result callback method corresponding to the IMS module from the framework layer, the corresponding permission control method of the IMS module in the framework layer is called based on reflection. The permission control method filters the permission call process involved in the IMS registration result callback method. This avoids the permission missing anomaly when electronic devices of the first version of the operating system execute the IMS registration result callback method, ensuring the normal execution of the SMS application's reflection call to the IMS registration result callback method, and thus obtaining the SIM card number information.

[0185] Optionally, the processor 510 is further configured to, after obtaining the SIM card number information based on the registration result information, reflectively call the unregistration method of the IMS registration result callback method based on a reflection mechanism, so that the IMS registration result callback method reverts to its initial state.

[0186] Thus, by using reflection to call the unregistration method of the IMS registration result callback method, the IMS registration result callback method can be rolled back to its initial state, thereby avoiding affecting the subsequent communication framework process.

[0187] Optionally, the processor 510 is further configured to, after obtaining the SIM card number information based on the registration result information, store the SIM card number information in a target storage location according to the screen state of the electronic device.

[0188] In this way, the SIM card's number information can be stored in different storage locations on the electronic device according to the screen status, thus improving the flexibility of the SIM card's number information storage location.

[0189] It should be understood that, in this embodiment, the input unit 504 may include a graphics processing unit (GPU) 5041 and a microphone 5042. The GPU 5041 processes image data of still images or videos obtained by an image capture device (such as a color camera) in video capture mode or image capture mode. The display unit 506 may include a display panel 5061, which may be configured in the form of a liquid crystal display, an organic light-emitting diode, or the like. The user input unit 507 includes at least one of a touch panel 5071 and other input devices 5072. The touch panel 5071 is also called a touch screen. The touch panel 5071 may include a touch detection device and a touch controller. Other input devices 5072 may include, but are not limited to, a physical keyboard, function keys (such as volume control buttons, power buttons, etc.), a trackball, a mouse, and a joystick, which will not be described in detail here.

[0190] The memory 509 can be used to store software programs and various data. The memory 509 may primarily include a first storage area for storing programs or instructions and a second storage area for storing data. The first storage area may store the operating system, application programs or instructions required for at least one function (such as sound playback, image playback, etc.). Furthermore, the memory 509 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus RAM (DRRAM). The memory 509 in the embodiments of this application includes, but is not limited to, these and any other suitable types of memory.

[0191] Processor 510 may include one or more processing units; optionally, processor 510 integrates an application processor and a modem processor, wherein the application processor mainly handles operations involving the operating system, user interface, and applications, and the modem processor mainly handles wireless communication signals, such as a baseband processor. It is understood that the aforementioned modem processor may also not be integrated into processor 510.

[0192] This application also provides a readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the various processes of the above-described information acquisition method embodiments and achieve the same technical effects. To avoid repetition, they will not be described again here.

[0193] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.

[0194] This application embodiment also provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement the various processes of the above-described information acquisition method embodiments and can achieve the same technical effect. To avoid repetition, it will not be described again here.

[0195] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.

[0196] This application provides a computer program product, which is stored in a storage medium and executed by at least one processor to implement the various processes of the information acquisition method embodiments described above, and can achieve the same technical effect. To avoid repetition, it will not be described again here.

[0197] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.

[0198] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0199] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.

Claims

1. An information acquisition method, the method being applied to an electronic device, the method comprising: Based on the SMS application, the IMS registration result callback method corresponding to the IP Multimedia Subsystem (IMS) module is obtained from the framework layer using a reflection mechanism. The IMS registration result callback method includes a preset class, which includes the registration result information of the IMS service. The preset class includes a listening method, which is used to extract the registration result information from the preset class. Based on the monitoring method, the registration result information is extracted from the preset class, wherein the registration result information includes the SIM card number information; Based on the registration result information, the SIM card number information is obtained.

2. The method according to claim 1, wherein, After the SMS application uses reflection to obtain the IMS registration result callback method corresponding to the IP Multimedia Subsystem (IMS) module from the framework layer, the method further includes: The preset class and the listening method under the preset class are rewritten in the SMS application so that the listening method under the preset class can be used to extract the registration result information from the preset class.

3. The method according to claim 1, wherein, Before the method for obtaining the IMS registration result callback of the IP Multimedia Subsystem (IMS) module from the framework layer using reflection mechanism based on the SMS application, the method further includes: If the SMS application receives a preset broadcast, it sends a registration request for the IMS service to the operator server, so that the operator server registers the IMS service based on the registration request and feeds back the registration result information of the IMS service to the preset class.

4. The method according to claim 3, wherein, The preset broadcast includes any one of the following: power-on broadcast, broadcast of the SIM card insertion / removal status change; The step of determining that the SMS application has received a preset broadcast includes: When the chip type of the electronic device is of type 1, if the electronic device is detected to be restarted or the insertion / removal status of the SIM card is updated, it is determined that the SMS application of the electronic device has received a power-on broadcast or a broadcast of a change in the insertion / removal status of the SIM card. If the chip type of the electronic device is of type two, and the electronic device is detected to have restarted, it is determined that the SMS application of the electronic device has received a power-on broadcast. The developers of the first type of chip and the second type of chip are different.

5. The method according to claim 1, wherein, When the operating system version of the electronic device is version 1, before the method for obtaining the IMS registration result callback method corresponding to the IP Multimedia Subsystem (IMS) module from the framework layer using reflection mechanism based on the SMS application, the method further includes: The permission control method corresponding to the IMS module in the framework layer is invoked based on the reflection mechanism, so as to filter and execute the permission invocation process involved in the IMS registration result callback method based on the permission control method.

6. The method according to claim 1, wherein, After obtaining the SIM card number information based on the registration result information, the method further includes: The anti-registration method of the IMS registration result callback method is invoked using reflection mechanism to make the IMS registration result callback method fall back to the initial state.

7. The method according to claim 1, wherein, After obtaining the SIM card number information based on the registration result information, the method further includes: Based on the screen status of the electronic device, the SIM card number information is stored in the target storage location.

8. An information acquisition device, the device being applied to an electronic device, the device comprising: The first acquisition module is used to obtain the IMS registration result callback method corresponding to the IP Multimedia Subsystem (IMS) module from the framework layer based on the SMS application using a reflection mechanism. The IMS registration result callback method includes a preset class, which includes the registration result information of the IMS service. The preset class includes a listening method, which is used to extract the registration result information from the preset class. The first extraction module is used to extract the registration result information from the preset class based on the monitoring method, wherein the registration result information includes SIM card number information; The first determining module is used to obtain the SIM card number information based on the registration result information.

9. The apparatus according to claim 8, further comprising: The rewrite module is used to rewrite the preset class and the listening method under the preset class in the SMS application after the SMS application obtains the IMS registration result callback method corresponding to the IP Multimedia Subsystem (IMS) module from the framework layer using the reflection mechanism, so that the listening method under the preset class can be used to extract the registration result information from the preset class.

10. The apparatus of claim 8, further comprising: The sending module is configured to, before the SMS application obtains the IMS registration result callback method corresponding to the IP Multimedia Subsystem (IMS) module from the framework layer using a reflection mechanism, send a registration request for the IMS service to the operator server when it is determined that the SMS application has received a preset broadcast, so that the operator server registers the IMS service based on the registration request and feeds back the registration result information of the IMS service to the preset class.

11. The apparatus according to claim 10, wherein, The preset broadcast includes any one of the following: power-on broadcast, broadcast of the SIM card insertion / removal status change; The sending module includes: The first determining unit is configured to determine, when the chip type of the electronic device is of the first type, that the SMS application of the electronic device has received a power-on broadcast or a broadcast on the change in the insertion / removal status of the SIM card, if the electronic device is detected to be restarted or the insertion / removal status of the SIM card is updated. The second determining unit is configured to determine, when the electronic device is detected to have restarted, that the SMS application of the electronic device has received a power-on broadcast, provided that the chip type of the electronic device is of the second type; wherein the chip of the first type and the chip of the second type are from different manufacturers.

12. The apparatus according to claim 8, wherein, If the operating system version of the electronic device is version 1, the device further includes: The second acquisition module is used to call the permission control method corresponding to the IMS module in the framework layer based on the reflection mechanism before obtaining the IMS registration result callback method corresponding to the IMS module in the framework layer based on the reflection mechanism, so as to filter and execute the permission call process involved in the IMS registration result callback method based on the permission control method.

13. The apparatus of claim 8, further comprising: The third acquisition module is used to, after obtaining the SIM card number information based on the registration result information, reflectively call the unregistration method of the IMS registration result callback method based on the reflection mechanism, so that the IMS registration result callback method reverts to the initial state.

14. The apparatus of claim 8, further comprising: The storage module is used to store the SIM card number information in a target storage location according to the screen state of the electronic device after obtaining the SIM card number information based on the registration result information.

15. An electronic device comprising a processor and a memory, the memory storing a program or instructions executable on the processor, the program or instructions, when executed by the processor, implementing the steps of the information acquisition method as claimed in any one of claims 1-7.

16. An electronic device configured to perform the information acquisition method as described in any one of claims 1-7.

17. A readable storage medium storing a program or instructions that, when executed by a processor, implement the steps of the information acquisition method as described in any one of claims 1-7.

18. A computer program product, said computer program product being executed by at least one processor to implement the information acquisition method as described in any one of claims 1-7.

19. A chip, the chip comprising a processor and a communication interface, the communication interface being coupled to the processor, the processor being configured to run a program or instructions to implement the information acquisition method as described in any one of claims 1-7.