A list loading method and device, a chip and a storage medium

CN120129026BActive Publication Date: 2026-10-30HONOR DEVICE CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202510198766.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-02-21
Publication Date
2026-10-30
Estimated Expiration
2045-02-21

Smart Images

  • Figure CN120129026B_ABST
    Figure CN120129026B_ABST
Patent Text Reader

Abstract

The application discloses a list loading method and device, a chip and a storage medium. The method comprises the following steps: obtaining a first identifier set and a second identifier set, the first identifier being an identifier of a scanned access device, and the second identifier being an identifier of a saved access device; determining a matching result between the first identifier and the second identifier based on a built hash table, the hash table comprising a first hash table built based on the first identifier or a second hash table built based on the second identifier; and loading access information of an access device determined according to the matching result into a list. According to the method, the matching relationship between the scanned access device and the saved access device is determined based on the hash table, the linear search matching method can be avoided, the matching complexity between the scanned access device and the saved access device can be effectively reduced, the matching speed is improved, the loading speed of the access device list is optimized, and the user experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communication technology, and in particular to a list loading method, apparatus, chip, and storage medium. Background Technology

[0002] With the development of mobile communication and the continuous improvement of people's living standards, the use of various mobile terminals such as mobile phones is becoming more and more widespread. Mobile phones have become an indispensable communication tool in people's lives, making it convenient for users to access the network anytime and anywhere and obtain information from the network.

[0003] Currently, connecting to Wireless Fidelity (WiFi) is one of the most common user scenarios. When users need to connect to WiFi, they can turn on the WiFi switch in their phone's Settings, allowing the phone to scan for nearby WiFi information. After scanning, the phone can load a list, displaying the scanned, available WiFi networks nearby, with saved WiFi networks pinned to the top. Only after the WiFi list is loaded can the phone automatically connect to a saved WiFi network or accept manual selection from the user. Therefore, the loading of the WiFi list is crucial for the user experience. Summary of the Invention

[0004] This application provides a list loading method, apparatus, chip, and storage medium. Based on the method described in this application, linear search matching methods can be avoided, the matching complexity between scanned access devices and saved access devices can be reduced, the matching speed between scanned access devices and saved access devices can be improved, which is beneficial to optimizing the loading speed of the access device list and improving the user experience.

[0005] In a first aspect, this application provides a list loading method, the method comprising: obtaining a first identifier set, wherein the first identifier is an identifier of a scanned access device; obtaining a second identifier set, wherein the second identifier is an identifier of a saved access device; determining a matching result between the first identifier in the first identifier set and the second identifier in the second identifier set based on an established hash table, wherein the hash table comprises: a first hash table established based on the first identifier in the first identifier set, or a second hash table established based on the second identifier in the second identifier set; and loading the access information of the access devices determined according to the matching result into the list.

[0006] Based on the method described in the first aspect, the matching relationship between the scanned access devices and the saved access devices is determined by using a hash table. This avoids the linear search matching method, effectively reduces the matching complexity between the scanned access devices and the saved access devices, improves the matching speed between the scanned access devices and the saved access devices, and helps to optimize the loading speed of the access device list and improve the user experience.

[0007] In one possible implementation, the first hash table is built based on a first hash function. Each first identifier in the first identifier set is stored as a key in the first hash table. Based on the established hash table, the matching result between the first identifier in the first identifier set and the second identifier in the second identifier set is determined, including: based on the first hash function, checking whether each second identifier in the second identifier set exists in the first hash table; and determining that at least one second identifier in the second identifier set has a matching relationship with at least one first identifier in the first identifier set, based on the existence of at least one second identifier in the second identifier set in the first hash table.

[0008] Based on this implementation, by constructing a hash table of the scanned access devices and checking whether the saved access devices exist in the hash table, the time complexity of the search process is O(1), which can effectively match the saved access devices with the scanned access devices, significantly improving the matching efficiency.

[0009] In one possible implementation, the method further includes: maintaining a first hash table; and incrementally updating the first hash table in response to a change in one or more first identifiers obtained by the scanning access device.

[0010] Based on this implementation, when the identifier of the scanned access device changes, incremental updates can be used to respond to dynamic changes in the network environment, ensuring that the hash table is always up-to-date and improving real-time response capabilities. Furthermore, incremental updates of the hash table, rather than rebuilding it every time, avoid unnecessary duplicate calculations and further improve performance.

[0011] In one possible implementation, the second hash table is built based on a second hash function. Each second identifier in the second identifier set is stored as a key in the second hash table. Based on the established hash table, the matching result between the first identifier in the first identifier set and the second identifier in the second identifier set is determined, including: based on the second hash function, checking whether each first identifier in the first identifier set exists in the second hash table; and determining that at least one first identifier in the first identifier set and at least one second identifier in the second identifier set have a matching relationship based on the existence of at least one first identifier in the first identifier set in the second hash table.

[0012] Based on this implementation, by constructing a hash table of the saved access devices and checking whether the scanned access devices exist in the hash table, the time complexity of the search process is O(1), which can effectively match the scanned access devices with the saved access devices, significantly improving the matching efficiency. Furthermore, since the hash table of the saved access devices can be constructed during idle time, it does not need to be constructed in real time during each scan, which can further improve the matching efficiency.

[0013] In one possible implementation, the second hash table also stores information about the access devices that are already stored, corresponding to each second identifier in the second identifier set. The information about the access devices is used as a value, and each value forms a key-value pair with its corresponding second identifier.

[0014] Based on this implementation method, by binding the saved device information of the access device with the identifier, it is convenient to directly obtain detailed information related to the access device, ensuring that the device status and data can be viewed at any time. It is suitable for data tracking and management during the device connection process and helps to optimize device management and query process.

[0015] In one possible implementation, the method further includes: maintaining a second hash table; and updating the second hash table in response to changes in the information of the stored access devices.

[0016] Based on this implementation method, the hash table can be automatically updated as the information of the access devices changes, which can maintain the consistency and up-to-dateness of the data, ensure that the device management information always matches the actual situation, and improve the system's adaptability.

[0017] In one possible implementation, the first identifier and the second identifier include the SSID and / or BSSID of the access device.

[0018] This implementation method allows for more flexible matching, helps avoid hash collisions, and enables more accurate identification of access devices.

[0019] Secondly, this application provides a communication device, which can be a terminal device, a device within a terminal device, or a device compatible with a terminal device. The communication device can also be a chip system, capable of executing the methods performed by the terminal device in the first aspect. The functions of the communication device can be implemented in hardware or by hardware executing corresponding software. The hardware or software includes one or more units corresponding to the aforementioned functions. These units can be software and / or hardware. The operations performed by the communication device and its beneficial effects are described in the first aspect above, and will not be repeated here.

[0020] Thirdly, this application provides a communication device including a processor, which executes a method such as that performed by the terminal device in the method of the first aspect when the processor calls a computer program in memory.

[0021] Fourthly, this application provides a communication device including a processor and a memory, the memory being used to store computer execution instructions; the processor being used to execute the computer execution instructions stored in the memory to cause the communication device to perform the method executed by the terminal device as described in the first aspect.

[0022] Fifthly, this application provides a communication device including a processor, a memory, and a transceiver. The transceiver is used to receive or transmit signals; the memory is used to store a computer program; and the processor is used to invoke the computer program from the memory to execute the method executed by the terminal device as described in the first aspect.

[0023] In a sixth aspect, this application provides a communication device including a processor and an interface circuit for receiving computer execution instructions and transmitting them to the processor; the processor executes the computer execution instructions to perform the method executed by the terminal device as described in the first aspect.

[0024] In a seventh aspect, this application provides a computer-readable storage medium for storing computer-executable instructions that, when executed, cause a terminal device to perform a method as described in the first aspect.

[0025] Eighthly, this application provides a communication device that includes functions or units for performing any of the methods in the first aspect.

[0026] Ninthly, this application provides a computer program product including a computer program, which, when executed, causes the method executed by the terminal device as in the method of the first aspect to be implemented.

[0027] In a tenth aspect, this application provides a communication system including a terminal device and a network device; wherein the terminal device is used to perform the method described in the first aspect. Attached Figure Description

[0028] Figure 1 This is a schematic diagram of a communication scenario provided in an embodiment of this application;

[0029] Figure 2 This is a flowchart of a list loading method provided in an embodiment of this application;

