Method, device and storage medium for processing mac address

By adding a low-power, low-memory second chip to electronic devices and optimizing MAC address processing using a hash algorithm, the problem of the service finding function failing in the screen-off state was solved, enabling normal use and improved query speed in the screen-off state.

CN119766773BActive Publication Date: 2026-02-06HONOR DEVICE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

In existing technologies, MAC address processing cannot be performed when the electronic device is in a screen-off state, causing the service to fail to locate the user.

Method used

A second chip with lower power consumption and less memory than the SOC chip is added to the electronic device. This chip is responsible for matching, storing, and updating MAC addresses in the screen-off state, and the query process is optimized using a hash algorithm.

Benefits of technology

It enables MAC address processing even when the screen is off, ensuring the normal operation of the service-to-find-person function, improving query speed and effectively utilizing memory.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119766773B_ABST
    Figure CN119766773B_ABST
Patent Text Reader

Abstract

The application provides a MAC address processing method, device and storage medium. The method is characterized in that: a small chip with lower power consumption than a SOC chip, smaller memory than the SOC chip and capable of long-term online processing of services after the electronic device is started (i.e. the electronic device is in a screen-off state, but still can work normally) is additionally added (mounted) in an existing SOC chip of a mobile phone or other electronic device, and then the matching service of the MAC address completed by the SOC chip is transferred to the small chip. In this way, even if the electronic device is in a screen-off state, the MAC address service can still be normally performed, so that the MAC address processing method can still be normally used when the electronic device is in a screen-off state.
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, in particular to a MAC address processing method, device and storage medium. BACKGROUND

[0002] Geo-fencing is an application of Location Based Services (LBS), that is, a virtual fence is used to enclose a virtual geographical boundary. When an electronic device enters, leaves or moves within a certain geographical area, the electronic device can receive automatic notifications and warnings. Based on this feature of geo-fencing, the electronic device has launched a service finding function. For the implementation of this function, usually, according to the fingerprint information (such as BSSID and corresponding RSSI) corresponding to the Media Access Control Address (MAC address) currently scanned by the electronic device, the fingerprint information in the locally managed fingerprint library of the MAC address is compared, and then the specific position of the user is determined through the matched BSSID and corresponding RSSI, so that when the user carrying the electronic device is located in different places (positions), the user can be pushed the service suitable for the current place.

[0003] However, the implementation of this function requires the electronic device to be in a bright screen state at all times. That is, when the electronic device is in a dark screen state, the processor in the electronic device for processing services will enter a sleep state.

[0004] Therefore, it is urgent to provide a MAC address processing method that can be performed when the electronic device is in a dark screen state, so as to enable the service finding function to be used when the electronic device is in a dark screen state. SUMMARY

[0005] In order to solve the above technical problems, the present application provides a MAC address processing method, device and storage medium, which aims to enable the electronic device to normally perform MAC address matching, storage and updating when the electronic device is in a dark screen state, so that the service finding function can still be normally used when the electronic device is in a dark screen state.

[0006] In a first aspect, the present application provides a MAC address processing method. 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 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 an off-screen state, the first chip is in a hibernation state. For the electronic device with such a structure, the method includes: when the electronic device enters a first area, the second chip scans the fingerprint information of the surrounding wireless access points. The fingerprint information of each wireless access point includes the BSSID and RSSI corresponding to the wireless access point. When the second chip scans the fingerprint information of the surrounding wireless access points, the electronic device is in an off-screen state or in a screen-on state. According to a hash algorithm, the hash classification value corresponding to each BSSID is determined. For each BSSID, in the memory of the second chip, the target BSSID identical to the BSSID is searched in the storage area corresponding to the hash classification value.

[0007] The first chip is, for example, a system on chip (SOC). At present, in order to reduce the power consumption of the electronic device, when the electronic device enters an off-screen state, the SOC chip usually enters a hibernation state. After the electronic device is turned on, the SOC chip resumes the working state and processes the business.

[0008] The second chip can be regarded as a chip at the same level as the SOC chip and can process the business. However, 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, that is, the implementation cost of the second chip is lower than that of the first chip. Moreover, since the power consumption of the second chip is relatively low, it can work and process the business after the electronic device is turned on, regardless of the state of the electronic device, such as off-screen or screen-on.

[0009] Therefore, by additionally mounting a small chip with lower power consumption and smaller memory than the SOC chip in an existing electronic device such as a mobile phone, which can work normally when the electronic device is in an off-screen state, the MAC address matching business completed by the SOC chip is transferred to the small chip. In this way, even if the electronic device is in an off-screen state, the MAC address processing business can still be performed normally, so that the function of finding a service person can still be used normally when the electronic device is in an off-screen state.

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

[0011] In this way, the hash classification value corresponding to each BSSID is determined based on the hash algorithm, and then the target BSSID is searched in the corresponding storage area according to the hash classification value. Therefore, a large number of unmatched BSSIDs can be filtered out before searching, the query amount is greatly reduced, and the query speed is improved.

[0012] According to the first aspect, or any one of the implementation forms of the first aspect, the classification number is 8.

[0013] Considering that the algorithm hardens the division processing, only 3-bit right shift is required for division by 8, and the time consumption is small. Therefore, in order to improve the query speed and subsequent storage speed, the present application selects 8 as the classification number.

[0014] According to the first aspect, or any one of the implementation forms of the first aspect, for each BSSID, in the memory of the second chip, before searching for the target BSSID identical to the BSSID in the storage area corresponding to the hash classification value, the method further includes: when the electronic device enters the first area, obtaining the fingerprint information of all wireless access points involved in the first area; determining the hash classification value of the BSSID in each fingerprint information by using the hash algorithm; and storing the fingerprint information of all wireless access points involved in the first area according to the hash classification value.

[0015] In this way, when the user carrying the electronic device enters the first area, the corresponding fingerprint information is directly obtained from the server, the hash classification value of the BSSID in each fingerprint information is determined based on the same hash algorithm processing mode, and then the hash classification value is stored, so that a large number of unsuitable BSSIDs can be filtered out in advance based on the hash classification value in the subsequent query process.

[0016] According to the first aspect, or any one of the first aspect's implementation manners, when the electronic device enters the first area, the method for obtaining the fingerprint information of all the wireless access points involved in the first area comprises: when the electronic device enters the first area, determining the cell fences included in the first area and the wifi fences included in each of the cell fences; and obtaining the fingerprint information of the wireless access points included in each of the wifi fences.

[0017] According to the first aspect, or any one of the first aspect's implementation manners, the method for storing the fingerprint information of all the wireless access points involved in the first area according to the hash classification values comprises: for each of the wifi fences included in each of the cell fences, storing the BSSID of all the wireless access points involved in the wifi fence according to the hash classification values; and after the BSSID of all the wireless access points involved in the wifi fence is stored, storing the RSSI corresponding to each of the BSSID in the order of the storage of the BSSID.

[0018] According to the first aspect, or any one of the first aspect's implementation manners, for each of the wifi fences included in each of the cell fences, the method for storing the BSSID of all the wireless access points involved in the wifi fence according to the hash classification values further comprises: storing the BSSID in the order of the size of the BSSID in each of the classifications corresponding to the hash classification values.

[0019] According to the first aspect, or any one of the first aspect's implementation manners, for each of the wifi fences included in each of the cell fences, the method for storing the BSSID of all the wireless access points involved in the wifi fence according to the hash classification values further comprises: storing the BSSID in the order of the size of the BSSID in each of the classifications corresponding to the hash classification values.

[0020] According to the first aspect, or any one of the first aspect's implementation manners, when the method for storing the fingerprint information of all the wireless access points involved in the first area according to the hash classification values, the method further comprises: recording the number of the fingerprint information of the wireless access points stored in each of the classifications corresponding to the hash classification values.

[0021] According to the first aspect, or any one of the first aspect's implementation manners, when the method for storing the fingerprint information of all the wireless access points involved in the first area according to the hash classification values, the method further comprises: recording the number of the fingerprint information of the wireless access points stored in each of the classifications corresponding to the hash classification values.

[0022] According to the first aspect or any one of the implementations of the first aspect, the method further includes: when the electronic device enters the second area, determining a cell fence included in the second area; deleting, according to the cell fence included in the second area, the cell fence not belonging to the second area stored in the memory of the second chip; obtaining, from the server, the fingerprint information of the wireless access point included in each of the wifi fences in the cell fence of the second area not stored in the memory of the second chip; when writing the obtained fingerprint information of the wireless access point into the memory of the second chip, determining, according to the memory fragments existing in the memory of the second chip, a memory fragment combination form and a copy consumption corresponding to each memory fragment combination form; selecting memory fragments from the memory of the second chip according to the memory fragment combination form with the minimum copy consumption; and writing the obtained fingerprint information of the wireless access point into the storage area corresponding to the merged memory fragments.

[0023] In this way, by determining the feasible memory fragment combination form first, and then selecting the corresponding memory fragments in the memory of the second chip according to the memory fragment combination form with the minimum copy consumption for merging, it is possible to ensure that the merged memory fragments can store the newly obtained fingerprint information of the wireless access point, and at the same time, it is possible to reduce the copy consumption caused by moving the existing fingerprint information during the merging of the memory fragments.

[0024] According to the first aspect or any one of the implementations of the first aspect, writing the obtained fingerprint information of the wireless access point into the storage area corresponding to the merged memory fragments includes: for each wireless fingerprint information of the wireless access point, determining a hash classification value of the BSSID in each fingerprint information by using a hash algorithm; and writing the fingerprint information of the wireless access point into the storage area corresponding to the merged memory fragments according to the hash classification value.

[0025] According to the first aspect or any one of the implementations of the first aspect, the method further includes: after finding the target BSSID identical to the BSSID, determining the current location of the electronic device according to the target BSSID and the target RSSI corresponding to the target BSSID; and pushing a service matching the current location of the electronic device.

