Network distribution method, equipment and storage medium

By loading the short-range wireless module firmware program when the electronic device starts up, and obtaining and utilizing pre-configuration information to automatically determine the working mode, the development difficulty and cumbersome user operation of wireless device network configuration in the prior art are solved, realizing seamless network configuration, reducing channel interference and improving transmission rate and reliable networking capability.

CN121665371APending Publication Date: 2026-03-13QUECTEL WIRELESS SOLUTIONS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511860177.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-10
Publication Date
2026-03-13

AI Technical Summary

Technical Problem

Existing wireless device network configuration methods rely on host-side control, which is difficult to develop, cumbersome for users, causes severe signal interference, reduces transmission speed, and makes it difficult to achieve reliable networking.

Method used

When an electronic device starts up, it loads the firmware program of the short-range wireless module, obtains the pre-configured network connection information, determines the working mode, and establishes a network connection with other devices based on the mode, thereby realizing automated and seamless network configuration.

Benefits of technology

It reduces the difficulty of host-side development, shortens network connection time, lowers the user threshold, improves user experience, reduces channel interference, and enhances transmission rate and reliable networking capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121665371A_ABST
    Figure CN121665371A_ABST
Patent Text Reader

Abstract

The invention provides a network distribution method and device and a storage medium, and the method comprises the steps: loading and operating a firmware program in a first short-distance wireless module in a starting process of a first electronic device; when the firmware program runs, network connection information which is obtained through pre-configuration and stored in the first short-distance wireless module is obtained; determining a working mode of the first short-distance wireless module according to the network connection information; and establishing network connection with a second short-distance wireless module in at least one second electronic device based on the working mode. According to the method and the device, the first short-distance wireless module can automatically search the network of the corresponding service while being powered on, automatic connection is realized, non-inductive network distribution experience of'power-on, namely networking 'is achieved, participation of a host end and a user is not needed, the development difficulty of the host end is reduced, the time for establishing networking of the equipment is shortened, and the efficiency of the equipment is improved. The use threshold of the user is lowered, and the use experience of the user is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of network communication technology, and more specifically, to a network distribution method, device, and storage medium. Background Technology

[0002] With the rapid development of IoT technology, various smart devices (such as smart home devices, wearable devices, and industrial sensors) are widely integrating short-range wireless communication modules to achieve convenient wireless networking and data interaction. In practical applications, users expect smart devices to be able to "connect to the network as soon as they are powered on," achieving a fast, stable, and automatic networking experience without manual intervention. Therefore, improving the autonomous networking capabilities of wireless modules and reducing reliance on host control logic has become a key issue in improving product usability and development efficiency.

[0003] Currently, common methods for configuring wireless devices include manual network configuration and auxiliary network configuration. Manual network configuration is typically initiated by the user through a mobile app or web interface. The host-side driver module performs a scan to list available networks. After the user selects the target network and enters the password, the host sends a connection command to complete the connection. Auxiliary network configuration includes methods such as Soft Access Point (SoftAP) configuration, Bluetooth configuration, and QR code configuration. For example, the device first enters AP mode and broadcasts a hotspot; the user connects to this hotspot via their mobile phone and sends router credentials; or Wi-Fi configuration information is transmitted via Bluetooth.

[0004] However, the aforementioned existing technologies are all dominated by the host end, with the short-range wireless communication module only acting as an execution unit to respond to commands. This has several drawbacks, such as high development difficulty, cumbersome user operation steps, severe signal interference, reduced transmission rate, and difficulty in achieving reliable networking. Summary of the Invention

[0005] The purpose of this application is to address the shortcomings of the prior art by providing a network distribution method, device, and storage medium to solve the problems of high development difficulty, cumbersome user operation steps, severe signal interference, reduced transmission rate, and difficulty in achieving reliable networking in the prior art.

[0006] To achieve the above objectives, the technical solutions adopted in the embodiments of this application are as follows: In a first aspect, one embodiment of this application provides a network configuration method applied to a first short-range wireless module, the first short-range wireless module being disposed in a first electronic device, the method comprising: During the startup process of the first electronic device, the firmware program in the first short-range wireless module is loaded and run; When the firmware program is running, it acquires pre-configured network connection information stored in the first short-range wireless module. The network connection information includes at least the code corresponding to the service role of the first short-range wireless module. Based on the network connection information, the operating mode of the first short-range wireless module is determined, and the operating mode is used to indicate the radio frequency mode and the application service type. Based on the operating mode, a network connection is established with a second short-range wireless module in at least one second electronic device.

[0007] Optionally, establishing a network connection with a second short-range wireless module in at least one second electronic device based on the operating mode includes: Based on the operating mode, determine the current role of the first short-range wireless module in the network; Based on the current role and the pre-configured custom fields, establish a network connection with a second short-range wireless module in at least one second electronic device.

[0008] Optionally, establishing a network connection with a second short-range wireless module in at least one second electronic device based on the current role and pre-configured custom fields includes: If the current role is the master device role, then the current channel and current bandwidth are determined, and a network connection is established with the second short-range wireless module in at least one second electronic device based on the current channel, the current bandwidth, and a pre-configured custom field.

[0009] Optionally, determining the current channel and current bandwidth includes: Traverse all channels under the radio frequency mode, determine the current channel status information for the current channel, and after the traversal is completed, determine the current channel based on the status information of all channels, and determine the current bandwidth based on the current channel.

