MAC address processing method and device and storage medium

By introducing a second chip with low power consumption and low memory into electronic devices, the problem of not being able to handle MAC addresses in the screen-off state is solved, and the function of service finding people is realized is normal use in the screen-off state, and processing speed and memory utilization efficiency are improved.

CN119766773AActive Publication Date: 2025-04-04HONOR DEVICE CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202311248071.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-09-26
Publication Date
2025-04-04
Estimated Expiration
2043-09-26

AI Technical Summary

Technical Problem

The prior art cannot process the MAC address when the electronic device is in the screen-out state, resulting in the function of the service finding person being unable to be used normally.

Method used

A second chip with low power consumption and low memory is introduced into the electronic device, which is used to match, store and update the MAC address when the electronic device is in the screen-off state. The second chip determines the hash classification value of the BSSID through a hashing algorithm and looks for matching fingerprint information in the corresponding storage area.

Benefits of technology

It realizes that the MAC address can still be processed normally when the electronic device is in the screen-off state, ensuring that the service is looking for people can also be used normally in the screen-off state, improving the query speed and effectively utilizing limited memory.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119766773A_ABST
    Figure CN119766773A_ABST
Patent Text Reader

Abstract

The invention provides an MAC address processing method and device and a storage medium. According to the method, a small chip with power consumption lower than that of an SOC chip and memory smaller than that of the SOC chip is additionally added (mounted) in electronic equipment such as a mobile phone with the SOC chip and the like, and the small chip can process business online for a long time after the electronic equipment is started (namely, the electronic equipment still can work normally when in a screen-off state); and then the matching service of the MAC address completed by the SOC chip is transferred to the small chip. Therefore, even if the electronic equipment is in the screen-off state, the service of the MAC address can still be normally carried out, so that when the electronic equipment is in the screen-off state, the function of serving for finding people can still be normally used.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to a MAC address processing method, device and storage medium. Background Art

[0002] Geo-fencing is an application of Location Based Services (LBS), which is to use a virtual fence to enclose a virtual geographic boundary. When an electronic device enters, leaves, or moves within a specific geographic area, the electronic device can receive automatic notifications and warnings. Based on this feature of geo-fencing, electronic devices have launched a service to find people function. Regarding the implementation of this function, it is usually based on the fingerprint information (such as BSSID and corresponding RSSI) corresponding to the Media Access Control Address (MAC address) currently scanned by the electronic device, and compared with the fingerprint information in the fingerprint library of the locally managed MAC address, and then the user's current specific location is determined by the matched BSSID and corresponding RSSI, so that when the user carrying the electronic device is in different places (locations), the user can be pushed services suitable for the current place.

[0003] However, the realization of this function requires that the electronic device is always in the screen-on state. That is, when the electronic device is in the screen-off state, the processor used for processing services in the electronic device will enter the sleep state.

[0004] Therefore, there is an urgent need to provide a method for processing MAC addresses when the electronic device is in a screen-off state, so that the service can still be used to find people when the electronic device is in a screen-off state. Summary of the invention

[0005] In order to solve the above technical problems, the present application provides a MAC address processing method, device and storage medium, aiming to enable the MAC address to be matched, stored and updated normally when the electronic device is in the screen-off state, so that the service finding person function can still be used normally when the electronic device is in the screen-off state.

[0006] In the first aspect, the present application provides a method for processing a MAC address. The method is applied to an electronic device, which includes a first chip and a second chip, the power consumption of the second chip is lower than the power consumption of the first chip, and the memory of the second chip is smaller than the memory of the first chip; wherein, when the electronic device is in a screen-off state, the first chip is in a dormant state. For an electronic device of this structure, the method includes: when the electronic device enters a first area, the second chip scans the fingerprint information of surrounding wireless access points, and the fingerprint information of each wireless access point includes the BSSID and RSSI corresponding to the wireless access point; wherein, when the second chip scans the fingerprint information of the surrounding wireless access points, the electronic device is in a screen-off state, or in a screen-on state; according to a hash algorithm, a hash classification value corresponding to each BSSID is determined; for each BSSID, in the memory of the second chip, in the storage area corresponding to the hash classification value, a target BSSID identical to the BSSID is searched.

[0007] The first chip is, for example, a system on chip (SOC). Currently, in order to reduce the power consumption of electronic devices, when the electronic device enters the screen-off state, the SOC chip usually enters the sleep state, and the SOC chip will resume the working state and process the business after the electronic device turns on the screen.

[0008] Among them, the second chip can be regarded as a chip of the same level as the SOC chip that can handle business. However, the power consumption of the second chip is less than that of the first chip, and the memory of the second chip is also less than that of the first chip, that is, the implementation cost of the second chip is lower than that of the first chip. In addition, since the second chip has low power consumption, it can operate and handle business after the electronic device is turned on, regardless of the state of the electronic device, such as off or on screen.

[0009] Therefore, by adding (mounting) a small chip with lower power consumption than the SOC chip and smaller memory than the SOC chip in electronic devices such as mobile phones that already have SOC chips, and which can process services online for a long time after the electronic device is started (that is, when the electronic device is in the screen-off state, it can still operate normally), and then transferring the MAC address matching service completed by the SOC chip to this small chip. In this way, even if the electronic device is in the screen-off state, the MAC address service can still proceed normally, so that when the electronic device is in the screen-off state, the service search function can still be used normally.

[0010] According to the first aspect, according to the hash algorithm, the hash classification value corresponding to each BSSID is determined, including: for each BSSID, according to the hash algorithm, the first N bytes and the last M bytes of the hexadecimal BSSID are subjected to XOR processing; the first processing result obtained by the XOR processing is converted from hexadecimal to decimal; each hexadecimal byte in the last M bytes is converted to decimal; the first decimal processing result is added to the decimal result of each byte in the last M bytes; according to a preset classification number, the second processing result obtained by the addition is subjected to remainder processing; and the third processing result obtained by the remainder processing is used as the hash classification value corresponding to the BSSID.

[0011] Therefore, by determining the hash classification value corresponding to each BSSID based on the hash algorithm, and then going to the corresponding storage area difference target BSSID according to the hash classification value, a large number of unmatched BSSIDs can be filtered out before searching, greatly reducing the query amount and thus improving the query speed.

[0012] According to the first aspect, or any implementation of the first aspect above, the number of categories is 8.

[0013] Considering that when the algorithm is hardened and the division is processed, division by 8 only requires 3 right shifts, which takes less time. Therefore, in order to improve the query speed and subsequent storage speed, this application chooses 8 as the number of categories.

[0014] According to the first aspect, or any implementation of the first aspect above, for each BSSID, in the memory of the second chip, in the storage area corresponding to the hash classification value, before searching for the target BSSID that is the same as the BSSID, the method also includes: when the electronic device enters the first area, obtaining fingerprint information of all wireless access points involved in the first area; determining the hash classification value of the BSSID in each fingerprint information through a hash algorithm; and storing the fingerprint information of all wireless access points involved in the first area according to the hash classification value.

[0015] Therefore, when a user carrying an electronic device enters the first area, the corresponding fingerprint information is directly obtained from the server, and based on the same hash algorithm processing method, the hash classification value of the BSSID in each fingerprint information is determined, and then stored according to the hash classification value, so as to facilitate subsequent query processes. A large number of inappropriate BSSIDs can be pre-filtered based on the hash classification value.

[0016] According to the first aspect, or any implementation method of the first aspect above, when an electronic device enters a first area, fingerprint information of all wireless access points involved in the first area is obtained, including: when the electronic device enters the first area, determining the cell fence included in the first area and the wifi fence included in each of the cell fences; obtaining fingerprint information of the wireless access points included in each wifi fence.

[0017] According to the first aspect, or any implementation method of the first aspect above, fingerprint information of all wireless access points involved in the first area is stored according to the hash classification value, including: for each wifi fence included in each cell fence, the BSSIDs of all wireless access points involved in the wifi fence are stored according to the hash classification value; after the BSSIDs of all wireless access points involved in the wifi fence are stored, the RSSI corresponding to each BSSID is stored in the order in which the BSSIDs are stored.

[0018] According to the first aspect, or any implementation method of the first aspect above, for each wifi fence included in each cell fence, the BSSIDs of all wireless access points involved in the wifi fence are stored according to the hash classification value, and also include: in the category corresponding to each hash classification value, the BSSIDs are stored in order according to the size of the BSSID.

[0019] The BSSIDs may be stored in descending order or in ascending order according to their sizes.

[0020] According to the first aspect, or any implementation of the first aspect above, when storing fingerprint information of all wireless access points involved in the first area according to the hash classification value, the method also includes: recording the number of fingerprint information of the wireless access points stored in the category corresponding to each hash classification value.

[0021] Among them, a data table or array can be constructed, and then the number of all wireless access points included in the first n directions of each WiFi fence can be recorded in the data table or array in sequence.

[0022] According to the first aspect, or any implementation of the first aspect above, the method also includes: when the electronic device enters the second area, determining the cell fence included in the second area; deleting the cell fence that does not belong to the second area stored in the memory of the second chip according to the cell fence included in the second area; obtaining fingerprint information of the wireless access point included in each wifi fence in the cell fence of the second area that is not stored in the memory of the second chip from the server; when writing the acquired fingerprint information of the wireless access point into the memory of the second chip, determining the memory fragment combination form and the copy consumption corresponding to each memory fragment combination form according to the memory fragments existing in the memory of the second chip; selecting memory fragments from the memory of the second chip according to the memory fragment combination form with the smallest copy consumption for merging; and writing the acquired fingerprint information of the wireless access point into the storage area corresponding to the merged memory fragments.

[0023] Therefore, by first determining a feasible memory fragment combination form, and then selecting the corresponding memory fragments in the memory of the second chip for merging according to the memory fragment combination form with the smallest copy consumption, it is possible to ensure that the merged memory fragments can store the newly acquired fingerprint information of the wireless access point, and to minimize the copy consumption caused by moving the existing fingerprint information during the memory fragment merging process.

[0024] According to the first aspect, or any implementation of the first aspect above, the acquired fingerprint information of the wireless access point is written into a storage area corresponding to the merged memory fragment, including: for each wireless fingerprint information of the wireless access point, a hash classification value of the BSSID in each fingerprint information is determined by a hash algorithm; and according to the hash classification value, the fingerprint information of the wireless access point is written into the storage area corresponding to the merged memory fragment.

[0025] According to the first aspect, or any implementation of the first aspect above, the method also includes: after finding the target BSSID that is the same as the BSSID, determining the current location of the electronic device based on the target BSSID and the target RSSI corresponding to the target BSSID; and pushing a service that matches the current location of the electronic device.

[0026] Since the MAC address processing operation is completed by the second chip, the service search function can also be realized when the electronic device is in the screen-off state.

[0027] In addition, based on the above storage method, the query (matching) speed can be greatly accelerated; based on the above update method, limited memory can be effectively utilized and copy consumption can be reduced.

