SIM card subscription state determination method and device, equipment and storage medium
By determining the SIM card subscription status information in the cache in the terminal device and sending request data to the mobile network and target address, the problem of not being able to automatically determine the SIM card activation and billing status in the prior art is solved. This achieves accurate status determination without relying on the operator's system, reducing revenue loss.
Patent Information
- Application Number
- CN202511755850.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-26
- Publication Date
- 2026-02-10
AI Technical Summary
Existing technology cannot determine whether a SIM card is active and billable without relying on the operator's billing system, resulting in revenue losses for operators.
If the SIM card's subscription status information is not found in the cache, a network attach request is initiated to the mobile network. If the request is not rejected, mobile data is forcibly enabled, request data is sent to the target address, and response data is received to determine the SIM card's subscription status.
It enables automatic determination of whether a SIM card is in an activated and billing state without relying on the operator's billing system, improving the accuracy of subscription status determination and avoiding revenue loss caused by users continuing to use the terminal device after they have stopped paying.
Smart Images

Figure CN121509944A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of network communication technology, specifically to a method, apparatus, device, and storage medium for determining SIM card subscription status. Background Technology
[0002] With the development of communication technology, terminal devices sold by operators are usually linked to phone numbers and activated and billed via SIM cards. However, some users only top up for the first month and then stop paying, switching to WiFi to continue using the terminal device's functions, causing revenue losses for operators. To prevent this behavior, it is necessary to determine whether the terminal device's SIM card is in an activated and billed state.
[0003] However, existing methods require access to the operator's billing system to determine whether the SIM card is in an activated billing state. Operators typically do not allow terminal devices to access their billing systems, making it difficult for terminal devices to determine whether the SIM card is in an activated billing state. Summary of the Invention
[0004] This application provides a method, apparatus, device, and storage medium for determining the subscription status of a SIM card, which can automatically determine whether a SIM card is in an activated billing state without relying on the operator's billing system.
[0005] The technical solution adopted by this invention to solve the problem is as follows: Firstly, this application provides a method for determining the subscription status of a SIM card, including: Determine if the SIM card's subscription status information exists in the cache; If the SIM card's subscription status information is not in the cache and the SIM card is detected, a network attach request is initiated to the mobile network. When the network attach request is not rejected, force mobile data to be enabled and send the requested data to the target address; Upon receiving response data from the target address based on the requested data, it is determined that the SIM card is in a subscription state.
[0006] In some implementations of this application, after determining whether the SIM card subscription status information exists in the cache, the following steps are included: If the SIM card subscription status information exists in the cache, obtain the timing duration of the first timer; When the duration of the first timer exceeds the first time threshold, determine whether a SIM card has been detected. When no SIM card is detected, control the second timer to start counting; When the second timer's duration exceeds the second time threshold, it is determined that the SIM card is in an unsubscribed state and the terminal device's WiFi function is locked.
[0007] In some embodiments of this application, after determining whether a SIM card has been detected, the following steps are included: When a SIM card is detected, a network attach request is initiated to the mobile network; When the network attach request is not rejected, force mobile data to be enabled and send the requested data to the target address; Upon receiving response data from the target address based on the requested data, it is determined that the SIM card is in a subscription state.
[0008] In some implementations of this application, after determining whether the SIM card subscription status information exists in the cache, the following steps are included: If the SIM card's subscription status information is not in the cache and no SIM card is detected, the second timer is started. When the second timer's duration exceeds the second time threshold, it is determined that the SIM card is in an unsubscribed state and the terminal device's WiFi function is locked.
[0009] In some embodiments of this application, after initiating a network attach request to the mobile network, the process includes: When a network attach request is rejected, the system determines that the SIM card is in an unsubscribed state and locks the WiFi function of the terminal device.
[0010] In some embodiments of this application, after forcibly enabling mobile data and sending requested data to the target address, the process includes: If no response data is received from the target address based on the requested data, it is determined that the SIM card is in an unsubscribed state and the WiFi function of the terminal device is locked.
[0011] In some embodiments of this application, after determining that the SIM card is in a subscription state upon receiving response data returned by the target address based on the requested data, the following steps are included: The subscription status information of the SIM card is cached and the first timer is started.
[0012] Secondly, embodiments of the present invention also provide a SIM card subscription status determination device, comprising: The first judgment module is used to determine whether the SIM card subscription status information exists in the cache; The first sending module is used to initiate a network attach request to the mobile network when the subscription status information of the SIM card is not in the cache and the SIM card is detected. The second sending module is used to forcibly enable mobile data and send request data to the target address when the network attach request is not rejected; The first determining module is used to determine that the SIM card is in a subscription state when it receives response data returned by the target address based on the request data.
[0013] Thirdly, this application also provides a terminal device, which includes: One or more processors; Memory; and One or more applications, wherein the applications are stored in memory and configured to be executed by a processor to implement the SIM card subscription status determination method of any of the first aspects.
[0014] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, the computer program being loaded by a processor to perform the steps in the SIM card subscription status determination method of any of the first aspects.
[0015] The beneficial effects of this invention are as follows: By initiating a network attach request to the mobile network when the SIM card's subscription status information is not in the cache and the SIM card is detected, and by forcibly activating mobile data and sending request data to the target address when the network attach request is not rejected, and determining that the SIM card is in a subscription state when the response data returned by the target address based on the request data is received, it is possible to automatically determine whether the SIM card is in an activated billing state without relying on the operator's billing system. In addition, the accuracy of determining the SIM card's subscription status can be improved by using a dual verification mechanism of network attach request and sending request data to the target address. Attached Figure Description
[0016] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0017] Figure 1 This is a schematic diagram of a SIM card subscription status determination system provided in an embodiment of the present invention; Figure 2 This is a schematic flowchart of an embodiment of the SIM card subscription status determination method provided by the present invention; Figure 3 This is a flowchart illustrating another embodiment of the SIM card subscription status determination method provided in this invention. Figure 4 This is a flowchart illustrating another embodiment of the SIM card subscription status determination method provided by the present invention; Figure 5 This is a schematic diagram of a specific embodiment of the SIM card subscription status determination device provided in this invention. Figure 6 This is a schematic diagram of an embodiment of the terminal device provided in this invention. Detailed Implementation
[0018] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0019] In the description of this application, the terms "first," "second," "third," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined with "first," "second," "third," etc., may explicitly or implicitly include one or more features.
[0020] In this application, the term "exemplary" is used to mean "used as an example, illustration, or description." Any embodiment described as "exemplary" in this application is not necessarily to be construed as being more preferred or advantageous than other embodiments. The following description is provided to enable any person skilled in the art to make and use this application. Details are set forth in the following description for purposes of explanation. It should be understood that those skilled in the art will recognize that this application can be made without using these specific details. In other instances, well-known structures and processes are not described in detail to avoid obscuring the description of this application with unnecessary detail. Therefore, this application is not intended to be limited to the embodiments shown, but is consistent with the broadest scope of the principles and features disclosed in this application.
[0021] It should be noted that since the method in this application embodiment is executed in a terminal device, the processing objects of each terminal device exist in the form of data or information, such as time, which is essentially time information. It can be understood that if size, quantity, position, etc. are mentioned in subsequent embodiments, they are all corresponding data that exist so that the terminal device can process them. Specific details will not be elaborated here.
[0022] This application provides a method, apparatus, device, and storage medium for determining SIM card subscription status, which will be described in detail below.
[0023] Please see Figure 1 , Figure 1 This is a schematic diagram of a SIM card subscription status determination system provided in an embodiment of this application. The SIM card subscription status determination system may include a terminal device 100, which integrates a SIM card subscription status determination device, such as... Figure 1 Terminal devices in the process.
[0024] In this embodiment, the terminal device 100 is mainly used to determine whether there is SIM card subscription status information in the cache; when there is no SIM card subscription status information in the cache and the SIM card is detected, it initiates a network attach request to the mobile network; when the network attach request is not rejected, it forcibly enables mobile data and sends request data to the target address; when it receives response data returned by the target address based on the request data, it determines that the SIM card is in a subscription state. Without relying on the operator's billing system, it automatically determines whether the SIM card is in an active billing state, and can improve the accuracy of the determined SIM card subscription status.
[0025] In this embodiment, the terminal device 100 can be an independent server, a server network, or a server cluster. For example, the terminal device 100 described in this embodiment includes, but is not limited to, a computer, a network host, a single network server, a set of multiple network servers, or a cloud server composed of multiple servers. The cloud server is composed of a large number of computers or network servers based on cloud computing.
[0026] It is understood that the terminal device 100 used in the embodiments of this application can be a device that includes both receiving and transmitting hardware, that is, a device having receiving and transmitting hardware capable of performing bidirectional communication on a bidirectional communication link. Such a device may include: cellular or other communication devices having a single-line display, a multi-line display, or a cellular or other communication device without a multi-line display. Specifically, the terminal device 100 may be a desktop terminal or a mobile terminal, and the terminal device 100 may also be one of a smart TV, mobile phone, tablet computer, laptop computer, etc.
[0027] Those skilled in the art will understand that Figure 1 The application environment shown is merely one application scenario of the solution in this application and does not constitute a limitation on the application scenario of the solution in this application. Other application environments may include those that are more specific to this application. Figure 1 The number of more or fewer terminal devices shown, for example Figure 1 Only one terminal device is shown in the image. It is understood that the SIM card subscription status determination system may also include one or more other services, which are not specified here.
[0028] In addition, such as Figure 1 As shown, the SIM card subscription status determination system may also include a memory 200 for storing data, such as timing times, such as the timing times of a first timer and a second timer, and time thresholds, such as a first time threshold and a second time threshold.
[0029] It should be noted that, Figure 1 The schematic diagram of the SIM card subscription status determination system shown is merely an example. The SIM card subscription status determination system and scenario described in this application embodiment are for the purpose of more clearly illustrating the technical solutions of this application embodiment and do not constitute a limitation on the technical solutions provided in this application embodiment. As those skilled in the art will know, with the evolution of the SIM card subscription status determination system and the emergence of new business scenarios, the technical solutions provided in this application embodiment are also applicable to similar technical problems.
[0030] First, this application provides a method for determining the subscription status of a SIM card. The execution subject of this method is a SIM card subscription status determination device, which is applied to a terminal device. The method includes: determining whether there is subscription status information of a SIM card in the cache; when there is no subscription status information of a SIM card in the cache and a SIM card is detected, initiating a network attach request to the mobile network; when the network attach request is not rejected, forcibly enabling mobile data and sending request data to the target address; and when receiving response data returned by the target address based on the request data, determining that the SIM card is in a subscription state.
[0031] like Figure 2 The diagram shown is a flowchart of an embodiment of the SIM card subscription status determination method in this application. This SIM card subscription status determination method is applied to a terminal device and may include the following steps S201 to S204, as detailed below: Step S201: Determine whether the SIM card subscription status information exists in the cache.
[0032] In this embodiment, the subscription status information is used to indicate that the SIM card is in a subscription state, which means that the SIM card is in an activated and billed state. After the terminal device determines that the SIM card is in a subscription state, it caches the information used to indicate that the SIM card is in a subscription state. In this way, the terminal device can determine whether the SIM card is in a subscription state by checking whether the SIM card's subscription status information exists in the cache, thus reducing the resource consumption when determining the SIM card's subscription status. For example, the subscription status information can be "subscribed" or it can be "1".
[0033] Furthermore, the cache is a local storage area on the terminal device used to store subscription status information. The terminal device can determine whether the SIM card's subscription status information exists in the cache after powering on, or it can check the cache at preset intervals. The terminal device can also determine the presence of SIM card subscription status information in the cache based on user or other device subscription status determination instructions. In some embodiments, the terminal device checks the cache for SIM card subscription status information at preset intervals. This allows for timely detection of SIM cards not being activated and billed after a user stops paying, reducing revenue losses for operators caused by users continuing to use the terminal device via WiFi after stopping payment.
[0034] S202. When the SIM card subscription status information is not in the cache and the SIM card is detected, initiate a network attach request to the mobile network.
[0035] In this embodiment, the network attach request is the core process by which devices using SIM cards, such as mobile phones and IoT terminals, actively request access to and obtain network service permissions from the operator's mobile network (2G / 3G / 4G / 5G) after powering on, restarting, changing networks (e.g., switching from WiFi to 5G), or entering a new network coverage area. The mobile network can confirm whether the SIM card in the terminal device is a valid card registered with the operator and whether the SIM card has activated access permissions for the current network (e.g., whether it supports 5G and allows roaming) through the network attach request. When the SIM card is in an unsubscribed state (i.e., not in a billing-activated state), the network attach request initiated by the terminal device to the mobile network will be rejected. Therefore, based on whether the network attach request initiated by the terminal device to the mobile network is rejected, it can be determined whether the SIM card is in a subscribed state.
[0036] Optionally, if the terminal device determines that there is no SIM card subscription status information in the cache, it will further perform SIM card detection. When a SIM card is detected, it will initiate a network attach request to the mobile network to determine the SIM card subscription status through the network attach request.
[0037] S203. If the network attach request is not rejected, force the activation of mobile data and send the requested data to the target address.
[0038] In this embodiment, forcibly enabling mobile data refers to the process of switching the cellular data switch of a terminal device from a closed state to an open state through a program or instruction. The target address refers to the network endpoint to which the terminal points when sending a network request, i.e., the identifier of the server / device to which the requested data will ultimately be delivered. In some embodiments, the target address is a public Ping address. Ping is a network tool based on the Internet Control Message Protocol (ICMP) used to detect network connectivity and response time between a device and a server. If an external server can be successfully pinged, it usually indicates that the data network is available.
[0039] Optionally, when the network attach request initiated by the terminal device to the mobile network is not rejected, the terminal device forcibly turns on mobile data and sends request data to the target address. This dual verification mechanism of the network attach request and the sending of request data to the target address can determine the SIM card's subscription status, improving the accuracy of the determined SIM card subscription status. For example, if the target address is PING google.com, and the network attach request initiated by the terminal device to the mobile network is not rejected, the terminal device forcibly turns on mobile data and sends request data to PING google.com to determine the SIM card's subscription status by sending request data to the target address.
[0040] In some embodiments, after initiating a network attach request to the mobile network in step S202, the method includes: when the network attach request is rejected, determining that the SIM card is in an unsubscribed state and locking the WiFi function of the terminal device. This embodiment determines that the SIM card is in an unsubscribed state and locks the WiFi function of the terminal device, preventing users from continuing to use the terminal device via WiFi after they have stopped paying for services. This avoids revenue losses for operators caused by users continuing to use the terminal device via WiFi after they have stopped paying for services.
[0041] S204. Upon receiving response data returned by the target address based on the requested data, determine that the SIM card is in a subscription state.
[0042] In this embodiment, response data refers to the data returned by the server or device corresponding to the target address based on the request data sent by the terminal device. When the SIM card is in a subscribed state, the request data sent by the terminal device can be received by the server or device corresponding to the target address, and the response data returned by the server or device corresponding to the target address based on the request data can also be received by the terminal device. Conversely, when the SIM card is in an unsubscribed state, the request data sent by the terminal device cannot be received by the server or device corresponding to the target address, and the terminal device cannot receive the response data returned by the server or device corresponding to the target address based on the request data. Therefore, the terminal device can determine whether the SIM card is in a subscribed state based on whether it receives the response data returned by the target address based on the request data.
[0043] Furthermore, subscription status refers to the SIM card being in an activated and billed state. When the terminal device receives response data returned by the target address based on the request data, it determines that the SIM card is in an activated and billed state. In this way, it can automatically determine whether the SIM card is in an activated and billed state without accessing the operator's billing system.
[0044] In some embodiments, after forcibly enabling mobile data and sending request data to the target address in step S203, the method includes: if no response data is received from the target address based on the request data, determining that the SIM card is in an unsubscribed state and locking the WiFi function of the terminal device. This embodiment determines that the SIM card is in an unsubscribed state and locks the WiFi function of the terminal device, preventing users from continuing to use the terminal device via WiFi after stopping payment. This avoids revenue losses for operators caused by users continuing to use the terminal device via WiFi after stopping payment.
[0045] In some embodiments, refer to Figure 3 As shown, after determining whether the SIM card subscription status information exists in the cache in step S201 above, steps S301 to S304 can be included, as detailed below: S301. If the SIM card subscription status information exists in the cache, obtain the timing time of the first timer.
[0046] In this embodiment, the timing of the first timer is used to characterize the caching time of the subscription status information in the cache, that is, the time difference between the time when the SIM card was last determined to be in a subscription state and the current time. Optionally, after determining that the SIM card is in a subscription state, the terminal device controls the first timer to start timing. When the timing of the first timer exceeds a first time threshold, the terminal device then determines the subscription status of the SIM card by initiating a network attach request to the mobile network and sending request data to the target address. This reduces the number of times the terminal device sends request data to the target address, thus reducing resource consumption while ensuring the accuracy of SIM card subscription status tracking.
[0047] S302. When the timing of the first timer exceeds the first time threshold, determine whether a SIM card has been detected.
[0048] In this embodiment of the application, the first time threshold is used to measure whether the caching time of the subscription status information in the cache has expired. The first time threshold can be set according to actual needs. For example, the first time threshold can be 8 hours, 10 hours, 12 hours, 14 hours, 16 hours, etc.
[0049] Furthermore, if the duration of the first timer is less than or equal to the first time threshold, it indicates that the cache time for the subscription status information in the cache has not expired, and the step of obtaining the duration of the first timer continues; if the duration of the first timer is greater than the first time threshold, it indicates that the cache time for the subscription status information in the cache has expired, and then it is determined whether a SIM card has been detected. For example, if the first time threshold is 12 hours, it is determined whether a SIM card has been detected if the duration of the first timer is greater than 12 hours.
[0050] S303. When no SIM card is detected, control the second timer to start counting.
[0051] In this embodiment of the application, the second timer is used to measure whether the time when no SIM card is detected has expired. When no SIM card is detected, the second timer is controlled to start counting, which can avoid misjudgment caused by detection errors and improve the accuracy of SIM card subscription status determination.
[0052] S304. When the timing of the second timer exceeds the second time threshold, determine that the SIM card is in an unsubscribed state and lock the WiFi function of the terminal device.
[0053] In this embodiment of the application, the second time threshold is used to measure whether the time during which the SIM card is not detected has expired. The second time threshold can be set according to actual needs. The second time threshold can be set to 0.5 hours, 0.8 hours, 1 hour, 1.5 hours, 2 hours, etc. For example, the second time threshold can be set to 1 hour.
[0054] Furthermore, if the timing of the second timer is less than or equal to the second time threshold, it indicates that the time without detecting the SIM card has not expired, and the system continues to determine whether the timing of the second timer is greater than the second time threshold. If the timing of the second timer is greater than the second time threshold, it indicates that the time without detecting the SIM card has expired, confirming that the SIM card is in an unsubscribed state and locking the WiFi function of the terminal device. This prevents users from continuing to use the terminal device via WiFi after stopping payment, thus avoiding revenue losses for operators caused by users continuing to use the terminal device via WiFi after stopping payment.
[0055] In some embodiments, refer to Figure 4 As shown, after determining whether a SIM card is detected in step S302 above, steps S401 to S403 can be included, as detailed below: S401. When a SIM card is detected, initiate a network attach request to the mobile network.
[0056] In this embodiment, the network attach request is the core process by which devices using SIM cards, such as mobile phones and IoT terminals, actively request access to and obtain network service permissions from the operator's mobile network (2G / 3G / 4G / 5G) after powering on, restarting, changing networks (e.g., switching from WiFi to 5G), or entering a new network coverage area. The mobile network can confirm whether the SIM card in the terminal device is a valid card registered with the operator and whether the SIM card has activated access permissions for the current network (e.g., whether it supports 5G and allows roaming) through the network attach request. When the SIM card is in an unsubscribed state (i.e., not in a billing-activated state), the network attach request initiated by the terminal device to the mobile network will be rejected. Therefore, based on whether the network attach request initiated by the terminal device to the mobile network is rejected, it can be determined whether the SIM card is in a subscribed state.
[0057] Optionally, when the terminal device determines that the SIM card subscription status information exists in the cache and the timing of the first timer is greater than the first time threshold, it will further perform SIM card detection. When the SIM card is detected, it will initiate a network attach request to the mobile network to determine the subscription status of the SIM card through the network attach request.
[0058] S402. If the network attach request is not rejected, force the activation of mobile data and send the requested data to the target address.
[0059] In this embodiment, forcibly enabling mobile data refers to the process of switching the cellular data switch of a terminal device from a closed state to an open state through a program or instruction. The target address refers to the network endpoint to which the terminal points when sending a network request, i.e., the identifier of the server / device to which the requested data will ultimately be delivered. In some embodiments, the target address is a public Ping address. Ping is a network tool based on the Internet Control Message Protocol (ICMP) used to detect network connectivity and response time between a device and a server. If an external server can be successfully pinged, it usually indicates that the data network is available.
[0060] Optionally, when the network attach request initiated by the terminal device to the mobile network is not rejected, the terminal device forcibly turns on mobile data and sends request data to the target address. This dual verification mechanism of the network attach request and the sending of request data to the target address can determine the SIM card's subscription status, improving the accuracy of the determined SIM card subscription status. For example, if the target address is PING google.com, and the network attach request initiated by the terminal device to the mobile network is not rejected, the terminal device forcibly turns on mobile data and sends request data to PING google.com to determine the SIM card's subscription status by sending request data to the target address.
[0061] In some embodiments, after initiating a network attach request to the mobile network in step S401, the method includes: when the network attach request is rejected, determining that the SIM card is in an unsubscribed state and locking the WiFi function of the terminal device. This embodiment determines that the SIM card is in an unsubscribed state and locks the WiFi function of the terminal device, preventing users from continuing to use the terminal device via WiFi after they have stopped paying for services. This avoids revenue losses for operators caused by users continuing to use the terminal device via WiFi after they have stopped paying for services.
[0062] S403. Upon receiving response data from the target address based on the requested data, determine that the SIM card is in a subscription state.
[0063] In this embodiment, response data refers to the data returned by the server or device corresponding to the target address based on the request data sent by the terminal device. When the SIM card is in a subscribed state, the request data sent by the terminal device can be received by the server or device corresponding to the target address, and the response data returned by the server or device corresponding to the target address based on the request data can also be received by the terminal device. Conversely, when the SIM card is in an unsubscribed state, the request data sent by the terminal device cannot be received by the server or device corresponding to the target address, and the terminal device cannot receive the response data returned by the server or device corresponding to the target address based on the request data. Therefore, the terminal device can determine whether the SIM card is in a subscribed state based on whether it receives the response data returned by the target address based on the request data.
[0064] Furthermore, the subscription status indicates that the SIM card is in an activated and billed state. When the terminal device receives the response data returned by the target address based on the request data, it determines that the SIM card is in an activated and billed state. In this way, it can automatically determine whether the SIM card is in an activated and billed state without accessing the operator's billing system.
[0065] In some embodiments, after forcibly enabling mobile data and sending request data to the target address in step S402, the method includes: if no response data is received from the target address based on the request data, determining that the SIM card is in an unsubscribed state and locking the WiFi function of the terminal device. This embodiment determines that the SIM card is in an unsubscribed state and locks the WiFi function of the terminal device, preventing users from continuing to use the terminal device via WiFi after stopping payment. This avoids revenue losses for operators caused by users continuing to use the terminal device via WiFi after stopping payment.
[0066] In some embodiments, after controlling the second timer to start timing in step S303 above, the process includes: when the timing time of the second timer is less than or equal to the second time threshold and a SIM card is detected, controlling the second timer to stop timing and initiating a network attach request to the mobile network; when the network attach request is not rejected, forcibly enabling mobile data and sending request data to the target address; and when receiving response data returned by the target address based on the request data, determining that the SIM card is in a subscription state. This can avoid misjudgment caused by detection errors and improve the accuracy of determining the SIM card subscription state.
[0067] In some embodiments, after determining whether the SIM card subscription status information exists in the cache in step S201, the method includes: when the SIM card subscription status information does not exist in the cache and no SIM card is detected, controlling a second timer to start timing; when the timing of the second timer is greater than a second time threshold, determining that the SIM card is in an unsubscribed state and locking the WiFi function of the terminal device. This can avoid misjudgment caused by detection errors, improve the accuracy of determining the SIM card subscription status, and avoid revenue loss to the operator caused by users continuing to use the terminal device through the WiFi function after stopping payment.
[0068] In some embodiments, after determining that the SIM card is in a subscription state upon receiving response data returned by the target address based on the request data in steps S204 and S403, the method includes: caching the subscription state information of the SIM card and controlling the first timer to start counting. This embodiment of the application caches the subscription state information of the SIM card and controls the first timer to start counting when the SIM card is in a subscription state. This allows the determination of the SIM card's subscription state to be made only after the first timer's count exceeds a first time threshold, by initiating a network attach request to the mobile network and sending request data to the target address. This reduces the number of times the terminal device sends request data to the target address, ensuring the accuracy of SIM card subscription state tracking while reducing resource consumption.
[0069] To better implement the SIM card subscription status determination method in this application embodiment, based on the SIM card subscription status determination method, this application embodiment also provides a SIM card subscription status determination device, such as... Figure 5 As shown, the SIM card subscription status determination device 600 includes: The first judgment module 610 is used to determine whether there is SIM card subscription status information in the cache; The first sending module 620 is used to initiate a network attach request to the mobile network when the subscription status information of the SIM card is not in the cache and the SIM card is detected. The second sending module 630 is used to forcibly enable mobile data and send request data to the target address when the network attach request is not rejected; The first determining module 640 is used to determine that the SIM card is in a subscription state when it receives response data returned by the target address based on the request data.
[0070] In this embodiment, a network attach request is initiated to the mobile network when the SIM card's subscription status information is not in the cache and the SIM card is detected. If the network attach request is not rejected, mobile data is forcibly activated and request data is sent to the target address. When the response data returned by the target address based on the request data is received, it is determined that the SIM card is in a subscription state. This can automatically determine whether the SIM card is in an active billing state without relying on the operator's billing system. In addition, the dual verification mechanism of network attach request and sending request data to the target address can improve the accuracy of the determined SIM card subscription status.
[0071] In some embodiments of this application, the SIM card subscription status determination device 600 further includes: The first acquisition module is used to acquire the timing time of the first timer when the subscription status information of the SIM card exists in the cache; The second judgment module is used to determine whether a SIM card is detected when the timing of the first timer is greater than the first time threshold. The first control module is used to control the second timer to start counting when no SIM card is detected; The second determining module is used to determine that the SIM card is in an unsubscribed state and lock the WiFi function of the terminal device when the timing of the second timer is greater than the second time threshold.
[0072] In some embodiments of this application, after the second determination module determines whether a SIM card is detected, the second determination module is further configured to: When a SIM card is detected, a network attach request is initiated to the mobile network; When the network attach request is not rejected, force mobile data to be enabled and send the requested data to the target address; Upon receiving response data from the target address based on the requested data, it is determined that the SIM card is in a subscription state.
[0073] In some embodiments of this application, the SIM card subscription status determination device 600 further includes: The second control module is used to control the second timer to start counting when there is no SIM card subscription status information in the cache and no SIM card is detected. The third determining module is used to determine that the SIM card is in an unsubscribed state and lock the WiFi function of the terminal device when the timing of the second timer is greater than the second time threshold.
[0074] In some embodiments of this application, the SIM card subscription status determination device 600 further includes: The fourth determination module is used to determine that the SIM card is in an unsubscribed state and lock the WiFi function of the terminal device when the network attachment request is rejected.
[0075] In some embodiments of this application, the SIM card subscription status determination device 600 further includes: The fifth determination module is used to determine that the SIM card is in an unsubscribed state and lock the WiFi function of the terminal device when no response data is received from the target address based on the request data.
[0076] In some embodiments of this application, the first determining module is further configured to: The subscription status information of the SIM card is cached and the first timer is started.
[0077] This application embodiment also provides a terminal device that integrates any of the SIM card subscription status determination devices provided in this application embodiment. The terminal device includes: One or more processors; Memory; and One or more applications, wherein the applications are stored in memory and configured to be executed by a processor in the steps of the SIM card subscription status determination method in any of the embodiments described above.
[0078] This application also provides a terminal device that integrates any of the SIM card subscription status determination devices provided in this application. For example... Figure 6 As shown, it illustrates a structural schematic diagram of the terminal device involved in the embodiments of this application. Specifically: The terminal device may include components such as a processor 801 with one or more processing cores, a memory 802 with one or more computer-readable storage media, a power supply 803, and an input unit 804. Those skilled in the art will understand that... Figure 6 The terminal device structure shown does not constitute a limitation on the terminal device and may include more or fewer components than shown, or combine certain components, or have different component arrangements. Wherein: The processor 801 is the control center of the terminal device. It connects various parts of the terminal device via various interfaces and lines. By running or executing software programs and / or modules stored in the memory 802, and by calling data stored in the memory 802, it performs various functions and processes data of the terminal device, thereby providing overall monitoring of the terminal device. Optionally, the processor 801 may include one or more processing cores; preferably, the processor 801 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications, and the modem processor mainly handles wireless communication. It is understood that the modem processor may also not be integrated into the processor 801.
[0079] The memory 802 can be used to store software programs and modules. The processor 801 executes various functional applications and data processing by running the software programs and modules stored in the memory 802. The memory 802 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, application programs required for at least one function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the terminal device, etc. In addition, the memory 802 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 802 may also include a memory controller to provide the processor 801 with access to the memory 802.
[0080] The terminal device also includes a power supply 803 that supplies power to the various components. Preferably, the power supply 803 can be logically connected to the processor 801 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. The power supply 803 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.
[0081] The terminal device may also include an input unit 804, which can be used to receive input digital or character information, and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.
[0082] Although not shown, the terminal device may also include a display unit, etc., which will not be described in detail here. Specifically, in this embodiment, the processor 801 in the terminal device loads the executable files corresponding to the processes of one or more applications into the memory 802 according to the following instructions, and the processor 801 runs the applications stored in the memory 802 to realize various functions, as follows: Determine if the SIM card's subscription status information exists in the cache; If the SIM card's subscription status information is not in the cache and the SIM card is detected, a network attach request is initiated to the mobile network. When the network attach request is not rejected, force mobile data to be enabled and send the requested data to the target address; Upon receiving response data from the target address based on the requested data, it is determined that the SIM card is in a subscription state.
[0083] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by instructions, or by instructions controlling related hardware. These instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.
[0084] Therefore, embodiments of this application provide a computer-readable storage medium, which may include: read-only memory (ROM), random access memory (RAM), a magnetic disk, or an optical disk, etc. A computer program is stored thereon, and the computer program is loaded by a processor to execute the steps in any of the SIM card subscription status determination methods provided in embodiments of this application. For example, the computer program loaded by the processor can execute the following steps: Determine if the SIM card's subscription status information exists in the cache; If the SIM card's subscription status information is not in the cache and the SIM card is detected, a network attach request is initiated to the mobile network. When the network attach request is not rejected, force mobile data to be enabled and send the requested data to the target address; Upon receiving response data from the target address based on the requested data, it is determined that the SIM card is in a subscription state.
[0085] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the detailed descriptions of other embodiments above, which will not be repeated here.
[0086] In practice, each of the above units or structures can be implemented as an independent entity or can be arbitrarily combined to be implemented as the same or several entities. For the specific implementation of each of the above units or structures, please refer to the previous method embodiments, which will not be repeated here.
[0087] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.
[0088] The foregoing has provided a detailed description of a SIM card subscription status determination method, apparatus, device, and storage medium provided in the embodiments of this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A method for determining SIM card subscription status, characterized in that, include: Determine if the SIM card's subscription status information exists in the cache; If the subscription status information of the SIM card is not in the cache and the SIM card is detected, a network attach request is initiated to the mobile network; If the network attach request is not rejected, mobile data is forcibly enabled and the request data is sent to the target address; Upon receiving response data from the target address based on the requested data, it is determined that the SIM card is in a subscription state.
2. The SIM card subscription status determination method according to claim 1, characterized in that, After determining whether the SIM card subscription status information exists in the cache, the following steps are included: If the subscription status information of the SIM card exists in the cache, obtain the timing duration of the first timer; When the timing of the first timer exceeds the first time threshold, it is determined whether the SIM card has been detected. When the SIM card is not detected, control the second timer to start counting; When the second timer's duration exceeds the second time threshold, it is determined that the SIM card is in an unsubscribed state and the WiFi function of the terminal device is locked.
3. The method for determining SIM card subscription status according to claim 2, characterized in that, After determining whether the SIM card has been detected, the following steps are included: Upon detecting the SIM card, a network attach request is initiated to the mobile network; If the network attach request is not rejected, mobile data is forcibly enabled and the request data is sent to the target address; Upon receiving response data from the target address based on the requested data, it is determined that the SIM card is in a subscription state.
4. The method for determining SIM card subscription status according to claim 1, characterized in that, After determining whether the SIM card subscription status information exists in the cache, the following steps are included: If the subscription status information of the SIM card is not in the cache and the SIM card is not detected, control the second timer to start counting; When the second timer's duration exceeds the second time threshold, it is determined that the SIM card is in an unsubscribed state and the WiFi function of the terminal device is locked.
5. The method for determining SIM card subscription status according to claim 1 or 3, characterized in that, After initiating a network attach request to the mobile network, the process includes: When the network attach request is rejected, the SIM card is determined to be in an unsubscribed state and the WiFi function of the terminal device is locked.
6. The method for determining SIM card subscription status according to claim 1 or 3, characterized in that, After forcibly activating mobile data and sending request data to the target address, the process includes: If no response data is received from the target address based on the requested data, it is determined that the SIM card is in an unsubscribed state and the WiFi function of the terminal device is locked.
7. The method for determining SIM card subscription status according to claim 1 or 3, characterized in that, Upon receiving response data returned by the target address based on the request data, and determining that the SIM card is in a subscription state, the process includes: The subscription status information of the SIM card is cached and the first timer is started.
8. A SIM card subscription status determination device, characterized in that, include: The first judgment module is used to determine whether the SIM card subscription status information exists in the cache; The first sending module is used to initiate a network attach request to the mobile network when the subscription status information of the SIM card is not in the cache and the SIM card is detected. The second sending module is used to forcibly enable mobile data and send request data to the target address when the network attach request is not rejected; The first determining module is used to determine that the SIM card is in a subscription state when it receives response data returned by the target address based on the request data.
9. A terminal device, characterized in that, The terminal device includes: One or more processors; Memory; and One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the processor to implement the SIM card subscription status determination method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, It stores a computer program, which is loaded by a processor to perform the steps in the SIM card subscription status determination method according to any one of claims 1 to 7.