[0010] Optionally, establishing a network connection with a second short-range wireless module in at least one second electronic device based on the current channel and a pre-configured custom field includes: The pre-configured custom fields are added to the broadcast frame, and the broadcast frame is broadcast through the current channel so that a second short-range wireless module in at least one second electronic device establishes a network connection with the first short-range wireless module based on the broadcast frame.

[0011] Optionally, establishing a network connection with a second short-range wireless module in at least one second electronic device based on the current role and pre-configured custom fields includes: If the current role is a slave device role, then at least one current frame is obtained, and a network connection is established with the second short-range wireless module in at least one second electronic device based on each current frame and a pre-configured custom field.

[0012] Optionally, establishing a network connection with a second short-range wireless module in at least one second electronic device based on each current frame and a pre-configured custom field includes: Each current frame is parsed to obtain the target field corresponding to each current frame; Based on the target field corresponding to each current frame and the pre-configured custom field, a network connection is established with a second short-range wireless module in at least one second electronic device.

[0013] Optionally, establishing a network connection with a second short-range wireless module in at least one second electronic device based on the target field corresponding to each current frame and a pre-configured custom field includes: The target field corresponding to each current frame is matched with the pre-configured custom field. If the target field corresponding to the current frame matches the custom field, the main device corresponding to the current frame is taken as an optional electronic device, and at least one optional electronic device is obtained. Based on the network quality of each optional electronic device, the second electronic device is determined, and a network connection is established with the second short-range wireless module in the second electronic device.

[0014] Secondly, another embodiment of this application provides a network distribution device applied to a first short-range wireless module, the first short-range wireless module being disposed in a first electronic device, the network distribution device comprising: The running module is used to load and run the firmware program in the first short-range wireless module during the startup process of the first electronic device; The acquisition module is used to acquire network connection information that has been pre-configured and stored in the first short-range wireless module during the execution of the firmware program. The network connection information includes at least the code corresponding to the service role of the first short-range wireless module. The determining module is used to determine the operating mode of the first short-range wireless module based on the network connection information, wherein the operating mode is used to indicate the radio frequency mode and the application service type. A connection module is used to establish a network connection with a second short-range wireless module in at least one second electronic device based on the operating mode.

[0015] Optionally, the connection module is specifically used for: Based on the operating mode, determine the current role of the first short-range wireless module in the network; Based on the current role and the pre-configured custom fields, establish a network connection with a second short-range wireless module in at least one second electronic device.

[0016] Optionally, the connection module is specifically used for: If the current role is the master device role, then the current channel and current bandwidth are determined, and a network connection is established with the second short-range wireless module in at least one second electronic device based on the current channel, the current bandwidth, and a pre-configured custom field.

[0017] Optionally, the connection module is specifically used for: Traverse all channels under the radio frequency mode, determine the current channel status information for the current channel, and after the traversal is completed, determine the current channel based on the status information of all channels, and determine the current bandwidth based on the current channel.

[0018] Optionally, the connection module is specifically used for: The pre-configured custom fields are added to the broadcast frame, and the broadcast frame is broadcast through the current channel so that a second short-range wireless module in at least one second electronic device establishes a network connection with the first short-range wireless module based on the broadcast frame.

[0019] Optionally, the connection module is specifically used for: If the current role is a slave device role, then at least one current frame is obtained, and a network connection is established with the second short-range wireless module in at least one second electronic device based on each current frame and a pre-configured custom field.

[0020] Optionally, the connection module is specifically used for: Each current frame is parsed to obtain the target field corresponding to each current frame; Based on the target field corresponding to each current frame and the pre-configured custom field, a network connection is established with a second short-range wireless module in at least one second electronic device.

[0021] Optionally, the connection module is specifically used for: The target field corresponding to each current frame is matched with the pre-configured custom field. If the target field corresponding to the current frame matches the custom field, the main device corresponding to the current frame is taken as an optional electronic device, and at least one optional electronic device is obtained. Based on the network quality of each optional electronic device, the second electronic device is determined, and a network connection is established with the second short-range wireless module in the second electronic device.

[0022] Thirdly, another embodiment of this application provides an electronic device, including: a processor, a storage medium, and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the machine-readable instructions to perform the steps of any of the methods described in the first aspect above.

[0023] Fourthly, another embodiment of this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, performs the steps of any of the methods described in the first aspect above.

[0024] The beneficial effects of this application are as follows: By loading and running the firmware program in the short-range wireless module during the startup process of the first electronic device, the firmware program can obtain pre-configured network connection information stored in the first short-range wireless module during runtime. Based on the network connection information, the operating mode of the first short-range wireless module is determined, and a network connection is established with at least one second short-range wireless module in a second electronic device based on the operating mode. This allows the first short-range wireless module to automatically search for the network corresponding to its service and automatically connect upon power-on, achieving a seamless network configuration experience of "network setup upon power-on." This eliminates the need for host-side and user involvement, reducing the development difficulty of the host side and shortening the time required for device network establishment, lowering the user's barrier to entry and improving the user experience. Furthermore, by pre-configuring and storing the network connection information in the first short-range wireless module to determine its operating mode and establish a network connection based on that mode, channel interference after connection is reduced, transmission rate is increased, and reliable networking is achieved. Attached Figure Description