[0028] In a second aspect, the present application provides a chip. The chip includes one or more interface circuits and one or more processors; the interface circuit is used to receive a signal from a memory of an electronic device and send a signal to the processor, the signal including a computer instruction stored in the memory; when the processor executes the computer instruction, the electronic device executes the instruction of the method in the first aspect or any possible implementation of the first aspect.

[0029] According to the second aspect, the chip has low power consumption, small memory, and is always in a non-sleep state after the electronic device is turned on.

[0030] Among them, the non-sleep state means that the chip is not in a sleep state (a state where it cannot process business), that is, after the electronic device is turned on, whether it is in a screen-on state or a screen-off state, the chip can process business normally.

[0031] The second aspect and any implementation of the second aspect correspond to the first aspect and any implementation of the first aspect respectively. The technical effects corresponding to the second aspect and any implementation of the second aspect can refer to the technical effects corresponding to the above-mentioned first aspect and any implementation of the first aspect, which will not be repeated here.

[0032] In a third aspect, the present application provides a chip system. The chip system includes a first chip and a second chip, the first chip and the second chip share an antenna of an electronic device, the power consumption of the second chip is lower than that of the first chip, and the memory of the second chip is smaller than that of the first chip; when the electronic device is in a screen-off state, the first chip is in a sleep state and the second chip is in a non-sleep state; wherein the second chip is used to call and run a computer program from the memory of the electronic device, so that the electronic device equipped with the chip system executes the instructions of the method in the first aspect or any possible implementation of the first aspect.

[0033] The first chip, for example, is a system on chip (SOC) in an electronic device. The SOC chip may include, for example, an application processor, a modem, a baseband and other processors.

[0034] Among them, the second chip is a small chip system newly added in this application, which has low power consumption, small memory, and can process business online all the time.

[0035] In one implementation, the first chip can be regarded as a main chip, and the second chip can be regarded as a slave chip. The second chip can assist the first chip in completing part of the processing business, and its performance and cost are lower than those of the first chip.

[0036] The third aspect and any implementation of the third aspect correspond to the first aspect and any implementation of the first aspect, respectively. The technical effects corresponding to the third aspect and any implementation of the third aspect can refer to the technical effects corresponding to the first aspect and any implementation of the first aspect, which will not be repeated here.

[0037] In a fourth aspect, the present application provides an electronic device. The electronic device includes a memory and a chip system as in the third aspect; the memory is coupled to the processors of the first chip and the second chip respectively; the memory stores program instructions, and when the program instructions are executed by the processor of the second chip, the electronic device executes the instructions of the method in the first aspect or any possible implementation of the first aspect.

[0038] The fourth aspect and any implementation of the fourth aspect correspond to the first aspect and any implementation of the first aspect, respectively. The technical effects corresponding to the fourth aspect and any implementation of the fourth aspect can refer to the technical effects corresponding to the above-mentioned first aspect and any implementation of the first aspect, which will not be repeated here.

[0039] In a fifth aspect, the present application provides a computer-readable medium for storing a computer program, wherein the computer program includes instructions for executing the method in the first aspect or any possible implementation of the first aspect.

[0040] The fifth aspect and any implementation of the fifth aspect correspond to the first aspect and any implementation of the first aspect, respectively. The technical effects corresponding to the fifth aspect and any implementation of the fifth aspect can refer to the technical effects corresponding to the first aspect and any implementation of the first aspect, which will not be repeated here.

[0041] In a sixth aspect, the present application provides a computer program comprising instructions for executing the method in the first aspect or any possible implementation of the first aspect.

[0042] The sixth aspect and any implementation of the sixth aspect correspond to the first aspect and any implementation of the first aspect, respectively. The technical effects corresponding to the sixth aspect and any implementation of the sixth aspect can refer to the technical effects corresponding to the first aspect and any implementation of the first aspect, which will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1A A schematic diagram of a scenario for exemplarily showing a service for finding people function in an electronic device;

[0044] Figure 1BA schematic diagram of another scenario of a service finding person function in an electronic device is shown as an example;

[0045] Figure 2 The hardware structure diagram of an electronic device for implementing the MAC address processing method provided in an embodiment of the present application is exemplarily shown;

[0046] Figure 3 For example, Figure 2 A schematic diagram of a scenario in which a service-finding function is implemented in an electronic device of the hardware structure shown;

[0047] Figure 4A A schematic diagram of a software layered architecture of an electronic device is shown as an example;

[0048] Figure 4B A schematic diagram of functional modules involved in each layer in an electronic device with a layered architecture is shown as an example;

[0049] Figure 4C A schematic diagram of functional modules within a MAC address processing module for implementing a MAC address processing method is shown as an example;

[0050] FIG. 5A to FIG. 5C A schematic diagram showing the relationship between a cell fence, a wifi fence and a wireless access point;

[0051] Figure 6 A schematic diagram showing the relationship between a cell fence, a wifi fence, a wireless access point, and fingerprint information corresponding to the wireless access point;

[0052] Figure 7 The figure is a schematic diagram showing an exemplary method of determining a hash classification value corresponding to each BSSID based on a hash algorithm;

[0053] Figure 8 The diagram is a schematic diagram showing an exemplary method of storing BSSIDs according to hash classification values;

[0054] Fig. 9 A schematic diagram showing the number of BSSIDs of all wireless access points included in the first n categories of each wifi fence recorded according to the hash classification value;

[0055] Fig.10 The schematic diagram is an exemplary diagram showing the storage of fingerprint information of different wifi fences under different cell fences according to hash classification values;

[0056] Fig.11 Schematic diagram showing the memory fragmentation of the fingerprint database before and after deleting the old fingerprint information;

[0057] Fig.12The figure is a schematic diagram showing an exemplary method of merging memory fragments and adding new fingerprint information to the fingerprint library based on a conventional memory fragment merging method;

[0058] Fig.13A For example, Fig.11 Several memory fragments are shown in FIG. , and schematic diagrams of memory fragment combinations corresponding to different memory fragment combination forms are determined;

[0059] Fig. 13B For example, Fig.13A A schematic diagram showing a memory fragment combination that can write new fingerprint information and a memory fragment combination with the smallest copy consumption that is determined from the memory fragment combinations shown;

[0060] Fig. 13C For example, based on Fig. 13B The schematic diagram of the memory fragment combination with the smallest copy consumption is shown to merge the memory fragments and write the new fingerprint information;

[0061] Fig.14 The following is a flowchart of a method for processing a MAC address provided in an embodiment of the present application;

[0062] Fig.15 The figure is a flowchart of another MAC address processing method provided in an embodiment of the present application. DETAILED DESCRIPTION

[0063] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0064] The term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there may be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone.

[0065] The terms "first" and "second" in the description and claims of the embodiments of the present application are used to distinguish different objects rather than to describe a specific order of objects. For example, a first target object and a second target object are used to distinguish different target objects rather than to describe a specific order of target objects.

[0066] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.

[0067] In the description of the embodiments of the present application, unless otherwise specified, the meaning of "multiple" refers to two or more than two. For example, multiple processing units refer to two or more processing units; multiple systems refer to two or more systems.

[0068] Some of the terms used in this application are explained below to facilitate understanding by those skilled in the art.

[0069] (1) Cell Fence (Cell Geofence)

[0070] The cell fence can be understood as the area covered by the base station scanned by mobile phones and other electronic devices using the mobile network (cellular network).

[0071] It can be understood that in actual applications, one base station may have one to multiple cells, that is, the same base station may correspond to one to multiple cell fences.

[0072] In addition, it should be noted that, based on the characteristics of mobile networks, cell fences can be applied to indoor positioning as well as outdoor positioning.

[0073] (2) Wi-Fi Fence (Wi-Fi Geofence)

[0074] Wi-Fi fence can be understood as the Wi-Fi signal scanned by mobile phones and other electronic devices.

[0075] Understandably, in actual applications, one or more wireless access points (APs) may be included in the same wifi fence, and each AP may correspond to a dedicated media access control address (MAC address).

[0076] (3)BSSID

[0077] BSSID refers to the basic service set identifier in a wireless local area network. It is a unique identifier used to identify each wireless access point in a wireless local area network, similar to a MAC address. That is, the processing of the MAC address mentioned in the embodiments of the present application is actually the processing of the BSSID. Therefore, through the BSSID, a wireless client (electronic devices such as mobile phones) can determine the identity of the wireless access point to which it is connected in order to establish a connection.

[0078] (4) RSSI

[0079] RSSI (Received Signal Strength Indicator) is used to determine the quality of the link and whether to increase the broadcast transmission strength. The strength of the received signal can be used to determine the distance between the signal point and the receiving point, and then the actual location of the user (electronic device) can be determined based on the corresponding data.

[0080] (5) Fingerprint information

[0081] Understandably, each cell fence may generally include multiple wifi fences, and each wifi fence may include a lot of wifi routing information, such as the BSSID and RSSI corresponding to each wireless access point. The BSSID and RSSI corresponding to each wireless access point are collectively referred to as the fingerprint information of the wireless access point.

[0082] Based on the characteristics of the cell fence, wifi fence, BSSID and RSSI in the fingerprint information mentioned above, mobile phones and other electronic devices currently provide the function of finding people through services. Regarding the implementation of this function, it is usually based on the fingerprint information corresponding to the wireless access point currently scanned by the electronic device (such as BSSID, and the corresponding RSSI), to compare with the fingerprint information in the locally managed fingerprint library, and then determine the user's current specific location through the matched BSSID and the corresponding RSSI, so that when users carrying electronic devices with this function enter different places (locations), services suitable for the current place can be automatically pushed to the user. For example, when a user enters a shopping mall, the mall's food, hot-selling products, activities, etc. can be automatically pushed to the user.

[0083] Furthermore, in some possible implementations, relevant activity information of a specific store can be pushed accurately to the user when the user arrives near the store.

[0084] It should be understood that the above description is merely an example listed for a better understanding of the technical solution of this embodiment, and is not intended to be the sole limitation to this embodiment.

[0085] At present, the processing operations of MAC addresses involved in the service search function, such as MAC address (BSSID) matching, MAC address (BSSID and RSSI) storage and update, are usually implemented in the system on chip (System on Chip, SOC) chip of electronic devices such as mobile phones. However, the SOC chip will only work when the screen of the electronic device is in the on state, and will enter the sleep state when the screen is off. In the sleep state, the SOC does not have the ability to perceive geographic fences, so the service search function cannot be realized.

[0086] For ease of understanding, the following combination Figure 1A and Figure 1B , describes the scenario in which MAC address processing is currently implemented by SOC chips to achieve the service search function.

[0087] See also Figure 1A For example, when user A carries an electronic device with a service-finding function, such as a mobile phone, and moves to shopping mall 1, when the mobile phone is in a light-screen state, such as a lock screen interface, the SOC chip will sense the change of the geographical fence where user A is located, and then after user A moves to the fence corresponding to shopping mall 1, a notification management window will pop up on the current interface of the mobile phone in the light-screen state, such as the lock screen interface, and display relevant services about shopping mall 1 in the notification management window, such as Figure 1A It shows "Mall 1's special sale today, 30% off on all daily necessities.".