[0030] Figure 3This is a flowchart illustrating a list loading method provided in an embodiment of this application;

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

[0032] Figure 5 This is a schematic diagram of the layered hardware and software architecture of an electronic device provided in an embodiment of this application;

[0033] Figure 6 This is a schematic diagram of the structure of a communication device provided in an embodiment of this application;

[0034] Figure 7 This is a schematic diagram of the structure of a communication device provided in an embodiment of this application;

[0035] Figure 8 This is a schematic diagram of the structure of a chip provided in an embodiment of this application. Detailed Implementation

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

[0037] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0038] In this application, "at least one (item)" refers to one or more, "more than one" refers to two or more, "at least two (items)" refers to two or three or more, and "and / or" is used to describe the correspondence between related objects, indicating that there can be three relationships. For example, "A and / or B" can mean: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the related objects before and after are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.

[0039] The terms "comprising" and "having," and any variations thereof, used in the following description of embodiments of this application are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include other steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or devices. It should be noted that in embodiments of this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any method or design described as "exemplary" or "for example" in embodiments of this application should not be construed as preferred or advantageous over other methods or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.

[0040] Figure 1 This is a schematic diagram of a communication scenario provided in an embodiment of this application.

[0041] To facilitate understanding of the embodiments of this application, let's first take... Figure 1 The communication scenarios illustrated herein are used as examples to illustrate communication scenarios applicable to the embodiments of this application. Furthermore, network coverage in the communication scenarios is illustrated using WiFi coverage as an example. It should be noted that the solutions in the embodiments of this application can also be applied to other mobile communication systems or network coverage, and the corresponding names can be replaced with the names of the corresponding functions in other mobile communication systems.

[0042] Currently, with the development of mobile communications, users' demand for connecting to the network through terminal devices is increasing. To facilitate users' access to the network through terminal devices, homes, businesses, shopping malls, and enterprises may be equipped with one or more access devices to provide network coverage, such as WiFi coverage, so that terminal devices can maintain network connectivity. Therefore, when a network connection is needed, the terminal device can often scan for multiple access devices nearby.

[0043] Figure 1 Taking three access devices and one terminal device as an example, such as Figure 1 As shown, this communication scenario includes a first access device 110, a second access device 112, and a third access device 114, as well as a terminal device 120 that accesses the network through one of the three access devices. The network coverage provided by the first access device 110, the second access device 112, and the third access device 114 overlaps with each other. In this scenario, the terminal device 120 can access the network through any of the WiFi coverage provided by the first access device 110, the second access device 112, and the third access device 114, as needed.

[0044] In some embodiments, the first access device 110, the second access device 112, and the third access device 114 may also be referred to as an access point (AP).

[0045] In some embodiments, the first access device 110, the second access device 112, and the third access device 114 may be any device capable of providing network access functionality to the terminal device 120, such as a router.

[0046] In some embodiments, the first access device 110, the second access device 112, and the third access device 114 may be configured with the same WiFi Service Set Identifier (SSID) and password. For example, the first access device 110, the second access device 112, and the third access device 114 may be access devices configured in the same home, merchant, shopping mall, or enterprise.

[0047] In some embodiments, the first access device 110, the second access device 112, and the third access device 114 can be configured with different WiFi SSIDs and passwords. That is, the first access device 110 and the second access device 112 can each have their own independently configured WiFi SSID and password. For example, the first access device 110, the second access device 112, and the third access device 114 can be access devices configured separately for different homes, merchants, shopping malls, or enterprises.

[0048] In some embodiments, the first access device 110, the second access device 112, and the third access device 114 may each be configured with a Basic Service Set Identifier (BSSID). Optionally, the BSSIDs of the first access device 110, the second access device 112, and the third access device 114 may be their respective Media Access Control (MAC) addresses.

[0049] In some embodiments, the first access device 110, the second access device 112, and the third access device 114 may each be configured with multiple virtual BSSIDs, and these virtual BSSIDs are all different.

[0050] In some embodiments, terminal device 120 may include a device that provides voice and / or data connectivity to a user. For example, terminal device 120 is a device with wireless transceiver capabilities that can be deployed on land, including indoor or outdoor, handheld, wearable, or vehicle-mounted; it can also be deployed on water (such as a ship); or it can be deployed in the air (such as an airplane, balloon, or satellite).

[0051] In some embodiments, the terminal device 120 may be a mobile phone, tablet computer, computer with wireless transceiver capabilities, virtual reality (VR) terminal, augmented reality (AR) terminal, wireless terminal in industrial control, vehicle terminal, wireless terminal in self-driving, wireless terminal in remote medical care, wireless terminal in smart grid, wireless terminal in transportation safety, wireless terminal in smart city, wireless terminal in smart home, wearable terminal, etc. The embodiments of this application do not limit the application scenarios.

[0052] In some embodiments, the terminal device 120 may also be referred to as a terminal, user equipment (UE), mobile station (MS), mobile terminal (MT), access terminal, vehicle terminal, industrial control terminal, UE unit, UE station, mobile station, mobile station, remote station, remote terminal, mobile device, UE terminal, wireless communication device, UE agent, or UE device, etc.

[0053] By way of example and not limitation, in this embodiment, the terminal device 120 can also be a wearable device. Wearable devices, also known as wearable smart devices, are a general term for devices that utilize wearable technology to intelligently design and develop everyday wearables, such as glasses, gloves, watches, clothing, and shoes. Wearable devices are portable devices worn directly on the body or integrated into a user's clothing or accessories. Wearable devices are not merely hardware devices; they achieve powerful functions through software support, data interaction, and cloud interaction. Broadly defined, wearable smart devices include those with comprehensive functions, large size, and the ability to perform complete or partial functions without relying on a smartphone, such as smartwatches or smart glasses, as well as those focused on a specific application function that require interaction with other devices such as smartphones, such as various smart bracelets and smart jewelry for vital sign monitoring.

[0054] It is understood that, in this embodiment of the application, all or part of the functions of the terminal device 120 can also be implemented through software functions running on hardware, or through virtualization functions instantiated on a platform (e.g., a cloud platform). In this embodiment of the application, the device for implementing the functions of the terminal device 120 can be the terminal device itself, or a device capable of supporting the terminal device in implementing the function, such as a chip system or a combination of devices or components capable of implementing the functions of the terminal device, and the device can be installed in the terminal device.

[0055] It is understandable that as the terminal device 120 moves within the location, it can roam between different access devices. Figure 1 For example, terminal device 120 can roam from first access device 110 to second access device 112.

[0056] It should be noted that, Figure 1 This is merely a schematic diagram of a communication scenario, which may also include other devices, such as other access devices and / or terminal devices. Figure 1 The number of various devices included in this communication scenario is not shown in the embodiments of this application.

[0057] After scanning for nearby Wi-Fi networks, the terminal device can load a list that displays available Wi-Fi networks in the vicinity. The list can also pin saved Wi-Fi networks to the top for easy access by users, or configure the terminal device to automatically connect to the pinned Wi-Fi network to improve the user experience.

[0058] Figure 2 This is a flowchart of a list loading method provided in an embodiment of this application.

[0059] Figure 2 The diagram illustrates part of the process involved in a terminal device from turning on the WiFi switch to displaying the list.

[0060] S201. WiFi Module Activation and Scanning.

[0061] After the user turns on the WiFi switch on the terminal device, the terminal device can immediately activate the WiFi module and begin scanning for nearby connectable WiFi networks.

[0062] The scan results will generate a list containing all networks (such as SSID, BSSID, RSSI, etc.), usually denoted as "cachedAccessPoints".

[0063] S202. Load the saved WiFi information.

[0064] Next, the device loads the WiFi information that the user has saved from local storage (such as configuration files, usually referred to as "configs").

[0065] This stored information includes identifiers of previously connected WiFi networks (such as SSID and / or BSSID) and their associated connection parameters (such as passwords).

[0066] S203. Matching process.

[0067] The terminal device compares the saved WiFi networks with the scanned WiFi networks one by one.

[0068] Specifically, for each saved WiFi record, the system will iterate through the scanned WiFi networks and determine whether their identifiers (SSID or BSSID) are consistent.

[0069] If a match is found, the system will mark the network as a "saved connectable WiFi".