[0026] Since the operation of processing the MAC address is completed by the second chip, the service finding function can be implemented 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; and based on the above updating method, the limited memory can be effectively utilized, and the copy consumption can be reduced.

[0028] In a second aspect, the present application provides a chip. The chip comprises one or more interface circuits and one or more processors; the interface circuits are configured to receive signals from a memory of an electronic device and send signals to the processors, the signals comprising computer instructions stored in the memory; when the processors execute the computer instructions, the electronic device executes instructions of the method in the first aspect or any possible implementation manner of the first aspect.

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

[0030] The non-sleep state means that the chip is not in a sleep state (a state in which no service can be processed), that is, after the electronic device is powered on, the chip can normally process services whether the electronic device is in a screen-on state or a screen-off state.

[0031] The second aspect and any implementation manner of the second aspect correspond to the first aspect and any implementation manner of the first aspect, respectively. The technical effects of the second aspect and any implementation manner of the second aspect can be found in the technical effects of the first aspect and any implementation manner of the first aspect, which will not be described here.

[0032] In a third aspect, the present application provides a chip system. The chip system comprises 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 configured to call and run a computer program from a memory of the electronic device, so that the electronic device installed with the chip system executes instructions of the method in the first aspect or any possible implementation manner of the first aspect.

[0033] The first chip, for example, a system on chip (SOC) in the electronic device, can comprise an application processor, a modem, a baseband processor, and the like.

[0034] The second chip is a small chip system newly added in the present application, which is low in power consumption, small in memory, and can process services online all the time.

[0035] In an implementation manner, the first chip can be regarded as a main chip, and the second chip can be regarded as a secondary chip. The second chip can assist the first chip to complete part of the processing services, and the performance and cost of the second chip are lower than those of the first chip.

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

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

[0038] The fourth aspect and any kind of implementation manner of the fourth aspect correspond to the first aspect and any kind of implementation manner of the first aspect respectively. The technical effects corresponding to the fourth aspect and any kind of implementation manner of the fourth aspect can be referred to the technical effects corresponding to the first aspect and any kind of implementation manner of the first aspect, which will not be described here.

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

[0040] The fifth aspect and any kind of implementation manner of the fifth aspect correspond to the first aspect and any kind of implementation manner of the first aspect respectively. The technical effects corresponding to the fifth aspect and any kind of implementation manner of the fifth aspect can be referred to the technical effects corresponding to the first aspect and any kind of implementation manner of the first aspect, which will not be described 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 manner of the first aspect.

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

[0043] FIG. 1A A schematic diagram of a scene of a service finding function of an exemplary electronic device;

[0044] FIG. 1BFig. 6 is a schematic diagram of a scenario of implementing the service finding function in an electronic device according to an embodiment of the present application;

[0045] FIG. 2 Fig. 7 is a schematic diagram of a hardware structure of an electronic device for implementing the method of processing MAC address according to an embodiment of the present application;

[0046] FIG. 3 Fig. 8 is a schematic diagram of a scenario of implementing the service finding function in an electronic device with the hardware structure shown in Fig. 7; FIG. 2 Fig. 9 is a schematic diagram of a software layered architecture of an electronic device according to an embodiment of the present application;

[0047] FIG. 4A Fig. 10 is a schematic diagram of a scenario of implementing the service finding function in an electronic device with the software layered architecture shown in Fig. 9;

[0048] FIG. 4B Fig. 11 is a schematic diagram of a scenario of implementing the service finding function in an electronic device with the software layered architecture shown in Fig. 9;

[0049] FIG. 4C Fig. 12 is a schematic diagram of a functional module inside a MAC address processing module for implementing the method of processing MAC address according to an embodiment of the present application;

[0050] FIG. 5A to FIG. 5C Fig. 13 is a schematic diagram of a relationship among a cell fence, a WiFi fence and a wireless access point according to an embodiment of the present application;

[0051] FIG. 6 Fig. 14 is a schematic diagram of a relationship among a cell fence, a WiFi fence, a wireless access point and fingerprint information corresponding to the wireless access point according to an embodiment of the present application;

[0052] FIG. 7 Fig. 15 is a schematic diagram of determining a hash classification value corresponding to each BSSID based on a hash algorithm according to an embodiment of the present application;

[0053] FIG. 8 Fig. 16 is a schematic diagram of storing BSSIDs according to hash classification values according to an embodiment of the present application;

[0054] FIG. 9 Fig. 17 is a schematic diagram of recording the number of BSSIDs of all wireless access points contained in the top-n classes of each WiFi fence according to hash classification values according to an embodiment of the present application;

[0055] FIG. 10 Fig. 18 is a schematic diagram of storing fingerprint information of different WiFi fences in different cell fences according to hash classification values according to an embodiment of the present application;

[0056] FIG. 11 Fig. 19 is a schematic diagram of the memory fragmentation in a fingerprint database before and after deleting old fingerprint information according to an embodiment of the present application;

[0057] FIG. 12A schematic diagram of adding new fingerprint information to the fingerprint library by merging memory fragments, which is exemplarily shown based on a conventional memory fragment merging manner;

[0058] FIG. 13A A schematic diagram of determining different memory fragment combinations corresponding to the memory fragment combinations of several memory fragments, which is exemplarily shown for FIG. 11 A schematic diagram of determining different memory fragment combinations corresponding to the memory fragment combinations of several memory fragments, which is exemplarily shown for

[0059] FIG. 13B A schematic diagram of determining the memory fragment combinations that can write new fingerprint information from the memory fragment combinations, which is exemplarily shown based on FIG. 13A A schematic diagram of determining the memory fragment combinations that can write new fingerprint information from the memory fragment combinations, which is exemplarily shown based on

[0060] FIG. 13C A schematic diagram of merging memory fragments based on the memory fragment combinations with minimum copy consumption, which is exemplarily shown based on FIG. 13B A schematic diagram of merging memory fragments based on the memory fragment combinations with minimum copy consumption, which is exemplarily shown based on

[0061] FIG. 14 A schematic diagram of a flow of a MAC address processing method provided by an embodiment of the present application, which is exemplarily shown.

[0062] FIG. 15 A schematic diagram of a flow of a MAC address processing method provided by another embodiment of the present application, which is exemplarily shown. DETAILED DESCRIPTION

[0063] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work fall within the scope of protection of the present application.

[0064] The term “and / or” in the present application is only used to describe the association relationship of the associated objects, and means that there can be three relationships, for example, A and / or B can mean that A exists alone, A and B exist together, and B exists alone.

[0065] The terms “first” and “second” and the like in the specification and claims of the embodiments of the present application are used to distinguish different objects, and are not used to describe the specific order of the objects. For example, the first target object and the second target object are used to distinguish different target objects, and are not used to describe the specific order of the target objects.

[0066] In the embodiments of the present application, the word "exemplary" or "for example" is used to mean serving as an example, instance, or illustration. Any embodiment or design described in the embodiments of the present application as "exemplary" or "for example" should not be construed as preferred or advantageous over other embodiments or designs. Rather, the intent is to present concepts in a concrete manner.

[0067] In the description of the embodiments of the present application, the meaning of "a plurality of" is two or more, unless otherwise specified. For example, a plurality of processing units means two or more processing units; a plurality of systems means two or more systems.

[0068] The following explains some of the terms involved in the present application to facilitate understanding by those skilled in the art.

[0069] (1) cell fence (cell geofence)

[0070] The cell fence can be understood as an area covered by a base station scanned by a mobile phone or other electronic device using a mobile network (cell network).

[0071] Understandably, in actual application, there can be one to multiple cells under one base station, that is, the same base station can correspond to multiple one to multiple cell fences.

[0072] In addition, it should be noted that based on the characteristics of the mobile network, the cell fence can be applied to indoor positioning and outdoor positioning.

[0073] (2) wifi fence (wifi geofence)

[0074] The wifi fence can be understood as a WiFi signal scanned by a mobile phone or other electronic device.

