Data transmission method and electronic equipment

By adjusting the working bandwidth in the WiFi connection, the problem of decreased in data transmission at different manufacturers' WiFi chips has been solved, and more efficient data transmission has been achieved, and the user experience is enhanced.

CN119383672APending Publication Date: 2025-01-28HONOR DEVICE CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202310929990.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-07-26
Publication Date
2025-01-28

AI Technical Summary

Technical Problem

When WiFi chips from different manufacturers conduct data transmission, the data transmission rate is reduced due to design and architecture differences, especially the large file transmission time is too long.

Method used

By establishing a WIFI connection between electronic devices, adjust the work bandwidth so that the first electronic device is used as the first role, and the work bandwidth with the second electronic device as the second role is adjusted to a larger target work bandwidth, thereby enhancing data transmission rate.

Benefits of technology

Implement the increase in data transmission between electronic devices, shorten the data transmission time, and improve the user experience, especially in large file transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119383672A_ABST
    Figure CN119383672A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a data transmission method and electronic equipment, relates to the field of electronic equipment, and can improve the data transmission rate and realize rapid transmission of large files. The specific scheme is as follows: in response to a first operation, a first electronic device acquires first information; under the condition that the first information meets a preset condition, the first electronic equipment sends a first notification to second electronic equipment in a first role, so that the second electronic equipment adjusts the working bandwidth of the second electronic equipment serving as a second role into the first working bandwidth, and the second role is a role in a relative relationship with the first role; the first electronic equipment adjusts the working bandwidth corresponding to the first role of the first electronic equipment to the first working bandwidth; the first electronic equipment transmits the first data with the second electronic equipment by adopting the first working bandwidth based on the first WiFi connection, and the first WiFi connection is the WiFi connection established between the first electronic equipment serving as the first role and the second electronic equipment serving as the second role.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of electronic devices, and in particular to a data transmission method and electronic device. Background Art

[0002] WiFi (wireless fidelity) networking is a way to connect multiple WiFi devices together through wireless local area network (WLAN) technology to achieve communication and resource sharing between multiple WiFi devices. Through WiFi networking, multiple electronic devices can be connected to the same wireless local area network to achieve data transmission between multiple electronic devices. For example, through WiFi networking, multiple electronic devices can perform operations such as machine cloning, data migration, file sharing, and file transfer.

[0003] In actual implementation, an electronic device can establish a WiFi network with other electronic devices through its own WiFi chip (or WiFi module, wireless network card, wireless network adapter). Among them, the existing WiFi chips may include WiFi chips developed by different manufacturers, such as WiFi chips of manufacturer A and WiFi chips of manufacturer B.

[0004] However, due to certain differences in the design and architecture of WiFi chips from different manufacturers, this will result in a lower data transmission rate when data is transmitted between electronic devices equipped with WiFi chips from different manufacturers, which in turn causes the transmission of large files to take too long. Summary of the invention

[0005] The embodiments of the present application provide a data transmission method and an electronic device, which can improve the data transmission rate and realize the rapid transmission of large files.

[0006] In order to achieve the above purpose, the embodiment of the present application adopts the following technical solution:

[0007] In a first aspect, an embodiment of the present application provides a data transmission method, which is applied to a first electronic device. The data transmission method may include: in response to a first operation, the first electronic device obtains first information; wherein the first operation is used to trigger the first electronic device to send first data to be transmitted to the second electronic device, or to trigger the second electronic device to send first data to the first electronic device; when the first information meets a preset condition, the first electronic device sends a first notification to the second electronic device in a first role, so that the second electronic device adjusts the working bandwidth of the second electronic device as a second role to the first working bandwidth indicated by the first notification, and the second role is a role that is relative to the first role; the first electronic device adjusts the working bandwidth corresponding to the first electronic device as the first role to the first working bandwidth; the first electronic device transmits the first data to the second electronic device based on a first WiFi connection using the first working bandwidth, wherein the first WiFi connection is a WiFi connection established between the first electronic device as the first role and the second electronic device as the second role.

[0008] Based on the method described in the first aspect, when a first electronic device transmits data with a second electronic device, the first electronic device can obtain first information. When the first information meets a preset condition, the first electronic device can send a first notification to the second electronic device so that the second electronic device adjusts its working bandwidth as a second role to the first working bandwidth indicated by the first notification. In addition, the first electronic device can also adjust its working bandwidth as a first role to the first working bandwidth. As a result, the second electronic device and the first electronic device can use a larger first working bandwidth to transmit data, which can improve the data transmission rate, shorten the data transmission time, and enhance the user experience.

[0009] In combination with the first aspect, in another possible implementation method, the first role is a role among access point, group owner, personal mobile hotspot, virtual access point, and hotspot, and the second role is a role among site or group client; or, the first role is a role among site or group client, and the second role is a role among access point, group owner, personal mobile hotspot, virtual access point, and hotspot.

[0010] In combination with the first aspect, in another possible implementation manner, the first notification includes an extended channel switching notification and an operating mode notification.

[0011] In combination with the first aspect, in another possible implementation method, the first role is a role among access point, group owner, personal mobile hotspot, virtual access point, and hotspot, the second role is a role in a site or group client, the first notification is an extended channel switching notification, and the first electronic device sends the first notification to the second electronic device in the first role, which may include: the first electronic device sends the extended channel switching notification to the second electronic device in the first role.

[0012] Based on this possible implementation method, when the first role of the first electronic device is one of an access point, a group owner, a personal mobile hotspot, a virtual access point, and a hotspot, and when the first information obtained by the first electronic device meets a preset condition, the first electronic device can send an extended channel switching notification to the second electronic device, so that the second electronic device adjusts its working bandwidth as the second role to the first working bandwidth indicated by the extended channel switching notification, and the first electronic device can also adjust its working bandwidth as the first role to the first working bandwidth, so that the second electronic device and the first electronic device can use a larger first working bandwidth to transmit data, which can improve the data transmission rate, shorten the data transmission time, and enhance the user experience.

[0013] In combination with the first aspect, in another possible implementation, the first information includes a chip type of a WiFi chip configured for an electronic device serving as a third role or a second working bandwidth for transmitting data between the first electronic device and the second electronic device, wherein the third role is a site or a group client.

[0014] In combination with the first aspect, in another possible implementation, the first information satisfies a preset condition, which may include: the chip type of the WiFi chip configured in the electronic device as the third role is a preset type; or the second working bandwidth is inconsistent with the first working bandwidth.

[0015] Based on this possible implementation method, when the second working bandwidth for transmitting data between the first electronic device and the second electronic device is inconsistent with the first working bandwidth, the first electronic device sends a first notification to the second electronic device to adjust the working bandwidth for transmitting data between the first electronic device and the second electronic device to the larger first working bandwidth. In this way, when the data transmission rate is low, the working bandwidth for transmitting data between the first electronic device and the second electronic device can be adjusted in time, thereby improving the data transmission rate and shortening the data transmission time.

[0016] Furthermore, the solution of the present application can also be such that when the chip type of the WiFi chip configured in the electronic device serving as the third role is a preset type, the first electronic device sends a first notification to the second electronic device to adjust the working bandwidth for transmitting data between the first electronic device and the second electronic device to a larger first working bandwidth, thereby further improving the data transmission rate.

[0017] In combination with the first aspect, in another possible implementation, the first information satisfies the preset condition that the second working bandwidth is inconsistent with the first working bandwidth. In response to the first operation, before the first electronic device obtains the first information, the data transmission method may also include: the first electronic device transmits the first data to the second electronic device based on the first WiFi connection using the second working bandwidth, and the second working bandwidth is less than the first working bandwidth; the first electronic device transmits the first data to the second electronic device based on the first WiFi connection using the first working bandwidth, which may include: the first electronic device transmits the second data to the second electronic device based on the first WiFi connection using the first working bandwidth, wherein the second data is the remaining data in the first data except the data transmitted by the second electronic device to the second electronic device using the second working bandwidth.

[0018] Based on this possible implementation method, when the second working bandwidth for transmitting data between the first electronic device and the second electronic device is inconsistent with the first working bandwidth, the first electronic device sends a first notification to the second electronic device to adjust the working bandwidth for transmitting data between the first electronic device and the second electronic device to the larger first working bandwidth. In this way, when the data transmission rate is low, the working bandwidth for transmitting data between the first electronic device and the second electronic device can be adjusted in time, thereby improving the data transmission rate and shortening the data transmission time.

[0019] In a second aspect, an embodiment of the present application provides a data transmission method, which is applied to a first electronic device. The data transmission method may include: when the first electronic device and the second electronic device transmit the first data, the first electronic device, as a third role, establishes a first WiFi connection with the second electronic device as a fourth role, and the working bandwidth corresponding to the first WiFi connection is the second working bandwidth; wherein the first data is the data to be transmitted sent by the first electronic device to the second electronic device, or the first data is the data to be transmitted sent by the second electronic device to the first electronic device; when the second working bandwidth is inconsistent with the first working bandwidth, the first electronic device sends a second notification to the second electronic device, and the second notification is used to indicate that the first electronic device will disconnect from the second electronic device and re-establish a WiFi connection; wherein the first working bandwidth is the working bandwidth negotiated between the first electronic device and the second electronic device, and the first working bandwidth is greater than the second working bandwidth; the first electronic device, as a third role, establishes a second WiFi connection with the second electronic device as the fourth role, and the working bandwidth corresponding to the second WiFi connection is the first working bandwidth; based on the second WiFi connection, the first electronic device uses the first working bandwidth to transmit the first data to the second electronic device.

[0020] Based on the method described in the second aspect, when the first electronic device transmits data with the second electronic device, the first electronic device, as a third role, can establish a first WiFi connection with the first electronic device, as a fourth role. Afterwards, when the second working bandwidth corresponding to the first WiFi connection is inconsistent with the first working bandwidth, the first electronic device can send a second notification to the second electronic device to notify the second electronic device that the first electronic device will disconnect from the second electronic device and re-establish the second WiFi connection. Among them, the working bandwidth corresponding to the second WiFi connection is the first working bandwidth, and then the first electronic device and the second electronic device can use a larger first working bandwidth to transmit the first data, which can improve the data transmission rate, shorten the data transmission time, and improve the user experience.

[0021] In combination with the second aspect, in another possible implementation method, the above-mentioned first electronic device sends a second notification to the second electronic device, which may include: the first electronic device obtains the data volume corresponding to the first data; when the data volume corresponding to the first data is greater than or equal to the first data volume, the first electronic device sends the second notification to the second electronic device.

[0022] Based on this possible implementation, when the data volume corresponding to the first data is greater than or equal to the first data volume, the first electronic device sends a second notification to the second electronic device to notify the second electronic device that the first electronic device will disconnect from the second electronic device and re-establish a second WiFi connection. The working bandwidth corresponding to the second WiFi connection is the first working bandwidth, and the first electronic device and the second electronic device can use the larger first working bandwidth to transmit the first data, which can improve the data transmission rate, shorten the data transmission time, and realize the fast transmission of large files.

[0023] In combination with the second aspect, in another possible implementation, the above-mentioned first electronic device, as a third role, establishes a second WiFi connection with the second electronic device, as a fourth role, which may include: the first electronic device sends a first request to the second electronic device; when the first electronic device receives a first response to the first request sent by the second electronic device, the first electronic device, as the third role, establishes a second WiFi connection with the second electronic device, as the fourth role.

[0024] In combination with the second aspect, in another possible implementation manner, the third role is a role in a site or a group client, and the fourth role is a role in an access point, a group owner, a personal mobile hotspot, a virtual access point, or a hotspot.

[0025] In a third aspect, an embodiment of the present application provides a data transmission method, which is applied to a first electronic device. The data transmission method may include: the first electronic device receives second information sent by the second electronic device, the second information includes identification information corresponding to a fifth role created by the second electronic device and a first working bandwidth; wherein the fifth role is a role created by the second electronic device when receiving the first operation; the first operation is used to trigger the first electronic device to send first data to be transmitted to the second electronic device, or to trigger the second electronic device to send first data to the first electronic device; when the first electronic device scans a first access point with a sixth role and the identification information corresponding to the first access point matches the identification information corresponding to the fifth role, the first electronic device adjusts the working bandwidth of the first electronic device as the sixth role to the first working bandwidth, and the sixth role is a role in a relative relationship with the fifth role; the first electronic device, as the sixth role, establishes a WiFi connection with the second electronic device as the fifth role; based on the WiFi connection, the first electronic device uses the first working bandwidth to transmit the first data to the second electronic device.

[0026] Based on the method described in the third aspect, when the first electronic device transmits the first data to the second electronic device, the first electronic device, as the sixth role, can set a filtering condition according to the second information sent by the second electronic device, as the fifth role. Afterwards, the first electronic device can adjust the working bandwidth of the first electronic device as the sixth role to the target working bandwidth according to the filtering condition, and then the first electronic device and the second electronic device can use the target working bandwidth to transmit the first data, which can improve the data transmission rate, shorten the data transmission time, and improve the user experience.

[0027] In combination with the third aspect, in another possible implementation, the first electronic device is configured with a first WiFi chip, and before the first electronic device adjusts the working bandwidth of the first electronic device as a sixth role to the first working bandwidth, the data transmission method may also include: the first electronic device obtains a chip type of the first WiFi chip; the first electronic device adjusts the working bandwidth of the first electronic device as the sixth role to the first working bandwidth, which may include: when the chip type of the first WiFi chip is a preset type, the first electronic device adjusts the working bandwidth of the first electronic device as the sixth role to the first working bandwidth.

[0028] In combination with the third aspect, in another possible implementation, after the first electronic device obtains the chip type of the first WiFi chip, the data transmission method may further include: the first electronic device obtains the data volume corresponding to the first data; the first electronic device adjusts the working bandwidth of the first electronic device as the sixth role to the first working bandwidth, which may include: when the chip type of the first WiFi chip is a preset type and the data volume corresponding to the first data is greater than or equal to the first data volume, the first electronic device adjusts the working bandwidth of the first electronic device as the sixth role to the first working bandwidth.

[0029] Based on this possible implementation method, when the chip type of the first WiFi chip is a preset type and the data volume corresponding to the first data is greater than or equal to the first data volume, the first electronic device adjusts the working bandwidth of the first electronic device as the sixth role to the first working bandwidth, and then the first electronic device and the second electronic device can use the larger first working bandwidth to transmit the first data, which can improve the data transmission rate, shorten the data transmission time, and realize the rapid transmission of large files.

[0030] In combination with the third aspect, in another possible implementation manner, the fifth role is a role among access point, group owner, personal mobile hotspot, virtual access point, and hotspot, and the sixth role is a role among site or group client.

[0031] In a fourth aspect, an embodiment of the present application provides a data transmission method, which is applied to a first electronic device. The data transmission method may include: when the first electronic device and the second electronic device transmit the first data, the first electronic device obtains the working frequency band corresponding to the seventh role created by the second electronic device; wherein the first data is the first electronic device sending data to be transmitted to the second electronic device, or the first data is the second electronic device sending data to be transmitted to the first electronic device; when the working frequency band corresponding to the seventh role is a preset frequency band, the first electronic device adjusts the working bandwidth of the first electronic device as an eighth role to a first working bandwidth; the first electronic device, as the eighth role, establishes a WiFi connection with the second electronic device as the seventh role; based on the WiFi connection, the first electronic device uses the first working bandwidth to transmit the first data to the second electronic device.

[0032] Based on the method described in the fourth aspect, when the first electronic device is a terminal device, the first electronic device does not provide a working bandwidth that can be used to set the working bandwidth supported by the WiFi chip carried by the first electronic device. Therefore, when the first electronic device and the second electronic device transmit the first data, the first electronic device, as the eighth role, can obtain the working frequency band corresponding to the seventh role created by the second electronic device. Thereafter, when the working frequency band corresponding to the seventh role created by the second electronic device is a preset frequency band, the first electronic device can adjust the working bandwidth supported by the WiFi chip carried by it to the maximum working bandwidth corresponding to the preset frequency band (i.e., the first working bandwidth), and then the first electronic device and the second electronic device can use the target working bandwidth to transmit the first data, which can improve the data transmission rate, shorten the data transmission time, and thus improve the user experience.

[0033] In combination with the fourth aspect, in another possible implementation, the first electronic device as the eighth role establishes a WiFi connection with the second electronic device as the seventh role, which may include: the first electronic device as the eighth role sends a second request to the second electronic device, and the second request includes a first working bandwidth; the first electronic device receives a second response corresponding to the second request sent by the second electronic device; the first electronic device transmits the first data to the second electronic device based on the WiFi connection using the first working bandwidth, which may include: when the second response indicates that the second electronic device supports the first working bandwidth, the first electronic device transmits the first data to the second electronic device based on the WiFi connection using the first working bandwidth.

[0034] In combination with the fourth aspect, in another possible implementation, after the first electronic device receives the second response corresponding to the second request sent by the second electronic device, the data transmission method may also include: when the second response indicates that the second electronic device does not support the first working bandwidth, the working bandwidth of the first electronic device as the eighth role is adjusted to the third working bandwidth indicated by the second response, and the third working bandwidth is smaller than the first working bandwidth; the first electronic device transmits the first data to the second electronic device based on a WiFi connection using the third working bandwidth.

[0035] In combination with the fourth aspect, in another possible implementation manner, the third working bandwidth is greater than the fourth working bandwidth, wherein the fourth working bandwidth is a working bandwidth set for the seventh role when the second electronic device creates the seventh role.

[0036] In combination with the fourth aspect, in another possible implementation method, the first electronic device obtains the working frequency band corresponding to the seventh role created by the second electronic device, which may include: the first electronic device obtains the data volume corresponding to the first data; when the data volume corresponding to the first data is greater than or equal to the first data volume, the first electronic device obtains the working frequency band corresponding to the seventh role created by the second electronic device.

[0037] In combination with the fourth aspect, in another possible implementation manner, the seventh role is a role among access point, group owner, personal mobile hotspot, virtual access point, and hotspot, and the eighth role is a role among site or group client.

[0038] In a fifth aspect, an embodiment of the present application provides a data transmission device, which can be applied to an electronic device to implement the method in the first aspect above. The functions of the data transmission device can be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions, for example, an acquisition module, a sending module, and an adjustment module.

[0039] The acquisition module may be used to acquire first information in response to a first operation; wherein the first operation is used to trigger the first electronic device to send first data to be transmitted to the second electronic device, or to trigger the second electronic device to send first data to the first electronic device.

[0040] The sending module can be used to send a first notification to a second electronic device in a first role when the first information meets a preset condition, so that the second electronic device adjusts the working bandwidth of the second electronic device as a second role to the first working bandwidth indicated by the first notification, and the second role is a role that is in a relative relationship with the first role.

[0041] The adjustment module may be used to adjust the working bandwidth corresponding to the first electronic device as the first role to the first working bandwidth.

[0042] The sending module can also be used to transmit the first data to the second electronic device based on the first WiFi connection using the first working bandwidth, wherein the first WiFi connection is a WiFi connection established between the first electronic device as the first role and the second electronic device as the second role.

[0043] In a sixth aspect, an electronic device is provided, which has the function of implementing the method described in the first aspect, the second aspect, the third aspect or the fourth aspect. The function can be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions.

[0044] In the seventh aspect, an electronic device is provided, comprising: a processor and a memory; the memory is used to store computer-executable instructions, and when the electronic device is running, the processor executes the computer-executable instructions stored in the memory to enable the electronic device to execute the data transmission method as described in any one of the first aspect above, or, execute the data transmission method as described in any one of the second aspect above, or, execute the data transmission method as described in any one of the third aspect above, or, execute the data transmission method as described in any one of the fourth aspect above.

[0045] In an eighth aspect, an electronic device is provided, comprising: a processor; the processor is used to couple with a memory, and after reading instructions in the memory, execute the data transmission method as described in any one of the first aspects above according to the instructions; or, the processor is used to execute the data transmission method as described in any one of the second aspects above according to the instructions; or, the processor is used to execute the data transmission method as described in any one of the third aspects above according to the instructions; or, the processor is used to execute the data transmission method as described in any one of the fourth aspects above according to the instructions.

[0046] In the ninth aspect, an embodiment of the present application provides a computer-readable storage medium on which computer program instructions are stored. When the computer program instructions are executed by an electronic device, the electronic device implements a data transmission method as described in any one of the first aspect or possible implementations of the first aspect; or, when the computer program instructions are executed by an electronic device, the electronic device implements a data transmission method as described in any one of the second aspect or possible implementations of the second aspect; or, when the computer program instructions are executed by an electronic device, the electronic device implements a data transmission method as described in any one of the third aspect or possible implementations of the third aspect; or, when the computer program instructions are executed by an electronic device, the electronic device implements a data transmission method as described in any one of the fourth aspect or possible implementations of the fourth aspect.

[0047] In the tenth aspect, an embodiment of the present application provides a computer program product, comprising a computer readable code, which, when the computer readable code is run in an electronic device, enables the electronic device to implement a data transmission method as described in any one of the first aspect or possible implementations of the first aspect; or, when the computer readable code is run in an electronic device, enables the electronic device to implement a data transmission method as described in any one of the second aspect or possible implementations of the second aspect; or, when the computer readable code is run in an electronic device, enables the electronic device to implement a data transmission method as described in any one of the third aspect or possible implementations of the third aspect; or, when the computer readable code is run in an electronic device, enables the electronic device to implement a data transmission method as described in any one of the fourth aspect or possible implementations of the fourth aspect.

[0048] In the eleventh aspect, a device (for example, the device may be a chip system) is provided, the device including a processor for supporting an electronic device to implement the functions involved in the first aspect, the second aspect, the third aspect or the fourth aspect. In one possible design, the device also includes a memory for storing program instructions and data necessary for the electronic device. When the device is a chip system, it may be composed of a chip, or may include a chip and other discrete devices.

[0049] It should be understood that the beneficial effects of the fifth to eleventh aspects mentioned above can be found in the relevant descriptions in the first, second, third or fourth aspects mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] Figure 1 A schematic diagram of a flow chart of data transmission of an electronic device in the prior art;

[0051] Figure 2 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application;

[0052] Figure 3 A schematic diagram of the software structure of an electronic device provided in an embodiment of the present application;

[0053] Figure 4 A scenario diagram of a data transmission method provided in an embodiment of the present application Figure 1 ;

[0054] Figure 5 A schematic diagram of a data transmission method provided in an embodiment of the present application Figure 1 ;

[0055] Figure 6 A scenario diagram of a data transmission method provided in an embodiment of the present application Figure 2 ;

[0056] Figure 7 A schematic diagram of a data transmission method provided in an embodiment of the present application Figure 2 ;

[0057] Figure 8 A schematic diagram of a data transmission method provided in an embodiment of the present application Figure 3 ;