[0070] If there is no match, the network will be treated as a regular connectable WiFi network.

[0071] For example, if there are M saved WiFi networks and N scanned WiFi networks, the terminal device will compare the M saved WiFi networks with the N scanned WiFi networks one by one, that is, perform M×N matching comparisons.

[0072] This method ensures accurate matching between saved WiFi networks and scanned WiFi networks.

[0073] S204. Construct and sort lists.

[0074] Based on the matching results, the terminal device can build a complete list of WiFi networks.

[0075] Typically, terminal devices will display "Saved Connectable WiFi Networks" at the top (because users are more likely to prioritize these networks), while other WiFi networks can be displayed after being sorted according to signal strength, frequency band, or other priority factors.

[0076] S205. List display and automatic connection.

[0077] Finally, the terminal device can load the refreshed list of WiFi networks and present it to the user. The top-listed, saved WiFi networks will usually automatically initiate connection attempts to improve the user experience; other WiFi networks can be manually selected by the user to connect to.

[0078] As users use their devices daily, the number of saved Wi-Fi networks increases significantly. This is especially true for professionals working in communications and wireless networks, who frequently need to connect to and troubleshoot different Wi-Fi networks; their devices may have a large number of saved Wi-Fi networks. Statistics show that some users can have over 3,000 saved networks after using their phones for three years.

[0079] When a large number of networks have been saved, after the terminal device turns on the WiFi switch, each saved WiFi network needs to be compared and matched with the scanned WiFi networks one by one. This results in a high overall matching time complexity (approximately M×N, which is the number of saved WiFi networks multiplied by the number of scanned WiFi networks). The refresh and loading of the list will be very slow, which will greatly affect the user experience.

[0080] Taking a saved number of WiFi networks as an example, if 20 WiFi networks are scanned (i.e., nearby connectable WiFi networks), then the number of comparison and matching operations would be 3000 × 20 = 60000 times. This could take 3 to 6 seconds to fully load the list, causing a very serious lag and severely impacting the user experience.

[0081] To facilitate understanding of the solutions provided in the embodiments of this application, the relevant concepts involved in the embodiments of this application are briefly introduced below:

[0082] 1. Hash Table

[0083] A hash table is a key-value structure used for efficient data storage and retrieval. Its core idea is to use a hash function to convert a key into an index, and then store the data at the location corresponding to that index.

[0084] Hash tables are typically composed of hash buckets, each storing key-value pairs. Each hash bucket has a corresponding index, and the data is stored at the location specified at that index.

[0085] Since the computation time complexity of a hash function is O(1), when searching for data, the hash function can directly jump to the corresponding index, which can avoid traversing the entire data structure and improve the search speed.

[0086] In some embodiments, a hash table can also be referred to as a HashMap.

[0087] 2. Hash Function

[0088] The hash function is the core of a hash table, determining how data is stored in the hash table.

[0089] Hash functions are primarily used to: calculate the hash value of a key to map the key to discrete integer values; map hash values ​​to array indices to determine the data storage location; and ensure a uniform distribution of hash values ​​to guarantee even data distribution and avoid hash collisions.

[0090] 3. The relationship between hash tables and hash functions

[0091] Hash functions can be used to calculate the hash value of a key and map it to a hash table index.

[0092] Hash tables can be used to store data in corresponding locations based on an index obtained from a hash function.

[0093] Therefore, hash tables rely on hash functions for data storage and retrieval.

[0094] For example, during the data storage process, an index can be obtained by calculating hash(Key)%Table_Size, and then key-value data can be stored at that index location.

[0095] For example, during the data query process, the index can be obtained by calculating hash(Key)%Table_Size, and then the user can directly jump to that index position to read the data.

[0096] Therefore, using a hash table to match saved WiFi networks with scanned WiFi networks during the WiFi list loading process can greatly speed up the matching process, improve matching efficiency, reduce list refresh waiting time, and enhance user experience.

[0097] Figure 3 This is a flowchart illustrating a list loading method according to an embodiment of this application. Figure 3As shown, the execution entity of this list loading method can be the aforementioned terminal device. Alternatively, Figure 3 The method shown can be executed by a chip in a terminal device. This application does not limit the scope of the implementation. Wherein:

[0098] S301. Obtain the first set of identifiers, wherein the first identifier is the identifier of the scanned access device.

[0099] Terminal devices can obtain a first set of identifiers by scanning network coverage, such as WiFi coverage. The first set of identifiers may include one or more first identifiers. These one or more first identifiers are identifiers of one or more access devices detected in the scan.

[0100] In some embodiments, the first identifier may be the Service Set Identifier (SSID) of the scanned access device.

[0101] In some embodiments, the first identifier may be the Basic Service Set Identifier (BSSID) of the scanned access device. Optionally, the BSSID of the scanned access device may include the Media Access Control (MAC) address of the scanned access device.

[0102] If an access device is configured with multiple virtual BSSIDs, it can be assumed that there are multiple virtual access devices, each with its own virtual BSSID.

[0103] These scan results can form a list containing all scanned networks (such as SSID, BSSID, RSSI, etc.), usually denoted as "cachedAccessPoints".

[0104] S302. Obtain the second set of identifiers, wherein the second identifier is the identifier of the access device that has been saved.

[0105] The terminal device can load a saved list of access devices, such as a saved list of WiFi devices, and obtain a second identifier set. The second identifier set may include one or more second identifiers. These one or more second identifiers are identifiers of one or more saved access devices.

[0106] In some embodiments, the second identifier may be the SSID of a saved access device.

[0107] In some embodiments, the second identifier may be a saved BSSID of the access device. Optionally, the saved BSSID of the access device may include a saved MAC address of the access device.

[0108] If an access device is configured with multiple virtual BSSIDs, it can be saved as multiple virtual access devices, each with its own virtual BSSID.

[0109] The list of saved access devices is usually denoted as "configs", for example, it can be saved in the WiFi module of the terminal device.

[0110] S303. Based on the established hash table, determine the matching result between the first identifier in the first identifier set and the second identifier in the second identifier set.

[0111] The hash table includes: a first hash table built based on the first identifier in the first identifier set, or a second hash table built based on the second identifier in the second identifier set.

[0112] In some embodiments, the key of the first hash table can be the identifier of each scanned access device, i.e., the first identifier (such as SSID, BSSID). Optionally, the value can be relevant information about the scanned access device (e.g., device name, signal strength, etc.). Optionally, the value can be left empty, directly forming a key-value pair with the first identifier of the scanned access device to establish the first hash table.

[0113] In some embodiments, the key of the second hash table can be the identifier of each saved access device, i.e., the second identifier (such as SSID, BSSID). The value can be information related to the saved access device (such as password, encryption method, etc.).

[0114] Based on the established hash table, the terminal device can match the first identifier of the scanned access device with the second identifier of the saved access device. By checking whether each first identifier in the first identifier set exists in the second identifier set, the terminal device can quickly determine which scanned access devices (e.g., those that can connect to WiFi) belong to the saved access devices (e.g., saved WiFi).

[0115] In some embodiments, the first hash table may be established based on a first hash function, and each first identifier in the first identifier set may be stored as a key in the first hash table. Based on the established hash table, determining the matching result between the first identifier in the first identifier set and the second identifier in the second identifier set may include: based on the first hash function, checking whether each second identifier in the second identifier set exists in the first hash table; and determining that at least one second identifier in the second identifier set has a matching relationship with at least one first identifier in the first identifier set based on the existence of at least one second identifier in the second identifier set in the first hash table.