[0075] Understandably, in actual application, one to multiple wireless access points (Access Point, AP) can be included in the same wifi fence, and each AP can correspond to a specific media access control address (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 for identifying each wireless access point in a wireless local area network, similar to a MAC address. That is, the processing of the MAC address in the embodiments of the present application is essentially the processing of the BSSID. Therefore, through the BSSID, the wireless client (mobile phone and other electronic devices) can determine the identity of the wireless access point it is connected to, in order to establish a connection.

[0078] (4) RSSI

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

[0080] (5) Fingerprint information

[0081] Understandably, each cell fence can generally include multiple wifi fences, and each wifi fence can include a plurality of wifi routing information, such as the BSSID and RSSI corresponding to each wireless access point. Among them, 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, the wifi fence, the BSSID and the RSSI in the fingerprint information described above, the current mobile phone and other electronic devices provide a service finding function. As for the implementation of this function, it is usually based on the fingerprint information (such as BSSID and corresponding RSSI) corresponding to the wireless access point currently scanned by the electronic device, to compare with the fingerprint information in the locally managed fingerprint library, and then to determine the specific location of the user through the matched BSSID and corresponding RSSI, so that when the user carrying the electronic device with this function enters different places (positions), the user can be automatically pushed to the services suitable for the current place. For example, when the user enters a certain shopping mall, the user can be automatically pushed to the food, best-selling products, activities, etc. of the shopping mall.

[0083] Further, in some possible implementation manners, it can also be accurate to the user reaching the vicinity of a certain specific store to push the related activity information of the store, etc.

[0084] It should be understood that the above description is only an example for better understanding the technical solutions of the embodiments and is not the only limitation of the embodiments.

[0085] Currently, the processing operation related to the MAC address in the service finding function, such as the matching of the MAC address (BSSID), the storage and updating of the MAC address (BSSID and RSSI), is usually implemented in the System on Chip (SOC) chip of the electronic device such as a mobile phone. However, the SOC chip only works when the screen of the electronic device is in the bright screen state, and will enter the sleep state when the screen is in the dark screen state. In the sleep state, the SOC does not have the ability to perceive the geofence, so the service finding function cannot be realized.

[0086] For ease of understanding, the following describes the current implementation of the MAC address processing by the SOC chip and the realization of the service finding function in the scenario. FIG. 1A and FIG. 1B

[0087] Referring to FIG. 1A , for example, when the user A carries an electronic device such as a mobile phone with a service finding function to the mall 1. When the carried mobile phone is in the bright screen state, such as the bright screen lock screen interface, the SOC chip will perceive the change of the geofence where the user A is located, and then pop up a notification management window on the current interface of the mobile phone in the bright screen state, such as the bright screen lock screen interface, when the user A moves to the corresponding fence of the mall 1, and display the relevant services about the mall 1 in the notification management window, such as FIG. 1A "Today's special sale in Mall 1, 7% off in the whole daily necessities department."

[0088] It should be understood that the above description is only an example for better understanding of the technical solution of the present embodiment, and is not the only limitation of the present embodiment.

[0089] Continuing to refer to FIG. 1A , for example, the user A carries the mobile phone which is always in the bright screen state, such as the bright screen lock screen interface (in actual application, it can be any interface of the electronic device, such as the desktop, the interface of a certain application program). In one possible implementation, when leaving the corresponding fence of the mall 1, the SOC chip perceives the change of the geofence, and can cancel the display of the service content about the mall 1 in the notification management window. In another possible implementation, it can be displayed all the time until the user A manually triggers the viewing and cancels it. The present embodiment takes the automatic cancellation of the display as an example.

[0090] Continuing to refer to FIG. 1A ​, exemplary, after leaving the fence corresponding to the mall 1, the user A carries the phone in the always-on screen state, such as the always-on screen lock screen, continues to move, the SOC chip perceives the change of the geographical fence where the user A is located, and then after the user A moves to the fence corresponding to the mall 2, the notification management window is popped up on the current interface of the phone in the always-on screen state, such as the always-on screen lock screen, and the relevant services about the mall 2 are displayed in the notification management window, such as FIG. 1A "New store opening of mall 2, various food, entertainment and big discount."

[0091] It should be understood that the above description is only an example for better understanding the technical solutions of the embodiments and is not the only limitation of the embodiments.

[0092] Referring to FIG. 1B , exemplary, when the user A carries the electronic device with the service finding function, such as the phone, to the mall 1. When the carried phone is in the off-screen state (i.e. black screen standby), the SOC chip will enter the sleep state. In this case, the SOC chip will not process the business, that is, it will not perceive the change of the geographical fence where the user A is located. Therefore, when the user A carries the phone in the off-screen state to move to the vicinity of the mall 1, the phone cannot perceive that it has entered the fence corresponding to the mall 1, and therefore will not push the services related to the mall 1. That is, the phone is still in the off-screen state.

[0093] Continuing to refer to FIG. 1B , exemplary, when the user A carries the phone in the always-off screen state from the mall 1 to the vicinity of the mall 2, since the phone is still in the off-screen state, that is, the SOC chip is still in the sleep state. Therefore, when the user A carries the phone in the off-screen state to move to the vicinity of the mall 2, the phone still cannot perceive that it has entered the fence corresponding to the mall 2, and therefore will not push the services related to the mall 2. That is, the phone is still in the off-screen state.

[0094] Exemplary, in a possible implementation, when the user A moves from the mall 1 to the mall 2, the phone screen is turned on, that is, the phone is switched from the off-screen state to the always-on screen state, and then the SOC will exit the sleep state and enter the working state, so that the change of the geographical fence can be perceived, and then after the user A moves to the fence corresponding to the mall 2, the notification management window is popped up on the current interface of the phone in the always-on screen state, such as the always-on screen lock screen, and the relevant services about the mall 2 are displayed in the notification management window, such as FIG. 1A "New store opening of mall 2, various food, entertainment and big discount."

[0095] Therefore, when the electronic device such as a mobile phone with the service finding function is in the bright screen state, the SOC chip can continuously perceive the change of the geographic fence, and then determine the moving position of the user according to the fence information, and push the service related to the current position to the electronic device in the bright screen state. However, after the electronic device enters the dark screen state, the SOC chip will enter the sleep state. In this state, the SOC cannot perceive the change of the geographic fence, and thus will not push the service of the current position to the user.

[0096] That is, the implementation of the service finding function requires that the electronic device currently perceiving the change of the geographic fence by the SOC chip is always in the bright screen state.

[0097] Therefore, the MAC address processing method provided in the embodiments of the present application can still normally perform MAC address matching, storage and updating when the electronic device is in the dark screen state, so that the service finding function can still be normally used when the electronic device is in the dark screen state.

[0098] Specifically, in the MAC address processing method provided in the embodiments of the present application, a small chip (i.e., the electronic device can still normally operate when it is in the dark screen state) with lower power consumption and smaller memory than the SOC chip and which can be online for a long time to process business after the electronic device is started is additionally added (mounted) in the existing electronic device such as a mobile phone with the SOC chip, and then the MAC address matching business completed by the SOC chip is transferred to the small chip. In this way, even if the electronic device is in the dark screen state, the MAC address business can still be normally performed, so that the MAC address processing method can still be normally used when the electronic device is in the dark screen state.

[0099] For the convenience of description, the SOC chip is described as a first chip, and the newly added small chip is described as a second chip.

[0100] Understandably, in order to reduce the hardware cost of the electronic device as much as possible, the performance, memory resource and processing capacity of the second chip can be lower than those of the first chip. For the electronic device with the dual-chip configuration, the first chip can be a main chip, and the second chip can be a vice chip (auxiliary chip).

[0101] In addition, it should be noted that the second chip has low power consumption, and thus has low power consumption occupation when it is set to be online for a long time to process business after the electronic device is started.

[0102] The hardware structure of the electronic device with the dual-chip configuration suitable for the MAC address processing method provided in the embodiments of the present application can be as shown in FIG. 2 .

[0103] The electronic device with the first chip and the second chip can be a mobile phone, a tablet computer, a smart wearable device, or the like, which are not listed one by one herein and are not limited in the present application. The following takes the mobile phone as an example to illustrate the scheme.

[0104] Referring to FIG. 2 For example, the electronic device 100 can 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 key 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, and the like.

[0105] The first chip 110 (SOC chip) can include one or more processors, such as an application processor (AP), a Modem, a graphics processing unit (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), and the like, which are not listed one by one herein and are not limited in the present application.

[0106] The second chip can include one or more processors. The processors can be the same as or similar to the processors included in the first chip, which are not limited in the present application.

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

[0108] It should be understood that the above description is merely an example provided to better understand the technical solution of this embodiment, and is not intended as the only limitation on this embodiment.

[0109] Furthermore, it should be understood that since the first chip 110 and the second chip 111 can handle 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] The interfaces may include inter-integrated circuit (I2C) interfaces, inter-integrated circuit sound (I2S) interfaces, pulse code modulation (PCM) interfaces, universal asynchronous receiver / transmitter (UART) interfaces, mobile industry processor interfaces (MIPI), general-purpose input / output (GPIO) interfaces, subscriber identity module (SIM) interfaces, universal serial bus (USB) interfaces, etc., and will not be listed here, nor is this application limiting in this regard. That is, the first chip 110 and the second chip 111 can connect to other devices in the electronic device, such as external memory, internal memory, audio modules, sensor modules, cameras, indicators, motors, buttons, displays, mobile communication modules, and wireless communication modules, through the above interfaces.

[0111] For ease of explanation, this application embodiment uses the example of a second chip primarily handling MAC address processing. Since MAC address processing relies on geofencing, and determining a cell fence requires the participation of a mobile communication module (mobile network or cellular network), while determining a Wi-Fi fence requires the participation of a wireless communication module (WLAN), the second chip needs to establish communication connections with the mobile communication module 150 and the wireless communication module 160. FIG. 2 As shown.

[0112] It should be further noted that the first chip 110 and the second chip 111 can also be provided with a memory, i.e., the first chip 110 and the second chip 111 can include the so-called internal memory to store instructions and data. In the embodiment, the internal memory of the second chip 111 is smaller than that of the first chip 110.

[0113] It should be further noted that, 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 internal memory of the second chip 110.

[0114] As to the memory provided in the first chip 110 and the second chip 111, in some possible implementation manners, it can be a cache memory. The memory in the first chip 110 can store instructions or data that have just been used or recycled by the first chip 110; the memory in the second chip 111 can store instructions or data that have just been used or recycled by the second chip 111. In this way, if the first chip 110 or the second chip 111 needs to use the used instructions or data again, it can directly call 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 implementation manners, the first chip 110 and the second chip 111 can be backup chips for each other, and therefore can interact data with each other. Therefore, as shown in FIG. 2 , the first chip 110 and the second chip 111 can establish a communication connection through an interface.

[0116] Continuing to refer to FIG. 2 , the external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to realize the expansion of 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 realize the data storage function. For example, files such as music and video are saved in the external memory card. For example, in another possible implementation manner, the external memory interface 102 can also communicate with the second chip 111.

[0117] Continuing to refer to FIG. 2 , the internal memory 121 can be used to store computer executable program codes, and the executable program codes include instructions. Understandably, the executable program codes can include those of the first chip 110, and can also include 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 instructions stored in the internal memory 121. For example, by executing the program instructions corresponding to the MAC address processing method provided in this application embodiment, the second chip 111 can enable the electronic device to perform MAC address matching, storage, and updating processes, thereby determining the current location information of the electronic device and recommending services suitable for the user's location information based on the service-finding function.

