Telegram user location positioning method, device, equipment and storage medium

By using TDLib library and spiral search technology in Telegram applications, user location information is obtained and corrected, the problem of low positioning accuracy of existing instant messaging applications is solved, and higher positioning accuracy and accuracy are achieved.

CN119293352BActive Publication Date: 2025-03-25SHENZHEN MAIFENG TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411826048.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-12
Publication Date
2025-03-25
Estimated Expiration
2044-12-12

AI Technical Summary

Technical Problem

Existing instant messaging applications have problems with low positioning accuracy in geolocation services, especially in complex environments, which are difficult to ensure the accuracy of positioning.

Method used

Establish a connection with the Telegram server through the TDLib library, obtain user authorization and initialize the geolocation service. Push the map to select the center point for the user, and obtain the location information of the surrounding user through spiral search, select the reference point, calculate the distance between the reference point and the target user, obtain the coordinates of the target user through multi-point positioning method, and correct and optimize according to environmental parameters and signal strength.

Benefits of technology

It improves the accuracy of user positioning, solves the problem of inaccurate positioning of a single signal source, takes into account the influence of the environment and signal, and further improves the accuracy of positioning.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119293352B_ABST
    Figure CN119293352B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of computers, and discloses a method, device, equipment and storage medium for locating a Telegram user position. The method includes: establishing a connection with a Telegram server through a TDLib library, obtaining user authorization and initializing a geographic location service; pushing a map to a user for selection, and obtaining a center point selected by the user in the map; performing a spiral search by expanding outward from the center point to obtain surrounding user location information, and selecting a preset number of reference points in the map according to the surrounding user location information; calculating the distance from the reference point to the target user, and obtaining the target user location coordinates through a multi-point positioning method according to the distance from the reference point to the target user; and correcting and optimizing the target user location coordinates according to environmental parameters and signal strength. In an embodiment of the present invention, the problem of inaccurate positioning of a single signal source can be solved, and the positioning accuracy of the user can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computers, and in particular to a Telegram user location positioning method, device, equipment and storage medium. Background Art

[0002] With the development of social networks, people are increasingly relying on various instant messaging applications to stay in touch and share information. Among them, Telegram, as a popular instant messaging tool, provides a variety of functions to enhance the user experience. However, current social applications still have many limitations in geolocation services, especially in certain specific scenarios, such as emergency rescue, social activities or marketing, it is important to be able to accurately locate nearby users.

[0003] Currently, many instant messaging applications provide "people nearby" functions, but these functions usually only show relative locations and cannot provide accurate geographic coordinates. In addition, existing technologies rely on a single signal source, making it difficult to ensure positioning accuracy in complex environments such as multipath propagation and signal obstruction. Summary of the invention

[0004] The main purpose of the present invention is to solve the technical problem of low position positioning accuracy.

[0005] A first aspect of the present invention provides a Telegram user location positioning method, the Telegram user location positioning method comprising:

[0006] Establish a connection with the Telegram server through the TDLib library, obtain user authorization and initialize the geolocation service;

[0007] Pushing a map to the user for selection, and obtaining a center point selected by the user in the map, wherein the center point is located in a preset vicinity of the target user;

[0008] Expanding outward from the center point to perform a spiral search to obtain surrounding user location information, and selecting a preset number of reference points in the map according to the surrounding user location information;

[0009] Calculating the distance from the reference point to the target user, and obtaining the position coordinates of the target user through a multi-point positioning method according to the distance from the reference point to the target user;

[0010] The target user location coordinates are corrected and optimized according to environmental parameters and signal strength.

[0011] Optionally, in a first implementation manner of the first aspect of the present invention, calculating the distance from the reference point to the target user, and obtaining the target user position coordinates by a multi-point positioning method according to the distance from the reference point to the target user includes:

[0012] Obtaining the distance from the reference point to the target user at the previous moment, and calculating the distance from the reference point to the target user at the current moment;

