Disclosure of Invention
In view of the above, it is desirable to provide a method, an apparatus, a system, a computer device and a storage medium for acquiring an IMEI number of a terminal, which can improve flexibility of acquiring the IMEI number of the terminal.
A method for acquiring an IMEI number of a terminal comprises the following steps:
receiving a first access request sent by a terminal; the first access request is sent out through an operator network;
obtaining the IMEI number of the terminal according to the first access request;
adding the IMEI number of the terminal into the first access request to obtain a second access request;
sending the second access request to an authentication server; the second access request is used for triggering the authentication server to obtain the IMEI number of the terminal and the IP address of the operator network according to the second access request; and according to the IP address of the operator network, confirming that the IMEI number of the terminal is valid, and sending the IMEI number of the terminal to a target terminal.
In one embodiment, the obtaining the IMEI number of the terminal according to the first access request includes:
obtaining a terminal identifier of the terminal according to the first access request;
and acquiring the IMEI number corresponding to the terminal identifier as the IMEI number of the terminal.
In one embodiment, before adding the IMEI number of the terminal to the first access request and obtaining the second access request, the method further includes:
verifying the first access request;
adding the IMEI number of the terminal to the first access request to obtain a second access request, comprising:
if the first access request passes the verification, acquiring a position identifier of the IMEI number of the terminal in the first access request;
and adding the IMEI number of the terminal to the corresponding position in the first access request according to the position identifier to obtain a second access request.
In one embodiment, the verifying the first access request includes:
and if the first access request is an access request to the authentication server, confirming that the first access request passes the verification.
In one embodiment, after adding the IMEI number of the terminal to the first access request and obtaining the second access request, the method further includes:
acquiring a secret key of the authentication server;
encrypting the second access request according to the secret key to obtain an encrypted second access request; the encrypted second access request carries a key identifier corresponding to the key;
the sending the second access request to an authentication server includes:
sending the encrypted second access request to an authentication server; the encrypted second access request is used for triggering the authentication server to acquire a key corresponding to the key identifier, and the encrypted second access request is decrypted according to the key to obtain the IMEI number of the terminal and the IP address of the operator network.
A method for acquiring an IMEI number of a terminal comprises the following steps:
receiving a second access request sent by the operator gateway; the operator gateway is used for receiving a first access request sent by a terminal, obtaining the IMEI number of the terminal according to the first access request, and adding the IMEI number of the terminal into the first access request to obtain a second access request; the first access request is sent out through an operator network;
obtaining the IMEI number of the terminal and the IP address of the operator network according to the second access request;
according to the IP address of the operator network, confirming that the IMEI number of the terminal is valid;
and sending the IMEI number of the terminal to a target terminal.
In one embodiment, the confirming that the IMEI number of the terminal is valid according to the IP address of the operator network includes:
and if the IP address of the operator network is matched with the preset IP address, determining that the IMEI number of the terminal is valid.
An apparatus for acquiring an IMEI number of a terminal, the apparatus comprising:
the request receiving module is used for receiving a first access request sent by a terminal; the first access request is sent out through an operator network;
an IMEI number acquisition module, configured to obtain an IMEI number of the terminal according to the first access request;
an IMEI number adding module, configured to add the IMEI number of the terminal to the first access request to obtain a second access request;
the request sending module is used for sending the second access request to an authentication server; the second access request is used for triggering the authentication server to obtain the IMEI number of the terminal and the IP address of the operator network according to the second access request; and according to the IP address of the operator network, confirming that the IMEI number of the terminal is valid, and sending the IMEI number of the terminal to a target terminal.
A system for acquiring IMEI number of a terminal comprises: the system comprises an operator gateway and an authentication server which are connected through a network, wherein the operator gateway is also connected with a terminal, and the authentication server is also connected with a target terminal;
the terminal is used for sending a first access request to the operator gateway;
the operator gateway is used for executing the steps of the method;
the authentication server is used for executing the steps of the method;
the target terminal is used for receiving the IMEI number of the terminal sent by the authentication server.
A computer device comprising a memory and a processor, the memory storing a computer program, the processor implementing the following steps when executing the computer program:
receiving a first access request sent by a terminal; the first access request is sent out through an operator network;
obtaining the IMEI number of the terminal according to the first access request;
adding the IMEI number of the terminal into the first access request to obtain a second access request;
sending the second access request to an authentication server; the second access request is used for triggering the authentication server to obtain the IMEI number of the terminal and the IP address of the operator network according to the second access request; and according to the IP address of the operator network, confirming that the IMEI number of the terminal is valid, and sending the IMEI number of the terminal to a target terminal.
A computer-readable storage medium, on which a computer program is stored which, when executed by a processor, carries out the steps of:
receiving a first access request sent by a terminal; the first access request is sent out through an operator network;
obtaining the IMEI number of the terminal according to the first access request;
adding the IMEI number of the terminal into the first access request to obtain a second access request;
sending the second access request to an authentication server; the second access request is used for triggering the authentication server to obtain the IMEI number of the terminal and the IP address of the operator network according to the second access request; and according to the IP address of the operator network, confirming that the IMEI number of the terminal is valid, and sending the IMEI number of the terminal to a target terminal.
According to the method, the device, the system, the computer equipment and the storage medium for acquiring the IMEI number of the terminal, the IMEI number of the terminal is added in the first access request of the terminal through the operator gateway to obtain a second access request, the second access request is sent to the authentication server, the IMEI number of the terminal is obtained through the authentication server according to the second access request, and the IMEI number of the terminal is sent to the target terminal; the target terminal can acquire the IMEI number of the terminal by analyzing the access request of the terminal forwarded by the operator gateway through the authentication server without additionally calling a terminal system, so that the process of acquiring the IMEI number of the terminal by the target terminal is simplified, and the flexibility of acquiring the IMEI number of the terminal is improved. Meanwhile, whether the access request passes through the operator gateway or not is confirmed according to the IP address of the operator network, so that whether the IMEI number of the terminal is valid or not is confirmed, and the accuracy of the obtained IMEI number of the terminal is guaranteed.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The method for acquiring the IMEI number of the terminal provided by the application can be applied to the application environment shown in FIG. 1. The application environment includes a terminal 110, an operator gateway 120, an authentication server 130, and a target terminal 140, where the operator gateway 120 is in communication connection with the terminal 110 and the authentication server 130, the authentication server 130 is in communication connection with the target terminal 140, and the terminal 110 is connected to an operator network provided by the operator gateway 120. Terminal 110 sends a first access request to operator gateway 120 through the operator network. The operator gateway 120 obtains the IMEI number of the terminal according to the first access request; adding the IMEI number of the terminal into the first access request to obtain a second access request; the second access request is sent to the authentication server 130. The authentication server 130 obtains the IMEI number of the terminal and the IP address of the operator network according to the second access request; according to the IP address of the operator network, it is confirmed that the IMEI number of the terminal is valid, and the IMEI number of the terminal is transmitted to the target terminal 140. The terminal 110 may be various smart phones, tablet computers, and the like; the operator gateway 120 may be a mobile gateway, a telecommunications gateway, or the like; the authentication server 130 is based on all the implementation servers of the present application, such as an account authentication server; the method can be realized by an independent server or a server cluster consisting of a plurality of servers; the target terminal 140 refers to a third party terminal.
In an embodiment, as shown in fig. 2, there is provided a method for acquiring an IMEI number of a terminal, which is described by taking an example that the method is applied to an operator gateway in fig. 1, and includes the following steps:
step S201, receiving a first access request sent by a terminal; the first access request is issued through the carrier network.
In this step, the terminal refers to a smart phone, a tablet computer, and the like; the operator gateway refers to a device capable of providing an operator network for a terminal to surf the internet, such as a mobile gateway, a telecommunication gateway, and the like; the operator network refers to a mobile data network. Wherein the terminal is connected to an operator network provided by an operator gateway.
For example, an operator gateway provides an operator network; the terminal is connected to the operator network and can enter a networking state. The terminal is provided with a browser, a user can log in the authentication platform through the browser, and authentication services, such as the Tian Yi account authentication service, can be performed through the authentication platform; a user opens an authentication platform through a browser and triggers and generates a first access request; the terminal sends the first access request to an operator gateway providing the operator network through the operator network. The authentication platform is based on all implementation platforms of the application, such as an angel wing account authentication service platform, a mobile phone number authentication service platform and the like; the first access request refers to any request for the terminal to access the authentication platform through the operator network.
In another embodiment, the terminal is equipped with an authentication platform; a user opens an authentication platform and triggers and generates a first access request; the terminal sends the first access request to an operator gateway providing the operator network through the operator network.
Step S202, according to the first access request, obtaining the IMEI number of the terminal.
In this step, the IMEI number is an international mobile equipment identity, which is commonly referred to as a mobile phone serial number and a mobile phone "serial number", and is used for identifying mobile communication equipment such as each independent mobile phone in a mobile phone network, and corresponds to an identity card of a mobile phone.
The terminal carries the IMEI number of the terminal and other information when in communication setting, and the operator gateway binds the terminal and the corresponding IMEI number in advance, so that the binding relationship between the terminal and the IMEI number is obtained.
In the specific implementation, the operator gateway obtains a terminal sending the first access request through an operator network according to the first access request, and obtains the IMEI number of the terminal according to the binding relationship between the terminal and the IMEI number inquired by the terminal; and an additional terminal system is not required to be called, so that the flexibility of obtaining the IMEI number of the terminal is further improved.
Step S203, adding the IMEI number of the terminal to the first access request to obtain a second access request.
In this step, the second access request is a request generated by adding the IMEI number of the terminal to the first access request.
For example, if the operator gateway identifies the first access request, the IMEI number of the terminal is added to the first access request to obtain a second access request; the second access request is conveniently sent to the authentication server subsequently, the IMEI number of the terminal is obtained through the authentication server based on the second access request, and the flexibility of obtaining the IMEI number of the terminal is further improved.
Step S204, sending the second access request to an authentication server; the second access request is used for triggering the authentication server to obtain the IMEI number of the terminal and the IP address of the operator network according to the second access request; and according to the IP address of the operator network, confirming that the IMEI number of the terminal is valid, and sending the IMEI number of the terminal to the target terminal.
In this step, the authentication server refers to a server corresponding to the authentication platform. Operator gateways provide operator networks for the terminals, and all the operator networks have corresponding IP addresses; the target terminal refers to a third party terminal, such as a third party terminal interfacing with the authentication server.
In a specific implementation, the operator gateway sends the second access request to the authentication server; the authentication server analyzes the second access request to obtain the IMEI number of the terminal and the IP address carried by the second access request, and the IP address is identified as the IP address of the operator network; and checking whether the second access request passes through the operator gateway or not according to the IP address of the operator network, if so, confirming that the IMEI number of the terminal is valid, and sending the IMEI number of the terminal to the target terminal. Therefore, the target terminal can acquire the IMEI number of the terminal by analyzing the access request of the terminal forwarded by the operator gateway through the authentication server without additionally developing an SDK (software development kit) and calling a terminal system through the SDK, so that the process of acquiring the IMEI number of the terminal by the target terminal is simplified, and the flexibility of acquiring the IMEI number of the terminal is improved.
In the method for acquiring the IMEI number of the terminal, the IMEI number of the terminal is added in a first access request of the terminal through an operator gateway to obtain a second access request, the second access request is sent to an authentication server, the IMEI number of the terminal is obtained through the authentication server according to the second access request, and the IMEI number of the terminal is sent to a target terminal; the target terminal can acquire the IMEI number of the terminal by analyzing the access request of the terminal forwarded by the operator gateway through the authentication server without additionally calling a terminal system, so that the process of acquiring the IMEI number of the terminal by the target terminal is simplified, and the flexibility of acquiring the IMEI number of the terminal is improved. Meanwhile, whether the access request passes through the operator gateway or not is confirmed according to the IP address of the operator network, so that whether the IMEI number of the terminal is valid or not is confirmed, and the accuracy of the obtained IMEI number of the terminal is guaranteed.
In an embodiment, the step S202, obtaining the IMEI number of the terminal according to the first access request, includes: obtaining a terminal identifier of the terminal according to the first access request; and acquiring the IMEI number corresponding to the terminal identifier as the IMEI number of the terminal.
In this embodiment, the terminal identifier refers to unique identification information, such as a device identification number, for representing the terminal.
In the specific implementation, when the terminal performs communication setting, the operator gateway binds the terminal and the corresponding IMEI number in advance, and obtains a corresponding relationship between the terminal identifier and the IMEI number by combining with the terminal identifier corresponding to the terminal, as a preset corresponding relationship between the terminal identifier and the IMEI number. The server analyzes the first access request to obtain a terminal identifier corresponding to a terminal which sends the first access request through an operator network; and inquiring the corresponding relation between the preset terminal identification and the IMEI number to obtain the IMEI number corresponding to the terminal identification as the IMEI number of the terminal. Therefore, an additional terminal system is not required to be called, and the flexibility of obtaining the IMEI number of the terminal is improved.
Further, the operator gateway may also verify the received first access request to ensure whether the first access request is an access request to the authentication server.
In an embodiment, in step S203, before adding the IMEI number of the terminal to the first access request and obtaining the second access request, the method further includes: the first access request is authenticated. Wherein verifying the first access request comprises: and if the first access request is an access request to the authentication server, confirming that the first access request is verified to be passed.
In the specific implementation, the operator gateway matches the first access request with an access request to the authentication server, and if the first access request is the access request to the authentication server, the operator gateway confirms that the first access request is verified; and if the first access request is not the access request to the authentication server, confirming that the first access request is not verified. Therefore, whether the first access request sent by the terminal is an access request to the authentication server or not is confirmed, the defect that the IMEI number of the terminal is leaked due to the fact that the IMEI number of the terminal is subsequently added to other access requests except the access request to the authentication server is avoided, and the accuracy of the IMEI number of the terminal is subsequently added to the first access request is guaranteed.
In an embodiment, in step S203, adding the IMEI number of the terminal to the first access request to obtain a second access request, includes: if the first access request passes the verification, acquiring a position identifier of the IMEI number of the terminal in the first access request; and adding the IMEI number of the terminal to the corresponding position in the first access request according to the position identifier to obtain a second access request.
In this embodiment, the location identifier is used to identify the location of the IMEI number of the terminal in the first access request, i.e. the IMEI number of the terminal has a corresponding insertion location in the first access request.
For example, the operator gateway confirms in advance the location identifier of the IMEI number of the terminal in the first access request; if the first access request passes the verification, the operator gateway acquires a position identifier of the IMEI number of the terminal confirmed in advance in the first access request; and confirming the corresponding position in the first access request of the IMEI number of the terminal according to the position identifier, and adding the IMEI number of the terminal to the corresponding position in the first access request to obtain a second access request. Therefore, the subsequent operator gateway can conveniently send the second access request to the authentication server, and the IMEI number of the terminal can be obtained through the authentication server based on the second access request, so that the flexibility of obtaining the IMEI number of the terminal is further improved.
Further, to ensure that the second access request is sent securely to the authentication server, the operator gateway may also encrypt the second access request.
In an embodiment, in step S203, after adding the IMEI number of the terminal to the first access request and obtaining the second access request, the method further includes: acquiring a secret key of an authentication server; encrypting the second access request according to the secret key to obtain an encrypted second access request; and the encrypted second access request carries a key identifier corresponding to the key.
In this embodiment, the key is sent to the operator gateway after being pre-established by the authentication server, so the operator gateway stores the key of the authentication server. The key identification means unique identification information for representing a key. Through the embodiment, the secure transmission of the second access request is ensured, so that the security of the IMEI number of the terminal is ensured.
In one embodiment, the step S204 of sending the second access request to the authentication server includes: sending the encrypted second access request to an authentication server; the encrypted second access request is used for triggering the authentication server to acquire a key corresponding to the key identifier, and the encrypted second access request is decrypted according to the key to obtain the IMEI number of the terminal and the IP address of the operator network.
In this embodiment, the operator gateway sends the encrypted second access request to the authentication server; the authentication server acquires a key identifier carried by the encrypted second access request and acquires a corresponding key according to the key identifier; and decrypting the encrypted second access request according to the key to obtain the IMEI number of the terminal and the IP address carried by the encrypted second access request, and identifying the IP address as the IP address of the operator network. Through the embodiment, the security of obtaining the IMEI number of the terminal is further ensured.
In an embodiment, in step S203, after adding the IMEI number of the terminal to the first access request and obtaining the second access request, the method further includes: acquiring a public key of an authentication server; encrypting the second access request according to the public key to obtain an encrypted second access request; and the encrypted second access request carries a public key identifier corresponding to the public key.
Then, the step S204 is to send the second access request to the authentication server, and includes: sending the encrypted second access request to an authentication server; the encrypted second access request is used for triggering the authentication server to acquire a private key matched with the public key corresponding to the public key identification, and the encrypted second access request is decrypted according to the private key to obtain the IMEI number of the terminal and the IP address of the operator network.
In the present embodiment, the public key and the private key are paired and stored in advance in the database in the authentication server, the public key is public, and the private key is secret, but the private key cannot be derived from the public key.
In specific implementation, the operator gateway sends the encrypted second access request to the authentication server; and the authentication server determines a public key corresponding to the public key identification, acquires a private key matched with the public key from the database, decrypts the encrypted second access request according to the private key to obtain the IMEI number of the terminal and the IP address carried by the encrypted second access request, and identifies the IP address as the IP address of the operator network. Through the embodiment, the security of obtaining the IMEI number of the terminal is further ensured.
In one embodiment, as shown in fig. 3, another method for acquiring an IMEI number of a terminal is provided, which includes the following steps:
step S301, receiving a first access request sent by a terminal; the first access request is issued through the carrier network.
Wherein the terminal is connected to an operator network provided by an operator gateway.
Step S302, according to the first access request, obtaining the IMEI number of the terminal.
Step S303, the first access request is verified.
Step S304, if the first access request passes the verification, the IMEI number of the terminal is added into the first access request to obtain a second access request.
Step S305, obtaining a key of the authentication server; encrypting the second access request according to the secret key to obtain an encrypted second access request; and the encrypted second access request carries a key identifier corresponding to the key.
Step S306, sending the encrypted second access request to an authentication server; the encrypted second access request is used for triggering the authentication server to acquire a key corresponding to the key identifier, and the encrypted second access request is decrypted according to the key to obtain the IMEI number of the terminal and the IP address of the operator network; and according to the IP address of the operator network, confirming that the IMEI number of the terminal is valid, and sending the IMEI number of the terminal to the target terminal.
The method for acquiring the IMEI number of the terminal can achieve the following effects:
(1) the target terminal can acquire the IMEI number of the terminal by analyzing any access request of the terminal forwarded by the operator gateway to the authentication server through the authentication server without additionally developing an SDK (software development kit), and a terminal system is called through the SDK, so that the process of acquiring the IMEI number of the terminal by the target terminal is simplified, and the flexibility of acquiring the IMEI number of the terminal is improved.
(2) The first access request is verified, the defect that the IMEI number of the terminal is leaked due to the fact that the IMEI number of the terminal is subsequently added to other access requests except the access request to the authentication server is avoided, and the accuracy of the IMEI number of the terminal is subsequently added to the first access request is guaranteed.
(3) The second access request is encrypted, so that the transmission security of the second access request is ensured; meanwhile, whether the access request passes through the operator gateway or not is confirmed according to the IP address of the operator network, so that whether the IMEI number of the terminal is valid or not is confirmed, and the security and the accuracy of the obtained IMEI number of the terminal are guaranteed.
(4) The terminal identity can be determined based on the acquired IMEI number of the terminal, so that the operation risk of the terminal is controlled; and acquiring information such as the corresponding detailed model of the terminal based on the acquired IMEI number of the terminal.
In an embodiment, as shown in fig. 4, there is provided another method for acquiring an IMEI number of a terminal, which is described by taking the method as an example for being applied to the authentication server in fig. 1, and includes the following steps:
step S401, receiving a second access request sent by an operator gateway; the operator gateway is used for receiving a first access request sent by the terminal, obtaining an IMEI number of the terminal according to the first access request, and adding the IMEI number of the terminal into the first access request to obtain a second access request; the first access request is issued through the carrier network.
Wherein the terminal is connected to an operator network provided by an operator gateway.
Step S402, according to the second access request, obtaining the IMEI number of the terminal and the IP address of the operator network.
Step S403, according to the IP address of the operator network, the IMEI number of the terminal is confirmed to be valid.
Step S404, the IMEI number of the terminal is sent to the target terminal.
According to the method for acquiring the IMEI number of the terminal, the target terminal can acquire the IMEI number of the terminal by analyzing the access request of the terminal forwarded by the operator gateway through the authentication server without additionally calling a terminal system, so that the process of acquiring the IMEI number of the terminal by the target terminal is simplified, and the flexibility of acquiring the IMEI number of the terminal is improved. Meanwhile, whether the access request passes through the operator gateway or not is confirmed according to the IP address of the operator network, so that whether the IMEI number of the terminal is valid or not is confirmed, and the accuracy of the obtained IMEI number of the terminal is guaranteed.
In one embodiment, the step S403, confirming that the IMEI number of the terminal is valid according to the IP address of the operator network, includes: and if the IP address of the operator network is matched with the preset IP address, determining that the IMEI number of the terminal is valid.
In this embodiment, the preset IP address refers to a fixed IP address corresponding to an operator network provided by an operator gateway.
For example, the authentication server acquires a preset IP address, matches the IP address of the operator network with the preset IP address, and determines that the IMEI number of the terminal is valid if the IP address of the operator network matches the preset IP address, which indicates that the second access request is sent through the operator gateway; and if the IP address of the operator network is not matched with the preset IP address, the second access request is not sent through the operator gateway, and the IMEI number of the terminal is determined to be invalid. In this embodiment, whether the access request passes through the operator gateway is determined according to the IP address of the operator network, so as to determine whether the IMEI number of the terminal is valid, which is beneficial to ensuring the accuracy of the obtained IMEI number of the terminal.
It should be understood that although the various steps in the flow charts of fig. 2-4 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 2-4 may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, and the order of performance of the sub-steps or stages is not necessarily sequential, but may be performed in turn or alternating with other steps or at least some of the sub-steps or stages of other steps.
In one embodiment, as shown in fig. 5, there is provided an apparatus for acquiring an IMEI number of a terminal, including: a request receiving module 510, an IMEI number obtaining module 520, an IMEI number adding module 530 and a request sending module 540, wherein:
a request receiving module 510, configured to receive a first access request sent by a terminal; the first access request is issued through the carrier network.
An IMEI number obtaining module 520, configured to obtain the IMEI number of the terminal according to the first access request.
An IMEI number adding module 530, configured to add the IMEI number of the terminal to the first access request to obtain a second access request.
A request sending module 540, configured to send the second access request to the authentication server; the second access request is used for triggering the authentication server to obtain the IMEI number of the terminal and the IP address of the operator network according to the second access request; and according to the IP address of the operator network, confirming that the IMEI number of the terminal is valid, and sending the IMEI number of the terminal to the target terminal.
In one embodiment, the IMEI number obtaining module is further configured to obtain a terminal identifier of the terminal according to the first access request; and acquiring the IMEI number corresponding to the terminal identifier as the IMEI number of the terminal.
In one embodiment, the apparatus for acquiring an IMEI number of a terminal further includes a request verification module, configured to add the IMEI number of the terminal to the first access request by the IMEI number addition module, and verify the first access request before obtaining the second access request.
In one embodiment, the IMEI number adding module is further configured to, if the first access request is verified, obtain a location identifier of the IMEI number of the terminal in the first access request; and adding the IMEI number of the terminal to the corresponding position in the first access request according to the position identifier to obtain a second access request.
In one embodiment, the request verification module is further configured to confirm that the first access request is verified if the first access request is an access request to the authentication server.
In one embodiment, the apparatus for acquiring the IMEI number of the terminal further includes a request encryption module, configured to add the IMEI number of the terminal to the first access request by the IMEI number addition module, and acquire the key of the authentication server after obtaining the second access request; encrypting the second access request according to the secret key to obtain an encrypted second access request; and the encrypted second access request carries a key identifier corresponding to the key.
In one embodiment, the request sending module is further configured to send the encrypted second access request to the authentication server; the encrypted second access request is used for triggering the authentication server to acquire a key corresponding to the key identifier, and the encrypted second access request is decrypted according to the key to obtain the IMEI number of the terminal and the IP address of the operator network.
In the embodiments, the IMEI number of the terminal is added to the first access request of the terminal through the operator gateway to obtain the second access request, and the second access request is sent to the authentication server, so that the IMEI number of the terminal is obtained through the authentication server according to the second access request, and the IMEI number of the terminal is sent to the target terminal; the target terminal can acquire the IMEI number of the terminal by analyzing the access request of the terminal forwarded by the operator gateway through the authentication server without additionally calling a terminal system, so that the process of acquiring the IMEI number of the terminal by the target terminal is simplified, and the flexibility of acquiring the IMEI number of the terminal is improved. Meanwhile, whether the access request passes through the operator gateway or not is confirmed according to the IP address of the operator network, so that whether the IMEI number of the terminal is valid or not is confirmed, and the accuracy of the obtained IMEI number of the terminal is guaranteed.
For specific limitation of the obtaining apparatus of the IMEI number of the terminal, refer to the above limitation on the obtaining method of the IMEI number of the terminal, and are not described herein again. All or part of the modules in the device for acquiring the IMEI number of the terminal can be realized by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, as shown in fig. 1, there is provided a system for acquiring an IMEI number of a terminal, including: an operator gateway 120 and an authentication server 130 connected through a network, the operator gateway 120 being further connected to the terminal 110, the authentication server being further connected to the target terminal 140;
a terminal 110 for sending a first access request to an operator gateway 120;
an operator gateway 120, configured to perform the steps of the method for acquiring an IMEI number of a terminal according to any embodiment of the present application;
an authentication server 130, configured to perform the steps of the method for acquiring an IMEI number of a terminal according to any embodiment of the present application;
and a target terminal 140 for receiving the IMEI number of the terminal transmitted by the authentication server 130.
Wherein, the terminal 110 is connected to an operator network provided by the operator gateway 120; the terminal 110 may be various smart phones, tablet computers, etc.; the operator gateway 120 may be a mobile gateway, a telecommunications gateway, or the like; the authentication server 130 is based on all the implementation servers of the present application, such as an account authentication server; the method can be realized by an independent server or a server cluster consisting of a plurality of servers; the target terminal 140 refers to a third party terminal, such as a third party terminal that interfaces with an authentication server.
According to the system for acquiring the IMEI number of the terminal, the IMEI number of the terminal can be acquired by the target terminal analyzing the access request of the terminal forwarded by the operator gateway through the authentication server without additionally calling a terminal system, so that the process of acquiring the IMEI number of the terminal by the target terminal is simplified, and the flexibility of acquiring the IMEI number of the terminal is improved. Meanwhile, whether the access request passes through the operator gateway or not is confirmed according to the IP address of the operator network, so that whether the IMEI number of the terminal is valid or not is confirmed, and the accuracy of the obtained IMEI number of the terminal is guaranteed.
In one embodiment, a computer device is provided, which may be an operator gateway, the internal structure of which may be as shown in fig. 6. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the computer device is used for storing the IMEI number of the terminal. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a method for acquiring an IMEI number of a terminal.
Those skilled in the art will appreciate that the architecture shown in fig. 6 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, there is provided a computer device comprising a memory storing a computer program and a processor implementing the following steps when the processor executes the computer program:
receiving a first access request sent by a terminal; the first access request is sent out through an operator network;
obtaining an IMEI number of the terminal according to the first access request;
adding the IMEI number of the terminal into the first access request to obtain a second access request;
sending the second access request to an authentication server; the second access request is used for triggering the authentication server to obtain the IMEI number of the terminal and the IP address of the operator network according to the second access request; and according to the IP address of the operator network, confirming that the IMEI number of the terminal is valid, and sending the IMEI number of the terminal to the target terminal.
In one embodiment, the processor, when executing the computer program, further performs the steps of: obtaining a terminal identifier of the terminal according to the first access request; and acquiring the IMEI number corresponding to the terminal identifier as the IMEI number of the terminal.
In one embodiment, the processor, when executing the computer program, further performs the steps of: and verifying the first access request before adding the IMEI number of the terminal into the first access request and obtaining the second access request.
In one embodiment, the processor, when executing the computer program, further performs the steps of: if the first access request passes the verification, acquiring a position identifier of the IMEI number of the terminal in the first access request; and adding the IMEI number of the terminal to the corresponding position in the first access request according to the position identifier to obtain a second access request.
In one embodiment, the processor, when executing the computer program, further performs the steps of: and if the first access request is an access request to the authentication server, confirming that the first access request is verified to be passed.
In one embodiment, the processor, when executing the computer program, further performs the steps of: after the IMEI number of the terminal is added into the first access request and a second access request is obtained, a secret key of an authentication server is obtained; encrypting the second access request according to the secret key to obtain an encrypted second access request; and the encrypted second access request carries a key identifier corresponding to the key.
In one embodiment, the processor, when executing the computer program, further performs the steps of: sending the encrypted second access request to an authentication server; the encrypted second access request is used for triggering the authentication server to acquire a key corresponding to the key identifier, and the encrypted second access request is decrypted according to the key to obtain the IMEI number of the terminal and the IP address of the operator network.
In one embodiment, the processor, when executing the computer program, further performs the steps of: receiving a second access request sent by the operator gateway; the operator gateway is used for receiving a first access request sent by the terminal, obtaining an IMEI number of the terminal according to the first access request, and adding the IMEI number of the terminal into the first access request to obtain a second access request; the terminal is connected with an operator network provided by an operator gateway, and a first access request is sent out through the operator network; obtaining the IMEI number of the terminal and the IP address of the operator network according to the second access request; according to the IP address of the operator network, the IMEI number of the terminal is confirmed to be valid; and sending the IMEI number of the terminal to the target terminal.
In one embodiment, the processor, when executing the computer program, further performs the steps of: and if the IP address of the operator network is matched with the preset IP address, determining that the IMEI number of the terminal is valid.
In the embodiments, the computer device, through the computer program running on the processor, enables the target terminal to analyze the access request of the terminal forwarded by the operator gateway through the authentication server, so as to obtain the IMEI number of the terminal, without additionally calling a terminal system, thereby simplifying the process of obtaining the IMEI number of the terminal by the target terminal, and being beneficial to improving the flexibility of obtaining the IMEI number of the terminal.
In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of:
receiving a first access request sent by a terminal; the first access request is sent out through an operator network;
obtaining an IMEI number of the terminal according to the first access request;
adding the IMEI number of the terminal into the first access request to obtain a second access request;
sending the second access request to an authentication server; the second access request is used for triggering the authentication server to obtain the IMEI number of the terminal and the IP address of the operator network according to the second access request; and according to the IP address of the operator network, confirming that the IMEI number of the terminal is valid, and sending the IMEI number of the terminal to the target terminal.
In one embodiment, the computer program when executed by the processor further performs the steps of: obtaining a terminal identifier of the terminal according to the first access request; and acquiring the IMEI number corresponding to the terminal identifier as the IMEI number of the terminal.
In one embodiment, the computer program when executed by the processor further performs the steps of: and verifying the first access request before adding the IMEI number of the terminal into the first access request and obtaining the second access request.
In one embodiment, the computer program when executed by the processor further performs the steps of: if the first access request passes the verification, acquiring a position identifier of the IMEI number of the terminal in the first access request; and adding the IMEI number of the terminal to the corresponding position in the first access request according to the position identifier to obtain a second access request.
In one embodiment, the computer program when executed by the processor further performs the steps of: and if the first access request is an access request to the authentication server, confirming that the first access request is verified to be passed.
In one embodiment, the computer program when executed by the processor further performs the steps of: after the IMEI number of the terminal is added into the first access request and a second access request is obtained, a secret key of an authentication server is obtained; encrypting the second access request according to the secret key to obtain an encrypted second access request; and the encrypted second access request carries a key identifier corresponding to the key.
In one embodiment, the computer program when executed by the processor further performs the steps of: sending the encrypted second access request to an authentication server; the encrypted second access request is used for triggering the authentication server to acquire a key corresponding to the key identifier, and the encrypted second access request is decrypted according to the key to obtain the IMEI number of the terminal and the IP address of the operator network.
In one embodiment, the computer program when executed by the processor further performs the steps of: receiving a second access request sent by the operator gateway; the operator gateway is used for receiving a first access request sent by the terminal, obtaining an IMEI number of the terminal according to the first access request, and adding the IMEI number of the terminal into the first access request to obtain a second access request; the terminal is connected with an operator network provided by an operator gateway, and a first access request is sent out through the operator network; obtaining the IMEI number of the terminal and the IP address of the operator network according to the second access request; according to the IP address of the operator network, the IMEI number of the terminal is confirmed to be valid; and sending the IMEI number of the terminal to the target terminal.
In one embodiment, the computer program when executed by the processor further performs the steps of: and if the IP address of the operator network is matched with the preset IP address, determining that the IMEI number of the terminal is valid.
In the embodiments, the computer-readable storage medium stores the computer program, so that the target terminal can obtain the IMEI number of the terminal by analyzing, by the authentication server, the access request of the terminal forwarded by the operator gateway, without additionally calling a terminal system, thereby simplifying the process of obtaining the IMEI number of the terminal by the target terminal, and facilitating improvement of flexibility of obtaining the IMEI number of the terminal.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.