[0116] The terminal device can construct a first hash table based on the first identifier in the first identifier set of the scanned access devices (e.g., the device's unique identifier, SSID, BSSID, etc.).

[0117] The key of the first hash table can be a first identifier, and its value can be device information of the scanned access device associated with the identifier (e.g., WiFi signal strength, connection method, etc.). Alternatively, the first hash table can contain only the first identifier itself, that is, only the key, and the value is empty.

[0118] The terminal device can use the first hash function to calculate the hash value based on the first identifier, convert each first identifier into an index of the hash table, and store it in the position corresponding to the index in the first hash table.

[0119] After the first hash table is constructed, the next terminal device can use the first hash function to search for the second identifier (e.g., the saved WiFi identifier) ​​in the second identifier set of the saved access devices, and determine which second identifiers exist in the first hash table. This means that the second identifier matches the first identifier at the corresponding position in the first hash table, and thus obtains the matching result.

[0120] The search process may include: for each second identifier in the second identifier set (e.g., the identifier of a saved WiFi), searching for whether the second identifier exists in the first hash table using a first hash function.

[0121] If the second identifier does not exist in the first hash table, it means that the second identifier is not in the identifier set of the scanned access devices, and therefore cannot be matched with the first identifier.

[0122] If the second identifier exists in the first hash table, it means that the second identifier matches the first identifier in the first identifier set corresponding to the same position in the first hash table. Optionally, a defined matching logic can be further used to determine the matching relationship between the second identifier and the first identifier at the same position in the first hash table to obtain a more accurate matching result.

[0123] It is understandable that by constructing a hash table of the scanned access devices and checking whether the saved access devices exist in the hash table, the time complexity of the search process is O(1), which can effectively match the saved access devices with the scanned access devices and significantly improve the matching efficiency.

[0124] Taking the example of a user's terminal device having saved M = 3000 WiFi networks and N = 20 nearby connectable WiFi networks, the terminal device needs to perform 20 + 3000 = 3020 operations. The 20 operations are for building the hash table of each of the 20 scanned WiFi networks, and the 3000 operations are for comparing whether the saved WiFi networks match the scanned WiFi networks.

[0125] As can be seen, compared to linear one-to-one matching, the number of executions can be optimized from 60,000 to 3,000, which is a theoretical optimization of nearly 20 times, which means that the number of WIFIs scanned, N, is greatly improved, thus greatly improving the matching efficiency.

[0126] In some embodiments, the method may further include: maintaining a first hash table; and incrementally updating the first hash table in response to a change in one or more first identifiers obtained by the scanning access device.

[0127] The terminal device can maintain a first hash table, which is incrementally updated only when the first identifier of a scanned access device changes, without needing to rebuild the first hash table with each scan. This change can be caused by the movement of the terminal device. For example, when the terminal device moves at low speed or within a small area, the set of first identifiers of the scanned access devices will not change significantly, only a few first identifiers will change, such as scanning a few newly added WiFi networks, or failing to scan some of the original WiFi networks multiple times in a row.

[0128] It is understandable that when the identifier of the scanned access device changes, incremental updates can respond to dynamic changes in the network environment, ensuring that the hash table is always up-to-date and improving real-time response capabilities. Furthermore, incremental updates to the hash table, rather than rebuilding it every time, avoid unnecessary duplicate calculations and further improve performance.

[0129] In some embodiments, the second hash table may be built based on a second hash function, and each second identifier in the second identifier set may be stored as a key in the second hash table. Based on the established hash table, determining the matching result between the first identifier in the first identifier set and the second identifier in the second identifier set may include: based on the second hash function, checking whether each first identifier in the first identifier set exists in the second hash table; and determining that at least one first identifier in the first identifier set and at least one second identifier in the second identifier set have a matching relationship based on the existence of at least one first identifier in the first identifier set in the second hash table.

[0130] Terminal devices can construct a second hash table based on the second identifier in the second identifier set of the access devices that has been saved (e.g., the device's unique identifier, SSID, BSSID, etc.).

[0131] The key of the second hash table can be a second identifier, and its value can be information about the access device that has been stored and associated with that identifier (e.g., password, encryption method, etc.).

[0132] The terminal device can use a second hash function to calculate the hash value based on the second identifier, convert each second identifier into an index of the hash table, and store it in the position corresponding to the index in the second hash table.

[0133] After constructing the second hash table, the next terminal device can use the second hash function to search for the first identifier (e.g., the scanned WiFi identifier) ​​in the first identifier set of the scanned access devices to determine which first identifiers exist in the second hash table. This means that the first identifier matches the second identifier at the corresponding position in the second hash table, and thus obtains the matching result.

[0134] The search process may include: for each first identifier in the first identifier set (e.g., the identifier of the scanned WiFi), searching for whether the first identifier exists in the second hash table using a second hash function.

[0135] If the first identifier does not exist in the second hash table, it means that the first identifier is not in the saved set of identifiers of access devices, and therefore cannot be matched with the second identifier.

[0136] If the first identifier exists in the second hash table, it means that the first identifier matches the second identifier in the second identifier set corresponding to the same position in the second hash table. Optionally, a defined matching logic can be further used to determine the matching relationship between the first identifier and the second identifier at the same position in the second hash table to obtain a more accurate matching result.

[0137] By constructing a hash table of the saved access devices and checking whether the scanned access devices exist in the hash table, the time complexity of the search process is O(1), which can effectively match the scanned access devices with the saved access devices, significantly improving the matching efficiency. Furthermore, since the hash table of the saved access devices can be constructed during idle time, it does not need to be constructed in real time during each scan, which can further improve the matching efficiency.

[0138] Taking the example of a user's terminal device having saved 3000 WiFi networks (M=3000) and 20 nearby connectable WiFi networks (N=20), in this example, since the hash table of the saved WiFi networks can be built and stored in the terminal device during idle time, the terminal device only needs to perform 20 operations when matching and comparing the saved WiFi networks with the scanned WiFi networks. That is, the number of times the 20 scanned WiFi networks are matched and compared with the saved WiFi networks through the hash table.

[0139] As can be seen, compared to linear one-to-one matching, the number of executions can be optimized from 60,000 to 20, which is a theoretical optimization of nearly 3,000 times, which is equivalent to the number of saved WIFIs M, greatly improving the matching efficiency.

[0140] In some embodiments, the second hash table also stores information on the access devices that have been saved, corresponding to each second identifier in the second identifier set. The information on the access devices is used as a value, and each value forms a key-value pair with its corresponding second identifier.

[0141] Terminal devices can also bind the information of the access devices (password, encryption method, etc.) to their respective identifiers and save them in the second hash table in the form of key-value pairs. This allows the terminal device to directly query the relevant information of the access device after a scanned access device successfully matches the saved access devices, which is beneficial for the terminal device to automatically connect to the access device.

[0142] It is understandable that by binding the saved device information of the access device with the identifier, it is beneficial to directly obtain detailed information related to the access device, ensuring that the device status and data can be viewed at any time. This is suitable for data tracking and management during the device connection process and helps to optimize device management and query processes.

[0143] In some embodiments, the method further includes: maintaining a second hash table; and updating the second hash table in response to changes in the information of the stored access devices.

[0144] The terminal device can maintain a second hash table. When the relevant information of the access device (password, encryption method, etc.) changes, the second hash table is updated so that the terminal device can successfully connect to the corresponding access device after the scanned access device is successfully matched with the saved access device.

[0145] It is understandable that as the information of the access devices changes, the terminal devices can automatically update the hash table, which can maintain the consistency and up-to-dateness of the data, ensure that the device management information always matches the actual situation, and improve the system's adaptability.

[0146] In some embodiments, the first identifier and the second identifier include the SSID and / or BSSID of the access device.

[0147] Optionally, the first identifier and the second identifier may consist only of the SSID of the access device.

[0148] In other words, the first identifier may only include the SSID of the scanned access device, and the second identifier may only include the SSID of the saved access device.

[0149] Using the SSID as the key in the hash table avoids the inconvenience of having to repeatedly enter the password for WiFi networks with the same name and password. For example, many current routers can simultaneously broadcast WiFi signals on both the 2.4GHz and 5GHz bands, and these two WiFi networks can have the same name (same SSID) and password. Using the SSID as the key eliminates the need to repeatedly enter the password for WiFi networks on both bands and saves on hash table resources.

[0150] However, for WiFi networks with the same SSID but different passwords, connection failures may occur, or other hash collision resolution methods / algorithms may be needed to adapt and handle the relevant information of access devices with the same SSID.

[0151] Optionally, the first and second identifiers may consist only of the BSSID of the access device.

[0152] In other words, the first identifier may only include the BSSID of the scanned access device, and the second identifier may only include the BSSID of the saved access device.

[0153] Using BSSID as the key allows you to distinguish between two different WiFi networks with the same name (e.g., SSID). However, WiFi networks with the same name and password need to be saved separately.

[0154] Optionally, the first identifier and the second identifier may include the SSID and BSSID of the access device.

[0155] In other words, the first identifier may include the SSID and BSSID of the scanned access device, and the second identifier may include the SSID and BSSID of the access device that have been saved.

[0156] In some cases, a combination of SSID and BSSID can be used as an identifier.

[0157] The SSID and BSSID can be combined to form a unique identifier, which can then be used as the key in the hash table. In this way, each entry in the hash table (the hash bucket, which in this application could be information related to the access device) can be uniquely identified based on the SSID and BSSID.

[0158] The combined key can be a string (e.g., "SSID_BSSID").

[0159] Alternatively, the SSID and BSSID can be combined into a single numeric value and used as the key in the hash table. For example, different (independent) hash functions can be used to calculate hash values ​​for the SSID and BSSID in the identifier, and then the hash values ​​of the two can be combined to create the key; for example, the hash values ​​of the two can be summed and then the hash value can be calculated using a hash function.

[0160] Hash collisions are usually caused by hash values ​​not being evenly distributed. Therefore, using two separate hash functions to process SSID and BSSID to obtain hash values ​​and combining them can help the keys of the hash table have a better distribution and reduce the possibility of hash collisions.

[0161] In some cases, hierarchical hash structures can be constructed using SSID and BSSID.

[0162] Specifically, a first-level hash table can be constructed based on the SSID as the key. The value of the first-level hash table is a second-level hash table constructed based on the BSSID as the key. The relevant information of the access device corresponding to the SSID and BSSID is stored as the value of the second-level hash table.

[0163] Because the combination of SSID and BSSID forms a two-level hash table, collisions in the first-level hash table are effectively reduced. Then, a second hash is performed on the BSSID within each SSID, further dispersing collisions and improving the accuracy and stability of network connections. Furthermore, this hierarchical hash structure supports complex multi-level data organization, enabling multi-level device management.

[0164] It is understandable that by including the SSID and / or BSSID of the access device in the first and second identifiers, the matching method can be more flexible, which helps to avoid hash collisions and more accurately identify the access device.

[0165] S304. Load the access information of the access devices determined based on the matching results into the list.

[0166] Terminal devices can load relevant information (such as SSID, BSSID, signal strength, encryption method, etc.) of successfully matched access devices into the WiFi list based on the matching results.

[0167] Typically, successfully matched and saved access devices are displayed at the top because these are likely to be the devices that users will connect to first.

[0168] The scanned access devices can be sorted and displayed according to priority such as signal strength and frequency band (2.4GHz / 5GHz).

[0169] Furthermore, if the scanned access device matches a saved access device, the terminal device can automatically attempt to connect to that access device, improving the user experience.

[0170] It is understandable that by using a hash table to determine the matching relationship between the scanned access devices and the saved access devices, the linear search matching method can be avoided. This can effectively reduce the matching complexity between the scanned access devices and the saved access devices, improve the matching speed between the scanned access devices and the saved access devices, and determine the matching access devices with O(1) complexity. This is beneficial for optimizing the loading speed of the access device list and improving the user experience.

[0171] The list loading method provided in this application can be applied to a user's electronic device. For example, the electronic device can be a mobile phone, tablet computer, personal digital assistant (PDA), augmented reality (AR) / virtual reality (VR) device, media player, or other portable mobile device with image processing capabilities. It can also be a wearable electronic device such as a smartwatch. This application does not impose any special limitations on the specific form of the device.

[0172] Figure 4 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application.

[0173] Electronic device 400 may include processor 410, external memory interface 420, internal memory 421, universal serial bus (USB) interface 430, charging management module 440, power management module 441, battery 442, antenna 1, antenna 2, mobile communication module 450, wireless communication module 460, audio module 470, speaker 470A, receiver 470B, microphone 470C, headphone jack 470D, sensor module 480, button 490, motor 491, indicator 492, camera 493, display screen 494, and subscriber identification module (SIM) card interface 495, etc. The sensor module 480 may include a pressure sensor 480A, a gyroscope sensor 480B, a barometric pressure sensor 480C, a magnetic sensor 480D, an accelerometer sensor 480E, a distance sensor 480F, a proximity light sensor 480G, a fingerprint sensor 480H, a temperature sensor 480J, a touch sensor 480K, an ambient light sensor 480L, a bone conduction sensor 480M, etc.

[0174] Processor 410 may include one or more processing units, such as: application processor (AP), modem processor, graphics processing unit (GPU), image signal processor (ISP), controller, memory, video codec, digital signal processor (DSP), baseband processor, and / or neural network processing unit (NPU), etc. The different processing units may be independent devices or integrated into one or more processors.

[0175] The controller can be the nerve center and command center of the electronic device 400. The controller can generate operation control signals based on the instruction opcode and timing signals to control the fetching and execution of instructions.

[0176] The processor 410 may also include a memory for storing instructions and data.

[0177] In some embodiments, the memory in processor 410 is a cache memory. This memory can store instructions or data that processor 410 has just used or that are used repeatedly. If processor 410 needs to use the instruction or data again, it can directly retrieve it from memory. This avoids repeated accesses, reduces the waiting time of processor 410, and thus improves system efficiency. Processor 410 retrieves instructions or data stored in memory, causing electronic device 400 to execute the methods performed by the electronic device in the following method embodiments.

[0178] In some embodiments, the processor 410 may include one or more interfaces. Interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.

[0179] The charging management module 440 is used to receive charging input from the charger. The charger can be a wireless charger or a wired charger.

[0180] The power management module 441 is used to connect the battery 442, the charging management module 440, and the processor 410. The power management module 441 receives input from the battery 442 and / or the charging management module 440 to power the processor 410, internal memory 421, external memory, display 494, camera 493, and wireless communication module 460, etc. In some other embodiments, the power management module 441 may also be located in the processor 410.

[0181] The wireless communication function of electronic device 400 can be implemented through antenna 1, antenna 2, mobile communication module 450, wireless communication module 460, modem processor, and baseband processor.

[0182] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 400 can be used to cover one or more communication frequency bands. Different antennas can also be multiplexed to improve antenna utilization. For example, antenna 1 can be multiplexed as a diversity antenna for a wireless local area network. In some other embodiments, the antennas can be used in conjunction with a tuning switch.

[0183] The mobile communication module 450 can provide solutions for wireless communication, including 2G / 3G / 4G / 5G, applied to the electronic device 400. The mobile communication module 450 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc.

[0184] The mobile communication module 450 can receive electromagnetic waves via antenna 1, and perform filtering, amplification, and other processing on the received electromagnetic waves before transmitting them to the modem processor for demodulation. The mobile communication module 450 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves for radiation via antenna 1.

[0185] In some embodiments, at least some functional modules of the mobile communication module 450 may be located in the processor 410.

[0186] In some embodiments, at least some functional modules of the mobile communication module 450 may be housed in the same device as at least some modules of the processor 410.

[0187] A modem processor may include a modulator and a demodulator. The modulator modulates the low-frequency baseband signal to be transmitted into a mid-to-high frequency signal. The demodulator demodulates the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After processing by the baseband processor, the low-frequency baseband signal is transmitted to the application processor.

[0188] The wireless communication module 460 can provide solutions for wireless communication applications on electronic devices 400, including wireless local area networks (WLAN) (such as Wi-Fi networks), Bluetooth (BT), BLE broadcasting, global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR) technologies.

[0189] The wireless communication module 460 can be one or more devices integrating at least one communication processing module. The wireless communication module 460 receives electromagnetic waves via antenna 2, performs frequency modulation and filtering of the electromagnetic wave signal, and sends the processed signal to processor 410. The wireless communication module 460 can also receive signals to be transmitted from processor 410, perform frequency modulation and amplification, and convert them into electromagnetic waves for radiation via antenna 2.

[0190] The electronic device can connect to a Bluetooth headset via the wireless communication module 460.

[0191] Display screen 494 is used to display images, videos, etc. Display screen 494 includes a display panel. In some embodiments, electronic device 400 may include one or N displays screens 494, where N is a positive integer greater than 1. Display screen 494 may be an outward-folding screen, i.e., a display screen that folds outwards.

[0192] Electronic device 400 can perform shooting functions through an ISP, camera 493, video codec, GPU, display 494, and application processor. The ISP is used to process data fed back by camera 493. Camera 493 is used to capture still images or videos. Camera 493 may include a front-facing camera and a rear-facing camera, with the front-facing camera located in the display area of ​​the screen and the rear-facing camera located in the back area of ​​the screen.

[0193] A digital signal processor (DSP) is used to process digital signals, including digital image signals and other digital signals. A video codec is used to compress or decompress digital video. Electronic device 400 may support one or more video codecs.

[0194] NPU stands for Neural-Network (NN) Computing Processor. By drawing inspiration from the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it can quickly process input information and continuously learn on its own.

[0195] The external memory interface 420 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 400. The external memory card communicates with the processor 410 through the external memory interface 420 to perform data storage functions.

[0196] Internal memory 421 can be used to store executable program code, including instructions. Processor 410 executes various functional applications and data processing of electronic device 400 by running the instructions stored in internal memory 421. Internal memory 421 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 function (such as sound playback), etc. The data storage area may store data created during the use of electronic device 400 (such as audio data), etc. Furthermore, internal memory 421 may include high-speed random access memory and may also include non-volatile memory, such as flash memory devices.

[0197] Electronic device 400 can implement audio functions such as music playback and recording through audio module 470, speaker 470A, receiver 470B, microphone 470C, headphone jack 470D, and application processor.

[0198] Audio module 470 is used to convert digital audio information into analog audio signal output, and also to convert analog audio input into digital audio signal. Audio module 470 can also be used for encoding and decoding audio signals.

[0199] In some embodiments, the audio module 470 may be disposed in the processor 410, or some functional modules of the audio module 470 may be disposed in the processor 410.

[0200] The 470A loudspeaker, also known as a "loudspeaker", is used to convert audio electrical signals into sound signals.

[0201] The receiver 470B, also known as the "earpiece", is used to convert audio electrical signals into sound signals.

[0202] The microphone 470C, also known as a "microphone" or "voice transducer," is used to convert sound signals into electrical signals.

[0203] The headphone jack 470D is used to connect wired headphones.

[0204] Electronic device 400 can acquire signals through sensor module 480.

[0205] The pressure sensor 480A is used to sense pressure signals and can convert the pressure signals into electrical signals. In some embodiments, the pressure sensor 480A may be disposed on the display screen 494.

[0206] The gyroscope sensor 480B can be used to determine the motion attitude of electronic device 400.

[0207] The 480C barometric pressure sensor is used to measure barometric pressure.

[0208] The Magnetic Sensor 480D includes a Hall sensor.

[0209] The accelerometer 480E can detect the magnitude of acceleration of electronic device 400 in various directions (generally three axes).

[0210] The distance sensor 480F is used to measure distance. The proximity light sensor 480G may include, for example, a light-emitting diode (LED) and a photosensor.

[0211] The 480L ambient light sensor is used to detect ambient light intensity.

[0212] The fingerprint sensor 480H is used to collect fingerprints.

[0213] The 480J temperature sensor is used to detect temperature.

[0214] The touch sensor 480K is also known as a "touch panel".

[0215] Touch sensor 480K can be placed on display screen 494. Touch sensor 480K and display screen 494 together form a touch screen, also known as a "touchscreen". Touch sensor 480K is used to detect touch operations on or near it.

[0216] The bone conduction sensor 480M can acquire vibration signals.

[0217] Button 490 includes the power button, volume buttons, etc.

[0218] Motor 491 can generate vibration alerts.

[0219] Indicator 492 can be an indicator light, used to indicate charging status, power changes, or to indicate messages, missed calls, notifications, etc.

[0220] The SIM card interface 495 is used to connect a SIM card.

[0221] Furthermore, an operating system runs on top of the aforementioned components. Examples include iOS and Android. The operating system of the electronic device 400 can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This application embodiment uses the layered architecture Android system as an example to exemplify the software structure of the electronic device 400. It should be noted that although this application embodiment uses the Android system as an example for illustration, its basic principles are equally applicable to electronic devices with other operating systems.

[0222] It is understood that the structures illustrated in the embodiments of the present invention do not constitute a specific limitation on the electronic device 400. In other embodiments of this application, the electronic device 400 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0223] Electronic devices can also have a layered software architecture, with different layers having their own corresponding modules or components to implement corresponding functions.