[0013] According to the distance from the reference point to the target user at the previous moment and the distance from the reference point to the target user at the current moment, optimizing and estimating the distance from the reference point to the target user through a Kalman filter;

[0014] According to the distance from the reference point to the target user, the position coordinates of the target user are obtained through a multi-point positioning method.

[0015] Optionally, in a second implementation manner of the first aspect of the present invention, obtaining the target user position coordinates by a multi-point positioning method according to the distance from the reference point to the target user includes:

[0016] Obtaining the position coordinates of the reference point;

[0017] The distance from the reference point to the target user and the position coordinates of the reference point are passed into the trilaterate() function in the trilateration.js library, and the position coordinates of the target user are obtained through the multi-point positioning method;

[0018] The target user location coordinates are converted from Cartesian coordinates to geographic coordinates.

[0019] Optionally, in a third implementation of the first aspect of the present invention, the correcting and optimizing the target user location coordinates according to the environmental parameters and the signal strength includes:

[0020] According to the signal strength, a first actual distance from the reference point to the target user is obtained through a logarithmic distance path loss model;

[0021] Establishing an environmental impact coefficient according to the environmental parameters, and obtaining a second actual distance from the reference point to the target user according to the first actual distance and the environmental impact coefficient;

[0022] The target user position coordinates are corrected and optimized according to the second actual distance.

[0023] Optionally, in a fourth implementation of the first aspect of the present invention, the step of performing a spiral search by expanding outward from the center point to obtain surrounding user location information, and selecting a preset number of reference points in the map according to the surrounding user location information includes:

[0024] Expand outward from the center point to perform a spiral search, and send a request to obtain nearby user information to the Telegram server;

[0025] Receive the user information list fed back by the Telegram server, and obtain the location information of surrounding users according to the user information list;

[0026] A preset number of reference points are selected in the map according to the surrounding user location information.

[0027] Optionally, in a fifth implementation of the first aspect of the present invention, before correcting and optimizing the target user location coordinates according to the environmental parameters and the signal strength, the method further includes:

[0028] If the target user location coordinates cannot be obtained, the search distance parameter is adjusted to balance the search range;

[0029] According to the adjusted search distance parameter, the spiral search for surrounding users continues through the center point within a preset time interval to calculate the target user position coordinates again.

[0030] Optionally, in a sixth implementation of the first aspect of the present invention, establishing a connection with the Telegram server through the TDLib library includes:

[0031] Apply for a Telegram API key and configure the Telegram API key to the TDLib library project;

[0032] Send a connection request to the Telegram server through the TDLib library, so that the Telegram server performs connection verification according to the Telegram API key;

[0033] If the verification is successful, a connection is established with the Telegram server.

[0034] A second aspect of the present invention provides a Telegram user position positioning device, comprising: a memory and at least one processor, wherein instructions are stored in the memory, and the memory and the at least one processor are interconnected through a line; the at least one processor calls the instructions in the memory so that the Telegram user position positioning device executes the above-mentioned Telegram user position positioning method.

[0035] A third aspect of the present invention provides a computer-readable storage medium, which stores instructions. When the computer-readable storage medium is run on a computer, the computer executes the above-mentioned Telegram user location positioning method.

[0036] In an embodiment of the present invention, a connection is established with a Telegram server through the TDLib library, and user authorization and initialization of geographic location services are obtained; a map is pushed to the user for selection, and the center point selected by the user in the map is obtained, and the center point is located in a preset vicinity of the target user; a spiral search is performed by expanding outward from the center point to obtain the location information of surrounding users, and a preset number of reference points are selected in the map according to the location information of surrounding users; the distance from the reference point to the target user is calculated, and the target user location coordinates are obtained by a multi-point positioning method according to the distance from the reference point to the target user; the target user location coordinates are corrected and optimized according to environmental parameters and signal strength. In the present invention, by selecting a center point in the map for a spiral search, a preset number of reference points are selected, and the target user location coordinates are obtained by a multi-point positioning method according to the reference point, the distance between different location points and the target user can be obtained, and the problem of inaccurate positioning of a single signal source can be solved, and the user's positioning accuracy can be improved; at the same time, according to environmental parameters and signal strength, the target user location coordinates are corrected and optimized, taking into account the influence of the environment and signal, and the positioning accuracy can be further improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 A schematic diagram of an embodiment of a Telegram user location positioning method in an embodiment of the present invention;

