Positioning method, device, equipment, product and medium

By combining wireless network signal scanning and auxiliary positioning database, the problem of inaccurate acquisition of national codes for electronic devices under non-cellular network conditions has been solved, achieving more accurate national code positioning.

CN120935758APending Publication Date: 2025-11-11SHENZHEN GUANGTONG YILIAN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511176415.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-20
Publication Date
2025-11-11

AI Technical Summary

Technical Problem

In the absence of cellular network capabilities, electronic devices rely on broadcast messages from wireless access points (APs) to obtain the country code, resulting in low accuracy.

Method used

By scanning wireless network signals, the broadcast messages of wireless access points (APs) in the geographical area where the electronic device is located are obtained, the first candidate country code and MAC address are determined, and the second candidate country code is searched in the auxiliary positioning database. The final country code is determined by comparison.

Benefits of technology

This improves the accuracy of the device in obtaining the country code under conditions without cellular network coverage, reduces interference from invalid or erroneous AP broadcasts, and ensures that the device can accurately identify the country code of the current address.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120935758A_ABST
    Figure CN120935758A_ABST
Patent Text Reader

Abstract

The invention discloses a positioning method and device, equipment, a product and a medium, and the method comprises the steps: obtaining a broadcast message of each wireless access point AP contained in a geographic region where electronic equipment is located through wireless network signal scanning, and determining a first candidate country code and an MAC address of the electronic equipment based on the broadcast message; searching a second candidate country code of the electronic equipment in an auxiliary positioning database based on the MAC address, wherein the auxiliary positioning database comprises at least one MAC address and the corresponding second candidate country code; and comparing the first candidate country code with the second candidate country code, and determining the country code of the electronic equipment according to a comparison result. According to the invention, the country code of the equipment can be positioned more accurately.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communication technology, and in particular to a positioning method, apparatus, device, product, and medium. Background Technology

[0002] With the development of communication technology, the positioning methods for electronic devices are becoming increasingly diverse. One method involves the electronic device obtaining cell system messages through cellular networks, extracting the corresponding Public Land Mobile Network (PLMN), converting it into a Mobile Country Code (MCC), and using this MCC as the device's country code. When the electronic device lacks cellular network capabilities, it uses Wi-Fi scanning to scan for broadcast messages from nearby access points (APs) and identifies the country code carried in these broadcast messages as the device's country code.

[0003] However, without cellular network capabilities, the country code of electronic devices relies on broadcast messages from the access point (AP). But the AP may not broadcast the country code, or it may broadcast an incorrect country code, resulting in low accuracy of the obtained device country code. Therefore, how to more accurately locate the device's country code is an important issue. Summary of the Invention

[0004] This application provides a positioning method, apparatus, equipment, product, and medium that can more accurately locate the country code of the equipment.

[0005] In a first aspect, this application provides a positioning method applied to an electronic device, the method comprising:

[0006] By scanning wireless network signals, the broadcast messages of each wireless access point (AP) in the geographical area where the electronic device is located are obtained, and the first candidate country code and MAC address of the electronic device are determined based on the broadcast messages.

[0007] Based on the MAC address, the electronic device is searched for a second candidate country code in the auxiliary positioning database, which includes at least one MAC address and its corresponding second candidate country code.

[0008] The first candidate country code is compared with the second candidate country code, and the country code of the electronic device is determined based on the comparison result.

[0009] Secondly, this application provides a positioning device disposed in an electronic device, the device comprising:

[0010] The first determining unit is used to obtain broadcast messages of each wireless access point (AP) in the geographical area where the electronic device is located by scanning wireless network signals, and to determine the first candidate country code and MAC address of the electronic device based on the broadcast messages.

[0011] The lookup unit is used to search for a second candidate country code of the electronic device in the auxiliary positioning database based on the MAC address. The auxiliary positioning database includes at least one MAC address and its corresponding second candidate country code.

[0012] The second determining unit is used to compare the first candidate country code with the second candidate country code, and determine the country code of the electronic device based on the comparison result.

[0013] Thirdly, this application provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the method in the first aspect of this application.

[0014] Fourthly, this application provides a computer program product comprising a computer program stored in a computer-readable storage medium. A processor of an electronic device reads the computer program from the computer-readable storage medium and executes the computer program, causing the electronic device to perform the method described in the first aspect.

[0015] Fifthly, this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, causes the processor to perform the method described in the first aspect above.