[0058] Fig. 9 A schematic diagram of a data transmission method provided in an embodiment of the present application Figure 4 ;

[0059] Fig.10 A schematic diagram of an extended channel switching notification provided in an embodiment of the present application;

[0060] Fig.11 A schematic diagram of a working mode notification provided in an embodiment of the present application;

[0061] Fig.12 A schematic diagram of a data transmission method provided in an embodiment of the present application Figure 5 ;

[0062] Fig.13 A schematic diagram of a data transmission method provided in an embodiment of the present application Figure 6 ;

[0063] Fig.14 A schematic diagram of a data transmission method provided in an embodiment of the present application Figure 7 ;

[0064] Fig.15 A schematic diagram of a data transmission method provided in an embodiment of the present application Figure 8 ;

[0065] Fig.16A schematic diagram of a data transmission method provided in an embodiment of the present application Figure 9 ;

[0066] Fig.17 A schematic diagram of a data transmission method provided in an embodiment of the present application Figure 10 ;

[0067] Fig.18 A schematic diagram of a data transmission method provided in an embodiment of the present application Figure 10 one;

[0068] Fig.19 A schematic diagram of a data transmission device provided in an embodiment of the present application Figure 1 ;

[0069] Fig. 20 A schematic diagram of a data transmission device provided in an embodiment of the present application Figure 2 ;

[0070] Fig.21 A schematic diagram of a data transmission device provided in an embodiment of the present application Figure 3 ;

[0071] Fig. 22 A schematic diagram of a data transmission device provided in an embodiment of the present application Figure 4 . DETAILED DESCRIPTION

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

[0073] The terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of this application, unless otherwise specified, "plurality" means two or more.

[0074] In order to clearly describe the technical solutions of the embodiments of the present application, some terms and technologies involved in the embodiments of the present application are briefly introduced below.

[0075] WiFi networking is a way to connect multiple WiFi devices together through wireless LAN technology to achieve communication and resource sharing between multiple WiFi devices. Through WiFi networking, multiple electronic devices can be connected to the same wireless LAN to achieve data transmission between multiple electronic devices. For example, through WiFi networking, multiple electronic devices can perform operations such as machine cloning, data migration, file sharing, and file transfer.

[0076] Usually, when multiple electronic devices are connected to a WiFi network, one of the electronic devices can serve as an access point (AP), and the other electronic devices can serve as stations (STA). The electronic device serving as a station can access the electronic device serving as an access point, that is, multiple electronic devices serving as stations can be connected to the same wireless local area network through the electronic device serving as an access point, thereby achieving mutual connection, and further enabling data transmission between multiple electronic devices.

[0077] In actual implementation, an electronic device can establish a WiFi network with other electronic devices through its own WiFi chip (or WiFi module, wireless network card, wireless network adapter). Among them, the existing WiFi chips may include WiFi chips developed by different manufacturers, such as WiFi chips of manufacturer A and WiFi chips of manufacturer B. However, there are certain differences in the design and architecture of WiFi chips of different manufacturers, which will cause compatibility issues when electronic devices equipped with WiFi chips of different manufacturers are established in WiFi networking.

[0078] Specifically, due to certain differences in the design and architecture of the WiFi chip of manufacturer A and the WiFi chip of manufacturer B, when an electronic device equipped with the WiFi chip of manufacturer A transmits data with an electronic device equipped with the WiFi chip of manufacturer B, only the smaller bandwidth initially declared by the electronic device equipped with the WiFi chip of manufacturer A can be used to transmit data, and the larger bandwidth negotiated by both parties cannot be used to transmit data, which will result in a lower data transmission rate and, in turn, longer transmission time for large files.

[0079] For example, electronic device A is equipped with a WiFi chip from manufacturer A, and electronic device B is equipped with a WiFi chip from manufacturer B. Figure 1As shown, when electronic device A is not connected to an access point as a site or is connected to an access point in the 2.4GHz frequency band, when electronic device A creates an access point, in order to avoid the electronic device using adjacent secondary channels and causing interference to other basic service sets (BSS), electronic device A declares that it supports a smaller bandwidth (such as 20MHz), that is, electronic device A as an access point sends a beacon frame to electronic device B, and the beacon frame carries the supported bandwidth value (such as 20MHz). When electronic device B as a site receives the beacon frame sent by electronic device A as an access point (that is, electronic device B as a site scans the access point created by electronic device A), electronic device B as a site can determine that electronic device A as an access point supports a smaller bandwidth (such as 20MHz). Afterwards, since electronic device B can support a larger bandwidth (such as 80MHz), when electronic device B associates the access point created by electronic device A, electronic device B as a site can send an association request frame to electronic device A as an access point, and the association request frame carries the supported bandwidth value (such as 80MHz). After receiving the association request frame sent by electronic device B, electronic device A as an access point expands the smaller bandwidth (such as 20MHz) it supports to a larger bandwidth (such as 80MHz) and declares that it supports the larger bandwidth (such as 80MHz). After expanding the smaller bandwidth (such as 20MHz) it supports to a larger bandwidth (such as 80MHz), electronic device A as an access point can return an association response (i.e., association response) frame to electronic device B as a station, and the association response frame carries the expanded bandwidth value (such as 80MHz), that is, when electronic device B as a station associates with electronic device A as an access point, electronic device B and electronic device A both negotiate the bandwidth to a larger bandwidth (such as 80MHz). After electronic device B and electronic device A negotiate the bandwidth, data transmission can be performed between electronic device A as an access point and electronic device B as a station.

[0080] However, since the WiFi chip used by electronic device B is a WiFi chip of manufacturer B, and when electronic device B scans electronic device A, electronic device B finds that electronic device A supports a smaller bandwidth (such as 20MHz), at this time, electronic device B writes the smaller bandwidth (such as 20MHz) supported by electronic device A into the firmware of the WiFi chip of manufacturer B carried by electronic device B. Therefore, when electronic device A and electronic device B perform data transmission, although electronic device A and electronic device B have negotiated the bandwidth to a larger bandwidth (such as 80MHz), electronic device A and electronic device B can only use the smaller bandwidth (such as 20MHz) initially claimed by electronic device A to transmit data, and cannot use the negotiated larger bandwidth (such as 80MHz) to transmit data, resulting in a longer data transmission time. For example, when electronic device A sends data to electronic device B, electronic device A fails to send data using a bandwidth of 80MHz, then electronic device A fails to send data using a bandwidth of 40MHz, and finally electronic device A successfully sends data using a bandwidth of 20MHz.

[0081] To sum up, in the prior art, when an electronic device equipped with a WiFi chip from manufacturer A acts as a site and is not connected to an access point in the 5 GHz frequency band, when an electronic device equipped with a WiFi chip from manufacturer B transmits data with an electronic device equipped with a WiFi chip from manufacturer A, only the smaller bandwidth initially declared by the electronic device equipped with the WiFi chip from manufacturer A can be used to transmit data, and the larger bandwidth negotiated by both parties cannot be used to transmit data, which results in a lower data transmission rate, and in turn, a longer transmission time for large files, affecting the user experience.

[0082] In response to the above problems, an embodiment of the present application provides a data transmission method, which can be applied to electronic devices. When a first electronic device transmits target data to a second electronic device, the first electronic device, as a site (or group client), can set filtering conditions based on the information of the target hotspot created by the second electronic device as a target hotspot (i.e., an access point or group owner). Afterwards, the first electronic device can adjust the working bandwidth of the first electronic device as a site (or group client) to the target working bandwidth according to the filtering conditions, and then the target working bandwidth can be used to transmit the target data between the first electronic device and the second electronic device, thereby improving the data transmission rate, shortening the data transmission time, and then realizing the rapid transmission of large files, improving the user experience.

[0083] Furthermore, when the first electronic device is a terminal device, the first electronic device does not provide a working bandwidth supported by the WiFi chip carried by the first electronic device. Therefore, when the first electronic device and the second electronic device transmit target data, the first electronic device, as a site (or group client), can obtain the working frequency band corresponding to the target hotspot (i.e., access point or group owner) created by the second electronic device. Thereafter, when the working frequency band corresponding to the access point (or group owner) created by the second electronic device is the target frequency band, the first electronic device can adjust the working bandwidth supported by the WiFi chip carried by it to the maximum working bandwidth corresponding to the target frequency band (i.e., target working bandwidth), and then the target working bandwidth can be used to transmit target data between the first electronic device and the second electronic device, thereby improving the data transmission rate, shortening the data transmission time, and realizing the rapid transmission of large files, thereby improving the user experience.

[0084] In addition, when the first electronic device transmits target data with the second electronic device, the first electronic device, as a site (or group client), can establish a WiFi connection with the second electronic device as a target hotspot (i.e., an access point or group owner). Afterwards, when the working bandwidth corresponding to the WiFi connection is inconsistent with the target working bandwidth, the first electronic device can send a reconnection notification to the second electronic device to notify the second electronic device that the first electronic device will disconnect from the second electronic device and re-establish a WiFi connection. Afterwards, the first electronic device re-establishes a WiFi connection with the second electronic device, wherein the working bandwidth corresponding to the re-established WiFi connection is the target working bandwidth, and then the target working bandwidth can be used to transmit the target data between the first electronic device and the second electronic device, thereby improving the data transmission rate and shortening the data transmission time, thereby realizing the rapid transmission of large files and improving the user experience.

[0085] In addition, when the first electronic device and the second electronic device transmit target data, if the working bandwidth for transmitting data between the first electronic device and the second electronic device is inconsistent with the target working bandwidth (that is, the first electronic device and the second electronic device cannot use the negotiated larger working bandwidth to transmit data), the first electronic device can send a management frame notification to the second electronic device to adjust the working bandwidth corresponding to the WiFi connection established between the first electronic device and the second electronic device to the target working bandwidth indicated by the management frame notification, and then the target working bandwidth can be used to transmit target data between the first electronic device and the second electronic device, thereby improving the data transmission rate, shortening the data transmission time, and realizing the rapid transmission of large files, thereby improving the user experience.

[0086] The data transmission method provided in the embodiment of the present application can be applied to an electronic device. The electronic device can be the first electronic device mentioned above, or the second electronic device mentioned above.

[0087] In some embodiments, the electronic device may be a mobile phone, a tablet computer, a handheld computer, a personal computer (PC), a cellular phone, a personal digital assistant (PDA), a wearable device, etc. The embodiments of the present application do not limit the specific form of the electronic device.

[0088] That is, the first electronic device or the second electronic device can be a mobile phone, a tablet computer, a handheld computer, a personal computer (PC), a cellular phone, a personal digital assistant (PDA), a wearable device, etc. And the specific form of the first electronic device can be the same as or different from the specific form of the second electronic device.

[0089] For example, when the first electronic device is a personal computer (such as a laptop or a desktop computer with a wireless network card installed), the second electronic device may be a personal computer, a tablet computer, a mobile phone, etc.

[0090] For example, taking the electronic device (ie, the first electronic device or the second electronic device) as a mobile phone, Figure 2 A schematic structural diagram of an electronic device provided in an embodiment of the present application is shown.

[0091] like Figure 2As shown, the electronic device may include a processor 210, an external memory interface 220, an internal memory 221, a universal serial bus (USB) interface 230, a charging management module 240, a power management module 241, a battery 242, an antenna 1, an antenna 2, a mobile communication module 250, a wireless communication module 260, an audio module 270, a speaker 270A, a receiver 270B, a microphone 270C, an earphone interface 270D, a sensor module 280, a button 290, a motor 291, an indicator 292, a camera 293, a display screen 294, and a subscriber identification module (SIM) card interface 295, etc. Among them, the sensor module 280 may include a pressure sensor 280A, a gyroscope sensor 280B, an air pressure sensor 280C, a magnetic sensor 280D, an acceleration sensor 280E, a distance sensor 280F, a proximity light sensor 280G, a fingerprint sensor 280H, a temperature sensor 280J, a touch sensor 280K, an ambient light sensor 280L, a bone conduction sensor 280M, etc.

[0092] It is to be understood that the structure illustrated in this embodiment does not constitute a specific limitation on the electronic device. In other embodiments, the electronic device may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0093] The processor 210 may include one or more processing units, for example, the processor 210 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0094] The controller can be the nerve center and command center of the electronic device. The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of fetching and executing instructions.

[0095] The processor 210 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 210 is a cache memory. The memory may store instructions or data that the processor 210 has just used or cyclically used. If the processor 210 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 210, and thus improves the efficiency of the system.

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

[0097] The UART interface is a universal serial data bus for asynchronous communication. The bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, the UART interface is generally used to connect the processor 210 and the wireless communication module 260. For example, the processor 210 communicates with the Bluetooth module in the wireless communication module 260 through the UART interface to implement the Bluetooth function. In some embodiments, the audio module 270 can transmit an audio signal to the wireless communication module 260 through the UART interface to implement the function of playing music through a Bluetooth headset.

[0098] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present application is only a schematic illustration and does not constitute a structural limitation on the electronic device 200. In other embodiments of the present application, the electronic device 200 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.

[0099] The wireless communication function of the electronic device can be implemented through antenna 1, antenna 2, mobile communication module 250, wireless communication module 260, modem processor and baseband processor.

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

[0101] The mobile communication module 250 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to electronic devices. The mobile communication module 250 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 250 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 250 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 250 can be set in the processor 210. In some embodiments, at least some of the functional modules of the mobile communication module 250 can be set in the same device as at least some of the modules of the processor 210.

[0102] The wireless communication module 260 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to electronic devices. The wireless communication module 260 can be one or more devices integrating at least one communication processing module. The wireless communication module 260 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 210. The wireless communication module 260 can also receive the signal to be sent from the processor 210, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

[0103] In an embodiment of the present application, the wireless communication module 260 may include a Bluetooth module and a WiFi module (or referred to as a WiFi chip, a wireless network card, or a wireless network adapter). Exemplarily, the WiFi module may include two WiFi network interfaces, namely a first WiFi network interface and a second WiFi network interface. The electronic device 200 may be used as a site to connect to an access point via the first WiFi network interface of the WiFi module. The electronic device 200 may also be used as an access point to establish a wireless communication connection with a site via the second WiFi network interface of the WiFi module.

[0104] The above-mentioned WiFi module can support multiple working modes, such as single-frequency single-transmit, dual-frequency single-transmit and dual-frequency dual-transmit working modes. Among them, in the dual-frequency dual-transmit working mode, the electronic device 200 can support two working frequency bands, and can use the two working frequency bands for WiFi connection at the same time, that is, the electronic device 200 can use the two working frequency bands for WiFi communication at the same time. Among them, the working frequency band of the WiFi module can be 2.4GHz, 5GHz, 6GHz, etc. For example, the working frequency band of the first WiFi network interface of the WiFi module is 2.4GHz, and the working frequency band of the second WiFi network interface of the WiFi module is 5GHz. For another example, the working frequency band of the first WiFi network interface of the WiFi module is 5GHz, and the working frequency band of the second WiFi network interface of the WiFi module is 2.4GHz.

[0105] It should be noted that one working frequency band may correspond to multiple working bandwidths. Specifically, when an electronic device transmits data based on a WiFi connection, it will select a target working bandwidth from multiple working bandwidths corresponding to the current working frequency band according to the actual situation and the current working frequency band. After that, the electronic device transmits data with the target working bandwidth under the working frequency band. Different working frequency bands correspond to different working bandwidths, that is, different working frequency bands correspond to different maximum working bandwidths. For example, the maximum working bandwidth corresponding to the 2.4GHz working frequency band is 20Mhz. For another example, the maximum working bandwidth corresponding to the 5GHz working frequency band is 80Mhz or 160Mhz.

[0106] In some embodiments, the antenna 1 of the electronic device is coupled to the mobile communication module 250, and the antenna 2 is coupled to the wireless communication module 260, so that the electronic device can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology.

[0107] The electronic device implements the display function through a GPU, a display screen 294, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 294 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 210 may include one or more GPUs that execute program instructions to generate or change display information.

[0108] The display screen 294 is used to display pictures, videos, etc. The display screen 294 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light emitting diode or an active-matrix organic light emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device may include 1 or N display screens 294, where N is a positive integer greater than 1.

[0109] The electronic device can realize the shooting function through the ISP, the camera 293, the video codec, the GPU, the display screen 294 and the application processor, etc. In some embodiments, the electronic device can include 1 or N cameras 293, where N is a positive integer greater than 1.

[0110] The external memory interface 220 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 200. The external memory card communicates with the processor 210 through the external memory interface 220 to implement a data storage function, such as storing music, video and other files in the external memory card.

[0111] The internal memory 221 can be used to store computer executable program codes, which include instructions. The processor 210 executes various functional applications and data processing of the electronic device by running the instructions stored in the internal memory 221. The internal memory 221 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, a picture playback function, etc.), etc. The data storage area may store data established during the use of the electronic device (such as audio data, a phone book, etc.), etc. In addition, the internal memory 221 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.

[0112] Of course, it is understandable that the above Figure 2 The figure is only an exemplary description when the electronic device is in the form of a mobile phone. If the electronic device is in the form of a tablet computer, a handheld computer, a PC, a PDA, a wearable device (such as a smart watch, a smart bracelet), etc., the structure of the electronic device may include more Figure 2 The structure shown in the figure is less than Figure 2 More structures are shown in the figure, which are not limited here.

[0113] It is understandable that, generally speaking, the realization of electronic device functions requires not only hardware support but also software cooperation.

[0114] The software system of the electronic device may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application takes the Android system of the layered architecture as an example to exemplify the software structure of the electronic device.

[0115] Figure 3 It is a software structure block diagram of the electronic device provided in the embodiment of the present application.

[0116] The layered architecture divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: the application layer, the application framework layer, the Android runtime and the system library (also called the Native layer), and the kernel layer.

[0117] The application layer can include a series of application packages. Figure 3 As shown, the application package may include applications such as camera, gallery (also called album), calendar, phone, map, navigation, WLAN, Bluetooth, music, video, short message, etc. The application framework layer provides application programming interface (application programming interface, API) and programming framework for the applications in the application layer. The application framework layer includes some predefined functions.

[0118] like Figure 3 As shown, the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, and the like.

[0119] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.

[0120] Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos, pictures, audio, calls made and received, browsing history and bookmarks, phone books, etc.

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

[0122] The phone manager is used to provide communication functions for electronic devices, such as the management of call status (including answering, hanging up, etc.).

[0123] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.

[0124] The notification manager enables applications to display notification information in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as notifications of applications running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is displayed in the status bar, a prompt sound is emitted, an electronic device vibrates, an indicator light flashes, etc.

[0125] The Android runtime includes the core library and the virtual machine. The Android runtime is responsible for the scheduling and management of the Android system.

[0126] The core library consists of two parts: one is the function that needs to be called by the Java language, and the other is the Android The core library.

[0127] The application layer and the application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.

[0128] The system library may include multiple functional modules, such as a surface manager, a media library, a 3D graphics processing library (such as OpenGL ES), a 2D graphics engine (such as SGL), etc.

[0129] The surface manager is used to manage the display subsystem and provide the fusion of two-dimensional and three-dimensional layers for multiple applications.

[0130] The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video encoding formats.

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

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

[0133] The kernel layer is the layer between hardware and software. The kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.

[0134] The methods in the following embodiments can all be implemented in an electronic device having the above hardware structure or software structure.

[0135] The hardware structure and software structure of the electronic device of the embodiment of the present application are introduced above. Before introducing the data transmission method provided by the embodiment of the present application, the technology involved in the data transmission method provided by the embodiment of the present application is first introduced.

[0136] (1) Access points and sites

[0137] When multiple electronic devices are connected to a WiFi network, one of the electronic devices can be used as an access point (AP), and the other electronic devices can be used as stations (STA). The electronic device used as a station can access the electronic device used as an access point, that is, multiple electronic devices used as stations can be connected to the same wireless local area network through the electronic device used as an access point to achieve mutual connection, thereby achieving data transmission between multiple electronic devices. The above electronic devices can be personal computers (such as laptops or desktop computers with wireless network cards installed), tablet computers, mobile phones, etc.

[0138] That is to say, when two electronic devices are communicating via WiFi, one of the electronic devices can serve as an access point (i.e., AP) and the other electronic device can serve as a station (i.e., STA). The electronic device serving as the station can access the electronic device serving as the access point, i.e., the electronic device serving as the station establishes a WiFi connection with the electronic device serving as the access point, and data can be transmitted between the electronic device serving as the station and the electronic device serving as the access point.

[0139] For example, taking the electronic device as a laptop computer, Figure 4 As shown in (a), laptop A can be used as an access point, laptop B can be used as a station, and laptop B can be connected to laptop A, that is, a wireless communication connection can be established between laptop A and laptop B, and data can be transmitted between laptop A and laptop B.

[0140] For example, if one electronic device is a laptop and the other electronic device is a mobile phone, Figure 4 As shown in (b), laptop computer C can be used as an access point, mobile phone D can be used as a station, and mobile phone D can be connected to laptop computer C, that is, a wireless communication connection can be established between laptop computer C and mobile phone D, and data can be transmitted between laptop computer C and mobile phone D.

[0141] It should be noted that the above access point may be a traditional access point (ie, Legacy AP).

[0142] (2) WiFi peer-to-peer (P2P) connection

[0143] WiFi point-to-point connection is a technical specification launched by the WiFi Alliance, also known as WiFi direct connection (i.e. WiFiDirect). WiFi point-to-point connection can support two or more electronic devices to form a point-to-point network (i.e. P2P Group) and communicate with each other without an access point (i.e. AP). The point-to-point network may include a group owner (i.e. group owner, GO) and at least one group client (i.e. group client, GC). It is understandable that the group owner can serve as an access point in the point-to-point network, that is, the group owner is equivalent to the above-mentioned access point. The group client can serve as a site in the point-to-point network, that is, the group client is equivalent to the above-mentioned site.

[0144] WiFi point-to-point connection can also be applied to data transmission between electronic devices. For example, taking data transmission between a laptop and a mobile phone as an example, the mobile phone can establish a WiFi connection with the laptop through WiFi point-to-point connection, that is, the mobile phone as a group client can connect to the laptop as the group owner, and then the laptop and the mobile phone can perform data transmission. For another example, taking data transmission between a smart TV and a mobile phone as an example, the mobile phone can establish a WiFi connection with the smart TV through WiFi point-to-point connection, and then the mobile phone can send its display content to the smart TV and display it.

[0145] (3) Virtual access point (soft access point, SoftAP)

[0146] Virtual access points are also called virtual hotspots or simulated hotspots. Electronic devices can implement virtual access point functions and realize wireless networking through the WiFi chip (or WiFi module, wireless network card, wireless network adapter) they carry. In actual implementation, an electronic device can create a virtual access point through its WiFi chip, and other electronic devices can be connected to the virtual access point as sites to achieve WiFi connection between electronic devices.