[0038] Figure 2 This is a schematic diagram of an embodiment of a Telegram user location positioning device in an embodiment of the present invention;

[0039] Figure 3 The figure is a schematic diagram of an embodiment of a Telegram user location positioning device in an embodiment of the present invention. DETAILED DESCRIPTION

[0040] Embodiments of the present invention provide a Telegram user location positioning method, device, equipment and storage medium.

[0041] The embodiments disclosed in the present invention will be described in more detail below with reference to the accompanying drawings. Although certain embodiments disclosed in the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present invention. It should be understood that the drawings and embodiments disclosed in the present invention are only for exemplary purposes and are not intended to limit the scope of protection disclosed in the present invention.

[0042] In the description of the embodiments disclosed in the present invention, the term "including" and similar terms should be understood as open inclusion, that is, "including but not limited to". The term "based on" should be understood as "based at least in part on". The term "one embodiment" or "the embodiment" should be understood as "at least one embodiment". The terms "first", "second", etc. may refer to different or the same objects. Other explicit and implicit definitions may also be included below.

[0043] For ease of understanding, the specific process of the embodiment of the present invention is described below. Figure 1 , an embodiment of the Telegram user location positioning method in an embodiment of the present invention includes:

[0044] S100 establishes a connection with the Telegram server through the TDLib library, obtains user authorization, and initializes the geographic location service.

[0045] In this embodiment, the user terminal device is connected to the Telegram server through the TDLib library, wherein TDLib is a cross-platform library specifically used to build Telegram clients. When using TDLib, it is necessary to create an interface (Client) that interacts with the TDLib instance, which will be used to communicate with the Telegram server. After establishing a connection with the Telegram server, it is necessary to guide the user to authorize and share their location information. Specifically, first construct an authorization URL, send an authorization request to the user, and then process the authorization callback. If the user authorizes, the "nearby people" function is activated. The Telegram user location positioning method of the present invention only locates users who activate the "nearby people" function, avoiding excessive intrusion on user privacy and balancing privacy protection and functional requirements. Secondly, it is necessary to initialize the geographic location service, request the user's geographic location permission, and configure the location update frequency to obtain user information regularly within a preset time interval. At the same time, initialize the location data reception, including registering the location data reception callback to obtain surrounding user information through the Telegram API, and handle location data errors.

[0046] S200, pushing a map to the user for selection, and obtaining the center point selected by the user in the map.

[0047] In this embodiment, a map is pushed to the user for selection, and the user selects a center point in the map, which is located in the preset vicinity of the target user to obtain the best search effect. Specifically, first, the user can select a location through the map application. For example, the user can right-click on the map to set the center point of the map, so that the map will automatically locate the area of ​​the center point. In addition, the user can also manually set the center point of the map by entering the longitude and latitude coordinates or address. Secondly, in order to ensure that the center point selected by the user is located in the preset area of ​​the target user, a variety of positioning technologies can be used. For example, hybrid positioning modes such as GPS, Wi-Fi and base stations can provide fast and accurate location information. In addition, methods such as the hexagonal grid method can be used to calculate the center points of multiple points, thereby ensuring that the selected center point meets the requirements of the preset area.

[0048] S300, performing a spiral search from a central point outward to obtain location information of surrounding users, and selecting a preset number of reference points in the map based on the location information of surrounding users.

