Disclosure of Invention
The object of the present invention is to solve at least one of the above-mentioned technical drawbacks, in particular the technical drawback of not being able to accurately determine a fake base station.
According to an aspect, an embodiment of the present invention provides a method for determining a pseudo base station, including:
sending data to a preset network site, and acquiring an Internet Protocol (IP) address set when the data can be transmitted, wherein the IP address set is a set of IP addresses corresponding to routers through which the data pass in the transmission process;
and determining whether the base station where the base station is located currently is a pseudo base station or not based on the IP address set.
Preferably, the method further comprises the following steps:
and when the data cannot be transmitted, determining the current base station as a suspected pseudo base station.
Preferably, the determining whether the base station currently located is a pseudo base station based on the IP address set includes:
detecting the validity of the IP address set according to a pre-stored legal IP address database; and the number of the first and second groups,
and determining whether the current base station is a pseudo base station or not according to the detection result.
Preferably, the detecting the validity of the IP address set according to a pre-stored valid IP address database includes:
detecting whether the IP address set has an IP address belonging to the legal IP address database;
if the IP address set does not have the IP address belonging to the legal IP address database, determining the IP address set as an illegal IP address set;
and if the IP address set has the IP address belonging to the legal IP address database, determining that the IP address set is a suspected illegal IP address set.
Preferably, the determining whether the current base station is a pseudo base station according to the detection result includes:
if the IP address set is an illegal IP address set, determining that the current base station is a pseudo base station;
and if the IP address set is a suspected illegal IP address set, determining whether the current base station is a pseudo base station or not based on a sub-IP address set before the IP address in the legal IP address database is reached.
Preferably, the determining whether the base station currently located is a pseudo base station based on the sub IP address set before reaching the IP address belonging to the legal IP address database includes:
detecting whether the IP address which does not belong to the legal IP address database exists in the sub-IP address set;
and if the IP address does not belong to the legal IP address database, determining that the current base station is a pseudo base station.
Preferably, the obtaining internet protocol IP addresses respectively corresponding to routers through which the data passes in the transmission process includes:
and acquiring IP addresses corresponding to all routers through which the data pass in the transmission process based on the time to live value TTL in the IP data packet of the data.
The embodiment of the present invention also provides an apparatus for determining a pseudo base station according to another aspect, including:
the system comprises a processing module, a network station and a server, wherein the processing module is used for sending data to a preset network station and acquiring an Internet Protocol (IP) address set when the data can be transmitted, wherein the IP address set is a set of IP addresses corresponding to routers through which the data passes in the transmission process;
and the first determining module is used for determining whether the base station where the base station is located currently is a pseudo base station or not based on the IP address set.
Preferably, the method further comprises the following steps: a second determination module;
and the second determining module is used for determining the current base station as a suspected pseudo base station when the data cannot be transmitted.
Preferably, the first determining module comprises a detection submodule and a pseudo base station determining submodule;
the detection submodule is used for detecting the validity of the IP address set according to a prestored legal IP address database;
and the pseudo base station determining submodule is used for determining whether the current base station is a pseudo base station or not according to the detection result.
Preferably, the detection sub-module includes an IP address set validity detection sub-unit, a first IP address set determination sub-unit, and a second IP address set determination sub-unit;
the IP address set legitimacy detection subunit is used for detecting whether the IP address set has the IP address belonging to the legal IP address database or not;
the first IP address set determining subunit is configured to determine that the IP address set is an illegal IP address set when the IP address set does not have an IP address belonging to the legal IP address database;
and the second IP address set determining subunit is configured to determine that the IP address set is a suspected illegal IP address set when an IP address belonging to the legal IP address database exists in the IP address set.
Preferably, the pseudo base station determination submodule includes a first pseudo base station determination subunit and a second pseudo base station determination subunit;
the first pseudo base station determining subunit is used for determining the current base station as a pseudo base station when the IP address set is an illegal IP address set;
and the second pseudo base station determining subunit is used for determining whether the base station in which the base station is located currently is a pseudo base station or not based on the sub-IP address set before the IP address belonging to the legal IP address database when the IP address set is a suspected illegal IP address set.
Preferably, the second pseudo base station determination subunit comprises an IP address detection subunit and a determination subunit;
the IP address detection subunit is used for detecting whether the IP address which does not belong to the legal IP address database exists in the sub-IP address set or not;
and the determining subunit is used for determining the current base station as a pseudo base station when the IP address which does not belong to the legal IP address database exists.
Preferably, the processing module is specifically configured to obtain, based on the time to live value TTL in the IP data packet of the data, IP addresses corresponding to respective routers through which the data passes in the transmission process.
According to another aspect, the present invention also provides a terminal device, which includes a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the method for determining a pseudo base station.
The method provided by the embodiment of the invention sends data to a preset network station, and when the data can be transmitted, acquires an Internet Protocol (IP) address set, wherein the IP address set is a set of IP addresses respectively corresponding to routers through which the data passes in the transmission process, provides a precondition for identifying a pseudo base station based on the IP address of the router through which the data passes in the transmission process, and determines whether the base station currently located is the pseudo base station based on the IP address set, so that whether the base station currently located by a mobile terminal is the pseudo base station is accurately and effectively determined according to the IP address of the router through which the data passes in the transmission process, communication with the pseudo base station is avoided, and property safety, information safety and the like of a user are effectively protected.
Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are illustrative only and should not be construed as limiting the invention.
As used herein, the singular forms "a", "an", "the" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof. It will be understood that when an element is referred to as being "connected" or "coupled" to another element, it can be directly connected or coupled to the other element or intervening elements may also be present. Further, "connected" or "coupled" as used herein may include wirelessly connected or wirelessly coupled. As used herein, the term "and/or" includes all or any element and all combinations of one or more of the associated listed items.
It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. It will be further understood that terms, such as those defined in commonly used dictionaries, should be interpreted as having a meaning that is consistent with their meaning in the context of the prior art and will not be interpreted in an idealized or overly formal sense unless expressly so defined herein.
As will be appreciated by those skilled in the art, a "terminal" as used herein includes both devices having a wireless signal receiver, which are devices having only a wireless signal receiver without transmit capability, and devices having receive and transmit hardware, which have devices having receive and transmit hardware capable of two-way communication over a two-way communication link. Such a device may include: a cellular or other communication device having a single line display or a multi-line display or a cellular or other communication device without a multi-line display; PCS (Personal Communications Service), which may combine voice, data processing, facsimile and/or data communication capabilities; a PDA (Personal Digital Assistant), which may include a radio frequency receiver, a pager, internet/intranet access, a web browser, a notepad, a calendar and/or a GPS (Global Positioning System) receiver; a conventional laptop and/or palmtop computer or other device having and/or including a radio frequency receiver. As used herein, a "terminal" or "terminal device" may be portable, transportable, installed in a vehicle (aeronautical, maritime, and/or land-based), or situated and/or configured to operate locally and/or in a distributed fashion at any other location(s) on earth and/or in space. As used herein, a "terminal Device" may also be a communication terminal, a web terminal, a music/video playing terminal, such as a PDA, an MID (Mobile Internet Device) and/or a Mobile phone with music/video playing function, or a smart tv, a set-top box, etc.
A first embodiment of the present invention provides a method for determining a pseudo base station, as shown in fig. 1, including: step 110, sending data to a preset network station, and when the data can be transmitted, acquiring an Internet Protocol (IP) address set, wherein the IP address set is a set of IP addresses respectively corresponding to routers through which the data passes in the transmission process; and step 120, determining whether the base station in which the current station is located is a pseudo base station or not based on the IP address set.
The method for determining the pseudo base station, provided by the embodiment of the invention, comprises the steps of sending data to a preset network station, and acquiring an internet protocol IP address set when the data can be transmitted, wherein the IP address set is a set of IP addresses respectively corresponding to routers through which the data pass in the transmission process, a precondition guarantee is provided for identifying the pseudo base station based on the IP address of the router through which the data pass in the transmission process, and whether the base station currently located is the pseudo base station is determined based on the IP address set, so that whether the base station currently located by a mobile terminal is the pseudo base station is accurately and effectively determined according to the IP address of the router through which the data pass in the transmission process, the communication with the pseudo base station is avoided, and the property safety, the information safety and the like of a user are effectively protected.
The following describes a method for determining a pseudo base station in an embodiment of the present invention in detail, specifically as follows:
in step 110, data is sent to a preset network station, and when the data can be transmitted, an internet protocol IP address set is obtained, where the IP address set is a set of IP addresses corresponding to routers through which the data passes in the transmission process.
Preferably, the method further comprises: and when the data can not be transmitted, determining the current base station as a suspected pseudo base station.
Preferably, the acquiring internet protocol IP addresses corresponding to respective routers through which the data passes in the transmission process includes: and acquiring IP addresses corresponding to the routers through which the data pass in the transmission process based on the time to live value TTL in the IP data packet of the data.
Specifically, the preset network station needs measures such as identity authentication or encryption to prevent the fake station by the pseudo base station, wherein when detecting whether the base station where the mobile terminal is located is the pseudo base station, the mobile terminal may obtain an IP address set, for example, denoted as an IP address set a, of all routers that the mobile terminal passes through in the normal data transmission process by sending data to the pre-designed network station, and since an IP address or an IP address range of each router in the core network of the regular operator is relatively fixed (i.e., preset), it may detect whether the base station where the mobile terminal is currently located is the pseudo base station according to the IP address set a and the IP address or the IP address range of each router in the core network of the regular operator.
Further, when network abnormal conditions such as network interruption and network instability occur, data transmission between the mobile terminal and the preset network station may not be possible, when the base station where the mobile terminal is currently located is a pseudo base station, data transmission between the mobile terminal and the predetermined network site may not be performed, as in the case shown in fig. 2, and thus, when data transmission between the mobile terminal and the predetermined network station is not possible, the base station where the mobile terminal is currently located may be determined as a suspected fake base station, then the reason why the data transmission cannot be carried out is deeply analyzed to determine whether the data transmission cannot be carried out due to the network abnormity, if the data transmission is not caused by the network abnormality, it can be determined that the data cannot be transmitted because the base station where the mobile terminal is currently located is the pseudo base station, so that the base station where the mobile terminal is currently located can be determined as the pseudo base station.
Further, when the mobile terminal sends data to the preset network station, in the transmission process of the data, the IP addresses corresponding to the routers through which the data pass in the transmission process can be obtained through the time to live TTL in the IP data packet of the data. Because each IP packet has a TTL (Time To Live) field, the IP address of each router in the normal data transmission process can be obtained according To an ICMP (Internet Control Message Protocol) and the TTL in the IP packet header, specifically, the mobile terminal first sends an IP packet with TTL of 1 (which sends out 3 packets with 40 bytes, where the contents in the 3 packets are the source address, the destination address and the Time tag when sending out the IP packet) To a preset network site, when the first router on the path receives the IP packet, the router subtracts TTL of 1, and at this Time, TTL of 0 is changed To 0, so the router drops the IP packet and returns an "ICMP Time timeout" Message, where the timeout Message includes the source address of the IP packet, and the source address of the IP packet, After receiving the timeout message, the mobile terminal knows that the router is on the path, and then sends out another data packet with TTL of 2 through "route trace", so as to find the 2 nd router, and so on, the mobile terminal finds another router by adding 1 to the TTL of the data packet sent each time, and this repeated action continues until the data packet arrives at the predetermined network site, and after the data packet arrives at the predetermined network site, the predetermined network site does not send back the "ICMP time timeout" message because it is the destination, so as to finally obtain the IP addresses corresponding to the routers through which the data passes in the transmission process.
In step 120, it is determined whether the base station currently located is a pseudo base station based on the IP address set.
Preferably, the determining whether the base station currently located is a pseudo base station based on the IP address set includes: detecting the legality of the IP address set according to a prestored legal IP address database; and determining whether the current base station is a pseudo base station or not according to the detection result.
Preferably, the detecting the validity of the IP address set according to the pre-stored valid IP address database includes: detecting whether an IP address belonging to a legal IP address database exists in the IP address set; if the IP address set does not have the IP address belonging to the legal IP address database, determining the IP address set as an illegal IP address set; and if the first IP address set contains the IP addresses belonging to the legal IP address database, determining the IP address set as a suspected illegal IP address set.
Preferably, determining whether the current base station is a pseudo base station according to the detection result includes: if the IP address set is an illegal IP address set, determining that the current base station is a pseudo base station; and if the IP address set is a suspected illegal IP address set, determining whether the current base station is a pseudo base station or not based on the sub-IP address set before the IP address in the legal IP address database is reached.
Preferably, the determining whether the base station currently located is a pseudo base station based on the sub IP address set before reaching the IP address belonging to the legal IP address database includes: detecting whether the IP address which does not belong to the legal IP address database exists in the sub-IP address set; and if the IP address does not belong to the legal IP address database, determining that the current base station is the pseudo base station.
Specifically, the IP address or IP address range of each router in the core network of the regular operator is preset, so that the IP address or IP address range of each router in the core network of the regular operator can be stored in a corresponding database, recorded as a legal IP address database, and loaded into the mobile terminal, that is, the legal IP address database is stored in the mobile terminal in advance, so that whether the current mobile terminal is in the pseudo base station can be detected according to the legal IP address database.
Further, when detecting whether the current mobile terminal is in the pseudo base station according to the legal IP address database, it may be determined whether the current mobile terminal is in the pseudo base station by detecting whether an IP address set (i.e., a set of IP addresses respectively corresponding to routers through which the mobile terminal transmits to a preset network station) belongs to the pre-stored legal IP address database. Specifically, if an IP address belonging to a legal IP address database does not exist in the IP address set, the IP address set is determined to be an illegal IP address set, that is, the base station where the mobile terminal is currently located is a pseudo base station, although the mobile terminal can normally perform data transmission with a preset network site, the mobile terminal can normally perform data transmission with the preset network site because the pseudo base station background automatically establishes a network to be connected to the internet for communication, but the network established by the pseudo base station background is not a base station or a core network of a mobile terminal operator, as shown in fig. 3; if the IP address set contains an IP address belonging to a legal IP address database, for example, IP address a, that is, the IP address a in the IP address set is an IP address in the legal IP address database, the IP address set is determined to be a suspected illegal IP address set, and the suspected illegal IP address set needs to be further detected to determine whether the current mobile terminal is in a fake base station.
Further, whether the current base station is a pseudo base station can be determined by detecting a sub-IP address set formed by all IP addresses before the IP address A is reached for the first time, wherein the sub-IP address set belongs to the IP address set, if all the IP addresses in the sub-IP address set are not IP addresses in a legal IP address database or IP addresses which do not belong to a legal IP address database exist in the sub-IP address set, the current base station where the mobile terminal is located is determined to be the pseudo base station, in this case, the mobile terminal can normally transmit data with a preset network station because the pseudo base station automatically establishes a local network and the automatically established local network is accessed to an operator core network, as shown in FIG. 4, namely, the mobile terminal is accessed to the operator core network through the local network automatically established by the pseudo base station and then is accessed to the Internet through the operator core network, the data transmission is carried out with the preset network station, in this case, the local network built by the pseudo base station by itself needs to be accessed into the core network of the operator, at least one router which cannot be controlled by the pseudo base station necessarily exists, and the IP address of the router is the IP address in the legal IP address database, specifically, when the mobile terminal sends data to the preset network station, although the pseudo base station can build the network by itself through the router controlled by the pseudo base station, so that the TTL can be used for doing hands and feet, because the local network built by the pseudo base station by itself needs to be accessed into the core network of the operator, as shown in FIG. 4, at least one router which cannot be controlled by the pseudo base station exists in the local network built by itself by the pseudo base station for accessing the core network or the Internet, after all, the pseudo base station cannot directly plug the network cable into the preset network station, but only can connect the preset network station through the intermediate network, i.e. must communicate with the predetermined network station via an intermediate network provided by the corresponding network provider, so that there must be at least one router which the pseudo base station cannot control and the IP address of the router.
Further, if all the IP addresses in the sub-IP address set are IP addresses in a legal IP address database, it is determined that the current base station where the mobile terminal is located is a regular base station of the operator, that is, the mobile terminal is not currently located in a pseudo base station, in this case, the mobile terminal accesses the internet through a core network of the operator to perform data transmission with a preset network site, as shown in fig. 5.
A second embodiment of the present invention provides an apparatus for determining a pseudo base station, as shown in fig. 6, including: the system comprises a processing module 61 and a first determining module 62, wherein the processing module 61 is configured to send data to a preset network station, and when the data can be transmitted, obtain an internet protocol IP address set, where the IP address set is a set of IP addresses corresponding to routers through which the data passes in a transmission process; a first determining module 62, configured to determine whether the current base station is a pseudo base station based on the IP address set.
Further, the apparatus further includes a second determining module 63, as shown in fig. 7, where the second determining module 63 is configured to determine the current base station as a suspected fake base station when data cannot be transmitted.
Further, the processing module 61 is specifically configured to obtain, based on the time to live value TTL in the IP data packet of the data, IP addresses corresponding to routers through which the data passes in the transmission process.
Further, the first determining module 62 includes a detecting sub-module 621 and a pseudo base station determining sub-module 622, as shown in fig. 7, where the detecting sub-module 621 is configured to detect the validity of the IP address set according to a pre-stored valid IP address database; and the pseudo base station determining sub-module 622 is configured to determine whether the current base station is a pseudo base station according to the detection result.
Further, the detecting sub-module 621 includes an IP address set validity detecting sub-unit 6211, a first IP address set determining sub-unit 6212, and a second IP address set determining sub-unit 6213, as shown in fig. 7, where the IP address set validity detecting sub-unit 6211 is configured to detect whether there is an IP address belonging to the valid IP address database in the IP address set; a first IP address set determining subunit 6212, configured to determine, when there is no IP address belonging to the legal IP address database in the IP address set, that the IP address set is an illegal IP address set; a second IP address set determining subunit 6213, configured to determine, when an IP address belonging to the legal IP address database exists in the IP address set, that the IP address set is a suspected illegal IP address set.
Further, the pseudo base station determining sub-module 622 includes a first pseudo base station determining sub-unit 6221 and a second pseudo base station determining sub-unit 6222, as shown in fig. 7, where the first pseudo base station determining sub-unit 6221 is configured to determine that the current base station is a pseudo base station when the IP address set is an illegal IP address set; the second pseudo base station determining subunit 6222 is configured to, when the IP address set is the suspected illegal IP address set, determine whether the base station currently located is a pseudo base station based on the sub IP address set before reaching the IP address belonging to the legal IP address database.
Further, the second pseudo base station determining subunit 6222 includes an IP address detecting subunit 62221 and a determining subunit 62222, as shown in fig. 7, wherein the IP address detecting subunit 62221 is configured to detect whether there is an IP address in the sub IP address set that does not belong to the legal IP address database; a determining subunit 62222, configured to determine that the current base station is a pseudo base station when there is an IP address that does not belong to the valid IP address database.
The embodiment of the invention sends data to a preset network station, and when the data can be transmitted, acquires an Internet Protocol (IP) address set, wherein the IP address set is a set of IP addresses respectively corresponding to routers through which the data passes in the transmission process, provides a precondition guarantee for identifying a pseudo base station based on the IP address of the router through which the data passes in the transmission process, and determines whether the current base station is the pseudo base station based on the IP address set, so that whether the current base station of a mobile terminal is the pseudo base station is accurately and effectively determined according to the IP address of the router through which the data passes in the transmission process, communication with the pseudo base station is avoided, and property safety, information safety and the like of a user are effectively protected.
Another embodiment of the present invention provides a terminal device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor executes the computer program to implement the method for determining a pseudo base station.
Those skilled in the art will appreciate that the present invention includes apparatus directed to performing one or more of the operations described in the present application. These devices may be specially designed and manufactured for the required purposes, or they may comprise known devices in general-purpose computers. These devices have stored therein computer programs that are selectively activated or reconfigured. Such a computer program may be stored in a device (e.g., computer) readable medium, including, but not limited to, any type of disk including floppy disks, hard disks, optical disks, CD-ROMs, and magnetic-optical disks, ROMs (Read-Only memories), RAMs (Random Access memories), EPROMs (Erasable Programmable Read-Only memories), EEPROMs (Electrically Erasable Programmable Read-Only memories), flash memories, magnetic cards, or optical cards, or any type of media suitable for storing electronic instructions, and each coupled to a bus. That is, a readable medium includes any medium that stores or transmits information in a form readable by a device (e.g., a computer).
It will be understood by those within the art that each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations, can be implemented by computer program instructions. Those skilled in the art will appreciate that the computer program instructions may be implemented by a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, implement the features specified in the block or blocks of the block diagrams and/or flowchart illustrations of the present disclosure.
Those of skill in the art will appreciate that various operations, methods, steps in the processes, acts, or solutions discussed in the present application may be alternated, modified, combined, or deleted. Further, various operations, methods, steps in the flows, which have been discussed in the present application, may be interchanged, modified, rearranged, decomposed, combined, or eliminated. Further, steps, measures, schemes in the various operations, methods, procedures disclosed in the prior art and the present invention can also be alternated, changed, rearranged, decomposed, combined, or deleted.
The foregoing is only a partial embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.