[0147] In the embodiment of the present application, an electronic device can be used as an access point or a site. That is, the electronic device can be used as a site to connect to the access point through a WiFi network interface of the WiFi chip to establish a WiFi connection. At the same time, the electronic device can also be used as an access point to connect to the site through another WiFi network interface of the WiFi chip to establish another WiFi connection.

[0148] It should be noted that, for two electronic devices that establish a WiFi connection, the role of one electronic device is an access point, and the role of the other electronic device is a site, that is, one of the two electronic devices that establish a WiFi connection can be used as a traditional access point (i.e., Legacy AP), a group owner (i.e., GO), a personal mobile hotspot (i.e., Personal Mobile Hotspot), a virtual access point (i.e., SoftAP) or a hotspot (i.e., HotSpot), and the other electronic device can be used as a site (i.e., STA), a group client (i.e., GC), etc. For example, one electronic device acts as a traditional access point (i.e., Legacy AP) and the other electronic device acts as a site (i.e., STA). For another example, one electronic device acts as a group owner (i.e., GO) and the other electronic device acts as a group client (i.e., GC). For another example, one electronic device acts as a traditional access point (i.e., Legacy AP) and the other electronic device acts as a group client (i.e., GC). For another example, one electronic device acts as a group owner (i.e., GO) and the other electronic device acts as a site (i.e., STA).

[0149] The above describes the technology involved in the data transmission method provided by the embodiment of the present application. The following describes the process of establishing a WiFi connection between electronic devices. The process of establishing a WiFi connection between electronic devices may include four stages: scanning, authentication, association, and four-way handshake.

[0150] Take the example of establishing a WiFi connection between the first computer and the second computer. Figure 5 As shown, the process of establishing a WiFi connection between the second computer and the second computer may specifically include: S501-S511.

[0151] S501. The first computer sends a beacon frame to the second computer, where the beacon frame includes an initial working bandwidth corresponding to a target hotspot.

[0152] When the first computer creates a target hotspot (such as an access point, a group owner, a personal mobile hotspot, or a virtual access point), the first computer as the target hotspot (i.e., the first computer providing the WiFi hotspot function) can send a beacon frame to the second computer, i.e., the first computer periodically broadcasts the beacon frame so that the second computer can establish a WiFi connection with the first computer. The beacon frame may include an initial working bandwidth, and the initial working bandwidth may be a working bandwidth corresponding to the target hotspot set when the first computer creates the target hotspot.

[0153] S502: The second computer receives a beacon frame sent by the first computer.

[0154] After the first computer sends a beacon frame to the second computer, the second computer can receive the beacon frame sent by the first computer, that is, the second computer scans the target hotspot created by the first computer, and the scanning phase is completed.

[0155] In some examples, when the first computer creates a target hotspot, the second computer can also send a probe request frame to the first computer, and after the first computer receives the probe request frame sent by the second computer, the first computer can send a probe response frame to the second computer. In other words, when the first computer creates a target hotspot, the second computer can scan the target hotspot created by the first computer through the beacon frame broadcast by the first computer, and the second computer can also scan the target hotspot created by the first computer by sending a probe request frame to the first computer.

[0156] S503: The second computer sends an authentication request frame to the first computer.

[0157] S504: The first computer receives the authentication request frame sent by the second computer, and sends an authentication response frame in response to the authentication request frame to the second computer.

[0158] After the second computer scans the target hotspot created by the first computer, the second computer can send an authentication request frame to the first computer, and when the first computer receives the authentication request frame sent by the second computer, the first computer can send an authentication response frame to the second computer for the authentication request frame, thereby completing the authentication phase.

[0159] S505: The second computer receives the authentication response frame sent by the first computer, and sends an association request frame to the first computer, where the association request frame includes a target working bandwidth.

[0160] After the second computer receives the authentication response frame sent by the first computer, the second computer may send an association request frame to the first computer to request access to the target hotspot created by the first computer.

[0161] In addition, when the second computer is associated with the target hotspot created by the first computer, the second computer can negotiate the working bandwidth with the first computer. Exemplarily, the association request frame can include the target working bandwidth (such as 80MHz or 160MHz), and the second computer can notify the first computer that the working bandwidth of the target hotspot needs to be expanded to the target working bandwidth by sending an association request frame carrying the target working bandwidth to the first computer.

[0162] S506: The first computer receives the association request frame sent by the second computer, and sends an association response frame in response to the association request frame to the second computer.

[0163] When the first computer receives an association request frame carrying a target working bandwidth sent by the second computer, the first computer can expand the working bandwidth corresponding to the target hotspot from the initial working bandwidth (such as 20MHz) to the target working bandwidth (such as 80MHz or 160MHz), that is, when the first computer acts as a target hotspot (such as an access point, a group owner, a personal mobile hotspot, a virtual access point), the working bandwidth supported by the first computer is expanded to the target working bandwidth. After the first computer expands the working bandwidth corresponding to the target hotspot from the initial working bandwidth to the target working bandwidth, the first computer can send an association response frame to the association request frame to the second computer, and the association response frame can include the expanded working bandwidth (i.e., the target working bandwidth), which completes the association phase.

[0164] S507: The first computer sends a first key information frame to the second computer.

[0165] After the first computer sends an association response frame to the second computer, the first computer may send a first key information frame carrying a random number (ie, ap number once, ANonce) generated by the target hotspot to the second computer, thereby completing the first handshake (ie, M1).

[0166] S508: The second computer receives the first key information frame sent by the first computer, and sends a second key information frame to the first computer.

[0167] After the second computer receives the first key information frame sent by the first computer, the second computer can send a second key information frame carrying a random number (i.e., station number once, SNonce) generated by the site (or group client) and a message integrity check code (i.e., message integrity code, MIC) to the first computer, thereby completing the second handshake (i.e., M2).

[0168] S509: The first computer receives the second key information frame sent by the second computer, and sends a third key information frame to the second computer.

[0169] After the first computer receives the second key information frame sent by the second computer, the first computer can send a third key information frame carrying an encrypted group transient key (GTK) and a message integrity check code to the second computer, thereby completing the third handshake (ie, M3).

[0170] S510, the second computer receives the third key information frame sent by the first computer, and sends a fourth key information frame to the first computer, where the fourth key information frame includes a message integrity check code.

[0171] After the second computer receives the third key information frame sent by the first computer, the second computer can send a fourth key information frame carrying a message integrity check code to the first computer, completing the fourth handshake (ie, M4), that is, completing the four-way handshake stage.

[0172] That is to say, after the second computer and the first computer perform the four stages of scanning, authentication, association, and four-way handshake, the second computer and the first computer establish a WiFi connection, after which data can be transmitted between the first computer and the second computer.

[0173] It should be noted that, on the one hand, an electronic device (such as a first computer) can be used as an access point (or group owner) to establish a WiFi connection with other electronic devices (such as a second computer) that are sites (or group clients). At the same time, the electronic device can also be used as a site (or group client) to establish another WiFi connection with other electronic devices that are access points (or group owners). In other words, one electronic device can establish two WiFi connections. In addition, there are multiple operating frequency bands corresponding to the WiFi connection established between an electronic device and other electronic devices, such as 2.4GHz, 5GHz, and 6GHz. The maximum operating bandwidths corresponding to different operating frequency bands are different. For example, the maximum operating bandwidth corresponding to the 2.4GHz operating frequency band is 20MHz. For example, the maximum operating bandwidth corresponding to the 5GHz operating frequency band is 80MHz or 160MHz. In other words, the operating frequency bands corresponding to the above two WiFi connections may be different, and the maximum operating bandwidths supported by the above two WiFi connections may also be different. For example, the working frequency band corresponding to one of the two WiFi connections mentioned above is 2.4 GHz, and the maximum working bandwidth supported by the WiFi connection is 20 MHz. The working frequency band corresponding to the other WiFi connection mentioned above is 5 GHz, and the maximum working bandwidth supported by the WiFi connection is 80 MHz or 160 MHz.

[0174] On the other hand, electronic devices can establish WiFi connections with other electronic devices through their own WiFi chips (i.e., WiFi networking). Among them, existing WiFi chips mainly include WiFi chips developed by different manufacturers, such as WiFi chips of manufacturer A and WiFi chips of manufacturer B.

[0175] In actual implementation, when an electronic device (such as a first computer) equipped with a WiFi chip of manufacturer A is used as a site and is not connected to an access point of the 5GHz working frequency band (that is, the electronic device is not connected to an access point when used as a site, or the electronic device is connected to an access point of the 2.4GHz working frequency band when used as a site), when the electronic device (such as the first computer) is used as an access point, in order to avoid the electronic device using adjacent secondary channels and causing interference to other basic service sets, the electronic device sets a smaller initial working bandwidth (such as 20MHz) for the access point (that is, the target hotspot).

[0176] However, when an electronic device equipped with a WiFi chip from manufacturer B (such as a second computer) transmits data with an electronic device equipped with a WiFi chip from manufacturer A (such as a first computer), due to certain differences in the design and architecture of the WiFi chip from manufacturer A and the WiFi chip from manufacturer B, data can only be transmitted using the smaller initial working bandwidth (such as 20MHz) initially declared by the electronic device equipped with the WiFi chip from manufacturer A, and data cannot be transmitted using the larger target working bandwidth (80MHz or 160MHz) negotiated by both parties. This will result in a lower data transmission rate and, in turn, longer transmission time for large files.

[0177] The following is a schematic illustration of the data transmission method provided in the embodiment of the present application based on the process of establishing a WiFi connection between electronic devices with reference to the accompanying drawings.

[0178] In some embodiments, when the first electronic device transmits target data with the second electronic device, the first electronic device, as a site (or group client), can set filtering conditions according to information of a target hotspot created by the second electronic device as a target hotspot (i.e., an access point or a group owner). Afterwards, the first electronic device can adjust the working bandwidth of the first electronic device as a site (or group client) to the target working bandwidth according to the filtering conditions, and then the target working bandwidth can be used to transmit the target data between the first electronic device and the second electronic device.

[0179] For example, the first electronic device is a second computer equipped with a WiFi chip of manufacturer B, and the second electronic device is a first computer equipped with a WiFi chip of manufacturer A. Figure 6 As shown, the data transmission method provided in the embodiment of the present application may include: S601-S616.

[0180] S601: The first computer receives a data transmission operation.

[0181] The data transfer operation can be used to trigger the transmission of target data between the first computer and the second computer. The data transfer operation can be user input. For example, when the first computer, as an access point or group owner, needs to transfer target data to the second computer, as a site or group client, the first computer can receive the data transfer operation input by the user. The data transfer operation can also be sent by the second computer, as a site or group client. For example, when the second computer, as a site or group client, needs to transfer target data to the first computer, as an access point or group owner, the second computer can receive the data transfer operation input by the user, and in response, the second computer can send the data transfer operation to the first computer.

[0182] Exemplarily, the data transmission operation can be used to trigger the electronic device to perform a device replacement cloning operation, can also be used to trigger the electronic device to perform a data migration operation, and can also be used to trigger the electronic device to perform a file sharing operation.

[0183] For example, a data transfer operation is used to trigger a first computer to perform a machine-changing cloning operation. Figure 7 As shown in (a) of FIG. 1 , a first computer 01 displays a switch cloning control 02. In response to a user triggering operation (such as a click operation) on the switch cloning control 02, Figure 7 As shown in (b), the first computer 01 displays a device selection interface 03, which may include the identifier of the available device (e.g., the identifier of the second computer is device B). In response to the user's triggering operation (e.g., clicking operation) on the identifier of the second computer (i.e., device B), indicating that the first computer needs to transfer the cloned file to the second computer based on the WiFi connection, then as a response to the user's triggering operation on the identifier of the second computer, the first computer 01 may create a target hotspot, so that the second computer establishes a WiFi connection with the first computer through the target hotspot, and then the first computer can perform a device-swap cloning operation with the second computer.

[0184] For example, taking the data transmission operation used to trigger the first computer to perform a data migration operation as an example, the first computer can display multiple data (such as pictures, videos, audio, etc.). The first computer can receive the user's selection operation (such as a click operation) on the data displayed on the first computer. In response to the user's selection operation on the data displayed on the first computer, the first computer determines the data selected by the user as the target data. Afterwards, the first computer can receive the user's trigger operation (such as a click operation) on the data migration control. In response to the user's trigger operation on the data migration control, the first computer can display the identification of at least one available device (such as a device name). Afterwards, the first computer can receive the user's selection operation on the identification corresponding to the second computer in the identification of at least one available device, indicating that the first computer needs to transfer the target data to the second computer based on the WiFi connection. In response to the user's selection operation on the identification corresponding to the second computer, the first computer can create a target hotspot so that the second computer can establish a WiFi connection with the first computer through the target hotspot, and then the first computer can migrate the selected target data to the second computer.

[0185] For another example, taking the data transmission operation used to trigger the first computer to share files as an example, the first computer can display multiple files. The first computer can receive a user's selection operation (such as a click operation) on the file displayed on the first computer. In response to the user's selection operation on the file displayed on the first computer, the first computer determines the file selected by the user as the target file. Afterwards, the first computer can receive a user's trigger operation (such as a click operation) on the file sharing control. In response to the user's trigger operation on the file sharing control, the first computer can display the identifier of at least one available device (such as a device name). Afterwards, the first computer can receive a user's selection operation on the identifier corresponding to the second computer in the identifier of at least one available device, indicating that the first computer needs to transfer the target file of the first computer to the second computer based on a WiFi connection. In response to the user's selection operation on the identifier corresponding to the second computer, the first computer can create a target hotspot so that the second computer can establish a WiFi connection with the first computer through the target hotspot, and then the first computer can share files with the second computer.

[0186] S602: In response to the data transmission operation, the first computer creates a target hotspot.

[0187] The target hotspot can be an access point (i.e., Legacy AP), a group owner (i.e., GO), a virtual access point (i.e., SoftAP), a personal mobile hotspot, or a hotspot (i.e., HotSpot). After the first computer receives the data transmission operation, the first computer can create a target hotspot, i.e., the first computer can serve as an access point to establish a WiFi connection with the second computer.

[0188] Exemplarily, the first computer may create a target hotspot corresponding to a preset frequency band, which may be, for example, a 5 GHz frequency band.

[0189] In some examples, since the first computer is equipped with a WiFi chip of manufacturer A, in order to avoid the first computer using an adjacent secondary channel and causing interference to other basic service sets, when the first computer creates a target hotspot, the first computer can set a smaller initial working bandwidth for the target hotspot. For example, the initial working bandwidth is 20 MHz.

[0190] S603: The first computer sends information about the target hotspot to the second computer, where the information about the target hotspot includes an identifier of the target hotspot and a maximum working bandwidth corresponding to the target hotspot.

[0191] After the first computer creates the target hotspot, the first computer may send information of the target hotspot to the second computer, so that the second computer may set filtering conditions according to the information of the target hotspot.

[0192] The information of the target hotspot may include the identifier of the target hotspot and the maximum operating bandwidth corresponding to the target hotspot. The identifier of the target hotspot may be used to uniquely identify the target hotspot. Exemplarily, the identifier of the target hotspot may be a basic service set identifier (i.e., basic service set identifier, BSSID) of the target hotspot. The basic service set identifier of the target hotspot refers to the MAC address corresponding to the target hotspot, i.e., the MAC address of the first computer. The second computer may establish a WiFi connection with the first computer through the basic service set identifier of the target hotspot.

[0193] The maximum operating bandwidth corresponding to the target hotspot refers to the maximum spectrum range available for data transmission through the target hotspot, that is, the maximum operating bandwidth supported by the first computer when the role of the first computer is the target hotspot (such as Legacy AP or GO). The maximum operating bandwidth corresponding to the target hotspot is related to the operating frequency band corresponding to the target hotspot. For example, when the target hotspot is a target hotspot corresponding to the 5GHz operating frequency band, the maximum operating bandwidth corresponding to the target hotspot is 80MHz or 160MHz.

[0194] In some examples, the information of the target hotspot may also include a service set identifier of the target hotspot, a working channel corresponding to the target hotspot, and a password corresponding to the target hotspot. The service set identifier of the target hotspot refers to the name of the target hotspot, that is, the device name of the first computer. The working channel corresponding to the target hotspot may indicate the working channel corresponding to the working frequency band supported by the first computer when the role of the first computer is the target hotspot (such as Legacy AP or GO). The password corresponding to the target hotspot may be pre-set by the first computer or pre-set by the user.

[0195] In some examples, the first computer sending the target hotspot information to the second computer may include: the first computer may send the target hotspot information to the second computer via Bluetooth communication.

[0196] S604: The second computer receives the target hotspot information sent by the first computer.

[0197] After the second computer receives the target hotspot information sent by the first computer, the second computer can set filtering conditions according to the target hotspot information.

[0198] S605: The second computer obtains the chip type of the WiFi chip configured in the second computer.

[0199] Due to certain differences in the design and architecture of the WiFi chip of manufacturer A and the WiFi chip of manufacturer B, when a second computer equipped with a WiFi chip of manufacturer B establishes a WiFi connection with a first computer equipped with a WiFi chip of manufacturer A and transmits data through the WiFi connection, data can only be transmitted using the smaller bandwidth initially claimed by the first computer, but cannot be transmitted using the larger bandwidth negotiated between the first and second computers. Therefore, before the second computer sets filtering conditions, the second computer can obtain the chip type of the WiFi chip configured in the second computer, and determine whether the chip type of the WiFi chip configured in the second computer is the first type, so that when the chip type of the WiFi chip configured in the second computer is the first type, the second computer sets filtering conditions according to the information of the target hotspot.

[0200] S606: When the chip type of the WiFi chip configured in the second computer is the first type, the second computer sets a filtering condition according to the information of the target hotspot, wherein the filtering condition includes a target identifier and a target working bandwidth.

[0201] The chip type of the WiFi chip may refer to the manufacturer of the WiFi chip. The first type may be used to indicate the WiFi chip of the target manufacturer (i.e., the WiFi chip of manufacturer B). That is, when the WiFi chip configured in the second computer is the WiFi chip of the target manufacturer, the second computer sets the filtering condition according to the information of the target hotspot.

[0202] The filtering condition may include a target identifier and a target working bandwidth. The target identifier may be used to determine whether the hotspot scanned by the second computer is a target hotspot. The target working bandwidth may be a working bandwidth to be set for the target hotspot.

[0203] In some examples, the second computer sets the filtering condition according to the information of the target hotspot, which may include: determining the identifier of the target hotspot as the target identifier, and determining the maximum working bandwidth corresponding to the target hotspot as the target working bandwidth. For example, the target working bandwidth may be 80 MHz or 160 MHz.

[0204] In some examples, when the chip type of the WiFi chip configured in the second computer is the first type, the second computer can obtain the data volume corresponding to the target data, and when the data volume corresponding to the target data is greater than or equal to the preset data volume, the second computer sets filtering conditions according to the information of the target hotspot. In this way, when the data volume of the target data to be transmitted is less than the preset data volume, there is no need to set filtering conditions, and the target data can be transmitted using the initial working bandwidth when the first computer creates the access point; and when the data volume of the target data to be transmitted is greater than or equal to the preset data volume, by setting filtering conditions, the working bandwidth of the second computer as a site can be adjusted to the target working bandwidth, and then the target working bandwidth can be used to transmit the target data, which can increase the file transfer rate and thus improve the user experience.

[0205] In the embodiment of the present application, after the second computer sets the filtering condition, the second computer can establish a WiFi connection with the first computer, and set the working bandwidth corresponding to the WiFi connection as the target working bandwidth. The following describes the process of establishing a WiFi connection between the second computer and the first computer and setting the working bandwidth corresponding to the WiFi connection as the target working bandwidth in conjunction with S607-S615.

[0206] S607: The first computer sends a beacon frame to the second computer, where the beacon frame includes an initial working bandwidth.

[0207] After the first computer sends the target hotspot information to the second computer, the first computer as the target hotspot (i.e., the first computer providing the WiFi hotspot function) can send a beacon frame to the second computer, i.e., the first computer periodically broadcasts the beacon frame so that the second computer can establish a WiFi connection with the first computer. The beacon frame may include an initial working bandwidth, and the initial working bandwidth may be the working bandwidth corresponding to the target hotspot set when the first computer creates the target hotspot. For example, the initial working bandwidth is 20MHz.

[0208] S608: The second computer receives the beacon frame sent by the first computer.

[0209] After the first computer sends a beacon frame to the second computer, the second computer receives the beacon frame sent by the first computer, that is, the second computer scans the hotspot. In the case of the hotspot scanned by the second computer, the second computer can determine the identifier corresponding to the scanned hotspot to determine whether the second computer scans the target hotspot created by the first computer according to the identifier corresponding to the scanned hotspot.

[0210] In some examples, after the first computer sends the target hotspot information to the second computer, the second computer may also send a probe request frame to the first computer, and after the first computer receives the probe request frame sent by the second computer, the first computer may send a probe response frame to the second computer. In other words, after the first computer sends the target hotspot information to the second computer, the second computer may scan the hotspot through the beacon frame broadcast by the first computer, and the second computer may also scan the target hotspot by sending a probe request frame to the first computer.

[0211] S609. The second computer determines whether the identifier corresponding to the scanned hotspot matches the target identifier. If the identifier corresponding to the scanned hotspot matches the target identifier, the second computer sets the working bandwidth of the target hotspot to the target working bandwidth.

[0212] After the second computer determines the identifier corresponding to the scanned hotspot, the second computer can determine the identifier corresponding to the scanned hotspot, and can compare the identifier corresponding to the scanned hotspot with the target identifier in the filtering condition (i.e., the identifier of the target hotspot created by the first computer). When the identifier corresponding to the hotspot scanned by the second computer matches the target identifier in the filtering condition, it means that the hotspot scanned by the second computer can support the target working bandwidth in the filtering condition. Therefore, the second computer can set the working bandwidth of the target hotspot to the target working bandwidth (such as 80MHz or 160MHz), that is, when the second computer acts as a site (or group client), the second computer sets the working bandwidth corresponding to the WiFi connection established between the second computer and the first computer to the target working bandwidth, that is, the second computer sets the working bandwidth of the second computer as a site to the target working bandwidth.

[0213] In some examples, the specific process of the second computer setting the working bandwidth of the target hotspot to the target working bandwidth may include: the second computer is provided with a bandwidth setting interface, and when the identifier corresponding to the hotspot scanned by the second computer matches the target identifier in the filtering condition, the second computer can send the target working bandwidth to the WiFi chip of the second computer through the bandwidth setting interface to set the working bandwidth of the WiFi chip of the second computer to the target working bandwidth (such as 80MHz or 160MHz).