[0049] In this embodiment, the data of surrounding users is obtained from the Telegram server once within a preset time interval, including the distance from each user to the positioning user. Specifically, a map will first be provided for the user to select a center point. Through this center point, a spiral search is continuously expanded outward within the preset time interval to obtain the location information of surrounding users, wherein the search coverage is uniform, and the distance between adjacent search points is also fixed. The spiral search can effectively cover the search area while maintaining the uniformity of the search path. Optionally, during the spiral search, a grid search can be performed first to systematically explore a large area to find an insertion point. When performing a spiral search, the grid search starts from p0 to perform a rectangular motion, and then switches to a spiral path for a more accurate search. Then, according to the location information of surrounding users, a preset number of reference points are selected in the map, wherein the preset number can be 3, i.e., 3 reference points are selected.

[0050] S400, calculating the distance from the reference point to the target user, and obtaining the position coordinates of the target user through a multi-point positioning method according to the distance from the reference point to the target user.

[0051] In this embodiment, first, it is necessary to measure the distance between the target user and multiple reference points, and use the multi-point positioning method to determine the position of the target user based on the distance from the reference point to the target user. The basic principle of the multi-point positioning method is to calculate the position of the target point by knowing the coordinates of three or more points and the distances from these points to the target point. Specifically, each reference point can be regarded as the center of a circle, the distance of the target user can be regarded as the radius of the circle, and then the intersection of these circles is found, which is the position of the target user. For example, if there are three reference points A, B, and C, and their distances from the target user are da, db, and dc, respectively, then three circles are drawn with point A as the center and distance da as the radius, point B as the center and distance db as the radius, and point C as the center and distance dc as the radius. The three circles intersect at one point, which is the position of the target user.

[0052] S500, correcting and optimizing the target user location coordinates according to the environmental parameters and the signal strength.

[0053] In this embodiment, due to the influence of the environment and the change of signal strength with distance, the calculation of the distance from the reference point to the target user may be biased, so the target user position coordinates need to be corrected and optimized to improve the positioning accuracy.

[0054] In an optional implementation of the first aspect of the present invention, calculating the distance from the reference point to the target user, and obtaining the position coordinates of the target user by a multi-point positioning method according to the distance from the reference point to the target user includes:

[0055] Obtain the distance from the reference point to the target user at the previous moment, and calculate the distance from the reference point to the target user at the current moment; optimize and estimate the distance from the reference point to the target user through the Kalman filter based on the distance from the reference point to the target user at the previous moment and the distance from the reference point to the target user at the current moment; obtain the position coordinates of the target user through the multi-point positioning method based on the distance from the reference point to the target user.

[0056] In this embodiment, a Kalman filter is used to comprehensively consider multiple measurement results to effectively reduce the impact of random errors, wherein the Kalman filter is a recursive algorithm for dynamic system state estimation, which continuously optimizes the position estimate through two steps of prediction and update. In the prediction stage, the Kalman filter uses the dynamic model of the system to predict the state and its error covariance at the current moment based on the state estimate at the previous moment. In the update stage, when new measurement data arrives, the Kalman filter uses these data to correct the predicted state to obtain a more accurate position estimate. Specifically, the Kalman filter predicts the distance from the reference point to the target user at the current moment based on the distance from the reference point to the target user at the previous moment, and then calculates the Kalman gain matrix, which is used to weigh the difference between the predicted distance from the reference point to the target user at the current moment and the calculated distance from the reference point to the target user at the current moment, and adjusts the distance estimate accordingly.

[0057] In an optional implementation manner of the first aspect of the present invention, obtaining the position coordinates of the target user by a multi-point positioning method according to the distance from the reference point to the target user includes:

[0058] Get the location coordinates of the reference point; pass the distance from the reference point to the target user and the location coordinates of the reference point into the trilaterate() function in the trilateration.js library, and obtain the location coordinates of the target user through the multi-point positioning method; convert the location coordinates of the target user from Cartesian coordinates to geographic coordinates.