[0224] Figure 5 This is a schematic diagram of the layered hardware and software architecture of an electronic device provided in an embodiment of this application.

[0225] like Figure 5 As shown, the hardware and software architecture of electronic devices can adopt a layered architecture. A layered architecture divides the system into several layers, each with a clear role and division of labor. Layers communicate with each other through software interfaces.

[0226] like Figure 5 As shown, the hardware and software architecture framework of the electronic device involved in this application may include an application layer, an application framework layer (FWK), system libraries and Android runtime, a hardware abstraction layer (HAL) (not shown), a kernel layer, and a hardware layer.

[0227] The application layer can include a series of applications. For example, the application package can include WLAN applications, Bluetooth applications, application connection, call sharing, notification sharing, keyboard and mouse sharing, file sharing, screen casting, video and gallery applications, as well as other applications not shown, such as music, camera, browser and other applications.

[0228] WLAN applications are mainly used to enable, connect to, and configure WLAN, while Bluetooth applications are used to enable, connect to, and configure Bluetooth.

[0229] In some embodiments, the WLAN application may be a sub-application of a settings application (not shown), which can be used to configure various functions of an electronic device.

[0230] Application continuity is used to enable the content and usage status of applications to connect this electronic device with nearby devices.

[0231] Call sharing applications enable nearby devices to answer and continue calls from this electronic device. For example, a smart screen can answer calls from this electronic device, while tablets and computers also support making calls.