[0214] In some examples, when the identifier corresponding to the hotspot scanned by the second computer does not match the target identifier in the filtering conditions, the second computer establishes a WiFi connection with the first computer so that the first computer and the second computer transmit data based on the WiFi connection. That is, when the identifier corresponding to the hotspot scanned by the second computer does not match the target identifier in the filtering conditions, it means that the hotspot scanned by the second computer is not the target hotspot created by the first computer, and the step of the second computer setting the working bandwidth of the target hotspot to the target working bandwidth is not executed.

[0215] S610: The second computer sends an authentication request frame to the first computer.

[0216] S611. The first computer receives an authentication request frame sent by the second computer, and sends an authentication response frame in response to the authentication request frame to the second computer.

[0217] After the second computer sets the working bandwidth of the target hotspot to the target working bandwidth, the second computer sends an authentication request frame to the first computer, and when the first computer receives the authentication request frame sent by the second computer, the first computer can send an authentication response frame for the authentication request frame to the second computer, thereby completing the authentication phase.

[0218] S612: The second computer receives the authentication response frame sent by the first computer, and sends an association request frame to the first computer, where the association request frame includes a target working bandwidth.

[0219] After the second computer receives the authentication response frame sent by the first computer, the second computer can send an association request frame to the first computer to request access to the target hotspot created by the first computer.

[0220] In addition, when the second computer is associated with the target hotspot created by the first computer, the second computer can negotiate the working bandwidth with the first computer. Exemplarily, the association request frame can include the target working bandwidth (such as 80MHz or 160MHz), and the second computer can notify the first computer that the working bandwidth of the target hotspot needs to be expanded to the target working bandwidth by sending an association request frame carrying the target working bandwidth to the first computer.

[0221] S613: The first computer receives the association request frame sent by the second computer, and the first computer expands the initial working bandwidth corresponding to the target hotspot to the target working bandwidth.

[0222] When the first computer receives an association request frame carrying the target working bandwidth sent by the second computer, the first computer can expand the working bandwidth corresponding to the target hotspot from the initial working bandwidth (such as 20MHz) to the target working bandwidth (such as 80MHz or 160MHz), that is, when the first computer acts as a target hotspot (such as an access point, a group owner, a personal mobile hotspot, a virtual access point), the first computer expands the working bandwidth corresponding to the WiFi connection established between the second computer and the first computer from the initial working bandwidth (such as 20MHz) to the target working bandwidth (such as 80MHz or 160MHz), that is, the first computer expands the working bandwidth of the first computer as a target hotspot from the initial working bandwidth (such as 20MHz) to the target working bandwidth (such as 80MHz or 160MHz).

[0223] S614. The first computer sends an association response frame to the second computer in response to the association request frame, where the association response frame is used to indicate that the working bandwidth of the target hotspot created by the first computer is extended to the target working bandwidth.

[0224] After the first computer expands the working bandwidth corresponding to the target hotspot from the initial working bandwidth to the target working bandwidth, the first computer can send an association response frame to the second computer for the association request frame, and the association response frame can include the expanded working bandwidth (i.e., the target working bandwidth), thus completing the association phase. In other words, in the association phase, the first computer and the second computer negotiate the working bandwidth corresponding to the target hotspot to be the target working bandwidth.

[0225] S615: The first computer and the second computer perform a four-way handshake.

[0226] It should be noted that the specific implementation method of the four-way handshake between the first computer and the second computer in the embodiment of the present application can refer to the above S507-S510, which will not be repeated in the embodiment of the present application.

[0227] S616: The first computer and the second computer transmit target data using the target working bandwidth.

[0228] In some examples, the target data transmission between the first computer and the second computer using the target working bandwidth may include: when the first computer transmits the target data to the second computer (i.e., the data transmission operation is a data transmission operation input by the user for the target data of the first computer), the first computer may use the target working bandwidth to transmit the target data (such as a file) to the second computer.

[0229] In some examples, the target data transmission between the first computer and the second computer using the target working bandwidth may include: when the second computer transmits the target data to the first computer (i.e., the data transmission operation is a data transmission operation input by the user for the target data of the second computer), the second computer may use the target working bandwidth to transmit the target data (such as a file) to the first computer.

[0230] In the embodiment of the present application, when the first computer and the second computer transmit target data, the second computer, as a site (or group client), can set filtering conditions according to the information of the target hotspot created by the first computer as an access point (or group owner). Afterwards, when the hotspot scanned by the second computer is the target hotspot created by the first computer, the second computer can adjust the working bandwidth of the second computer as a site (or group client) to the target working bandwidth according to the filtering conditions, and then the second computer and the first computer can use a larger target working bandwidth to transmit data, which can improve the data transmission rate, shorten the data transmission time, and improve the user experience.

[0231] In some embodiments, when the first electronic device is a terminal device, the first electronic device does not provide a working bandwidth that can be used to set the supported working bandwidth of the WiFi chip carried by the first electronic device. Therefore, when the first electronic device and the second electronic device transmit target data, the first electronic device, as a site (or group client), can obtain the working frequency band corresponding to the target hotspot (i.e., access point or group owner) created by the second electronic device. Thereafter, when the working frequency band corresponding to the access point (or group owner) created by the second electronic device is the target frequency band, the first electronic device can adjust the working bandwidth supported by the WiFi chip carried by it to the maximum working bandwidth corresponding to the target frequency band (i.e., target working bandwidth), and then the target working bandwidth can be used to transmit target data between the first electronic device and the second electronic device.

[0232] For example, the first electronic device is a mobile phone equipped with a WiFi chip of manufacturer B, and the second electronic device is a first computer equipped with a WiFi chip of manufacturer A. Figure 8 As shown, the data transmission method provided in the embodiment of the present application may include: S801-S812.

[0233] S801, the first computer receives a data transmission operation.

[0234] The data transmission operation can be used to trigger the transmission of target data between the first computer and the mobile phone. The data transmission operation can be input by the user. For example, when the first computer, as an access point or group owner, needs to transmit target data to the mobile phone, which is a site or group client, the first computer can receive the data transmission operation input by the user. The data transmission operation can also be sent by the mobile phone, which is a site or group client. For example, when the mobile phone, as a site or group client, needs to transmit target data to the first computer, which is an access point or group owner, the mobile phone can receive the data transmission operation input by the user, and in response, the mobile phone can send the data transmission operation to the first computer.

[0235] Exemplarily, the data transmission operation can be used to trigger a device switching and cloning operation between the first computer and the mobile phone, can also be used to trigger a data migration operation between the first computer and the mobile phone, and can also be used to trigger a file sharing operation between the first computer and the mobile phone.

[0236] It should be noted that the specific implementation method of the input data transmission operation in the embodiment of the present application can refer to the above S601, which will not be repeated in the embodiment of the present application.

[0237] S802: In response to the data transmission operation, the first computer creates a target hotspot.

[0238] The target hotspot can be an access point (i.e., Legacy AP), a group owner (i.e., GO), a virtual access point (i.e., SoftAP), a personal mobile hotspot, or a hotspot (i.e., HotSpot). After the first computer receives the data transmission operation, the first computer can create a target hotspot, i.e., the first computer can serve as an access point to establish a WiFi connection with the mobile phone.

[0239] In some examples, since the first computer is equipped with a WiFi chip of manufacturer A, in order to avoid the first computer using an adjacent secondary channel and causing interference to other basic service sets, when the first computer creates a target hotspot, the first computer can set a smaller initial working bandwidth for the target hotspot. For example, the initial working bandwidth is 20 MHz.

[0240] In the embodiment of the present application, after the first computer creates the target hotspot, the mobile phone can establish a WiFi connection with the first computer and set the working bandwidth corresponding to the WiFi connection to the target working bandwidth. The following describes the process of establishing a WiFi connection between the mobile phone and the first computer and setting the working bandwidth corresponding to the WiFi connection to the target working bandwidth in conjunction with S803-S814.

[0241] S803. The first computer sends a beacon frame to the mobile phone, where the beacon frame includes a working frequency band and an initial working bandwidth corresponding to the target hotspot.

[0242] After the first computer creates the target hotspot, the first computer may send a beacon frame to the mobile phone, that is, the first computer periodically broadcasts the beacon frame so that the mobile phone can establish a WiFi connection with the first computer. The beacon frame may include the working frequency band corresponding to the target hotspot and the initial working bandwidth corresponding to the target hotspot. The initial working bandwidth may be the working bandwidth corresponding to the target hotspot set when the first computer creates the target hotspot. For example, the initial working bandwidth is 20MHz.

[0243] S804. The mobile phone receives a beacon frame sent by the first computer.

[0244] When the mobile phone receives the beacon frame sent by the first computer, it indicates that the mobile phone has scanned the target hotspot created by the first computer.

[0245] In some examples, after the first computer creates the target hotspot, the mobile phone can also send a probe request frame to the first computer, and after the first computer receives the probe request frame sent by the mobile phone, the first computer can send a probe response frame to the mobile phone. In other words, after the first computer creates the target hotspot, the mobile phone can scan the target hotspot created by the first computer through the beacon frame broadcast by the first computer, and the mobile phone can also scan the target hotspot created by the first computer by sending a probe request frame to the first computer.

[0246] S805: When the working frequency band corresponding to the target hotspot is the target frequency band, the mobile phone sets the working bandwidth of the WiFi chip configured therein to the target working bandwidth.

[0247] The target frequency band may be a frequency band that supports a larger working bandwidth. For example, the target frequency band is a 5 GHz frequency band or a 6 GHz frequency band. The target working bandwidth is the maximum working bandwidth supported by the first computer when the first computer creates a target hotspot corresponding to the target frequency band. For example, the target working bandwidth is 80 MHz or 160 MHz.

[0248] When the mobile phone receives the beacon frame sent by the first computer, the mobile phone can obtain the working frequency band corresponding to the target hotspot created by the first computer. The mobile phone can determine whether the working frequency band corresponding to the target hotspot created by the first computer is the target frequency band (such as the 5GHz band). When the working frequency band corresponding to the target hotspot created by the first computer is the target frequency band (such as the 5GHz band), the mobile phone can set the working bandwidth of its configured WiFi chip to the target working bandwidth (such as 80MHz or 160MHz), that is, when the mobile phone is used as a site, the mobile phone sets the working bandwidth corresponding to the WiFi connection established between the mobile phone and the first computer to the target working bandwidth, that is, the mobile phone sets the working bandwidth of the mobile phone as a site to the target working bandwidth.

[0249] In some examples, when the mobile phone sets the operating bandwidth of the configured WiFi chip to the target operating bandwidth, the mobile phone can write the target operating bandwidth into the firmware of the configured WiFi chip.

[0250] In some examples, before the mobile phone sets the working bandwidth of the WiFi chip configured in it to the target working bandwidth, the mobile phone can obtain the data volume corresponding to the target data. When the data volume corresponding to the target data is greater than or equal to the preset data volume, and the working frequency band corresponding to the target hotspot is the target frequency band, the mobile phone sets the working bandwidth of the WiFi chip configured in it to the target working bandwidth. In this way, when the data volume of the target data to be transmitted is less than the preset data volume, the target data can be transmitted using the initial working bandwidth when the first computer creates the access point; and when the data volume of the target data to be transmitted is greater than or equal to the preset data volume, the working bandwidth of the mobile phone as a site can be adjusted to the target working bandwidth, and then the target data can be transmitted using the target working bandwidth, which can increase the file transfer rate and thus improve the user experience.

[0251] S806. The mobile phone sends an authentication request frame to the first computer.

[0252] S807. The first computer receives the authentication request frame sent by the mobile phone, and sends an authentication response frame in response to the authentication request frame to the mobile phone.

[0253] After the mobile phone sets the working bandwidth of its configured WiFi chip to the target working bandwidth, the mobile phone can send an authentication request frame to the first computer, and when the first computer receives the authentication request frame sent by the mobile phone, the first computer can send an authentication response frame for the authentication request frame to the mobile phone, thereby completing the authentication stage.

[0254] S808. The mobile phone receives the authentication response frame sent by the first computer, and sends an association request frame to the first computer, where the association request frame includes a target working bandwidth.

[0255] After the mobile phone receives the authentication response frame sent by the first computer, the mobile phone can send an association request frame to the first computer to request access to the target hotspot created by the first computer. The association request frame may include the target working bandwidth. The mobile phone can send an association request frame carrying the target working bandwidth to the first computer, thereby notifying the first computer that the working bandwidth of the mobile phone when it is a site (or group client) is the target working bandwidth (such as 80MHz or 160MHz).

[0256] S809: The first computer receives the association request frame sent by the mobile phone, and if the first computer supports the target working bandwidth, the first computer expands the initial working bandwidth corresponding to the target hotspot to the target working bandwidth.

[0257] When the first computer receives the association request frame sent by the mobile phone, the first computer can negotiate bandwidth with the mobile phone according to the working bandwidth it supports. In some examples, when the first computer supports the target working bandwidth (i.e., the maximum working bandwidth supported by the first computer as an access point is greater than or equal to the target working bandwidth), the first computer can expand the initial working bandwidth (e.g., 20MHz) corresponding to the target hotspot to the target working bandwidth (e.g., 80MHz or 160MHz), that is, when the first computer is the target hotspot (e.g., access point, group owner, personal mobile hotspot, virtual access point), the first computer expands the working bandwidth corresponding to the WiFi connection established between the second computer and the first computer from the initial working bandwidth (e.g., 20MHz) to the target working bandwidth (e.g., 80MHz or 160MHz). After the first computer expands the initial working bandwidth corresponding to the target hotspot to the target working bandwidth, the first computer sends an association response frame to the mobile phone, and the association response frame may include the extended working bandwidth (i.e., the target working bandwidth), that is, the association phase is completed. In other words, in the association phase, the first computer and the mobile phone negotiate the working bandwidth corresponding to the target hotspot to the target working bandwidth.

[0258] For example, the mobile phone sets the working bandwidth of its configured WiFi chip to 80MHz. When the first computer supports a working bandwidth of 80MHz, the first computer expands the initial working bandwidth corresponding to the target hotspot (such as 20MHz) to 80MHz, and sends an association response frame to the mobile phone. The bandwidth information carried by the association response frame is 80MHz, that is, the mobile phone and the first computer negotiate the working bandwidth corresponding to the target hotspot to 80MHz (that is, the target working bandwidth).

[0259] In some examples, when the first computer does not support the target working bandwidth (i.e., the maximum working bandwidth supported by the first computer as an access point is less than the target working bandwidth), the first computer can negotiate with the mobile phone to reduce the target working bandwidth to the maximum working bandwidth supported by the first computer (i.e., the maximum working bandwidth supported by the first computer as an access point). Afterwards, the first computer and the mobile phone can be connected based on WiFi and use the negotiated working bandwidth (i.e., the maximum working bandwidth supported by the first computer as an access point) for data transmission.

[0260] For example, the mobile phone sets the working bandwidth of its configured WiFi chip to 80MHz. When the maximum working bandwidth supported by the first computer as an access point is 40MHz (when the first computer does not support the target working bandwidth of 80MHz), the first computer expands the initial working bandwidth corresponding to the target hotspot (such as 20MHz) to 40MHz, and sends an association response frame to the mobile phone. The bandwidth information carried by the association response frame is 40MHz, that is, the mobile phone and the first computer negotiate the working bandwidth corresponding to the target hotspot to 40MHz (that is, the maximum working bandwidth supported when the first computer is used as an access point).

[0261] S810. The first computer sends an association response frame to the mobile phone in response to the association request frame, where the association response frame is used to indicate that the working bandwidth of the target hotspot created by the first computer is extended to the target working bandwidth.

[0262] After the first computer expands the initial working bandwidth corresponding to the target hotspot to the target working bandwidth, the first computer can send an association response frame to the mobile phone for the association request frame, and the association response frame is used to indicate that the working bandwidth of the target hotspot created by the first computer is expanded to the target working bandwidth.

[0263] S811. The first computer and the mobile phone perform a four-way handshake.

[0264] It should be noted that the specific implementation method of the four-way handshake between the first computer and the mobile phone in the embodiment of the present application can refer to the above S507-S510, which will not be repeated in the embodiment of the present application.

[0265] S812. The first computer and the mobile phone transmit target data using the target working bandwidth.

[0266] In some examples, the target data transmission between the first computer and the mobile phone using the target working bandwidth may include: when the first computer transmits the target data to the mobile phone (i.e., the data transmission operation is a data transmission operation input by the user for the target data of the first computer), the first computer may use the target working bandwidth to transmit the target data (such as a file) to the mobile phone.

[0267] In some examples, the target data is transmitted between the first computer and the mobile phone using the target working bandwidth, which may include: when the mobile phone transmits the target data to the first computer (i.e., the data transmission operation is a data transmission operation input by the user for the target data of the mobile phone), the mobile phone may use the target working bandwidth to transmit the target data (such as a file) to the first computer.

[0268] In the embodiment of the present application, when the first computer and the mobile phone transmit target data, the mobile phone, as a site (or group client), can obtain the working frequency band corresponding to the target hotspot (i.e., access point or group owner) created by the first computer. When the working frequency band corresponding to the target hotspot is the target frequency band, the mobile phone can adjust the working bandwidth supported by the WiFi chip it carries to the maximum working bandwidth corresponding to the target frequency band (i.e., the target working bandwidth), and then the first computer and the mobile phone can use a larger target working bandwidth to transmit the target data, which can improve the data transmission rate, shorten the data transmission time, and thus improve the user experience.

[0269] In some embodiments, when the first electronic device transmits target data with the second electronic device, the first electronic device, as a site (or group client), can establish a WiFi connection with the second electronic device as a target hotspot (i.e., an access point or group owner). Afterwards, when the working bandwidth corresponding to the WiFi connection is inconsistent with the target working bandwidth, the first electronic device can send a reconnection notification to the second electronic device to notify the second electronic device that the first electronic device will disconnect from the second electronic device and re-establish the WiFi connection. Afterwards, the first electronic device re-establishes a WiFi connection with the second electronic device, wherein the working bandwidth corresponding to the re-established WiFi connection is the target working bandwidth, and the target data can be transmitted between the first electronic device and the second electronic device using the target working bandwidth.

[0270] For example, the first electronic device is a second computer equipped with a WiFi chip of manufacturer B, and the second electronic device is a first computer equipped with a WiFi chip of manufacturer A. Fig. 9 As shown, the data transmission method provided in the embodiment of the present application may include: S901-S911.

[0271] S901. A first computer receives a data transmission operation for target data.

[0272] The data transfer operation can be used to trigger the transmission of target data between the first computer and the second computer. The data transfer operation can be user input. For example, when the first computer, as an access point or group owner, needs to transfer target data to the second computer, as a site or group client, the first computer can receive the data transfer operation input by the user. The data transfer operation can also be sent by the second computer, as a site or group client. For example, when the second computer, as a site or group client, needs to transfer target data to the first computer, as an access point or group owner, the second computer can receive the data transfer operation input by the user, and in response, the second computer can send the data transfer operation to the first computer.

[0273] S902: In response to the data transmission operation, the first computer creates a target hotspot.

[0274] The target hotspot can be an access point (i.e., Legacy AP), a group owner (i.e., GO), a virtual access point (i.e., SoftAP), a personal mobile hotspot, or a hotspot (i.e., HotSpot). After the first computer receives the data transmission operation, the first computer can create a target hotspot, i.e., the first computer can serve as an access point to establish a WiFi connection with the second computer.

[0275] In some examples, since the first computer is equipped with a WiFi chip of manufacturer A, in order to avoid the first computer using an adjacent secondary channel and causing interference to other basic service sets, when the first computer creates a target hotspot, the first computer can set a smaller initial working bandwidth for the target hotspot. For example, the initial working bandwidth is 20 MHz.

[0276] S903. The first computer sends a first beacon frame to the second computer, where the first beacon frame includes an initial working bandwidth corresponding to the target hotspot.

[0277] After the first computer creates the target hotspot, the first computer as the target hotspot (i.e., the first computer providing the WiFi hotspot function) can send a first beacon frame to the second computer, i.e., the first computer periodically broadcasts the first beacon frame so that the second computer can access the target hotspot created by the first computer, i.e., the second computer can establish a WiFi connection with the first computer. The first beacon frame can include an initial working bandwidth, and the initial working bandwidth can be the working bandwidth corresponding to the target hotspot set when the first computer creates the target hotspot. For example, the initial working bandwidth is 20MHz.

[0278] In some examples, after the first computer creates a target hotspot, the second computer may also send a probe request frame to the first computer, and after the first computer receives the probe request frame sent by the second computer, the first computer may send a probe response frame to the second computer. That is, after the first computer creates a target hotspot, the second computer may scan the target hotspot created by the first computer through the first beacon frame broadcast by the first computer, and the second computer may also scan the target hotspot created by the first computer by sending a probe request frame to the first computer.

[0279] S904: When the second computer receives the first beacon frame sent by the first computer, the second computer accesses the target hotspot created by the first computer.

[0280] When the second computer receives the first beacon frame sent by the first computer, the second computer can access the target hotspot created by the first computer, that is, the second computer establishes a WiFi connection with the first computer.

[0281] Exemplarily, after the second computer receives the first beacon frame sent by the first computer, the second computer can send an authentication request frame to the first computer. When the first computer receives the authentication request frame sent by the second computer, the first computer can send an authentication response frame to the second computer for the authentication request frame, that is, completing the authentication phase. After the second computer receives the authentication response frame sent by the first computer, the second computer can send an association request frame carrying the target working bandwidth (such as 80MHz or 160MHz) to the first computer, for requesting access to the target hotspot created by the first computer, and notifying the first computer that the working bandwidth of the target hotspot needs to be extended to the target working bandwidth. When the first computer receives the association request frame carrying the target working bandwidth sent by the second computer, the first computer can extend the working bandwidth corresponding to the target hotspot from the initial working bandwidth (such as 20MHz) to the target working bandwidth (such as 80MHz or 160MHz), and send an association response frame to the association request frame to the second computer. The association response frame may include the extended working bandwidth (i.e., the target working bandwidth), that is, completing the association phase, that is, in the association phase, the second computer and the first computer negotiate the working bandwidth corresponding to the target hotspot to be the target working bandwidth (such as 80MHz or 160MHz). Afterwards, the first computer and the second computer perform a four-way handshake, that is, the second computer and the first computer establish a WiFi connection.

[0282] It should be noted that the specific implementation method of establishing a WiFi connection between the second computer and the first computer in the embodiment of the present application can refer to S503-S510, which will not be repeated in the embodiment of the present application.

[0283] S905: The second computer obtains the data volume corresponding to the target data.

[0284] After the second computer accesses the target hotspot created by the first computer (i.e., the second computer establishes a WiFi connection with the first computer), the second computer can obtain the data volume corresponding to the target data, and then the second computer can determine whether it needs to send a disconnection notification to the first computer based on the size of the data volume corresponding to the target data.