[0119] The internal memory 121 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a given function (such as sound playback, image playback, and program instructions for the MAC address processing method described in this embodiment), 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 database in the second chip 111 memory), etc.

[0120] Understandably, in practical applications, internal memory 121 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc.

[0121] See also FIG. 2 The charging management module 140 receives 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 receives charging input from the wired charger via the USB interface 130. In some wireless charging implementations, the charging management module 140 receives wireless charging input via the wireless charging coil of the electronic device 100. While charging the battery 142, the charging management module 140 can also supply power to the electronic device via the power management module 141.

[0122] See also FIG. 2 The power management module 141 is used to connect to the battery 142, and the charging management module 140 is connected to the first chip 110, and can also be connected to the second chip. FIG. 2 (For illustration purposes only). 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 count, and battery health status (leakage current, impedance).

[0123] See also FIG. 2The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor, and the baseband processor, etc. Among them, the antenna 1 and the antenna 2 are used to transmit and receive electromagnetic wave signals.

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

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

[0126] In addition, as for the fingerprint information in the fingerprint library downloaded to the local and loaded to the corresponding memory by the second chip 111, it can be obtained from the corresponding server through the mobile communication module 150, i.e. the mobile network or the cellular network. It can 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 only an example for better understanding the technical solution of the embodiments and is not the only limitation of the embodiments.

[0128] Continuing to refer to FIG. 2 The audio module 170 can include a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, etc.

[0129] Continuing to refer to FIG. 2The sensor module 180 can include a pressure sensor, a gyro sensor, a barometric 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, and the like, which are not listed one by one here, and the present application does not limit this.

[0130] Continuing to refer to FIG. 2 The keys 190 include a power key, a volume key, and the like. The keys 190 can be mechanical keys. They can also be touch keys. The electronic device 100 can receive key inputs and generate key signal inputs related to 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 also for touch vibration feedback. The indicator 192 can be an indicator light and can be used to indicate a charging state, a power change, and also to indicate a message, a missed call, a notification, and the like.

[0131] Continuing to refer to FIG. 2 The camera 193 is used to capture still images or videos. In some implementations, the electronic device 100 can include one or N cameras 193, N being a positive integer greater than 1.

[0132] Continuing to refer to FIG. 2 The display screen 194 is used to display images, videos, and the like. The display screen 194 includes a display panel. In some implementations, the electronic device 100 can include one or N display screens 194, N being a positive integer greater than 1.

[0133] As to the hardware structure of the electronic device 100, it should be understood that FIG. 3 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 specific implementations, the electronic device 100 can have more or fewer components than those shown in the figure, can combine two or more components, or can have a different component configuration.

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

[0135] Thus, based on the electronic device with the hardware structure shown in FIG. 3 The second chip can always be online, so that the processing business of the MAC address can still be normally performed when the electronic device is in the screen-out state, thereby ensuring the normal use of the service finding function. For example FIG. 3As shown, when user A carries the electronic device with the service finding function, such as a mobile phone, to move to the mall 1. When the carried mobile phone is in the off-screen state (i.e. black screen standby), the first chip will enter the sleep state, but the second chip is still in the working state (non-sleep state). Since the MAC address processing business has been transferred to the second chip processing, in this case, the second chip will perceive the change of the geographic fence where user A is located. Therefore, when user A carries the mobile phone in the off-screen state to move to the vicinity of the mall 1, the mobile phone perceives that it has entered the fence corresponding to the mall 1, so it will automatically light up the screen, that is, switch the mobile phone from the off-screen state to the on-screen state, and push the services related to the mall 1, such as FIG. 3 The content "Mall 1 has a special offer today, 7 off for all daily necessities" is displayed in the interface after lighting up, such as the notification management window of the on-screen lock screen.

[0136] Continuing to refer to FIG. 2 , for example, user A carries the mobile phone in the on-screen state or the off-screen state to continue moving. In one possible implementation, when leaving the fence corresponding to the mall 1, the second chip will perceive the change of the geographic fence, regardless of the current screen state, that is, the on-screen state or the off-screen state. At this time, the service content about the mall 1 displayed in the notification management window can be cancelled. In another possible implementation, it can be displayed all the time until it is cancelled after user A manually triggers to view. The present embodiment takes the automatic cancellation of display as an example.

[0137] For example, after user A leaves the fence corresponding to the mall 1, if there is no operation on the mobile phone, in one possible implementation, the mobile phone can re-enter the off-screen state.

[0138] For example, user A carries the mobile phone in the off-screen state to continue moving, and the second chip perceives the change of the geographic fence where user A is located. After user A moves to the fence corresponding to the mall 2, the second chip automatically lights up the screen, that is, switches the mobile phone from the off-screen state to the on-screen state, and pushes the services related to the mall 2, such as FIG. 4A The content "Mall 2 opens a new store, various food and entertainment with big discounts" is displayed in the interface after lighting up, such as the notification management window of the on-screen lock screen.

[0139] It should be understood that the above description is only an example for better understanding the technical solution of the present embodiment, and is not the only limitation of the present embodiment.

[0140] In the following, with specific embodiments, the technical solution of the present application (applicable to FIG. 4B the processing method of the MAC address of the electronic device shown in the hardware structure), and how the technical solution of the present application solves the above technical problems are described in detail.

[0141] Before the MAC address processing method provided by the embodiments of the present application is specifically described, the software structure of the electronic device to which the embodiments of the present application are applicable, i.e., the architecture that can be adopted, is first described.

[0142] Specifically, in actual applications, the software system of the electronic device can adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture. The software system used by the electronic device includes but is not limited to a Windows system, an Android system, and an iOS system. For ease of illustration, the embodiments of the present application take the Android system with a layered architecture as an example to exemplarily illustrate the software structure of the electronic device.

[0143] In addition, it should be understood that the MAC address processing scheme provided by the embodiments of the present application can also be applicable to other systems in specific implementation.

[0144] Referring to FIG. 4A and FIG. 4A , the software layered architecture of the electronic device and the software structure block diagram of the electronic device based on the layered architecture are exemplarily shown.

[0145] As shown in FIG. 4B , the layered architecture of the electronic device divides the software into several layers, each layer has 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, the application layer (Applications, APP), the application framework layer (Application Framework, FWK), the system resident service layer (Native layer), the hardware abstraction layer (hardware abstraction layer, HAL), and the kernel layer (Linux Kernel, hereinafter referred to as: Kernel).

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

[0147] The APP layer can include a series of application packages, such as applications implemented based on a service platform, applications provided by an electronic device manufacturer, or third-party applications, that is, applications that can access various capabilities supported by the electronic device. The FWK layer provides application programming interfaces (APIs) and programming frameworks for the applications in the APP layer. In some implementations, the programming interfaces and programming frameworks can be described as functions. The Native layer provides some native services and commonly used system libraries. The HAL is used to encapsulate hardware drivers and provide a unified interface to the upper-layer 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 above layered architecture can be deployed in both the first chip and the second chip. The embodiment takes the second chip as an example to describe the content included in the layered architecture of the operating system of the second chip.

[0149] As to FIG. 4B The specific content included in the layered architecture of the electronic device shown in FIG. 1 can be as shown in FIG. 2 in a possible implementation. FIG. 4B

[0150] Referring to FIG. 1A , for example, the application packages included in the APP layer can include video, settings, W;AN, camera, map, music, and the like.

[0151] It should be understood that the above description is only an example for better understanding the technical solution of the embodiment and is not the only limitation of the embodiment. In actual applications, the APP layer can include more or fewer applications, which is not limited in the present application.

[0152] Continuing to refer to FIG. 4B , for example, the APIs and programming frameworks provided by the FWK layer for the applications in the APP layer can include, for example, a location service, a resource manager, a notification manager, a view system, a phone manager, and the like.

[0153] The location service, also known as a positioning service, is a value-added service provided by a combination of a mobile communication network and a satellite positioning system. The location information (such as longitude and latitude coordinate data) of an electronic device is obtained through a set of positioning technologies and provided to the mobile user himself or others and the communication system to implement various location-related services. In the present embodiment, the actual position of the electronic device can be determined based on the determined fence information, and the location service can be implemented.

[0154] ​The resource manager provides various resources for the application, such as localized strings, icons, pictures, layout files, video files, and the like, which are not listed one by one here, and the present application does not make any limitation thereto.

[0155] The notification manager enables the application to display notification information in the status bar, which can be used to convey a message of the notification type and can automatically disappear after a short stay without user interaction. For example, the notification manager is used to notify that a certain geographic fence is entered, and is used to display services recommended by the service-based people finding function for the user at the current location, such as FIG. 4B The content displayed in the notification management window.

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

[0157] The phone manager is used to provide the communication function of the electronic device 100. For example, the management of the call state (including connection, hang-up, and the like).

[0158] It should be understood that the above description is only an example for better understanding the technical solutions of the embodiments and is not the only limitation of the embodiments. In actual applications, other APIs and programming frameworks can also be included in the FWK layer, such as a window manager, a content provider, and the like, which are not listed one by one here, and the present application does not make any limitation thereto.

[0159] Continuing to refer to FIG. 4B , the native layer provides native services and commonly used system libraries, such as the Android Runtime and system libraries.

[0160] The Android Runtime includes a core library and a virtual machine. The Android Runtime is responsible for the scheduling and management of the Android system. The core library includes two parts: one part is the function function called by the java language, and the other part is the core library of Android. The APP layer and the FWK layer run in the virtual machine. The virtual machine executes the java files of the APP layer and the FWK layer into binary files. The virtual machine is used to perform the management of the object life cycle, the management of the stack, the management of the thread, the management of the security and the exception, and the garbage collection, and the like.