[0059] In this embodiment, the trilaterate() function in the trilateration.js library is used to calculate the specific location coordinates of the target user through a geometric method. This function is based on the three-point positioning principle, accepts at least three known points and their distances to the target point, and outputs the coordinates of the target point. By introducing the trilateration.js library, efficient and accurate user positioning is achieved, while simplifying the operation steps and improving the user experience.

[0060] For example, in two-dimensional space, if the coordinates of three points are known, the position of the target point can be found by solving the triangle. , , and target point Distance to three points , , , the coordinates of the target point can be calculated by the following steps:

[0061] 1. Establish the equation:

[0062] According to the Pythagorean theorem, , , Make three circles for the radius:

[0063]

[0064]

[0065]

[0066] 2. Eliminate higher-order terms:

[0067] After eliminating the higher-order terms through two sets of differences, we get the system of equations:

[0068]

[0069]

[0070]

[0071] 3. Solve the system of equations:

[0072] Solved by matrix operations and The coordinates of .

[0073] Then, the target user location coordinates are converted between the Cartesian coordinate system and the geographic coordinate system through the toLonLat_epsg4978 and fromLonLat_epsg4978 functions, and the converted longitude and latitude are output to the user graphical interface for display.

[0074] In an optional implementation of the first aspect of the present invention, correcting and optimizing the target user location coordinates according to the environmental parameters and the signal strength includes:

[0075] According to the signal strength, the first actual distance from the reference point to the target user is obtained through the logarithmic distance path loss model; according to the environmental parameters, the environmental impact coefficient is established, and according to the first actual distance and the environmental impact coefficient, the second actual distance from the reference point to the target user is obtained; according to the second actual distance, the target user position coordinates are corrected and optimized.

[0076] In this embodiment, since the signal strength decreases with increasing distance, a logarithmic distance path loss model is used to estimate the actual distance, and the first actual distance from the reference point to the target user is obtained, wherein the logarithmic distance path loss model is a model for estimating the change of signal strength with distance during wireless signal transmission. The model is based on the logarithmic relationship between signal strength and distance, and can predict the attenuation of the signal due to the increase of distance during transmission. The model takes into account factors such as transmission power, receiving sensitivity, and frequency. At the same time, environmental parameters such as building density, weather conditions (rain and snow attenuation of signals), terrain (the influence of mountains and plains on signal propagation), and time (ionosphere changes during day and night) are analyzed to establish a suitable environmental impact coefficient to adjust the distance (first actual distance) estimation, and obtain the second actual distance from the reference point to the target user, so as to correct and optimize the position coordinates of the target user.

[0077] In an optional implementation of the first aspect of the present invention, performing a spiral search by expanding outward from a center point to obtain surrounding user location information, and selecting a preset number of reference points in a map according to the surrounding user location information includes:

[0078] Perform a spiral search by expanding outward from the center point, and send a request to the Telegram server to obtain information about nearby users; receive a list of user information fed back by the Telegram server, and obtain location information of surrounding users based on the list of user information; select a preset number of reference points in the map based on the location information of surrounding users.

[0079] In this embodiment, the user selects a center point on the map and performs a spiral search by expanding outward from the center point. During the spiral search, when detecting a nearby area, a request for obtaining nearby user information is sent to the Telegram server. The Telegram server will feedback a list containing user information. After receiving the user information list fed back by the Telegram server, the user location information is extracted, which usually includes the user's latitude and longitude coordinates. Then, a preset number of reference points are selected on the map based on the extracted user location information.

[0080] In an optional implementation manner of the first aspect of the present invention, before correcting and optimizing the target user position coordinates according to the environmental parameters and the signal strength, the method further includes:

[0081] If the target user location coordinates cannot be obtained, the search distance parameter is adjusted to balance the search range; according to the adjusted search distance parameter, a spiral search is continued through the center point within a preset time interval to search for surrounding users to calculate the target user location coordinates again.