[0285] S906. When the data volume corresponding to the target data is greater than or equal to the preset data volume, the second computer sends a reconnection notification to the first computer, where the reconnection notification is used to instruct the second computer to disconnect from the target hotspot created by the first computer and re-establish a connection.

[0286] The preset data volume can be used to measure whether the data volume corresponding to the target data is large. For example, the preset data volume is 1G. That is to say, when the second computer determines that the data volume corresponding to the target data is greater than or equal to the preset data volume, the second computer can send a reconnection notification to the first computer, and the reconnection notification can be used to instruct the second computer to disconnect from the target hotspot created by the first computer and re-establish the connection, that is, the second computer notifies the first computer by sending a reconnection notification to the first computer, at which time the second computer will disconnect from the first computer and re-establish the WiFi connection to avoid the first computer canceling the target hotspot (i.e., destroying the target hotspot).

[0287] In some examples, when the second computer determines that the data volume corresponding to the target data is less than a preset data volume, the second computer and the first computer may use the initial working bandwidth to transmit the target data.

[0288] S907. The second computer sends a deauthentication request frame to the first computer.

[0289] After the first computer receives the reconnection notification sent by the second computer or the second computer receives a response message to the reconnection notification sent by the first computer, the second computer sends a deauthentication request (ie, deauthrequest) frame to the first computer.

[0290] S908. The first computer receives the deauthentication request frame sent by the second computer, and replies with a confirmation frame to the second computer.

[0291] After the second computer sends a reconnection notification to the first computer, the second computer can send a deauthentication request frame to the first computer. When the first computer receives the deauthentication request frame sent by the second computer, the first computer can reply with a confirmation frame to the second computer, that is, the second computer is disconnected from the target hotspot created by the first computer.

[0292] S909. The first computer sends a second beacon frame to the second computer, where the second beacon frame includes a target working bandwidth corresponding to the target hotspot.

[0293] Because when the second computer and the first computer establish a WiFi connection for the first time, the first computer expands the working bandwidth corresponding to the target hotspot from the initial working bandwidth (such as 20MHz) to the target working bandwidth (such as 80MHz or 160MHz). And because when the second computer disconnects the WiFi connection from the first computer, the first computer does not destroy the created target hotspot. Therefore, when the first computer broadcasts a beacon frame again (that is, the first computer sends a second beacon frame to the second computer), the working bandwidth information carried by the second beacon frame is the target working bandwidth (such as 80MHz or 160MHz), that is, the first computer can send a second beacon frame carrying the target working bandwidth to the second computer, so that the second computer can re-access the target hotspot created by the first computer.

[0294] S910: When the second computer receives the second beacon frame sent by the first computer, the second computer re-accesses the target hotspot created by the first computer.

[0295] When the second computer receives the second beacon frame sent by the first computer, the second computer can re-access the target hotspot created by the first computer, that is, the second computer re-establishes a WiFi connection with the first computer.

[0296] Exemplarily, after the second computer receives the second beacon frame sent by the first computer, the second computer can send an authentication request frame to the first computer. When the first computer receives the authentication request frame sent by the second computer, the first computer can send an authentication response frame to the second computer for the authentication request frame, that is, completing the authentication phase. After the second computer receives the authentication response frame sent by the first computer, the second computer can send an association request frame carrying the target working bandwidth (such as 80MHz or 160MHz) to the first computer to request access to the target hotspot created by the first computer. When the first computer receives the association request frame sent by the second computer, the first computer can send an association response frame to the association request frame to the second computer. The association response frame may include the extended working bandwidth (i.e., the target working bandwidth), that is, completing the association phase, that is, in the association phase, the second computer and the first computer negotiate the working bandwidth corresponding to the target hotspot to the target working bandwidth (such as 80MHz or 160MHz). Afterwards, the first computer and the second computer perform a four-way handshake, that is, the second computer and the first computer re-establish a WiFi connection.

[0297] It should be noted that the specific implementation method of the second computer and the first computer re-establishing the WiFi connection in the embodiment of the present application can refer to S503-S510, which will not be repeated in the embodiment of the present application.

[0298] S911. The first computer and the second computer transmit target data using a target working bandwidth.

[0299] Since the first computer can send a second beacon frame carrying the target working bandwidth to the second computer when the first computer and the second computer re-establish a WiFi connection, when the second computer receives the second beacon frame sent by the first computer (i.e., the second computer finds that the first computer has created a target hotspot), the second computer can write a larger target working bandwidth (such as 80MHz or 160MHz) into the firmware of the WiFi chip that the second computer can carry. In this way, the target working bandwidth can be used to transmit target data between the first computer and the second computer.

[0300] In some examples, the target data transmission between the first computer and the second computer using the target working bandwidth may include: when the first computer transmits the target data to the second computer (i.e., the data transmission operation is a data transmission operation input by the user for the target data of the first computer), the first computer may use the target working bandwidth to transmit the target data (such as a file) to the second computer.

[0301] In some examples, the target data transmission between the first computer and the second computer using the target working bandwidth may include: when the second computer transmits the target data to the first computer (i.e., the data transmission operation is a data transmission operation input by the user for the target data of the second computer), the second computer may use the target working bandwidth to transmit the target data (such as a file) to the first computer.

[0302] In an embodiment of the present application, when the first computer and the second computer transmit target data, the second computer, as a site (or group client), can establish a WiFi connection with the first computer as a target hotspot (i.e., an access point or group owner). Afterwards, when the working bandwidth corresponding to the WiFi connection is inconsistent with the target working bandwidth, the second computer can send a reconnection notification to the first computer to notify the first computer that the second computer will disconnect from the first computer and re-establish the WiFi connection. Afterwards, the second computer re-establishes a WiFi connection with the first computer, wherein the working bandwidth corresponding to the re-established WiFi connection is the target working bandwidth, and then the first computer and the second computer can use a larger target working bandwidth to transmit target data, which can increase the data transmission rate, shorten the data transmission time, and enhance the user experience.

[0303] In some embodiments, when a first electronic device and a second electronic device are transmitting target data, if the working bandwidth for transmitting data between the first electronic device and the second electronic device is inconsistent with the target working bandwidth (i.e., the first electronic device and the second electronic device cannot use the negotiated larger working bandwidth to transmit data), the first electronic device may send a management frame notification to the second electronic device so that the working bandwidth corresponding to the WiFi connection established between the first electronic device and the second electronic device is adjusted to the target working bandwidth indicated by the management frame notification, and the target working bandwidth may be used to transmit target data between the first electronic device and the second electronic device.

[0304] The management frame notification may be an 802.11 management frame notification. Exemplarily, the management frame notification may be an extended channel switch announcement (ie, an extended channel switch announcement, ECSA).

[0305] like Fig.10As shown, the extended channel switch notification (i.e., ECSA) may include six fields: information element identifier (i.e., elementid), length (i.e., length), channel switch mode (i.e., channel switch mode), new channel (i.e., new channelnumber), new operating class (i.e., new operating class), and channel switch timing (i.e., channel switchcount).

[0306] Among them, the information element identifier can be used to identify a specific type of information element so that the electronic device can correctly parse and process the received signal. The length can be used to indicate the length of the field corresponding to the extended channel switching notification. The field corresponding to the channel switching mode can be used to indicate the channel switching mode currently supported by the electronic device. The field corresponding to the new operating level can indicate the new operating level currently corresponding to the electronic device. The new operating level of the electronic device is different, and the working bandwidth of the electronic device as a site is different, that is, by setting the field corresponding to the new operating level of the extended channel switching notification, the electronic device can be notified to adjust the working bandwidth of the electronic device as a site according to the field corresponding to the new operating level. For example, the field corresponding to the new operating level is set to 124, that is, when the electronic device receives the extended channel switching notification, the electronic device can set its working bandwidth corresponding to the site to 80MHz.

[0307] Exemplarily, the management frame notification may also be an operating mode notification (ie, operating mode notification, OMN).

[0308] like Fig.11As shown, the working mode notification (ie, OMN) may include five fields: channel bandwidth (ie, channel width), 160 / 80+80BW, No LDPC, receiving spatial stream (ie, Rx NSS), and receiving spatial stream type (ie, Rx NSS Type). Among them, the field corresponding to the channel bandwidth can be used to indicate the working bandwidth that the electronic device is to support as the working bandwidth of the station. By setting the field corresponding to the channel bandwidth of the working mode notification, the electronic device can be notified to adjust the working bandwidth of the electronic device as a station according to the field corresponding to the channel bandwidth. For example, the field corresponding to the channel bandwidth is set to 0x2, that is, the working mode notification can instruct the electronic device to set the working bandwidth of the station to 80MHz. The field corresponding to 160 / 80+80BW can be used to indicate the binding mode of the working bandwidth when the working bandwidth is 160MHz / 80MHz. For example, the field corresponding to 160 / 80+80BW can be set to 0x0. The field corresponding to No LDPC can be used to indicate whether to receive LDPC-encoded data. For example, the field corresponding to No LDPC can be set to 0x0. The field corresponding to the receiving spatial stream can indicate the spatial stream actually supported by the electronic device. For example, when the electronic device supports 2*2 MIMO, the field corresponding to the received spatial stream may be set to 0x2. For example, the field corresponding to the type of the received spatial stream may be set to 0x0.

[0309] In some examples, when the management frame notification is an extended channel switching notification (i.e., ECSA), an electronic device (e.g., a second electronic device) that serves as a target hotspot (i.e., an access point or a group owner) may send an extended channel switching notification to other electronic devices (e.g., a first electronic device) that serve as sites (or group clients) to notify the other electronic devices (e.g., the first electronic device) to adjust the working bandwidth corresponding to the target hotspot to the target working bandwidth indicated by the extended channel switching notification.

[0310] Exemplarily, when an electronic device (such as a second electronic device) that serves as a target hotspot (i.e., an access point or a group owner) can send an extended channel switching notification to other electronic devices (such as a first electronic device) that serve as sites (or group clients), the chip type of the WiFi chip equipped in the other electronic devices (such as the first electronic device) can be obtained. When the chip type of the WiFi chip equipped in the other electronic devices (such as the first electronic device) is the first type, the electronic device (such as the second electronic device) that serves as the target hotspot (i.e., an access point or a group owner) can send an extended channel switching notification to other electronic devices (such as the first electronic device) that serve as sites (or group clients).

[0311] Exemplarily, when an electronic device (such as a second electronic device) that serves as a target hotspot (i.e., an access point or a group owner) can send an extended channel switching notification to other electronic devices (such as a first electronic device) that serve as sites (or group clients), the electronic device (such as the second electronic device) can determine whether the working bandwidth for transmitting data between the electronic device and the other electronic devices is consistent with the target working bandwidth indicated by the extended channel switching notification. If the working bandwidth for transmitting data between the electronic device and the other electronic devices is inconsistent with the target working bandwidth indicated by the extended channel switching notification, the electronic device (such as the second electronic device) that serves as the target hotspot (i.e., an access point or a group owner) can send an extended channel switching notification to other electronic devices (such as the first electronic device) that serve as sites (or group clients).

[0312] That is to say, there are two trigger conditions for an electronic device (such as a second electronic device) that is a target hotspot (i.e., an access point or a group owner) to send an extended channel switching notification to other electronic devices (such as a first electronic device) that are sites (or group clients). Among them, one trigger condition is that the chip type of the WiFi chip carried by other electronic devices that are sites (or group clients) is of the first type; the other trigger condition is that the working bandwidth for transmitting data between the electronic device and other electronic devices is inconsistent with the target working bandwidth indicated by the extended channel switching notification. Below, taking the above two trigger conditions as examples, the process of sending an extended channel switching notification to other electronic devices that are sites to notify other electronic devices to adjust the working bandwidth corresponding to the target hotspot to the target working bandwidth indicated by the extended channel switching notification is schematically explained.

[0313] For example, the first electronic device is the second computer, the second electronic device is the first computer, and the trigger condition of the extended channel switching notification is that the chip type of the WiFi chip carried by the second computer as the station is the first type. Fig.12 As shown, the data transmission method provided in the embodiment of the present application may include: S1001-S1011.

[0314] S1001, the first computer receives a data transmission operation.

[0315] The data transmission operation can be used to trigger the transmission of target data between the first computer and the second computer. The data transmission operation can be input by the user. For example, when the first computer, as an access point or group owner, needs to transmit target data to the second computer, as a site or group client, the first computer can receive the data transmission operation input by the user. The data transmission operation can also be sent by the second computer, as a site or group client. For example, when the second computer, as a site or group client, needs to transmit target data to the first computer, as an access point or group owner, the second computer can receive the data transmission operation input by the user, and in response, the second computer can send the data transmission operation to the first computer.

[0316] S1002. In response to the data transmission operation, the first computer creates a target hotspot.

[0317] The target hotspot can be an access point (i.e., Legacy AP), a group owner (i.e., GO), a virtual access point (i.e., SoftAP), a personal mobile hotspot, or a hotspot (i.e., HotSpot). After the first computer receives the data transmission operation, the first computer can create a target hotspot, i.e., the first computer can serve as an access point to establish a WiFi connection with the second computer.

[0318] In some examples, since the first computer is equipped with a WiFi chip of manufacturer A, in order to avoid the first computer using an adjacent secondary channel and causing interference to other basic service sets, when the first computer creates a target hotspot, the first computer can set a smaller initial working bandwidth for the target hotspot. For example, the initial working bandwidth is 20 MHz.

[0319] S1003. The first computer sends a beacon frame to the second computer, where the beacon frame includes an initial working bandwidth corresponding to the target hotspot.

[0320] After the first computer creates the target hotspot, the first computer as the target hotspot (i.e., the first computer providing the WiFi hotspot function) can send a beacon frame to the second computer, i.e., the first computer periodically broadcasts the beacon frame so that the second computer can establish a WiFi connection with the first computer. The beacon frame may include an initial working bandwidth, and the initial working bandwidth may be the working bandwidth corresponding to the target hotspot set when the first computer creates the target hotspot. For example, the initial working bandwidth is 20MHz.

[0321] S1004. The second computer receives the beacon frame sent by the first computer.

[0322] After the first computer sends a beacon frame to the second computer, the second computer receives the beacon frame sent by the first computer, that is, the second computer scans the target hotspot created by the first computer, and then the second computer can access the target hotspot created by the first computer.

[0323] S1005. The second computer sends a probe request frame to the first computer, where the probe request frame includes the chip type of the WiFi chip configured in the second computer.

[0324] Due to certain differences in the design and architecture of the WiFi chip of manufacturer A and the WiFi chip of manufacturer B, when the second computer equipped with the WiFi chip of manufacturer B establishes a WiFi connection with the first computer equipped with the WiFi chip of manufacturer A and transmits data through the WiFi connection, it can only use the smaller bandwidth initially claimed by the first computer to transmit data, and cannot use the larger bandwidth negotiated by the first and second computers to transmit data. Therefore, after the second computer receives the beacon frame sent by the first computer, the second computer can send a probe request frame carrying the chip type of the WiFi chip configured by the second computer to the first computer, so that the first computer can obtain the chip type of the WiFi chip configured by the second computer. Furthermore, the first computer can determine whether the chip type of the WiFi chip configured by the second computer is the first type, and if the chip type of the WiFi chip configured by the second computer is the first type, the first computer can send an extended channel switching notification to the second computer to notify the second computer to reset the working bandwidth corresponding to the target hotspot.

[0325] S1006. The first computer receives the probe request frame sent by the second computer, and sends a probe response frame to the second computer.

[0326] S1007. When the chip type of the WiFi chip configured in the second computer is the first type, the first computer sends an extended channel switching notification to the second computer, where the extended channel switching notification is used to instruct the second computer to adjust the working bandwidth corresponding to the second computer as a site to the target working bandwidth.

[0327] The chip type of the WiFi chip may refer to the manufacturer of the WiFi chip. The first type may be used to indicate the WiFi chip of the target manufacturer (i.e., the WiFi chip of manufacturer B). That is, when the first computer determines that the WiFi chip configured in the second computer is the WiFi chip of the target manufacturer, the first computer sends an extended channel switching notification to the second computer to notify the second computer to adjust the working bandwidth corresponding to the second computer as a site to the target working bandwidth.

[0328] S1008. The second computer sets the working bandwidth of the second computer as a site as the target working bandwidth.

[0329] When the second computer receives the extended channel switching notification sent by the first computer, the second computer can set the working bandwidth corresponding to the target hotspot as the target working bandwidth, that is, when the second computer acts as a site (or group client), the second computer sets the working bandwidth corresponding to the WiFi connection established between the second computer and the first computer to the target working bandwidth, that is, the second computer sets the working bandwidth of the second computer as a site to the target working bandwidth.

[0330] S1009. The first computer sets the working bandwidth corresponding to the target hotspot as the target working bandwidth.

[0331] After the first computer sends an extended channel switching notification to the second computer, the first computer can set the working bandwidth corresponding to the target hotspot as the target working bandwidth, that is, when the first computer is used as the target hotspot (such as an access point, group owner, personal mobile hotspot, virtual access point), the first computer sets the working bandwidth corresponding to the WiFi connection established between the second computer and the first computer to the target working bandwidth, that is, the first computer sets the working bandwidth of the first computer as the target hotspot to the target working bandwidth.

[0332] It should be noted that S1009 may be executed simultaneously with S1008, and S1009 may be executed after S1008. The execution order of S1009 and S1008 is not specifically limited in the embodiment of the present application.

[0333] S1010. The second computer accesses the target hotspot created by the first computer.

[0334] After the second computer sets the working bandwidth of the second computer as a site as the target working bandwidth, and the first computer sets the working bandwidth corresponding to the target hotspot as the target working bandwidth, the second computer can access the target hotspot created by the first computer, that is, the second computer establishes a WiFi connection with the first computer.

[0335] Exemplarily, the process of establishing a WiFi connection between the second computer and the first computer may include: the second computer may send an authentication request frame to the first computer, and when the first computer receives the authentication request frame sent by the second computer, the first computer may send an authentication response frame to the second computer for the authentication request frame, i.e., completing the authentication phase. After the second computer receives the authentication response frame sent by the first computer, the second computer may send an association request frame carrying the target working bandwidth (such as 80MHz or 160MHz) to the first computer to request access to the target hotspot created by the first computer. When the first computer receives the association request frame carrying the target working bandwidth sent by the second computer, the first computer may send an association response frame to the second computer for the association request frame, and the association response frame may include the expanded working bandwidth (i.e., the target working bandwidth), i.e., completing the association phase. Afterwards, the first computer and the second computer perform a four-way handshake, i.e., the second computer and the first computer establish a WiFi connection.

[0336] It should be noted that the specific implementation method of establishing a WiFi connection between the second computer and the first computer in the embodiment of the present application can refer to S503-S510, which will not be repeated in the embodiment of the present application.

[0337] S1011. The first computer and the second computer transmit target data using a target working bandwidth.

[0338] Since the first computer and the second computer both set the working bandwidth corresponding to the target hotspot as the target working bandwidth, the target data can be transmitted between the first computer and the second computer using the target working bandwidth.

[0339] In some examples, the target data transmission between the first computer and the second computer using the target working bandwidth may include: when the first computer transmits the target data to the second computer (i.e., the data transmission operation is a data transmission operation input by the user for the target data of the first computer), the first computer may use the target working bandwidth to transmit the target data (such as a file) to the second computer.

[0340] In some examples, the target data transmission between the first computer and the second computer using the target working bandwidth may include: when the second computer transmits the target data to the first computer (i.e., the data transmission operation is a data transmission operation input by the user for the target data of the second computer), the second computer may use the target working bandwidth to transmit the target data (such as a file) to the first computer.

[0341] In the embodiment of the present application, when the first computer and the second computer transmit target data, the first computer can obtain the chip type of the WiFi chip equipped in the second computer. When the chip type of the WiFi chip equipped in the second computer is the first type, the first computer can send an extended channel switching notification to the second computer, so that the second computer adjusts its working bandwidth as a site to the target working bandwidth indicated by the extended channel switching notification, and then the second computer and the first computer can use a larger target working bandwidth to transmit data, which can improve the data transmission rate, shorten the data transmission time, and enhance the user experience.

[0342] For example, the first electronic device is the second computer, the second electronic device is the first computer, and the triggering condition of the extended channel switching notification is that the working bandwidth for transmitting data between the first computer and the second computer is inconsistent with the target working bandwidth indicated by the extended channel switching notification. Fig.13 As shown, the data transmission method provided in the embodiment of the present application may include: S1101-S1112.

[0343] S1101, the first computer receives a data transmission operation.

[0344] The data transmission operation can be used to trigger the transmission of target data between the first computer and the second computer. The data transmission operation can be input by the user. For example, when the first computer, as an access point or group owner, needs to transmit target data to the second computer, as a site or group client, the first computer can receive the data transmission operation input by the user. The data transmission operation can also be sent by the second computer, as a site or group client. For example, when the second computer, as a site or group client, needs to transmit target data to the first computer, as an access point or group owner, the second computer can receive the data transmission operation input by the user, and in response, the second computer can send the data transmission operation to the first computer.

[0345] S1102. In response to the data transmission operation, the first computer creates a target hotspot.

[0346] The target hotspot can be an access point (i.e., Legacy AP), a group owner (i.e., GO), a virtual access point (i.e., SoftAP), a personal mobile hotspot, or a hotspot (i.e., HotSpot). After the first computer receives the data transmission operation, the first computer can create a target hotspot, i.e., the first computer can serve as an access point to establish a WiFi connection with the second computer.

[0347] In some examples, since the first computer is equipped with a WiFi chip of manufacturer A, in order to avoid the first computer using an adjacent secondary channel and causing interference to other basic service sets, when the first computer creates a target hotspot, the first computer can set a smaller initial working bandwidth for the target hotspot. For example, the initial working bandwidth is 20 MHz.

[0348] S1103. The first computer sends a beacon frame to the second computer, where the beacon frame includes an initial working bandwidth corresponding to the target hotspot.

[0349] After the first computer creates the target hotspot, the first computer as the target hotspot (i.e., the first computer providing the WiFi hotspot function) can send a beacon frame to the second computer, i.e., the first computer periodically broadcasts the beacon frame so that the second computer can establish a WiFi connection with the first computer. The beacon frame may include an initial working bandwidth, and the initial working bandwidth may be the working bandwidth corresponding to the target hotspot set when the first computer creates the target hotspot. For example, the initial working bandwidth is 20MHz.

[0350] S1104. The second computer receives the beacon frame sent by the first computer.

[0351] After the first computer sends a beacon frame to the second computer, the second computer receives the beacon frame sent by the first computer, that is, the second computer scans the target hotspot created by the first computer, and then the second computer can access the target hotspot created by the first computer.