[0161] The system library can include a plurality of function modules. For example, a surface manager, media libraries, a three-dimensional (3D) graphics processing library (for example, OpenGL ES), a two-dimensional (2D) graphics engine (for example, SGL), and the like. The surface manager is used to manage a display subsystem and provides a fusion of 2D and 3D layers for a plurality of application programs. The media libraries support a plurality of commonly used audio, video format playing and recording, and static image files, and the like. The media libraries can support a plurality of audio and video coding formats, for example, MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, and the like. The three-dimensional graphics processing library is used to implement three-dimensional graphics drawing, image rendering, synthesis, and layer processing, and the like.

[0162] In addition, it should be noted that the 2D graphics engine described 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 the embodiment and is not the only limitation of the embodiment. In actual application, the Native layer can include more or fewer service / function modules, and the present application does not limit this.

[0164] Continuing to refer to FIG. 4C For example, the HAL layer encapsulates hardware drivers, provides a unified interface to the upper layer framework, for example, can include a camera abstraction layer (interface) for a camera driver, a positioning abstraction layer for GPS, WiFi, and the like.

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

[0166] Continuing to refer to FIG. 4A For example, the hardware drivers included in the Kernel layer are, for example, GPS drivers, display drivers, WiFi drivers, and the like.

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

[0168] It should be noted that the MAC address processing method provided by the embodiments of the present application can include matching of the MAC address, specifically matching of the BSSID, and storage and updating of the MAC address. Based on this, in some possible implementation manners, the MAC address processing module can be functioned as a MAC address matching sub-module, a MAC address storage sub-module, and a MAC address updating sub-module, as shown in FIG. 8. FIG. 4B

[0169] Exemplarily, in another possible implementation manner, the functions of storage and updating of the MAC address can be integrated into one functional module, that is, the MAC address processing module can be functioned as a MAC address matching sub-module and a MAC address storage and updating sub-module.

[0170] Exemplarily, in another possible implementation manner, the matching, storage and updating of the MAC address can be integrated in one functional module, that is, all implemented by the MAC address processing module without internal functional distinction.

[0171] It should be understood that the above description is only an example for better understanding the technical solution of the embodiments of the present application, and is not the only limitation of the embodiments of the present application. In actual application, the Kernel layer can include more or less hardware drivers, and the present application does not limit this.

[0172] As for the software structure of the electronic device, it can be understood that, FIG. 4B and FIG. 5A to FIG. 5C the layers and the components contained in each layer in the software structure shown do not constitute a specific limitation of the electronic device. In specific implementation, the electronic device can include more or less layers than shown, and each layer can include more or less components, and the present application does not limit this.

[0173] Based on the software structure of the electronic device shown in FIG. 5A , the MAC address processing method provided by the embodiments of the present application will be described below in combination with specific embodiments.

[0174] It can be understood that the following specific embodiments can be implemented independently or in combination. For the same or similar concepts or processes, they can not be described again in some embodiments.

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

[0176] Before the MAC address processing method provided by the embodiments of the present application is described, the focus of the MAC address processing method provided by the embodiments 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 influence on whether the service can be timely pushed.

[0178] The storage and updating of the MAC address will both operate the memory of the second chip. Since the memory of the second chip is small, it is better that the storage and updating of the MAC address occupy less memory. For this, a reasonable way is needed to store the fence information, such as the fingerprint information.

[0179] In addition, part of the fingerprint library fence information needs to be updated, and a large number of memory fragments may be generated after the old information is deleted during the updating process. Since the total memory capacity occupied by the fingerprint library is fixed, new fence information cannot be downloaded into the fingerprint library of the second chip.

[0180] Based on the consideration of processing speed and memory, the MAC address processing method provided by the embodiments of the present application can be divided into a MAC address matching link and a MAC address storage and updating link.

[0181] As can be known from the above description, the BSSID can uniquely identify the scanned wireless access point, similar to the MAC address. Therefore, in the MAC address matching link in the embodiments, the specific processing is the matching of the BSSID.

[0182] In addition, as can be known from the above description, the fingerprint information of each wireless access point includes the BSSID and the corresponding RSSI. Therefore, in the MAC address storage and updating link in the embodiments, the specific processing is the storage and updating of the BSSID and the corresponding RSSI.

[0183] The MAC address storage and updating link and the MAC address matching link in the MAC address processing method provided by the embodiments of the present application will be specifically described below in combination with the drawings.

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

[0185] (1) Storage of MAC address

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

[0187] For example, in a large area, there are usually 1 to multiple cell fences, such as cell fence_1 to cell fence_11 shown in FIG. 1. FIG. 5A ​​

[0188] As can be understood, for multiple cell fences in the same area, there can be overlapping areas (as shown in FIG. 5B illustrated) or no overlapping areas.

[0189] For each cell fence, there can be 1 to multiple wifi fences. For example, as shown in FIG. 5B cell fence_1, in one possible implementation, cell fence_1 can include, for example, wifi fence_1, wifi fence_2, wifi fence_3, wifi fence_4, and wifi fence_5, as shown in FIG. 5B

[0190] As can be understood, for multiple wifi fences in the same cell fence, there can be overlapping areas (as shown in FIG. 5C illustrated) or no overlapping areas.

[0191] For each wifi fence, there can be 1 to multiple wireless access points. For example, as shown in FIG. 5C wifi fence_1, in one possible implementation, wifi fence_1 can include, for example, wireless access point 1, wireless access point 2, wireless access point 3, wireless access point 4, and wireless access point 5, as shown in FIG. 5A to FIG. 5C

[0192] For each wireless access point, there is a set of fingerprint information, i.e., BSSID and RSSI. For example, as shown in FIG. 5A to FIG. 5C wireless access point 1 corresponds to BSSID_1 and RSSI_1, wireless access point 2 corresponds to BSSID_2 and RSSI_2, wireless access point 3 corresponds to BSSID_3 and RSSI_3, wireless access point 4 corresponds to BSSID_4 and RSSI_4, and wireless access point 5 corresponds to BSSID_5 and RSSI_5.

[0193] As can be understood, the above description is only an example for better understanding the technical solution of the embodiment and is not the only limitation of the embodiment.

[0194] As can be understood, 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 similar to FIG. 6 illustrated.

[0195] According to FIG. 6 illustrated, the relationship between the fence and the fingerprint information can be determined as​​FIG. 6 As shown.

[0196] Referring to FIG. 6 Exemplarily, for any cell fence, such as cell fence_1 to cell fence_m, each can include multiple 1 to multiple wifi fences, for example 1 to n1 or n2.

[0197] Continuing to refer to FIG. 7 Exemplarily, for each wifi fence in each cell fence, it can include 1 to multiple wireless access points, for example FIG. 7 N1, N2, M1, M2, P1, P2 shown in

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

[0199] In addition, it should be noted that in actual application, the values of m, n1, n2, N1, N2, M1, M2, P1, P2 can be the same or different.

[0200] Considering that a region can include 1 to multiple cell fences, each cell fence can include 1 to multiple wifi fences, and each wifi fence can include 1 to multiple wireless access points. If the ID corresponding to the cell fence and the ID corresponding to the wifi fence are directly divided, and then the BSSID and the corresponding RSSI are stored in the order of the size of the BSSID of the wireless access point, when the subsequent matching of the MAC address is matched in the fingerprint library of the second chip based on the commonly used sequential matching method and the dichotomy matching method, the time consumption will be relatively long, which is not conducive to the subsequent determination of the fence, and can cause the service push to be not timely. 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 updating link of the MAC address, the HASH algorithm is used to classify the BSSID included in each wifi fence in the fingerprint library, and then the BSSID is stored according to the HASH classification value.

[0201] In addition, it should be noted that for the BSSID stored in each HASH classification value, the BSSIDs are sequentially sorted according to the size of their values. At the same time, in order to facilitate the MAC address matching link, the second chip can search in the storage area corresponding to the HASH classification value, the number of BSSIDs corresponding to each HASH classification value is also recorded.

[0202] Specifically, the first 3 bytes of a general MAC address (BSSID) are used to represent the manufacturer of the network card, and the last 3 bytes are used to represent the device number. That is, the first 3 bytes of the BSSID are manufacturer-related information, and the last 3 bytes are random information. In order to enable the BSSID values in the fingerprint library corresponding to the second chip to be uniformly distributed, in one possible implementation, for each BSSID, the hash classification value (which can also be referred to as a classification serial number or a category) can be determined according to the calculation manner of the hash classification value shown in the following formula. FIG. 7

[0203] Referring to FIG. 7 , for example, taking the 16-bit BSSID "54:2b:de:a0:d6:c4" as an example. In the process of calculating the hash classification value by using the hash algorithm for this BSSID, the first 3 bytes "54:2b:de" and the last 3 bytes "a0:d6:c4" can be first subjected to XOR processing, and then the result (102 in hexadecimal) of the XOR processing is added to the decimal numbers corresponding to the last 3 bytes respectively.

[0204] Referring to FIG. 8 , 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; and for "c4" in the last 3 bytes, the corresponding decimal number is 196.

[0205] Continuing to refer to FIG. 8 , for example, after the addition processing of the result of the XOR processing and the decimal numbers corresponding to the last 3 bytes respectively, 812 is obtained, and then the remainder processing is performed according to the preset classification number. For example, taking the classification number 8 as an example, the result 4 obtained by 812%8 is the hash classification value corresponding to this BSSID.

[0206] It should be noted that the classification number 8 is selected in the embodiment, which is considered that the algorithm hardens the division, and only 3 bits are right shifted to divide 8, which consumes less time. However, in actual application, other numerical values can be selected as the classification number according to business requirements, and the present application does not limit this.