[0016] The method proposed in this application obtains broadcast messages from various wireless access points (APs) within the geographical area where the electronic device is located by scanning wireless network signals, and determines the first candidate country code and MAC address of the electronic device based on the broadcast messages; searches for the second candidate country code of the electronic device in an auxiliary positioning database based on the MAC address, the auxiliary positioning database including at least one MAC address and its corresponding second candidate country code; compares the first candidate country code with the second candidate country code, and determines the country code of the electronic device based on the comparison result, which can more accurately locate the country code of the device. Attached Figure Description

[0017] To more clearly illustrate the technical solutions in this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1 This is a schematic diagram illustrating the principle of a positioning method provided in an embodiment of this application;

[0019] Figure 2 This is a schematic diagram of the structure of a positioning system provided in an embodiment of this application;

[0020] Figure 3 This is a flowchart illustrating a positioning method provided in an embodiment of this application;

[0021] Figure 4 This is a schematic diagram of the structure of a positioning device provided in an embodiment of this application;

[0022] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0023] The technical solutions of this application will now be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0024] This application proposes a positioning method applicable to country code positioning scenarios, enabling more accurate location of a device's country code. Specifically, this application can obtain broadcast messages from various wireless access points (APs) within the geographical area where the electronic device is located through wireless network signal scanning. Based on these broadcast messages, a first candidate country code and a Media Access Control (MAC) address for the electronic device are determined. A second candidate country code for the electronic device is then searched in an auxiliary positioning database based on this MAC address. The first and second candidate country codes are compared, and the country code of the electronic device is determined according to the comparison result.

[0025] This method can effectively eliminate interference from invalid and erroneous AP broadcasts, ensuring that the device can accurately identify the country code of its current address.

[0026] Please see Figure 1 , Figure 1 This is a schematic diagram illustrating the principle of a positioning method provided in an embodiment of this application. The following is in conjunction with... Figure 1 The principle of the positioning method provided in this application is briefly explained as follows:

[0027] S101, turn on the electronic device;

[0028] S102, running the national code decision-making module;

[0029] The national code decision module is a module in the electronic device used to obtain the national code. The national code decision module may include a first determining unit, a searching unit, and a second determining unit, and the national code of the electronic device is determined through each unit.

[0030] In one optional implementation, if the electronic device detects an instruction to turn on the electronic device, it can trigger the electronic device to run the national code decision module; in another optional implementation, if the electronic device receives a request instruction to obtain the national code, it can trigger the running of the national code decision module; this application does not specifically limit the method of triggering the running of the national code decision module.

[0031] S103, WiFi scanning;

[0032] Specifically, the WiFi function of electronic devices can be enabled in advance, allowing the electronic devices to perform WiFi scanning through the national code decision module.

[0033] S104, determine the first candidate country code of the electronic device by WiFi scanning;

[0034] Specifically, the broadcast messages of each wireless access point (AP) in the geographical area where the electronic device is located can be obtained by WiFi scanning, and the first candidate country code of the electronic device can be determined from the broadcast messages of each AP.

[0035] S105, determines the MAC address of the electronic device by WiFi scanning, and determines the second candidate country code based on the MAC address;

[0036] Specifically, broadcast messages from various wireless access points (APs) in the geographical area where the electronic device is located can be obtained through WiFi scanning. The MAC address of the electronic device can be determined from the broadcast messages of each AP. Based on the MAC address, a second candidate country code for the electronic device is searched in an auxiliary positioning database. This auxiliary positioning database includes at least one MAC address and its corresponding second candidate country code. This auxiliary positioning database can be set up in a positioning server. Electronic devices can import data from the auxiliary positioning database from the positioning server. By setting the auxiliary positioning database on the positioning server, multiple electronic devices can obtain data from the auxiliary positioning database, which helps to achieve batch acquisition of corresponding country codes by multiple electronic devices.

[0037] In an alternative implementation, the auxiliary positioning database may be imported from the positioning server into the electronic device after the national code decision module is run, such as by importing the national code decision module.

[0038] Optionally, if the electronic device detects that the national decision-making module is running, it can send a data request to the positioning server to obtain the auxiliary positioning database, so that the positioning server responds to the electronic device's data request and sends the data from the auxiliary positioning database to the electronic device for its use.

[0039] S106, Based on the MAC address, search for the geographic coordinates of the electronic device in the auxiliary positioning database, and determine the country code of the electronic device based on the geographic coordinates;