[0082] In this embodiment, if the target user location coordinates cannot be obtained through the reference point, the search distance parameter is adjusted. If the target user location coordinates cannot be found, the search distance parameter can be appropriately adjusted to expand or narrow the search range, thereby balancing the search efficiency and coverage. Then, according to the adjusted search distance parameter, a spiral search of surrounding users is continued through the center point within a preset time interval to calculate the target user location coordinates again. After each search obtains the surrounding user location information from the Telegram API, the surrounding user location information is stored to ensure that the location of the next search is not repeated.

[0083] In an optional implementation of the first aspect of the present invention, establishing a connection with a Telegram server through the TDLib library includes:

[0084] Apply for a Telegram API key and configure the Telegram API key to the TDLib library project; send a connection request to the Telegram server through the TDLib library, so that the Telegram server can perform connection verification based on the Telegram API key; if the verification is successful, establish a connection with the Telegram server.

[0085] In this embodiment, first, install the TDLib library and log in to the Telegram account. Then, configure the TDLib connection parameters, specifically, first apply for the Telegram API key, then configure the Telegram API key to the TDLib library project, and the Telegram API key user's subsequent API calls. Secondly, through the TDLib library, send a connection request to the Telegram server, the connection request carries the Telegram API key, the Telegram server verifies the Telegram API key, and if the verification is successful, the server address is sent to the user terminal device, so that the user terminal device is connected to the Telegram server.

[0086] See also Figure 2 According to a second aspect of the present invention, a Telegram user location positioning device is provided, and the Telegram user location positioning device comprises:

[0087] The server connection module 10 is used to establish a connection with the Telegram server through the TDLib library, obtain user authorization and initialize the geographic location service;

[0088] The center point selection module 20 is used to push the map to the user for selection and obtain the center point selected by the user in the map, where the center point is located in a preset vicinity of the target user;

[0089] A reference point selection module 30 is used to perform a spiral search extending outward from a center point to obtain location information of surrounding users, and select a preset number of reference points in the map according to the location information of surrounding users;

[0090] The position coordinate calculation module 40 is used to calculate the distance from the reference point to the target user, and obtain the position coordinates of the target user through a multi-point positioning method according to the distance from the reference point to the target user;

[0091] The position coordinate correction module 50 is used to correct and optimize the target user's position coordinates according to environmental parameters and signal strength.

[0092] In an optional implementation of the second aspect of the present invention, the position coordinate calculation module 40 is also used to obtain the distance from the reference point to the target user at the previous moment, and calculate the distance from the reference point to the target user at the current moment; based on the distance from the reference point to the target user at the previous moment, and the distance from the reference point to the target user at the current moment, the distance from the reference point to the target user is optimized and estimated through a Kalman filter; based on the distance from the reference point to the target user, the position coordinates of the target user are obtained through a multi-point positioning method.

[0093] In an optional implementation of the second aspect of the present invention, the position coordinate calculation module 40 is also used to obtain the position coordinates of the reference point; pass the distance from the reference point to the target user and the position coordinates of the reference point into the trilaterate() function in the trilateration.js library, and obtain the target user position coordinates through a multi-point positioning method; convert the target user position coordinates from Cartesian coordinates to geographic coordinates.

[0094] In an optional implementation of the second aspect of the present invention, the position coordinate correction module 50 is also used to obtain a first actual distance from the reference point to the target user based on the signal strength through a logarithmic distance path loss model; establish an environmental impact coefficient based on environmental parameters, and obtain a second actual distance from the reference point to the target user based on the first actual distance and the environmental impact coefficient; and correct and optimize the target user's position coordinates based on the second actual distance.

[0095] In an optional implementation of the second aspect of the present invention, the reference point selection module 30 is also used to perform a spiral search by expanding outward from the center point, and send a request for obtaining nearby user information to the Telegram server; receive a user information list fed back by the Telegram server, and obtain surrounding user location information based on the user information list; and select a preset number of reference points in the map based on the surrounding user location information.