[0207] For ease of illustration, the classification number 8 is taken as an example in the embodiment. In this way, the final classification result, i.e., the obtained hash classification value, has 8 kinds of 0 to 7.

[0208] It should be understood that the above description is only an example for better understanding the technical solution of the embodiment and is not the only limitation of the embodiment. ​

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

[0210] For ease of explanation, let's take the Wi-Fi fence_1 within cell fence_1 of the fingerprint database, which includes N wireless access points, as an example. The BSSIDs corresponding to these N wireless access points are as follows: FIG. 8 The following explanation is provided (shown in part).

[0211] See FIG. 7 For example, targeting FIG. 8 Each BSSID shown is based on FIG. 9 The hash classification value is calculated as shown. After hash classification, a hash classification value for each BSSID can be obtained. During storage, starting with hash classification value 0 (i.e., category 0), BSSIDs with hash classification value 0 are stored in the fingerprint database in ascending order.

[0212] See also FIG. 9 For example, after storing the BSSIDs with hash classification value 0, the BSSIDs with hash classification value 1 can be stored in ascending order. This process continues until all the BSSIDs corresponding to all wireless access points in Wi-Fi fence_1 are stored in the fingerprint database.

[0213] Furthermore, it should be noted that in practical applications, the geofence sensed by an electronic device at a given moment may include multiple cell fences, and each cell fence may contain multiple Wi-Fi fences, and each Wi-Fi fence may contain multiple wireless access points. In this case, when storing BSSIDs in the fingerprint database, they can be distinguished by cell fence ID and Wi-Fi fence ID. Then, under the corresponding Wi-Fi fence, BSSIDs can be stored according to their hash classification values, i.e., sorted sequentially by their numerical values, while simultaneously recording the number of BSSIDs corresponding to each hash classification value.

[0214] For example, the number of BSSIDs corresponding to each hash classification value included in a certain wifi fence is as follows: the hash classification value is 0 (category 0), the number of BSSIDs is 4; the hash classification value is 1 (category 1), the number of BSSIDs is 4; the hash classification value is 2 (category 2), the number of BSSIDs is 8; the hash classification value is 3 (category 3), the number of BSSIDs is 2; the hash classification value is 4 (category 4), the number of BSSIDs is 3; the hash classification value is 5 (category 5), the number of BSSIDs is 5; the hash classification value is 6 (category 6), the number of BSSIDs is 6; and the hash classification value is 7 (category 7), the number of BSSIDs is 7. In a possible implementation, the number of BSSIDs corresponding to each hash classification value included in the wifi fence recorded in the record table can be the total number of the first n categories, which can be as shown in the following table. FIG. 10

[0215] Referring to FIG. 10 , in the record table, the first record can be the total number of BSSIDs included in category 0, that is, 4. The second record is the total number of BSSIDs included in category 0 and category 1, that is, 8. The third record is the total number of BSSIDs included in category 0, category 1 and category 2, that is, 16. The fourth record is the total number of BSSIDs included in category 0, category 1, category 2 and category 3, that is, 18. The fifth record is the total number of BSSIDs included in category 0, category 1, category 2, category 3 and category 4, that is, 21. The sixth record is 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 record is 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 record is the total number of BSSIDs included in category 0, category 1, category 2, category 3, category 4, category 5, category 6 and category 7, that is, 38.

[0216] It should be understood that the above description is only an example for better understanding the technical solution of the embodiment, and is not the only limitation of the embodiment.

[0217] Referring to FIG. 10 , for example, in a possible implementation, for a certain memory region in the fingerprint library, the ID of the cell fence can be recorded in the memory region corresponding to the starting address, for example, "C1" shown in FIG. 9 , and the ID of the first wifi fence of the cell fence with the ID "C1" can be recorded in the memory region corresponding to the next address following the address, for example, "C1" shown in FIG. 10 ​"11". After that, the BSSIDs of the wireless access points under the wifi fence with the ID of "11" are recorded in the next memory area of the memory area with the address of "11" in the order of the hash classification values from 0 to 7.

[0218] For example, the number of the BSSIDs corresponding to the hash classification values included in a certain wifi fence is recorded in the next four memory areas of the memory area with the address of "11". The BSSIDs of the four different wireless access points with the hash classification value of 0 are recorded in the order from small to large. FIG. 10 Continuing to refer to

[0219] , for example, the BSSIDs of the four different wireless access points with the hash classification value of 1 are recorded in the next four memory areas of the BSSIDs of the last hash classification value of 0 in the order from small to large. FIG. 10 Continuing to refer to

[0220] , for example, after the BSSIDs of the hash classification value of 7 are recorded in the order as described above, the RSSIs corresponding to the BSSIDs stored in the memory areas with the hash classification values of 0 to 7 are recorded in the next memory areas in the order of the RSSIs. FIG. 10 Continuing to refer to

[0221] , for example, after the BSSIDs and the corresponding RSSIs of all the wireless access points under the wifi fence with the ID of "11" are recorded in the fingerprint database in the order, the ID of the second wifi fence under the cell fence with the ID of "C1", such as "12", is recorded in the same way. The BSSIDs and the corresponding RSSIs of all the wireless access points under the wifi fence with the ID of "12" are recorded in the next memory areas of the memory area with the address of "12" in the order of the hash classification values. FIG. 11 Continuing to refer to

[0222] , for example, after the BSSIDs and the RSSIs of all the wireless access points in all the wifi fences under the cell fence with the ID of "C1" are recorded in the fingerprint database in the above-mentioned way, the BSSIDs and the 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 the corresponding RSSIs of the wireless access points in the wifi fence with the ID of "21" under the cell fence with the ID of "C2" are recorded. FIG. 11 It should be understood that the above description is only an example for better understanding the technical solution of the embodiment and is not the only limitation of the embodiment.

[0223] It should be understood that the above description is only an example for better understanding the technical solution of the embodiment and is not the only limitation of the embodiment.

[0224] Thus, the fingerprint information of the wireless access points in various fences is downloaded and stored into the fingerprint library of the second chip, so that in the process of moving of the user carrying the electronic device, the matched fingerprint information can be found in the fingerprint library according to the currently scanned wireless access point fingerprint information of the electronic device, and then the target position of the user is determined based on the fence algorithm, and the push of the service is realized.

[0225] In addition, based on the above, the hash classification value of each BSSID is determined by using the hash algorithm first, and then the hash classification value is divided, and then stored in the order from small to large under each hash classification value. Subsequently, in the MAC address matching link, the hash classification value of each BSSID scanned currently is calculated according to the hash algorithm first, and then the corresponding hash classification value in the fingerprint library is searched, so that the BSSID under other hash classification values is directly filtered out, the data matching amount is greatly reduced, and the MAC address matching can be faster, that is, the time consumption of the matching link is shortened. The MAC address matching process will be described in detail in the following MAC address matching link, which will not be described here.

[0226] (2) Update of MAC address

[0227] It should be noted that in actual application, the storage of the MAC address can also have the following problems in the update scene. For example, in the case of insufficient memory in the fingerprint library, storage and update can involve merging of multiple memory fragments in the fingerprint library, and data moving. If the conventional merging method is used, that is, the memory fragments are merged in order of address size, the data will be moved multiple times due to the improper selection of the memory fragments to be merged, and the copy overhead will be increased.

[0228] For ease of illustration, the MAC address update process is used to specifically illustrate the merging method of the memory fragments in the MAC address processing scheme provided by the embodiments of the present application.

[0229] Referring to FIG. 11 , for example, before the old fingerprint information is deleted, the memory status of the fingerprint library is, for example, only one free memory block, such as memory block 0.

[0230] Referring to FIG. 11 , for example, in a possible implementation, for example, at A, the fingerprint information of the A region downloaded by the user's mobile phone through the network includes the BSSID and the corresponding RSSI of the wireless access point in each wifi fence of the eight cell fences of cell 1 to cell 8. These fingerprint information are recorded in the corresponding fingerprint library of the second chip, for example FIG. 12The memory blocks in the 8 black shadows shown in FIG. 1. When the user moves to B, the phone can automatically delete the fingerprint information under the cell fences of cell 1 to cell 5 not involved in B, and download the fingerprint information under the new cell fences, such as the BSSID and corresponding RSSI of the wireless access point under each of the 84 cell fences of cell 9 to cell 12. In this case, the old fingerprint information is deleted and the new fingerprint information is stored. When the old fingerprint information is deleted, memory fragmentation occurs, and if not handled in time, it will cause insufficient memory to store new fingerprint information after a long time.

[0231] Continuing to refer to FIG. 12 The fingerprint information in the three memory blocks with labels 1, 2 and 3 needs to be deleted. After deleting the fingerprint information in the three memory blocks, four idle memory blocks (also referred to as memory fragments) of memory block 0, memory block 1, memory block 2 and memory block 3 will appear in the fingerprint library. 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 appearing memory fragment will be determined according to the address order from left to right (from left to right, the left address is small and the right address is large), whether it meets the memory allocation requirements of the new fingerprint information. If it meets, it is directly allocated. If it does not meet, the memory fragments will be merged, specifically the memory fragment will be merged with the next memory fragment appearing behind it. 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 is directly allocated, if it does not meet, it continues to merge in the above manner until the merging meets the current memory allocation requirements (the size of the merged memory space is greater than or equal to the memory size required by the new fingerprint message). However, since in the process of merging memory fragments, the data between the two memory fragments, such as old fingerprint data, needs to be moved each time, which leads to multiple data movements in the whole process, thereby increasing the copy overhead.

[0232] For ease of illustration, the following combines FIG. 12 The conventional memory fragment processing method is described.