[0040] The auxiliary positioning database also includes the geographic coordinates corresponding to each MAC address. Specifically, the first candidate country code is compared with the second candidate country code. If the comparison result is the same, the first or second candidate country code is determined as the country code of the electronic device and reported to the positioning server. If the comparison result is different, the geographic coordinates of the electronic device are searched in the auxiliary positioning database based on the MAC address, and the country code of the electronic device is determined based on the geographic coordinates.

[0041] S107 reports the country code of the electronic device to the WiFi submodule.

[0042] Specifically, the country code of the electronic device can be reported to the positioning server through the WiFi submodule. Alternatively, the second candidate country code corresponding to the MAC address in the auxiliary positioning database can be updated to the country code of the electronic device, and the updated auxiliary positioning database can be reported to the positioning server.

[0043] The key technical terms involved in this application are described in detail below.

[0044] I. Wireless Access Point (AP)

[0045] A wireless access point (AP) is a network device and a core component of a wireless local area network (WLAN). It converts wired network signals into wireless signals, enabling wireless devices (such as mobile phones and laptops) to access the wired network. It is typically used in homes, offices, and campuses, with a coverage range ranging from tens to hundreds of meters.

[0046] II. National Code

[0047] The country code refers to the Mobile Country Code (MCC), a 3-digit code assigned by the International Telecommunication Union (ITU) to uniquely identify the country to which a user belongs in a mobile communication system.

[0048] III. Auxiliary Positioning Database

[0049] The auxiliary positioning database refers to a database pre-set on the positioning server, used to store at least one MAC address and its corresponding second candidate country code, as well as the geographic coordinates corresponding to each MAC address, which are coordinates obtained based on the positioning system.

[0050] It is worth emphasizing that when any of the embodiments proposed in this application are applied to a specific product or technology, any data (such as data in the assisted positioning database) is collected with the permission or consent of the user / application, and the collection, use and processing of the relevant data comply with the relevant laws, regulations and standards of the relevant region.

[0051] The following is a detailed description of the structural diagram of the positioning system provided in this application.

[0052] Please see Figure 2 , Figure 2 This is a schematic diagram of the structure of a positioning system provided in an embodiment of this application. Figure 2 As shown, the positioning system may include a positioning server 200 and a terminal device cluster. The terminal device cluster may include one or more terminal devices; the number of terminal devices is not limited here. Figure 2 As shown, multiple terminal devices may specifically include terminal device 1, terminal device 2, terminal device 3, ..., terminal device n; as... Figure 2 As shown, terminal device 1, terminal device 2, terminal device 3, ..., terminal device n can all connect to the positioning server 200 via the network, so that each terminal device can interact with the positioning server 200 through the network connection.

[0053] like Figure 2 The positioning server 200 shown can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. Terminal devices can be: smartphones, tablets, laptops, desktop computers, smart TVs, in-vehicle terminals, smart home devices, and other smart terminals.

[0054] In specific implementations, the aforementioned positioning scheme can be executed by an electronic device, which can be a terminal device or a server. Alternatively, the aforementioned positioning scheme can also be executed jointly by a terminal device and a server. For example, taking the joint execution by a terminal device and a server in this application as an example, the following is a detailed description of the embodiments of this application using the communication between terminal device 1 and positioning server 200 as an example.

[0055] Terminal device 1 communicates with positioning server 200 via a network. The auxiliary positioning database can be integrated into positioning server 200, or it can be placed in the cloud or other network servers, as described below.

[0056] Terminal device 1 can scan wireless network signals to obtain broadcast messages from various wireless access points (APs) in the geographical area where terminal device 1 is located, and determine the first candidate country code and MAC address of terminal device 1 based on the broadcast messages; search for the second candidate country code of terminal device 1 in the auxiliary positioning database based on the MAC address, the auxiliary positioning database including at least one MAC address and its corresponding second candidate country code; compare the first candidate country code with the second candidate country code, and determine the country code of terminal device 1 according to the comparison result; terminal device 1 sends the determined country code to the positioning server 200, so that the positioning server 200 updates the country code of electronic devices in the auxiliary positioning database.

[0057] It is understood that the positioning system described in the embodiments of this application is for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and does not constitute a limitation on the technical solutions provided in the embodiments of this application. As those skilled in the art know, with the evolution of system architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.

[0058] The specific embodiments of the positioning method are described below with reference to the accompanying drawings.