[0352] S1105. The second computer accesses the target hotspot created by the first computer.

[0353] After the second computer receives the beacon frame sent by the first computer, the second computer can access the target hotspot created by the first computer, that is, the second computer establishes a WiFi connection with the first computer.

[0354] Exemplarily, the process of establishing a WiFi connection between the second computer and the first computer may include: after the second computer receives a beacon frame carrying the initial working bandwidth sent by the first computer, the second computer may send an authentication request frame to the first computer, and when the first computer receives the authentication request frame sent by the second computer, the first computer may send an authentication response frame to the second computer for the authentication request frame, thus completing the authentication phase. After the second computer receives the authentication response frame sent by the first computer, the second computer may send an association request frame carrying the target working bandwidth (such as 80MHz or 160MHz) to the first computer, requesting access to the target hotspot created by the first computer, and notifying the first computer that the working bandwidth of the target hotspot needs to be expanded to the target working bandwidth. When the first computer receives an association request frame carrying the target working bandwidth sent by the second computer, the first computer can expand the working bandwidth corresponding to the target hotspot from the initial working bandwidth (such as 20MHz) to the target working bandwidth (such as 80MHz or 160MHz), and send an association response frame to the association request frame to the second computer. The association response frame may include the expanded working bandwidth (i.e., the target working bandwidth), and the association phase is completed. That is, in the association phase, the second computer and the first computer negotiate the working bandwidth corresponding to the target hotspot to the target working bandwidth (such as 80MHz or 160MHz). Afterwards, the first computer and the second computer perform a four-way handshake, that is, the second computer and the first computer establish a WiFi connection.

[0355] It should be noted that the specific implementation method of establishing a WiFi connection between the second computer and the first computer in the embodiment of the present application can refer to the above S503-S510, which will not be repeated in the embodiment of the present application.

[0356] S1106: Data is transmitted between the first computer and the second computer.

[0357] Because the WiFi chip configured in the first computer and the WiFi chip configured in the second computer are from different manufacturers, there are certain differences in the design and architecture of the WiFi chip configured in the first computer and the WiFi chip configured in the second computer. Therefore, when the second computer equipped with the WiFi chip of manufacturer B performs data transmission with the first computer equipped with the WiFi chip of manufacturer A, only the smaller initial working bandwidth (such as 20MHz) initially claimed by the first computer equipped with the WiFi chip of manufacturer A can be used to transmit data, that is, the initial working bandwidth is used to transmit data between the first computer and the second computer.

[0358] In some examples, when data is transmitted between the first computer and the second computer, data frames may be used for data transmission, that is, one data frame is transmitted at a time.

[0359] S1107: The first computer determines whether the working bandwidth corresponding to the target hotspot is the target working bandwidth.

[0360] After the initial working bandwidth is used to transmit data between the first computer and the second computer, the first computer can determine whether the working bandwidth corresponding to the target hotspot is the target working bandwidth, that is, the first computer can determine whether the target working bandwidth is used to transmit data between the first computer and the second computer. If the first computer determines that the working bandwidth corresponding to the target hotspot is not the target working bandwidth, the first computer can send an extended channel switching notification to the second computer.

[0361] In some examples, the first computer determines that the working bandwidth corresponding to the target hotspot is the target working bandwidth, and executes S1112, that is, data transmission continues between the first computer and the second computer.

[0362] S1108. The first computer sends an extended channel switching notification to the second computer, where the extended channel switching notification is used to instruct the second computer to adjust the working bandwidth corresponding to the second computer as a site to the target working bandwidth.

[0363] When the first computer determines that the working bandwidth corresponding to the target hotspot is not the target working bandwidth (the initial working bandwidth is used to transmit data between the first computer and the second computer), the first computer can send an extended channel switching notification to the second computer to notify the second computer to adjust the working bandwidth corresponding to the second computer as a site to the target working bandwidth.

[0364] S1109. The second computer adjusts the working bandwidth corresponding to the second computer as a site to the target working bandwidth.

[0365] When the second computer receives the extended channel switching notification sent by the first computer, the second computer can set the working bandwidth corresponding to the target hotspot as the target working bandwidth, that is, when the second computer acts as a site (or group client), the second computer sets the working bandwidth corresponding to the WiFi connection established between the second computer and the first computer to the target working bandwidth, that is, the second computer sets the working bandwidth of the second computer as a site to the target working bandwidth.

[0366] S1110. The first computer sets the working bandwidth corresponding to the target hotspot as the target working bandwidth.

[0367] After the first computer sends an extended channel switching notification to the second computer, the first computer can set the working bandwidth corresponding to the target hotspot as the target working bandwidth, that is, when the first computer is used as the target hotspot (such as an access point, group owner, personal mobile hotspot, virtual access point), the first computer sets the working bandwidth corresponding to the WiFi connection established between the second computer and the first computer to the target working bandwidth, that is, the first computer sets the working bandwidth of the first computer as the target hotspot to the target working bandwidth.

[0368] It should be noted that S1110 may also be executed simultaneously with S1109, and S1110 may also be executed after S1109. The execution order of S1110 and S1109 is not specifically limited in the embodiments of the present application.

[0369] S1111. The first computer and the second computer transmit target data using a target working bandwidth.

[0370] Since the first computer and the second computer both set the working bandwidth corresponding to the target hotspot as the target working bandwidth, the target data can be transmitted between the first computer and the second computer using the target working bandwidth.

[0371] In some examples, since data transmission between the first computer and the second computer can be performed in the form of data frames, that is, one data frame is transmitted at a time, the target working bandwidth is used to transmit the target data between the first computer and the second computer, which may include: for the first computer and the second computer, the working bandwidth corresponding to the target hotspot is set to the target working bandwidth, and the target data is transmitted using the target working bandwidth.

[0372] In some examples, the target data transmission between the first computer and the second computer using the target working bandwidth may include: when the first computer transmits the target data to the second computer (i.e., the data transmission operation is a data transmission operation input by the user for the first computer), the first computer may use the target working bandwidth to transmit the target data (such as a file) to the second computer.

[0373] In some examples, the target data transmission between the first computer and the second computer using the target working bandwidth may include: when the second computer transmits the target data to the first computer (i.e., the data transmission operation is a data transmission operation input by the user for the second computer), the second computer may use the target working bandwidth to transmit the target data (such as a file) to the first computer.

[0374] In an embodiment of the present application, when a first computer and a second computer transmit target data, the first computer determines whether the working bandwidth corresponding to the target hotspot is consistent with the target working bandwidth. When it is determined that the working bandwidth corresponding to the target hotspot is inconsistent with the target working bandwidth, the first computer can send an extended channel switching notification to the second computer, so that the second computer adjusts its working bandwidth as a site to the target working bandwidth indicated by the extended channel switching notification. As a result, a larger target working bandwidth can be used to transmit data between the second computer and the first computer, which can improve the data transmission rate, shorten the data transmission time, and enhance the user experience.

[0375] In some examples, when the management frame notification is a working mode notification (i.e., OMN), the first electronic device may send a working mode notification to the second electronic device to notify the second electronic device to adjust the working bandwidth corresponding to the target hotspot to the target working bandwidth indicated by the extended channel switching notification. The first electronic device may be an electronic device serving as a target hotspot (i.e., an access point or a group owner), or an electronic device serving as a site (or a group client).

[0376] In addition, there are two triggering conditions for the first electronic device to send a working mode notification to the second electronic device. One of the triggering conditions is that the chip type of the WiFi chip carried by the electronic device that serves as a station in the first electronic device and the second electronic device is the first type; the other triggering condition is that the working bandwidth of the data transmitted by the first electronic device and the second electronic device is inconsistent with the target working bandwidth indicated by the extended channel switching notification.

[0377] For example, the first electronic device is the second computer, the second electronic device is the first computer, the second computer sends a working mode notification to the first computer, and the triggering condition of the working mode notification is that the working bandwidth of the first computer and the second computer for transmitting data is inconsistent with the target working bandwidth indicated by the extended channel switching notification. Fig.14 As shown, the data transmission method provided in the embodiment of the present application may include: S1201-S1212.

[0378] S1201, the first computer receives a data transmission operation.

[0379] The data transmission operation can be used to trigger the transmission of target data between the first computer and the second computer. The data transmission operation can be input by the user. For example, when the first computer, as an access point or group owner, needs to transmit target data to the second computer, as a site or group client, the first computer can receive the data transmission operation input by the user. The data transmission operation can also be sent by the second computer, as a site or group client. For example, when the second computer, as a site or group client, needs to transmit target data to the first computer, as an access point or group owner, the second computer can receive the data transmission operation input by the user, and in response, the second computer can send the data transmission operation to the first computer.

[0380] S1202: In response to the data transmission operation, the first computer creates a target hotspot.

[0381] The target hotspot can be an access point (i.e., Legacy AP), a group owner (i.e., GO), a virtual access point (i.e., SoftAP), a personal mobile hotspot, or a hotspot (i.e., HotSpot). After the first computer receives the data transmission operation, the first computer can create a target hotspot, i.e., the first computer can serve as an access point to establish a WiFi connection with the second computer.

[0382] In some examples, since the first computer is equipped with a WiFi chip of manufacturer A, in order to avoid the first computer using an adjacent secondary channel and causing interference to other basic service sets, when the first computer creates a target hotspot, the first computer can set a smaller initial working bandwidth for the target hotspot. For example, the initial working bandwidth is 20 MHz.

[0383] S1203. The first computer sends a beacon frame to the second computer, where the beacon frame includes an initial working bandwidth corresponding to the target hotspot.

[0384] After the first computer creates the target hotspot, the first computer as the target hotspot (i.e., the first computer providing the WiFi hotspot function) can send a beacon frame to the second computer, i.e., the first computer periodically broadcasts the beacon frame so that the second computer can establish a WiFi connection with the first computer. The beacon frame may include an initial working bandwidth, and the initial working bandwidth may be the working bandwidth corresponding to the target hotspot set when the first computer creates the target hotspot. For example, the initial working bandwidth is 20MHz.

[0385] S1204: The second computer receives the beacon frame sent by the first computer.

[0386] After the first computer sends a beacon frame to the second computer, the second computer receives the beacon frame sent by the first computer, that is, the second computer scans the target hotspot created by the first computer, and then the second computer can access the target hotspot created by the first computer.

[0387] S1205. The second computer accesses the target hotspot created by the first computer.

[0388] After the second computer receives the beacon frame sent by the first computer, the second computer can access the target hotspot created by the first computer, that is, the second computer establishes a WiFi connection with the first computer.

[0389] It should be noted that the specific implementation method of establishing a WiFi connection between the second computer and the first computer in the embodiment of the present application can refer to the above S1105 or the above S503-S510, which will not be repeated in the embodiment of the present application.

[0390] S1206: Data is transmitted between the first computer and the second computer.

[0391] Because the WiFi chips configured in the first computer and the second computer are from different manufacturers, there are certain differences in the design and architecture of the WiFi chip configured in the first computer and the WiFi chip configured in the second computer. Therefore, when the second computer equipped with the WiFi chip of manufacturer B performs data transmission with the first computer equipped with the WiFi chip of manufacturer A, only the smaller initial working bandwidth (such as 20MHz) initially claimed by the first computer equipped with the WiFi chip of manufacturer A can be used to transmit data, that is, the initial working bandwidth is used to transmit data between the first computer and the second computer.

[0392] In some examples, when data is transmitted between the first computer and the second computer, data frames may be used for data transmission, that is, one data frame is transmitted at a time.

[0393] S1207: The second computer determines whether the working bandwidth corresponding to the target hotspot is the target working bandwidth.

[0394] After the first computer and the second computer use the initial working bandwidth to transmit data, the second computer can determine whether the working bandwidth corresponding to the target hotspot is the target working bandwidth, that is, the second computer can determine whether the target working bandwidth is used to transmit data between the first computer and the second computer. If the second computer determines that the working bandwidth corresponding to the target hotspot is not the target working bandwidth, the second computer can send a working mode notification to the first computer.

[0395] In some examples, when the second computer determines that the working bandwidth corresponding to the target hotspot is the target working bandwidth, S1212 is executed, that is, data transmission continues between the first computer and the second computer.

[0396] S1208. The second computer sends a working mode notification to the first computer, where the working mode notification is used to instruct the first computer to expand the working bandwidth corresponding to the target hotspot to the target working bandwidth.

[0397] When the second computer determines that the working bandwidth corresponding to the target hotspot is not the target working bandwidth (the first computer and the second computer use the initial working bandwidth to transmit data), the second computer can send a working mode notification to the first computer to notify the first computer to set the working bandwidth corresponding to the target hotspot to the target working bandwidth.

[0398] S1209: The first computer sets the working bandwidth corresponding to the target hotspot as the target working bandwidth.

[0399] When the first computer receives the working mode notification sent by the second computer, the first computer can set the working bandwidth corresponding to the target hotspot as the target working bandwidth, that is, when the first computer acts as the target hotspot (such as an access point, group owner, personal mobile hotspot, virtual access point), the first computer sets the working bandwidth corresponding to the WiFi connection established between the second computer and the first computer to the target working bandwidth, that is, the first computer sets the working bandwidth of the first computer as the target hotspot to the target working bandwidth.

[0400] S1210. The second computer adjusts the working bandwidth corresponding to the second computer as a site to the target working bandwidth.

[0401] After the second computer sends a working mode notification to the first computer, the second computer can set the working bandwidth corresponding to the target hotspot as the target working bandwidth, that is, when the second computer acts as a site (or group client), the second computer sets the working bandwidth corresponding to the WiFi connection established between the second computer and the first computer to the target working bandwidth, that is, the second computer sets the working bandwidth of the second computer as a site to the target working bandwidth.

[0402] It should be noted that S1210 may be executed simultaneously with S1209, and S1210 may be executed after S1209. The execution order of S1210 and S1209 is not specifically limited in the embodiments of the present application.

[0403] S1211. The first computer and the second computer transmit target data using a target working bandwidth.

[0404] Since the first computer and the second computer both set the working bandwidth corresponding to the target hotspot as the target working bandwidth, the target data can be transmitted between the first computer and the second computer using the target working bandwidth.

[0405] In some examples, since data transmission between the first computer and the second computer can be performed in the form of data frames, that is, one data frame is transmitted at a time, the target working bandwidth is used to transmit the target data between the first computer and the second computer, which may include: for the first computer and the second computer, the working bandwidth corresponding to the target hotspot is set to the target working bandwidth, and the target data is transmitted using the target working bandwidth.

[0406] In some examples, the target data transmission between the first computer and the second computer using the target working bandwidth may include: when the first computer transmits the target data to the second computer (i.e., the data transmission operation is a data transmission operation input by the user for the first computer), the first computer may use the target working bandwidth to transmit the target data (such as a file) to the second computer.

[0407] In some examples, the target data transmission between the first computer and the second computer using the target working bandwidth may include: when the second computer transmits the target data to the first computer (i.e., the data transmission operation is a data transmission operation input by the user for the second computer), the second computer may use the target working bandwidth to transmit the target data (such as a file) to the first computer.

[0408] In an embodiment of the present application, when a first computer and a second computer transmit target data, the second computer determines whether the working bandwidth corresponding to the target hotspot is consistent with the target working bandwidth. When it is determined that the working bandwidth corresponding to the target hotspot is inconsistent with the target working bandwidth, the second computer can send a working mode notification to the first computer, so that the first computer adjusts the working bandwidth corresponding to the target hotspot to the target working bandwidth indicated by the working mode notification. As a result, a larger target working bandwidth can be used to transmit data between the second computer and the first computer, which can improve the data transmission rate, shorten the data transmission time, and enhance the user experience.

[0409] To facilitate understanding, the data transmission method provided in the embodiment of the present application is described below with reference to the accompanying drawings.

[0410] The following is combined with Fig.15 The data transmission method provided in the embodiment of the present application is described. The data transmission method is applied to a first electronic device. Fig.15 As shown, the data transmission method may include the following S1301-S1304.

[0411] S1301. In response to a first operation, a first electronic device obtains first information; wherein the first operation is used to trigger the first electronic device to send first data to be transmitted to a second electronic device, or to trigger the second electronic device to send first data to the first electronic device.

[0412] In some examples, the first operation can be used to trigger the first electronic device to send the first data to be transmitted to the second electronic device, that is, when the first electronic device receives the first operation input by the user for the first electronic device, in response to the first operation, the first electronic device obtains the first information. In some examples, the first operation can be used to trigger the second electronic device to send the first data to be transmitted to the first electronic device, that is, when the second electronic device receives the first operation input by the user for the second electronic device, the second electronic device can send the instruction corresponding to the first operation to the first electronic device, and as a response to the instruction corresponding to the first operation, the first electronic device obtains the first information.

[0413] Exemplarily, the first operation can be used to trigger the first electronic device and the second electronic device to perform a device cloning operation, can also be used to trigger the first electronic device and the second electronic device to perform a data migration operation, and can also be used to trigger the first electronic device and the second electronic device to perform a file sharing operation.

[0414] Specifically, in the embodiment of the present application, the first operation may be the data transmission operation in S1001, S1101, or S1201. In the embodiment of the present application, the first data may be the target data in S1011, S1111, or S1211.

[0415] The above-mentioned first electronic device can determine whether to send the first notification to the second electronic device based on the first information. In some examples, the first information may include the chip type of the WiFi chip configured for the electronic device as the third role, wherein the third role is a site or group client. For example, when the first electronic device acts as a site or group client (that is, the first role is the third role), the first information may include the chip type of the WiFi chip configured for the first electronic device. For another example, when the second electronic device acts as a site or group client (that is, the second role is the third role), the first information may include the chip type of the WiFi chip configured for the second electronic device.

[0416] In some examples, the first information may also include a second operating bandwidth for transmitting data between the first electronic device and the second electronic device.

[0417] The first electronic device can be used as a first role, and the second electronic device can be used as a second role. The second role is a role that is in a relative relationship with the first role.

[0418] In some examples, the first role is one of access point, group owner, personal mobile hotspot, virtual access point, and hotspot, and the second role is one of site or group client. That is, the first electronic device can be used to create an access point, group owner, personal mobile hotspot, virtual access point, or hotspot, and the second electronic device can be used as a site or group client to access the access point, group owner, personal mobile hotspot, virtual access point, or hotspot created by the first electronic device.

[0419] In some examples, the first role is a role in a site or group client, and the second role is a role in an access point, a group owner, a personal mobile hotspot, a virtual access point, or a hotspot. That is, the second electronic device can be used to create an access point, a group owner, a personal mobile hotspot, a virtual access point, or a hotspot, and the first electronic device can be used as a site or group client to access the access point, group owner, personal mobile hotspot, virtual access point, or hotspot created by the second electronic device.

[0420] Specifically, in the embodiment of the present application, the first role may be the target hotspot in the above-mentioned S1002, or the above-mentioned S1102, or the above-mentioned S1202.

[0421] In some examples, when the first role is one of an access point, a group owner, a personal mobile hotspot, a virtual access point, and a hotspot, and the first information may be a chip type of a WiFi chip configured for an electronic device as a third role, in response to a first operation, the first electronic device obtains the first information, which may include: in response to the first operation, the first electronic device creates the first role; the first electronic device receives a probe request frame sent by the second electronic device including the chip type of the WiFi chip configured for the second electronic device.

[0422] In some examples, when the first role is one of an access point, a group owner, a personal mobile hotspot, a virtual access point, and a hotspot, and the first information may be a second working bandwidth for transmitting data between a first electronic device and a second electronic device, in response to a first operation, the first electronic device obtains the first information, which may include: in response to the first operation, the first electronic device creates the first role; the first electronic device establishes a WiFi connection with the second electronic device; data is transmitted between the first electronic device and the second electronic device; the first electronic device obtains the second working bandwidth for transmitting data between the first electronic device and the second electronic device.

[0423] In some examples, when the first role is a site or group client and the first information may be a second working bandwidth for transmitting data between the first electronic device and the second electronic device, in response to the first operation, the first electronic device obtains the first information, which may include: in response to the first operation, the first electronic device creates the first role; the first electronic device establishes a WiFi connection with the second electronic device; data is transmitted between the first electronic device and the second electronic device; the second electronic device obtains the second working bandwidth for transmitting data between the first electronic device and the second electronic device.

[0424] Specifically, the specific implementation method for the first electronic device to obtain the first information in the embodiment of the present application can refer to the above S1002-S1006, or the above S1102-S1107, the target hotspot in the above S1202-S1207, and will not be repeated in the embodiment of the present application.

[0425] S1302: When the first information satisfies a preset condition, the first electronic device sends a first notification to the second electronic device in the first role, so that the second electronic device adjusts the working bandwidth of the second electronic device as the second role to the first working bandwidth indicated by the first notification, and the second role is a role in a relative relationship with the first role.

[0426] In some examples, the first notification is used to instruct the second electronic device to adjust the working bandwidth corresponding to the second electronic device as the second role to the first working bandwidth. The above-mentioned first notification includes an extended channel switching notification and a working mode notification. Specifically, the above-mentioned first notification is a management frame notification in the above-mentioned embodiment. The above-mentioned first working bandwidth can be the above-mentioned S1007, or the above-mentioned S1108, and the target working bandwidth in the above-mentioned S1208.

[0427] In some examples, the first information satisfies the preset condition, which may include: the chip type of the WiFi chip configured in the electronic device as the third role is a preset type. The chip type of the WiFi chip may refer to the manufacturer of the WiFi chip. The preset type may be used to indicate the WiFi chip of the target manufacturer (i.e., the WiFi chip of manufacturer B). Specifically, the preset type may be the first type in S1007, S1108, or S1208.

[0428] In some examples, the first information satisfies a preset condition, which may include: the second working bandwidth is inconsistent with the first working bandwidth.

[0429] In some examples, when the first role is one of an access point, a group owner, a personal mobile hotspot, a virtual access point, and a hotspot, and the second role is one of a site or a group client, the first electronic device sends a first notification to the second electronic device in the first role, which may include: the first electronic device sends an extended channel switching notification or an operating mode notification to the second electronic device in the first role.

[0430] In some examples, when the first role is a role in a site or group client, and the second role is a role in an access point, a group owner, a personal mobile hotspot, a virtual access point, or a hotspot, the first electronic device sends a first notification to the second electronic device in the first role, which may include: the first electronic device sends a working mode notification to the second electronic device in the first role.

[0431] Specifically, the specific implementation method of the first electronic device sending the first notification to the second electronic device in the embodiment of the present application as the first role can refer to the above S1007, or refer to the above S1108, or refer to the target hotspot in the above S1208, which will not be repeated in the embodiment of the present application.