[0096] In an optional implementation of the second aspect of the present invention, the Telegram user location positioning device also includes: a search distance adjustment module, which is used to adjust the search distance parameter to balance the search range if the target user location coordinates cannot be obtained; according to the adjusted search distance parameter, continue to perform a spiral search for surrounding users through the center point within a preset time interval to recalculate the target user location coordinates.

[0097] In an optional implementation of the second aspect of the present invention, the server connection module 10 is also used to apply for a Telegram API key and configure the Telegram API key to the project of the TDLib library; through the TDLib library, a connection request is sent to the Telegram server, so that the Telegram server performs connection verification based on the Telegram API key; if the verification passes, a connection is established with the Telegram server.

[0098] Figure 3 : is a structural diagram of a Telegram user location positioning device provided by an embodiment of the present invention. The Telegram user location positioning device 500 may have relatively large differences due to different configurations or performances, and may include one or more processors (central processing units, CPU) 510 (for example, one or more processors) and a memory 520, and one or more storage media 530 (for example, one or more mass storage devices) storing application programs 533 or data 532. Among them, the memory 520 and the storage medium 530 can be short-term storage or permanent storage. The program stored in the storage medium 530 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations in the Telegram user location positioning device 500. Furthermore, the processor 510 can be configured to communicate with the storage medium 530 to execute a series of instruction operations in the storage medium 530 on the Telegram user location positioning device 500.

[0099] The Telegram user location positioning device 500 may also include one or more power supplies 540, one or more wired or wireless network interfaces 550, one or more input and output interfaces 560, and / or one or more operating systems 531, such as Windows Server, Mac OS X, Unix, Linux, Free BSD, etc. Those skilled in the art will appreciate that Figure 3The structure of the Telegram user location positioning device shown does not constitute a limitation on the Telegram user location positioning device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0100] The present invention also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium. Instructions are stored in the computer-readable storage medium. When the instructions are executed on a computer, the computer executes the steps of the Telegram user location positioning method.

[0101] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0102] In addition, although each operation is described in a specific order, this should be understood as requiring such operation to be performed in the specific order shown or in a sequential order, or requiring that all illustrated operations should be performed to obtain desired results. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single implementation in combination. On the contrary, the various features described in the context of a single implementation can also be implemented in multiple implementations individually or in any suitable sub-combination mode.

[0103] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.

Claims

1. A Telegram user location positioning method, characterized in that: The Telegram user location positioning method includes: Establish a connection with the Telegram server through the TDLib library, obtain user authorization and initialize the geolocation service; Pushing a map to a user for selection, and obtaining a center point selected by the user in the map, wherein the center point is located in a preset vicinity of a target user, and the center point is obtained by calculating multiple points in the preset vicinity using a hexagonal grid method; Performing a spiral search by expanding outward from the center point to obtain surrounding user location information, and selecting a preset number of reference points in the map based on the surrounding user location information, wherein the spiral search first performs a grid search to systematically explore an area to find an insertion point, and the grid search then performs a rectangular motion starting from the insertion point, and then switches to a spiral path for searching; Calculating the distance from the reference point to the target user, and obtaining the position coordinates of the target user through a multi-point positioning method according to the distance from the reference point to the target user; Correcting and optimizing the target user's location coordinates according to environmental parameters and signal strength; The calculating the distance from the reference point to the target user, and obtaining the position coordinates of the target user by a multi-point positioning method according to the distance from the reference point to the target user comprises: Obtaining the distance from the reference point to the target user at the previous moment, and calculating the distance from the reference point to the target user at the current moment; According to the distance from the reference point to the target user at the previous moment and the distance from the reference point to the target user at the current moment, optimizing and estimating the distance from the reference point to the target user through a Kalman filter; According to the distance from the reference point to the target user, the position coordinates of the target user are obtained through a multi-point positioning method.

2. The Telegram user location positioning method according to claim 1, characterized in that: The obtaining the target user position coordinates by a multi-point positioning method according to the distance from the reference point to the target user comprises: Obtaining the position coordinates of the reference point; The distance from the reference point to the target user and the position coordinates of the reference point are passed into the trilaterate() function in the trilateration.js library, and the position coordinates of the target user are obtained through the multi-point positioning method; The target user location coordinates are converted from Cartesian coordinates to geographic coordinates.