[0233] Referring to FIG. 12, exemplary, after the old fingerprint data is deleted, the free memory blocks (memory fragments) in the fingerprint library, i.e. the memory fragments that can write data, include memory fragment 0, memory fragment 1, memory fragment 2 and memory fragment 3 (in the order of address size, the order of the four memory blocks is: memory fragment 1, memory fragment 2, memory fragment 3 and memory fragment 0), if the conventional memory fragment processing method, it will first judge whether the memory fragment 1 meets the need of writing the new fingerprint information newly added to the fingerprint library to the memory, that is, whether the memory size of the memory block 1 is greater than or equal to the memory size required by the new fingerprint information.

[0234] Continuing to refer to FIG. 12 , exemplary, when the memory fragment 1 is insufficient in space, i.e. unable to write new fingerprint information, the memory fragment 1 and the memory fragment 2 will be merged.

[0235] Continuing to refer to FIG. 12 , exemplary, since there is old data 1 between the memory fragment 1 and the memory fragment 2, it is necessary to move the data 1 in front of the memory fragment 1 before the memory fragment 1 and the memory fragment 2 can be merged. Thus, the first data movement occurs.

[0236] Continuing to refer to FIG. 12 , exemplary, after the data 1 is moved and the memory fragment 1 and the memory fragment 2 are merged, it will be judged 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] Continuing to refer to FIG. 12 , exemplary, when the memory fragment 1-2 is insufficient in space, i.e. unable to write new fingerprint information, the memory fragment 1-2 and the memory fragment 3 will be merged.

[0238] Continuing to refer to FIG. 12 , exemplary, since there are old data 2 and data 3 between the memory fragment 1-2 and the memory fragment 3, it is necessary to move the data 2 and the data 3 in front of the memory fragment 1-2 in turn before the memory fragment 1-2 and the memory fragment 3 can be merged. Thus, the second data movement (for data 2) and the third data movement (for data 3) occur.

[0239] Continuing to refer to FIG. 11 , exemplary, after the data 3 is moved and the memory fragment 1-2 and the memory fragment 3 are merged, it will be judged again whether the memory size of the merged memory fragment 1-3 is greater than or equal to the memory size required by the new fingerprint information.

[0240] Continuing to refer to FIG. 13AFor example, the memory size of the memory fragments 1-3 is greater than the memory size required by the new fingerprint information, and the new fingerprint information can be written into the memory fragments 1-3. In this way, the writing of the new fingerprint data is realized, but 3 times of data migration occurs in the process, the data migration amount is large, and therefore the time cost is large. If the MAC address matching occurs at this time, in a possible implementation manner, the matching can fail because the new fingerprint information is not written in time in the fingerprint library. In another possible implementation manner, if the matching processing waits for the fingerprint library to be updated before being performed, the progress of subsequent processing is affected, and the service cannot be pushed in time.

[0241] In addition, a large amount of data migration processing also increases the burden of the second chip and affects the processing speed of the second chip on other services.

[0242] In view of the above problems, the MAC address processing method provided in the application increases the data migration copy cost on the basis of the existing memory fragment merging manner, and then merges the memory fragments by selecting the memory fragment combination manner with the minimum cost, so as to greatly reduce the time cost caused by data migration.

[0243] Still taking the deletion of the old fingerprint information in the fingerprint library shown in FIG. 13B as an example, the memory fragments in the fingerprint library are the memory fragment 1, the memory fragment 2, the memory fragment 3 and the memory fragment 0. When the operation of writing the new fingerprint information in the new fingerprint library occurs, for the four memory fragments, the determined memory fragment combination can be, for example, the 14 combinations shown in FIG. 11 .

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

[0245] In combination with FIG. 13B and FIG. 13CAs shown, memory fragment combination 5 needs to move data 1 to data 4 between memory fragment 1 and memory fragment 0, so as to be combined into memory fragment combination 5, that is, 4 times of data moving is needed. Memory fragment combination 6 needs to move data 2 to data 4 between memory fragment 2 and memory fragment 0, so as to be combined into memory fragment combination 6, that is, 3 times of data moving is needed. Memory fragment combination 7 needs to move data 4 between memory fragment 3 and memory fragment 0, so as to be combined into memory fragment combination 7, that is, 1 time of data moving is needed. Memory fragment combination 11 needs to move data 1 to data 4 between memory fragment 1, memory fragment 2 and memory fragment 0, so as to be combined into memory fragment combination 11, that is, 4 times of data moving is needed. Memory fragment combination 12 needs to move data 1 to data 4 between memory fragment 1, memory fragment 3 and memory fragment 0, so as to be combined into memory fragment combination 12, that is, 4 times of data moving is needed. Memory fragment combination 13 needs to move data 1 to data 3 between memory fragment 1, memory fragment 2 and memory fragment 3, so as to be combined into memory fragment combination 13, that is, 3 times of data moving is needed. 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, so as to be combined into memory fragment combination 14, that is, 4 times of data moving is needed.

[0246] Therefore, it can be seen that, FIG. 5C The combination of memory fragments 7 shown in the figure consumes the least copying when data moving is performed. Therefore, when new fingerprint information is written into the fingerprint library of the second chip, memory fragment 0 and memory fragment 3 can be directly combined as shown, and this process only needs to move data 4, that is, 1 time of data moving is needed. Then, the new fingerprint information can be written into the combined memory fragment 3-0. FIG. 5C

[0247] It should be understood that the above description is only an example for better understanding the technical solutions of the embodiments and is not the only limitation of the embodiments.

[0248] Therefore, based on the processing manner provided by the embodiments of the present application, the data copying time can be greatly reduced, and the new fingerprint information can be written into the fingerprint library of the second chip in time, which facilitates the subsequent MAC address matching processing.

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

[0250] For example, a user carries a mobile phone with a double-chip (first chip + second chip) configuration with a service finding function into a FIG. 14 For example, as shown in the figure, the wifi fence_1. In this fence, the fingerprint information of the wireless access point scanned by the mobile phone can include​FIG. 15 The fingerprint information of the five wireless access points 1-5 shown in FIG. 1.

[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] Understandably, through the above description of the storage and updating links of the MAC addresses, it can be known that in the storage process of the fingerprint information, the fingerprint information is classified by the hash classification values, and then sorted in ascending order under the corresponding hash classification values. Therefore, after the fingerprint information is scanned, each BSSID scanned can be processed by the same hash algorithm to determine the hash classification value corresponding to each BSSID. Then, the sequential matching method or the binary matching method is used to search in the BSSIDs managed by the corresponding hash classification value, so as to speed up the matching process and shorten the matching time of the MAC addresses in the case of ensuring that the comparison times are roughly equal, and to determine the fence in time and push the service.

[0253] Based on the description of the above embodiments, the processing method of the MAC address provided by the application can have a processing flow as shown in FIG. 14 or FIG. 2 in the actual implementation process.

[0254] Referring to FIG. 7 , an exemplary flowchart of a MAC address processing method is shown. In this embodiment, the MAC address processing method can include:

[0255] 101. 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 wireless access point includes the BSSID and RSSI corresponding to the wireless access point.

[0256] The electronic device is the device configured with the double-chip (first chip + second chip) in the above embodiments. For the hardware structure of the electronic device configured with the double-chip, for example, FIG. 15 is shown.

[0257] The first chip, for example, the SOC chip in the above embodiments, and the second chip is a chip with lower power consumption and smaller memory than the SOC chip, but 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 be in a working state after the electronic device is started, that is, the second chip can execute the MAC address processing method provided in the application regardless of whether the electronic device is in a screen-off state or a screen-on state.

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

[0260] Regarding the determination of the hash classification value corresponding to each BSSID, for example, the following method can be used:

[0261] First, perform XOR processing on the first N bytes and the last M bytes of the BSSID in hexadecimal according to the hash algorithm.

[0262] N and M can be the same or different.

[0263] In this embodiment, N and M are both 3.

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

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

[0266] Next, add the first processing result in decimal to the decimal result of each byte in the last M bytes.

[0267] Next, perform a remainder operation on the second processing result obtained by the addition according to a predetermined classification number.

[0268] The predetermined classification number can be determined according to the minimum power consumption required when the algorithm is hardened for division, and in this embodiment, 8 is used as an example.

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

[0270] Regarding the specific implementation details of determining the hash classification value corresponding to each BSSID in step 102, refer to the description of the embodiment in the FIG. 5A to FIG. 5C embodiment part, which will not be described here.

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

[0272] Understandably, the memory of the second chip 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 matching link of the MAC address, the classified filtering can be realized based on the hash classification value, and then the matched target BSSID can be quickly queried.

[0273] Therefore, based on the MAC address processing method provided in the embodiments of the present application, the target BSSID identical to each BSSID can be quickly found, and then the current position 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 position of the electronic device can be timely pushed.

[0274] Referring to FIG. 6 , an exemplary flowchart of a MAC address processing method is shown. In this embodiment, the MAC address processing method can include:

[0275] 201. When the electronic device enters the first area, the fingerprint information of all wireless access points related to the first area is obtained.

[0276] From the above description of the relationship between the cell fence, the wifi fence, the wireless access point and the fingerprint information in the above embodiments, such as FIG. 7 , and FIG. 9 , it can be known 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, the cell fences included in the first area and the wifi fences included in each cell fence can be determined by interacting with the server storing the fingerprint information of the wireless access points of different wifi fences, and then the fingerprint information of the wireless access points included in each wifi fence can be obtained from the server.

[0277] 202. The hash classification value of the BSSID in each fingerprint information is determined by a hash algorithm.

[0278] Understandably, in order to ensure that in the MAC address matching link, the hash classification value corresponding to the BSSID can be used for quick query. In the storage stage, the determination method of the hash classification value of each BSSID is the same as the determination method of the query matching node, and the specific implementation details can be referred to the content of step 102 in the above embodiments, or FIG. 11 the description of the embodiment part shown in the above embodiments, which will not be repeated here.

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