[0059] Please see Figure 3 , Figure 3 This is a flowchart illustrating a positioning method provided in an embodiment of this application. The executing entity in this embodiment can be a positioning device, which can be a single electronic device or a cluster of multiple electronic devices. The electronic device can be a server, a terminal device, or other devices; there are no limitations on this. Figure 3 As shown, the method may include:

[0060] S301 obtains the broadcast messages of each wireless access point (AP) in the geographical area where the electronic device is located by scanning the wireless network signal, and determines the first candidate country code and MAC address of the electronic device based on the broadcast messages.

[0061] Specifically, for electronic devices without cellular networks, the system can scan for Wi-Fi signals to obtain broadcast messages from various access points (APs) within the geographical area where the electronic device is located. Based on these broadcast messages, the system can determine the electronic device's first candidate country code and MAC address, which can then be stored in a designated file. The electronic device can enable its Wi-Fi function beforehand, allowing it to scan for broadcast messages from the various APs within its geographical area. This geographical area can be a specified region surrounding the electronic device, such as within 100 meters.

[0062] In one alternative implementation, the broadcast message may carry the corresponding country code and MAC address, and the electronic device may directly determine the first candidate country code and MAC address of the electronic device through the country code and MAC address carried in the broadcast message.

[0063] In another alternative implementation, the broadcast message may also carry an identifier and MAC address indicating the country. The electronic device may determine the corresponding country code based on the identifier carried in the broadcast message and use the determined country code and the MAC address carried in the broadcast message as the first candidate country code and MAC address of the electronic device.

[0064] In one implementation, since wireless network signals may be unstable at different locations or times, electronic devices can scan the wireless network signal multiple times via WiFi to obtain broadcast messages from various wireless access points (APs) in the geographical area where the electronic device is located, and determine the first candidate country code and MAC address of the electronic device based on the broadcast messages obtained from multiple WiFi scans.

[0065] Optionally, in the process of determining the first candidate country code of the electronic device based on the broadcast messages obtained from multiple WiFi scans, the electronic device can determine the country code corresponding to each WiFi scan based on the broadcast messages obtained from each WiFi scan, and for any country code corresponding to any WiFi scan, obtain the proportion of the country code corresponding to any WiFi scan in the country codes corresponding to multiple WiFi scans; based on this proportion, determine the first candidate country code of the electronic device, and the proportion of the first candidate country code of the electronic device is greater than the proportion of other country codes in the country codes corresponding to multiple WiFi scans.

[0066] For example, suppose an electronic device scans WiFi three times and obtains nine broadcast messages from three wireless access points (APs) in the geographical area where the electronic device is located. If the nine broadcast messages obtained from the three WiFi scans carry three country codes 1, two country codes 2, and four country codes 3, then it can be determined that country code 1 accounts for 1 / 3, country code 2 accounts for 2 / 9, and country code 3 accounts for 4 / 9. Therefore, the first candidate country code for the electronic device can be determined to be country code 3.

[0067] This application embodiment obtains broadcast messages from various wireless access points (APs) within the geographical area where the electronic device is located by performing multiple wireless network signal scans. This reduces the probability of signal instability causing failure to receive broadcast messages or receiving incorrect broadcast messages, resulting in inaccurate first candidate country codes. By performing multiple wireless network signal scans and determining the first candidate country code based on the results of these scans, the accuracy of the scanned signals and the accuracy of the first candidate country code are improved.

[0068] S302, based on the MAC address, search for the second candidate country code of the electronic device in the auxiliary positioning database, the auxiliary positioning database including at least one MAC address and its corresponding second candidate country code.

[0069] The auxiliary positioning database stores at least one MAC address and its corresponding second candidate country code, as well as the geographic coordinates corresponding to each MAC address. A description of this auxiliary positioning database can be found here. Figure 1 The description of the corresponding embodiments will not be repeated here.

[0070] In one implementation, there are multiple MAC addresses, and a MAC address is obtained based on a broadcast message from an AP. The electronic device can search for the second candidate country code corresponding to any MAC address in the auxiliary positioning database for any MAC address among the multiple MAC addresses. For any second candidate country code, the proportion of the second candidate country code among the second candidate country codes corresponding to the multiple MAC addresses is obtained. Based on the proportion, the second candidate country code of the electronic device is determined, and the proportion of the second candidate country code of the electronic device is greater than the proportion of other second candidate country codes among the second candidate country codes corresponding to the multiple MAC addresses.