[0025] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0026] Figure 1 A schematic flowchart of a power distribution method provided in an embodiment of this application; Figure 2 A schematic flowchart illustrating the process of establishing a network connection with a second short-range wireless module in at least one second electronic device in the network distribution method provided in this application embodiment; Figure 3Another schematic diagram of the process of establishing a network connection with a second short-range wireless module in at least one second electronic device in the network distribution method provided in the embodiments of this application; Figure 4 Another schematic diagram of the process of establishing a network connection with a second short-range wireless module in at least one second electronic device in the network distribution method provided in the embodiments of this application; Figure 5 A schematic diagram of a power distribution network device provided in an embodiment of this application; Figure 6 This is a schematic diagram of the electronic device structure provided in an embodiment of this application. Detailed Implementation

[0027] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. It should be understood that the accompanying drawings in this application are for illustrative and descriptive purposes only and are not intended to limit the scope of protection of this application. Furthermore, it should be understood that the schematic drawings are not drawn to scale. The flowcharts used in this application illustrate operations implemented according to some embodiments of this application. It should be understood that the operations in the flowcharts may not be implemented in sequence, and steps without logical contextual relationships may be reversed or implemented simultaneously. In addition, those skilled in the art, guided by the content of this application, may add one or more other operations to the flowcharts, or remove one or more operations from the flowcharts.

[0028] Furthermore, the described embodiments are merely some, not all, of the embodiments of this application. The components of the embodiments of this application described and illustrated herein can typically be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.

[0029] It should be noted that the term "comprising" will be used in the embodiments of this application to indicate the presence of the features declared thereafter, but does not exclude the addition of other features.

[0030] Currently, common methods for configuring wireless devices include manual network configuration and auxiliary network configuration. Manual network configuration is typically initiated by the user through a mobile app or web interface. The host-side driver module performs a scan to list available networks. After the user selects the target network and enters the password, the host sends a connection command to complete the connection. Auxiliary network configuration includes methods such as Soft Access Point (SoftAP) configuration, Bluetooth configuration, and QR code configuration. For example, the device first enters AP mode and broadcasts a hotspot; the user connects to the hotspot via their mobile phone and sends router credentials; or Wi-Fi configuration information is transmitted via Bluetooth.

[0031] However, firstly, the network configuration process heavily relies on host-side software development, requiring developers to have a deep understanding of the Wi-Fi protocol stack and underlying control interfaces, increasing development difficulty and time. Simultaneously, the user operation steps are cumbersome, failing to meet the demand for "seamless network configuration." Secondly, most solutions do not consider RF environment optimization; AP or P2P-GO devices often randomly select channels for network construction, easily leading to channel conflicts with other networks, resulting in severe signal interference and reduced transmission rates. Furthermore, the lack of a unified identification mechanism between different devices makes it difficult to achieve automatic discovery and trusted networking of products from the same brand or similar products. Finally, existing solutions generally fail to achieve module-level intelligent decision-making, unable to dynamically select the optimal RF operating mode (such as AP, STA, P2P-GO / GC, BT, etc.) based on device type and service role, limiting adaptive networking capabilities in multiple scenarios.

[0032] Therefore, the aforementioned existing technologies are all dominated by the host end, with the short-range wireless communication module only acting as an execution unit to respond to commands. This results in several drawbacks, such as high development difficulty, cumbersome user operation steps, severe signal interference, reduced transmission rate, and difficulty in achieving reliable networking.

[0033] Based on the aforementioned problems, this application proposes a network configuration method applied to a first short-range wireless module. By loading and running the firmware program in the short-range wireless module during the startup process of the first electronic device, the method can acquire pre-configured network connection information stored in the first short-range wireless module during firmware runtime. Based on this network connection information, the operating mode of the first short-range wireless module is determined, and a network connection is established with a second short-range wireless module in at least one second electronic device based on this operating mode. This allows the first short-range wireless module to automatically search for and connect to the network corresponding to its service upon power-up, without requiring intervention from the host or user. This reduces the development difficulty of the host and shortens the time required for device network establishment, lowering the user's barrier to entry and improving the user experience.

[0034] First, the relevant concepts and application scenarios involved in the power distribution method provided in the embodiments of this application will be explained.

[0035] A short-range wireless module is a standalone hardware module that integrates one or more short-range wireless communication technologies to enable wireless data transmission between electronic devices over a limited distance (usually a few meters to hundreds of meters).

[0036] Short-range wireless modules can typically be used as Wi-Fi APs, Wi-Fi STAs, Wi-Fi P2P Go, Wi-Fi P2P Gc, and BitTorrent.

[0037] In this context, an Access Point (AP) is a device (such as a router) that provides Wi-Fi access. A Station (STA) is a client device (such as a mobile phone) connected to an AP. This includes Group Owners (GOs) and Group Clients (GCs). A GO acts as a temporary AP, managing P2P groups. A GC is a client device connected to a GO.

[0038] Wi-Fi Beacon frames are broadcast frames periodically sent by the access point (AP) to announce the existence of the network. They contain SSID, supported speeds, security parameters, etc., and are sent by the AP at certain time intervals to inform the outside world of the existence of its wireless network. The frame includes a Vendor Specific field, which can carry custom vendor information.

[0039] One-Time Programmable (OTP) memory is a type of memory that, once programmed, cannot be changed or erased.

[0040] WiFi P2P technology is also known as Wi-Fi Direct. The Wi-Fi Direct standard allows devices in a wireless network to connect to each other without a router. This standard allows wireless devices to interconnect in a point-to-point manner, and it offers significant improvements in transmission speed and range compared to Bluetooth.