[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 the storage of the fingerprint information of all wireless access points involved in the first area according to the hash classification value, for example, it can be done in the following way:

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

[0283] It should be noted that in order to ensure that when locating the BSSID in the area corresponding to the corresponding hash classification value, it can be more convenient and fast, in each classification corresponding to the hash classification value, it can be stored in order according to the size of the BSSID. For example, store in descending order or store in ascending order.

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

[0285] Next, after the BSSID of all wireless access points involved in the wifi fence is stored, the RSSI corresponding to each BSSID is stored in the order of BSSID storage. In specific implementation, for example, a table or array can be used to record the total number of wireless access points contained in the first n classes of each wifi fence. For details, see FIG. 13A to FIG. 13C The description of the embodiment part is not repeated here.

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

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

[0288] 206, for each BSSID, in the memory of the second chip, find the target BSSID same as the BSSID in the storage area corresponding to the hash classification value.

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

[0290] 207. After finding the target BSSID identical to the BSSID, the current position of the electronic device is determined according to the target BSSID and the target RSSI corresponding to the target BSSID.

[0291] 208. The service matching the current position of the electronic device is pushed.

[0292] Therefore, the target BSSID identical to the BSSID of each wireless access point scanned by the electronic device in the first area can be quickly found, and the current position of the electronic device is further determined according to the target BSSID and the RSSI corresponding to the target BSSID. In this way, the service matching the current position of the electronic device can be timely pushed.

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

[0294] 210. According to the cell fence included in the second area, the cell fence not belonging to the second area stored in the memory of the second chip is deleted.

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

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

[0297] 213. According to the memory fragment combination form with the minimum copy consumption, the memory fragments are selected from the memory of the second chip for merging.

[0298] 214. The obtained fingerprint information of the wireless access point is written into the storage area corresponding to the merged memory fragments.

[0299] For details of the steps 209 to 214, refer to the description of the embodiments shown in the embodiment part of FIG. 2 , ​ , which will not be repeated here.

[0300] Therefore, when the fingerprint information needs to be updated, the corresponding memory fragments in the memory of the second chip are merged according to the memory fragment combination form with the minimum copy consumption after the feasible memory fragment combination form is determined, so that the merged memory fragments can store the newly acquired fingerprint information of the wireless access point, and the copy consumption caused by moving the existing fingerprint information during the memory fragment merging process is reduced as much as possible.

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

[0302] In addition, the embodiment of the present application further provides a chip. The chip comprises 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, and the signal comprises computer instructions stored in the memory; when the processor executes the computer instructions, the electronic device executes the MAC address processing method provided by the above-mentioned embodiments.

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

[0304] For communication of the chip with other functional devices in the electronic device, please refer to the embodiment shown in ​ and will not be described here again.

[0305] In addition, the embodiment of the present application further provides a chip system. The chip system comprises: 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 dormant state, and the second chip is in a non-dormant state.

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

[0307] Understandably, the first chip is, for example, the SOC chip as described in the above embodiments, and the second chip is the second chip as described in the above embodiments, which is low in power consumption, small in memory, and can be online all the time after the electronic device is started.

[0308] In addition, the embodiment of the present application further provides a computer readable storage medium, and the computer storage medium stores computer instructions, and when the computer instructions run on the electronic device, the electronic device executes the above-mentioned related method steps to realize the MAC address processing method in the above-mentioned embodiment.

[0309] In addition, the embodiment of the present application further provides a computer program product, and when the computer program product runs on the electronic device, the electronic device executes the above-mentioned related steps to realize the MAC address processing method in the above-mentioned embodiment.

[0310] In addition, as known from the above description, the chip, the chip system, the electronic device, the computer readable storage medium, the computer program product or the chip provided by the embodiment of the present application are all used to execute the corresponding method provided above, so the beneficial effects that can be achieved are referred to the beneficial effects in the corresponding method provided above, which will not be described here.

[0311] The above-described embodiments are only used to illustrate the technical solutions of the present application, rather than limit them; although the foregoing embodiments of the present application are described in detail, those skilled in the art should understand that the technical solutions recorded in the foregoing embodiments can be modified, or some technical features can be replaced by equivalents; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A method of processing a MAC address, characterized by, The application is applied to an electronic device, the electronic device comprising a first chip and a second chip, the power consumption of the second chip being lower than that of the first chip, and the memory of the second chip being smaller than that of the first chip; wherein, when the electronic device is in an off-screen state, the first chip is in a dormant state; The method comprises: When the electronic device enters a first area, the second chip scans fingerprint information of surrounding wireless access points, the fingerprint information of each wireless access point comprising a BSSID and an 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 off-screen state or in a bright screen state; According to a hash algorithm, a hash classification value corresponding to each BSSID is determined; wherein, the determination of the hash classification value corresponding to each BSSID according to the hash algorithm comprises: for each BSSID, performing an exclusive or operation on the first N bytes and the last M bytes of the BSSID in hexadecimal according to the hash algorithm; converting the first processing result obtained by the exclusive or operation from hexadecimal to decimal; converting each 16-bit byte in the last M bytes from hexadecimal to decimal; adding the first processing result in decimal to the decimal result of each byte in the last M bytes; performing a remainder operation on the second processing result obtained by the addition according to a preset classification number; and taking the third processing result obtained by the remainder operation as the hash classification value corresponding to the BSSID; For each BSSID, in the memory of the second chip, a target BSSID identical to the BSSID is searched in the storage area corresponding to the hash classification value.

2. The method of claim 1, wherein, The classification number is 8.

3. The method according to claim 1 or 2, characterized in that, For each BSSID, before searching for a target BSSID identical to the BSSID in the storage area corresponding to the hash classification value in the memory of the second chip, the method further comprises: When the electronic device enters the first area, the fingerprint information of all wireless access points involved in the first area is obtained; According to the hash algorithm, the hash classification value of the BSSID in each fingerprint information is determined; According to the hash classification value, the fingerprint information of all wireless access points involved in the first area is stored.

4. The method of claim 3, wherein, When the electronic device enters the first area, the fingerprint information of all wireless access points involved in the first area is obtained, which comprises: When the electronic device enters the first area, it is determined that the first area comprises a cell fence and each cell fence comprises a wifi fence; The fingerprint information of the wireless access points included in each wifi fence is obtained.

5. The method of claim 4, wherein, According to the hash classification value, the fingerprint information of all wireless access points involved in the first area is stored, which comprises: For each wifi fence included in each cell fence, according to the hash classification value, the BSSID of all wireless access points involved in the wifi fence is stored. After the BSSIDs of all the wireless access points involved in the wifi fence are stored, the RSSI corresponding to each of the BSSIDs is stored in the order of the storage of the BSSIDs.

6. The method of claim 5, wherein, For each wifi fence included in each cell fence, the BSSIDs of all the wireless access points involved in the wifi fence are stored according to the hash classification value, and the BSSIDs further include: In each classification corresponding to the hash classification value, the BSSIDs are stored in order of size.

7. The method of claim 3, wherein, When the fingerprint information of all the wireless access points involved in the first area is stored according to the hash classification value, the method further includes: The number of the fingerprint information of the wireless access points stored in each classification corresponding to the hash classification value is recorded.

8. The method of claim 1, wherein, The method further includes: When the electronic device enters a second area, a cell fence included in the second area is determined; According to the cell fence included in the second area, the memory of the second chip stores the cell fence not belonging to the second area is deleted; The fingerprint information of the wireless access points included in each wifi fence in the cell fence of the second area not stored in the memory of the second chip is obtained from the server; When the obtained fingerprint information of the wireless access points is written into the memory of the second chip, the memory fragment combination form is determined according to the memory fragment existing in the memory of the second chip, and the copy consumption corresponding to each of the memory fragment combination forms is determined; According to the memory fragment combination form with the minimum copy consumption, memory fragments are selected from the memory of the second chip for merging; The obtained fingerprint information of the wireless access points is written into the storage area corresponding to the merged memory fragments.

9. The method of claim 1, wherein, The obtained fingerprint information of the wireless access points is written into the storage area corresponding to the merged memory fragments, including: For each wireless fingerprint information of the wireless access points, the hash classification value of the BSSID in each fingerprint information is determined by the hash algorithm; According to the hash classification value, the fingerprint information of the wireless access points is written into the storage area corresponding to the merged memory fragments.

10. The method of claim 1, wherein, The method further includes: After the target BSSID identical to the BSSID is found, the current position of the electronic device is determined according to the target BSSID and the target RSSI corresponding to the target BSSID; A service matching the current position of the electronic device is pushed.

11. A chip, characterized by The electronic device 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 the signal to the processor, and the signal includes computer instructions stored in the memory; when the processor executes the computer instructions, the electronic device performs the MAC address processing method of any one of claims 1 to 10.

12. A chip system, characterized by It includes: A first chip and a second chip share an antenna of an electronic device, the second chip has lower power consumption and smaller memory than the first chip; when the electronic device is in a screen-off state, the first chip is in a dormant state and the second chip is in a non-dormant state. The second chip is configured to call and run a computer program from a memory of the electronic device, so that the electronic device on which the chip system is installed performs the MAC address processing method according to any one of claims 1 to 10.

13. An electronic device, comprising: The electronic device comprises a memory and the chip system according to claim 12; the memory is coupled to the processors of the first chip and the second chip respectively; the memory stores program instructions, and the program instructions are executed by the processor of the second chip to cause the electronic device to perform the MAC address processing method according to any one of claims 1 to 10.

14. A computer-readable storage medium, characterized in that, The computer program is configured to cause the electronic device to perform the MAC address processing method according to any one of claims 1 to 10 when the computer program is executed on the electronic device.

Citation Information

Patent Citations

  • Service recommendation method and device and storage medium

    CN116028707A

  • Geofence processing method and device and storage medium

    CN116033342A