[0232] Notification sharing enables nearby devices to receive notifications from this electronic device and supports processing on those devices.

[0233] Keyboard and mouse sharing is used to share input devices with this electronic device and nearby computers, or to share the mouse, keyboard and touchpad of a computer or tablet with this electronic device. It can also enable cross-device file transfer and cross-device window display and use.

[0234] File sharing applications enable wireless file sharing with other electronic devices on the same network, allowing for rapid file sharing or printing.

[0235] Screen mirroring applications are used to connect a local device to a large-screen device, allowing videos and other content displayed on the local device to be shown on the large screen. Alternatively, they can connect a local device to a small-screen device, allowing videos and other content displayed on the small screen to be shown on the local device's large screen. Here, "large screen" and "small screen" refer to the relative sizes of the electronic device's display.

[0236] The application framework layer provides an Application Programming Interface (API) and programming framework for applications in the application layer. The application framework layer includes predefined functions. It may include a window manager, content provider, view system, resource manager, pathway establishment system, session management system, and send / receive system, etc.

[0237] The application framework layer may also include hash mapping and hash collision management.

[0238] Hash mapping can be used to build hash tables, and hash collision management can be used to resolve hash collisions. For details on their implementation, please refer to [reference needed]. Figure 3 The methods shown and described will not be repeated here.

[0239] The runtime is responsible for system scheduling and management. The runtime includes the core libraries and the virtual machine. The core libraries consist of two parts: one part contains the functionalities that the programming language (e.g., Java) needs to call, and the other part contains the system's core libraries.

[0240] The application layer and application framework layer can run in a virtual machine. The virtual machine executes the programming files (e.g., Java files) of the application layer and application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.

[0241] System libraries can include multiple functional modules. For example: Surface Manager, Media Libraries, 3D image processing libraries (e.g., OpenGL ES), 2D graphics engines (e.g., SGL), etc.

[0242] The Surface Manager is used to manage the display subsystem and provides the fusion of two-dimensional (2D) and three-dimensional (3D) layers for multiple applications.

[0243] The media library supports playback and recording of various common audio and video formats, as well as still image files. It supports multiple audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG.

[0244] The 3D image processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.

[0245] A 2D graphics engine is a graphics engine for 2D drawing.

[0246] ARP status is used to obtain and maintain ARP information of access devices and to determine whether the ARP status of access devices is normal.

[0247] The Hardware Abstraction Layer (HAL) is an interface layer located between the operating system kernel and upper-level software, its purpose being to abstract hardware. The HAL is an abstract interface for device kernel drivers, providing application programming interfaces (APIs) for accessing the underlying devices to higher-level Java API frameworks. The HAL can contain multiple library modules, each implementing an interface for a specific type of hardware component.

[0248] The kernel layer is the foundation of the Android operating system; all the final functions of the Android operating system are implemented through the kernel layer. The kernel layer can contain drivers such as WiFi, Bluetooth, display, camera, and audio.