3. The Telegram user location positioning method according to claim 1, characterized in that: The correcting and optimizing the target user location coordinates according to the environmental parameters and the signal strength includes: According to the signal strength, a first actual distance from the reference point to the target user is obtained through a logarithmic distance path loss model; Establishing an environmental impact coefficient according to the environmental parameters, and obtaining a second actual distance from the reference point to the target user according to the first actual distance and the environmental impact coefficient; The target user position coordinates are corrected and optimized according to the second actual distance.

4. The Telegram user location positioning method according to claim 1, characterized in that: The step of performing a spiral search by expanding outward from the center point to obtain location information of surrounding users, and selecting a preset number of reference points in the map according to the location information of surrounding users includes: Expand outward from the center point to perform a spiral search, and send a request to obtain nearby user information to the Telegram server; Receive the user information list fed back by the Telegram server, and obtain the location information of surrounding users according to the user information list; A preset number of reference points are selected in the map according to the surrounding user location information.

5. The Telegram user location positioning method according to claim 1, characterized in that: Before correcting and optimizing the target user location coordinates according to the environmental parameters and the signal strength, the method further includes: If the target user location coordinates cannot be obtained, the search distance parameter is adjusted to balance the search range; According to the adjusted search distance parameter, the spiral search for surrounding users continues through the center point within a preset time interval to calculate the target user position coordinates again.

6. The Telegram user location positioning method according to claim 1, characterized in that: The method of establishing a connection with the Telegram server through the TDLib library includes: Apply for a Telegram API key and configure the Telegram API key to the TDLib library project; Send a connection request to the Telegram server through the TDLib library, so that the Telegram server performs connection verification according to the Telegram API key; If the verification is successful, a connection is established with the Telegram server.

7. A Telegram user location positioning device, characterized in that: The Telegram user location positioning device comprises: The server connection module is used to establish a connection with the Telegram server through the TDLib library, obtain user authorization, and initialize the geolocation service; A center point selection module is used to push a map to a user for selection, and obtain a center point selected by the user in the map, wherein the center point is located in a preset vicinity of the target user, and the center point is obtained by calculating multiple points in the preset vicinity using a hexagonal grid method; A reference point selection module, configured to perform a spiral search extending outward from the center point to obtain surrounding user location information, and select a preset number of reference points in the map according to the surrounding user location information, wherein the spiral search first performs a grid search to systematically explore an area to find an insertion point, and the grid search then performs a rectangular motion starting from the insertion point, and then switches to a spiral path for searching; A position coordinate calculation module, used to calculate the distance from the reference point to the target user, and obtain the position coordinates of the target user through a multi-point positioning method according to the distance from the reference point to the target user; A position coordinate correction module, used to correct and optimize the target user's position coordinates according to environmental parameters and signal strength; The position coordinate calculation module is also used to obtain the distance from the reference point to the target user at the previous moment, and calculate the distance from the reference point to the target user at the current moment; based on the distance from the reference point to the target user at the previous moment and the distance from the reference point to the target user at the current moment, the distance from the reference point to the target user is optimized and estimated through a Kalman filter; based on the distance from the reference point to the target user, the position coordinates of the target user are obtained through a multi-point positioning method.

8. A Telegram user location positioning device, characterized in that: The Telegram user location positioning device comprises: a memory and at least one processor, the memory stores instructions, and the memory and the at least one processor are interconnected via a line; The at least one processor calls the instruction in the memory so that the Telegram user location positioning device executes the Telegram user location positioning method as described in any one of claims 1-6.

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 Telegram user location positioning method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • RFID-based essential productive factors locating system for large-area workshop and RFID-based essential productive factors locating method

    CN110320513A

  • Positioning method, server, wireless access device and system

    CN117998294A