[0071] For example, taking the example of obtaining the first candidate country code in S301 above as an illustration, suppose the electronic device scans WiFi three times and obtains nine broadcast messages from three wireless access points (APs) in the geographical area where the electronic device is located. Among these nine broadcast messages are nine MAC addresses, including three MAC1s, five MAC2s, and one MAC3. If the second candidate country code corresponding to MAC1 is found to be country code 1, the second candidate country code corresponding to MAC2 is country code 4, and the second candidate country code corresponding to MAC3 is country code 3 in the auxiliary positioning database, then it can be determined that country code 1 accounts for 3 / 9 of the second candidate country codes corresponding to multiple MAC addresses, country code 4 accounts for 5 / 9, and country code 3 accounts for 1 / 9. Based on the proportion of each second candidate country code, the second candidate country code of the electronic device is determined to be country code 4, which has the largest proportion.

[0072] This application uses a method to search a assisted positioning database for second candidate country codes corresponding to each MAC address based on broadcast messages. This facilitates subsequent comparison of the first and second candidate country codes, and determines the country code of the electronic device based on the comparison results. This approach allows for determination of the electronic device's country code even when comparison results are inconsistent, indicating that either the first candidate country code obtained from the broadcast message or the second candidate country code obtained from the assisted positioning database is incorrect. This allows for further methods to determine the country code of the electronic device.

[0073] S303, compare the first candidate country code with the second candidate country code, and determine the country code of the electronic device based on the comparison result.

[0074] In a specific implementation, the electronic device can compare the first candidate country code with the second candidate country code. If the comparison result shows that the first candidate country code and the second candidate country code are the same, then the first candidate country code or the second candidate country code is determined as the country code of the electronic device. If the comparison result shows that the first candidate country code and the second candidate country code are different, then the geographical coordinates of the electronic device can be searched in the auxiliary positioning database based on the MAC address, and the country code of the electronic device can be determined based on the geographical coordinates. As mentioned above, the auxiliary positioning database also includes the geographical coordinates corresponding to each MAC address.

[0075] In one embodiment, during the process of determining the country code of an electronic device based on geographical coordinates, the country code of the country to which the geographical coordinates belong can be determined as the country code of the electronic device.

[0076] In one implementation, there are multiple MAC addresses. A MAC address is obtained based on a broadcast message from an AP. The electronic device can search for the geographic coordinates corresponding to any MAC address in the auxiliary positioning database and determine the country identifier of the country to which the geographic coordinates corresponding to the MAC address belong. For any country identifier, the proportion of the country identifier among the country identifiers corresponding to the multiple MAC addresses is obtained. Based on the proportion, the country to which the geographic coordinates belong is determined, and the proportion of the country identifier of the country to which the geographic coordinates belong is greater than the proportion of other country identifiers among the country identifiers corresponding to the multiple MAC addresses.

[0077] In this system, one country identifier can correspond to multiple geographic coordinates. In some embodiments, different geographic coordinates can correspond to the same country identifier, while in other embodiments, different geographic coordinates can correspond to different country identifiers. The country identifier can include, but is not limited to, any one or more characters such as numbers, letters, and words.

[0078] For example, combining the examples of obtaining the first candidate country code in S301 and obtaining the second candidate country code in S302, suppose the electronic device scans WiFi three times and obtains nine broadcast messages from three wireless access points (APs) in the geographical area where the electronic device is located. These nine broadcast messages include nine MAC addresses, of which three are MAC1, five are MAC2, and one is MAC3. The auxiliary positioning database is searched for the geographic coordinates 1 corresponding to MAC1, and the country identifier 1 of the country to which MAC1 corresponds is determined. Similarly, the auxiliary positioning database is searched for the geographic coordinates 2 corresponding to MAC2, and the country identifier 2 of the country to which MAC2 corresponds is determined. The auxiliary positioning database is also searched for the geographic coordinates 3 corresponding to MAC3, and the country identifier 2 of the country to which MAC3 corresponds is determined. Therefore, the proportion of country identifier 1 among the country identifiers corresponding to multiple MAC addresses is 3 / 9, and the proportion of country identifier 2 among the country identifiers corresponding to multiple MAC addresses is 6 / 9. Thus, the country to which country identifier 2, with the largest proportion of 6 / 9, belongs can be determined, and the country code 4 of the country to which country identifier 2 belongs is determined as the country code of the electronic device.

[0079] In one implementation, after determining the country code of the electronic device based on geographical coordinates, the electronic device can update the second candidate country code corresponding to the MAC address in the auxiliary positioning database to the country code of the electronic device, thereby obtaining an updated auxiliary positioning database.