[0088] It should be understood that the above description is merely an example listed for a better understanding of the technical solution of this embodiment, and is not intended to be the sole limitation to this embodiment.

[0089] Continue to see Figure 1A For example, user A continues to move with a mobile phone that is always in a bright screen state, such as a bright screen lock screen interface (in actual applications, it can be any interface of an electronic device, such as a desktop or an application interface). In one possible implementation, after leaving the fence corresponding to shopping mall 1, the SOC chip senses the change of the geographic fence and can cancel the service content about shopping mall 1 displayed in the notification management window. In another possible implementation, it can also be displayed until user A manually triggers the viewing and cancels it. This embodiment takes automatic cancellation of display as an example.

[0090] Continue to see Figure 1AFor example, after leaving the fence corresponding to shopping mall 1, user A continues to move with the mobile phone that has been in a bright screen state, such as a lock screen interface that has been in a bright screen. The SOC chip senses the change of the geographical fence where user A is located. Then, after user A moves to the fence corresponding to shopping mall 2, a notification management window pops up on the current interface of the mobile phone in a bright screen state, such as a lock screen interface that has been in a bright screen, and displays related services about shopping mall 2 in the notification management window, such as Figure 1A It shows "2 new stores opened in the mall, various food and entertainment are on sale.".

[0091] It should be understood that the above description is merely an example listed for a better understanding of the technical solution of this embodiment, and is not intended to be the sole limitation to this embodiment.

[0092] See also Figure 1B For example, when user A carries an electronic device with a service-finding function, such as a mobile phone, and moves to shopping mall 1. When the mobile phone is in the screen-off state (i.e., black screen standby), the SOC chip will enter a dormant state. In this case, the SOC chip will not process the business, that is, it will not perceive the changes in the geographic fence where user A is located. Therefore, when user A carries a mobile phone in the screen-off state and moves to the vicinity of shopping mall 1, the mobile phone cannot perceive that it has entered the fence corresponding to shopping mall 1, so it will no longer push services related to shopping mall 1. That is, the mobile phone is still in the screen-off state.

[0093] Continue to see Figure 1B For example, when user A moves from mall 1 to mall 2 with a mobile phone that has been in the off state, the mobile phone is still in the off state, that is, the SOC chip is still in the dormant state. Therefore, when user A moves to mall 2 with the mobile phone in the off state, the mobile phone still cannot sense that it has entered the fence corresponding to mall 2, so it will no longer push services related to mall 2. That is, the mobile phone is still in the off state.

[0094] For example, in one possible implementation, when user A moves from mall 1 to mall 2, the screen of the mobile phone is turned on, that is, the mobile phone switches from the screen-off state to the screen-on state, and the SOC will exit the sleep state and enter the working state, so that it can sense the change of the geographic fence. Then, after user A moves to the fence corresponding to mall 2, the current interface of the mobile phone in the screen-on state, such as the lock screen interface of the screen, pops up a notification management window, and displays the relevant services about mall 2 in the notification management window, such as Figure 1A It shows "2 new stores opened in the mall, various food and entertainment are on sale.".

[0095] It can be seen that when the screen of an electronic device such as a mobile phone with a service to find people is on, the SOC chip can continuously sense the changes in the geographic fence, and then determine the user's mobile location based on the fence information, and push services related to the current location to the electronic device in the screen-on state. However, after the electronic device enters the screen-off state, the SOC chip will enter a dormant state. In this state, the SOC cannot sense the changes in the geographic fence, and will not push services for the current location to the user.

[0096] In other words, the realization of the service to find people requires that the electronic devices that currently use the SOC chip to sense changes in geographic fences always keep the screen on.

[0097] In view of this, an embodiment of the present application provides a MAC address processing method that can match, store and update MAC addresses normally when the electronic device is in the screen-off state, so that the service search function can still be used normally when the electronic device is in the screen-off state.

[0098] Specifically, in the MAC address processing method provided in the embodiment of the present application, a small chip with lower power consumption than the SOC chip and smaller memory than the SOC chip is added (mounted) to an electronic device such as a mobile phone that already has a SOC chip, and can process services online for a long time after the electronic device is started (that is, when the electronic device is in the screen-off state, it can still operate normally), and then the MAC address matching service completed by the SOC chip is transferred to this small chip. In this way, even if the electronic device is in the screen-off state, the MAC address service can still proceed normally, so that when the electronic device is in the screen-off state, the service to find people can still be used normally.

[0099] For ease of explanation, the SOC chip will be described as the first chip and the newly added small chip will be described as the second chip.

[0100] Understandably, in order to reduce the hardware cost of the electronic device as much as possible, the performance, memory resources, processing power, etc. of the second chip can be lower than that of the first chip. For such a dual-chip electronic device, the first chip can be the main chip and the second chip can be the secondary chip (auxiliary chip).

[0101] In addition, it should be noted that, since the second chip has low power consumption, it is set to process services online for a long time after the electronic device is started, which reduces the power consumption of the electronic device.

[0102] The hardware structure of the electronic device with a dual-chip configuration applicable to the MAC address processing method provided in the embodiment of the present application can be as follows: Figure 2 shown.

[0103] The electronic device having the first chip and the second chip mentioned above may be, for example, a mobile phone, a tablet computer, a smart wearable device, etc., which are not listed here one by one and are not limited in this application. The following description takes the electronic device as a mobile phone as an example to illustrate the solution.

[0104] See also Figure 2 Exemplarily, the electronic device 100 may include: a first chip 110, a second chip 111, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc.

[0105] Among them, the first chip 110 (SOC chip) may include one or more processors, such as: an application processor (AP), a modem processor (Modem), a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, a neural-network processing unit (NPU), etc., which are not listed here one by one and are not limited in this application.

[0106] The second chip may include one or more processors, which may be the same as or similar to the processor included in the first chip, and the present application does not limit this.

[0107] It should be noted that, regarding one or more processors included in the first chip 110 and the second chip 111, in some possible implementations, each processor may be an independent device. In other possible implementations, different processors may also be integrated into one processor, for example, a baseband processor may be integrated into a modem, so that the modem has both a modulation and demodulation function and a baseband processor function.

[0108] It should be understood that the above description is merely an example listed for a better understanding of the technical solution of this embodiment, and is not intended to be the sole limitation to this embodiment.

[0109] In addition, it should be understood that since the first chip 110 and the second chip 111 can process different services, they need to interact with other components of the electronic device. Therefore, the first chip 110 and the second chip 111 may also include one or more interfaces.

[0110] Among them, the interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, a universal serial bus (USB) interface, etc., which are not listed one by one here, and this application does not limit this. That is, the first chip 110 and the second chip 111 can be connected to other devices in the electronic device, such as external memory, internal memory, audio module, sensor module, camera, indicator, motor, button, display screen, mobile communication module, wireless communication module, etc. through the above-mentioned interface.

[0111] For the sake of convenience, the present application embodiment takes the second chip as an example to process the MAC address processing service. Since the MAC address processing service needs to rely on geographic fences, and the determination of cell fences requires the participation of mobile communication modules (mobile networks or cellular networks), and the determination of wifi fences requires the participation of wireless communication modules (WLAN), the second chip needs to establish communication connections with mobile communication modules 150 and wireless communication modules 160, such as Figure 2 shown.

[0112] In addition, it should be noted that the first chip 110 and the second chip 111 may also be provided with a memory, that is, the first chip 110 and the second chip 111 may include so-called memory to store instructions and data. Specifically in this embodiment, the memory of the second chip 111 is smaller than the memory of the first chip 110.

[0113] In addition, it should be noted that, specifically in the technical solution provided in the embodiment of the present application, the fingerprint information corresponding to different fences is stored in the fingerprint library created in the memory of the second chip 110 .

[0114] Regarding the memory set in the first chip 110 and the second chip 111, in some possible implementations, it can be a cache memory. Among them, the memory in the first chip 110 can save the instructions or data that the first chip 110 has just used or circulated; the memory in the second chip 111 can save the instructions or data that the second chip 111 has just used or circulated. In this way, if the first chip 110 or the second chip 11 needs to use the used instructions or data again, it can be directly called from the corresponding memory, thereby avoiding repeated access, reducing the waiting time of the first chip 110 and the second chip 111, and improving the efficiency of the system.

[0115] For example, in some possible implementations, the first chip 110 and the second chip 111 can be backup chips for each other, so data can be exchanged between the two. Figure 2 As shown, a communication connection can be established between the first chip 110 and the second chip 111 through an interface.

[0116] Continue to see Figure 2 , the external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the first chip 110 through the external memory interface 120 to implement a data storage function. For example, files such as music and videos are stored in the external memory card. Exemplarily, in some other possible implementations, the outsourced memory interface 102 can also communicate with the second chip 111.

[0117] Continue to see Figure 2 , the internal memory 121 can be used to store computer executable program codes, and the executable program codes include instructions. It is understandable that these executable program codes may include those of the first chip 110 and those of the second chip 111. Therefore, in the embodiment of the present application, the second chip 111 also communicates with the internal memory 120.

[0118] The first chip 110 and the second chip 111 execute various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. For example, the second chip 111 can enable the electronic device to perform MAC address matching, storage and update and other processing by executing the program instructions corresponding to the MAC address processing method provided in the embodiment of the present application, thereby determining the current location information of the electronic device and recommending services suitable for the location information to the user based on the service search function.

[0119] The internal memory 121 may include a program storage area and a data storage area. The program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, and a program instruction of a MAC address processing method described in an embodiment of the present application), etc. The data storage area may store data created during the use of the electronic device 100 (such as fingerprint information that needs to be loaded into the fingerprint library in the memory of the second chip 111, etc.).

[0120] It is understandable that in actual applications, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.

[0121] Continue to see Figure 2 , the charging management module 140 is used to receive charging input from the charger. The charger can be a wireless charger or a wired charger. In some wired charging implementations, the charging management module 140 can receive charging input from the wired charger through the USB interface 130. In some wireless charging implementations, the charging management module 140 can receive wireless charging input through the wireless charging coil of the electronic device 100. While the charging management module 140 is charging the battery 142, it can also power the electronic device through the power management module 141.