[0432] In some examples, the first information satisfies the preset condition that the second working bandwidth is inconsistent with the first working bandwidth. Before the first electronic device obtains the first information in response to the first operation, the above-mentioned data transmission method may also include: the first electronic device transmits the first data to the second electronic device based on the first WiFi connection using the second working bandwidth, and the second working bandwidth is less than the first working bandwidth; the first electronic device transmits the first data to the second electronic device based on the first WiFi connection using the first working bandwidth, which may include: the first electronic device transmits the second data to the second electronic device based on the first WiFi connection using the first working bandwidth, wherein the second data is the remaining data in the first data except the data transmitted by the second electronic device to the second electronic device using the second working bandwidth.

[0433] Specifically, in the embodiment of the present application, the first electronic device transmits the first data to the second electronic device based on the first WiFi connection using the second working bandwidth, and the specific implementation method of the second working bandwidth being smaller than the first working bandwidth can refer to the above S1103-S1106, or refer to the above S1203-S1206, which will not be repeated in the embodiment of the present application.

[0434] S1303: The first electronic device adjusts the working bandwidth corresponding to the first role of the first electronic device to the first working bandwidth.

[0435] After the first electronic device sends the first notification to the second electronic device, the first electronic device adjusts the working bandwidth corresponding to the first role of the first electronic device to the first working bandwidth, that is, the first electronic device sets the working bandwidth corresponding to the WiFi connection established between the second electronic device and the first electronic device to the first working bandwidth.

[0436] Specifically, in the embodiment of the present application, the specific implementation method in which the first electronic device adjusts the working bandwidth corresponding to the first electronic device as the first role to the first working bandwidth can refer to the above S1009, or refer to the above S1109, or refer to the above S1209 for a specific implementation method, which will not be repeated in the embodiment of the present application.

[0437] S1304: The first electronic device transmits first data to the second electronic device based on the first WiFi connection using the first working bandwidth, wherein the first WiFi connection is a WiFi connection established between the first electronic device as a first role and the second electronic device as a second role.

[0438] Since the first electronic device adjusts the working bandwidth corresponding to the first role of the first electronic device to the first working bandwidth, and the working bandwidth of the second electronic device as the second role is adjusted to the first working bandwidth indicated by the first notification, the first data can be transmitted between the first electronic device and the second electronic device using the first working bandwidth.

[0439] In some examples, a first electronic device transmits first data to a second electronic device based on a first WiFi connection using a first working bandwidth, which may include: when the first electronic device transmits the first data to the second electronic device, the first electronic device may transmit the first data (such as a file) to the second electronic device using the first working bandwidth.

[0440] In some examples, a first electronic device transmits first data to a second electronic device based on a first WiFi connection using a first working bandwidth, which may include: when the second electronic device transmits the first data to the first electronic device, the second electronic device may transmit the first data (such as a file) to the first electronic device using the first working bandwidth.

[0441] Specifically, in the embodiment of the present application, the specific implementation method in which the first electronic device adjusts the working bandwidth corresponding to the first electronic device as the first role to the first working bandwidth can refer to the above S1009, or refer to the above S1109, or refer to the above S1209 for a specific implementation method, which will not be repeated in the embodiment of the present application.

[0442] In an embodiment of the present application, when a first electronic device transmits data with a second electronic device, the first electronic device can obtain first information. When the first information satisfies a preset condition, the first electronic device can send a first notification to the second electronic device so that the second electronic device adjusts its working bandwidth as the second role to the first working bandwidth indicated by the first notification. In addition, the first electronic device can also adjust its working bandwidth as the first role to the first working bandwidth. As a result, the second electronic device and the first electronic device can use a larger first working bandwidth to transmit data, which can improve the data transmission rate, shorten the data transmission time, and enhance the user experience.

[0443] The following is combined with Fig.16 The data transmission method provided in the embodiment of the present application is described. The data transmission method is applied to a first electronic device. Fig.16 As shown, the data transmission method may include the following S1401-S1404.

[0444] S1401: When a first electronic device transmits first data to a second electronic device, the first electronic device, as a third role, establishes a first WiFi connection with a second electronic device, as a fourth role, and a working bandwidth corresponding to the first WiFi connection is a second working bandwidth.

[0445] The first data is data to be transmitted sent by the first electronic device to the second electronic device, or the first data is data to be transmitted sent by the second electronic device to the first electronic device. Specifically, the first data may be the target data in the above S901.

[0446] In some examples, the third role is a role in a site or group client, and the fourth role is a role in an access point, a group owner, a personal mobile hotspot, a virtual access point, or a hotspot. That is, the second electronic device can be used to create an access point, a group owner, a personal mobile hotspot, a virtual access point, or a hotspot, and the first electronic device can be used as a site or group client to access the access point, group owner, personal mobile hotspot, virtual access point, or hotspot created by the first electronic device.

[0447] In some examples, the first electronic device, as the third role, establishes a first WiFi connection with the second electronic device, as the fourth role, which may include: when the first electronic device receives a first beacon frame sent by the second electronic device, the first electronic device, as the third role, establishes a first WiFi connection with the second electronic device, as the fourth role. When the second electronic device receives the first operation, the second electronic device creates the third role and sends the first beacon frame to the first electronic device.

[0448] The first operation is used to trigger the first electronic device to send first data to be transmitted to the second electronic device, or to trigger the second electronic device to send first data to the first electronic device.

[0449] The first beacon frame may include a second working bandwidth. The second working bandwidth may be a working bandwidth set for the third role when the second electronic device creates the third role. For example, the second working bandwidth is 20 MHz. Specifically, the second working bandwidth may be the initial working bandwidth in the above S903.

[0450] Specifically, in the embodiment of the present application, the first electronic device acts as the third role and establishes a first WiFi connection with the second electronic device acts as the fourth role. The working bandwidth corresponding to the first WiFi connection is the specific implementation method of the second working bandwidth. Please refer to the specific implementation method of S901-S904 above, which will not be repeated in the embodiment of the present application.

[0451] S1402. When the second working bandwidth is inconsistent with the first working bandwidth, the first electronic device sends a second notification to the second electronic device, where the second notification is used to indicate that the first electronic device will disconnect from the second electronic device and re-establish a WiFi connection; wherein the first working bandwidth is the working bandwidth obtained by negotiation between the first electronic device and the second electronic device, and the first working bandwidth is greater than the second working bandwidth.

[0452] In some examples, the first electronic device sending the second notification to the second electronic device may include: the first electronic device obtaining the data volume corresponding to the first data; if the data volume corresponding to the first data is greater than or equal to the first data volume, the first electronic device sending the second notification to the second electronic device.

[0453] Specifically, the second notification may be the reconnection notification in S906. The first working bandwidth may be the target working bandwidth in S904.

[0454] Specifically, the specific implementation method of the first electronic device sending the second notification to the second electronic device in the embodiment of the present application can refer to the specific implementation method of S905 and S906 mentioned above, which will not be repeated in the embodiment of the present application.

[0455] S1403: The first electronic device, as the third role, establishes a second WiFi connection with the second electronic device, as the fourth role, and the working bandwidth corresponding to the second WiFi connection is the first working bandwidth.

[0456] In some examples, the first electronic device, as a third role, establishes a second WiFi connection with the second electronic device, as a fourth role, which may include: the first electronic device sends a first request to the second electronic device; when the first electronic device receives a first response to the first request sent by the second electronic device, the first electronic device, as the third role, establishes a second WiFi connection with the second electronic device, as the fourth role.

[0457] Specifically, the first request may be the deauthentication request frame in S907 above. The first response may be the confirmation frame in S908 above.

[0458] Specifically, in the embodiment of the present application, the specific implementation method of the first electronic device as the third role establishing the second WiFi connection with the second electronic device as the fourth role can refer to the specific implementation method of S907 and S910 mentioned above, which will not be repeated in the embodiment of the present application.

[0459] S1404: The first electronic device transmits first data to the second electronic device using the first working bandwidth based on the second WiFi connection.

[0460] In some examples, the first electronic device transmits the first data to the second electronic device based on the second WiFi connection using the first working bandwidth, which may include: when the first electronic device transmits the first data to the second electronic device, the first electronic device may transmit the first data (such as a file) to the second electronic device using the first working bandwidth.

[0461] In some examples, the first electronic device transmits the first data to the second electronic device based on the second WiFi connection using the first working bandwidth, which may include: when the second electronic device transmits the first data to the first electronic device, the second electronic device may transmit the first data (such as a file) to the first electronic device using the first working bandwidth.

[0462] Specifically, in the embodiment of the present application, the specific implementation method of the first electronic device transmitting the first data to the second electronic device using the first working bandwidth based on the second WiFi connection can refer to the specific implementation method of S911 above, which will not be repeated in the embodiment of the present application.

[0463] In an embodiment of the present application, when the first electronic device transmits data with the second electronic device, the first electronic device, as a third role, can establish a first WiFi connection with the first electronic device, as a fourth role. Afterwards, when the second working bandwidth corresponding to the first WiFi connection is inconsistent with the first working bandwidth, the first electronic device can send a second notification to the second electronic device to notify the second electronic device that the first electronic device will disconnect from the second electronic device and re-establish the second WiFi connection. Among them, the working bandwidth corresponding to the second WiFi connection is the first working bandwidth, and then the first electronic device and the second electronic device can use a larger first working bandwidth to transmit the first data, which can improve the data transmission rate, shorten the data transmission time, and improve the user experience.

[0464] The following is combined with Fig.17 The data transmission method provided in the embodiment of the present application is described. The data transmission method is applied to a first electronic device. Fig.17 As shown, the data transmission method may include the following S1501-S1504.

[0465] S1501. A first electronic device receives second information sent by a second electronic device, where the second information includes identification information and a first working bandwidth corresponding to a fifth role created by the second electronic device; wherein the fifth role is a role created by the second electronic device upon receiving a first operation; and the first operation is used to trigger the first electronic device to send first data to be transmitted to the second electronic device, or to trigger the second electronic device to send first data to the first electronic device.

[0466] The second electronic device can be used as a fifth role, and the first electronic device can be used as a sixth role. The sixth role is a role that is in a relative relationship with the fifth role.

[0467] In some examples, the fifth role is one of access point, group owner, personal mobile hotspot, virtual access point, and hotspot, and the sixth role is one of site or group client. That is, the second electronic device can be used to create an access point, group owner, personal mobile hotspot, virtual access point, or hotspot, and the first electronic device can be used as a site or group client to access the access point, group owner, personal mobile hotspot, virtual access point, or hotspot created by the second electronic device.

[0468] The above-mentioned second information may include identification information corresponding to the fifth role created by the second electronic device and the first working bandwidth. The first working bandwidth may be the maximum working bandwidth supported by the fifth role created by the second electronic device. For example, the first working bandwidth is 80MHz or 160MHz. Specifically, the second information may be the information of the target hotspot in S603 above. The identification information corresponding to the fifth role may be the identification of the target hotspot in S603 above. The first working bandwidth may be the maximum working bandwidth corresponding to the target hotspot in S603 above.

[0469] In the embodiment of the present application, the fifth role is a role created by the second electronic device when receiving the first operation; the first operation is used to trigger the first electronic device to send the first data to be transmitted to the second electronic device, or to trigger the second electronic device to send the first data to the first electronic device. That is, when the second electronic device receives the first operation, in response to the first operation, the second electronic device creates the fifth role and sends the second information to the first electronic device.

[0470] Specifically, the specific implementation method of the first electronic device receiving the second information sent by the second electronic device in the embodiment of the present application can refer to the specific implementation method of S601-S604 above, which will not be repeated in the embodiment of the present application.

[0471] S1502. When the first electronic device scans the first access point in the sixth role and the identification information corresponding to the first access point matches the identification information corresponding to the fifth role, the first electronic device adjusts the working bandwidth of the first electronic device as the sixth role to the first working bandwidth, and the sixth role is a role in a relative relationship with the fifth role.

[0472] In some examples, the first electronic device may set a filtering condition based on the second information, and the filtering condition includes a target identifier and a target working bandwidth. The target identifier may be used to determine whether the first access point scanned by the first electronic device is an access point created by the second electronic device (i.e., the fifth role). Exemplarily, the first electronic device sets the filtering condition, which may include: the first electronic device determines the identification information corresponding to the fifth role as the target identifier; the first electronic device determines the first working bandwidth as the target working bandwidth.

[0473] Afterwards, after the first electronic device determines the identification information corresponding to the scanned first access point, the first electronic device can determine the identification information corresponding to the scanned first access point, and can compare the identification information corresponding to the first access point with the target identification in the filtering condition. When the identification information corresponding to the first access point scanned by the first electronic device matches the target identification in the filtering condition, it means that the first access point scanned by the first electronic device can support the target working bandwidth in the filtering condition, and therefore, the first electronic device can adjust the working bandwidth of the first electronic device as the sixth role to the target working bandwidth (i.e., the first working bandwidth).

[0474] Specifically, the first access point may be the hotspot scanned in S609. The identification information corresponding to the first access point may be the identification corresponding to the hotspot scanned in S609. The first working bandwidth may be the maximum working bandwidth corresponding to the target hotspot in S603.

[0475] Specifically, in an embodiment of the present application, when the first electronic device scans the first access point in the sixth role and the identification information corresponding to the first access point matches the identification information corresponding to the fifth role, the first electronic device adjusts the working bandwidth of the first electronic device as the sixth role to the first working bandwidth. The specific implementation method can refer to the above-mentioned S609, which will not be repeated in the embodiment of the present application.

[0476] In some examples, the first electronic device is configured with a first WiFi chip. Before the first electronic device adjusts the working bandwidth of the first electronic device as a sixth role to the first working bandwidth, the data transmission method may further include: the first electronic device obtains the chip type of the first WiFi chip; the first electronic device adjusts the working bandwidth of the first electronic device as the sixth role to the first working bandwidth, which may include: when the chip type of the first WiFi chip is a preset type, the first electronic device adjusts the working bandwidth of the first electronic device as the sixth role to the first working bandwidth.

[0477] In some examples, after the first electronic device obtains the chip type of the first WiFi chip, the above-mentioned data transmission method may also include: the first electronic device obtains the data volume corresponding to the first data; the first electronic device adjusts the working bandwidth of the first electronic device as the sixth role to the first working bandwidth, which may include: when the chip type of the first WiFi chip is a preset type and the data volume corresponding to the first data is greater than or equal to the first data volume, the first electronic device adjusts the working bandwidth of the first electronic device as the sixth role to the first working bandwidth.

[0478] Specifically, in an embodiment of the present application, when the first electronic device scans the first access point in the sixth role and the identification information corresponding to the first access point matches the identification information corresponding to the fifth role, the first electronic device adjusts the working bandwidth of the first electronic device as the sixth role to the first working bandwidth. The specific implementation method can refer to the above-mentioned S605-S609, which will not be repeated in the embodiment of the present application.

[0479] S1503: The first electronic device, as the sixth role, establishes a WiFi connection with the second electronic device, as the fifth role.

[0480] The process of the first electronic device, as the sixth role, establishing a WiFi connection with the second electronic device, as the fifth role, may include four stages: scanning, authentication, connection, and four-way handshake.

[0481] Specifically, in the embodiment of the present application, the specific implementation method of the first electronic device as the sixth role establishing a WiFi connection with the second electronic device as the fifth role can refer to the specific implementation method of S610-S615 above, which will not be repeated in the embodiment of the present application.

[0482] S1504: The first electronic device transmits first data to the second electronic device using a first working bandwidth based on a WiFi connection.

[0483] In some examples, a first electronic device transmits first data to a second electronic device based on a WiFi connection using a first working bandwidth, which may include: when the first electronic device transmits the first data to the second electronic device, the first electronic device may use the target working bandwidth (i.e., the first working bandwidth) to transmit the first data (such as a file) to the second electronic device.

[0484] In some examples, a first electronic device transmits first data to a second electronic device based on a WiFi connection using a first working bandwidth, which may include: when the second electronic device transmits the first data to the first electronic device, the second electronic device may use the target working bandwidth (i.e., the first working bandwidth) to transmit the first data (such as a file) to the first (i.e., the first working bandwidth).

[0485] In the embodiment of the present application, when the first electronic device transmits the first data to the second electronic device, the first electronic device, as the sixth role, can set a filtering condition according to the second information sent by the second electronic device, as the fifth role. Afterwards, the first electronic device can adjust the working bandwidth of the first electronic device as the sixth role to the target working bandwidth according to the filtering condition, and then the first electronic device and the second electronic device can use the target working bandwidth to transmit the first data, which can improve the data transmission rate, shorten the data transmission time, and improve the user experience.

[0486] The following is combined with Fig.18 The data transmission method provided in the embodiment of the present application is described. The data transmission method is applied to a first electronic device. Fig.18 As shown, the data transmission method may include the following S1601-S1604.

[0487] S1601: When a first electronic device transmits first data to a second electronic device, the first electronic device obtains a working frequency band corresponding to a seventh role created by the second electronic device.

[0488] The first electronic device may be a terminal device (such as a mobile phone).

[0489] The first data is data to be transmitted sent by the first electronic device to the second electronic device, or the first data is data to be transmitted sent by the second electronic device to the first electronic device. Specifically, the first data may be the target data in S812 above.

[0490] In some examples, the second electronic device serves as the seventh role, and the first electronic device serves as the eighth role. The seventh role is one of access point, group owner, personal mobile hotspot, virtual access point, and hotspot, and the eighth role is one of site or group client. That is, the second electronic device can be used to create an access point, group owner, personal mobile hotspot, virtual access point, or hotspot, and the first electronic device can be used as a site or group client to access the access point, group owner, personal mobile hotspot, virtual access point, or hotspot created by the first electronic device.

[0491] In the embodiment of the present application, the seventh role is a role created by the second electronic device when receiving the first operation; the first operation is used to trigger the first electronic device to send the first data to be transmitted to the second electronic device, or to trigger the second electronic device to send the first data to the first electronic device. That is, when the second electronic device receives the first operation, in response to the first operation, the second electronic device creates the seventh role and sends the second information to the first electronic device.

[0492] Specifically, in the embodiment of the present application, the second electronic device receives the first operation, responds to the first operation, creates the seventh role, and sends the second information to the first electronic device. The specific implementation method can refer to the above-mentioned S801-S802, which will not be repeated in the embodiment of the present application.

[0493] In some examples, the first electronic device obtains the working frequency band corresponding to the seventh role created by the second electronic device, which may include: the first electronic device obtains the data volume corresponding to the first data; when the data volume corresponding to the first data is greater than or equal to the first data volume, the first electronic device obtains the working frequency band corresponding to the seventh role created by the second electronic device.

[0494] Specifically, the specific implementation method of the first electronic device obtaining the working frequency band corresponding to the seventh role created by the second electronic device in the embodiment of the present application can refer to the specific implementation method of S803-S804 above, which will not be repeated in the embodiment of the present application.

[0495] S1602: When the working frequency band corresponding to the seventh role is a preset frequency band, the first electronic device adjusts the working bandwidth of the first electronic device as the eighth role to the first working bandwidth.

[0496] The preset frequency band may be a frequency band that supports a larger working bandwidth. For example, the preset frequency band is a 5 GHz frequency band or a 6 GHz frequency band. The first working bandwidth is the maximum working bandwidth supported by the second electronic device when the second electronic device creates a seventh role corresponding to the preset frequency band. For example, the first working bandwidth is 80 MHz or 160 MHz. Specifically, the preset frequency band may be the first frequency band in S805 above, and the first working bandwidth may be the target working bandwidth in S805 above.

[0497] In some examples, the first electronic device adjusting the working bandwidth of the first electronic device as the eighth role to the first working bandwidth may include the first electronic device writing the first working bandwidth into firmware of a WiFi chip configured in the first electronic device.

[0498] Specifically, in the embodiment of the present application, the specific implementation method of the first electronic device adjusting the working bandwidth of the first electronic device as the eighth role to the first working bandwidth can refer to the specific implementation method of the above S805, which will not be repeated in the embodiment of the present application.

[0499] S1603: The first electronic device, as the eighth role, establishes a WiFi connection with the second electronic device, as the seventh role.

[0500] In some examples, the first electronic device, as the eighth role, establishes a WiFi connection with the second electronic device, as the seventh role, which may include: the first electronic device, as the eighth role, sends a second request to the second electronic device, the second request including a first working bandwidth; the first electronic device receives a second response corresponding to the second request sent by the second electronic device; the first electronic device transmits the first data to the second electronic device based on the WiFi connection using the first working bandwidth, which may include: when the second response indicates that the second electronic device supports the first working bandwidth, the first electronic device transmits the first data to the second electronic device based on the WiFi connection using the first working bandwidth.

[0501] In some examples, after the first electronic device receives the second response corresponding to the second request sent by the second electronic device, the above-mentioned data transmission method may also include: when the second response indicates that the second electronic device does not support the first working bandwidth, the first electronic device adjusts the working bandwidth of the first electronic device as the eighth role to the third working bandwidth indicated by the second response, and the third working bandwidth is smaller than the first working bandwidth; the first electronic device transmits the first data to the second electronic device based on the WiFi connection using the third working bandwidth.

[0502] In some examples, the third working bandwidth is greater than the fourth working bandwidth, wherein the fourth working bandwidth is a working bandwidth set for the seventh role when the second electronic device creates the seventh role.

[0503] Specifically, in the embodiment of the present application, the specific implementation method of the first electronic device as the eighth role establishing a WiFi connection with the second electronic device as the seventh role can refer to the specific implementation method of S806-S811 above, which will not be repeated in the embodiment of the present application.

[0504] S1604: The first electronic device transmits first data to the second electronic device using a first working bandwidth based on a WiFi connection.

[0505] Specifically, in the embodiment of the present application, the specific implementation method of the first electronic device transmitting the first data to the second electronic device based on the WiFi connection using the first working bandwidth can refer to the specific implementation method of the above-mentioned S812, which will not be repeated in the embodiment of the present application.

[0506] In the embodiment of the present application, when the first electronic device is a terminal device, the first electronic device does not provide a working bandwidth that can be used to set the supported working bandwidth of the WiFi chip carried by the first electronic device. Therefore, when the first electronic device and the second electronic device transmit the first data, the first electronic device, as the eighth role, can obtain the working frequency band corresponding to the seventh role created by the second electronic device. Thereafter, when the working frequency band corresponding to the seventh role created by the second electronic device is a preset frequency band, the first electronic device can adjust the working bandwidth supported by the WiFi chip carried by it to the maximum working bandwidth (i.e., the first working bandwidth) corresponding to the preset frequency band, and then the first electronic device and the second electronic device can use the target working bandwidth to transmit the first data, which can improve the data transmission rate, shorten the data transmission time, and thus improve the user experience.