[0080] This application improves the accuracy of the assisted positioning database by updating it in real time, which helps multiple devices to more accurately obtain the country code of the country described by each device based on the updated assisted positioning database.

[0081] This application obtains broadcast messages from various wireless access points (APs) within the geographical area where the electronic device is located by scanning wireless network signals, and determines the first candidate country code and MAC address of the electronic device based on the broadcast messages; searches for the second candidate country code of the electronic device in an auxiliary positioning database based on the MAC address, the auxiliary positioning database including at least one MAC address and its corresponding second candidate country code; compares the first candidate country code with the second candidate country code, and determines the country code of the electronic device based on the comparison result, which can more accurately locate the country code of the device.

[0082] Please see Figure 4 , Figure 4 This is a schematic diagram of the structure of a positioning device provided in an embodiment of this application. Figure 4 As shown, the positioning device 40 may include: a first determining unit 401, a searching unit 402, and a second determining unit 403.

[0083] The first determining unit 401 is used to obtain the broadcast messages of each wireless access point (AP) in the geographical area where the electronic device is located by scanning the wireless network signal, and to determine the first candidate country code and MAC address of the electronic device based on the broadcast messages.

[0084] The lookup unit 402 is used to search for the second candidate country code of the electronic device in the auxiliary positioning database based on the MAC address. The auxiliary positioning database includes at least one MAC address and its corresponding second candidate country code.

[0085] The second determining unit 403 is used to compare the first candidate country code with the second candidate country code, and determine the country code of the electronic device based on the comparison result.

[0086] Furthermore, when the second determining unit 403 determines the country code of the electronic device based on the comparison result, it is specifically used for:

[0087] If the comparison result shows that the first candidate country code and the second candidate country code are the same, then the first candidate country code or the second candidate country code is determined to be the country code of the electronic device.

[0088] If the comparison result shows that the first candidate country code and the second candidate country code are different, then the geographic coordinates of the electronic device are searched in the auxiliary positioning database based on the MAC address, and the country code of the electronic device is determined based on the geographic coordinates. The auxiliary positioning database also includes the geographic coordinates corresponding to each MAC address.

[0089] Furthermore, when the second determining unit 403 determines the country code of the electronic device based on the geographical coordinates, it is specifically used for:

[0090] Determine the country to which the geographical coordinates belong, and then use the country code of that country as the country code of the electronic device.

[0091] Furthermore, the number of MAC addresses is multiple, and a MAC address is obtained based on a broadcast message from an AP; when the second determining unit 403 determines the country to which the geographical coordinates belong, it is specifically used for:

[0092] For any MAC address among multiple MAC addresses, search the auxiliary positioning database for the geographic coordinates corresponding to the MAC address, and determine the country identifier of the country to which the geographic coordinates corresponding to the MAC address belong.

[0093] For any given country identifier, obtain the percentage of that country identifier among the country identifiers corresponding to the multiple MAC addresses;

[0094] Based on the stated proportion, the country to which the geographic coordinates belong is determined, and the proportion of the country identifier of the country to which the geographic coordinates belong is greater than the proportion of other country identifiers among the country identifiers corresponding to the multiple MAC addresses.

[0095] Furthermore, after the second determining unit 403 determines the country code of the electronic device based on the geographical coordinates, it is also used to:

[0096] The second candidate country code corresponding to the MAC address in the auxiliary positioning database is updated to the country code of the electronic device to obtain the updated auxiliary positioning database.

[0097] Furthermore, the number of MAC addresses is multiple, with one MAC address obtained based on a broadcast message from an AP; when the lookup unit searches for the second candidate country code of the electronic device in the auxiliary positioning database based on the MAC address, it is specifically used for:

[0098] For any MAC address among multiple MAC addresses, search the auxiliary positioning database for the second candidate country code corresponding to that MAC address;

[0099] For any second candidate country code, obtain the proportion of the second candidate country code among the second candidate country codes corresponding to the plurality of MAC addresses;

[0100] Based on the stated proportion, a second candidate country code for the electronic device is determined, wherein the proportion of the second candidate country code for the electronic device is greater than the proportion of other second candidate country codes among the second candidate country codes corresponding to the plurality of MAC addresses.