[0041] In peer-to-peer (Wi-Fi Direct, P2P) connections, devices have two roles: Group Owner (GO) and Group Client (GC). The GO is the master device, acting as a temporary access point (AP) to manage the P2P group. The GC is a slave device, a client connected to the GO. During P2P operations, the GO and Client form a group. Groups are of two types: Persistent Groups and Temporary Groups.

[0042] In this context, "Persist Group" refers to a GO being played by a designated device, and once the security configuration information and group-related information are generated, they will not change. This information can be directly utilized in subsequent uses, significantly reducing connection time.

[0043] In this context, Temporary Group refers to the role assignment between Go and Client determined by Group Formation, which is the result of negotiation between the two devices. Its information is temporary, requiring a temporary creation for each subsequent use, resulting in a longer connection time than Persist Group.

[0044] It is understood that the network configuration method provided in this application embodiment can be applied in scenarios where multiple electronic devices need to connect to the network. These electronic devices can be smart devices, such as smart home devices, multi-protocol gateway devices, mobile IoT devices, and other terminal devices. Specifically, smart home devices include smart TVs, projectors, home cameras, and smart speakers. Mobile IoT devices include drones and action cameras. Other terminal devices include mobile phones, tablets, and retail terminals. All electronic devices are equipped with short-range wireless modules.

[0045] The following describes the network configuration method provided by the embodiments of this application in conjunction with several examples. It should be noted that this application uses the example of a first short-range wireless module in a first electronic device and a second short-range wireless module in at least one second electronic device for network configuration. Both the first electronic device and the second electronic device can be any of the aforementioned electronic devices.

[0046] Figure 1 This is a schematic flowchart of a power distribution method provided in an embodiment of this application, referring to... Figure 1 As shown, the execution subject of this method can be a first short-range wireless module, which is disposed in a first electronic device. The method includes: S101. During the startup process of the first electronic device, the firmware program in the first short-range wireless module is loaded and run.

[0047] It is understood that the first short-range wireless module is installed in the first electronic device. When the first electronic device containing the first short-range wireless module is started, the first short-range wireless module is powered on and automatically loads and runs its internal firmware program.

[0048] Optionally, when the first electronic device is powered on, its power system simultaneously supplies power to the first short-range wireless module, and the first short-range wireless module loads its firmware program. The firmware program refers to the firmware execution code on the local processor of the first short-range wireless module.

[0049] S102. During firmware operation, obtain the network connection information that has been pre-configured and stored in the first short-range wireless module.

[0050] Optionally, during firmware runtime, network connection information that has been pre-configured and stored in the first short-range wireless module is obtained.

[0051] For example, during the production process, Wi-Fi modules can pre-write network connection information into the OTP of the first short-range wireless module according to business needs.

[0052] The network connection information includes at least the code corresponding to the service role of the first short-range wireless module. The network connection information may also include the code corresponding to the device type and the code corresponding to the application service type.

[0053] For example, the code corresponding to the service role refers to the sum of the codes of all service roles of the first short-range wireless module, and the code corresponding to the application service type refers to the sum of the codes of all application service types of the first short-range wireless module.

[0054] Specifically, the service role refers to the communication role that the first short-range wireless module should play in the wireless network, which is used to indicate how the first short-range wireless communication module connects and interacts with other short-range wireless communication modules.

[0055] Specifically, the device type refers to the type of electronic device on which the first short-range wireless module is installed, used to identify the category or purpose of the first electronic device.

[0056] Specifically, the application service type refers to the upper-layer business application or service protocol that the first short-range wireless module needs to run, which is used to instruct the first electronic device to start the corresponding software service process.

[0057] For example, the mapping relationship between the service roles of different electronic devices, the codes corresponding to the service roles, the device types, the codes corresponding to the device types, the application service types, and the codes corresponding to the application service types can be shown in Table 1 below: Table 1

[0058] For example, network connection information can be encrypted using an encryption algorithm and then stored in the OTP. Correspondingly, when retrieving pre-configured network connection information stored in the first short-range wireless module, the network connection information can be obtained by decrypting it using the decryption algorithm corresponding to the encryption algorithm. The encryption algorithm may include algorithms such as XOR, permutation-shift, and SM4.

[0059] For example, the network connection information may also include a verification field, which is used to verify the validity and correctness of the network connection information.

[0060] S103. Determine the operating mode of the first short-range wireless module based on the network connection information.

[0061] Optionally, after obtaining the network connection information, the network connection information is analyzed and judged to determine the working mode of the first short-range wireless module.

[0062] For example, after obtaining network connection information, the network connection information can be parsed by combining the mapping relationship between service role, the code corresponding to the service role, device type, the code corresponding to the device type, application service type, and the code corresponding to the application service type, so as to identify the working mode of the first short-range wireless module.

[0063] The operating mode indicates the radio frequency (RF) mode and application service type. Specifically, the RF mode refers to the communication role of the wireless module at the physical and data link layers, including: Wi-Fi AP, STA, P2P-GO, P2P-GC, BLE, etc. The application service type refers to the upper-layer service functions or application scenarios that the first short-range wireless module will run, including: DLNA, Miracast, AirPlay, NAT forwarding, etc.