[0122] Continue to see Figure 2 The power management module 141 is used to connect to the battery 142, the charging management module 140 and the first chip 110, and can also connect to the second chip ( Figure 2 The power management module 141 receives input from the battery 142 and / or the charging management module 140, and supplies power to the first chip 110, the second chip 111, the internal memory 121, the external memory, the display screen 194, the camera 193, the wireless communication module 160, etc. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle number, battery health status (leakage, impedance), etc.

[0123] Continue to see Figure 2The wireless communication function of the electronic device 100 can be realized by antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor and baseband processor, etc. Among them, antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals.

[0124] Continue to see Figure 2 The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the electronic device 100. The wireless communication module 160 can provide solutions for wireless communications including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared technology (IR), etc., applied to the electronic device 100.

[0125] Specifically in the technical solution provided in the embodiment of the present application, the determination of the cell fence can be achieved with the help of the mobile communication module 150 and the corresponding antenna, and the determination of the wifi fence can be achieved with the help of the wireless communication module 160 and the corresponding antenna.

[0126] In addition, the fingerprint information downloaded locally by the second chip 111 and loaded into the fingerprint library of the corresponding memory may be obtained from the corresponding server through the mobile communication module 150, i.e., the mobile network or the cellular network. It may also be obtained from the corresponding server through the wireless communication module 160, i.e., the mobile network or the cellular network.

[0127] It should be understood that the above description is merely an example listed for a better understanding of the technical solution of this embodiment, and is not intended to be the sole limitation to this embodiment.

[0128] Continue to see Figure 2 The audio module 170 may include a speaker 170A, a receiver 170B, a microphone 170C, an earphone jack 170D, and the like.

[0129] Continue to see Figure 2The sensor module 180 may include a pressure sensor, a gyroscope sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, etc., which are not listed here one by one and are not limited in this application.

[0130] Continue to see Figure 2 , the button 190 includes a power button, a volume button, etc. The button 190 can be a mechanical button. It can also be a touch button. The electronic device 100 can receive a button input and generate a button signal input related to the user settings and function control of the electronic device 100. The motor 191 can generate a vibration prompt. The motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. The indicator 192 can be an indicator light, which can be used to indicate the charging status, power changes, messages, missed calls, notifications, etc.

[0131] Continue to see Figure 2 The camera 193 is used to capture still images or videos. In some implementations, the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.

[0132] Continue to see Figure 2 The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. In some implementations, the electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.

[0133] The hardware structure of the electronic device 100 is introduced here. It should be understood that: Figure 2 The hardware structure of the electronic device 100 shown is only an example and does not constitute a specific limitation on the hardware structure of electronic devices such as mobile phones. In a specific implementation, the electronic device 100 may have more or fewer components than those shown in the figure, may combine two or more components, or may have different component configurations.

[0134] In addition, it should be noted that the components shown in the figures can be implemented in hardware, software, or a combination of software and hardware.

[0135] Therefore, based on Figure 2 The electronic device with the hardware structure shown in the figure, by handing over the MAC address processing business to the second chip that can always work online, can make the MAC address processing business still work normally when the electronic device is in the off state, thereby ensuring the normal use of the service to find people. Figure 3As shown, when user A carries an electronic device with a service-finding function, such as a mobile phone, and moves to shopping mall 1. When the mobile phone is in the screen-off state (i.e., black screen standby), the first chip will enter the sleep state, but the second chip will still be in the working state (non-sleep state). Since the processing of the MAC address has been transferred to the second chip, in this case, the second chip will sense the changes in the geographic fence where user A is located. Therefore, when user A carries a mobile phone in the screen-off state and moves to the vicinity of shopping mall 1, the mobile phone senses that it has entered the fence corresponding to shopping mall 1, so it will automatically light up the screen, that is, switch the mobile phone from the screen-off state to the screen-on state, and push services related to shopping mall 1, such as Figure 3 The content shown, "Mall 1 has a special sale today, 30% off on all daily necessities." is displayed in the interface after lighting up, such as the notification management window of the lock screen interface of the lit screen.

[0136] Continue to see Figure 3 For example, user A continues to move with a mobile phone in a screen-on or screen-off state. In one possible implementation, after leaving the fence corresponding to shopping mall 1, regardless of whether the current screen state is a screen-on state or a screen-off state, the second chip will sense the change of the geographic fence, and the service content about shopping mall 1 displayed in the notification management window can be cancelled. In another possible implementation, it can also be displayed until user A manually triggers the viewing and cancels it. This embodiment takes automatic cancellation of display as an example.

[0137] For example, after user A leaves the fence corresponding to shopping mall 1, if the mobile phone is not operated, in a possible implementation, the mobile phone can re-enter the screen-off state.

[0138] For example, user A continues to move with a mobile phone in the off-screen state. The second chip senses the change of the geographical fence where user A is located, and then automatically lights up the screen after user A moves to the fence corresponding to shopping mall 2, that is, switches the mobile phone from the off-screen state to the on-screen state, and pushes services related to shopping mall 2, such as Figure 3 The content shown "A new store in Mall 2 is open, with great discounts on various delicacies and entertainment." is displayed in the interface after it is lit up, such as the notification management window of the lock screen interface of the lit screen.

[0139] It should be understood that the above description is merely an example listed for a better understanding of the technical solution of this embodiment, and is not intended to be the sole limitation to this embodiment.

[0140] The following is a specific embodiment of the technical solution of the present application (applicable to Figure 2 A method for processing the MAC address of an electronic device with the hardware structure shown in the figure) and a detailed description are given of how the technical solution of the present application solves the above-mentioned technical problems.

[0141] Before specifically describing the MAC address processing method provided in the embodiment of the present application, the software structure of the electronic device to which the embodiment of the present application is applicable, that is, the architecture that can be adopted, is first described.

[0142] Specifically, in practical applications, the software system of the electronic device can adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. Among them, the software system used by the electronic device includes but is not limited to the Windows system, the Android system, and the iOS system. For the sake of convenience, the embodiment of the present application takes the Android system with a layered architecture as an example to illustrate the software structure of the electronic device.

[0143] In addition, it should be understood that the subsequent MAC address processing solution provided in the embodiments of the present application can also be applied to other systems in specific implementations.

[0144] See also Figure 4A and Figure 4B , exemplarily illustrating a software layered architecture of an electronic device, and a software structure block diagram of the electronic device based on the layered architecture.

[0145] like Figure 4A As shown, the layered architecture of the electronic device divides the software into several layers, each with a clear role and division of labor. The layers communicate with each other through software interfaces. In some implementations, the Android system is divided into five layers, from top to bottom: application layer (Applications, APP), application framework layer (Application Framework, FWK), system resident service layer (Native layer), hardware abstraction layer (HAL), kernel layer (Linux Kernel, hereinafter referred to as: Kernel).

[0146] It should be noted that FWK can also be understood as a system service framework. The Native layer refers to the local framework and runtime environment, which is also commonly known as the Android runtime and system library.

[0147] Among them, the APP layer may include a series of application packages, such as applications implemented based on the service middle platform, applications provided by electronic device manufacturers, or third-party applications, that is, they can access and call multiple capabilities supported by electronic devices. The FWK layer provides an application programming interface (API) and a programming framework for applications in the APP layer. In some implementations, these programming interfaces and programming frameworks can be described as functions. The Native layer provides some local services and commonly used system libraries. HAL is used to encapsulate hardware drivers and provide a unified interface to the upper-level framework. The Kernel layer is the kernel layer of the operating system, which includes various hardware drivers.

[0148] It should be noted that in some possible implementations, the operating system of the layered architecture may be deployed in both the first chip and the second chip. This embodiment takes the second chip as an example to illustrate the contents included in the layered architecture of the operating system of the second chip.

[0149] about Figure 4A The specific contents that may be included in the hierarchical architecture of the electronic device shown may be as follows in a possible implementation manner: Figure 4B shown.

[0150] See also Figure 4B For example, the application packages included in the APP layer may include video, settings, WAN, camera, map, music and other applications.

[0151] It should be understood that the above description is only an example listed for a better understanding of the technical solution of this embodiment, and is not the only limitation to this embodiment. In practical applications, the APP layer may include more or fewer application programs, and this application does not limit this.

[0152] Continue to see Figure 4B For example, the FWK layer provides APIs and programming frameworks for applications in the APP layer, which may include location services, resource managers, notification managers, view systems, phone managers, etc.

[0153] Among them, location service, also known as positioning service, is a value-added service provided by the mobile communication network and the satellite positioning system. It obtains the location information of the electronic device (such as longitude and latitude coordinate data) through a group of positioning technologies and provides it to the mobile user himself or others and the communication system to realize various location-related services. Specifically in this embodiment, when the actual location of the electronic device is determined according to the determined fence information, it can be realized based on the location service.

[0154] Among them, the resource manager provides various resources for the application, such as localized strings, icons, pictures, layout files, video files, etc., which are not listed here one by one and this application does not impose any restrictions on this.

[0155] The notification manager enables applications to display notification information in the status bar. It can be used to convey notification messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify users of the current entry into a certain geographic fence, and to display services suitable for the current location recommended for users based on the service search function, such as Figure 1A Contents displayed in the notification management window.

[0156] The view system includes visual controls, such as controls for displaying text and controls for displaying pictures. The view system can be used to build applications. A display interface can be composed of one or more views. For example, a display interface including a text notification icon can include a view for displaying text and a view for displaying pictures.

[0157] The phone manager is used to provide communication functions of the electronic device 100, such as management of call status (including connection, disconnection, etc.).

[0158] It should be understood that the above description is only an example listed for a better understanding of the technical solution of this embodiment, and is not the only limitation to this embodiment. In practical applications, the FWK layer may also include other APIs and programming frameworks, such as a window manager, a content provider, etc., which are not listed here one by one, and this application does not limit this.

[0159] Continue to see Figure 4B , exemplarily, the local services and commonly used system libraries provided by the Native layer may include, for example, the Android Runtime and system libraries.

[0160] Among them, Android Runtime includes core libraries and virtual machines. Android Runtime is responsible for the scheduling and management of the Android system. The core library consists of two parts: one is the function that the Java language needs to call, and the other is the Android core library. The APP layer and FWK layer run in the virtual machine. The virtual machine executes the APP layer and FWK layer Java files as binary files. The virtual machine is used to perform object life cycle management, stack management, thread management, security and exception management, and garbage collection and other functions.

[0161] Among them, the system library can include multiple functional modules. For example: surface manager, media library, three-dimensional (3D) graphics processing library (for example: OpenGL ES), two-dimensional (2D) graphics engine (for example: SGL), etc. The surface manager is used to manage the display subsystem and provide fusion of 2D and 3D layers for multiple applications. The media library supports a variety of commonly used audio and video format playback and recording, as well as static image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc. The three-dimensional graphics processing library is used to implement three-dimensional graphics drawing, image rendering, synthesis, and layer processing, etc.

[0162] In addition, it should be noted that the 2D graphics engine mentioned above is a drawing engine for 2D drawing.

[0163] It should be understood that the above description is only an example for better understanding the technical solution of this embodiment, and is not the only limitation to this embodiment. In practical applications, the Native layer may include more or fewer service / functional modules, and this application does not limit this.

[0164] Continue to see Figure 4B For example, the HAL layer encapsulates the hardware driver and provides a unified interface to the upper-level framework, which may include a camera abstraction layer (interface) for the camera driver, a positioning abstraction layer for GPS, WiFi, etc.

[0165] It should be understood that the above description is only an example listed for a better understanding of the technical solution of this embodiment, and is not the only limitation to this embodiment. In practical applications, the HAL layer may include more or less unified interfaces corresponding to hardware drivers, and this application does not limit this.

[0166] Continue to see Figure 4B For example, the hardware drivers included in the Kernel layer include GPS drivers, display drivers, WiFi drivers, etc.

[0167] Specifically in the technical solution provided in the embodiment of the present application, in order to implement MAC address processing, the Kernel layer may further include a MAC address processing module.

[0168] It should be noted that the MAC address processing method provided in the embodiment of the present application may include MAC address matching, specifically matching BSSID, and MAC address storage and update. Based on this, in some possible implementations, the MAC address touch module can be functionalized as a MAC address matching submodule, a MAC address storage submodule, and a MAC address update submodule, such as Figure 4C shown.

[0169] Exemplarily, in some other possible implementations, the storage and update functions of the MAC address may be integrated into one functional module, that is, the MAC address processing module may be functionalized into a MAC address matching submodule and a MAC address storage and update submodule.

[0170] Exemplarily, in some other possible implementations, the matching, storage and updating of MAC addresses may be integrated into one functional module, that is, all implemented by the MAC address processing module without making any functional distinction internally.

[0171] It should be understood that the above description is only an example listed for better understanding of the technical solution of this embodiment, and is not the only limitation to this embodiment. In practical applications, the Kernel layer may include more or fewer hardware drivers, and this application does not limit this.

[0172] This is the end of the introduction to the software structure of electronic devices. It can be understood that, Figure 4A and Figure 4B The layers in the software structure shown, and the components contained in each layer, do not constitute a specific limitation on the electronic device. In a specific implementation, the electronic device may include more or fewer layers than shown, and each layer may include more or fewer components, which is not limited in this application.

[0173] exist Figure 4B Based on the software structure of the electronic device shown, the MAC address processing method provided in the embodiment of the present application is described below in combination with specific embodiments.

[0174] It is understandable that the following specific embodiments may be implemented independently or in combination with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.

[0175] In addition, it should be noted that the following embodiments are still described by taking the electronic device as a mobile phone as an example. However, it should be understood that these examples do not constitute a limitation on the technical solution of the present application.

[0176] Before describing the MAC address processing method provided in the embodiment of the present application, the focus of the MAC address processing method provided in the embodiment of the present application is first described.

[0177] It should be noted that the matching speed of the MAC address determines the calculation time of the entire fence algorithm, which has an important impact on whether the service can be pushed in time.

[0178] The storage and update of the MAC address will operate on the memory of the second chip. Since the memory of the second chip is small, the storage and update of the MAC address should occupy as little memory as possible. For this, it is necessary to use a reasonable method to store fence information, such as fingerprint information.

[0179] In addition, some fence information in the fingerprint library needs to be updated, and in the update process, a large amount of memory fragmentation may occur after the old information is deleted. Since the total memory capacity occupied by the fingerprint library is fixed, it may happen that the new fence information cannot be downloaded to the fingerprint library of the second chip.

[0180] Based on considerations of processing speed and memory, the MAC address processing method provided in the embodiment of the present application can be divided into a MAC address matching link and a MAC address storage and update link.

[0181] From the above description, it can be known that the BSSID can uniquely identify the scanned wireless access point, similar to the MAC address. Therefore, in the matching link of the MAC address in this embodiment, specifically the matching process of the BSSID is carried out.

[0182] In addition, it can be known from the above description that the fingerprint information of each wireless access point includes BSSID and corresponding RSSI. Therefore, in the storage and update link of the MAC address in this embodiment, specifically the storage and update of BSSID and corresponding RSSI.

[0183] The following is a detailed description of the MAC address storage and update process and the MAC address matching process in the MAC address processing method provided in the embodiment of the present application in conjunction with the accompanying drawings.

[0184] The following is the content of MAC address storage and update:

[0185] (1) Storage of MAC addresses

[0186] Before describing the storage method of fingerprint information in the fingerprint database of the second chip, first FIG. 5A to FIG. 5C The relationship between the cell fence, the wifi fence, the wireless access point, and the fingerprint information (BSSID and the corresponding RSSI) corresponding to the wireless access point is described.

[0187] For example, in a large area, there are often one or more cell fences, such as Figure 5A Cell fence_1 to cell fence_11 shown in.

[0188] Understandably, for multiple cell fences in the same area, there may be overlapping areas between them (such as Figure 5A as shown), or they may not overlap each other.

[0189] For each cell fence, one or more wifi fences can be included. Figure 5A Taking the cell fence _1 shown as an example, in a possible implementation, the cell fence _1 may include, for example, Figure 5B Wifi fence_1, Wifi fence_2, Wifi fence_3, Wifi fence_4 and Wifi fence_5, etc. are shown in the figure.

[0190] Understandably, for multiple wifi fences in the same cell fence, there may be overlapping areas between them (such as Figure 5B as shown), or they may not overlap each other.

[0191] For each wifi fence, there can be one or more wireless access points. Figure 5B Taking the wifi fence _1 shown as an example, in a possible implementation, the wifi fence _1 may include, for example, Figure 5C 1, wireless access point 2, wireless access point 3, wireless access point 4, wireless access point 5, etc. are shown in FIG.

[0192] Each wireless access point has a corresponding set of fingerprint information, namely BSSID and RSSI. Figure 5C As shown in the figure, the fingerprint information corresponding to the wireless access point 1 is BSSID_1 and RSSI_1, the fingerprint information corresponding to the wireless access point 2 is BSSID_2 and RSSI_2, the fingerprint information corresponding to the wireless access point 3 is BSSID_3 and RSSI_3, the fingerprint information corresponding to the wireless access point 4 is BSSID_4 and RSSI_4, and the fingerprint information corresponding to the wireless access point 5 is BSSID_5 and RSSI_5.

[0193] It should be understood that the above description is merely an example listed for a better understanding of the technical solution of this embodiment, and is not intended to be the sole limitation to this embodiment.

[0194] However, it should be understood that no matter how many wifi fences are included in the cell fence, and how many wireless access points are included in the wifi fence, the relationship between the fence (cell fence, wifi fence) and the fingerprint information (BSSID and corresponding RSSI) is the same as FIG. 5A to FIG. 5C Similar as shown.

[0195] according to FIG. 5A to FIG. 5C As shown, the relationship between the fence and the fingerprint information can be determined as follows Figure 6 shown.

[0196] See also Figure 6 , exemplarily, for any cell fence, such as cell fence_1 to cell fence_m, it can include multiple 1 to multiple wifi fences, such as 1 to n1 or n2.

[0197] Continue to see Figure 6 ,Exemplarily, each wifi fence in each cell fence may include one to multiple wireless access points, such as Figure 6 N1, N2, M1, M2, P1, P2 are shown in FIG. Each of these wireless access points has a BSSID that can identify its uniqueness and a corresponding RSSI.

[0198] Exemplarily, in a scenario where the cell fence includes 1 to multiple cell fences, the wifi fences in each cell fence include 1 to multiple wifi fences, and the wireless access points in each wifi fence include 1 to multiple wireless access points, m, n1, n2, N1, N2, M1, M2, P1, and P2 can be any integer greater than 0.

[0199] In addition, it should be noted that, in practical applications, the values ​​of m, n1, n2, N1, N2, M1, M2, P1, and P2 may be the same or different.

[0200] Considering that there may be 1 to more cell fences included in an area, each cell fence includes 1 to more wifi fences, and each wifi fence includes 1 to more wireless access points. If it is directly divided according to the ID corresponding to the cell fence and the ID corresponding to the wifi fence, and then the BSSID and the corresponding RSSI are stored in the order of the size of the BSSID of the wireless access point. In the subsequent MAC address matching link, when matching in the fingerprint library of the second chip based on the commonly used sequential matching method and binary matching method, it will take a long time, which is not conducive to the determination of the subsequent fences, and will cause the service to be pushed untimely. Therefore, in order to solve this problem, in the MAC address processing method provided in the embodiment of the present application, in the storage and update link of the MAC address, the BSSID included in each wifi fence in the fingerprint library will be classified through the hash (HASH) algorithm, and then re-stored according to the hash classification value.

[0201] In addition, it should be noted that the BSSIDs stored in each hash classification value are sorted in order according to the size of their values. At the same time, in order to facilitate the matching of MAC addresses, the second chip can search in the storage area corresponding to the corresponding hash classification value, and also record the number of BSSIDs corresponding to each hash classification value.

[0202] Specifically, the first 3 bytes of a general MAC address (BSSID) are used to indicate the manufacturer of the network card, and the last 3 bytes are used to indicate the device number. That is, the first 3 bytes of the BSSID are information related to the manufacturer, and the last 3 bytes are random information. In order to make the BSSID values ​​in the fingerprint library corresponding to the second chip evenly distributed, in a possible implementation, for each BSSID, Figure 7 The calculation method of the hash classification value (also called: classification sequence number or category) shown in the figure determines the hash classification value of each BSSID.

[0203] See also Figure 7 For example, take the hexadecimal BSSID "54:2b:de:a0:d6:c4" as an example. For this BSSID, when using the hash algorithm to calculate the hash classification value, the first three bytes "54:2b:de" and the last three bytes "a0:d6:c4" can be processed with the same or (⊙) method first, and then the result of the same or processing (hexadecimal 102) and the decimal number corresponding to each of the last three bytes are added.

[0204] See also Figure 7 For example, for the XOR processing result "102", the corresponding decimal number is 258, for "a0" in the last 3 bytes, the corresponding decimal number is 160; for "d6" in the last 3 bytes, the corresponding decimal number is 214; for "c4" in the last 3 bytes, the corresponding decimal number is 196.

[0205] Continue to see Figure 7 For example, after adding the result obtained by the XOR process to the decimal numbers corresponding to the last three bytes to obtain 812, a remainder process is performed according to the preset classification number. For example, if the classification number is 8, the result 4 obtained by 812%8 is the hash classification value corresponding to this BSSID.

[0206] It should be noted that in this embodiment, 8 is selected as the classification number because the algorithm is hardened for division. Division by 8 only requires a 3-bit right shift, which takes less time. However, in actual applications, other values ​​can be selected as the classification number according to business needs, and this application does not limit this.

[0207] For the sake of convenience, this embodiment takes the classification number of 8 as an example. In this way, the final classification result, that is, the obtained hash classification value, has 8 types from 0 to 7.

[0208] It should be understood that the above description is merely an example listed for a better understanding of the technical solution of this embodiment, and is not intended to be the sole limitation to this embodiment.

[0209] Based on the above method of calculating the hash classification value, after classifying the BSSID values ​​under each wifi fence of each cell fence, these BSSIDs can be stored again according to the hash classification value.

[0210] For the sake of convenience, take the example that the wifi fence_1 of the cell fence_1 in the fingerprint library includes N wireless access points. The BSSIDs corresponding to these N wireless access points are as follows: Figure 8 The following is explained with reference to the figure (part shown).

[0211] See also Figure 8 , for example, Figure 8 Each BSSID shown is based on Figure 7 The calculation method of the hash classification value shown in the figure can obtain the hash classification value of each BSSID after hash classification. When storing, start with hash classification value 0, that is, category 0, and store the BSSID with hash classification value 0 in the fingerprint library in order from small to large.

[0212] Continue to see Figure 8 For example, after the BSSID of the hash classification value 0 is stored, the BSSID of the hash classification value 1 can be stored in ascending order. In this way, the BSSIDs corresponding to all wireless access points in the wifi fence_1 are stored in the fingerprint library.

[0213] In addition, it should be noted that in actual applications, the geographic fences perceived by the electronic device at a certain moment may include multiple cell fences, and each cell fence may include multiple wifi fences, and each wifi fence may include multiple wireless access points. In this case, when storing the BSSID in the fingerprint library, it can be distinguished according to the ID of the cell fence and the ID of the wifi fence, and then the BSSID is stored according to the hash classification value under the corresponding wifi fence, that is, it is sorted in order according to the size of its numerical value, and the number of BSSIDs corresponding to each hash classification value is recorded.

[0214] Exemplarily, the number of BSSIDs corresponding to each hash classification value included in a certain wifi fence is as follows: there are 4 BSSIDs with a hash classification value of 0 (category 0), 4 BSSIDs with a hash classification value of 1 (category 1), 8 BSSIDs with a hash classification value of 2 (category 2), 2 BSSIDs with a hash classification value of 3 (category 3), 3 BSSIDs with a hash classification value of 4 (category 4), 5 BSSIDs with a hash classification value of 5 (category 5), 6 BSSIDs with a hash classification value of 6 (category 6), and 7 BSSIDs with a hash classification value of 7 (category 7). In a possible implementation, the number of BSSIDs corresponding to the hash classification values ​​included in the wifi fence recorded can be the total number of the first n categories as an example, and can be specifically as follows. Fig. 9 shown.

[0215] See also Fig. 9 , in this record table, the first bit records the total number of BSSIDs included in category 0, that is, 4. The second bit records the total number of BSSIDs included in category 0 and category 1, that is, 8. The third bit records the total number of BSSIDs included in category 0, category 1, and category 2, that is, 16. The fourth bit records the total number of BSSIDs included in category 0, category 1, category 2, and category 3, that is, 18. The fifth bit records the total number of BSSIDs included in category 0, category 1, category 2, category 3, and category 4, that is, 21. The sixth bit records the total number of BSSIDs included in category 0, category 1, category 2, category 3, category 4, and category 5, that is, 26. The seventh bit records the total number of BSSIDs included in category 0, category 1, category 2, category 3, category 4, category 5, and category 6, that is, 32. The eighth bit records the total number of BSSIDs included in the eight categories of Category 0, Category 1, Category 2, Category 3, Category 4, Category 5, Category 6 and Category 7, which is 38.

[0216] It should be understood that the above description is merely an example listed for a better understanding of the technical solution of this embodiment, and is not intended to be the sole limitation to this embodiment.

[0217] See also Fig.10 ,Exemplarily, in a possible implementation, for a certain memory area in the fingerprint library, the ID of the cell fence can be first recorded in the memory area corresponding to the starting address, for example Fig.10 Then, the ID of the first wifi fence of the cell fence with ID "C1" is recorded in the memory area corresponding to the next address immediately following the address, for example Fig.10After that, starting from the next address after recording the address "11", the BSSID under each hash classification value can be recorded in the corresponding memory area in the order of categories 0 to 7, from small to large.

[0218] by Fig. 9 Taking the number of BSSIDs corresponding to each hash classification value included in a certain wifi fence as an example, in the four consecutive memory areas starting from the next address of the address "11", the BSSIDs of four different wireless access points with a hash classification value of 0 are recorded in ascending order.

[0219] Continue to see Fig.10 For example, in the four consecutive storage areas after the last BSSID with a hash classification value of 0, the BSSIDs of four different wireless access points with a hash classification value of 1 are recorded in order from small to large.

[0220] Continue to see Fig.10 For example, according to the above method, after sequentially recording the BSSID with a hash classification value of 7, the RSSI corresponding to each BSSID will be recorded in the next storage area in the order of the BSSID stored under the hash classification value 0 value 7.

[0221] Continue to see Fig.10 For example, after the BSSIDs and corresponding RSSIs of all wireless access points under the wifi fence with ID "11" are recorded in sequence to the fingerprint library, the ID of the second wifi fence under the cell fence with ID "C1", such as "12", will be recorded in the same way. And starting from the next memory area of ​​the memory area where "12" is recorded, the BSSIDs and corresponding RSSIs of all wireless access points under the wifi fence with ID "12" are recorded in sequence according to the hash classification value.

[0222] Continue to see Fig.10 For example, after the BSSIDs and RSSIs of the wireless access points in all wifi fences under the cell fence with ID "C1" are stored in the fingerprint library in the above manner, the BSSIDs and corresponding RSSIs of the wireless access points included in each wifi fence in the next cell fence can be recorded. For example, the BSSIDs and corresponding RSSIs of the wireless access points in the wifi fence with ID "21" in the cell fence with ID "C2" are recorded.

[0223] It should be understood that the above description is merely an example listed for a better understanding of the technical solution of this embodiment, and is not intended to be the sole limitation to this embodiment.

[0224] As a result, the fingerprint information of the wireless access points in various fences is downloaded and stored in the fingerprint library of the second chip, so that when the user carries the electronic device and moves, the matching fingerprint information can be found in the fingerprint library based on the fingerprint information of the wireless access points currently scanned by the electronic device, and then the user's current target location can be determined based on the fence algorithm to push the service.

[0225] In addition, based on the above, the hash classification value of each BSSID is first determined by the hash algorithm, divided according to the hash classification value, and then sorted and stored in ascending order under each hash classification value. Subsequently, in the MAC address matching process, the hash classification value of each BSSID currently scanned is also calculated according to the hash algorithm, and then the corresponding hash classification value in the fingerprint library is searched, thereby directly filtering out the BSSIDs under other hash classification values, greatly reducing the amount of data matching, so that the MAC address matching can be faster, that is, the time consumption of the matching process is shortened. For details about the MAC address matching process, please refer to the following content about the MAC address matching process, which will not be repeated here.

[0226] (2) MAC address update

[0227] It should be noted that in actual applications, the storage of MAC addresses may also have problems in the following update scenarios. For example, when the fingerprint database is short of memory, storage and update may involve merging multiple memory fragments in the fingerprint database and moving data. If this process is performed according to the conventional merging method, that is, merging in sequence according to address size, the memory fragments selected for merging are not appropriate, resulting in multiple data moves, thereby increasing copy overhead.

[0228] For ease of explanation, this embodiment uses the MAC address update process to specifically illustrate the method of merging memory fragments in the MAC address processing solution provided in the embodiment of the present application.

[0229] See also Fig.11 , exemplarily, before the old fingerprint information is deleted, the fingerprint database memory situation is, for example, only one free memory block, such as memory block 0.

[0230] Continue to see Fig.11 For example, in a possible implementation, when in location A, the fingerprint information related to the area of ​​location A automatically downloaded through the network by the user's mobile phone includes the BSSID and corresponding RSSI of the wireless access point under each wifi fence in the eight cell fences from cell 1 to cell 8. These fingerprint information are respectively recorded in the fingerprint library corresponding to the second chip, for example Fig.11In the 8 black-shaded memory blocks shown in FIG. 1 . When the user moves to location B, the mobile phone can automatically delete the fingerprint information under the 5 cell fences from cell1 to cell5 that are not involved in location B, and download the fingerprint information involved in the new cell fence, such as the BSSID and corresponding RSSI of the wireless access point under each wifi fence in the 84 cell fences from cell9 to cell12. In this case, the old fingerprint information is deleted and the new fingerprint information is stored in the database. Deleting the old fingerprint information will cause memory fragmentation. If the memory fragmentation is not handled in time, there will be insufficient memory to store new fingerprint information after a long time.

[0231] Continue to see Fig.11 , take the fingerprint information in the three memory blocks numbered 1, 2 and 3 need to be deleted as an example. After deleting the fingerprint information in these three memory blocks, four free memory blocks (also called memory fragments) will appear in the fingerprint library, namely, memory block 0, memory block 1, memory block 2 and memory block 3. In this case, if new fingerprint information needs to be written, according to the conventional memory fragment processing (merging) method, the size of the first memory fragment will generally be determined from the address order from left to right (from left to right, the address on the left is small, and the address on the right is large) to see whether it meets the memory allocation requirements required by the new fingerprint information. If it meets, it will be allocated directly. If not, the memory fragments will be merged, specifically, the memory fragment will be merged with the next memory fragment that appears later. After merging the two memory fragments, it is determined whether the size of the merged memory fragment meets the current memory allocation requirements. If it meets, it will be allocated directly; if not, it will continue to be merged in the above manner until the merge meets the current memory allocation requirements (the memory space after the merger is greater than or equal to the memory size required by the new fingerprint message). However, since in the process of merging memory fragments, each merge requires the data between two memory fragments, such as old fingerprint data, to be moved, this may result in multiple data moves in the entire process, thereby increasing the copy overhead.

[0232] For ease of explanation, the following Fig.12 The following describes the general method for handling memory fragmentation.

[0233] See also Fig.12For example, after the old fingerprint data is deleted, the free memory blocks (memory fragments) in the fingerprint library, that is, the memory fragments that can be written with data include memory fragment 0, memory fragment 1, memory fragment 2 and memory fragment 3 (in the order of address size, the order in which these four memory blocks appear is: memory fragment 1, memory fragment 2, memory fragment 3 and memory fragment 0), if the conventional memory fragment processing method is used, it will first determine whether memory fragment 1 meets the memory allocation requirements for writing the new fingerprint information that needs to be newly added to the fingerprint library, that is, whether the memory size of memory block 1 is greater than or equal to the memory size required by the new fingerprint information.

[0234] Continue to see Fig.12 , exemplarily, when the space of memory fragment 1 is insufficient, that is, when new fingerprint information cannot be written, memory fragment 1 and memory fragment 2 will be merged.

[0235] Continue to see Fig.12 For example, since there is old data 1 between memory fragment 1 and memory fragment 2, data 1 needs to be moved to the front of memory fragment 1 before memory fragment 1 and memory fragment 2 can be merged. Thus, the first data migration occurs.

[0236] Continue to see Fig.12 , exemplarily, after moving data 1 and merging memory fragment 1 and memory fragment 2, it is determined again whether the memory size of the merged memory fragment 1-2 is greater than or equal to the memory size required by the new fingerprint information.

[0237] Continue to see Fig.12 , exemplarily, when the space of memory fragment 1-2 is insufficient, that is, when new fingerprint information cannot be written, memory fragment 1-2 and memory fragment 3 will be merged.

[0238] Continue to see Fig.12 For example, since old data 2 and data 3 exist between memory fragment 1-2 and memory fragment 3, data 2 and data 3 need to be moved to the front of memory fragment 1-2 in sequence before memory fragment 1-2 and memory fragment 3 can be merged. Therefore, the second data move (for data 2) and the third data move (for data 3) occur.

[0239] Continue to see Fig.12 , exemplarily, after data 3 is moved and memory fragments 1-2 and memory fragments 3 are merged, it will be determined again whether the memory size of the merged memory fragments 1-3 is greater than equal to the memory size required by the new fingerprint information.

[0240] Continue to see Fig.12, illustratively, the space of memory fragment 1-3 is larger than the memory size required for the new fingerprint information, and the new fingerprint information can be written into memory fragment 1-3. Thus, the writing of new fingerprint data is realized, but three data migrations occur in this process, and the amount of data migration is large, so the time overhead is large. If a MAC address match occurs at this time, in one possible implementation, the match may fail because the new fingerprint information is not written into the fingerprint library in time. In another possible implementation, if the matching process waits for the fingerprint library to be updated before it is performed, it will affect the progress of subsequent processing, resulting in the failure to push the service in time.

[0241] In addition, large amounts of data movement and processing will also increase the burden on the second chip and affect the processing speed of the second chip for other services.

[0242] Taking the above problems into consideration, the MAC address processing method provided in the present application increases the overhead of data migration and copying on the existing memory fragment merging method, and then merges the memory fragments by selecting the memory fragment combination method with the lowest overhead, thereby greatly reducing the time overhead caused by data migration.

[0243] Still Fig.11 After deleting the old fingerprint information, the memory fragments existing in the fingerprint library are memory fragment 1, memory fragment 2, memory fragment 3 and memory fragment 0. When the operation of writing new fingerprint information into the new fingerprint library occurs, for the scenario of these four memory fragments, the determined memory fragment combination can be, for example, as follows Fig.13A 14 species are shown.

[0244] By comparing the memory sizes of the 14 memory fragment combinations with the required memory sizes of the new fingerprint information to be written, it is determined that the memory sizes of memory fragment combination 5, memory fragment combination 6, memory fragment combination 7, memory fragment combination 11, memory fragment combination 12, memory fragment combination 13 and memory fragment combination 14 all meet the memory allocation requirements of the new fingerprint information, such as Fig. 13B shown.

[0245] Combination Fig.11 and Fig. 13BAs shown, memory fragment combination 5 needs to move data 1 to data 4 between memory fragment 1 and memory fragment 0 before it can be merged into memory fragment combination 5, that is, it needs to perform 4 data moves. Memory fragment combination 6 needs to move data 2 to data 4 between memory fragment 2 and memory fragment 0 before it can be merged into memory fragment combination 6, that is, it needs to perform 3 data moves. Memory fragment combination 7 needs to move data 4 between memory fragment 3 and memory fragment 0 before it can be merged into memory fragment combination 7, that is, it needs to perform 1 data move. Memory fragment combination 11 needs to move data 1 to data 4 between memory fragment 1, memory fragment 2 and memory fragment 0 before it can be merged into memory fragment combination 11, that is, it needs to perform 4 data moves. Memory fragment combination 12 needs to move data 1 to data 4 between memory fragment 1, memory fragment 3 and memory fragment 0 before it can be merged into memory fragment combination 12, that is, it needs to perform 4 data moves. Memory fragment combination 13 needs to move data 1 to data 3 between memory fragment 1, memory fragment 2 and memory fragment 3 before it can be merged into memory fragment combination 13, that is, it needs to move data three times. Memory fragment combination 14 needs to move data 1 to data 4 between memory fragment 1, memory fragment 2, memory fragment 3 and memory fragment 0 before it can be merged into memory fragment combination 14, that is, it needs to move data four times.

[0246] From this we can see that Fig. 13B The merging method of memory fragment combination 7 shown in FIG. 1 minimizes copy consumption when data is moved. Therefore, when writing new fingerprint information into the fingerprint library of the second chip, it can be as follows: Fig. 13C As shown, memory fragment 0 and memory fragment 3 are directly merged. In this process, only data 4 needs to be moved, that is, data movement is performed once. After that, the new fingerprint information can be written into the merged memory fragment 3-0.

[0247] It should be understood that the above description is merely an example listed for a better understanding of the technical solution of this embodiment, and is not intended to be the sole limitation to this embodiment.

[0248] Therefore, based on the processing method provided in the embodiment of the present application, the time consumption of data copying can be greatly reduced, so that the new fingerprint information can be written into the fingerprint library of the second chip in time, which is convenient for subsequent MAC address matching processing.

[0249] The following is the content of the MAC address matching process:

[0250] For example, a user carries a mobile phone with a dual-chip (first chip + second chip) configuration with a service search function, and enters Figure 5C Take the wifi fence 1 as an example. In this fence, the fingerprint information of the wireless access point scanned by the mobile phone may include Figure 5C The wireless access point 1 to the wireless access point 5 shown in FIG.

[0251] Exemplarily, in a possible implementation, the fingerprint information of the five wireless access points currently scanned by the mobile phone can be expressed in the following form: {(BSSID_1, RSSI_1), (BSSID_2, RSSI_2), (BSSID_3, RSSI_3), (BSSID_4, RSSI_4), (BSSID_5, RSSI_5)}.

[0252] It can be understood from the above description of the storage and update of the MAC address that during the storage process of the fingerprint information, it will be classified by hash classification value, and then sorted in ascending order under the corresponding hash classification value. Therefore, after the fingerprint information is scanned, each scanned BSSID can be hashed by the same hash algorithm to determine the hash classification value corresponding to each BSSID. Then use the sequential matching method or the binary matching method to search in the BSSID managed by the corresponding hash classification value, so as to ensure that the number of comparisons is roughly equal, and thus speed up the matching process, thereby shortening the matching time of the MAC address, and timely determine the fence and push the service.

[0253] Based on the description of the above embodiments, the MAC address processing method provided by the present application can be processed as follows in the actual implementation process. Fig.14 or Fig.15 shown.

[0254] See also Fig.14 , a flow chart showing a method for processing a MAC address is exemplified. In this embodiment, the method for processing a MAC address may include:

[0255] 101. When an electronic device enters a first area, a second chip scans fingerprint information of surrounding wireless access points. The fingerprint information of each wireless access point includes a BSSID and RSSI corresponding to the wireless access point.

[0256] The electronic device is a device with a dual-chip configuration (first chip + second chip) as mentioned in the above embodiment. For the hardware structure of the electronic device with a dual-chip configuration, for example Figure 2 shown.

[0257] The first chip is, for example, the SOC chip mentioned in the above embodiment, and the second chip is a chip with lower power consumption and smaller memory than the SOC chip, but is at the same level as the SOC chip, that is, the second chip can also process various services.

[0258] In addition, it should be noted that the second chip can remain in operation after the electronic device is started, that is, regardless of whether the electronic device is in a screen-off state or a screen-on state, the second chip can execute the MAC address processing method provided in the embodiment of the present application.

[0259] 102. Determine a hash classification value corresponding to each BSSID according to a hash algorithm.

[0260] The hash classification value corresponding to each BSSID may be determined, for example, in the following manner:

[0261] First, according to the hash algorithm, the first N bytes and the last M bytes of the hexadecimal BSSID are XORed.

[0262] Here, N and M may be the same or different.

[0263] Specifically in this embodiment, N and M are the same, and both are taken as 3 as an example.

[0264] Next, the first processing result obtained by the XOR processing is converted from hexadecimal to decimal.

[0265] Next, convert each hexadecimal byte in the last M bytes to decimal.

[0266] Next, the first processing result in base 10 is added to the decimal result of each byte in the last M bytes.

[0267] Next, according to the preset number of categories, a remainder process is performed on the second processing result obtained by the addition process.

[0268] The preset number of categories may be determined according to the minimum power consumption required for division when the algorithm is hardened. This embodiment takes 8 as an example.

[0269] Finally, the third processing result obtained by the remainder processing is used as the hash classification value corresponding to the BSSID.

[0270] For specific implementation details of determining the hash classification value corresponding to each BSSID in step 102, see Figure 7 The description of the illustrated embodiment will not be repeated here.

[0271] 103. For each BSSID, search for a target BSSID identical to the BSSID in a storage area corresponding to the hash classification value in the memory of the second chip.

[0272] Understandably, the second chip's memory needs to store the fingerprint information of each wireless access point obtained from the server in advance according to the hash classification value. In this way, in the MAC address matching process, classification filtering can be implemented based on the hash classification value, and the matching target BSSID can be quickly queried.

[0273] Therefore, based on the MAC address processing method provided in the embodiment of the present application, it is possible to quickly find the target BSSID that is the same as each BSSID, and then determine the current location of the electronic device based on the target BSSID and the RSSI corresponding to the target BSSID. In this way, services matching the current location of the electronic device can be pushed in a timely manner.

[0274] See also Fig.15 , a flow chart showing a method for processing a MAC address is exemplified. In this embodiment, the method for processing a MAC address may include:

[0275] 201. When an electronic device enters a first area, fingerprint information of all wireless access points involved in the first area is obtained.

[0276] Through the above embodiments, the relationship between the cell fence, the wifi fence, the wireless access point and the fingerprint information is described. FIG. 5A to FIG. 5C ,as well as Figure 6 It can be seen from the description that for a certain area, such as the first area, it can include 1 to multiple cell fences, and each cell fence can include 1 to multiple wifi fences, and each wifi fence can include 1 to multiple wireless access points, and each wireless access point has its own fingerprint information. Based on this, when the electronic device enters the first area, it can interact with the server that stores the fingerprint information of the wireless access points of different wifi fences to determine the cell fences included in the first area and the wifi fences included in each cell fence, and then obtain the fingerprint information of the wireless access points included in each wifi fence from the server.

[0277] 202. Determine the hash classification value of the BSSID in each fingerprint information by using a hash algorithm.

[0278] Understandably, in order to ensure that the MAC address matching link can be quickly queried according to the hash classification value corresponding to the BSSID. In the storage stage, the method of determining the hash classification value of each BSSID is the same as the method of determining the query matching node. For specific implementation details, please refer to the content of step 102 in the above embodiment, or Figure 7 The description of the illustrated embodiment will not be repeated here.

[0279] 203. Store fingerprint information of all wireless access points involved in the first area according to the hash classification value.

[0280] Understandably, the fingerprint information of each wireless access point includes BSSID and RSSI. Therefore, the storage process not only includes storing BSSID, but also needs to include storing the corresponding RSSI.

[0281] Regarding storing fingerprint information of all wireless access points involved in the first area according to the hash classification value, for example, the following method may be used:

[0282] First, for each wifi fence included in each cell fence, the BSSIDs of all wireless access points involved in the wifi fence are stored according to the hash classification value.

[0283] It should be noted that in order to ensure that the BSSID can be found more quickly and conveniently when locating the area corresponding to the corresponding hash classification value, the BSSIDs can be stored in order according to their size in the classification corresponding to each hash classification value, for example, in descending order or in ascending order.

[0284] In addition, in order to facilitate the subsequent MAC address matching process, the storage area corresponding to each hash classification value can be accurately located, when the fingerprint information of all wireless access points involved in the first area is stored according to the hash classification value, the number of fingerprint information of wireless access points stored in the category corresponding to each hash classification value can also be recorded.

[0285] Next, after the BSSIDs of all wireless access points involved in the wifi fence are stored, the RSSI corresponding to each BSSID is stored in the order in which the BSSIDs are stored. In a specific implementation, for example, a table or array can be used to record the total number of wireless access points included in the first n categories of each wifi fence. For details, see Fig. 9 The description of the embodiment part will not be repeated here.

[0286] 204 , the second chip scans fingerprint information of surrounding wireless access points, where the fingerprint information of each wireless access point includes a BSSID and RSSI corresponding to the wireless access point.

[0287] 205. Determine the hash classification value corresponding to each BSSID according to the hash algorithm.

[0288] 206 . For each BSSID, search for a target BSSID identical to the BSSID in a storage area corresponding to the hash classification value in the memory of the second chip.

[0289] Steps 204 to 206 in this embodiment are substantially the same as steps 101 to 103 in the above embodiment. For specific implementation details, please refer to the description of steps 101 to 103, which will not be repeated here.

[0290] 207 , after finding the target BSSID that is the same as the BSSID, determine the current location of the electronic device according to the target BSSID and the target RSSI corresponding to the target BSSID.

[0291] 208, push services matching the current location of the electronic device.

[0292] Thus, the target BSSID that is the same as the BSSID of each wireless access point scanned by the electronic device in the first area can be quickly found, and then the current location of the electronic device can be determined according to the target BSSID and the RSSI corresponding to the target BSSID. In this way, the service matching the current location of the electronic device can be pushed in time.

[0293] 209. When the electronic device enters the second area, determine a cell fence included in the second area.

[0294] 210. According to the cell fences included in the second area, delete the cell fences that do not belong to the second area and are stored in the memory of the second chip.

[0295] 211. Obtain fingerprint information of wireless access points included in each wifi fence in the cell fence of the second area that is not stored in the memory of the second chip from the server.

[0296] 212. When writing the acquired fingerprint information of the wireless access point into the memory of the second chip, determine the memory fragment combination form and the copy consumption corresponding to each memory fragment combination form according to the memory fragments existing in the memory of the second chip.

[0297] 213 , selecting memory fragments from the memory of the second chip for merging according to the memory fragment combination form with the smallest copy consumption.

[0298] 214, writing the acquired fingerprint information of the wireless access point into the storage area corresponding to the merged memory fragments.

[0299] For specific implementation details of steps 209 to 214, please refer to Fig.11 , FIG. 13A to FIG. 13C The description of the illustrated embodiment will not be repeated here.

[0300] Therefore, when the fingerprint information needs to be updated, a feasible memory fragment combination form is first determined, and then the corresponding memory fragments in the memory of the second chip are selected for merging according to the memory fragment combination form with the smallest copy consumption. This can ensure that the merged memory fragments can store the newly acquired fingerprint information of the wireless access point, and can also reduce the copy consumption caused by moving the existing fingerprint information during the memory fragment merging process as much as possible.

[0301] In addition, it is understandable that, in order to implement the above functions, the electronic device includes hardware and / or software modules corresponding to the execution of each function. In combination with the algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware 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 in combination with the embodiments, but such implementation should not be considered to be beyond the scope of the present application.

[0302] In addition, the embodiment of the present application also provides a chip. The chip includes one or more interface circuits and one or more processors; the interface circuit is used to receive a signal from the memory of the electronic device and send a signal to the processor, the signal including a computer instruction stored in the memory; when the processor executes the computer instruction, the electronic device executes the MAC address processing method provided in the above embodiments.

[0303] It is understandable that the chip mentioned in this embodiment is specifically the second chip mentioned in the above embodiments, which has low power consumption, small memory, and can be operated online all the time after the electronic device is started.

[0304] For information about the communication between this chip and other functional devices in electronic devices, please refer to Figure 2 The embodiments shown will not be described in detail here.

[0305] In addition, the embodiment of the present application also provides a chip system. The chip system includes: a first chip and a second chip, the first chip and the second chip share an antenna of an electronic device, the power consumption of the second chip is lower than the power consumption of the first chip, and the memory of the second chip is smaller than the memory of the first chip; when the electronic device is in the screen-off state, the first chip is in the sleep state, and the second chip is in the non-sleep state.

[0306] Among them, the second chip is used to call and run a computer program from the memory of the electronic device, so that the electronic device equipped with the chip system executes the MAC address processing method provided by the above embodiments.

[0307] It is understandable that the first chip is, for example, the SOC chip mentioned in the above embodiment, and the second chip is the second chip with low power consumption and small memory mentioned in the above embodiment, and can be operated online all the time after the electronic device is started.

[0308] In addition, an embodiment of the present application also provides a computer-readable storage medium, which stores computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the above-mentioned related method steps to implement the MAC address processing method in the above-mentioned embodiment.

[0309] In addition, an embodiment of the present application further provides a computer program product. When the computer program product is run on an electronic device, the electronic device executes the above-mentioned related steps to implement the MAC address processing method in the above-mentioned embodiment.

[0310] In addition, from the above description, it can be seen that the chip, chip system, electronic device, computer-readable storage medium, computer program product or chip provided in the embodiments of the present application are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above, and will not be repeated here.

[0311] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for processing a MAC address, characterized in that: Applied to an electronic device, the electronic device comprises a first chip and a second chip, the power consumption of the second chip is lower than the power consumption of the first chip, and the memory of the second chip is smaller than the memory of the first chip; wherein when the electronic device is in a screen-off state, the first chip is in a dormant state; The method comprises: When the electronic device enters the first area, the second chip scans the fingerprint information of the surrounding wireless access points, and the fingerprint information of each of the wireless access points includes the BSSID and RSSI corresponding to the wireless access point; wherein, when the second chip scans the fingerprint information of the surrounding wireless access points, the electronic device is in the screen-off state or in the screen-on state; Determine, according to a hash algorithm, a hash classification value corresponding to each of the BSSIDs; For each of the BSSIDs, a target BSSID identical to the BSSID is searched in a storage area corresponding to the hash classification value in the memory of the second chip.

2. The method according to claim 1, characterized in that Determine, according to the hash algorithm, a hash classification value corresponding to each of the BSSIDs, including: For each of the BSSIDs, performing XOR processing on the first N bytes and the last M bytes of the hexadecimal BSSID according to the hash algorithm; Convert the first processing result obtained by the XOR processing from hexadecimal to decimal; Convert each hexadecimal byte in the last M bytes to decimal; Add the first processing result in base 10 to the decimal result of each byte in the last M bytes; According to a preset number of categories, a remainder processing is performed on the second processing result obtained by the addition processing; The third processing result obtained by the remainder processing is used as the hash classification value corresponding to the BSSID.

3. The method according to claim 2, characterized in that The number of categories is 8.

4. The method according to any one of claims 1 to 3, characterized in that: For each of the BSSIDs, in the memory of the second chip, in the storage area corresponding to the hash classification value, before searching for a target BSSID identical to the BSSID, the method further includes: When the electronic device enters the first area, acquiring fingerprint information of all wireless access points involved in the first area; Determine the hash classification value of the BSSID in each fingerprint information by using the hash algorithm; According to the hash classification value, fingerprint information of all wireless access points involved in the first area is stored.

5. The method according to claim 4, characterized in that When the electronic device enters the first area, acquiring fingerprint information of all wireless access points involved in the first area includes: When the electronic device enters the first area, determining the cell fence included in the first area and the wifi fence included in each of the cell fences; The fingerprint information of the wireless access point included in each of the wifi fences is obtained.

6. The method according to claim 5, characterized in that Storing fingerprint information of all wireless access points involved in the first area according to the hash classification value includes: For each wifi fence included in each cell fence, storing the BSSIDs of all wireless access points involved in the wifi fence according to the hash classification value; After the BSSIDs of all wireless access points involved in the wifi fence are stored, the RSSI corresponding to each BSSID is stored in the order in which the BSSIDs are stored.

7. The method according to claim 6, characterized in that For each wifi fence included in each cell fence, according to the hash classification value, the BSSIDs of all wireless access points involved in the wifi fence are stored, further comprising: In the category corresponding to each of the hash category values, the BSSIDs are stored in order according to their size.

8. The method according to any one of claims 4 to 7, characterized in that: When storing fingerprint information of all wireless access points involved in the first area according to the hash classification value, the method further includes: The number of fingerprint information of wireless access points stored in the category corresponding to each hash classification value is recorded.

9. The method according to any one of claims 1 to 8, characterized in that: The method further comprises: When the electronic device enters a second area, determining a cell fence included in the second area; According to the cell fences included in the second area, deleting the cell fences that do not belong to the second area and are stored in the memory of the second chip; Acquire fingerprint information of wireless access points included in each wifi fence in the cell fence of the second area which is not stored in the memory of the second chip from the server; When writing the acquired fingerprint information of the wireless access point into the memory of the second chip, determining a combination form of memory fragments and a copy consumption corresponding to each combination form of memory fragments according to memory fragments existing in the memory of the second chip; Selecting memory fragments from the memory of the second chip for merging according to a combination form of memory fragments with minimal copying consumption; The acquired fingerprint information of the wireless access point is written into the storage area corresponding to the merged memory fragments.

10. The method according to any one of claims 1 to 9, characterized in that: The acquired fingerprint information of the wireless access point is written into the storage area corresponding to the merged memory fragments, including: For each wireless fingerprint information of the wireless access point, determine the hash classification value of the BSSID in each fingerprint information by using the hash algorithm; According to the hash classification value, the fingerprint information of the wireless access point is written into a storage area corresponding to the merged memory fragments.

11. The method according to any one of claims 1 to 10, characterized in that: The method further comprises: After finding a target BSSID identical to the BSSID, determining the current location of the electronic device according to the target BSSID and a target RSSI corresponding to the target BSSID; Push services that match the current location of the electronic device.

12. A chip, characterized in that: It includes one or more interface circuits and one or more processors; the interface circuit is used to receive a signal from a memory of an electronic device and send the signal to the processor, wherein the signal includes a computer instruction stored in the memory; when the processor executes the computer instruction, the electronic device executes the MAC address processing method as described in any one of claims 1 to 11.

13. A chip system, characterized in that: include: A first chip and a second chip, wherein the first chip and the second chip share an antenna of the electronic device, the power consumption of the second chip is lower than the power consumption of the first chip, and the memory of the second chip is smaller than the memory of the first chip; when the electronic device is in a screen-off state, the first chip is in a sleep state, and the second chip is in a non-sleep state; Among them, the second chip is used to call and run a computer program from the memory of the electronic device, so that the electronic device equipped with the chip system executes the MAC address processing method as described in any one of claims 1 to 11.

14. An electronic device, characterized in that: The electronic device includes a memory and a chip system as described in claim 13; the memory is coupled to the processors of the first chip and the second chip respectively; the memory stores program instructions, and when the program instructions are executed by the processor of the second chip, the electronic device executes the MAC address processing method as described in any one of claims 1 to 11.

15. A computer-readable storage medium, characterized in that: It comprises a computer program, and when the computer program is run on an electronic device, the electronic device executes the MAC address processing method as claimed in any one of claims 1 to 11.

Citation Information

Patent Citations

  • Service recommendation method and device and storage medium

    CN116028707A

  • Geofence processing method and device and storage medium

    CN116033342A

  • Memory access method, chip, electronic equipment and computer readable storage medium

    CN116136826A

  • Geofence establishing method, server and communication system

    CN116437293A

  • Reverse address resolution method and electronic device

    US20230198934A1