[0101] According to one embodiment of this application, Figure 3 The steps involved in the positioning method shown can be derived from... Figure 4 The positioning device 40 shown is executed by each unit. For example, Figure 3 The S301 shown can be derived from Figure 4 The first determining unit 401 in the process is used to execute the command. Figure 3 The S302 shown can be made by Figure 4 The lookup unit 402 in the middle is used to perform the operation; Figure 3 The S303 shown can be derived from Figure 4 The second determining unit 403 in the process is used to execute the operation.

[0102] This application obtains broadcast messages from various wireless access points (APs) within the geographical area where the electronic device is located by scanning wireless network signals, and determines the first candidate country code and MAC address of the electronic device based on the broadcast messages; searches for the second candidate country code of the electronic device in an auxiliary positioning database based on the MAC address, the auxiliary positioning database including at least one MAC address and its corresponding second candidate country code; compares the first candidate country code with the second candidate country code, and determines the country code of the electronic device based on the comparison result, which can more accurately locate the country code of the device.

[0103] According to one embodiment of this application, Figure 4 The various units in the positioning device 40 shown can be individually or all combined into one or more units, or some of the units can be further divided into multiple smaller candidate units to achieve the same operation without affecting the technical effect of the embodiments of this application. In other embodiments of this application, the positioning device 40 may also include other units. In practical applications, these functions can also be implemented with the assistance of other units, and can be implemented by multiple units working together.

[0104] In this application embodiment, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.

[0105] According to one embodiment of this application, a computer program capable of executing the steps involved in the corresponding methods shown in the various embodiments of this application can be run on a general-purpose electronic device (which may include processing elements and storage elements such as a central processing unit (CPU), random access memory (RAM), and read-only memory (ROM)) to construct, as described in the embodiments of this application. Figure 4 The positioning device 40 shown. The computer program described above can be recorded on a computer-readable recording medium, and can be loaded into the electronic device described above through the computer-readable recording medium and run therein.

[0106] This application also provides an electronic device; please refer to [link to relevant documentation]. Figure 5 , Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application, such as... Figure 5 As shown, the electronic device 50 includes at least a processor 501, a memory 502, and a network interface 503. The processor 501, memory 502, and network interface 503 can exchange data.

[0107] The processor 501 mentioned above can be a Central Processing Unit (CPU), but it can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor.

[0108] The memory 502 described above may include read-only memory and random access memory, and provides program instructions and data to the processor 501. A portion of the memory 502 may also include non-volatile random access memory.

[0109] The processor 501 described in this application embodiment can be used to call a computer program stored in the memory 502, so that the electronic device described in this application embodiment can execute the above-described positioning method in various embodiments of this application, and can also execute the foregoing... Figure 4 The description of the positioning device 40 in the corresponding embodiments will not be repeated here. Furthermore, the beneficial effects of using the same method will also not be repeated.

[0110] Furthermore, it should be noted that this application also provides a computer-readable storage medium storing a computer program. When a processor executes the computer program, it can perform the positioning methods described in the various embodiments of this application; therefore, they will not be repeated here. Additionally, the beneficial effects of using the same method will also not be repeated. For technical details not disclosed in the embodiments of the computer storage medium involved in this application, please refer to the description of the method embodiments of this application.

[0111] As an example, the aforementioned computer program can be deployed and executed on an electronic device, or deployed and executed on multiple electronic devices located in one location, or executed on multiple electronic devices distributed across multiple locations and interconnected through a communication network. Multiple electronic devices distributed across multiple locations and interconnected through a communication network can form a blockchain network.

[0112] The aforementioned computer-readable storage medium can be an internal storage unit of the electronic device, such as a hard drive or memory. It can also be an external storage device, such as a plug-in hard drive, smart media card (SMC), secure digital card (SD) card, or flash card. Furthermore, the computer-readable storage medium can include both internal and external storage units. This computer-readable storage medium is used to store the computer program and other programs and data required by the electronic device. It can also be used to temporarily store data that has been output or will be output.

[0113] This application provides a computer program product comprising a computer program stored in a computer-readable storage medium. An electronic device's processor reads the computer program from the computer-readable storage medium and executes the computer program, causing the electronic device to perform the positioning methods described in the embodiments of this application; therefore, these descriptions will not be repeated here. Furthermore, the beneficial effects of using the same method will also not be repeated. For technical details not disclosed in the embodiments of the computer-readable storage medium involved in this application, please refer to the description of the method embodiments of this application.