[0064] In one example, if the network connection information obtained has a device type value of 0x05 (network display), a service role value of 0x0007 (wifi-p2p-Go+wifi-p2p-Gc+wifi-STA), and an application service type value of 0x0003 (miracast+DLNA), it can be determined that the first electronic device containing the first short-range wireless communication module is a smart TV that supports screen casting and internet access. At this time, it can be determined that the radio frequency mode is wifi-p2p-Go and STA, and P2P-GO is enabled for miracast screen casting, and STA is enabled for scanning and connecting to wifi for internet access and enabling DLNA server transmission.

[0065] In another example, in the obtained network connection information, the device type value is 0x04 (Halow gateway), the service role value is 0x01c0 (Halow-AP+Halow-STA+Halow-MESH), and the application service type is 0x0080 (NAT). This indicates that the first electronic device containing the first short-range wireless communication module is a gateway supporting AP+STA+MESH functionality. In this case, the radio frequency mode can be determined to be: Halow-AP, Halow-STA, Halow-MESH, and Halow-AP+Halow-STA+Halow-MESH can be enabled, establishing NAT transmission between the three interfaces.

[0066] S104. Based on the operating mode, establish a network connection with a second short-range wireless module in at least one second electronic device.

[0067] Optionally, after determining the operating mode of the first short-range wireless module, the first short-range wireless module executes the corresponding networking strategy according to the radio frequency mode and application service type indicated by the operating mode, and establishes a network connection with the second short-range wireless module in at least one second electronic device based on the networking strategy. This achieves automated, intelligent, and reliable networking without the need for host intervention, significantly improving the interoperability, anti-interference capability, and user experience between electronic devices.

[0068] The networking strategies include: networking strategies when the device is the master device and networking strategies when the device is the slave device.

[0069] In this embodiment, by loading and running the firmware program in the short-range wireless module during the startup process of the first electronic device, the firmware program can obtain pre-configured network connection information stored in the first short-range wireless module during runtime. Based on the network connection information, the operating mode of the first short-range wireless module is determined, and a network connection is established with a second short-range wireless module in at least one second electronic device based on the operating mode. This allows the first short-range wireless module to automatically search for the network corresponding to the service and automatically connect upon power-on, achieving a seamless network configuration experience of "network setup upon power-on." This eliminates the need for host-side and user involvement, reducing the development difficulty of the host side and shortening the time for device network establishment, lowering the user's barrier to entry and improving the user experience. Furthermore, by pre-configuring and storing the network connection information in the first short-range wireless module to determine its operating mode and establish a network connection based on that mode, channel interference after connection is reduced, transmission rate is increased, and reliable networking is achieved.

[0070] In one possible implementation, Figure 2 A schematic flowchart illustrating the process of establishing a network connection with a second short-range wireless module in at least one second electronic device in the network distribution method provided in this application embodiment, referring to... Figure 2 As shown, in S104 above, establishing a network connection with a second short-range wireless module in at least one second electronic device based on the working mode includes: S201. Determine the current role of the first short-range wireless module in the network according to the working mode.

[0071] Optionally, after obtaining the working mode, the service role code in the working mode is parsed according to the mapping relationship between the service role, the code corresponding to the service role, the device type, the code corresponding to the device type, the application service type, and the code corresponding to the application service type. The code value is parsed and mapped into a combination of multiple radio frequency modes to obtain a radio frequency mode set.

[0072] Optionally, after obtaining the set of radio frequency modes, all radio frequency modes supported by the first short-range wireless communication module can be determined. Then, it can be determined whether a master device type mode exists in the set of radio frequency modes. If so, the current role of the first short-range wireless communication module in the network is determined to be a master device; if not, the current role of the first short-range wireless communication module in the network is determined to be a slave device. Master device type modes include: Wi-Fi AP, P2P-GO, Halow-AP, and Mesh Master, etc.

[0073] In one example, if the value of the service role in the obtained network connection information is 0x0004 (wifi-STA), it can be determined that the current role is a slave device.

[0074] In another example, if the network connection information shows a device type value of 0x05 (network display), a service role value of 0x0007 (wifi-p2p-Go+wifi-p2p-Gc+wifi-STA), and an application service type value of 0x0003 (miracast+DLNA), it can be determined that the radio frequency mode set contains both master and slave device modes. Therefore, the current role can be determined based on the service to be executed. Alternatively, it can be prioritized to run as a master device (for enabling Miracast screen mirroring hotspot).

[0075] S202. Based on the current role and the pre-configured custom fields, establish a network connection with the second short-range wireless module in at least one second electronic device.

[0076] Optionally, after determining the current role, a network connection can be established with the second short-range wireless module in at least one second electronic device, based on the networking strategy corresponding to the current role and the pre-configured custom fields.

[0077] The pre-configured custom fields can be pre-configured specific identification information used to characterize the service attributes of the first short-range wireless module. These pre-configured custom fields are used for identification and non-interactive network configuration. Specifically, the service attributes include: product type, manufacturer, supported protocols, SSID, and other information.

[0078] For example, taking the IEEE 802.11 standard as an example, the pre-configured custom field can be the Vendor-Specific Information Element (Vendor IE) in the IEEE 802.11 standard.

[0079] For example, the Vendor IE may include the following fields: Vendor-defined IE field (Element ID), Total Length field (Length), Vendor Unique Identifier field (OUI), Vendor-defined Type Number field (OUI Type), and Data Content field (Vendor Data). The Element ID is fixed at '0xDD'. The Length field indicates the total length of subsequent data. The OUI Type field is used to distinguish private messages for different purposes (e.g., 0x01 represents "network broadcast", 0x02 represents "firmware upgrade"). The Vendor Data field may include an encrypted Magic Code and a connection password. The Magic Code is used for security and validity identification of the vendor's family code. The connection password is used to establish a secure connection.