[0249] The Bluetooth driver is used to drive the Bluetooth module.

[0250] The WiFi driver is used to drive the WiFi module. In addition, the WiFi driver can also be used to implement WiFi connection / authentication and determine the WiFi roaming status.

[0251] The hardware layer can include WiFi modules, Bluetooth modules, and may also include displays, microphones, cameras, memory, audio encoders, and video encoders, etc.

[0252] It should be noted that the application provided Figure 5 The illustrated software architecture diagram of the electronic device is for illustrative purposes only.

[0253] This application does not limit the specific module divisions within different layers of the Android operating system; for details, please refer to the general technical descriptions of the Android operating system software architecture. Furthermore, the device communication method provided in this application can also be implemented based on other operating systems, which will not be listed here.

[0254] Figure 6 This is a schematic diagram of the structure of a communication device according to an embodiment of this application. Figure 6 The communication device 600 shown can be a terminal device, a device within a terminal device, or a device that can be used in conjunction with a terminal device.

[0255] Figure 6 The communication device 600 shown may include an acquisition unit 601 and a processing unit 602. Wherein:

[0256] The acquisition unit 601 is used to acquire a first set of identifiers, wherein the first identifier is the identifier of the scanned access device.

[0257] The acquisition unit 601 is also used to acquire a second set of identifiers, wherein the second identifier is the identifier of the access device that has been saved.

[0258] Processing unit 602 is used to determine the matching result between a first identifier in a first identifier set and a second identifier in a second identifier set based on an established hash table, wherein the hash table includes: a first hash table established based on the first identifier in the first identifier set, or a second hash table established based on the second identifier in the second identifier set.

[0259] The processing unit 602 is also used to load the access information of the access devices determined according to the matching results into the list.

[0260] The communication device 600 provided in this application determines the matching relationship between the scanned access device and the saved access device based on a hash table. This avoids the use of a linear search matching method, effectively reduces the matching complexity between the scanned access device and the saved access device, improves the matching speed between the scanned access device and the saved access device, and helps to optimize the loading speed of the access device list and improve the user experience.

[0261] In one possible implementation, the first hash table is built based on a first hash function. Each first identifier in the first identifier set is stored as a key in the first hash table. Based on the established hash table, the matching result between the first identifier in the first identifier set and the second identifier in the second identifier set is determined, including: based on the first hash function, checking whether each second identifier in the second identifier set exists in the first hash table; and determining that at least one second identifier in the second identifier set has a matching relationship with at least one first identifier in the first identifier set, based on the existence of at least one second identifier in the second identifier set in the first hash table.

[0262] Based on this implementation, by constructing a hash table of the scanned access devices and checking whether the saved access devices exist in the hash table, the time complexity of the search process is O(1), which can effectively match the saved access devices with the scanned access devices, significantly improving the matching efficiency.

[0263] In one possible implementation, the processing unit 602 is further configured to: maintain a first hash table; and incrementally update the first hash table in response to a change in one or more first identifiers obtained by the scanning access device.

[0264] Based on this implementation, when the identifier of the scanned access device changes, incremental updates can be used to respond to dynamic changes in the network environment, ensuring that the hash table is always up-to-date and improving real-time response capabilities. Furthermore, incremental updates of the hash table, rather than rebuilding it every time, avoid unnecessary duplicate calculations and further improve performance.

[0265] In one possible implementation, the second hash table is built based on a second hash function. Each second identifier in the second identifier set is stored as a key in the second hash table. Based on the established hash table, the matching result between the first identifier in the first identifier set and the second identifier in the second identifier set is determined, including: based on the second hash function, checking whether each first identifier in the first identifier set exists in the second hash table; and determining that at least one first identifier in the first identifier set and at least one second identifier in the second identifier set have a matching relationship based on the existence of at least one first identifier in the first identifier set in the second hash table.

[0266] Based on this implementation, by constructing a hash table of the saved access devices and checking whether the scanned access devices exist in the hash table, the time complexity of the search process is O(1), which can effectively match the scanned access devices with the saved access devices, significantly improving the matching efficiency. Furthermore, since the hash table of the saved access devices can be constructed during idle time, it does not need to be constructed in real time during each scan, which can further improve the matching efficiency.

[0267] In one possible implementation, the second hash table also stores information about the access devices that are already stored, corresponding to each second identifier in the second identifier set. The information about the access devices is used as a value, and each value forms a key-value pair with its corresponding second identifier.

[0268] Based on this implementation method, by binding the saved device information of the access device with the identifier, it is convenient to directly obtain detailed information related to the access device, ensuring that the device status and data can be viewed at any time. It is suitable for data tracking and management during the device connection process and helps to optimize device management and query process.

[0269] In one possible implementation, the processing unit 602 is further configured to: maintain a second hash table; and update the second hash table in response to changes in the information of the stored access devices.

[0270] Based on this implementation method, the hash table can be automatically updated as the information of the access devices changes, which can maintain the consistency and up-to-dateness of the data, ensure that the device management information always matches the actual situation, and improve the system's adaptability.

[0271] In one possible implementation, the first identifier and the second identifier include the SSID and / or BSSID of the access device.

[0272] This implementation method allows for more flexible matching, helps avoid hash collisions, and enables more accurate identification of access devices.

[0273] Figure 7 This is a schematic diagram of a communication device provided in an embodiment of this application. The communication device 700 can be a terminal device or a network device in the above method embodiments, or it can be a chip, chip system, or processor that supports the terminal device or network device in implementing the above methods. This communication device can be used to implement the methods described in the above method embodiments, and for details, please refer to the description in the above method embodiments.

[0274] The communication device 700 may include one or more processors 701. The processor 701 may be a general-purpose processor or a dedicated processor, such as a baseband processor or a central processing unit (CPU). The baseband processor can be used to process communication protocols and communication data, while the CPU can be used to control the communication device (e.g., base station, baseband chip, terminal, terminal chip, DU or CU, etc.), execute software programs, and process data from the software programs.

[0275] Optionally, the communication device 700 may include one or more memories 702, which may store instructions 704. These instructions can be executed on the processor 701, causing the communication device 700 to perform the methods described in the above method embodiments. Optionally, the memories 702 may also store data. The processor 701 and the memories 702 may be provided separately or integrated together.

[0276] Optionally, the communication device 700 may further include a transceiver 705 and an antenna 706. The transceiver 705, also known as a transceiver unit, transceiver, or transceiver circuit, is used to implement transceiver functions. The transceiver 705 may include a receiver and a transmitter. The receiver, also known as a receiver circuit, is used to implement a receiving function; the transmitter, also known as a transmitter or transmitting circuit, is used to implement a transmitting function. Figure 6 The processing unit 602 shown can be a processor 701.

[0277] In another possible design, the processor 701 may include a transceiver for implementing receive and transmit functions. For example, the transceiver may be a transceiver circuit, an interface, or an interface circuit. The transceiver circuit, interface, or interface circuit for implementing receive and transmit functions may be separate or integrated. The aforementioned transceiver circuit, interface, or interface circuit can be used for reading and writing code / data, or it can be used for transmitting or relaying signals.

[0278] In another possible design, the processor 701 may optionally store instructions 703, which, when executed on the processor 701, cause the communication device 700 to perform the methods described in the above method embodiments. Instructions 703 may be embedded in the processor 701; in this case, the processor 701 may be implemented in hardware.

[0279] The communication device described in the above embodiments may be a terminal device or a network device, but the scope of the communication device described in the embodiments of this application is not limited to this, and the structure of the communication device may vary. Figure 7 The communication device can be a standalone device or part of a larger device. For example, the communication device can be:

[0280] (1) Independent integrated circuit IC, or chip, or chip system or subsystem;

[0281] (2) A collection of one or more ICs, optionally including a storage component for storing data and instructions;

[0282] (3) ASIC, such as modem (MSM);

[0283] (4) Modules that can be embedded in other devices;

[0284] (5) Receivers, terminals, smart terminals, cellular phones, wireless devices, handheld devices, mobile units, vehicle-mounted devices, network devices, cloud devices, artificial intelligence devices, etc.

[0285] (6) Others, etc.

[0286] For cases where the communication device can be a chip or a chip system, please refer to [link / reference]. Figure 8 The diagram shows the structure of the chip. Figure 8 The chip 800 shown includes a processor 801 and an interface 802. Optionally, it may also include a memory 803. The number of processors 801 can be one or more, and the number of interfaces 802 can be multiple.