[0114] The terms "first," "second," etc., in the specification, claims, and drawings of this application are used to distinguish different objects, not to describe a specific order. Furthermore, the term "comprising," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, apparatus, product, or device that includes a series of steps or units is not limited to the listed steps or modules, but may optionally include steps or modules not listed, or may optionally include other step units inherent to these processes, methods, apparatuses, products, or devices.

[0115] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented using alternative hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application. The foregoing disclosure is merely a preferred embodiment of this application and should not be construed as limiting the scope of this application. Therefore, equivalent variations made in accordance with the claims of this application are still within the scope of this application.

Claims

1. A positioning method, characterized in that, Applied to electronic devices, the method includes: By scanning wireless network signals, the broadcast messages of each wireless access point (AP) in the geographical area where the electronic device is located are obtained, and the first candidate country code and media access control (MAC) address of the electronic device are determined based on the broadcast messages. Based on the MAC address, the electronic device is searched for a second candidate country code in the auxiliary positioning database, which includes at least one MAC address and its corresponding second candidate country code. The first candidate country code is compared with the second candidate country code, and the country code of the electronic device is determined based on the comparison result.

2. The method as described in claim 1, characterized in that, Determining the country code of the electronic device based on the comparison results includes: If the comparison result shows that the first candidate country code and the second candidate country code are the same, then the first candidate country code or the second candidate country code is determined to be the country code of the electronic device. If the comparison result shows that the first candidate country code and the second candidate country code are different, then the geographic coordinates of the electronic device are searched in the auxiliary positioning database based on the MAC address, and the country code of the electronic device is determined based on the geographic coordinates. The auxiliary positioning database also includes the geographic coordinates corresponding to each MAC address.

3. The method as described in claim 2, characterized in that, Determining the country code of the electronic device based on the geographic coordinates includes: Determine the country to which the geographical coordinates belong, and then use the country code of that country as the country code of the electronic device.

4. The method as described in claim 3, characterized in that, The number of MAC addresses is multiple, and a MAC address is obtained based on a broadcast message from an AP; determining the country to which the geographical coordinates belong includes: For any MAC address among multiple MAC addresses, search the auxiliary positioning database for the geographic coordinates corresponding to the MAC address, and determine the country identifier of the country to which the geographic coordinates corresponding to the MAC address belong. For any given country identifier, obtain the percentage of that country identifier among the country identifiers corresponding to the multiple MAC addresses; Based on the stated proportion, the country to which the geographic coordinates belong is determined, and the proportion of the country identifier of the country to which the geographic coordinates belong is greater than the proportion of other country identifiers among the country identifiers corresponding to the multiple MAC addresses.

5. The method as described in claim 2, characterized in that, After determining the country code of the electronic device based on the geographic coordinates, the method further includes: The second candidate country code corresponding to the MAC address in the auxiliary positioning database is updated to the country code of the electronic device to obtain the updated auxiliary positioning database.

6. The method as described in claim 1, characterized in that, The number of MAC addresses is multiple, and a MAC address is obtained based on a broadcast message from an AP; the step of searching for the second candidate country code of the electronic device in the assisted positioning database based on the MAC address includes: For any MAC address among multiple MAC addresses, search the auxiliary positioning database for the second candidate country code corresponding to that MAC address; For any second candidate country code, obtain the proportion of the second candidate country code among the second candidate country codes corresponding to the plurality of MAC addresses; Based on the stated proportion, a second candidate country code for the electronic device is determined, wherein the proportion of the second candidate country code for the electronic device is greater than the proportion of other second candidate country codes among the second candidate country codes corresponding to the plurality of MAC addresses.

7. A positioning device, characterized in that, The device is disposed in an electronic device and includes: The first determining unit is used to obtain broadcast messages of each wireless access point (AP) in the geographical area where the electronic device is located by scanning wireless network signals, and to determine the first candidate country code and MAC address of the electronic device based on the broadcast messages. The lookup unit is used to search for a second candidate country code of the electronic device in the auxiliary positioning database based on the MAC address. The auxiliary positioning database includes at least one MAC address and its corresponding second candidate country code. The second determining unit is used to compare the first candidate country code with the second candidate country code, and determine the country code of the electronic device based on the comparison result.

8. An electronic device, characterized in that, It includes a memory and a processor, the memory storing a computer program that, when executed by the processor, causes the processor to perform the steps of the method according to any one of claims 1-6.

9. A computer program product, characterized in that, Includes a computer program that, when executed by a processor, implements the steps of the method according to any one of claims 1-6.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program adapted to be loaded by a processor and to execute the steps of the method according to any one of claims 1-6.