[0080] By determining the current role of the first short-range wireless module in the network through the working mode, and establishing a network connection with the second short-range wireless module in at least one second electronic device based on the current role and the pre-configured custom fields, the security and accuracy of the network connection process can be improved, avoiding blindly connecting to all visible WIFI hotspots and achieving selective network configuration. At the same time, it also supports cross-brand isolation.

[0081] The following example, using the current role as the primary device role, illustrates the process of establishing a network connection with a second short-range wireless module in at least one second electronic device based on the current role and pre-configured custom fields.

[0082] In one possible implementation, the process in S202 above, which establishes a network connection with a second short-range wireless module in at least one second electronic device based on the current role and a pre-configured custom field, includes: If the current role is the master device role, then determine the current channel and current bandwidth, and establish a network connection with the second short-range wireless module in at least one second electronic device based on the current channel, current bandwidth and pre-configured custom fields.

[0083] Optionally, if the current role is the master device role, the surrounding channel environment can be scanned and judged to determine the current channel and current bandwidth.

[0084] Optionally, after determining the current channel and bandwidth, a Beacon frame can be broadcast according to the channel and bandwidth indicated by the current channel and bandwidth, and based on pre-configured custom fields, to establish a network connection with the second short-range wireless module in at least one second electronic device. This avoids congested channels, selects the channel and bandwidth with the least interference for network construction, and improves network quality. Simultaneously, by determining the current channel and bandwidth, the initial connection success rate can be improved, achieving truly stable networking without user intervention.

[0085] For example, a Beacon frame can be broadcast according to the channel and bandwidth indicated by the current channel and bandwidth, and according to the SSID of the current role, the encryption method of the current role, the password of the current role, and the pre-configured custom fields to establish a network connection with the second short-range wireless module in at least one second electronic device.

[0086] The SSID and encryption method of the current role can be read from pre-configured custom fields or pre-stored in the first short-range wireless module. The password of the current role can be read from pre-configured custom fields.

[0087] In one possible implementation, the above steps for determining the current channel and current bandwidth include: Traverse all channels in the radio frequency mode, determine the current channel's status information for the current channel, and after the traversal is complete, determine the current channel based on the status information of all channels, and determine the current bandwidth based on the current channel.

[0088] Optionally, all channels in the radio frequency mode can be traversed, and for the current channel that is traversed, the status information of the current channel can be determined. After the traversal is completed, the current channel can be determined based on the status information of all channels, and the current bandwidth can be determined based on the current channel, thereby ensuring network quality, reducing interference, and improving user experience.

[0089] The current channel status information includes: Signal Strength Index (RSSI), Signal-to-Noise Ratio (SNR), and Channel Cleanliness Score. The Channel Cleanliness Score can be calculated from the number of Beacon frames received during the channel scan.

[0090] For example, the optimal channel can be determined as the current channel based on the signal strength and signal-to-noise ratio, and the appropriate bandwidth for the current channel can be determined under the current environment, thereby obtaining the current bandwidth.

[0091] In one possible implementation, the above steps, based on the current channel and a pre-configured custom field, establish a network connection with a second short-range wireless module in at least one second electronic device, including: The pre-configured custom fields are added to the broadcast frame, and the broadcast frame is broadcast through the current channel so that the second short-range wireless module in at least one second electronic device establishes a network connection with the first short-range wireless module based on the broadcast frame.

[0092] Optionally, pre-configured custom fields are added to the broadcast frame (Beacon frame), and the Beacon frame is broadcast according to the current channel and current bandwidth. This enables the second short-range wireless module in at least one second electronic device to establish a network connection with the first short-range wireless module based on the broadcast frame after receiving it. Furthermore, since the broadcast frame carries pre-configured custom fields, whitelisting can be performed through these custom fields, thereby avoiding accidental connections with other ordinary Wi-Fi devices or devices not belonging to this system. At the same time, no user password is required, and no HOST intervention is needed, achieving true "seamless network configuration".

[0093] The above example, using the current role as the master device role, illustrates the process of establishing a network connection with a second short-range wireless module in at least one second electronic device based on the current role and pre-configured custom fields. The following example, using the current role as the slave device role, illustrates the process of establishing a network connection with a second short-range wireless module in at least one second electronic device based on the current role and pre-configured custom fields.

[0094] In one possible implementation, the process in S202 above, which establishes a network connection with a second short-range wireless module in at least one second electronic device based on the current role and a pre-configured custom field, includes: If the current role is a slave device role, then at least one current frame is obtained, and a network connection is established with the second short-range wireless module in at least one second electronic device based on each current frame and the pre-configured custom fields.

[0095] Optionally, if the current role is a slave device role, at least one current frame is monitored and scanned. The current frame can be a Beacon frame or a P2P Discovery frame.

[0096] For example, scanning can be performed for a preset duration, such as 3 seconds.

[0097] Optionally, after acquiring at least one current frame, each current frame can be parsed and compared with a pre-configured custom field to establish a network connection with a second short-range wireless module in at least one second electronic device.