[0507] In the solution of the present application, when the first electronic device transmits target data to the second electronic device, the first electronic device, as a site (or group client), can set filtering conditions according to the information of the target hotspot created by the second electronic device as the target hotspot (i.e., the access point or group owner). Afterwards, the first electronic device can adjust the working bandwidth of the first electronic device as a site (or group client) to the target working bandwidth according to the filtering conditions, and then the target working bandwidth can be used to transmit the target data between the first electronic device and the second electronic device, thereby improving the data transmission rate, shortening the data transmission time, and realizing the rapid transmission of large files, improving the user experience.

[0508] Furthermore, when the first electronic device is a terminal device, the first electronic device does not provide a working bandwidth supported by the WiFi chip carried by the first electronic device. Therefore, when the first electronic device and the second electronic device transmit target data, the first electronic device, as a site (or group client), can obtain the working frequency band corresponding to the target hotspot (i.e., access point or group owner) created by the second electronic device. Thereafter, when the working frequency band corresponding to the access point (or group owner) created by the second electronic device is the target frequency band, the first electronic device can adjust the working bandwidth supported by the WiFi chip carried by it to the maximum working bandwidth corresponding to the target frequency band (i.e., target working bandwidth), and then the target working bandwidth can be used to transmit target data between the first electronic device and the second electronic device, thereby improving the data transmission rate, shortening the data transmission time, and realizing the rapid transmission of large files, thereby improving the user experience.

[0509] In addition, when the first electronic device transmits target data with the second electronic device, the first electronic device, as a site (or group client), can establish a WiFi connection with the second electronic device as a target hotspot (i.e., an access point or group owner). Afterwards, when the working bandwidth corresponding to the WiFi connection is inconsistent with the target working bandwidth, the first electronic device can send a reconnection notification to the second electronic device to notify the second electronic device that the first electronic device will disconnect from the second electronic device and re-establish a WiFi connection. Afterwards, the first electronic device re-establishes a WiFi connection with the second electronic device, wherein the working bandwidth corresponding to the re-established WiFi connection is the target working bandwidth, and then the target working bandwidth can be used to transmit the target data between the first electronic device and the second electronic device, thereby improving the data transmission rate and shortening the data transmission time, thereby realizing the rapid transmission of large files and improving the user experience.

[0510] In addition, when the first electronic device and the second electronic device transmit target data, if the working bandwidth for transmitting data between the first electronic device and the second electronic device is inconsistent with the target working bandwidth (that is, the first electronic device and the second electronic device cannot use the negotiated larger working bandwidth to transmit data), the first electronic device can send a management frame notification to the second electronic device to adjust the working bandwidth corresponding to the WiFi connection established between the first electronic device and the second electronic device to the target working bandwidth indicated by the management frame notification, and then the target working bandwidth can be used to transmit target data between the first electronic device and the second electronic device, thereby improving the data transmission rate, shortening the data transmission time, and realizing the rapid transmission of large files, thereby improving the user experience.

[0511] Corresponding to the method in the above embodiment, the embodiment of the present application further provides a data transmission device. The data transmission device can be applied to a first electronic device to implement the method in the above embodiment. The function of the data transmission device can be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions.

[0512] For example, Fig.19 A schematic diagram of the structure of a data transmission device 1900 is shown. Fig.19 As shown, the data transmission device 1900 may include: an acquisition module 1901 , a sending module 1902 and an adjustment module 1903 .

[0513] Among them, the acquisition module 1901 can be used to obtain first information in response to a first operation; wherein the first operation is used to trigger the first electronic device to send first data to be transmitted to the second electronic device, or to trigger the second electronic device to send first data to the first electronic device.

[0514] The sending module 1902 can be used to send a first notification to the second electronic device in a first role when the first information meets a preset condition, so that the second electronic device adjusts the working bandwidth of the second electronic device as a second role to the first working bandwidth indicated by the first notification, and the second role is a role that is in a relative relationship with the first role.

[0515] The adjustment module 1903 may be configured to adjust the working bandwidth corresponding to the first electronic device serving as the first role to the first working bandwidth.

[0516] The sending module 1902 can also be used to transmit first data to a second electronic device based on a first WiFi connection using a first working bandwidth, wherein the first WiFi connection is a WiFi connection established between the first electronic device as a first role and the second electronic device as a second role.

[0517] In another possible implementation, the first role is one of an access point, a group owner, a personal mobile hotspot, a virtual access point, and a hotspot, and the second role is a role in a site or a group client; or, the first role is a role in a site or a group client, and the second role is one of an access point, a group owner, a personal mobile hotspot, a virtual access point, and a hotspot.

[0518] In another possible implementation manner, the first notification includes an extended channel switching notification and an operating mode notification.

[0519] In another possible implementation, the first role is a role among access point, group owner, personal mobile hotspot, virtual access point, and hotspot, the second role is a role in a site or group client, and the first notification is an extended channel switching notification; the sending module 1902 can be specifically used to send an extended channel switching notification to the second electronic device in the first role.

[0520] In another possible implementation, the first information includes a chip type of a WiFi chip configured in an electronic device as a third role or a second working bandwidth for transmitting data between the first electronic device and the second electronic device, wherein the third role is a site or a group client.

[0521] In another possible implementation, the first information satisfies a preset condition, which may include: the chip type of the WiFi chip configured in the electronic device as the third role is a preset type; or the second working bandwidth is inconsistent with the first working bandwidth.

[0522] In another possible implementation, the first information satisfies the preset condition that the second working bandwidth is inconsistent with the first working bandwidth, and the sending module 1902 can also be used to transmit the first data to the second electronic device based on the first WiFi connection using the second working bandwidth, and the second working bandwidth is less than the first working bandwidth. The sending module 1902 can specifically be used to transmit the second data to the second electronic device based on the first WiFi connection using the first working bandwidth.

[0523] For example, Fig. 20 A schematic diagram of the structure of a data transmission device 2000 is shown. Fig. 20 As shown, the data transmission device 2000 may include: a communication module 2001 and a sending module 2002 .

[0524] Among them, the communication module 2001 can be used to establish a first WiFi connection with the second electronic device as a fourth role as a third role when the first electronic device and the second electronic device transmit the first data, and the working bandwidth corresponding to the first WiFi connection is the second working bandwidth; wherein the first data is the data to be transmitted sent by the first electronic device to the second electronic device, or the first data is the data to be transmitted sent by the second electronic device to the first electronic device.

[0525] The sending module 2002 can be used to send a second notification to the second electronic device when the second working bandwidth is inconsistent with the first working bandwidth, and the second notification is used to indicate that the first electronic device will disconnect from the second electronic device and re-establish a WiFi connection; wherein the first working bandwidth is the working bandwidth obtained by negotiation between the first electronic device and the second electronic device, and the first working bandwidth is greater than the second working bandwidth.

[0526] The communication module 2001 can also be used to serve as a third role to establish a second WiFi connection with a second electronic device serving as a fourth role, and the working bandwidth corresponding to the second WiFi connection is the first working bandwidth.

[0527] The sending module 2002 may also be configured to transmit the first data to the second electronic device using the first working bandwidth based on the second WiFi connection.

[0528] For example, Fig.21 A schematic diagram of the structure of a data transmission device 2100 is shown. Fig.21 As shown, the data transmission device 2100 may include: a receiving module 2101 , an adjustment module 2102 , a communication module 2103 and a sending module 2104 .

[0529] Among them, the receiving module 2101 can be used to receive second information sent by the second electronic device, the second information includes identification information and a first working bandwidth corresponding to a fifth role created by the second electronic device; wherein the fifth role is a role created by the second electronic device when receiving the first operation; the first operation is used to trigger the first electronic device to send the first data to be transmitted to the second electronic device, or to trigger the second electronic device to send the first data to the first electronic device.

[0530] The adjustment module 2102 can be used to adjust the working bandwidth of the first electronic device as the sixth role to the first working bandwidth when the first electronic device scans the first access point as the sixth role and the identification information corresponding to the first access point matches the identification information corresponding to the fifth role. The sixth role is a role that is relative to the fifth role.

[0531] The communication module 2103 can be used to serve as the sixth role and establish a WiFi connection with the second electronic device serving as the fifth role.

[0532] The sending module 2104 may be configured to transmit first data to a second electronic device using a first working bandwidth based on a WiFi connection.

[0533] For example, Fig. 22 A schematic diagram of the structure of a data transmission device 2200 is shown. Fig. 22 As shown, the data transmission device 2200 may include: an acquisition module 2201 , an adjustment module 2202 , a communication module 2203 and a sending module 2204 .

[0534] The acquisition module 2201 can be used to obtain the working frequency band corresponding to the seventh role created by the second electronic device when the first electronic device and the second electronic device transmit the first data; wherein the first data is the data to be transmitted sent by the first electronic device to the second electronic device, or the first data is the data to be transmitted sent by the second electronic device to the first electronic device.

[0535] The adjustment module 2202 may be configured to adjust the working bandwidth of the first electronic device as the eighth role to the first working bandwidth when the working frequency band corresponding to the seventh role is a preset frequency band.

[0536] The communication module 2203 can be used to serve as the eighth role and establish a WiFi connection with the second electronic device serving as the seventh role.

[0537] The sending module 2204 may be configured to transmit first data to a second electronic device using a first working bandwidth based on a WiFi connection.

[0538] It should be understood that the division of units or modules (hereinafter referred to as units) in the above device is only a division of logical functions. In actual implementation, they can be fully or partially integrated into one physical entity, or physically separated. And the units in the device can all be implemented in the form of software calling through processing elements; or all in the form of hardware; or some units can be implemented in the form of software calling through processing elements, and some units can be implemented in the form of hardware.

[0539] For example, each unit can be a separately established processing element, or it can be integrated in a certain chip of the device. In addition, it can also be stored in a memory in the form of a program, and called and executed by a certain processing element of the device. In addition, all or part of these units can be integrated together, or they can be implemented independently. The processing element described here can also be called a processor, which can be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each unit above can be implemented by an integrated logic circuit of hardware in the processor element or in the form of software called by a processing element.

[0540] In one example, the unit in the above apparatus may be one or more integrated circuits configured to implement the above method, such as one or more ASICs, or one or more DSPs, or one or more FPGAs, or a combination of at least two of these integrated circuit forms.

[0541] For another example, when the units in the device can be implemented in the form of a processing element scheduling program, the processing element can be a general-purpose processor, such as a CPU or other processor that can call a program. For another example, these units can be integrated together and implemented in the form of a system on a chip SOC.

[0542] In one implementation, the units of the above apparatus implementing the corresponding steps in the above method can be implemented in the form of a processing element scheduling program. For example, the apparatus may include a processing element and a storage element, and the processing element calls the program stored in the storage element to execute the method described in the above method embodiment. The storage element may be a storage element on the same chip as the processing element, that is, an on-chip storage element.

[0543] In another implementation, the program for executing the above method may be in a storage element on a different chip from the processing element, i.e., an off-chip storage element. In this case, the processing element calls or loads the program from the off-chip storage element to the on-chip storage element to call and execute the method described in the above method embodiment.

[0544] For example, an embodiment of the present application may also provide a device, such as an electronic device, which may include a processor and a memory for storing instructions executable by the processor. When the processor is configured to execute the above instructions, the electronic device implements the shortcut input method described in the above embodiment. The memory may be located inside the electronic device or outside the electronic device. And the processor includes one or more.

[0545] In another implementation, the unit of the device implementing each step in the above method may be configured as one or more processing elements, which may be arranged on the corresponding electronic device, and the processing element here may be an integrated circuit, for example: one or more ASICs, or one or more DSPs, or one or more FPGAs, or a combination of these integrated circuits. These integrated circuits may be integrated together to form a chip.

[0546] For example, the present application also provides a chip, which can be applied to the above electronic device. The chip includes one or more interface circuits and one or more processors; the interface circuit and the processor are interconnected through a line; the processor receives and executes computer instructions from the memory of the electronic device through the interface circuit to implement the method described in the above method embodiment.

[0547] An embodiment of the present application also provides a computer program product, including computer instructions executed by the above-mentioned electronic device.

[0548] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0549] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0550] The units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0551] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0552] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, such as a program. The software product is stored in a program product, such as a computer-readable storage medium, including a number of instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard drives, ROM, RAM, magnetic disks, or optical disks.

[0553] For example, the present application embodiment may also provide a computer-readable storage medium on which computer program instructions are stored. When the computer program instructions are executed by an electronic device, the electronic device implements the shortcut input method described in the above method embodiment.

[0554] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A data transmission method, characterized in that: Applied to a first electronic device, the method includes: In response to a first operation, the first electronic device acquires first information; wherein the first operation is used to trigger the first electronic device to send first data to be transmitted to the second electronic device, or to trigger the second electronic device to send the first data to the first electronic device; When the first information satisfies a preset condition, the first electronic device sends a first notification to the second electronic device as a first role, so that the second electronic device adjusts the working bandwidth of the second electronic device as a second role to the first working bandwidth indicated by the first notification, and the second role is a role in a relative relationship with the first role; The first electronic device adjusts the working bandwidth corresponding to the first electronic device acting as the first role to the first working bandwidth; The first electronic device transmits the first data to the second electronic device using the first working bandwidth based on a first WiFi connection, wherein the first WiFi connection is a WiFi connection established between the first electronic device as the first role and the second electronic device as the second role.

2. The method according to claim 1, characterized in that The first role is one of an access point, a group owner, a personal mobile hotspot, a virtual access point, and a hotspot, and the second role is one of a site or a group client; or The first role is a role in a site or a group client, and the second role is a role in an access point, a group owner, a personal mobile hotspot, a virtual access point, and a hotspot.

3. The method according to claim 1, characterized in that The first notification includes an extended channel switching notification and an operating mode notification.

4. The method according to claim 1, characterized in that: The first role is one of an access point, a group owner, a personal mobile hotspot, a virtual access point, and a hotspot; the second role is one of a site or a group client; the first notification is an extended channel switching notification; and the first electronic device sends the first notification to the second electronic device as the first role, including: The first electronic device sends the extended channel switching notification to the second electronic device in the first role.

5. The method according to claim 1, characterized in that The first information includes a chip type of a WiFi chip configured in an electronic device as a third role or a second working bandwidth for transmitting data between the first electronic device and the second electronic device, wherein the third role is a site or a group client.

6. The method according to claim 5, characterized in that The first information satisfies a preset condition, including: The chip type of the WiFi chip configured in the electronic device as the third role is a preset type; or, The second operating bandwidth is inconsistent with the first operating bandwidth.

7. The method according to claim 6, characterized in that The first information satisfies a preset condition that the second working bandwidth is inconsistent with the first working bandwidth. Before the first electronic device acquires the first information in response to the first operation, the method further includes: The first electronic device transmits the first data to the second electronic device using the second working bandwidth based on the first WiFi connection, and the second working bandwidth is smaller than the first working bandwidth; The first electronic device transmits the first data to the second electronic device using the first working bandwidth based on the first WiFi connection, including: The first electronic device transmits second data to the second electronic device using the first working bandwidth based on the first WiFi connection, wherein the second data is remaining data in the first data except for the data transmitted to the second electronic device using the second working bandwidth.

8. A data transmission method, characterized in that: Applied to a first electronic device, the method includes: In the case where the first electronic device transmits the first data to the second electronic device, the first electronic device, as the third role, establishes a first WiFi connection with the second electronic device, as the fourth role, and the working bandwidth corresponding to the first WiFi connection is the second working bandwidth; wherein the first data is the data to be transmitted sent by the first electronic device to the second electronic device, or the first data is the data to be transmitted sent by the second electronic device to the first electronic device; When the second working bandwidth is inconsistent with the first working bandwidth, the first electronic device sends a second notification to the second electronic device, where the second notification is used to indicate that the first electronic device will disconnect from the second electronic device and re-establish a WiFi connection; wherein the first working bandwidth is a working bandwidth obtained through negotiation between the first electronic device and the second electronic device, and the first working bandwidth is greater than the second working bandwidth; The first electronic device, as a third role, establishes a second WiFi connection with the second electronic device, as a fourth role, and the working bandwidth corresponding to the second WiFi connection is the first working bandwidth; The first electronic device transmits the first data to the second electronic device using the first working bandwidth based on the second WiFi connection.

9. The method according to claim 8, characterized in that The first electronic device sending a second notification to the second electronic device includes: The first electronic device acquires a data volume corresponding to the first data; When the data volume corresponding to the first data is greater than or equal to the first data volume, the first electronic device sends a second notification to the second electronic device.

10. The method according to claim 8, characterized in that The first electronic device, as the third role, establishes a second WiFi connection with the second electronic device, as the fourth role, including: The first electronic device sends a first request to the second electronic device; When the first electronic device receives the first response to the first request sent by the second electronic device, the first electronic device, as the third role, establishes a second WiFi connection with the second electronic device, as the fourth role.

11. The method according to claim 8, characterized in that The third role is a role in a site or a group client, and the fourth role is a role in an access point, a group owner, a personal mobile hotspot, a virtual access point, and a hotspot.

12. A data transmission method, characterized in that: Applied to a first electronic device, the method includes: The first electronic device receives second information sent by the second electronic device, where the second information includes identification information corresponding to a fifth role created by the second electronic device and a first working bandwidth; wherein the fifth role is a role created by the second electronic device when receiving a first operation; and the first operation is used to trigger the first electronic device to send first data to be transmitted to the second electronic device, or to trigger the second electronic device to send the first data to the first electronic device; When the first electronic device scans a first access point in a sixth role and the identification information corresponding to the first access point matches the identification information corresponding to the fifth role, the first electronic device adjusts the working bandwidth of the first electronic device as the sixth role to the first working bandwidth, and the sixth role is a role in a relative relationship with the fifth role; The first electronic device, as the sixth role, establishes a WiFi connection with the second electronic device, as the fifth role; The first electronic device transmits the first data to the second electronic device based on the WiFi connection using the first working bandwidth.

13. The method according to claim 12, characterized in that The first electronic device is configured with a first WiFi chip, and before the first electronic device adjusts the working bandwidth of the first electronic device as the sixth role to the first working bandwidth, the method further includes: The first electronic device obtains a chip type of the first WiFi chip; The first electronic device adjusting the working bandwidth of the first electronic device as the sixth role to the first working bandwidth includes: When the chip type of the first WiFi chip is a preset type, the first electronic device adjusts the working bandwidth of the first electronic device as the sixth role to the first working bandwidth.

14. The method according to claim 13, characterized in that After the first electronic device obtains the chip type of the first WiFi chip, the method further includes: The first electronic device acquires a data volume corresponding to the first data; The first electronic device adjusting the working bandwidth of the first electronic device as the sixth role to the first working bandwidth includes: When the chip type of the first WiFi chip is a preset type and the data volume corresponding to the first data is greater than or equal to the first data volume, the first electronic device adjusts the working bandwidth of the first electronic device as the sixth role to the first working bandwidth.

15. The method according to claim 12, characterized in that The fifth role is one of an access point, a group owner, a personal mobile hotspot, a virtual access point, and a hotspot, and the sixth role is one of a site or a group client.

16. A data transmission method, characterized in that: Applied to a first electronic device, where the first electronic device is a terminal device, the method includes: In the case where the first electronic device transmits first data to the second electronic device, the first electronic device obtains the working frequency band corresponding to the seventh role created by the second electronic device; wherein the first data is data to be transmitted sent by the first electronic device to the second electronic device, or the first data is data to be transmitted sent by the second electronic device to the first electronic device; When the working frequency band corresponding to the seventh role is a preset frequency band, the first electronic device adjusts the working bandwidth of the first electronic device as the eighth role to the first working bandwidth; The first electronic device, as the eighth role, establishes a WiFi connection with the second electronic device, as the seventh role; The first electronic device transmits the first data to the second electronic device based on the WiFi connection using the first working bandwidth.

17. The method according to claim 16, characterized in that The first electronic device, as the eighth role, establishes a WiFi connection with the second electronic device, as the seventh role, including: The first electronic device, as the eighth role, sends a second request to the second electronic device, where the second request includes the first working bandwidth; The first electronic device receives a second response corresponding to the second request sent by the second electronic device; The first electronic device transmits the first data to the second electronic device using the first working bandwidth based on the WiFi connection, including: When the second response indicates that the second electronic device supports the first working bandwidth, the first electronic device transmits the first data to the second electronic device using the first working bandwidth based on the WiFi connection.

18. The method according to claim 17, characterized in that After the first electronic device receives a second response corresponding to the second request sent by the second electronic device, the method further includes: When the second response indicates that the second electronic device does not support the first working bandwidth, the first electronic device adjusts the working bandwidth of the first electronic device as the eighth role to a third working bandwidth indicated by the second response, where the third working bandwidth is smaller than the first working bandwidth; The first electronic device transmits the first data to the second electronic device based on the WiFi connection using the third working bandwidth.

19. The method according to claim 18, characterized in that The third working bandwidth is greater than a fourth working bandwidth, wherein the fourth working bandwidth is a working bandwidth set for the seventh role when the second electronic device creates the seventh role.

20. The method according to claim 16, characterized in that The first electronic device acquires a working frequency band corresponding to a seventh role created by the second electronic device, including: The first electronic device acquires a data volume corresponding to the first data; When the data amount corresponding to the first data is greater than or equal to the first data amount, the first electronic device obtains the working frequency band corresponding to the seventh role created by the second electronic device.

21. The method according to claim 16, characterized in that The seventh role is one of an access point, a group owner, a personal mobile hotspot, a virtual access point, and a hotspot, and the eighth role is one of a site or a group client.

22. An electronic device, characterized in that: The electronic device includes a processor and a memory for storing instructions executable by the processor; when the processor is configured to execute the instructions, the electronic device implements the method as described in any one of claims 1 to 7; or, when the processor is configured to execute the instructions, the electronic device implements the method as described in any one of claims 8 to 11; or, when the processor is configured to execute the instructions, the electronic device implements the method as described in any one of claims 12 to 15; or, when the processor is configured to execute the instructions, the electronic device implements the method as described in any one of claims 16 to 21.

23. A chip system, characterized in that: The chip system is coupled to a memory, and the chip system is used to read and execute a computer program stored in the memory to implement the method as described in any one of claims 1 to 7, or to implement the method as described in any one of claims 8 to 11, or to implement the method as described in any one of claims 12 to 15, or to implement the method as described in any one of claims 16 to 21.

24. A computer-readable storage medium having computer program instructions stored thereon; characterized in that: When the computer program instructions are executed by an electronic device, the electronic device implements the method as described in any one of claims 1 to 7; or, when the computer program instructions are executed by an electronic device, the electronic device implements the method as described in any one of claims 8 to 11; or, when the computer program instructions are executed by an electronic device, the electronic device implements the method as described in any one of claims 12 to 15; or, when the computer program instructions are executed by an electronic device, the electronic device implements the method as described in any one of claims 16 to 21.

Citation Information

Cited By

  • Channel adjustment method, electronic device and chip system

    WO2026184181A1