Equipment positioning method and device, computer equipment and storage medium
By obtaining the LAN IP address and device set identification of smart devices, and combining it with the GPS module to obtain multi-dimensional location information, it solves the problem of smart device positioning accuracy being affected by network services, and achieves higher positioning accuracy and information security sharing.
Patent Information
- Application Number
- CN202410697377.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-31
- Publication Date
- 2024-09-24
AI Technical Summary
In home scenarios, smart devices rely on external network positioning technology, and their positioning accuracy is easily affected by network service or facility failures, resulting in inaccurate positioning functions.
By obtaining the LAN IP address of the target device, query the map server for location information, and use the device set identifier to send location sharing requests to other devices. It combines the GPS module to obtain multi-dimensional location information to ensure positioning accuracy.
It improves the accuracy of device positioning, avoids errors caused by obtaining location information from a single dimension, and ensures safe sharing of location information through device set identification.
Smart Images

Figure CN118694813A
Abstract
Description
Technical Field
[0001] The present application relates to the field of positioning technology, and in particular to a device positioning method, apparatus, computer equipment, storage medium and computer program product. Background Art
[0002] As people's lives gradually upgrade to high-end, personalized and service-oriented, smart devices have also become essential products in people's lives today, such as smart home devices, including sweeping robots, smart speakers, smart switches, surveillance cameras, etc. Smart devices can be centrally managed through the central control system.
[0003] Due to limitations in usage scenarios (such as home scenarios) and device resources (such as device size), smart devices generally do not have self-positioning capabilities and usually obtain positioning information through network positioning technology. However, network positioning technology relies on external services or facilities. Once these services or facilities fail or have maintenance issues, the positioning function is affected and the smart device cannot accurately obtain positioning information, resulting in low device positioning accuracy. Summary of the invention
[0004] Based on this, it is necessary to provide a device positioning method, apparatus, computer equipment, computer-readable storage medium and computer program product that can improve the accuracy of device positioning in response to the above technical problems.
[0005] In a first aspect, the present application provides a device positioning method, comprising:
[0006] Get the IP address corresponding to the current local area network that the target device is currently connected to;
[0007] Sending the IP address to a map server, so that the map server queries the location information of the first device corresponding to the IP address and returns it;
[0008] Upon receiving the first device location information returned by the map server, obtaining the device set identifier corresponding to the device set to which the target device belongs, and sending a location sharing request to other devices in the device set currently connected to the current local area network based on the device set identifier, so that the other devices obtain the second device location information through their own GPS modules and return it;
[0009] Based on the first device location information and the second device location information, target location information corresponding to the target device is determined.
[0010] In a second aspect, the present application also provides a device positioning apparatus, comprising:
[0011] The address acquisition module is used to obtain the IP address corresponding to the current local area network to which the target device is currently connected;
[0012] A query module, used to send the IP address to a map server, so that the map server queries the location information of the first device corresponding to the IP address and returns it;
[0013] A sharing module, used to obtain a device set identifier corresponding to the device set to which the target device belongs, and send a location sharing request to other devices in the device set currently connected to the current local area network based on the device set identifier, so that other devices obtain the location information of the second device through their own GPS modules and return it;
[0014] The positioning module is used to determine the target location information corresponding to the target device based on the first device location information and the second device location information.
[0015] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0016] Get the IP address corresponding to the current local area network that the target device is currently connected to;
[0017] Sending the IP address to a map server, so that the map server queries the location information of the first device corresponding to the IP address and returns it;
[0018] Upon receiving the first device location information returned by the map server, obtaining the device set identifier corresponding to the device set to which the target device belongs, and sending a location sharing request to other devices in the device set currently connected to the current local area network based on the device set identifier, so that the other devices obtain the second device location information through their own GPS modules and return it;
[0019] Based on the first device location information and the second device location information, target location information corresponding to the target device is determined.
[0020] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:
[0021] Get the IP address corresponding to the current local area network that the target device is currently connected to;
[0022] Sending the IP address to a map server, so that the map server queries the location information of the first device corresponding to the IP address and returns it;
[0023] Upon receiving the first device location information returned by the map server, obtaining the device set identifier corresponding to the device set to which the target device belongs, and sending a location sharing request to other devices in the device set currently connected to the current local area network based on the device set identifier, so that the other devices obtain the second device location information through their own GPS modules and return it;
[0024] Based on the first device location information and the second device location information, target location information corresponding to the target device is determined.
[0025] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:
[0026] Get the IP address corresponding to the current local area network that the target device is currently connected to;
[0027] Sending the IP address to a map server, so that the map server queries the location information of the first device corresponding to the IP address and returns it;
[0028] Upon receiving the first device location information returned by the map server, obtaining the device set identifier corresponding to the device set to which the target device belongs, and sending a location sharing request to other devices in the device set currently connected to the current local area network based on the device set identifier, so that the other devices obtain the second device location information through their own GPS modules and return it;
[0029] Based on the first device location information and the second device location information, target location information corresponding to the target device is determined.
[0030] The above-mentioned device positioning method, apparatus, computer equipment, storage medium and computer program product obtain the first device location information returned by the map server by sending the IP address of the current local area network currently connected to the map server; then obtain the device set identifier corresponding to the device set to which the target device belongs, and send a location sharing request to other devices in the device set currently connected to the current local area network according to the device set identifier, so that other devices can obtain the second device location information through their own GPS modules and return it, thereby realizing the sharing of the second device location information, and sharing through the device set identifier ensures the information sharing security of the second device location information. Then, according to the first device location information and the second device location information, the target location information corresponding to the target device is determined, and the device location information can be obtained in multiple dimensions, avoiding the location error caused by the device location information obtained in a single dimension, thereby improving the accuracy of device positioning. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0032] Figure 1 A diagram of an application environment of a device positioning method in an embodiment;
[0033] Figure 2 A schematic diagram of a flow chart of a device positioning method in an embodiment;
[0034] Figure 3 A schematic diagram of a process flow of a device positioning step in an embodiment;
[0035] Figure 4 is a schematic diagram of a location sharing request in one embodiment;
[0036] Figure 5 is a structural block diagram of a device positioning apparatus in one embodiment;
[0037] Figure 6 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0038] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0039] The device positioning method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. Among them, the target device 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. The target device 102 obtains the IP address corresponding to the current local area network to which the target device 102 is currently connected; the target device 102 sends the IP address to the map server 104, so that the map server queries the first device location information corresponding to the IP address and returns it; when the target device 102 receives the first device location information returned by the map server, it obtains the device set identifier corresponding to the device set to which the target device belongs, and sends a location sharing request to other devices in the device set currently connected to the current local area network based on the device set identifier, so that other devices obtain the second device location information through their own GPS modules and return it; the target device 102 determines the target location information corresponding to the target device based on the first device location information and the second device location information. Among them, the target device 102 can be a central control device connected to the central control system, and the central control device is a system for centrally controlling various central control devices, such as a home central control system, a factory central control system, etc. The central control device is controlled by the central control system, and may be, but is not limited to, an IoT device, which may be a smart speaker, a smart TV, a smart air conditioner, a smart vehicle device, etc. The server 104 may be implemented as an independent server or a server cluster consisting of multiple servers.
[0040] In one embodiment, Figure 2 As shown, a device positioning method is provided, which is applied to Figure 1 Taking the target device in as an example, the method includes the following steps:
[0041] Step 202: Obtain the IP address corresponding to the current local area network to which the target device is currently connected.
[0042] The target device refers to a device that is not equipped with a self-positioning function but currently needs to obtain location information. The current local area network refers to the local area network that the target device is currently connected to through the gateway device. The IP address is the Internet Protocol address corresponding to the gateway device, which is used to identify the network address of the gateway device in the local area network.
[0043] Specifically, after the target device is started, it connects to the gateway device according to the device identification, and after the device is verified, it accesses the current local area network through the gateway device. Then the target device triggers the positioning instruction, which can be the positioning instruction triggered by the target device receiving the user's demand, or receiving the positioning instruction triggered by the positioning demand of other devices through the current local area network, or the positioning instruction triggered by the target device at a fixed time. The target device obtains the IP address corresponding to the current local area network currently connected from the gateway device.
[0044] Step 204: Send the IP address to the map server so that the map server queries the location information of the first device corresponding to the IP address and returns it.
[0045] The map server refers to a server that has a location query function through a map. The first device location information refers to the location information returned by the map server, which can represent the geographical location information of the target device.
[0046] Specifically, the target device generates a location acquisition request according to the IP address, and calls the communication interface of the map server, such as the HTTPS interface provided by the map server. The target device sends the location acquisition request to the map server through the communication interface.
[0047] The location acquisition request also includes the device identification of the target device. After receiving the location acquisition request, the map server performs an authorization verification on the device identification of the target device. The authorization verification can be performed by querying the map server to see whether the verification code in the device identification is consistent with the local authorization verification code. If they are consistent, it is determined that the authorization verification of the device identification has passed; if they are inconsistent, it is determined that the authorization verification of the device identification has failed.
[0048] After the map server detects that the authority verification of the device identifier is passed, it searches for the corresponding location information according to the IP address and returns it. The target device receives the location information returned by the map server as the first device location information.
[0049] In one embodiment, the target device receives a user instruction, identifies the user's intention according to the user instruction, and determines the location accuracy information according to the user's intention. After receiving the location information returned by the map server, the target device can extract the target location information from the location information according to the location accuracy information to obtain the first device location information. For example, if the location information returned by the map server includes longitude and latitude information with "country-city-street" accuracy, and the location accuracy information is the city accuracy requirement, the target device extracts the longitude and latitude information of the country-city from the location information to obtain the first device location information.
[0050] The target device can also generate a location acquisition request based on the IP address and location accuracy information and send it to the map server, and receive the location information corresponding to the location accuracy requirement returned by the map server as the first device location information.
[0051] Step 206, when receiving the first device location information returned by the map server, obtain the device set identifier corresponding to the device set to which the target device belongs, and based on the device set identifier, send a location sharing request to other devices in the device set currently connected to the current local area network, so that other devices can obtain the second device location information through their own GPS modules and return it.
[0052] The device set refers to a pre-set set of devices that are allowed to share information. The device set identifier refers to the identifier information that identifies the device set. The device set identifiers of the devices in the same device set are the same. The second device location information refers to the location information of the device obtained by other devices through their own positioning functions.
[0053] Specifically, when the target device receives the first device location information returned by the map server, it obtains the device set identifier corresponding to the device set to which the target device belongs, and the target device generates a location sharing request according to the device set identifier. Then the target device obtains the multicast address associated with the device set identifier, which indicates the information sharing address preset in the local area network, and other devices can receive the shared information through the multicast address.
[0054] The target device sends a location sharing request to the current local area network it is currently connected to according to the multicast address. Other devices in the device set to which the target device belongs receive the location sharing request at the multicast address. Other devices use the local device set identifier to authenticate the location sharing request. The authentication is used to verify whether the target device that sends the location sharing request is in the same device set as itself. If the authentication is successful, the other device obtains the location information through its own GPS module and sends it to the multicast address in the current local area network; if the authentication fails, the other device does not respond. Then the target device obtains the location information returned by other devices from the multicast address in the current local area network as the second device location information.
[0055] In one embodiment, the target device receives multiple pieces of location information sent by other devices. The target device determines the second device location information from each piece of location information according to the sending time of other devices, and the determination may be made according to the sending time from early to late.
[0056] Step 208: Determine target location information corresponding to the target device based on the first device location information and the second device location information.
[0057] Specifically, the target device compares the first device location information with the second device location information, and selects the target location information from the first device location information and the second device location information according to the comparison result.
[0058] In one embodiment, when the authority verification of the device identification of the target device fails, or the first device location information returned by the map server is not received, the target device may use the second device location information as the target location information.
[0059] In the above device positioning method, the first device location information returned by the map server is obtained by sending the IP address of the current local area network currently connected to the map server; then the device set identifier corresponding to the device set to which the target device belongs is obtained, and a location sharing request is sent to other devices in the device set currently connected to the current local area network according to the device set identifier, so that other devices can obtain the second device location information through their own GPS modules and return it, thereby realizing the sharing of the second device location information, and sharing through the device set identifier ensures the information sharing security of the second device location information. Then, according to the first device location information and the second device location information, the target location information corresponding to the target device is determined, and the device location information can be obtained in multiple dimensions, avoiding the location error caused by the device location information obtained in a single dimension, thereby improving the accuracy of device positioning.
[0060] In one embodiment, Figure 3 As shown, step 206, based on the device set identifier, sends a location sharing request to other devices in the device set currently connected to the current local area network, so that other devices obtain the second device location information through their own GPS modules and return it, including:
[0061] Step 302, encrypting the location sharing request based on the device set identifier;
[0062] Step 304, sends an encrypted location sharing request to other devices in the device set currently connected to the current local area network, so that other devices can decrypt the received encrypted location sharing request based on the device set identifier corresponding to the device set to which they belong, and after successful decryption, obtain the second device location information through their own GPS module and return it.
[0063] Specifically, the target device generates a location sharing request based on the IP address, encrypts the location sharing request using the device set identifier, and obtains the encrypted location sharing request. Then, the encrypted location sharing request is sent to the current local area network currently connected according to the multicast address, so that all devices currently connected to the current local area network that can access the multicast address can receive the encrypted location sharing request.
[0064] Devices that receive encrypted location sharing requests from a multicast address in the current local area network can be considered candidate devices. Candidate devices represent devices that are uncertain whether they belong to the same device set as the target device. The candidate device then uses the local device set identifier to decrypt the encrypted location sharing request. If the decryption is successful, it means that the candidate device that has successfully decrypted belongs to the same device set as the target device. The candidate device that has successfully decrypted is determined to be another device in the device set to which the target device belongs. The other device obtains the second device location information through its own GPS module and returns it to the multicast address of the current local area network. The target device obtains the second device location information returned by the other device from the multicast address of the current local area network.
[0065] In a specific embodiment, Figure 4 As shown, a schematic diagram of a location sharing request is provided. The target device is controlled by the central control system, which can be a management server. When the target device is used for the first time, it connects to the current local area network, registers an account with the central control system according to the IP address of the current local area network and the user information, and receives the account ID returned by the central control system. When other devices use the same current local area network IP address to register an account with the central control system, the central control system binds the other devices to the same account ID, and then treats the target device and other devices as a device set, and uses the account ID as the device set identifier of the device set. When the target device is, for example, a smart central control device for a home, the account ID can be understood as a family ID.
[0066] The gateway device is, for example, a router, and other devices are, for example, terminals with GPS functions that are bound to the same account ID as the target device. After triggering the positioning command, the target device generates a location sharing request, generates a key based on the account ID, and uses the key to encrypt the location sharing request to obtain the encrypted location sharing request. The target device assembles the encrypted location sharing request into UDP multicast information, and sends a UDP (User Datagram Protocol) multicast message (encrypted location sharing request) to a specific multicast address of the current local area network once every 10 seconds. Other devices receive the UDP multicast information sent by the target device, use the local account ID to generate a key and decrypt the UDP multicast information. If the decryption is successful, the second device location information is obtained through its own GPS module and sent to the target device until the target device receives the second device location information and stops sending.
[0067] In this embodiment, the location sharing request is encrypted by using the device set identifier, and can only be decrypted by other devices in the same device set, and the location information of the second device is returned, thereby preventing the location sharing request from being received and decrypted by devices outside the device set, thereby ensuring the data security of information sharing in the device set, and thus ensuring the data security of the target location information.
[0068] In one embodiment, step 208, determining target location information corresponding to the target device based on the first device location information and the second device location information, includes:
[0069] Calculating a position error between the first device position information and the second device position information;
[0070] When the position error is greater than a first threshold, using the second device position information as target position information corresponding to the target device;
[0071] When the position error is less than or equal to a preset threshold, target position information corresponding to the target device is selected from the first device position information and the second device position information.
[0072] Specifically, the target device calculates the position error between the first device location information and the second device location information. When the position error is greater than the first threshold, it indicates that there is a position error between the first device location received through the map server and the second device location information. Since the accuracy of GPS location information is higher than the location information queried using the IP address, the second device location information is preferentially used as the target location information corresponding to the target device. When the position error is less than or equal to the preset threshold, it indicates that the accuracy of the first device location and the second device location information received through the map server are consistent, and the target location information corresponding to the target device is selected from the first device location information and the second device location information.
[0073] In this embodiment, by determining the target location information according to the location error between the first device location information and the second device location information, the location error of the first device location information can be avoided, thereby ensuring the accuracy of the target location information.
[0074] In one embodiment, the device positioning method further includes:
[0075] When the first device location information returned by the map server is not received, a location sharing request is sent to a reference device in the device set currently connected to the current local area network and having the same device type as the target device, so that the reference device obtains its own target location information and returns it;
[0076] The target location information returned by the reference device is used as the target location information corresponding to the target device.
[0077] Specifically, when the target device does not receive the first device location information returned by the map server, it needs to share the target location information from other devices. The target device sends a location sharing request to a reference device that is consistent with the device type of the target device in the device set currently connected to the current local area network, so that the reference device obtains its own target location information and returns it. If the device type of the target device is a device type that does not have a self-positioning function, the reference device refers to a device that has the same device set identifier as the target device and does not have a self-positioning function. The non-reference device that is bound to the same device set identifier as the target device is a device with a self-positioning function.
[0078] Specifically, the location sharing request may also include the target device type, such as a target identification code. The target device then sends the location sharing request to other devices in the same device set in the current local area network. Other devices match their own device type with the target device type in the location sharing request, such as comparing their own identification code with the target identification code. If they match, the match is successful, otherwise, the match fails. When other devices detect that the device type matches successfully, they determine the device as a reference device. The reference device obtains its own target location information and returns it to the target device. The target device uses the target location information sent by the reference device as its own target location information. The reference device obtains its own target location information based on the first device location information and the second device location information obtained in advance by it (the reference device). When other devices detect that the device type matches unsuccessfully, the device does not respond.
[0079] In a specific embodiment, the target device receives multiple target location information sent by the reference device through the local area network, and the target device determines one target location information from the multiple target location information as its own target location information. The target device can be determined based on the sending time of the reference device, or based on the historical sharing record of the reference device, such as preferably using the location information sent by the reference device that has shared information the most times as the target location information, and filtering out the location information sent by the reference device that has requested to share information the most times.
[0080] In this embodiment, when the target device does not receive the first device location information returned by the map server, it can directly obtain the target location information from the reference device through the current local area network, without waiting for the non-reference device to turn on the GPS function and send the second device location information to determine the target location information, thereby improving the efficiency of obtaining the target location information.
[0081] In one embodiment, the device positioning method further includes:
[0082] When the position error between the first device position information and the second device position information is greater than a second threshold, returning to the step of sending the IP address to the map server until the first device position information and the second device position information whose position error is less than the second threshold are obtained, and determining the target position information corresponding to the target device based on the first device position information and the second device position information whose position error is less than the second threshold; or
[0083] When the position error between the first device location information and the second device location information is greater than a second threshold, return to the step of sending the IP address to the map server until the number of repeated executions is greater than a preset number of times, to obtain the final first device location information and the second device location information, determine the target location information corresponding to the target device based on the final second device location information, and display a positioning confirmation notification for the target location information on at least one of the target device and the other device.
[0084] Specifically, the second threshold is greater than the first threshold. When the target device detects that the position error between the first device location information and the second device location information is greater than the second threshold, it means that the first device location information has a larger error than the second device location information. At this time, the currently acquired first device location information is no longer trustworthy, and the target device returns to the step of sending the IP address to the map server until the first device location information and the second device location information with a position error less than the second threshold are obtained. This means that the first device location information and the second device location information less than the second threshold are trustworthy. The target device compares the position error with the first threshold and determines the target location information based on the comparison result.
[0085] The target device may also return to the step of sending the IP address to the map server when the position error between the first device location information and the second device location information is greater than a second threshold value, and repeat the execution until the number of times is greater than a preset number of times, such as 3 times, to obtain the final first device location information and second device location information. The target device determines the final second device location information as the target location information corresponding to the target device, and displays a positioning confirmation notification for the target location information on at least one of the target device and the other device, such as displaying a positioning confirmation notification in a pop-up window on the user terminal based on the target location information, receiving the confirmation information returned by the user terminal or not receiving the confirmation information after a preset time period, and using the target location information for subsequent service operations.
[0086] In this embodiment, when the position error between the first device position information and the second device position information is greater than a second threshold, the first device position information and the second device position information are reacquired to reduce the error of the position information, thereby ensuring the accuracy of the target position information.
[0087] In one embodiment, the target device is not configured with a local positioning service, and the device positioning method further includes:
[0088] Sending a service query request carrying the target location information to the target server corresponding to the local service configured on the target device, so that the target server queries the service result based on the target location information and returns it;
[0089] Display service results.
[0090] Specifically, the target device is configured with local services, such as weather query, route planning and other local services, and a server corresponding to the local service configured in the target device is pre-set. After the target device responds to the user instruction, identifies the local service corresponding to the user instruction, determines the target location information according to the first device location information and the second device location information, and sends the target location information to the target server corresponding to the local service, so that the target server queries the service result based on the target location information and returns it, and displays the service result.
[0091] For example, in response to a user instruction sent by a user, such as "How do I get to School A", the target device recognizes the user instruction as a route planning service, and extracts the query location information as "Study A". After the target device determines the target location information based on the first device location information and the second device location information, it generates a service query request corresponding to the user instruction based on the query location information and the target location information, and sends the service query request to the route server corresponding to the route planning service, so that the route planning server queries the location information of Study A, generates a route plan based on the target location information, and then returns it to the target device for display.
[0092] In this embodiment, by sending a service query request carrying the target location information to the target server corresponding to the local service configured by the target device, the utilization rate of the target location information is improved.
[0093] In a specific embodiment, the target device acts as an intelligent central control device, obtains the router IP address through the router of the current local area network currently connected, sends the IP address to the https interface of the map server, and obtains the first device location information queried by the map server.
[0094] After receiving the location information of the first device, the smart central control device generates a key based on the account ID to encrypt the location information of the first device and assemble it into a UDP multicast message. The smart central control device sends a UDP multicast message to a specific multicast address in the current LAN every 10 seconds, and interacts with the mobile phone connected to the same router. Specifically, when the mobile phone APP receives the UDP multicast message sent by the smart central control device, it uses the account ID to decrypt it. After the decryption is successful, the (GPS / Beidou module) positioning service is enabled to obtain the location information of the mobile phone, and the location information of the mobile phone is returned to the smart central control device to obtain the location information of the second device.
[0095] The smart central control device compares the second device location information returned by the mobile phone with the first device location information of the map server. If there is inconsistency, the first device location information and the second device location information are obtained and compared repeatedly for no less than three times. If there is no final inconsistency, the second device location information located by the mobile phone GPS is used as the target location information, and the smart central control device pops up a window on the mobile phone based on the target location information to remind the user to confirm whether the target location information is accurate.
[0096] The smart central control device then uses the account ID as a private key to encrypt the target location information with a private algorithm and generate a service query request. It then sends the service query request to the target server through the https security interface to query the service results and return them, such as obtaining weather information, city names, etc., which are displayed on the screen of the target device.
[0097] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0098] Based on the same inventive concept, the embodiment of the present application also provides a device positioning device for implementing the device positioning method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more device positioning device embodiments provided below can refer to the limitations on the device positioning method above, and will not be repeated here.
[0099] In an exemplary embodiment, Figure 5 As shown, a device positioning apparatus 500 is provided, comprising: an address acquisition module 502, a query module 504, a sharing module 506 and a positioning module 508, wherein:
[0100] The address acquisition module 502 is used to obtain the IP address corresponding to the current local area network currently accessed by the target device;
[0101] A query module 504 is used to send the IP address to a map server, so that the map server queries the first device location information corresponding to the IP address and returns it;
[0102] Sharing module 506, used to obtain a device set identifier corresponding to the device set to which the target device belongs, and send a location sharing request to other devices in the device set currently connected to the current local area network based on the device set identifier, so that other devices obtain the second device location information through their own GPS modules and return it;
[0103] The positioning module 508 is used to determine the target location information corresponding to the target device based on the first device location information and the second device location information.
[0104] In one embodiment, the sharing module 506 is also used to encrypt the location sharing request based on the device set identifier; send the encrypted location sharing request to other devices in the device set currently connected to the current local area network, so that other devices can decrypt the received encrypted location sharing request based on the device set identifier corresponding to the device set to which they belong, and after the decryption is successful, obtain the second device location information through their own GPS module and return it.
[0105] In one embodiment, the positioning module 508 is also used to calculate the position error between the first device position information and the second device position information; when the position error is greater than a first threshold, the second device position information is used as the target position information corresponding to the target device; when the position error is less than or equal to a preset threshold, the target position information corresponding to the target device is selected from the first device position information and the second device position information.
[0106] In one embodiment, the device positioning apparatus 500 is also used to send a location sharing request to a reference device in a device set currently connected to the current local area network and having the same device type as the target device when the first device location information returned by the map server is not received, so that the reference device obtains its own target location information and returns it; and uses the target location information returned by the reference device as the target location information corresponding to the target device.
[0107] In one embodiment, the device positioning apparatus 500 is further used to, when the position error between the first device location information and the second device location information is greater than a second threshold, return to the step of sending the IP address to the map server until the first device location information and the second device location information having a position error less than the second threshold are obtained, and the target location information corresponding to the target device is determined based on the first device location information and the second device location information having a position error less than the second threshold; or, when the position error between the first device location information and the second device location information is greater than the second threshold, return to the step of sending the IP address to the map server until the number of repeated executions is greater than a preset number of times, the final first device location information and the second device location information are obtained, the target location information corresponding to the target device is determined based on the final second device location information, and a positioning confirmation notification for the target location information is displayed on at least one of the target device and the other device.
[0108] In one embodiment, the target device is not configured with a local positioning service, and the device positioning device 500 is also used to send a service query request carrying the target location information to the target server corresponding to the local service configured for the target device, so that the target server queries the service result based on the target location information and returns it; and displays the service result.
[0109] Each module in the above-mentioned device positioning apparatus can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module above.
[0110] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Figure 6 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile 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 the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store map data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a device positioning method is implemented.
[0111] Those skilled in the art will understand that Figure 6 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0112] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.
[0113] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0114] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0115] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0116] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0117] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0118] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A device positioning method, characterized in that: The method comprises: Get the IP address corresponding to the current local area network that the target device is currently connected to; Sending the IP address to a map server, so that the map server queries the first device location information corresponding to the IP address and returns it; Upon receiving the first device location information returned by the map server, obtaining a device set identifier corresponding to the device set to which the target device belongs, and sending a location sharing request to other devices in the device set currently connected to the current local area network based on the device set identifier, so that the other devices obtain the second device location information through their own GPS modules and return it; Based on the first device location information and the second device location information, target location information corresponding to the target device is determined.
2. The method according to claim 1, characterized in that The sending of a location sharing request to other devices in the device set currently connected to the current local area network based on the device set identifier, so that the other devices obtain the second device location information through their own GPS modules and return it, includes: encrypting a location sharing request based on the device set identifier; An encrypted location sharing request is sent to other devices in the device set currently connected to the current local area network, so that the other devices decrypt the received encrypted location sharing request based on the device set identifier corresponding to the device set to which they belong, and after successful decryption, obtain the second device location information through their own GPS module and return it.
3. The method according to claim 1, characterized in that The determining, based on the first device location information and the second device location information, target location information corresponding to the target device includes: Calculating a position error between the first device position information and the second device position information; When the position error is greater than a first threshold, using the second device position information as the target position information corresponding to the target device; When the position error is less than or equal to the preset threshold, target position information corresponding to the target device is selected from the first device position information and the second device position information.
4. The method according to claim 1, characterized in that: The method comprises: When the first device location information returned by the map server is not received, a location sharing request is sent to a reference device in the device set currently connected to the current local area network and having the same device type as the target device, so that the reference device obtains its own target location information and returns it; The target location information returned by the reference device is used as the target location information corresponding to the target device.
5. The method according to claim 3, characterized in that: The method further comprises: When the position error between the first device location information and the second device location information is greater than a second threshold, returning to the step of sending the IP address to the map server until the first device location information and the second device location information having a position error less than the second threshold are obtained, and determining the target location information corresponding to the target device based on the first device location information and the second device location information having a position error less than the second threshold; or When the position error between the first device location information and the second device location information is greater than a second threshold, return to the step of sending the IP address to the map server until the number of repeated executions is greater than a preset number of times, to obtain the final first device location information and the second device location information, determine the target location information corresponding to the target device based on the final second device location information, and display a positioning confirmation notification for the target location information on at least one of the target device and the other devices.
6. The method according to any one of claims 1 to 5, characterized in that The target device is not configured with a local positioning service, and the method further includes: Sending a service query request carrying the target location information to a target server corresponding to the local service configured for the target device, so that the target server queries and returns a service result based on the target location information; Display the service results.
7. A device positioning device, characterized in that: The device comprises: The address acquisition module is used to obtain the IP address corresponding to the current local area network to which the target device is currently connected; A query module, used to send the IP address to a map server, so that the map server queries the first device location information corresponding to the IP address and returns it; A sharing module, used for obtaining a device set identifier corresponding to the device set to which the target device belongs, and sending a location sharing request to other devices in the device set currently connected to the current local area network based on the device set identifier, so that the other devices obtain the second device location information through their own GPS modules and return it; A positioning module is used to determine the target location information corresponding to the target device based on the first device location information and the second device location information.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