[0098] In one possible implementation, Figure 3 This is another schematic diagram illustrating the process of establishing a network connection with a second short-range wireless module in at least one second electronic device in the network distribution method provided in this application embodiment, referring to... Figure 3 As shown, the above steps, based on each current frame and pre-configured custom fields, establish a network connection with a second short-range wireless module in at least one second electronic device, including: S301. Parse each current frame to obtain the target field corresponding to each current frame.

[0099] Optionally, each current frame can be parsed to obtain the target field corresponding to each current frame.

[0100] For example, the target field can be the Vendor IE in the current frame. Specifically, it can be the Magic Code in the Vendor IE.

[0101] S302. Based on the target field corresponding to each current frame and the pre-configured custom field, establish a network connection with the second short-range wireless module in at least one second electronic device.

[0102] Optionally, it can be determined whether the target field corresponding to each current frame obtained by parsing matches the pre-configured custom field. If they match, a network connection is established with the second short-range wireless module in the corresponding second electronic device, thereby avoiding blindly connecting to all visible Wi-Fi hotspots, realizing selective network configuration of "only connecting to trusted devices", and also supporting cross-brand isolation.

[0103] For example, if the Magic code in the current frame is the same as the Magic code in the pre-configured custom field, automatic network configuration can be performed based on the SSID and the connection password in the Vendor Data field.

[0104] In one possible implementation, Figure 4 This is another schematic diagram illustrating the process of establishing a network connection with a second short-range wireless module in at least one second electronic device in the network distribution method provided in this application embodiment, referring to... Figure 4 As shown, in step S302 above, establishing a network connection with a second short-range wireless module in at least one second electronic device based on the target field corresponding to each current frame and a pre-configured custom field includes: S401. Match the target field corresponding to each current frame with the pre-configured custom field. If the target field corresponding to the current frame matches the custom field, then the master device corresponding to the current frame is taken as an optional electronic device, and at least one optional electronic device is obtained.

[0105] Optionally, it can be determined whether the target field corresponding to each current frame obtained by parsing matches the pre-configured custom field. If they match, the corresponding master device is used as an optional electronic device.

[0106] For example, if the Magic code in the current frame is the same as the Magic code in a pre-configured custom field, then the corresponding master device is treated as an optional electronic device.

[0107] S402. Based on the network quality of each optional electronic device, determine the second electronic device and establish a network connection with the second short-range wireless module in the second electronic device.

[0108] Optionally, based on the network quality of each optional electronic device, the optional electronic device with the best network command can be selected as the second electronic device, and a network connection can be established with the second short-range wireless module in the second electronic device. This enables autonomous discovery, trusted authentication, and intelligent networking between devices, eliminating the reliance on host control logic and manual intervention, and significantly improving the efficiency, security, and user experience of network distribution in IoT scenarios.

[0109] For example, the signal strength and interference level of each optional electronic device can be determined separately, and the network quality score of each optional electronic device can be calculated. The optional electronic device with the highest score is selected as the second electronic device, and automatic network configuration is performed with the second electronic device based on the SSID and the connection password in the Vendor Data field.

[0110] Optionally, while establishing a network connection with the second short-range wireless module in the second electronic device, the first short-range wireless module can also start the corresponding application service type through the HOST terminal.

[0111] Based on the same inventive concept, this application also provides a distribution network device corresponding to the distribution network method. Since the principle of the device in this application to solve the problem is similar to the distribution network method described above in this application, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be described again.

[0112] Reference Figure 5 As shown, Figure 5 This is a schematic diagram of a distribution network device provided in an embodiment of this application. The device is applied to a first short-range wireless module, which is disposed in a first electronic device and includes: an operation module 501, an acquisition module 502, a determination module 503, and a connection module 504. The running module 501 is used to load and run the firmware program in the first short-range wireless module during the startup process of the first electronic device; The acquisition module 502 is used to acquire network connection information that has been pre-configured and stored in the first short-range wireless module during firmware operation. The network connection information includes at least the code corresponding to the service role of the first short-range wireless module. The determining module 503 is used to determine the operating mode of the first short-range wireless module based on the network connection information. The operating mode is used to indicate the radio frequency mode and the application service type. The connection module 504 is used to establish a network connection with a second short-range wireless module in at least one second electronic device based on the operating mode.

[0113] Optionally, the connection module 504 is specifically used for: Determine the current role of the first short-range wireless module in the network based on the operating mode; Based on the current role and pre-configured custom fields, establish a network connection with a second short-range wireless module in at least one second electronic device.

[0114] Optionally, the connection module 504 is specifically used for: If the current role is the master device role, then determine the current channel and current bandwidth, and establish a network connection with the second short-range wireless module in at least one second electronic device based on the current channel, current bandwidth and pre-configured custom fields.

[0115] Optionally, the connection module 504 is specifically used for: Traverse all channels in the radio frequency mode, determine the current channel's status information for the current channel, and after the traversal is complete, determine the current channel based on the status information of all channels, and determine the current bandwidth based on the current channel.

[0116] Optionally, the connection module 504 is specifically used for: The pre-configured custom fields are added to the broadcast frame, and the broadcast frame is broadcast through the current channel so that the second short-range wireless module in at least one second electronic device establishes a network connection with the first short-range wireless module based on the broadcast frame.

[0117] Optionally, the connection module 504 is specifically used for: If the current role is a slave device role, then at least one current frame is obtained, and a network connection is established with the second short-range wireless module in at least one second electronic device based on each current frame and the pre-configured custom fields.

