Disclosure of Invention
The embodiment of the invention aims to provide a method, a device, network equipment and a storage medium for detecting the state of an SIM card, which can find the illegal use condition of the SIM card in time so as to control the illegal use condition of the SIM card and ensure the safety of information.
In order to solve the above technical problem, an embodiment of the present invention provides a method for detecting a status of an SIM card, including: judging whether a first terminal device is offline or not, wherein an SIM card identifier of an SIM card to be detected is bound with a device identifier of the first terminal device; if the first terminal equipment is judged to be offline, inquiring the equipment identification of the terminal equipment currently using the SIM card through a BOSS interface according to the SIM card identification; when the equipment identification of the terminal equipment using the SIM card at present is obtained, the obtained equipment identification is compared with the equipment identification of the first terminal equipment, and if the comparison result is inconsistent, the state of the SIM card is judged to be abnormal.
The embodiment of the invention also provides a device for detecting the state of the SIM card, which comprises: the device state judging module is used for judging whether the first terminal device is off-line or not, wherein the SIM card identifier of the SIM card to be detected is bound with the device identifier of the first terminal device; the equipment identifier query module is used for querying the equipment identifier of the current terminal equipment using the SIM card according to the SIM card identifier through a BOSS interface when the first terminal equipment is judged to be offline; and the SIM card state detection module is used for comparing the acquired equipment identifier with the equipment identifier of the first terminal equipment when the equipment identifier of the terminal equipment using the SIM card at present is acquired, and judging that the state of the SIM card is abnormal if the comparison result is inconsistent.
An embodiment of the present invention further provides a network device, including: at least one processor; and a memory communicatively coupled to the at least one processor; the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the SIM card status detection method.
The embodiment of the invention also provides a computer readable storage medium, which stores a computer program, and the computer program realizes the SIM card state detection method when being executed by a processor.
Compared with the prior art, the method and the device have the advantages that whether the first terminal device is offline or not is judged, and when the first terminal device is judged to be offline, the device identification of the terminal device currently using the SIM card to be detected is inquired through the BOSS interface according to the SIM card identification; when the equipment identification of the terminal equipment which uses the SIM card to be detected currently is obtained, the obtained equipment identification is compared with the equipment identification of the first terminal equipment, and if the comparison result is inconsistent, the state of the SIM card is judged to be abnormal. The BOSS interface is called to obtain the equipment identification of the terminal equipment using the SIM card at present, and the equipment identification of the terminal equipment using the SIM card at present can be accurately obtained in time, so that the condition that the SIM card is illegally used can be found in time, the condition that the SIM card is illegally used can be managed and controlled, the safety of information is ensured, and the condition that the SIM card cannot be illegally used due to the fact that related information (such as an IMSI number) cannot be obtained for comparison caused by incompatibility of an API (application program interface) or unstable factors is avoided; meanwhile, the possibility that the SIM card is illegally used when the first terminal equipment is online is low, so that whether the SIM card is illegally used is detected after the first terminal equipment is judged to be offline, the detection range of whether the SIM card is illegally used can be narrowed, and the detection efficiency is improved.
In addition, the querying, through the BOSS interface, the device identifier of the terminal device currently using the SIM card according to the SIM card identifier specifically includes: and inquiring the equipment identification of the terminal equipment currently using the SIM card according to the SIM card identification at regular time through a BOSS interface.
In addition, before the determining whether the first terminal device is offline, the method further includes: acquiring the equipment identifier of the first terminal equipment and the identifier of the current SIM card of the first terminal equipment; and binding the equipment identifier of the first terminal equipment with the identifier of the current SIM card to obtain the SIM card identifier. The equipment identification of the first terminal equipment and the identification of the current SIM card are bound, so that the SIM card can only be used on the bound first terminal equipment, when the SIM card is used by other terminal equipment, the illegal use of the SIM card by other terminal equipment can be judged according to the bound equipment identification or the SIM card identification, and then the illegal use condition of the SIM card is processed in time, and the safety of information is ensured.
In addition, the acquiring the device identifier of the first terminal device specifically includes: and acquiring the equipment identifier of the first terminal equipment through a preset client installed in the first terminal equipment.
In addition, after the device identifier of the first terminal device is obtained through a preset client installed in the first terminal device, the method further includes: and acquiring the online state of the first terminal equipment through the preset client.
In addition, the querying, through the BOSS interface, the device identifier of the terminal device currently using the SIM card according to the SIM card identifier specifically includes: and inquiring and acquiring the IMEI number of the terminal equipment using the mobile phone number currently through the BOSS interface according to the mobile phone number.
In addition, the comparing the acquired device identifier with the device identifier of the first terminal device specifically includes: and comparing the IMEI number of the terminal equipment using the mobile phone number with the IMEI number of the first terminal equipment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, embodiments of the present invention will be described in detail below with reference to the accompanying drawings. However, it will be appreciated by those of ordinary skill in the art that numerous technical details are set forth in order to provide a better understanding of the present application in various embodiments of the present invention. However, the technical solution claimed in the present application can be implemented without these technical details and various changes and modifications based on the following embodiments.
The first embodiment of the invention relates to a method for detecting the state of an SIM card, which comprises the steps of judging whether a first terminal device is off-line or not, wherein the SIM card identifier of the SIM card to be detected is bound with the device identifier of the first terminal device; if the first terminal equipment is judged to be offline, inquiring the equipment identification of the terminal equipment currently using the SIM card through the BOSS interface according to the SIM card identification; when the equipment identification of the terminal equipment using the SIM card at present is obtained, the obtained equipment identification is compared with the equipment identification of the first terminal equipment, and if the comparison result is inconsistent, the state of the SIM card is judged to be abnormal. The equipment identification of the terminal equipment using the SIM card at present is inquired and obtained through a BOSS (business operation support system) interface, and the equipment identification can be timely and accurately obtained, so that whether the SIM card is illegally used or not is effectively judged; meanwhile, the possibility that the SIM card is illegally used when the terminal equipment is on line is low, so that whether the SIM card is illegally used is detected when the terminal equipment is off line, the range of detecting whether the SIM card is illegally used can be narrowed, and the detection efficiency is improved.
It should be noted that the SIM card status detection method provided in the embodiment of the present invention may be executed by a server, for example, by a server of a platform, where the server may be implemented by an independent server or a server cluster composed of multiple servers, and the following description takes the server as an example.
The specific flow of the SIM card status detection method provided by the embodiment of the present invention is shown in fig. 1, and specifically includes the following steps:
s101: and judging whether the first terminal equipment is offline, wherein the SIM card identification of the SIM card to be detected is bound with the equipment identification of the first terminal equipment.
The first terminal device is a terminal device that can use a SIM card, such as a mobile phone. The SIM card identification can be an IMSI number or a mobile phone number. The device identity of the first terminal device may be an IMEI number. It should be understood that the SIM card identifier of the SIM card to be detected is bound to the device identifier of the first terminal device, that is, the SIM card to be detected is bound to the first terminal device, and the SIM card to be detected should be used only on the first terminal device.
The first terminal device is offline, which means that the SIM card to be detected on the first terminal device is disconnected from the operating network corresponding to the SIM card. Optionally, the server determines whether the first terminal device is offline, and may determine that the first terminal device is online by acquiring the state of the to-be-detected SIM card on the first terminal device through the BOSS interface, and when the state of the to-be-detected SIM card is online (access to an operating network); and when the state of the SIM card to be detected is offline (disconnected from the operating network), judging that the first terminal equipment is offline.
In a specific example, the server may obtain the online status of the first terminal device through a preset client installed in the first terminal device. For example, after a user installs a preset client on a first terminal device, the preset client acquires the state of the SIM card to be detected of the first terminal device, and reports the acquired state of the SIM card to be detected to a server, so that the server can acquire the online state of the first terminal device. The preset client is a client customized according to the system type of the first terminal device, so as to ensure compatibility with the first terminal device. For example, when the first terminal device is an android system, the preset client is a client supported by the android system; when the first terminal device is an IOS system, the preset client is a client supported by the IOS system.
Optionally, when the online state of the first terminal device is obtained through a preset client, the preset client may be configured to report the state of the SIM card to be detected to the server according to a preset time interval, where the preset time interval is, for example, 5min, 10min, or 20min, and may be specifically set according to an actual need, and the present disclosure is not limited herein.
S102: and if the first terminal equipment is judged to be offline, inquiring the equipment identification of the terminal equipment currently using the SIM card to be detected through the BOSS interface according to the SIM card identification.
Specifically, when the first terminal device is judged to be offline, the service end calls the BOSS interface, and inquires the device identifier of the terminal device currently using the SIM to be detected according to the SIM card identifier through the BOSS interface. The terminal device currently using the SIM card to be detected may be the first terminal device, for example, the first terminal device is recovered from an offline state (for example, offline caused by shutdown) to an online state; the SIM card detection method can also be used for other terminal equipment, and if the SIM card detection method is used for other terminal equipment, the SIM card to be detected is illegally used.
In a specific example, when the service end queries the device identifier of the terminal device currently using the SIM card to be detected through the BOSS interface according to the SIM card identifier, the service end queries the device identifier of the terminal device currently using the SIM card to be detected through the BOSS interface regularly according to the SIM card identifier. Optionally, a timing task may be provided, which causes the BOSS interface to perform timing inquiry. The timing time may be set according to actual needs, for example, 5min, 10min, or 15min, and is not limited herein.
In a specific example, the service end queries, through the BOSS interface, the device identifier of the terminal device currently using the SIM to be detected according to the SIM card identifier, and specifically, may query and acquire, through the BOSS interface, the IMEI number of the terminal device currently using the mobile phone number according to the mobile phone number, that is, the SIM card identifier is a mobile phone number, and the device identifier of the terminal device is an IMEI number.
S103: when the equipment identification of the terminal equipment which uses the SIM card to be detected currently is obtained, the obtained equipment identification is compared with the equipment identification of the first terminal equipment, and if the comparison result is inconsistent, the state of the SIM card is judged to be abnormal.
Optionally, the device identifier of the first terminal device is stored in the server, and when the device identifier of the terminal device currently using the SIM card to be detected is obtained, the server compares the obtained device identifier with the device identifier of the first terminal device stored in the server.
Specifically, the server side inquires the equipment identification of the terminal equipment which currently uses the SIM card to be detected through a BOSS system, when the equipment identification of the terminal equipment which currently uses the SIM card to be detected is obtained, the server side compares the obtained equipment identification with the equipment identification of the first terminal equipment, if the comparison result is inconsistent, the SIM card to be detected is used by other terminal equipment, and the SIM card is in an illegal use state, the state of the SIM card is judged to be abnormal; and if the comparison result is consistent, the SIM card to be detected is still used on the first terminal equipment, and the state of the SIM card is judged to be normal.
In a specific example, the server compares the acquired device identifier with the device identifier of the first terminal device, specifically, the IMEI number of the terminal device currently using the mobile phone number corresponding to the SIM card to be detected and the IMEI number of the first terminal device are compared, that is, the device identifier of the first terminal device is also the IMEI number.
Optionally, when the state of the SIM card to be detected is determined to be abnormal, the service terminal calls the BOSS interface to disable the flow of the SIM card to be detected, so that the SIM card to be detected cannot be connected to an operating network for use, and the information safety is ensured. For example, when the state of the SIM card to be detected is determined to be abnormal, the server sends the state information of the abnormal state of the SIM card to the administrator, and the administrator calls the BOSS interface to disable the flow of the SIM card to be detected.
Compared with the prior art, the SIM card state detection method provided by the embodiment of the invention judges whether the first terminal equipment is offline, and when the first terminal equipment is judged to be offline, the equipment identification of the terminal equipment currently using the SIM card to be detected is inquired through the BOSS interface according to the SIM card identification; when the equipment identification of the terminal equipment which uses the SIM card to be detected currently is obtained, the obtained equipment identification is compared with the equipment identification of the first terminal equipment, and if the comparison result is inconsistent, the state of the SIM card is judged to be abnormal. The BOSS interface is called to obtain the equipment identification of the terminal equipment using the SIM card currently, and the equipment identification of the terminal equipment using the SIM card currently can be accurately obtained in time, so that the condition that the SIM card is illegally used can be found in time, the condition that the SIM card is illegally used can be conveniently managed and controlled, and the information safety is ensured; meanwhile, the possibility that the SIM card is illegally used when the first terminal equipment is online is low, so that whether the SIM card is illegally used is detected after the first terminal equipment is judged to be offline, the detection range of whether the SIM card is illegally used can be narrowed, and the detection efficiency is improved.
In a specific example, before S101, that is, before determining whether the first terminal device is offline, as shown in fig. 2, the method further includes the following steps:
s201: and acquiring the equipment identifier of the first terminal equipment and the identifier of the current SIM card of the first terminal equipment.
The current SIM card of the first terminal device is the SIM card installed in the first terminal device, that is, the SIM card to be detected.
Optionally, when the server obtains the device identifier of the first terminal device, the server may obtain the device identifier through a preset client installed in the first terminal device. For example, a user downloads a preset client from a server, installs the preset client on a first terminal device, and the preset client acquires a device identifier of the first terminal device and sends the device identifier to the server.
Optionally, when the server obtains the identifier of the current SIM card of the first terminal device, the server may also obtain the identifier by a preset client. Preferably, the identifier of the current SIM card is a mobile phone number, and the user enters the mobile phone number in the server before downloading and installing the preset client.
S202: and binding the equipment identifier of the first terminal equipment with the identifier of the current SIM card to obtain the SIM card identifier.
Specifically, after acquiring the device identifier of the first terminal device and the identifier of the current SIM card, the server binds the device identifier of the first terminal device and the identifier of the current SIM card, and stores the bound device identifier and the identifier of the current SIM card in the server, so as to obtain the bound SIM card identifier, that is, the SIM card identifier.
The equipment identification of the first terminal equipment and the identification of the current SIM card are bound, so that the SIM card can only be used on the bound first terminal equipment, when the SIM card is used by other terminal equipment, the illegal use of the SIM card by other terminal equipment can be judged according to the bound equipment identification or the SIM card identification, and then the illegal use condition of the SIM card is processed in time, and the safety of information is ensured.
Please refer to fig. 3, which is a flowchart illustrating a method for detecting a status of a SIM card. It should be understood that the flowchart is an exemplary diagram in which the server performs detection of the SIM card statuses of all terminal devices communicating with the server. Specifically, 1, a user inputs a mobile phone number into a platform (a server); 2. a user installs a customized client (a preset client) on a terminal device (a mobile phone), and after the device is activated, the customized client sends an IMEI number (a device identifier) of the terminal device to a platform; 3. the platform binds the mobile phone number and the IMEI number and stores the mobile phone number and the IMEI number in the platform; 4. the platform sets the initial state of the terminal equipment to be a normal state, and then monitors the online state of the terminal equipment through a customized client; 5. when the terminal equipment is judged to be offline, the platform carries out SIM card violation judgment and enters step 6; 6. the platform executes a timing task, and calls a BOSS interface to inquire an IMEI number by taking the mobile phone number of the offline terminal equipment as a parameter; 7. the platform judges whether the IMEI number returned by the BOSS is consistent with the IMEI number stored by the platform, if so, the platform returns to step 6 to continuously judge the violation detection of the next offline terminal equipment; if not, entering 8; 8. the state of the platform updating terminal equipment is SIM card violation; 9. the platform sends an illegal short message to inform a platform administrator; 10. the platform administrator calls the BOSS interface to disable traffic for the offending SIM card. It should be noted that the corresponding english alphabet in fig. 3 is a lower case.
The steps of the above methods are divided for clarity, and the implementation may be combined into one step or split some steps, and the steps are divided into multiple steps, so long as the steps contain the same logical relationship, which is within the protection scope of the present patent; it is within the scope of the patent to add insignificant modifications to the algorithms or processes or to introduce insignificant design changes to the core design without changing the algorithms or processes.
A second embodiment of the present invention relates to a SIM card status detection apparatus, as shown in fig. 4, including: a device state judging module 301, a device identification inquiring module 302 and a SIM card state detecting module 303.
The device state determining module 301 is configured to determine whether the first terminal device is offline, where an SIM card identifier of the SIM card to be detected is bound to a device identifier of the first terminal device;
the device identifier query module 302 is configured to query, through the BOSS interface, a device identifier of a terminal device currently using the SIM card according to the SIM card identifier when it is determined that the first terminal device is offline;
the SIM card state detection module 303 is configured to, when acquiring a device identifier of a terminal device that currently uses the SIM card, compare the acquired device identifier with a device identifier of the first terminal device, and determine that the state of the SIM card is abnormal if a comparison result is inconsistent.
Further, the device identification query module 302 is further configured to: and inquiring the equipment identification of the terminal equipment currently using the SIM card according to the SIM card identification at regular time through the BOSS interface.
Further, the SIM card status detection apparatus provided by the embodiment of the present invention further includes an identifier binding module, where the identifier binding module is configured to:
acquiring an equipment identifier of first terminal equipment and an identifier of a current SIM card of the first terminal equipment;
and binding the equipment identifier of the first terminal equipment with the identifier of the current SIM card to obtain the SIM card identifier.
Further, the identity binding module is further configured to: and acquiring the equipment identifier of the first terminal equipment through a preset client installed in the first terminal equipment.
Further, the apparatus for detecting a status of an SIM card provided in the embodiments of the present invention further includes an equipment status monitoring module, where the equipment status monitoring module is configured to: and acquiring the online state of the first terminal equipment through a preset client.
Further, the device identification query module 302 is further configured to: and inquiring and acquiring the IMEI number of the terminal equipment using the mobile phone number at present through the BOSS interface according to the mobile phone number.
Further, the SIM card status detection module 303 is further configured to: and comparing the IMEI number of the terminal equipment using the mobile phone number currently with the IMEI number of the first terminal equipment.
It should be understood that this embodiment is an example of the apparatus corresponding to the first embodiment, and may be implemented in cooperation with the first embodiment. The related technical details mentioned in the first embodiment are still valid in this embodiment, and are not described herein again in order to reduce repetition. Accordingly, the related-art details mentioned in the present embodiment can also be applied to the first embodiment.
It should be noted that each module referred to in this embodiment is a logical module, and in practical applications, one logical unit may be one physical unit, may be a part of one physical unit, and may be implemented by a combination of multiple physical units. In addition, in order to highlight the innovative part of the present invention, elements that are not so closely related to solving the technical problems proposed by the present invention are not introduced in the present embodiment, but this does not indicate that other elements are not present in the present embodiment.
A third embodiment of the invention is directed to a network device, as shown in fig. 5, comprising at least one processor 401; and a memory 402 communicatively coupled to the at least one processor 401; the memory 402 stores instructions executable by the at least one processor 401, and the instructions are executed by the at least one processor 401, so that the at least one processor 401 can execute the SIM card status detection method.
Where the memory 402 and the processor 401 are coupled by a bus, which may include any number of interconnected buses and bridges that couple one or more of the various circuits of the processor 401 and the memory 402 together. The bus may also connect various other circuits such as peripherals, voltage regulators, power management circuits, and the like, which are well known in the art, and therefore, will not be described any further herein. A bus interface provides an interface between the bus and the transceiver. The transceiver may be one element or a plurality of elements, such as a plurality of receivers and transmitters, providing a means for communicating with various other apparatus over a transmission medium. The data processed by the processor 401 may be transmitted over a wireless medium via an antenna, which may receive the data and transmit the data to the processor 401.
The processor 401 is responsible for managing the bus and general processing and may provide various functions including timing, peripheral interfaces, voltage regulation, power management, and other control functions. And memory 402 may be used to store data used by processor 401 in performing operations.
A fourth embodiment of the present invention relates to a computer-readable storage medium storing a computer program. The computer program realizes the above-described method embodiments when executed by a processor.
That is, those skilled in the art can understand that all or part of the steps in the method of the foregoing embodiments may be implemented by a program to instruct related hardware, where the program is stored in a storage medium and includes several instructions to enable a device (which may be a single chip, a chip, etc.) or a processor (processor) to execute all or part of the steps of the method described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
It will be understood by those of ordinary skill in the art that the foregoing embodiments are specific examples for carrying out the invention, and that various changes in form and details may be made therein without departing from the spirit and scope of the invention in practice.