[0287] For cases where the chip is used to implement the terminal device or network device in the embodiments of this application:

[0288] Interface 802 is used to receive or output signals;

[0289] Processor 801 is used to perform data processing operations on terminal devices or network devices.

[0290] It is understood that some optional features in the embodiments of this application can be implemented independently in certain scenarios without relying on other features, such as the current solution on which they are based, to solve the corresponding technical problems and achieve the corresponding effects. Alternatively, they can be combined with other features as needed in certain scenarios. Accordingly, the communication device given in the embodiments of this application can also implement these features or functions, which will not be elaborated here.

[0291] It should be understood that the processor in the embodiments of this application can be an integrated circuit chip with signal processing capabilities. In implementation, the steps of the above method embodiments can be completed by integrated logic circuits in the processor's hardware or by instructions in software form. The processor described above can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0292] It is understood that the memory in the embodiments of this application can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous linked dynamic random access memory (SLDRAM), and direct rambus RAM (DR RAM). It should be noted that the memory used in the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0293] This application also provides a computer-readable medium storing a computer program or instructions, which, when executed by a communication device, implements the functions of any of the above method embodiments.

[0294] This application also provides a computer program product including instructions, which, when read and executed by a computer, causes the computer to perform the functions of any of the above method embodiments.

[0295] This application provides a communication system, which includes a terminal device and a network device; wherein the terminal device is used to execute the method executed by the terminal device in the above embodiments, and the network device is used to execute the method executed by the network device in the above embodiments.

[0296] The above embodiments can be implemented entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product.

[0297] A computer program product includes one or more computer instructions. When these computer instructions are loaded and executed on a computer, they, in whole or in part, create the processes or functions according to embodiments of this application. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device.

[0298] Computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means.

[0299] Computer-readable storage media can be any available medium that a computer can access, or a data storage device such as a server or data center that integrates one or more available media. Available media can be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., high-density digital video discs (DVDs)), or semiconductor media (e.g., solid-state disks (SSDs)).

[0300] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some operations can be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.

[0301] The descriptions of the various embodiments provided in this application can be referenced mutually. Each embodiment has its own emphasis, and parts not described in detail in a certain embodiment can be referred to the relevant descriptions of other embodiments. For the sake of convenience and brevity, for example, the functions and operations of the various devices and equipment provided in the embodiments of this application can be referred to the relevant descriptions of the method embodiments of this application. The method embodiments and the device embodiments can also be referenced, combined or cited from each other.

[0302] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.

Claims

1. A list loading method, characterized in that, The method includes: In response to the user turning on the WiFi switch, the WiFi module is activated and the system scans for connectable WiFi networks; Obtain a first set of identifiers, wherein the first identifier is the identifier of the scanned access device, and the first identifier includes the SSID and BSSID of the scanned access device; Obtain a second set of identifiers, wherein the second identifier is a saved identifier of the access device, and the second identifier includes the saved SSID and BSSID of the access device; Based on the established hash table, the matching result between the first identifier in the first identifier set and the second identifier in the second identifier set is determined. The hash table includes: a first hash table based on the first identifier in the first identifier set, or a second hash table based on the second identifier in the second identifier set. Both the first hash table and the second hash table are hierarchical hash tables based on SSID and BSSID. The hierarchical hash table includes a first-level hash table based on a hash function with SSID as the key, and a second-level hash table based on another hash function independent of the hash function with BSSID as the key. The value corresponding to the SSID in the first-level hash table points to the second-level hash table. The access information of the access devices determined based on the matching results will be loaded into a list and presented to the user.

2. The method according to claim 1, characterized in that, The first hash table is a hierarchical hash table built based on a first hash function and SSID, and another hash function independent of the first hash function and BSSID. The SSID of each first identifier in the first identifier set is used as a key, and the first hash function is used to construct a first-level hash table within the first hash table. The value of the first-level hash table is a second-level hash table constructed using the BSSID of the first identifier as a key and the other hash function independent of the first hash function. Determining the matching result between a first identifier in the first identifier set and a second identifier in the second identifier set based on the established hash tables includes: Based on the first hash function, for each SSID in the second identifier set, check if it exists in the first hash table; If the SSID in the second identifier exists in the first hash table, based on the other hash function independent of the first hash function, check whether the BSSID corresponding to the SSID in the second identifier exists in the first hash table; Based on the fact that the SSID and BSSID included in at least one second identifier in the second identifier set exist in the first hash table, it is determined that at least one second identifier in the second identifier set has a matching relationship with at least one first identifier in the first identifier set.

3. The method according to claim 2, characterized in that, The method further includes: Maintain the first hash table; In response to a change in one or more first identifiers obtained by the scanning access device, the first hash table is incrementally updated.

4. The method according to claim 1, characterized in that, The second hash table is a hierarchical hash table built based on a second hash function and SSID, and another hash function independent of the second hash function and BSSID. The SSID of each second identifier in the second identifier set is used as a key, and the second hash function is used to construct the first layer hash table within the second hash table. The value of the first layer hash table is the second layer hash table constructed using the BSSID of the second identifier as a key and the other hash function independent of the second hash function. Determining the matching result between the first identifier in the first identifier set and the second identifier in the second identifier set based on the established hash table includes: Based on the second hash function, for each SSID in the first identifier in the first identifier set, check if it exists in the second hash table; If the SSID in the first identifier exists in the second hash table, based on the other hash function independent of the second hash function, check whether the BSSID corresponding to the SSID in the first identifier exists in the second hash table; Based on the fact that the SSID and BSSID included in at least one first identifier in the first identifier set exist in the second hash table, it is determined that at least one first identifier in the first identifier set and at least one second identifier in the second identifier set have a matching relationship.

5. The method according to claim 4, characterized in that, The second layer hash table in the second hash table also stores information about the saved access devices corresponding to each second identifier in the second identifier set. The information about the saved access devices is used as a value, and it forms a key-value pair of the second layer hash table in the second hash table with the BSSID in the corresponding second identifier.

6. The method according to claim 5, characterized in that, The method further includes: Maintain the second hash table; In response to changes in the information of the access devices that have been saved, the second hash table is updated.

7. A communication device, characterized in that, include: The processing unit is used to activate the WiFi module and scan for connectable WiFi networks in response to the user turning on the WiFi switch; The acquisition unit is used to acquire a first set of identifiers, wherein the first identifier is the identifier of the scanned access device, and the first identifier includes the SSID and BSSID of the scanned access device; The acquisition unit is further configured to acquire a second set of identifiers, wherein the second identifier is an identifier of a saved access device, and the second identifier includes the SSID and BSSID of the saved access device; The processing unit is further configured to determine, based on the established hash table, the matching result between the first identifier in the first identifier set and the second identifier in the second identifier set, wherein the hash table includes: a first hash table established based on the first identifier in the first identifier set, or a second hash table established based on the second identifier in the second identifier set, wherein both the first hash table and the second hash table are hierarchical hash tables established based on SSID and BSSID, the hierarchical hash table includes a first-level hash table established based on a hash function with SSID as the key, and a second-level hash table established based on another hash function independent of the hash function with BSSID as the key, wherein the value corresponding to the SSID in the first-level hash table points to the second-level hash table; The processing unit is also used to load the access information of the access devices determined according to the matching results into a list and present it to the user.

8. A communication device, characterized in that, It includes a processor and a memory, the processor and the memory being coupled, the processor being used to implement the method as described in any one of claims 1-6.

9. A chip, characterized in that, The device includes a processor and an interface, the processor and the interface being coupled; the interface is used to receive or output signals, and the processor is used to execute code instructions to cause the method of any one of claims 1-6 to be performed.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when invoked by the computer, cause the computer to perform the method as described in any one of claims 1-6.

11. A computer program product comprising computer instructions, characterized in that, When the computer instructions are executed by the processor, they implement the method as described in any one of claims 1-6.

Citation Information

Patent Citations

  • Wireless local area network connection method and device

    CN105744598A

  • Method for automatically switching configured routers by intelligent equipment

    CN108012311A

  • Data retrieval method, device and equipment and machine readable storage medium

    CN114647658A

  • Commodity data updating method and device, electronic equipment and storage medium

    CN117493342A