[0118] Optionally, the connection module 504 is specifically used for: Each current frame is parsed to obtain the target field corresponding to each current frame; Based on the target field corresponding to each current frame and the pre-configured custom field, a network connection is established with the second short-range wireless module in at least one second electronic device.

[0119] Optionally, the connection module 504 is specifically used for: The target field corresponding to each current frame is matched with the pre-configured custom field. If the target field corresponding to the current frame matches the custom field, the master device corresponding to the current frame is taken as an optional electronic device, and at least one optional electronic device is obtained. Based on the network quality of each optional electronic device, a second electronic device is determined, and a network connection is established with the second short-range wireless module in the second electronic device.

[0120] The processing flow of each module in the device and the interaction flow between each module can be referred to the relevant descriptions in the above method embodiments, and will not be detailed here.

[0121] This application also provides an electronic device, such as... Figure 6 As shown, Figure 6 The schematic diagram of the electronic device structure provided in the embodiments of this application includes: a processor 61, a memory 62, and optionally, a bus 63. The memory 62 stores machine-readable instructions executable by the processor 61 (e.g., ...). Figure 5 The device includes the execution module 501, the acquisition module 502, the determination module 503, and the connection module 504 (and the corresponding execution instructions, etc.). When the electronic device is running, the processor 61 and the memory 62 communicate through the bus 63. When the machine-readable instructions are executed by the processor 61, the steps of the above-mentioned network distribution method are performed.

[0122] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the steps of the above-described network distribution method.

[0123] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems and devices described above can be referred to the corresponding processes in the method embodiments, and will not be repeated here. In the several embodiments provided in this application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed mutual coupling or direct coupling or communication connection can be through some communication interfaces; the indirect coupling or communication connection of devices or modules can be electrical, mechanical, or other forms.

[0124] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. If the functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes: USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, optical disks, and other media capable of storing program code.

[0125] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.

Claims

1. A power distribution network method, characterized in that, The method, applied to a first short-range wireless module disposed in a first electronic device, includes: During the startup process of the first electronic device, the firmware program in the first short-range wireless module is loaded and run; When the firmware program is running, it acquires pre-configured network connection information stored in the first short-range wireless module. The network connection information includes at least the code corresponding to the service role of the first short-range wireless module. Based on the network connection information, the operating mode of the first short-range wireless module is determined, and the operating mode is used to indicate the radio frequency mode and the application service type. Based on the operating mode, a network connection is established with a second short-range wireless module in at least one second electronic device.

2. The distribution network method according to claim 1, characterized in that, The step of establishing a network connection with a second short-range wireless module in at least one second electronic device based on the operating mode includes: Based on the operating mode, determine the current role of the first short-range wireless module in the network; Based on the current role and the pre-configured custom fields, establish a network connection with a second short-range wireless module in at least one second electronic device.

3. The distribution network method according to claim 2, characterized in that, The step of establishing a network connection with a second short-range wireless module in at least one second electronic device based on the current role and pre-configured custom fields includes: If the current role is the master device role, then the current channel and current bandwidth are determined, and a network connection is established with the second short-range wireless module in at least one second electronic device based on the current channel, the current bandwidth, and a pre-configured custom field.

4. The distribution network method according to claim 3, characterized in that, Determining the current channel and current bandwidth includes: Traverse all channels under the radio frequency mode, determine the current channel status information for the current channel, and after the traversal is completed, determine the current channel based on the status information of all channels, and determine the current bandwidth based on the current channel.

5. The distribution network method according to claim 3, characterized in that, The step of establishing a network connection with a second short-range wireless module in at least one second electronic device based on the current channel and a pre-configured custom field includes: The pre-configured custom fields are added to the broadcast frame, and the broadcast frame is broadcast through the current channel so that a second short-range wireless module in at least one second electronic device establishes a network connection with the first short-range wireless module based on the broadcast frame.

6. The distribution network method according to claim 2, characterized in that, The step of establishing a network connection with a second short-range wireless module in at least one second electronic device based on the current role and pre-configured custom fields includes: If the current role is a slave device role, then at least one current frame is obtained, and a network connection is established with the second short-range wireless module in at least one second electronic device based on each current frame and a pre-configured custom field.

7. The distribution network method according to claim 6, characterized in that, The step of establishing a network connection with a second short-range wireless module in at least one second electronic device based on each current frame and a pre-configured custom field includes: Each current frame is parsed to obtain the target field corresponding to each current frame; Based on the target field corresponding to each current frame and the pre-configured custom field, a network connection is established with a second short-range wireless module in at least one second electronic device.

8. The distribution network method according to claim 7, characterized in that, The step of establishing a network connection with a second short-range wireless module in at least one second electronic device based on the target field corresponding to each current frame and a pre-configured custom field includes: The target field corresponding to each current frame is matched with the pre-configured custom field. If the target field corresponding to the current frame matches the custom field, the main device corresponding to the current frame is taken as an optional electronic device, and at least one optional electronic device is obtained. Based on the network quality of each optional electronic device, the second electronic device is determined, and a network connection is established with the second short-range wireless module in the second electronic device.

9. An electronic device, characterized in that, include: A processor and a memory, the memory storing machine-readable instructions executable by the processor, which, when the electronic device is running, are executed by the processor to perform the steps of the distribution network method as described in any one of claims 1 to 8.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the steps of the distribution network method as described in any one of claims 1 to 8.