Network speed display method and electronic equipment

By establishing a network sharing connection between the network-sharing device and the network-providing device, real-time traffic data is obtained and the network speed icon is refreshed, solving the problem that the network-sharing device cannot display the network speed, improving users' intuitive perception of the shared network status, and enhancing the user experience.

CN121967593APending Publication Date: 2026-05-01HONOR DEVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HONOR DEVICE CO LTD
Filing Date
2024-10-23
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

Electronic devices using shared Wi-Fi cannot display network speed, making it impossible for users to determine if there are any abnormalities in the shared network, thus affecting user experience.

Method used

After the network sharing connection is established between the network borrowing device and the network supply device, traffic data is obtained in real time and the network speed icon is refreshed to display the current network speed, ensuring that the network speed icon always shows the latest information.

Benefits of technology

Users can intuitively perceive the smoothness of the shared network by viewing the network speed icon, thus improving the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121967593A_ABST
    Figure CN121967593A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a network speed display method and electronic equipment, and is suitable for the technical field of information display, and the network speed display method comprises the steps that first equipment and second equipment establish network sharing connection, and the network sharing connection is used for enabling the first equipment to share and use a first network of the second equipment; if the first device is not connected with a second network at a first moment, a first icon is added to a status bar of the first device, the second network comprises a wireless local area network and / or a cellular network, the first icon indicates the network speed, and the first moment is the moment when the network sharing connection is established; afterwards, the first device can obtain traffic data consumed by the first device from the second device according to a preset period, and refresh the first icon based on the traffic data. According to the embodiment of the invention, when the first equipment borrowing the network borrows the network of the second equipment, the network speed can be displayed in real time, so that the user experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of information display technology, and in particular to a method and electronic device for displaying network speed. Background Technology

[0002] Multiple electronic devices that work using multi-device collaboration technology, such as those in a trust ring, can share a network. For example, electronic device A, which does not have a network, can share the network of electronic device B, which does have a network. This allows users to flexibly use multiple devices.

[0003] In related technologies, because the electronic device borrowing the network cannot display the network speed, if access abnormalities occur when the borrowing electronic device uses the network provided by the electronic device, such as website access problems, the user cannot determine whether the problem lies with the accessed object or the shared network being used. In other words, the inability of the borrowing electronic device to display the network speed can easily prevent the user from perceiving whether there are any abnormalities in the shared network, thus affecting the user experience. Summary of the Invention

[0004] In view of this, embodiments of this application provide a network speed display method, an electronic device, a computer-readable storage medium, a chip system, and a computer program product, which can enable an electronic device borrowing the network of another electronic device to display the network speed in real time, thereby improving the user experience.

[0005] In a first aspect, embodiments of this application provide a method for displaying network speed, which can be applied to electronic devices that borrow a network, referred to as network-borrowing devices or the first device.

[0006] The network speed display method may include: a first device establishing a network sharing connection with a second device, whereby the first device shares the second device's first network. The first device can determine whether it is connected to the second network at a given moment, where the first moment is the moment the network sharing connection is initiated. The second network includes a wireless local area network (WLAN) and / or a cellular network. For example, the WLAN could be a WiFi network, and the cellular network could be an LTE network. If the first device is not connected to the second network at the given moment, a first icon can be added to the first device's status bar. This first icon indicates the network speed. After the first device establishes a network sharing connection with the second device, it can retrieve the data traffic consumed by the first device from the second device at preset intervals and refresh the first icon based on the data traffic.

[0007] In this context, the second device is an electronic device that provides the network, also known as a network provider. The first network is the network shared by the second device with the first device. In some scenarios, the first network is also referred to as a shared network.

[0008] The first icon can indicate network speed, and in some scenarios, it is also called the network speed icon.

[0009] The above preset period is a pre-set duration value, such as 1 second.

[0010] The traffic data consumed by the first device refers to the traffic data consumed by the first device when using the first network, or the traffic data provided by the second device to the first device.

[0011] In this embodiment, the first device (the network-sharing device) can display a first icon (network speed icon) when it successfully establishes a network sharing connection with the second device (the network-providing device). After successfully establishing the network sharing connection, the first device can query the consumed traffic data from the second device in real time, and determine the real-time network speed of the first device based on the queried traffic data. The network speed icon is then refreshed based on the real-time network speed, ensuring that the network speed icon always displays the latest network speed information. In this case, users can intuitively perceive the current network speed of the network-sharing device by viewing the network speed icon of the first device, thereby sensing whether the shared network used by the first device is working smoothly or whether there are any abnormalities, which helps improve the user experience.

[0012] In some embodiments, the first device may establish a network sharing connection with the second device in response to a first operation performed by the user on the screen of the first device.

[0013] The first operation is to enable network sharing. This first operation can trigger the first device to borrow network resources from the second device.

[0014] Here, the first device can proactively initiate a network sharing connection with the second device upon detecting the first operation.

[0015] In other embodiments, the first device may respond to receiving a connection message from the second device and establish a network sharing connection with the second device.

[0016] The connection message is used to indicate that network sharing should be enabled.

[0017] Here, the second device can respond to the user's first operation on the second device's screen, proactively initiate the establishment of a network sharing connection with the first device, and send the aforementioned connection message to the first device. Upon receiving the aforementioned connection message, the first device can cooperate with the second device to establish a network sharing connection.

[0018] In a first possible implementation of the first aspect, when the first device and the second device successfully establish a network sharing connection, if the first device has already connected to the second network at the first moment and the first icon already exists in the status bar, the first device can retain the first icon in the status bar.

[0019] Here, when the first device successfully establishes a network sharing connection with the second device, the first device's status bar can display a first icon, which is the network speed icon, to inform the user of the network speed status. If, at the moment of initiating the network sharing connection (i.e., the first moment), the first device is already connected to a second network, such as a WiFi network, and the first device's status bar already displays the first icon, then the first device can retain the first icon in the status bar. This avoids the situation where the first icon is deleted and then immediately reappears, saving computational resources.

[0020] Understandably, the fact that the first device is already displaying the first icon when it is connected to the second network indicates that the first device has enabled the network speed display function.

[0021] In the second possible implementation of the first aspect, when the first device and the second device successfully establish a network sharing connection, if the first device is already connected to the second network at the first moment and there is no first icon in the status bar, the first device can add the first icon to the status bar.

[0022] Here, if at the moment the network sharing connection is initiated (i.e., at the first moment), the first device is connected to a second network, such as a WiFi network, and the first device's status bar does not have the first icon, it means that the first device has not enabled the network speed display function. In this case, the first device can add the first icon to the status bar.

[0023] In some alternative implementations, when the first device and the second device successfully establish a network sharing connection, if the first device is already connected to the second network and the first icon is not present in the status bar, the first device may first display a prompt message, such as a message prompting the user to enable the network speed display function, or a message indicating permission to display the network speed. Only after obtaining user permission, such as when the network speed display function is enabled or a control indicating permission to display the network speed is triggered, will the first icon be displayed in the status bar.

[0024] Here, if the first device does not display the first icon when it is connected to the second network, it means that the first device has not enabled the network speed display function or the user does not want to display the network speed icon. In this case, the first device can display the network speed with the user's permission, which helps to improve the user experience.

[0025] In a third possible implementation of the first aspect, the first device obtains traffic data consumed by the first device from the second device at a preset period, and refreshes the first icon based on the traffic data. This may include: the first device sending traffic query information to the second device at a preset period. Each time the first device receives traffic data sent by the second device, it determines the first network speed of the first device based on the traffic data and refreshes the icon content of the first icon to the first network speed.

[0026] Among them, the first network speed is the network speed of the first device.

[0027] The traffic query information is used to query the traffic consumed by the first device. The traffic consumed by the first device refers to the traffic consumed by the first device using the first network.

[0028] In this embodiment, the first device sends traffic query information to the second device at a preset period to obtain real-time traffic consumption data from the second device. Based on this data, the first device calculates the real-time network speed and updates the network speed icon. This ensures that the network speed icon always displays the latest network speed information.

[0029] In a fourth possible implementation of the first aspect, the first device determines the first network speed based on traffic data, which may include: the first device determining the first network speed as the ratio of the first difference to the first duration.

[0030] Here, the first difference is the difference between the traffic data received this time and the traffic data received last time, and the first duration is the duration corresponding to the preset period. For example, if the preset period is 1 second, then the first duration can be 1 second.

[0031] Optionally, the first device determines its first network speed based on traffic data. Alternatively, the first device can calculate the difference between each pair of traffic data received multiple times, divide the difference by the query time interval between the two traffic data, obtain the corresponding value, and finally determine the average of the multiple values ​​as the first network speed.

[0032] It is understood that the embodiments of this application do not specifically limit the process by which the first device calculates the first network speed based on multiple traffic data.

[0033] In the fifth possible implementation of the first aspect, the first device may include system interface services and system services.

[0034] In this scenario, the first device sending traffic query information to the second device at a preset period can include: First, the system interface service sends first information for querying traffic to the system service at a preset period. Then, in response to receiving the first information, the system service sends second information for querying traffic to the second device.

[0035] The first piece of information indicates the query traffic. The second piece of information indicates the query traffic.

[0036] It is understood that the specific content of the first information and the second information is not limited in the embodiments of this application.

[0037] Optionally, each time the first device receives traffic data sent by the second device, determining the first device's first network speed based on the traffic data may include: First, in response to receiving the traffic data sent by the second device, the system service sends the traffic data to the system interface service. Then, in response to receiving the traffic data, the system interface service determines the first device's first network speed based on the traffic data.

[0038] Optionally, the process by which the system interface service determines the first network speed of the first device based on traffic data can be specifically as follows: the ratio of the first difference to the first duration is determined as the first network speed. Here, the first difference is the difference between the traffic data received this time and the traffic data received last time, and the first duration is the duration corresponding to a preset period.

[0039] In this embodiment, since the system service is responsible for starting and managing various services in the operating system, and the system service is usually always alive, the interaction between the system interface service and the second device is realized through the system service, which is stable and reliable and helps to ensure that the first device can refresh and display real-time network speed data in a timely manner.

[0040] In the sixth possible implementation of the first aspect, the first device further includes a first service for establishing or disconnecting a network sharing connection with the second device. In some scenarios, the first service is also referred to as a first network sharing service.

[0041] In this scenario, the first device can establish a network sharing connection with the second device through the first service. After establishing the network sharing connection, the first service sends a first network broadcast message, which indicates that network sharing is enabled.

[0042] The first network broadcast is used to broadcast the opening and closing status of the first network (or shared network). The content broadcast by the first network broadcast (or simply the first broadcast) can be a first broadcast message or a second broadcast message. The first broadcast message indicates that network sharing is enabled, that is, that the shared network provided by the second device (or the network supply device) is enabled. The second broadcast message indicates that network sharing is disabled, that is, that the shared network provided by the network supply device is disabled.

[0043] Here, when the first device establishes a network sharing connection with the second device through the first service, the content of the first network broadcast by the first service is the first broadcast message. It should be noted that the first service and the system service interface can improve the information transmission rate by transmitting the opening and closing status of the first network through broadcast (specifically, by transmitting the first network broadcast).

[0044] Optionally, the system interface service may send first information for querying traffic to the system service at a preset period, which may include: the system interface service responding to receiving a first network broadcast by sending first information for querying traffic to the system service at a preset period.

[0045] Here, when the system interface service receives a first network broadcast containing a first broadcast message, it can send first information for querying traffic to the system service according to a preset period.

[0046] Optionally, the first service may send a first network broadcast including a first broadcast message, which may be in response to the second device starting to transmit network data to the first device.

[0047] Here, the first service sends the first network broadcast when the second device (the network provider) starts transmitting network data to the first device (the network borrower). This avoids the system interface service from starting the network speed query too early, which helps to save unnecessary computing resource consumption.

[0048] In a seventh possible implementation of the first aspect, the first device may also disconnect the network sharing connection with the second device. In response to the first device connecting to the second network, the first icon in the status bar is retained; in response to the first device not connecting to the second network, the first icon is stopped from being displayed.

[0049] In this embodiment, the first device can disconnect from the network sharing connection with the second device. During the disconnection process, the first device can attempt to connect to the second network. If the first device has already connected to the second network when the network sharing connection between the first and second devices is successfully disconnected, the first device can retain the first icon in the status bar. This avoids the situation where the first icon is deleted and then immediately re-displayed, thus saving computational resources. If the first device has not connected to the second network when the network sharing connection between the first and second devices is successfully disconnected, the first device can stop displaying the first icon in the status bar.

[0050] It should be noted that when the first device successfully disconnects the network sharing connection with the second device, the second network that the first device connects to can be either the second network it used before using the first network, or a newly discovered second network. For example, if the second network used before using the first network was network X, when the first device successfully disconnects the network sharing connection with the second device, the first device may reconnect to the original network X, or it may connect to a new network Y.

[0051] In some embodiments, the first device may disconnect the network sharing connection with the second device in response to a second operation performed by a user on the first device's screen. The second operation is an operation to disable network sharing. The second operation may trigger the first device to stop borrowing network resources from the second device.

[0052] Here, the first device can proactively disconnect the network sharing connection with the second device when it detects the second operation.

[0053] In other embodiments, the first device may disconnect the network sharing connection with the second device in response to receiving a disconnect message from the second device. The disconnect message indicates that network sharing is to be disabled.

[0054] Here, the second device can respond to a second operation by the user on its screen, proactively initiating a disconnection from the network sharing connection with the first device and sending the aforementioned disconnection message to the first device. Upon receiving the disconnection message, the first device can cooperate with the second device to disconnect the network sharing connection.

[0055] In the eighth possible implementation of the first aspect, after the first device and the second device establish a network sharing connection, it may further include: displaying a second icon. The second icon indicates that the first device is performing network sharing. In some scenarios, the second icon is also referred to as a network sharing icon.

[0056] In this case, after the first device disconnects its network sharing connection with the second device, it may also include: stopping the display of the second icon.

[0057] In this embodiment, when the first device and the second device successfully establish a network sharing connection, the first device can display a second icon in its status bar. When the first device and the second device successfully disconnect from the network sharing connection, the first device can also stop displaying the second icon in its status bar. This allows users to intuitively perceive whether the first device is currently sharing the network by checking the presence or absence of the second icon in its status bar, thus improving the user experience.

[0058] In the ninth possible implementation of the first aspect, the first device includes a system interface service and a first service. The system interface service is used to query traffic data and / or trigger the first icon refresh through the network speed service when the first device establishes a network sharing connection with the second device. The first service is used to establish or disconnect the network sharing connection with the second device.

[0059] In this scenario, after the first device disconnects from the network sharing connection with the second device, the process may further include: First, the first service sends a first network broadcast including a second broadcast message indicating that network sharing is disabled. Then, in response to receiving the first network broadcast and the first device connecting to the second network, the system interface service continues to run the network speed service.

[0060] In this embodiment, firstly, after the first device disconnects its network sharing connection with the second device via the first service, the first service can send a first network broadcast (or first broadcast) including a second broadcast message, which the system service interface can receive. The first service and the system service interface communicate the opening and closing status of the first network via broadcast (specifically, by transmitting the first network broadcast), which can improve information transmission speed. Secondly, after receiving the first network broadcast including the second broadcast message, if the first device is already connected to the second network, the system interface service can continue to run the network speed service. This allows the first device to continue using the network speed service to query traffic data and / or trigger the first icon refresh even after successfully disconnecting its network sharing connection with the second device. This avoids the situation of immediately turning the network speed service off and on again, helping to reduce data processing volume and improve data processing speed. It also helps to promptly refresh and display the network speed after disconnecting the network sharing connection when the first device connects to another available network.

[0061] Optionally, the network speed service may include one or more threads. For example, the network speed service may include a first thread for querying traffic data and a second thread for calculating network speed and triggering a refresh of the first icon. In some scenarios, the first thread may also be called a traffic query thread or a query thread. The second thread may also be called a network speed refresh thread or a refresh thread.

[0062] In a tenth possible implementation of the first aspect, after the first device disconnects the network sharing connection with the second device, the system interface service may further include: in response to receiving a first network broadcast and the first device not being connected to the second network, disabling the network speed service.

[0063] In this embodiment of the application, after receiving a first network broadcast including a second broadcast message, if the first device is not connected to the second network, the system interface service can directly shut down the network speed service, thus saving unnecessary computing resource consumption.

[0064] In the eleventh possible implementation of the first aspect, when the first device establishes a network sharing connection with the second device, if the first device has already connected to the second network at a first moment, the first device can disconnect the second network after the network sharing connection is successfully established.

[0065] In this embodiment of the application, when the first device and the second device establish a network sharing connection, if the first device is already connected to the second network at the first moment, the first device can disconnect the second network after the network sharing connection is successfully established, thus avoiding the consumption of computing resources required to maintain the network connection.

[0066] Optionally, in some application scenarios, when the first device establishes a network sharing connection with the second device, if the first device is already connected to the second network at the first moment, the first device can close its connection to the second network after the network sharing connection is successfully established, rather than disconnecting from the second network. That is to say, in some scenarios, when the first device switches from using the second network to using the first network (or the shared network), it can maintain its connection to the second network, but will not use the second network to transmit data.

[0067] In the twelfth possible implementation of the first aspect, if the network sharing connection between the first device and the second device is lost, a new connection is established with the second network.

[0068] In this embodiment of the application, when the network sharing connection between the first device and the second device is disconnected, the first device may attempt to re-establish a connection with the previously connected second network. For example, if the second network used by the first device before using the first network was network X, when the first device successfully disconnects the network sharing connection with the second device, the first device may attempt to re-establish a connection with network X.

[0069] Optionally, if the first device fails to re-establish a connection with the second network, the first device can connect to another second network. For example, if the first device was using network X before using the first network, and the first device successfully disconnects from the network sharing connection with the second device, the first device can attempt to re-establish a connection with network X. If the first device fails to re-establish a connection with network X, the first device can establish a connection with a newly discovered network Y, where network Y is the second network.

[0070] Secondly, embodiments of this application provide a network speed display device, which is applied to a first device and includes:

[0071] The communication module is used to establish a network sharing connection with the second device, and the network sharing connection is used to enable the first device to share the first network of the second device.

[0072] The display module is used to add a first icon to the status bar of the first device if the first device is not connected to the second network at the first moment. The second network includes a wireless local area network and / or a cellular network. The first icon indicates the network speed. The first moment is the moment when the network sharing connection is initiated.

[0073] The communication module is also used to obtain data on the traffic consumed by the first device from the second device according to a preset period;

[0074] The display module is also used to refresh the first icon based on traffic data.

[0075] As an embodiment of this application, the network speed display device can implement the method as described in any of the first aspects above.

[0076] Thirdly, embodiments of this application provide an electronic device, which includes a memory and a processor. The memory stores a computer program that can run on the processor, and the processor executes the computer program to implement the method as described in any of the first aspects above.

[0077] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method described in any of the first aspects above.

[0078] Fifthly, embodiments of this application provide a chip system including a processor coupled to a memory. The processor executes a computer program stored in the memory to implement the method described in any of the first aspects above. The chip system may be a single chip or a chip module composed of multiple chips.

[0079] Sixthly, embodiments of this application provide a computer program product that, when run on an electronic device, causes the electronic device to perform the method described in any of the first aspects above.

[0080] It is understood that the beneficial effects of the second to sixth aspects mentioned above can be found in the relevant descriptions in the first aspect mentioned above, and will not be repeated here. Attached Figure Description

[0081] Figure 1 This is a schematic diagram of a mobile phone interface;

[0082] Figure 2 This is a schematic diagram illustrating the effect of the network speed display on the network sharing device provided in this embodiment of the application;

[0083] Figure 3A schematic diagram of the hardware structure of the electronic device provided in the embodiments of this application;

[0084] Figure 4 The software system of the electronic device provided in the embodiments of this application;

[0085] Figure 5 A schematic diagram illustrating the process of the network supply device turning on and off the shared network, provided for an embodiment of this application;

[0086] Figure 6 This application provides a schematic diagram illustrating the process of enabling a shared network by a network-sharing device in an embodiment of the present application.

[0087] Figure 7 This application provides a schematic diagram illustrating the process by which a network-sharing device shuts down a shared network, as exemplified in this embodiment.

[0088] Figure 8 Another schematic diagram illustrating the process of a network-sharing device opening and closing a shared network, provided as an embodiment of this application;

[0089] Figure 9 This application provides another schematic diagram illustrating the process of a network sharing device opening and closing a shared network, as illustrated in an embodiment of the present application.

[0090] Figure 10 A timing diagram of a network speed display method provided in an embodiment of this application;

[0091] Figure 11 This is a timing diagram of the network speed display method;

[0092] Figure 12 This application provides a timing diagram for displaying network speed when the shared network is disconnected, as shown in the embodiments of this application.

[0093] Figure 13 This is a flowchart illustrating a method for displaying network speed according to an embodiment of this application. Detailed Implementation

[0094] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.

[0095] The following explains some concepts that may be involved in the embodiments of this application:

[0096] (1) Multiple: Unless otherwise specified, in the embodiments of this application, multiple refers to two or more.

[0097] (2) Multi-device collaboration technology: In the embodiments of this application, multi-device collaboration technology is a distributed technology applied to multiple electronic devices.

[0098] Multi-device collaboration technology can be applied between electronic devices of the same or different types. These electronic devices include, but are not limited to, mobile phones, tablets, laptops, large-screen devices (e.g., smart TVs, smart screens), personal computers (PCs), handheld computers, netbooks, personal digital assistants (PDAs), wearable electronic devices, in-vehicle devices, virtual reality devices, and so on.

[0099] Multi-device collaboration technology requires communication connections between devices. These connections can be wired or wireless. Wired solutions can include technologies such as USB On-The-Go (OTG). Wireless solutions can include Wireless Fidelity (Wi-Fi), Wi-Fi Direct, Bluetooth (BT), Near Field Communication (NFC), and Infrared (IR).

[0100] (3) Trust Ring: In this embodiment, when two or more electronic devices under the same account trust each other, the two or more electronic devices can form a trust ring. For example, two mobile phones of the same user, or mobile phones, tablets, laptops, etc. of the same user can form a trust ring through mutual trust between devices. It is understood that the name or terminology of the trust ring in this embodiment is not limited. For example, in some scenarios, the trust ring can also be referred to as a set of mutually trusted collaborative devices.

[0101] A trust ring consists of multiple electronic devices that log in to the same platform using the same account and password. Each electronic device in the trust ring can use multi-device collaboration technology to perform cross-system and cross-device collaboration, thereby achieving resource sharing and collaborative operation.

[0102] In this embodiment of the application, there can be a variety of different collaboration types among the electronic devices in the trust ring, such as: network sharing, multi-screen collaboration (including screen extension, screen mirroring and screen sharing), keyboard and mouse collaboration, call collaboration, call continuation collaboration, etc.

[0103] The following example, using any two electronic devices A and B in a trust loop, illustrates various types of collaboration.

[0104] Network sharing: Share the network of electronic device A with electronic device B, so that electronic device B can use the network of electronic device A.

[0105] Screen mirroring: Mirrors all content displayed on the screen of electronic device A onto the screen of electronic device B. The content displayed on electronic device B is identical to the content displayed on electronic device A, and changes as the content displayed on electronic device A changes.

[0106] Screen extension: The screen of electronic device B is used as a secondary screen for electronic device A. Electronic device A can transfer a portion of the content it needs to display to the secondary screen for display. The screens of electronic device A and electronic device B can display content together, thus extending the display capabilities of electronic device A.

[0107] Screen sharing: Projecting the user interface of electronic device A onto the screen of electronic device B for display, allowing users to interact with the user interface of electronic device A from within electronic device B, and transferring files from electronic device B to electronic device A by performing specific operations on electronic device B (e.g., dragging and dropping files from the user interface of electronic device B to the user interface of electronic device A), thus enabling cross-device operation and cross-device file transfer between electronic devices A and B. The user interface of electronic device A can be displayed in any area of ​​the screen of electronic device B, or it can be displayed full-screen.

[0108] Keyboard and mouse collaboration: Electronic device A and electronic device B can share each other's existing input devices, such as a mouse and keyboard. For example, electronic device A's input devices can be shared with electronic device B, and the shared input devices can be used for input on both electronic device A and electronic device B. Additionally, in keyboard and mouse sharing, file transfer can also be performed between electronic device A and electronic device B.

[0109] Seamless Collaboration: When a user is running an application on electronic device A, the interface of electronic device B can prompt the user to open the application running on electronic device A on electronic device B, thus transferring the user to electronic device B to continue the operation, such as watching a video or editing a document. For example, if a document application (such as a memo or Word document) is running on electronic device A, and the user is editing the document on electronic device A, when electronic device B is close to electronic device A, a prompt message is displayed on electronic device B. The user clicks the prompt message on electronic device B, and in response to the user's click, electronic device B opens the document application and displays the user's current editing position, thus allowing the user to continue editing on electronic device B.

[0110] Call coordination: When electronic device A receives an incoming voice or video call, the incoming call interface can be displayed simultaneously on electronic device B. In this way, the user can choose to answer or hang up the call on electronic device B.

[0111] Notification Collaboration: When electronic device A receives a notification message, the notification message can be displayed synchronously on electronic device B. It also allows users to perform operations such as replying to, deleting, and marking as read on the notification message on electronic device B.

[0112] (4) Cellular Network: In this embodiment, a cellular network is a mobile communication network system that divides a geographical area into many small areas, each called a "cell" or "cell". The architecture of cellular networks has undergone a transition from analog to digital, including different technical standards such as 2nd Generation Mobile Communication Technology (2G), 3rd Generation Mobile Communication Technology (3G), 4th Generation Mobile Communication Technology (4G), 5th Generation Mobile Communication Technology (5G), and 6th Generation Mobile Communication Technology (6G). Among these, 5G New Radio (NR) is one of the 5G standards. 4G Long Term Evolution (LTE) is one of the 4G standards.

[0113] (5) Wireless Local Area Networks (WLAN) and WiFi: In this embodiment, WLAN is a system that uses radio frequency (RF) technology to transmit data. This technology is used to make up for the shortcomings of wired local area networks and achieve the purpose of network extension.

[0114] WiFi is a wireless local area network based on the IEEE 802.11b standard, designed to improve interoperability between wireless network products based on the IEEE 802.11 standard. In other words, WiFi belongs to WLAN.

[0115] (6) System Service (SystemServer): In this embodiment, the system service is also commonly referred to as the system service process or the SystemServer process. SystemServer is a crucial process in the Android system; it is the core service process of the entire system. SystemServer is responsible for starting and managing various services in the system, including system-level services such as the WindowManagerServer (WMS), ActivityManagerService (AMS), and PackageManagerServer (PMS). These system-level services provide the core functions of the Android system, such as application management, interface display, and notification management. In other words, the stable operation of SystemServer is crucial to the normal operation of the entire system. In practice, SystemServer is usually always alive to ensure the effective operation of other services.

[0116] Electronic devices within a trust ring can share network access. If an electronic device in the trust ring does not use its own network for some reason, it can use the networks of other electronic devices in the trust ring. Reasons for not using its own network may include no network access, poor network connectivity, or the user not wanting to use the device's network.

[0117] To distinguish between the two, electronic devices that provide the network can be referred to as network-providing devices or second devices, and electronic devices that borrow the network can be referred to as network-borrowing devices or first devices.

[0118] In practical applications, when electronic devices are connected to WLAN or cellular networks, they can display the network speed on the interface. In this way, users can intuitively perceive whether the network of the electronic device is smooth or whether there is any abnormality through the network speed data displayed by the electronic device.

[0119] Taking mobile phones as an example, combined with Figure 1 The status bar 105 at the top of the phone's interface 101 can include a WiFi icon 102, a cellular network icon 103, and a network speed icon 104. Users can intuitively perceive the phone's current network speed through the network speed icon 104 displayed on the phone's interface 101. Figure 1 It can be seen that the phone is currently connected to both 4G and WiFi networks simultaneously, and is currently using the WiFi network for data transmission, with a current network speed of 298 kilobytes per second (kb / s). Figure 1 This is a schematic diagram of a mobile phone interface.

[0120] However, during the development process, researchers discovered that existing electronic devices can only calculate network speed by combining network data transmitted through WLAN and / or cellular networks. Furthermore, within a trust loop, when a device sharing the network from the provider device does not use either the WLAN or cellular network, it cannot obtain traffic data based on its existing software architecture. Therefore, it cannot calculate or display network speed. In other words, when a device using the shared network (or primary network) provided by the provider device cannot display its network speed, users cannot intuitively perceive the speed of the device using the shared network, and thus cannot detect any anomalies in the shared network.

[0121] In this scenario, as an example, if a user tries to access a website using a shared network device but the website cannot be opened, it is difficult for the user to determine whether the problem lies with the shared network or the website itself.

[0122] To address the issue of shared network devices in a trust loop failing to display network speed, this application proposes a feature where the shared network device displays a network speed icon upon establishing a network sharing connection with the network provider. The device then queries the network provider for real-time traffic data, determining its real-time network speed based on this data and updating the speed icon accordingly. This ensures the speed icon always displays the latest network speed. In this scenario, users can intuitively perceive the current network speed of the shared network device by checking its icon, thereby understanding whether the shared network is functioning smoothly or experiencing any anomalies, thus improving the user experience.

[0123] Optionally, when the network sharing device establishes a network sharing connection with the network supply device, in addition to displaying the network speed icon, it can also display a network sharing icon. The network sharing icon can indicate to the user that the current device (i.e., the device currently being operated) is using the network sharing function.

[0124] It is understandable that the network borrowing device and the network supply device are any two electronic devices in the trust loop.

[0125] Optionally, a network-borrowing device can borrow network from multiple network-supplying devices simultaneously.

[0126] Optionally, a network supply device can supply network to multiple network borrowing devices simultaneously.

[0127] Combination Figure 2 , Figure 2 This is a schematic diagram illustrating the effect of the network speed display on the network sharing device provided in this embodiment of the application.

[0128] It should be noted that, in order to distinguish the description, in the embodiments of this application, the thickness of the lines is used to distinguish the currently operating device (which can be simply referred to as the current device or the local machine) and other devices in the trust ring. Specifically, a bold icon can be used to distinguish the current device, and a non-bold icon can be used to distinguish other devices.

[0129] Understandably, this application does not specifically limit how the current device is distinguished from other devices in its embodiments. For example, in some application scenarios, a triangle icon can be used to represent the current device, and a circle icon can be used to represent other devices in the trust ring. Furthermore, in other application scenarios, colors can be used to distinguish the currently operating device from other devices in the trust ring; specifically, a gray icon can be used to distinguish the current device, and a white icon can be used to distinguish other devices.

[0130] like Figure 2 As shown, the current device's interface 201 includes a Bluetooth icon 202, a network sharing icon 203, a network speed icon 204, a Subscriber Identity Module (SIM) status icon 205, a first device ball 206, and a second device ball 207. The first device ball 206 displays the graphic identifier of device 1, and the second device ball 207 displays the graphic identifier of device 2. The first device ball 206 is a bold icon, indicating that the current device is device 1, while the second device ball 207 is a non-bold icon, indicating that device 2 is another device in the trust ring. Combined with... Figure 2 It can be seen that there are two electronic devices in the current trust ring, namely device 1 and device 2.

[0131] Figure 2 In the middle, the interface 201 also displays a prompt message 208 that "Network sharing service is in use", and an icon 209 indicating that network sharing is in use is displayed above the first device ball 206, indicating that device 1 is using the shared network of device 2.

[0132] Combination Figure 2 It can be observed that, in the network speed display method provided in this application embodiment, when device 1 (i.e., the network-borrowing device) uses the shared network of device 2 (i.e., the network-providing device), a network speed icon 204 can be displayed on the interface of device 1. In other words, the network-borrowing device can display the network speed. In this case, users can intuitively perceive whether the shared network used by the network-borrowing device is smooth or whether there is any abnormality by checking the network speed displayed by the network-borrowing device, which helps to improve the user experience.

[0133] Optionally, if the borrowing device and the providing device do not establish network sharing, but the borrowing device is already connected to a network, such as a WiFi or 5G network, then the borrowing device can display its network speed according to existing network speed display schemes. Understandably, if the borrowing device is not connected to any other network—specifically, neither a WLAN nor a cellular network—then it has no available bandwidth and will not display its network speed.

[0134] The following describes the usage scenarios of the embodiments of this application:

[0135] The embodiments of this application can be applied to scenarios where electronic devices in a trust ring display network speed.

[0136] The network speed display method provided in this application can be applied to electronic devices in a trust ring. These electronic devices can be terminals or servers. Terminals can be mobile phones, tablets, wearable devices, in-vehicle devices, augmented reality (AR) / virtual reality (VR) devices, laptops, ultra-mobile personal computers (UMPCs), netbooks, personal digital assistants (PDAs), etc. Wearable devices can be smartwatches or smart bracelets, etc. This application does not limit the specific devices described herein.

[0137] To better understand the embodiments of this application, a mobile phone is used as an example of an electronic device below, combined with... Figure 3 and Figure 4 The structure of the electronic device according to the embodiments of this application will be described.

[0138] Figure 3 A schematic diagram of the hardware structure of the electronic device is shown. (For example...) Figure 3 As shown, the electronic device may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a sensor module 180, a camera 193, a display screen 194 (also referred to as a screen), and a SIM card interface 195, etc.

[0139] The sensor module 180 may include a four-in-one (accelerometer, angular velocity meter, gyroscope, compass) motion sensor, a light sensor, a pressure sensor, a touch sensor, a temperature sensor, a proximity sensor, a 3D structured light sensor, and so on. Different sensors are used to sense different signals, allowing the processor 110 to perform calculations based on these signals to achieve different functions of the electronic device. For example, the four-in-one motion sensor can be used to determine the motion posture and orientation information of the electronic device; the touch sensor is used to sense touch information.

[0140] Processor 110 may include one or more processing units, such as: application processor (AP), modem processor, GPU, HWC, image signal processor (ISP), controller, memory, video codec, digital signal processor (DSP), baseband processor, and / or neural network processing unit (NPU). Different processing units may be independent devices or integrated into one or more processors. The controller may serve as the nerve center and command center of the electronic device. The controller can generate operation control signals based on instruction opcodes and timing signals to control instruction fetching and execution.

[0141] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to use the instruction or data again, it can retrieve it directly from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0142] The processor 110 can run the network speed display method provided in this application embodiment, so that when an electronic device in a trust ring uses the shared network of other devices, it can display network speed data in a timely manner, thereby improving the user experience. The processor 110 may include different devices. For example, when integrating a CPU and a GPU, the CPU and GPU can cooperate to execute the network speed display method provided in this application embodiment. For example, some algorithms in the network speed display method are executed by the CPU, and other algorithms are executed by the GPU to obtain faster processing efficiency.

[0143] It should be understood that, in practical applications, electronic devices may include more than Figure 3The number of components shown is not limited to the number of components illustrated in this application. The illustrated electronic device is merely an example, and the electronic device may have more or fewer components than those shown, may combine two or more components, or may have different component configurations. The various components shown in the figures may be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and / or application-specific integrated circuits.

[0144] Figure 3 The hardware structure of the electronic device has been introduced. The software system of the electronic device will now be described. The software system of the electronic device can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This application uses the Android system as an example to illustrate the software system of the electronic device.

[0145] Figure 4 The software system of the electronic device provided in the embodiments of this application. For example... Figure 4 As shown, the software system of an electronic device can adopt a layered architecture, with each layer having a clear role and division of labor. Layers communicate with each other through software interfaces.

[0146] 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 system libraries, and the kernel layer.

[0147] like Figure 4 As shown, the application layer can include a series of applications, such as settings, gallery, phone, SMS, and so on.

[0148] The application layer may also include a system user interface (SystemUI) service and a smart service interaction portal. In some embodiments, the system user interface service may also be located in the application framework layer.

[0149] The system interface service includes a system UI module and a network speed management module.

[0150] Optionally, SystemUI can be a single process, while the System UI module and the network speed management module can be two sub-processes within SystemUI.

[0151] The system UI module is primarily responsible for the interface display. For example, when the current device establishes network sharing with other devices in the trust ring, a network sharing icon can be displayed in the current device's status bar (see [link]). Figure 2 The network sharing icon (203) and the network speed icon (see [link]). Figure 2The network speed icon (204) and the message displayed on the current device's interface indicating that network sharing is in progress (see [link]). Figure 2 (See prompt message 208). For example, the network speed icon can be refreshed based on the real-time network speed determined by the network speed management module.

[0152] The network speed management module is primarily responsible for listening to broadcasts targeting various networks. For example, it can listen to the first network broadcast (also called the first broadcast) targeting a shared network, the second network broadcast (referred to as the second broadcast) targeting a WLAN network, and the third network broadcast (referred to as the third broadcast) targeting a cellular network. Based on the broadcasts it receives, the network speed management module can query traffic data from the corresponding modules, calculate the network speed, and send the calculated speed to the system UI module for interface refresh and display. Specifically, the first broadcast indicates whether network sharing is enabled; the second broadcast indicates whether a WLAN network connection is established; and the third broadcast indicates whether a cellular network connection is enabled.

[0153] As an example, when the network speed management module hears the first broadcast indicating that the shared network has been enabled, it can query the real-time traffic consumption data from the electronic device providing the shared network (i.e., the network provider) through the system service (SystemServer) and network sharing service in the application architecture layer, thereby calculating the network speed.

[0154] It should be noted that since SystemServer is responsible for starting and managing various services in the operating system, and SystemServer is usually always alive, the interaction between the network speed management module and the network sharing service is stable and reliable through SystemServer, which helps to ensure that electronic devices borrowing the network (i.e., network-borrowing devices) can display the network speed in a timely manner.

[0155] As another example, when the network speed management module detects a second and / or third broadcast, and the second and third broadcasts indicate that the use of cellular or WLAN networks has been enabled, the network speed management module can query real-time traffic data from the network data module at the kernel layer to calculate the network speed.

[0156] The smart service interaction portal includes a service trigger portal. Users can use this portal to enable or disable the network sharing connection between the borrowing device and the supplying device.

[0157] The application framework layer provides an Application Programming Interface (API) and programming framework for applications in the application layer. The application framework layer may include some predefined functions.

[0158] like Figure 4 As shown, the application framework layer may include SystemServer, Network Sharing Service, Service Status Management Module, Device Management Module, MagicLink Module, Access Networking Module, and Network Data Transmission Module.

[0159] SystemServer comprises a system service module and a data interaction module. The system service module can interact with other modules. For example, when the current electronic device establishes network sharing with other devices, the system service module can notify the application layer's system UI module to refresh the UI display and show the network sharing icon. The data interaction module can receive data or messages from other modules. For instance, the data interaction module can receive traffic query messages from the application layer's network speed management module and pass these messages to the system service module, which then queries the network sharing service for traffic data.

[0160] Optionally, the system service module and the data interaction module can be two sub-processes within SystemServer.

[0161] The network sharing service can communicate with the network sharing services of other devices. When an electronic device is a network-borrowing device, it can obtain traffic data from the network-providing device's network sharing service. When the current electronic device is a network-providing device, it can query the traffic data used by the network-borrowing device and return that traffic data to the network-borrowing device through the network sharing service.

[0162] The service status management module can manage the status of services in electronic devices. For example, it can manage the status of network sharing services. In practice, the status of network sharing services can include connected, connected, and disconnected. As an example, the service status management module can promptly remind the application-level system UI module to refresh the corresponding UI display content when the status of the network sharing service changes.

[0163] The device management module can manage the services of the electronic device itself and other devices in the trust ring. For example, when other devices come online, such as connecting to a WiFi network, turning on Bluetooth, or turning on NFC, the current electronic device can discover these online devices through the access networking module of the application framework layer. The services and their running status on other devices can be synchronized to the device management module of the current electronic device, thus enabling mutual management among the electronic devices in the trust ring.

[0164] MagicLink primarily enables connections between two electronic devices via wireless local area networks, such as WiFi or Bluetooth. MagicLink allows data transfer between the two connected devices.

[0165] The access networking module can include a near / far-field discovery module, a near / far-field connection module, and a near / far-field networking module. The near / far-field discovery module enables the current electronic device to discover other electronic devices in the near / far field. The near / far-field connection module enables the current electronic device to establish connections with other near / far-field electronic devices. The near / far-field networking module enables the current electronic device to network with other near / far-field electronic devices, for example, by establishing a trust ring.

[0166] The network data transmission module may include message transmission modules, file transmission modules, and audio / video transmission modules. The message transmission module can transmit messages between devices. For example, during the process of establishing a network sharing connection between a current device and other devices, the device borrowing the network can send its device-related information, such as its device name, to the device providing the network through the message transmission module. The file transmission module can transfer files between devices. The audio / video transmission module can transmit audio and video between devices.

[0167] Optionally, the application framework layer may also include a content provider, a phone manager, a resource manager, a notification manager, etc.

[0168] Content providers are used to store and retrieve data, making that data accessible to applications. They enable data sharing and interaction between different applications, providing a complete mechanism that allows one application to access data in another while ensuring the security of the accessed data. This data can include videos, images, audio, phone calls made and received, browsing history and bookmarks, phone books, etc.

[0169] A phone manager is used to provide communication functions for electronic devices. For example, it manages call status (including connection and disconnection).

[0170] The file explorer provides applications with various resources, such as localized strings, icons, images, layout files, video files, and more.

[0171] The notification manager allows applications to display notifications in the status bar. These notifications can be used to deliver informational messages and can disappear automatically after a short pause, requiring no user interaction. For example, the notification manager can be used to notify users of download completion or message alerts. The notification manager can also display notifications as icons or scrolling text in the top status bar, such as notifications from background applications, or as dialog boxes on the screen. Examples include displaying text messages in the status bar, emitting sounds, vibrating the device, and flashing indicator lights.

[0172] The Android Runtime consists of core libraries and a virtual machine. The Android Runtime is responsible for the scheduling and management of the Android system.

[0173] The core library consists of two parts: one part is the functionalities that need to be called by the Java language, and the other part is the Android core library.

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

[0175] System libraries can include multiple functional modules. For example: surface manager, 3D graphics processing library (e.g., OpenGL ES), 2D graphics engine (e.g., SGL), media libraries, etc.

[0176] The Surface Manager is used to manage the display subsystem and provides the blending of two-dimensional and three-dimensional layers for multiple applications.

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

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

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

[0180] The kernel layer is the layer between hardware and software. The kernel layer includes at least display drivers, camera drivers, audio drivers, and sensor drivers.

[0181] like Figure 4As shown, the kernel layer may also include a distribution gateway service, a network daemon (Netd), a network module, and a network data module.

[0182] Network modules may include peer-to-peer (P2P) networks, cellular networks (e.g., LTE networks, NR networks), WLAN networks (e.g., WiFi), etc.

[0183] The network data module can detect network data transmitted by WLAN networks and / or cellular networks, and obtain the traffic data consumed through WLAN networks and the traffic data consumed through cellular networks.

[0184] Because each electronic device can function as a network provider in some scenarios and a network borrower in others, and the structure and interaction process differ between these two scenarios, the following discussion will combine... Figure 4 This further elaborates on the situation of electronic devices in different scenarios.

[0185] (1) Application scenario 1: Electronic devices as network supply devices.

[0186] Firstly, the network supply device can display network speed in real time. Specifically, the electronic device acting as the network supply device can query real-time traffic consumption data from the network data module at the kernel layer through the network speed management module at the application layer, and calculate the network speed based on the retrieved traffic data. Furthermore, the network speed management module can send the calculated network speed to the system UI module at the application layer. Thus, the system UI module can display the network speed icon in the status bar of the electronic device (see...). Figure 2 Refresh the network speed icon (204) in the image.

[0187] Secondly, the network provider can assist the network borrower in displaying real-time network speed. For example, the electronic device acting as the network provider can receive a traffic acquisition request from the network borrower 1 through the network sharing service. After receiving the request, it can obtain the traffic data for the network borrower 1 from the network module through MagicLink, the distribution gateway service, Netd, and the network module, layer by layer. Then, it can reversely return the acquired traffic data to the network sharing service through the network module, Netd, the distribution gateway service, and MagicLink. Finally, the electronic device acting as the network provider can send the traffic data for the network borrower 1 to the network borrower 1 through the network sharing service. In this case, the network borrower 1 can calculate the real-time network speed based on the traffic data sent by the network provider and display the speed.

[0188] Understandably, a network provider can offer a shared network to one network borrower or to multiple network borrowers simultaneously. In practice, the network provider can assign a corresponding port to each connected network borrower. Thus, for each network borrower, the network module can count the traffic on that port and use that traffic as the traffic shared with that network borrower. For example, if the network provider assigns port 8088 to network borrower 1, then when network borrower 1 requests traffic data from the network provider, the network provider can send the counted traffic from port 8088 to network borrower 1.

[0189] It is understandable that each electronic device in the trust ring can act as both a network-borrowing device and a network-providing device when it has a network connection, and can only act as a network-borrowing device when it does not have a network connection.

[0190] (2) Application scenario 2: Electronic devices as network sharing devices.

[0191] In application scenario 2, there may be three stages: Stage 1, the electronic device that is borrowing the network is not connected to the shared network; Stage 2, the electronic device that is borrowing the network is using the shared network of the network provider; Stage 3, the electronic device that is borrowing the network stops using the shared network of the network provider.

[0192] Phase 1: Electronic devices used for network sharing are not connected to the shared network.

[0193] In Phase 1, if the device borrowing the network is neither connected to a cellular network nor a WLAN network, the device's interface will not display the network speed.

[0194] If the device is connected to a cellular network and / or WLAN, it can query real-time data consumption from the kernel-level network data module via the application-layer network speed management module. Based on this data, it can calculate its network speed. Furthermore, the network speed management module can send the calculated speed to the application-layer system UI module. This allows the system UI module to view the network speed icon displayed in the device's status bar (see [link to system UI module]). Figure 2 The network speed icon (204) in the image has been updated.

[0195] Phase 2: Electronic devices acting as borrowers are using the shared network provided by the network provider.

[0196] In Phase 2, the network-borrowing device can send a first query message to the data interaction module in SystemServer via the network speed management module in SystemUI. This first query message queries the network traffic consumed by the borrowing device. Upon receiving the first query message, the data interaction module can send a second query message to the network sharing service of the borrowing device via the system service module in SystemServer. Upon receiving the second query message, the network sharing service of the borrowing device can send a third query message to the network sharing service of the supplying device. Thus, upon receiving the third query message, the supplying device can obtain the network traffic data consumed by the borrowing device and return this data to the borrowing device via its network sharing service. Finally, the network speed management module in the borrowing device can calculate the network speed based on the traffic data obtained from the supplying device and notify the SystemUI module to adjust the network speed icon displayed in the status bar of the borrowing device based on this speed (see [link to system UI]). Figure 2 The network speed icon (204) in the image has been updated.

[0197] It is understood that the first query message, the second query information, and the third query message are information transmitted between different modules for querying the current device's traffic consumption. The first query message, the second query information, and the third query message may have the same content or different content. This application embodiment does not limit the specific content of the first query message, the second query information, and the third query message.

[0198] Phase 3: Electronic devices that act as borrowers cease using the shared network provided by the network provider.

[0199] In Phase 3, if the device that borrowed the network did not connect to either the cellular network or the WLAN network when it finished using the shared network, the device's interface will not display the network speed.

[0200] If the device using the shared network has already connected to a cellular network and / or WLAN network when it ends its use of the shared network, the device can query the real-time data consumption from the network data module in the kernel layer through the network speed management module in the application layer. Based on this data, the device can calculate its network speed. Furthermore, the network speed management module can send the calculated network speed to the system UI module in the application layer. This allows the system UI module to view the network speed icon displayed in the device's status bar (see [link to documentation]). Figure 2 The network speed icon (204) in the image has been updated.

[0201] In some embodiments, if a user initiates a network sharing connection through a service trigger entry at the application layer when the borrowing device has a network connection, the borrowing device may not establish a network sharing connection with the providing device. In this case, as an example, if the borrowing device is currently connected to a WiFi network, and the system detects that the user has initiated an operation to provide network sharing to the borrowing device, the borrowing device may display a prompt message indicating that it will not initiate a network sharing connection, such as "The current device is already connected to the network and network sharing is not supported".

[0202] In other embodiments, when the borrowing device has a network connection, if a user initiates a network sharing connection through a service trigger entry at the application layer, the borrowing device can also respond to the user's trigger operation and establish a network sharing connection with the providing device. For example, if the borrowing device is currently connected to a 5G network, and it detects that a user has initiated an operation to provide shared network access to the borrowing device, the borrowing device can disconnect from the 5G network or stop using the 5G network, establish a network sharing connection with the providing device, and use the shared network provided by the providing device.

[0203] Optionally, if the device using the network has internet access and prioritizes using the shared network provided by the device providing the network, then if the network sharing connection is lost and the device stops using the shared network, the device can reuse its original network, such as the WiFi network that was previously disabled due to accessing the shared network.

[0204] Before explaining the network speed display method of this application, let's first consider the following... Figures 5 to 9 This application describes the process of enabling and disabling a shared network as provided in its embodiments.

[0205] See Figure 5 , Figure 5 This is a schematic diagram illustrating the process of the network supply device turning on and off the shared network, provided for an embodiment of this application.

[0206] like Figure 5 As shown in (a), the status bar of the current device's interface 501 includes a Bluetooth icon 51a, a network speed icon 51b, a WiFi icon 51c, and a SIM card icon 51d. The SIM card icon 51d indicates that no SIM card is inserted into the current device. The WiFi icon 51c indicates that the current device is connected to a WiFi network. The network speed icon 51b indicates that the current device's network speed is 0.9 kbps. The current device can respond to the user's downward swipe on interface 501 in the direction indicated by the dashed arrow to enter the control center interface 502.

[0207] like Figure 5As shown in (b), the control center interface 502 includes a trust ring card 52a. Trust ring card 52a displays three device balls: device ball 52b corresponding to device 3, device ball 52c corresponding to device 2, and device ball 52d corresponding to device 1. Each device ball can display the corresponding device's graphic identifier. For example, device ball 52d displays the graphic identifier of device 1.

[0208] from Figure 5 As shown in (b), there are three electronic devices in the current trust ring: Device 1, Device 2, and Device 3. Device sphere 52b is a bold icon, while Device spheres 52c and 52d are non-bold icons, indicating that the current device is Device 3, and Device 1 and Device 2 are the other devices in the trust ring. It should be noted that the current device, i.e., Device 3, can access the network module (see [link]). Figure 4 The access networking module in the application framework layer discovers other devices, such as device 1 and device 2.

[0209] The current device, namely device 3, can respond to the user clicking on device ball 52b to enter the trust ring interface 503.

[0210] like Figure 5 As shown in (c), the trust ring interface 503 of the current device displays three operable device balls: device ball 504 corresponding to device 3, device ball 505 corresponding to device 2, and device ball 506 corresponding to device 1. The trust ring interface 503 also displays a prompt message 53a: "Click on the device ball and select the required service to complete the process."

[0211] like Figure 5 As shown in (c) to (d), the current device can respond to the user's click on the device ball 504 corresponding to device 3 (that is, the current device), pop up window 507, and display the prompt message 53b "Drag and drop the service to other devices to complete the transfer" in the trust ring interface 503.

[0212] like Figure 5 As shown in (d), window 507 includes screen sharing control 57a and network sharing control 57b.

[0213] like Figure 5 As shown in (d) to (e), the current device can respond to the user's click on the network sharing control 57b, display window 508, and display the prompt message 53c "Click the device ball, select the required service to complete the flow" in the trust ring interface 503.

[0214] like Figure 5As shown in (e) to (g), the current device can respond to the user dragging window 508 into device sphere 506 along the direction of the dashed arrow, first displaying icon 509 above device sphere 506 (see...). Figure 5 In (f)), icon 509 indicates that a network sharing connection is being established; when a network sharing connection is successfully established, icon 510 is displayed above device sphere 506 (see [f]). Figure 5 In the (g) section, icon 510 indicates that a network sharing connection has been successfully established. Icon 510 displays a network sharing icon and a graphic identifier for device 3, indicating that device 3's network is currently being shared with device 1. In other words, device 3 is the network provider, and device 1 is the network borrower.

[0215] like Figure 5 As shown in (g), when the current device (i.e., device 3) successfully establishes a network sharing connection with device 1, the status bar at the top of the trust ring interface 503 of the current device also displays a network sharing icon 51e, and the trust ring interface 503 can also display a prompt message 53d that "the 'Network Sharing' service is in use".

[0216] like Figure 5 As shown in (g) to (h), the current device can respond to the user's operation of dragging icon 510 into device ball 504 along the direction of the dashed arrow, disconnect the network sharing connection with device 1, and stop displaying network sharing icon 51e in trust ring interface 503.

[0217] like Figure 5 As shown in (h), after the current device, namely device 3, disconnects the network sharing connection with device 1, the network sharing icon 51e is no longer displayed in the status bar at the top of the trust ring interface 503 of the current device. The trust ring interface 503 can also display the prompt message 53e: "Click the device ball and select the required service to complete the transfer".

[0218] Combination Figure 5 It can be observed that network supply devices, such as device 3, can actively enable network sharing (see...). Figure 5 (a) through (g) in the above, you can also actively shut down the shared network (see [reference]). Figure 5 (g) to (h) in the middle. This is understandable. Figure 5 The operation method shown for enabling or disabling network sharing by the network supply device is only one example. Other operation methods for enabling or disabling network sharing by the network supply device are not specified here. Figure 5 It can also be observed that the network supply device can always display the network speed normally because it is always connected to the WiFi network.

[0219] The following is for reference. Figure 6and Figure 7 , Figure 6 This is a schematic diagram illustrating the process of enabling a shared network by a network-borrowing device, as provided in an embodiment of this application. Figure 7 This is a schematic diagram illustrating the process of a network-sharing device shutting down a shared network, as provided in an embodiment of this application.

[0220] like Figure 6 As shown in (a), the status bar of the current device's interface 601 (or icon interface) includes an NFC icon 61a, a Bluetooth icon 61b, and a SIM card icon 61c. The SIM card icon 61c indicates that no SIM card is inserted into the current device. The status bar of interface 601 shows that the current device is neither connected to a WLAN network nor a cellular network. Interface 601 also displays application icons for several applications, such as the WeChat application icon and the phone application icon.

[0221] The current device can respond to the user clicking the application icon of the settings application and enter the settings interface 602.

[0222] like Figure 6 As shown in (b), the settings interface 602 includes a variety of controls that can trigger network connection. For example, it may include a WLAN settings control 62a that triggers connection to a WLAN network and a mobile network settings control 62b that triggers connection to a mobile network.

[0223] The current device can respond to the user's click on the WLAN settings control 62a in the settings interface 602 and enter the WLAN settings interface 603.

[0224] like Figure 6 As shown in (c), the WLAN settings interface 603 displays two shared network options, namely network option 604 for device 3 and network option 605 for device 2.

[0225] like Figure 6 As shown in (c) to (e), the current device can respond to the user's click on network option 604 and establish a network sharing connection with device 3. During the process of establishing a network sharing connection between the current device and device 3, the current device can display a "Connecting..." message 64a below network option 604 (see [link]). Figure 6 (d)). When the current device and device 3 successfully establish a network sharing connection, the current device can display a "Connected" message 64b below network option 604 (see [link]). Figure 6 (e) in the middle.

[0226] like Figure 6As shown in (e), when the current device and device 3 successfully establish a network sharing connection, the status bar at the top of the WLAN settings interface 603 displays a network sharing icon 61d and a network speed icon 61e. At the same time, a floating prompt window 606 can also be displayed at the top of the WLAN settings interface 603, which prompts that the current device has entered the trust ring.

[0227] from Figure 6 As can be seen from (a) to (e) in this embodiment, when the current device (e.g., device 1) is neither connected to a WLAN network nor a cellular network, the current device can use the shared network of other devices (e.g., device 3) in the trust ring. During the process of using the shared network of other devices, the current device acts as a network borrower, and the current device can display the network speed, which helps the user intuitively perceive whether the shared network is working properly and whether there are any network anomalies.

[0228] Furthermore, such as Figure 6 As shown in (e), the current device can respond to the user's swipe up along the dashed arrow and return to interface 601 (or icon interface).

[0229] like Figure 6 As shown in (f) to (g), the current device can respond to the user's click on the WeChat icon 607 in interface 601 and enter interface 608. In the status bar at the top of interface 608, the network speed displayed by the network speed icon 61e has changed, specifically from 0k / s to 447k / s.

[0230] from Figure 6 As can be seen from (e) to (g) in this embodiment, when the current device (e.g., device 1) uses the shared network of other devices (e.g., device 3) in the trust ring, the network speed can be displayed in real time. That is to say, in this application, when the borrowing device uses the shared network of the providing device, the network speed can be displayed in real time.

[0231] from Figure 6 It can be observed that the device sharing the network, such as device 1, can enable network sharing through the settings application, and the device sharing the network can display the network speed in real time when using the shared network of other devices (such as device 3).

[0232] Figure 6 This explains how devices sharing a network can enable network sharing through a settings application. The following section will illustrate this. Figure 7 This explains how to disable network sharing on a device that is sharing a network connection through application settings.

[0233] like Figure 7As shown in (a), the WLAN settings interface 603 displays two network sharing options: network option 604 for device 3 and network option 605 for device 2. Below network option 604 for device 3, a "Connected" message 64b is displayed, and the status bar at the top of the WLAN settings interface 603 includes a network sharing icon 61d, indicating that the current device has established a network sharing connection with the network provider (i.e., device 3), and the current device is a network borrower.

[0234] The WLAN settings interface 603 also displays a list 609, which may include one or more selectable WLAN options, such as option 69a, option 69b, etc.

[0235] like Figure 7 As shown in (a) to (c), the current device can respond to the user's click on option 69a in list 609 and establish a network connection with the WLAN network corresponding to option 69a, specifically the WLAN network with the network name "8A network". This is understandable. Figure 7 The password input process before establishing a network connection with the WLAN network is omitted.

[0236] like Figure 7 As shown in (b), the status bar at the top of the WLAN settings interface 603 displays a network sharing icon 61d and a WiFi icon 61f. The WLAN settings interface 603 also displays a control 610, which shows information about the connected WLAN networks. The control 610 displays "8A Network" and "Connected". "8A Network" is the name of the connected WLAN network, and "Connected" indicates the connection status.

[0237] like Figure 7 As shown in (c), the status bar at the top of the WLAN settings interface 603 displays a WiFi icon 61f and a network speed icon 61e, but no network sharing icon. In the WLAN settings interface 603, the "Connected" status in control 610 has been updated to "Connected (Internet access available)". The bottom of the WLAN settings interface 603 also displays the message "Network sharing has stopped, this machine is already connected to the network" 611.

[0238] from Figure 7 It can be seen that the current device can disable existing shared networks through the settings app. Specifically, the current device can disable shared networks when connecting to a new available network.

[0239] from Figure 7 It can also be found that, in this application, when the device connecting to an available WiFi network and disabling network sharing, the device can still display the network speed icon (see [link]). Figure 7 (c) shows the network speed icon 61e). That is to say, in this embodiment of the application, when the network-borrowing device switches from a shared network to other networks (e.g., cellular network and / or WLAN), the network-borrowing device can display the network speed in real time.

[0240] Figure 6 and Figure 7 This explains how devices sharing a network can enable and disable network sharing via a settings application. The following section will illustrate this. Figure 8 This section explains how devices sharing a network can turn the network on or off through the control center. Figure 8 This is a schematic diagram illustrating another process by which a network-sharing device turns on and off a shared network, as provided in an embodiment of this application.

[0241] like Figure 8 As shown in (a), the status bar at the top of the current device's interface 701 includes an NFC icon 71a, a Bluetooth icon 71b, and a SIM card icon 71c. The SIM card icon 71c indicates that no SIM card is inserted into the current device. From the status bar of interface 701, it can be seen that the current device is neither connected to a WLAN network nor a cellular network.

[0242] The current device can respond to the user's action of sliding down along the dotted arrow on interface 701 to enter the control center interface 702.

[0243] like Figure 8 As shown in (b), the control center interface 702 includes a trust ring card 703. The trust ring card 703 displays device balls 73a corresponding to device 1, 73b corresponding to device 2, and 73c corresponding to device 3. Each device ball can display the corresponding device's graphic identifier. For example, device ball 73a displays the graphic identifier of device 1.

[0244] from Figure 8 As shown in (b), there are three electronic devices in the current trust ring: Device 1, Device 2, and Device 3. Device sphere 73a is a bold icon, while Device spheres 73b and 73c are non-bold icons, indicating that the current device is Device 1, while Device 2 and Device 3 are other devices in the trust ring. It should be noted that the current device, i.e., Device 1, can access the network module (see...). Figure 4 The access networking module in the application framework layer discovers other devices, such as device 2 and device 3.

[0245] The current device, namely device 1, can respond to the user's click on device ball 73a and enter the trust ring interface 703.

[0246] like Figure 8As shown in (c), the trust ring interface 703 of the current device displays three operable device balls: device ball 704 corresponding to device 1, device ball 705 corresponding to device 2, and device ball 706 corresponding to device 3. The trust ring interface 703 also displays a prompt message 73a: "Click on the device ball and select the required service to complete the process."

[0247] like Figure 8 As shown in (c) to (d), the current device can respond to the user's click on the device ball 706 corresponding to device 3, displaying window 707 at the location of device ball 706, and displaying the prompt message 73b "Drag and drop the service to other devices to complete the transfer" below window 707. From Figure 8 As can be seen from (c) to (d), when the current device responds to the user's click on the device ball 706 corresponding to device 3, the positions of each device ball change. It is understood that this embodiment does not specifically limit the position of each device ball.

[0248] like Figure 8 As shown in (d), window 707 includes screen sharing control 77a and network sharing control 77b.

[0249] like Figure 8 As shown in (d) to (e), the current device can respond to the user's operation of clicking the network sharing control 77b, close the display window 707 and display the window 708 below the device ball 706, and display the prompt message 73c "Click the device ball, select the required service to complete the flow" in the trust ring interface 703.

[0250] like Figure 8 As shown in (e) to (g), the current device can respond to the user dragging window 708 into device sphere 704 along the direction of the dashed arrow, first displaying icon 709 above device sphere 704 (see...). Figure 8 In (f)), icon 709 indicates that a network sharing connection is being established; once the network sharing connection is successfully established, icon 710 will then be displayed above device sphere 704 (see [f]). Figure 8 In (g) of the diagram, icon 710 indicates that a network sharing connection has been successfully established. Icon 710 displays a network sharing icon and a graphic identifier for device 3, indicating that device 3's network is currently being shared with device 1.

[0251] In this case, the current device, namely device 1, is the network borrowing device, and device 3 is the network supply device.

[0252] like Figure 8As shown in (g), when the current device, namely device 1, successfully establishes a network sharing connection with device 3, the status bar of the trust ring interface 703 of the current device includes a network sharing icon 71d and a network speed icon 71e, and the trust ring interface 703 also includes a prompt message 73d that "the 'Network Sharing' service is in use".

[0253] like Figure 8 As shown in (g) to (h), the current device can disconnect the network sharing connection with device 3 in response to the user's operation of dragging icon 710 into device ball 706 along the direction of the dashed arrow.

[0254] from Figure 8 As can be seen from (g) to (h), when the current device, i.e., device 1, successfully disconnects the network sharing connection with device 3, the network sharing icon 71d and the network speed icon 71e are no longer displayed in the status bar at the top of the trust ring interface 703 of the current device. The trust ring interface 703 displays the prompt message 73e, "Click the device ball and select the required service to complete the process," and the bottom of the trust ring interface 703 displays the prompt message 73f, "Network sharing has stopped and the connection with 'device 3' has been disconnected."

[0255] Combination Figure 8 It can be observed that devices sharing the network, such as device 1, can enable and disable network sharing via the control center. From Figure 8 It can also be observed that when the device borrowing the network disconnects from the shared network of the device providing the network, if it is not connected to other networks, such as WiFi, the device borrowing the network will not have a network and will not display the network speed.

[0256] Continue to refer to Figure 9 , Figure 9 It describes how devices sharing the network can turn it on and off via the notification bar. Figure 9 This is a schematic diagram illustrating another process of opening and closing a shared network by a network-borrowing device, provided as an embodiment of this application.

[0257] like Figure 9 As shown in (a), the status bar at the top of the current device's interface 801 includes an NFC icon 81a, a Bluetooth icon 81b, a network sharing icon 81c, a network speed icon 81d, and a SIM card icon 81e. The SIM card icon 81e indicates that no SIM card is currently inserted into the device.

[0258] The status bar of interface 801 shows that the current device is neither connected to WLAN nor cellular network. The current device is a network-borrowing device and is using the shared network of other devices.

[0259] The device can now respond to the user's action of swiping down along the direction of the dotted arrow on interface 801 and enter notification interface 802.

[0260] like Figure 9 As shown in (b), the notification interface 802 includes message bars 803 and 804. Message bar 803 displays the message: Trust Ring is using "Network Sharing" from "Device 3". Message bar 804 displays the message: Trust Ring Network Sharing is using Device 3's WLAN network. Message bar 804 also includes... Control 84a.

[0261] like Figure 9 As shown in (b) to (c), the current device can respond to user clicks. The operation of control 84a displays "Disconnect" control 84b in the message bar.

[0262] like Figure 9 As shown in (c) to (d), the current device can respond to the user's click on the "Disconnect" control 84b, disconnect the network sharing connection, end the display of the network sharing icon 81c and the network speed icon 81d, and display the "Reconnect" control 84c in the message bar 804. Figure 9 As shown in (d), the notification interface 802 also includes a message bar 805, which displays the message: Trust ring ends using "network sharing".

[0263] Understandably, the current device can also respond to the user's further click on the "Reconnect" control 84c to re-establish the network sharing connection, for example, to re-establish the network sharing connection with device 3 (not shown in the figure).

[0264] Understandable. Figures 6 to 9 The illustrated methods for enabling or disabling network sharing on the network-sharing device are just examples. The network-sharing device may also have other methods for enabling or disabling network sharing. For example, the network-sharing device may also respond to the user's three-finger swipe up on the desktop interface or the interface of an application (such as WeChat) to enter the trust ring interface, thereby enabling or disabling network sharing. No specific limitations are made here.

[0265] The following section, in conjunction with the figures shown above, illustrates the specific interaction process between various structures within the electronic device system during the implementation of the network speed display method of this application.

[0266] in, Figure 10 This is a timing diagram of a network speed display method provided in an embodiment of this application. Combined with... Figure 4It is understood that electronic devices can interact with SystemServer (specifically the system service module and data interaction module in SystemServer) at the application layer, SystemUI (specifically the system UI module and network speed management module in SystemUI) at the application framework layer, and the network sharing service at the application framework layer to obtain the traffic data consumed by the borrowing device from the network provider when using the shared network of other devices (network provider devices). Based on the traffic data display, the real-time network speed can be displayed, so that users can intuitively perceive whether the shared network used by the borrowing device is smooth or whether there is any abnormality.

[0267] Figure 10 The timing diagram of the network speed display method shown can include at least the following steps:

[0268] Step 901: The first network sharing service responds to the user's operation to enable network sharing and establishes a network sharing connection with the second network sharing service.

[0269] The first network sharing service (or the first service) is the network sharing service for the network-borrowing equipment. The second network sharing service is the network sharing service for the network-providing equipment.

[0270] The network borrowing device and the network supply device can be any two electronic devices in the trust ring. The structure of each electronic device in the trust ring can be seen in [example...]. Figure 3 and Figure 4 The electronic device shown.

[0271] Enabling network sharing, as mentioned above, also means enabling a shared network. A shared network is a network shared by the network provider device with the network borrower device. In some scenarios, the shared network can also be referred to as the primary network.

[0272] In some scenarios, initiating network sharing can also be referred to as the first operation. Here, the device borrowing the network can proactively initiate a network sharing connection with the device providing the network upon detecting the first operation.

[0273] For example, the steps to enable network sharing can be found in [link to documentation]. Figure 6 The operation of clicking the network option 604 shown in (c) can be found here, or see [link to relevant documentation]. Figure 8 The operation shown in (e) involves dragging window 708 into device sphere 704 along the direction of the dashed arrow. Alternatively, see [link to relevant documentation]. Figure 9 The operation of clicking the "Reconnect" control 84c in the message bar 804, as shown in (d) in the diagram, will not be elaborated here.

[0274] It is understandable that the network sharing being triggered by the borrowing device is only one example; in some embodiments, the network sharing can also be triggered by the providing device (see [link to example]). Figure 5 Specifically, the second network sharing service can also respond to the user's operation of enabling network sharing on the second device and actively establish a network sharing connection with the first network sharing service of the first device.

[0275] In this embodiment, the network sharing device and the network sharing device are specifically the first network sharing service in the network sharing device and the second network sharing service in the network sharing device. The network sharing connection can be established by two electronic devices in a trust ring disclosed in related technologies, which will not be elaborated here.

[0276] In practice, after the first network sharing service of the network borrowing device and the second network sharing service of the network supplying device establish a network sharing connection, the first network sharing service can send a message to the system service module in SystemServer so that the system service module can know that the first network sharing service and the second network sharing service have successfully established a network sharing connection.

[0277] Step 902: In response to the successful establishment of a network sharing connection between the first network sharing service and the second network sharing service, the system service module instructs the system UI module to refresh the UI display related to the successful establishment of the network sharing connection.

[0278] Here, the system service module can send a first notification message to the system UI module, wherein the first notification message instructs the system UI module to refresh the UI display related to the successful establishment of the network sharing connection. It is understood that this application embodiment does not specifically limit the content and implementation form of the first notification message. As an example, the first notification message can be "flash-001".

[0279] Step 903: The system UI module refreshes and displays UI information related to the successful establishment of a network sharing connection.

[0280] The UI display related to refreshing and successfully establishing a network sharing connection may include: displaying the network sharing icon, displaying the network speed icon, and displaying a message indicating a successful network sharing connection. In practice, the system UI module can display the network sharing icon and network speed icon in the status bar at the top of the device sharing the network, and display a message indicating a successful network sharing connection on the currently active interface. Understandably, when the first and second network sharing services successfully establish a network sharing connection, the network speed displayed on the network speed icon is usually 0 kbps.

[0281] The network sharing icon shown can be found in [the documentation / reference]. Figure 2 The network sharing icon 203 in the middle Figure 6The network sharing icon in 61d, Figure 8 The network sharing icon in 71d, or Figure 9 The network sharing icon in 81c.

[0282] The displayed network speed icon can be found in [link / reference]. Figure 6 The network speed icon in the 61e Figure 8 The network speed icon in the image is 71e, or... Figure 9 The network speed icon in the image is 81d.

[0283] The message indicating a successful network sharing connection can be found in [link / reference]. Figure 6 The prompt message 64b shown in (e) is... Figure 8 The prompt message 73d shown in (g) is... Figure 9 The message bar 803 is shown in (c) in the image.

[0284] Optionally, the device can switch from its existing network (or original network) to the shared network when it has its own network, such as being connected to WLAN or cellular network, or when it does not have its own network.

[0285] Optionally, when a device switches from its original network to a shared network, before step 903, the device can first stop using or disconnect from the original network and connect to the shared network. For example, if device 1 was originally connected to a WiFi network, specifically a personal hotspot shared by device 2, when a user performs an operation to enable network sharing on device 1, device 1 can respond to the user's operation, establish a network sharing connection with the user-selected device 3, and stop using the original network, i.e., the personal hotspot network shared by device 2. It should be noted that the personal hotspot network is a WiFi network, which is different from the shared network mentioned in this application. The shared network mentioned in this application is the network shared by the network provider device to the device borrowing the network when establishing a network sharing connection. The network provider device and the device borrowing the network are any two electronic devices in the trust ring.

[0286] Step 904: The system UI module instructs the network speed management module to perform initialization related to network sharing.

[0287] Here, the system UI module can send a second notification message to the network speed management module, wherein the second notification message instructs the network speed management module to perform initialization operations related to network sharing. It is understood that this embodiment does not specifically limit the content of the second notification message. As an example, the second notification message can be "network sharing initialization".

[0288] It is understood that the present application embodiments do not limit the execution order of steps 903 and 904.

[0289] Step 905: The network speed management module performs initialization related to network sharing.

[0290] Here, the initialization content related to network sharing may include, but is not limited to, the following three items:

[0291] The first aspect involves enabling listening to broadcasts targeting a first network (or shared network) (which can be simply referred to as first network broadcast or first broadcast). The first network broadcast is used to announce the on / off status of the first network. The content broadcast by the first network broadcast may include a first broadcast message or a second broadcast message. The first broadcast message indicates that network sharing is enabled. The second broadcast message indicates that network sharing is disabled. It is understood that the specific content of the first and second broadcast messages is not specifically limited in this embodiment. As an example, the first broadcast message can be "on," indicating that network sharing is enabled, and the second broadcast message can be "0," indicating that network sharing is disabled.

[0292] The second step is to enable the thread related to network speed display in network sharing scenarios (or the first network speed service). Here, the threads related to network speed display in network sharing scenarios can include a first traffic query thread (which can be simply called the first query thread) and a first network speed refresh thread (which can be simply called the first refresh thread). The query thread is responsible for querying the real-time traffic consumption from other modules. The refresh thread is responsible for calculating the real-time network speed based on the real-time traffic consumption and triggering a refresh of the network speed icon.

[0293] Optionally, the first query thread and the first refresh thread can be implemented as the same thread or as two separate threads. When the first query thread and the first refresh thread are implemented as two separate threads, each thread has a simple task, low computational complexity, and is easy to maintain.

[0294] The third step is to initialize the content provider (see...). Figure 4 The content provider is part of the application framework layer. The content provider enables data sharing and interaction between different applications, ensuring the security of the accessed data when one application accesses data from another.

[0295] Step 906: In response to the second network sharing service transmitting network data to the network-borrowing device, the first network sharing service sends a first network broadcast.

[0296] The content broadcast in the first network broadcast (or first broadcast) can be either a first broadcast message or a second broadcast message. The first broadcast message indicates that network sharing is enabled, that is, that is, that the shared network provided by the network provider is enabled. The second broadcast message indicates that network sharing is disabled, that is, that is, that the shared network provided by the network provider is disabled.

[0297] The first network sharing service can send the first network broadcast only to the network speed management module, or it can send the first network broadcast to other modules at the same time; no specific limitation is made here.

[0298] Understandably, in step 906, the content broadcast by the first network broadcast is the first broadcast message.

[0299] In practice, network supply equipment can be connected via MagicLink (see...) Figure 4 MagicLink, a component of the application framework layer, transmits network data to devices using the network.

[0300] Here, the first network sharing service sends a first network broadcast when the network provider starts transmitting network data to the network borrower. This can prevent the network speed management module from starting network speed queries too early, thus helping to save unnecessary computing resource consumption.

[0301] Step 907: Upon receiving the first network broadcast, the network speed management module determines whether network sharing has been enabled.

[0302] Here, since the network speed management module has already started listening to the first network broadcast during the initialization process in step 905, it can receive the first network broadcast when the first network sharing service sends it. Based on the content of the first network broadcast, the module can determine whether the current device (the device borrowing the network) has enabled network sharing with other devices. Since the content broadcast in step 906 is a first broadcast message, the network speed management module can determine that network sharing has been enabled when it receives the first network broadcast in step 907.

[0303] In step 908, the network speed management module, in response to the enabled network sharing, sends information to the data interaction module to query the real-time traffic consumption.

[0304] For ease of description, the information sent by the network speed management module to the data interaction module to query the real-time traffic consumption can be referred to as the first query information.

[0305] In practice, the network speed management module can send a first query message to the data interaction module through a first query thread to query the real-time traffic consumption. The first query message is used to query the current device's real-time traffic consumption. It is understood that the specific content of the first query message is not limited in this embodiment. Optionally, the network speed management module can send the first query message to the data interaction module at a preset interval, such as 3 seconds, to obtain traffic data at various times.

[0306] Here, since the network speed management module has already initialized the first query thread, the first refresh thread, and the content provider during the initialization process in step 905, the network speed management module can use the content provider to enable the first query thread to send the first query information to the data interaction module in order to query the real-time traffic consumed by the current device (the device borrowing the network).

[0307] In step 909, the data interaction module responds to the first query information from the network speed management module and passes the query task to the system service module.

[0308] In some embodiments, the data interaction module can directly pass the first query information to the system service module to realize the transfer of the query task to the system service module.

[0309] In other embodiments, the data interaction module can parse the first query information and then pass the parsed content to the system service module to realize the transfer of the query task to the system service module.

[0310] Here, the data interaction module can use the information transmission methods between modules in SystemServer disclosed in related technologies to pass the query task to the system service module, which will not be elaborated here.

[0311] In step 910, the system service module responds to the query task by sending information for querying traffic to the first network sharing service.

[0312] Here, for ease of description, the information sent to the first network sharing service for querying traffic can be referred to as the second query information.

[0313] Step 911: In response to the second query information, the first network sharing service sends information to the network supply device to query its own traffic.

[0314] Here, for ease of description, the information sent to the network-providing device for querying the traffic of the local device (current device or network-borrowing device) can be referred to as third query information or traffic acquisition request. It is understood that the embodiments of this application do not specifically limit the content of the third query information.

[0315] In practice, the first network sharing service can be achieved through the MagicLink of the network sharing device (see...). Figure 4 The MagicLink application framework layer sends the aforementioned third query information to the second network sharing service of the network supply device.

[0316] It should be noted that when the network supply device receives a traffic acquisition request from the network borrower device through the second network sharing service, it can do so through the network supply device's MagicLink (see...). Figure 4 MagicLink (application framework layer), distribution gateway service, Netd, network module (see...) Figure 4 The distribution gateway service (Netd, network module) in the middle kernel layer descends layer by layer to obtain the traffic data of the network module for the borrowing network device. Then, it reverses through the network module, Netd, distribution gateway service, and MagicLink to return the obtained traffic data to the second network sharing service. After that, the network providing device can send the traffic data for the borrowing network device to the borrowing network device through the second network sharing service.

[0317] Understandably, a network provider can offer a shared network to one network borrower or to multiple network borrowers simultaneously. In practice, the network provider can assign a corresponding port to each connected network borrower. Thus, for each network borrower, the network module can track the traffic on that port, which represents the traffic shared with that network borrower. For example, if the network provider assigns port 8088 to network borrower 1, when network borrower 1 sends a traffic acquisition request to the network provider, the network provider can return the traffic from port 8088 to network borrower 1.

[0318] In step 912, the first network sharing service responds to the traffic data returned by the second network sharing service and sends the traffic data to the system service module.

[0319] Step 913: Upon receiving the traffic data, the system service module sends the traffic data to the data interaction module.

[0320] Step 914: Upon receiving traffic data, the data interaction module sends the traffic data to the network speed management module.

[0321] Step 915: The network speed management module calculates the network speed based on the traffic data received multiple times and sends the network speed to the system UI module.

[0322] As an example, the network speed management module can calculate the network speed by dividing the difference between two consecutive received traffic data by the time interval between the two queries.

[0323] As another example, the network speed management module can first calculate the difference between each pair of received traffic data, divide the difference by the query time interval between the two traffic data, and finally determine the average of the multiple values ​​as the network speed.

[0324] It is understood that the embodiments of this application do not specifically limit the process of calculating network speed based on multiple traffic data.

[0325] Step 916: The system UI module responds to the network speed received from the network speed management module by refreshing the UI display.

[0326] Here, the system UI module responds to the network speed received from the network speed management module by refreshing and displaying the network speed icon.

[0327] The network speed icon can be found here. Figure 2 The network speed icon in the image is 204. Figure 6 The network speed icon in the 61e Figure 8 The network speed icon in the image is 71e, or... Figure 9 The network speed icon in the image is 81d.

[0328] from Figure 10 It can be observed that when a network-sharing device shares a network with a network-providing device, the borrowing device can obtain the real-time traffic consumption of the borrowing device from the network-providing device. Based on this obtained traffic, the borrowing device can calculate and display the real-time network speed. In this way, users can intuitively perceive whether the shared network used by the borrowing device is working smoothly or if there are any abnormalities by viewing the displayed network speed, which helps improve the user experience.

[0329] Figure 10 The timing of the network speed display method shown is only an example.

[0330] In some embodiments, step 912 above can be replaced by: the first network sharing service, in response to the traffic data returned by the second network sharing service, directly sending the traffic data to the data interaction module. In this case, step 913 above can be omitted.

[0331] In some embodiments, step 913 above can be replaced by: the system service module, in response to receiving traffic data, directly sending the traffic data to the network speed management module. In this case, the operation of step 914 above can be omitted.

[0332] It should be noted that since SystemServer (or the SystemServer process) is responsible for starting and managing various services in the system, and SystemServer is usually always alive, the interaction between SystemUI and the first network sharing service can be achieved through SystemServer, which can ensure that the real-time traffic consumed by the current device (the device borrowing the network) is transmitted to the network speed management module in a timely manner, thereby ensuring that the device borrowing the network can display the network speed in a timely manner.

[0333] The following is combined Figure 11 Describe the specific process by which an electronic device (specifically, a network sharing device or a network providing device) displays network speed when it is not using a shared network with other devices, such as before establishing a network sharing connection with other devices. Figure 11 This is a timing diagram for the network speed display method.

[0334] Combination Figure 4 Electronic devices can interact with the network data module at the kernel layer through the SystemUI at the application layer (specifically, the System UI module and the network speed management module within the SystemUI), enabling the electronic device to display or not display the network speed when not using the shared network of other devices.

[0335] like Figure 11 As shown, the method for displaying network speed may include the following steps:

[0336] Step 1001: The network speed management module responds to the power-on of the network-borrowing device by performing power-on initialization.

[0337] The power-on initialization may include, but is not limited to: enabling listening to broadcasts to WLAN networks (which may be referred to as second network broadcast or second broadcast) and enabling listening to broadcasts to cellular networks (which may be referred to as third network broadcast or third broadcast).

[0338] The second network broadcast is used to announce the on / off status of the WLAN network. The content broadcast by the second network broadcast may include a third or fourth broadcast message. The third broadcast message indicates that the WLAN network is on. The fourth broadcast message indicates that the WLAN network is off.

[0339] The third network broadcast is used to announce the on / off status of the cellular network. The content broadcast by the third network broadcast may include either the fifth or sixth broadcast message. The fifth broadcast message indicates that the cellular network is on. The sixth broadcast message indicates that the cellular network is off.

[0340] It is understood that the embodiments of this application do not specifically limit the content of the third, fourth, fifth, and sixth broadcast messages.

[0341] Here, the network speed management module is enabled to listen to the second and third network broadcasts. This allows the network speed management module to receive the second network broadcast when the electronic device turns the WLAN network on or off, and to receive the third network broadcast when the electronic device turns the cellular network on or off.

[0342] Step 1002: In response to the user's operation of turning on the display of network speed and the current network data update, the network data module sends a notification message to the network speed management module indicating that the electronic device has network access.

[0343] In practice, users can enable network speed display on their electronic device screen by following the operating methods disclosed in relevant technologies; details will not be elaborated here. Optionally, the network data module can store settings related to enabling the network speed display function. Thus, when the network data module detects the use of a WLAN network and / or a cellular network, it triggers the display of network speed.

[0344] Here, the network data module can detect network data transmitted by WLAN network and / or cellular network. When network data transmitted by WLAN network and / or cellular network is detected, the network data module can send the above-mentioned notification message to the network speed management module.

[0345] It should be noted that if the electronic device is not using a shared network of other devices, and if the electronic device is currently neither connected to an available WLAN network nor an available cellular network, then in step 1002, the network data module will not perform the operation of sending a notification message to the network speed management module. In other words, the electronic device cannot display the network speed.

[0346] Step 1003: Upon receiving the notification message from the network data module, the network speed management module starts the thread related to network speed display.

[0347] Here, the network speed display-related thread in step 1003 specifically refers to the network speed display-related thread (second network speed service) in non-network sharing scenarios. The network speed display-related thread in non-network sharing scenarios can include a second traffic query thread (referred to as the second query thread) and a second network speed refresh thread (referred to as the second refresh thread). It is understandable that since the network speed management module will not start any network speed display-related threads when there is no network connection, the network speed display-related thread in non-network sharing scenarios is the same thread used when the electronic device is connected to a WLAN or cellular network.

[0348] Optionally, the second query thread and the first query thread can be the same thread. The second refresh thread and the aforementioned first refresh thread can also be the same thread. When the second query thread and the first query thread are implemented as the same thread, and the second refresh thread and the first refresh thread are implemented as the same thread, the number of threads in the network speed management module can be reduced to a certain extent, making it easier to maintain each thread.

[0349] Step 1004: The network speed management module sends traffic query information to the network data module to query the real-time traffic consumption.

[0350] Here, the network speed management module can send traffic query information to the network data module according to the aforementioned preset period in order to query the network data module for the real-time traffic consumption.

[0351] Step 1005: The network data module responds to the traffic query information received from the network speed management module and queries the real-time traffic consumption.

[0352] Here, the network data module can obtain the data traffic consumed by the WLAN network and / or cellular network. It should be noted that when the electronic device is connected to an available WLAN network and / or cellular network, the network data module can use the solutions disclosed in related technologies to query the real-time data traffic consumed by the electronic device, which will not be elaborated here.

[0353] Understandably, when an electronic device is not connected to an available WLAN or cellular network, the network data module cannot detect the real-time data usage of the device. In this situation, the network speed management module cannot find the data usage, cannot trigger a refresh of the network speed icon, and therefore stops displaying the network speed icon.

[0354] Step 1006: The network data module returns the retrieved traffic data to the network speed management module.

[0355] Step 1007: The network speed management module calculates the network speed based on the traffic data received multiple times and sends the network speed to the system UI module.

[0356] Here, the process of calculating network speed by the network speed management module can be referred to in step 915 above, and will not be repeated here.

[0357] Step 1008: The system UI module responds to the network speed received from the network speed management module by refreshing the UI display.

[0358] Here, the system UI module responds to the network speed received from the network speed management module by refreshing and displaying the network speed icon.

[0359] The network speed icon can be found here. Figure 1 The network speed icon in the image is 104.

[0360] from Figure 11 It can be observed that when an electronic device is not using a shared network from other devices, it can display the network speed if it is connected to an available WLAN network and / or cellular network; however, it will not display the network speed if it is neither connected to an available WLAN network nor a available cellular network.

[0361] Understandably, any electronic device in the trust ring can employ... Figure 11 The solution displays network speed.

[0362] In some alternative embodiments, the network-borrowing device can switch from the already connected network (or original network) to the shared network when the network-borrowing device itself has a network, such as being connected to a WLAN or a cellular network, or it can switch from the original network to the shared network when the network-borrowing device itself does not have a network.

[0363] It should be noted that when a device using a shared network switches from its original network to use a shared network while it already has a network connection, the original network channel is closed or disconnected during communication. The network data module (in conjunction with...) Figure 4 Network data module in the middle kernel layer Figure 11 The network data module in the middle cannot detect network data updates from the previously used WLAN network and / or cellular network, and therefore cannot access the network. Figure 11 The timing diagram shown illustrates a network speed display scheme that displays network speed, but this can only be achieved through... Figure 10 The network speed display scheme shown demonstrates the network speed display. In other words, devices using the shared network can display network speed even when not in use of the shared network. Figure 11 The shown network speed display scheme displays network speed. When switching to using a shared network, the speed can be displayed as follows: Figure 10 The shown network speed display scheme displays network speed. Figure 10 The network speed display scheme shown is the same as Figure 11 The displayed network speed display schemes are compatible with each other.

[0364] In some alternative embodiments, the network-borrowing device can only perform actions such as [the following is an example of an action] when the network-borrowing device itself has no network access, for example, when it is neither connected to a WLAN network nor a cellular network. Figure 10 The network speed display method is shown below. In this case, as an example, if the device is currently connected to a WiFi network and detects that the user has performed an operation to enable network sharing to the device, the device can display a prompt message indicating that network sharing is not being performed, such as "The current device is already connected to the network and network sharing is not supported".

[0365] The following further combines Figure 12 This paper describes a solution for displaying network speed when the device using the shared network disconnects from its own network, provided that the device already has its own network access.

[0366] in, Figure 12 This is a timing diagram showing network speed display when the shared network is disconnected, provided as an embodiment of this application. (Combined with...) Figure 4 It can be seen that the device that borrows the network can display the network speed when it disconnects from the shared network through the interaction between the SystemServer in the application layer (specifically the system service module and data interaction module in SystemServer), the SystemUI in the application framework layer (specifically the system UI module and network speed management module in SystemUI), the network sharing service in the application framework layer, and the network data module in the kernel layer.

[0367] like Figure 12 As shown, the method for displaying network speed may include the following steps:

[0368] Step 1101: In response to the user's operation to disable network sharing, the first network sharing service disconnects the network sharing connection from the second network sharing service.

[0369] For instructions on disabling network sharing, please refer to [link / reference]. Figure 7 The operation of option 69a in the click list 609 shown in (a) is as follows: Figure 8 (g) shows the operation of dragging icon 710 into device ball 706 along the direction of the dashed arrow. Figure 9 The operation of clicking the "Disconnect" control 84b shown in (c) is not described in detail here.

[0370] Understandably, the scenario of the network sharing being disabled by the borrowing device is merely an example; in some embodiments, the network sharing can also be disabled by the providing device (see [link to example]). Figure 5 Specifically, the second network sharing service can also respond to the user's operation of turning off network sharing on the second device and actively disconnect the network sharing connection from the first network sharing service on the first device.

[0371] In this embodiment, the network sharing device and the network sharing device are specifically the first network sharing service in the network sharing device and the second network sharing service in the network sharing device. The network sharing connection can be disconnected by disconnecting the network sharing connection between two electronic devices in the trust ring disclosed in related technologies, which will not be elaborated here.

[0372] Step 1102: In response to successfully disconnecting the network sharing connection with the second network sharing service, the first network sharing service sends a first network broadcast.

[0373] The content broadcast in the first network broadcast (or first broadcast) can be either a first broadcast message or a second broadcast message. The first broadcast message indicates that network sharing is enabled, that is, that is, that the shared network provided by the network provider is enabled. The second broadcast message indicates that network sharing is disabled, that is, that is, that the shared network provided by the network provider is disabled.

[0374] The first network sharing service can send the first network broadcast only to the network speed management module, or it can send the first network broadcast to other modules at the same time; no specific limitation is made here.

[0375] Understandably, in step 1102, the content broadcast by the first network broadcast is the second broadcast message.

[0376] In step 1103, the network speed management module responds to receiving the first network broadcast by performing recovery operations related to ending network sharing.

[0377] Here, recovery operations related to ending network sharing may include, but are not limited to, the following recovery operations:

[0378] To restore operation 1, disable listening to the first network broadcast. The content broadcast by the first network broadcast can include either a first broadcast message or a second broadcast message. The first broadcast message indicates that network sharing is enabled. The second broadcast message indicates that network sharing is disabled.

[0379] Recovery Operation 2: Close the thread related to network speed display (or the first network speed service) in network sharing scenarios. For details on the threads related to network speed display in network sharing scenarios, please refer to... Figure 10 Step 905 involves a first query thread and a first refresh thread. The query thread is responsible for querying other modules for real-time traffic consumption. The refresh thread is responsible for calculating the real-time network speed based on the real-time traffic consumption.

[0380] Optionally, in step 1103, if preset conditions are met, the network speed management module may not perform the above recovery operation 2. The preset conditions may include the following two sub-conditions:

[0381] Condition 1: Figure 11 The second query thread involved in step 1003 and Figure 10 The first query thread involved in step 905 is the same thread. Figure 11 The second refresh thread involved in step 1003 and Figure 10 The first refresh thread involved in step 905 is the same thread.

[0382] It should be noted that when the second query thread and the first query thread are the same thread, and the second refresh thread and the first refresh thread are the same thread, the number of threads in the network speed management module can be reduced to some extent, making it easier to maintain each thread. Additionally, because... Figure 11 The second query thread and the second refresh thread involved are usually native operating system threads. Developing on the basis of the original threads can reduce the development difficulty on the one hand, and ensure the stability of the system on the other.

[0383] Condition 2: The network speed management module is currently able to receive the second network broadcast and / or the third network broadcast, and the second network broadcast and / or the third network broadcast indicate that the network-borrowing device has enabled the WLAN network and / or cellular network.

[0384] The content broadcast by the second network broadcast may include a third or fourth broadcast message. The third broadcast message indicates that the WLAN network is enabled. The fourth broadcast message indicates that the WLAN network is disabled. The content broadcast by the third network broadcast may also include a fifth or sixth broadcast message. The fifth broadcast message indicates that the cellular network is enabled. The sixth broadcast message indicates that the cellular network is disabled.

[0385] As an example, if the network speed management module can receive the second network broadcast, and the content of the second network broadcast indicates that the WLAN network is enabled, then condition 2 is satisfied.

[0386] As another example, if the network speed management module can receive a third network broadcast, and the content of the third network broadcast indicates that the cellular network is enabled, then condition 2 is satisfied.

[0387] As another example, if the network speed management module can receive the second network broadcast and the third network broadcast, and at least one of the second network broadcast and the third network broadcast indicates that the corresponding network is enabled, then condition 2 is satisfied.

[0388] It should be noted that when the network sharing device disconnects, the network speed management module performs a recovery operation based on the current network connection status of the device. This avoids the situation where the threads related to network speed display are immediately closed and reopened, which helps to reduce the amount of data processing and improve the data processing speed. At the same time, it helps to display the network speed in a timely manner after the network sharing connection is disconnected, provided that the device itself has a network connection.

[0389] Understandably, if the network speed management module does not receive a broadcast indicating that the borrowing device has connected to the WLAN network and / or cellular network when performing the recovery operation, then the network speed management module can directly perform recovery operation 2.

[0390] In some optional embodiments, after the first network sharing service and the second network sharing service successfully disconnect the network sharing connection, before step 1103, the network-borrowing device may attempt to connect to the WLAN network and / or cellular network.

[0391] Optionally, after the first network sharing service and the second network sharing service successfully disconnect the network sharing connection, before step 1103, the borrowing device can attempt to re-establish a connection with the original network.

[0392] Optionally, after the first network sharing service and the second network sharing service successfully disconnect the network sharing connection, if the borrowing device fails to re-establish a connection with the original network before step 1103, it can connect to other discovered networks. For example, if the network the borrowing device was using before using the shared network was network X, and the borrowing device successfully disconnects the network sharing connection with the providing network device, the borrowing device can attempt to re-establish a connection with network X. If the borrowing device fails to re-establish a connection with network X, it can establish a connection with a newly discovered network Y, where network Y is a WLAN network and / or a cellular network.

[0393] Step 1104: The network speed management module notifies the system UI module to refresh the UI display related to disconnecting the network sharing connection.

[0394] Here, the network speed management module can send a third notification message to the system UI module, wherein the third notification message instructs the system UI module to refresh the UI display related to disconnecting the network sharing connection. It is understood that this application embodiment does not specifically limit the content and implementation form of the third notification message.

[0395] The UI display related to refreshing and disconnecting the network sharing connection may include: ending the display of the network sharing icon (see...). Figure 2 The network sharing icon 203 in the middle Figure 6 The network sharing icon in 61d, Figure 8 The network sharing icon in 71d, Figure 9 The network sharing icon in 81c), and the end display of the network speed icon (see [link]). Figure 7 The network speed icon in the 61e Figure 8 The network speed icon in 71e Figure 9 The network speed icon (81d) displays a message indicating that the network sharing connection has been disconnected (see [link]). Figure 7 The prompt message 611 shown in (c) is as follows. Figure 8 The prompt message 73f shown in (h) is... Figure 9 The message bar shown in (d) is 805, etc.

[0396] Here, the system UI module can stop displaying the network sharing icon and network speed icon in the status bar, and display a message indicating that the network sharing connection has been disconnected on the currently operating interface.

[0397] It is understood that the present application does not limit the execution order of steps 1103 and 1104 in the embodiments.

[0398] In some alternative implementations, steps 1102 to 1104 above can also be replaced with the following operations:

[0399] (1) The first network sharing service sends a fourth notification message to the system service module, indicating that the first network sharing service and the second network sharing service have successfully disconnected the network sharing connection.

[0400] (2) When the first network sharing service and the second network sharing service disconnect the network sharing connection, the system service module instructs the system UI module to refresh the UI display related to the disconnection of the network sharing connection.

[0401] Here, the system service module can send a fifth notification message to the system UI module to notify the system UI module to refresh the UI display related to disconnecting the network sharing connection. Specifically, the fifth notification message instructs the system UI module to refresh the UI display related to disconnecting the network sharing connection. It is understood that this application embodiment does not specifically limit the content and implementation form of the fifth notification message.

[0402] (3) The UI display related to refreshing the system UI module and disconnecting the network sharing connection.

[0403] Here, operation (3) can be referred to in step 1104 above, and will not be repeated here.

[0404] (4) The system UI module instructs the network speed management module to perform recovery operations related to ending network sharing.

[0405] Here, the system UI module can send a sixth notification message to the network speed management module, wherein the sixth notification message instructs the network speed management module to perform recovery operations related to ending network sharing. It is understood that this embodiment does not specifically limit the content of the sixth notification message.

[0406] (5) The network speed management module performs recovery operations related to ending network sharing.

[0407] Here, operation (5) can be referred to in step 1103 above, and will not be repeated here.

[0408] Step 1105: In response to detecting a network data update, the network data module sends a notification message to the network speed management module indicating that the current device has network access.

[0409] Step 1106: Upon receiving the notification message from the network data module, the network speed management module starts the thread related to network speed display.

[0410] Understandably, the aforementioned network speed management module starts the network speed display-related thread (or secondary network speed service) when the network speed display function of the borrowing device is enabled. If the network speed display function of the borrowing device is disabled, the network speed management module may not need to execute the operation of starting the network speed display-related thread. In this case, steps 1107 to 1111 are not executed, and the borrowing device does not display the network speed.

[0411] Here, the thread started in step 1106 can specifically be the thread related to network speed display in the non-network sharing scenario mentioned in step 1003 above (or referred to as the second network speed service). The thread related to network speed display in the non-network sharing scenario can include the second traffic query thread (referred to as the second query thread) and the second network speed refresh thread (referred to as the second refresh thread).

[0412] Optionally, if the network speed management module does not perform the above-mentioned recovery operation 2 in step 1103, then step 1106 can be skipped. In this case, there is no need to restart the network speed-related thread, and the process can proceed directly to step 1107.

[0413] Step 1107: The network speed management module sends traffic query information to the network data module to query the real-time traffic consumption.

[0414] Step 1108: The network data module responds to the traffic query information received from the network speed management module and queries the real-time traffic consumption.

[0415] Step 1109: The network data module returns the retrieved traffic data to the network speed management module.

[0416] Step 1110: The network speed management module calculates the network speed based on the traffic data received multiple times and sends the network speed to the system UI module.

[0417] Step 1111: The system UI module responds to the network speed received from the network speed management module by refreshing the UI display.

[0418] Here, the operations from step 1105 to step 1111 can be found in [reference needed]. Figure 11 The operations in steps 1002 to 1008 are not described in detail here.

[0419] Understandably, if the network speed management module executes step 1103 and the borrowing device is neither connected to the WLAN network nor the cellular network, then the borrowing device will not execute the following steps. Figure 12During steps 1105 to 1111, the device using the internet cannot display the network speed.

[0420] from Figure 12 It can be observed that when the device sharing the network disconnects, if it is connected to a WLAN network and / or a cellular network, the network speed can still be displayed; if it is not connected to a WLAN network and / or a cellular network, the network speed is not displayed.

[0421] Combination Figures 10 to 12 It can be observed that electronic devices using shared networks shared by other devices can display network speed. Furthermore, the network speed display scheme when connected to WLAN and / or cellular networks is compatible with the network speed display scheme when connected to shared networks, and the two can be switched flexibly.

[0422] Figure 13 This is a flowchart illustrating a method for displaying network speed according to an embodiment of this application. See also... Figure 13 This method can be applied to electronic devices that borrow a network, referred to as "network-borrowing devices" or "first devices." For examples of network-borrowing devices, please refer to... Figure 10 and Figure 12 The network access device shown.

[0423] like Figure 13 As shown, the network speed display method may include the following steps 1201 to 1210.

[0424] It is understood that the above-described network speed display method may include all of the steps in steps 1201 to 1210, or may include only some of them. It is also understood that the steps in the network speed display method can be arbitrarily combined without conflict. As an optional embodiment of this application, the network speed display method may include only steps 1201, 1202, and 1205. As another optional embodiment of this application, the network speed display method may also include only steps 1201 to 1205.

[0425] Step 1201: The first device and the second device establish a network sharing connection.

[0426] The network sharing connection is used to enable the first device to share the first network of the second device.

[0427] The second device is an electronic device that provides the network; it can also be called a network supply device. For details on network supply devices, please refer to [link to relevant documentation]. Figure 10 and Figure 12 The power supply equipment shown.

[0428] The first device and the second device are any two electronic devices in the trust ring. The structures of the first device and the second device can be found in [reference needed]. Figure 3and Figure 4 .

[0429] The first network is the network shared by the second device with the first device. In some scenarios, the first network is also referred to as a shared network (see [link to documentation]). Figures 2 to 12 (The shared network in the corresponding embodiments).

[0430] In some embodiments, the first device may establish a network sharing connection with the second device in response to a first operation by the user on the screen of the first device. That is, the first device may initiate the establishment of a network sharing connection.

[0431] The first operation is to enable network sharing. This first operation can trigger the first device to borrow network resources from the second device.

[0432] The first step can be found in [reference]. Figure 6 The operation of clicking the network option 604 shown in (c) can be found here, or see [link to relevant documentation]. Figure 8 The operation shown in (e) involves dragging window 708 into device sphere 704 along the direction of the dashed arrow. Alternatively, see [link to relevant documentation]. Figure 9 The operation of clicking the "Reconnect" control 84c in the message bar 804, as shown in (d) in the diagram, will not be elaborated here.

[0433] In other embodiments, the first device may respond to a connection message received from the second device and establish a network sharing connection with the second device. That is, the second device may initiate the establishment of a network sharing connection.

[0434] The connection message is used to indicate that network sharing should be enabled.

[0435] Here, the second device can respond to the user's first operation on the second device's screen, proactively initiate the establishment of a network sharing connection with the first device, and send the aforementioned connection message to the first device. Upon receiving the aforementioned connection message, the first device can cooperate with the second device to establish a network sharing connection.

[0436] Step 1202: If the first device is not connected to the second network at the first moment, the first device adds a first icon to the status bar of the first device.

[0437] The first moment refers to the moment when the network sharing connection is initiated.

[0438] The second network may include a wireless local area network (WLAN) and / or a cellular network. For example, the WLAN could be a WiFi network, and the cellular network could be an LTE network, a 5G network, etc.

[0439] The first icon indicates network speed; in some scenarios, it is also referred to as the network speed icon (see [link]). Figure 6The network speed icon in the 61e Figure 8 The network speed icon in the image is 71e, or... Figure 9 The network speed icon in the image (81d).

[0440] Here, when the first device successfully establishes a network sharing connection with the second device, a first icon, namely the network speed icon, can be displayed on the status bar of the first device to inform the user of the network speed status. If, at the moment of initiating the network sharing connection (i.e., at the first moment), the first device is not connected to the second network, that is, it is neither connected to the Wi-Fi nor the cellular network, in this case, the first device can add the first icon to the status bar.

[0441] Step 1203: If the first device has already connected to the second network at the first moment and the first icon already exists in the status bar, then the first device retains the first icon in the status bar.

[0442] Here, if the first device is connected to a second network, such as a WiFi network, at the moment of initiating the establishment of a network sharing connection (i.e., the first moment), and the first device's status bar already displays the first icon, then the first device can retain the first icon in the status bar to avoid the situation where the first icon is deleted and then immediately reappears, thus saving computational resources.

[0443] Understandably, the fact that the first device is already displaying the first icon when it is connected to the second network indicates that the first device has enabled the network speed display function.

[0444] Step 1204: If the first device has already connected to the second network at the first moment and the first icon does not exist in the status bar, then the first device adds the first icon to the status bar.

[0445] Here, if at the moment the network sharing connection is initiated (i.e., at the first moment), the first device is connected to a second network, such as a WiFi network, and the first device's status bar does not have the first icon, it means that the first device has not enabled the network speed display function. In this case, the first device can add the first icon to the status bar.

[0446] In some alternative implementations, when the first device and the second device successfully establish a network sharing connection, if the first device is already connected to the second network and the first icon is not present in the status bar, the first device may first display a prompt message, such as a message prompting the user to enable the network speed display function, or a message indicating permission to display the network speed. Only after obtaining user permission, such as when the network speed display function is enabled or a control indicating permission to display the network speed is triggered, will the first icon be displayed in the status bar.

[0447] Here, if the first device does not display the first icon when it is connected to the second network, it means that the first device has not enabled the network speed display function or the user does not want to display the network speed icon. In this case, the first device can display the network speed with the user's permission, which helps to improve the user experience.

[0448] Step 1205: If the first device has already connected to the second network at the first moment, then the first device disconnects from the second network after the network sharing connection is successfully established.

[0449] In this embodiment of the application, when the first device and the second device establish a network sharing connection, if the first device is already connected to the second network at the first moment, the first device can disconnect the second network after the network sharing connection is successfully established, thus avoiding the consumption of computing resources required to maintain the network connection.

[0450] Optionally, in some application scenarios, when the first device establishes a network sharing connection with the second device, if the first device is already connected to the second network at the first moment, the first device can close its connection to the second network after the network sharing connection is successfully established, rather than disconnecting from the second network. That is to say, in some scenarios, when the first device switches from using the second network to using the first network (or the shared network), it can maintain its connection to the second network, but will not use the second network to transmit data.

[0451] Step 1206: The first device obtains the traffic data consumed by the first device from the second device according to a preset cycle, and refreshes the first icon based on the traffic data.

[0452] The aforementioned preset period is a pre-set duration value, such as 1 second.

[0453] The traffic data consumed by the first device refers to the traffic data consumed by the first device when using the first network, or the traffic data provided by the second device to the first device.

[0454] In this embodiment, when the first device (network-borrowing device) successfully establishes a network sharing connection with the second device (network-providing device), it can display a first icon (network speed icon). After successfully establishing the network sharing connection, the first device can query the consumed traffic data from the second device in real time, and determine the real-time network speed of the first device based on the queried traffic data. The network speed icon is then refreshed based on the real-time network speed, ensuring that the network speed icon always displays the latest network speed information. In this case, users can intuitively perceive the current network speed of the network-borrowing device by viewing the network speed icon of the first device, thereby sensing whether the shared network used by the first device is working smoothly or whether there are any abnormalities, which helps improve the user experience.

[0455] In some optional implementations, step 1206 above, in which the first device obtains the traffic data consumed by the second device according to a preset period and refreshes the first icon based on the traffic data, may include: sending traffic query information to the second device according to a preset period; determining the first network speed of the first device based on the traffic data each time the traffic data sent by the second device is received; and refreshing the icon content of the first icon to the first network speed.

[0456] Among them, the first network speed is the network speed of the first device.

[0457] The traffic query information is used to query the traffic consumed by the first device. The traffic consumed by the first device refers to the traffic consumed by the first device using the first network.

[0458] In this embodiment, the first device sends traffic query information to the second device at a preset period to obtain real-time traffic consumption data from the second device. Based on this real-time traffic consumption data, the first device calculates the real-time network speed and updates the network speed icon. This allows the network speed icon (see...) to... Figure 6 The network speed icon in the 61e Figure 8 The network speed icon in the image is 71e, or... Figure 9 The network speed icon (81d) in the system can always display the latest network speed information.

[0459] Optionally, the first device determines its first network speed based on traffic data, which may include: the first device determining the first network speed as the ratio of a first difference to a first duration. Here, the first difference is the difference between the currently received traffic data and the previously received traffic data, and the first duration is the duration corresponding to a preset period.

[0460] Here, the first difference is the difference between the traffic data received this time and the traffic data received last time, and the first duration is the duration corresponding to the preset period. For example, if the preset period is 1 second, then the first duration can be 1 second.

[0461] Optionally, the first device determines its first network speed based on traffic data. Alternatively, the first device can calculate the difference between each pair of traffic data received multiple times, divide the difference by the query time interval between the two traffic data, obtain the corresponding value, and finally determine the average of the multiple values ​​as the first network speed.

[0462] It is understood that the embodiments of this application do not specifically limit the process by which the first device calculates the first network speed based on multiple traffic data.

[0463] In some optional implementations, the first device includes a system interface service and system services. The system interface service can be found in [reference needed]. Figure 4 See also SystemUI in the application layer. Figures 10 to 12 The SystemUI is shown below. System services can be found in [link / reference]. Figure 4 The SystemServer in the application framework layer can also be found in [the documentation / reference]. Figure 10 and Figure 12 The SystemServer shown in the image.

[0464] The first device sends traffic query information to the second device at a preset period, which may include: the system interface service sending first information for querying traffic at a preset period (see...). Figure 10 (Step 908); Upon receiving the first information, the system service sends second information to the second device for querying traffic (see...) Figure 10 (Steps 909 to 911). The first information is information indicating query traffic. The second information is information indicating query traffic. It is understood that the specific content of the first and second information is not limited in the embodiments of this application.

[0465] Each time the first device receives traffic data sent by the second device, it determines the first device's first network speed based on the traffic data. This may include: the system service responding to the received traffic data from the second device by sending the traffic data to the system interface service (see...). Figure 10 Steps 912 to 914); The system interface service responds upon receiving traffic data and determines the first network speed of the first device based on the traffic data (see...). Figure 10 (Step 915).

[0466] Optionally, the process by which the system interface service determines the first network speed of the first device based on traffic data can be specifically as follows: the ratio of the first difference to the first duration is determined as the first network speed. Here, the first difference is the difference between the traffic data received this time and the traffic data received last time, and the first duration is the duration corresponding to a preset period.

[0467] In this embodiment, since the system service is responsible for starting and managing various services in the operating system, and the system service is usually always alive, the interaction between the system interface service and the second device is realized through the system service, which is stable and reliable and helps to ensure that the first device can refresh and display real-time network speed data in a timely manner.

[0468] In some alternative implementations, the first device also includes a first service (see...). Figure 4 Network sharing services in the application framework layer, or see [link to application framework layer]. Figure 10 and Figure 12 The first network sharing service is used to establish or disconnect a network sharing connection with the second device.

[0469] After the first device and the second device establish a network sharing connection, the process further includes: the first service sending a first network broadcast including a first broadcast message (see...). Figure 10 (Step 906). The first network broadcast is used to broadcast the opening and closing status of the first network (or shared network). The content broadcast by the first network broadcast (or simply the first broadcast) can be a first broadcast message or a second broadcast message. The first broadcast message indicates that network sharing is enabled, that is, that the shared network provided by the second device (or the network provider) is enabled. The second broadcast message indicates that network sharing is disabled, that is, the shared network provided by the network provider is disabled. It is understood that when the first device establishes a network sharing connection with the second device through the first service, the content of the first network broadcast broadcast by the first service is the first broadcast message.

[0470] The system interface service sends first information for querying traffic to the system service at a preset period, including: in response to receiving a first network broadcast, the system interface service sends first information for querying traffic to the system service at a preset period (see...). Figure 10 (Step 908)

[0471] In practice, the first device can be used through the first service (see...) Figure 4 Network sharing services in the application framework layer, or see [link to application framework layer]. Figure 10 and Figure 12 The first network sharing service establishes a network sharing connection with the second device. After establishing the network sharing connection, the first service sends a first network broadcast including a first broadcast message (see [link to network broadcast]). Figure 10 (See step 906 for the first broadcast). The first broadcast message indicates that network sharing is enabled. In this case, when the system interface service receives a first network broadcast containing the first broadcast message, it can send first information for querying traffic to the system service at a preset period.

[0472] It should be noted that the opening and closing status of the first network can be transmitted between the first service and the system service interface through broadcast (specifically, by transmitting the first network broadcast), which can improve the information transmission rate.

[0473] Optionally, the first service may send a first network broadcast including a first broadcast message, which may be in response to the second device starting to transmit network data to the first device.

[0474] Here, the first service sends the first network broadcast when the second device (the network provider) starts transmitting network data to the first device (the network borrower). This avoids the system interface service from starting the network speed query too early, which helps to save unnecessary computing resource consumption.

[0475] Step 1207: The first device disconnects from the network sharing connection with the second device.

[0476] In some embodiments, the first device may disconnect the network sharing connection from the second device in response to a second operation performed by the user on the screen of the first device.

[0477] The second operation is to disable network sharing. This second operation can trigger the first device to stop borrowing network resources from the second device. (See also: [link to second operation]). Figure 7 The operation of option 69a in the click list 609 shown in (a) is as follows: Figure 8 (g) shows the operation of dragging icon 710 into device ball 706 along the direction of the dashed arrow. Figure 9 The operation of clicking the "Disconnect" control 84b shown in (c) is not described in detail here.

[0478] Here, the first device can proactively disconnect the network sharing connection with the second device when it detects the second operation.

[0479] In other embodiments, the first device may disconnect the network sharing connection with the second device in response to receiving a disconnect message from the second device. The disconnect message indicates that network sharing is to be disabled.

[0480] Here, the second device can respond to a second operation by the user on its screen, proactively initiating a disconnection from the network sharing connection with the first device and sending the aforementioned disconnection message to the first device. Upon receiving the disconnection message, the first device can cooperate with the second device to disconnect the network sharing connection.

[0481] In some alternative implementations, after the first device and the second device establish a network sharing connection, the method further includes: displaying a second icon.

[0482] In this case, after the first device disconnects from the network sharing connection with the second device, it also includes: stopping the display of the second icon.

[0483] The second icon indicates that the first device is sharing the network. In some scenarios, the second icon is also referred to as the network sharing icon. For more information on network sharing icons, please see [link to relevant documentation]. Figure 2 The network sharing icon 203 in the middle Figure 6 The network sharing icon in 61d, Figure 8 The network sharing icon in 71d, or Figure 9 The network sharing icon in 81c.

[0484] In this embodiment, when the first device and the second device successfully establish a network sharing connection, the first device can display a second icon in its status bar. When the first device and the second device successfully disconnect from the network sharing connection, the first device can also stop displaying the second icon in its status bar. This allows users to intuitively perceive whether the first device is currently sharing the network by checking the presence or absence of the second icon in its status bar, thus improving the user experience.

[0485] In some optional implementations, the first device includes a system interface service and a first service. The system interface service is used to query traffic data and / or trigger the first icon refresh through the network speed service when the first device establishes a network sharing connection with the second device. The first service is used to establish or disconnect the network sharing connection with the second device.

[0486] For details, please refer to the system interface service. Figure 4 SystemUI in the application layer, or see Figures 10 to 12 The SystemUI shown in the image. The first service can be found in [link / reference]. Figure 4 Network sharing services in the application framework layer, or see [link to application framework layer]. Figure 10 and Figure 12 The first network sharing service in the world).

[0487] After the first device disconnects the network sharing connection with the second device, the process further includes: the first service sending a first network broadcast including a second broadcast message, the second broadcast message indicating that network sharing is turned off (see...). Figure 12 (Step 1102); Upon receiving the first network broadcast and the first device connecting to the second network, the system interface service continues to run the network speed service (see...). Figure 12 (Steps 1103 to 1104).

[0488] In this embodiment, firstly, after the first device disconnects its network sharing connection with the second device via the first service, the first service can send a first network broadcast (or first broadcast) including a second broadcast message, which the system service interface can receive. The first service and the system service interface communicate the opening and closing status of the first network via broadcast (specifically, by transmitting the first network broadcast), which can improve information transmission speed. Secondly, after receiving the first network broadcast including the second broadcast message, if the first device is already connected to the second network, the first device can continue to run the network speed service. This allows the first device to continue using the network speed service to query traffic data and / or trigger the first icon refresh even after successfully disconnecting its network sharing connection with the second device. This avoids the situation of immediately turning the network speed service off and on again, helping to reduce data processing volume and improve data processing speed. It also helps to refresh and display the network speed promptly after disconnecting the network sharing connection and when the first device is connected to the network.

[0489] Optionally, the network speed service may include one or more threads. For example, the network speed service may include a first thread for querying traffic data and a second thread for calculating network speed and triggering a refresh of the first icon. In some scenarios, the first thread may also be called a traffic query thread or a query thread. The second thread may also be called a network speed refresh thread or a refresh thread.

[0490] Understandably, the network speed service used by the first device in a shared network scenario (referred to as the first network speed service for distinction) and the network speed service used in scenarios using other networks (such as Wi-Fi and cellular networks) (the second network speed service) can be the same service or different services. When the first and second network speed services are the same service, the network speed service can be reused when the first device switches from the first network to the second network, or vice versa, thereby improving data processing efficiency.

[0491] The first network speed service includes the aforementioned first query thread and first refresh thread. The second network speed service includes the aforementioned second query thread and second refresh thread.

[0492] In some alternative implementations, after the first device disconnects its network sharing connection with the second device, the following further steps are included:

[0493] The system interface service responds to receiving the first network broadcast and the first device is not connected to the second network by disabling the network speed service.

[0494] In this embodiment of the application, after receiving a first network broadcast including a second broadcast message, if the first device is not connected to the second network, the system interface service can directly shut down the network speed service, thus saving unnecessary computing resource consumption.

[0495] Step 1208: In response to the first device connecting to the second network, the first device retains the first icon in the status bar.

[0496] In this embodiment, the first device can disconnect from the network sharing connection with the second device. During the disconnection process, the first device can attempt to connect to the second network. If the first device has already connected to the second network when the network sharing connection between the first and second devices is successfully disconnected, the first device can retain the first icon in the status bar. This avoids the situation where the first icon is deleted and then immediately reappears, thus saving computational resources.

[0497] It should be noted that when the first device successfully disconnects the network sharing connection with the second device, the second network that the first device connects to can be either the second network it used before using the first network, or a newly discovered second network. For example, if the second network used before using the first network was network X, when the first device successfully disconnects the network sharing connection with the second device, the first device may reconnect to the original network X, or it may connect to a new network Y.

[0498] Step 1209: In response to the first device not being connected to the second network, the first device stops displaying the first icon.

[0499] Here, if the first device does not connect to the second network when the first device successfully disconnects the network sharing connection with the second device, the first device can stop displaying the first icon in the status bar.

[0500] Step 1210: If the network sharing connection between the first device and the second device is lost, the first device and the second network shall re-establish a connection.

[0501] In this embodiment of the application, when the network sharing connection between the first device and the second device is disconnected, the first device may attempt to re-establish a connection with the previously connected second network. For example, if the second network used by the first device before using the first network was network X, when the first device successfully disconnects the network sharing connection with the second device, the first device may attempt to re-establish a connection with network X.

[0502] Optionally, if the first device fails to re-establish a connection with the second network, the first device can connect to another second network. For example, if the first device was using network X before using the first network, and the first device successfully disconnects from the network sharing connection with the second device, the first device can attempt to re-establish a connection with network X. If the first device fails to re-establish a connection with network X, the first device can establish a connection with a newly discovered network Y, where network Y is the second network.

[0503] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0504] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.

[0505] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.

[0506] As used in this application specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if detected [the described condition or event]" may be interpreted, depending on the context, as meaning "once determined," "in response to determination," "once detected [the described condition or event]," or "in response to detection [the described condition or event]."

[0507] Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only for distinguishing descriptions and should not be construed as indicating or implying relative importance. It should also be understood that although the terms "first," "second," etc., are used in the text to describe various elements in some embodiments of this application, these elements should not be limited by these terms. These terms are merely used to distinguish one element from another.

[0508] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.

[0509] Furthermore, those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. In the various embodiments of this application, each functional unit can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0510] This application also provides an electronic device, which includes at least one memory, at least one processor, and a computer program stored in at least one memory and executable on at least one processor. When the processor executes the computer program, it causes the electronic device to perform the steps in any of the above method embodiments.

[0511] Furthermore, those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. In the various embodiments of this application, each functional unit can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0512] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps described in the various method embodiments above.

[0513] This application provides a computer program product that, when run on an electronic device, enables the electronic device to implement the steps described in the various method embodiments above.

[0514] This application also provides a chip system, which includes a processor coupled to a memory. The processor executes a computer program stored in the memory to implement the steps in the above-described method embodiments.

[0515] If an integrated module / unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable storage medium can include: any entity or device capable of carrying computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc.

[0516] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0517] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0518] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

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

Claims

1. A method for displaying network speed, characterized in that, Applied to a first device, the method includes: Establish a network sharing connection with the second device, the network sharing connection being used to enable the first device to share the first network of the second device; If the first device does not connect to the second network at the first moment, a first icon is added to the status bar of the first device. The second network includes a wireless local area network and / or a cellular network. The first icon indicates the network speed. The first moment is the moment when the network sharing connection is initiated. According to a preset cycle, the traffic data consumed by the first device is obtained from the second device, and the first icon is refreshed based on the traffic data.

2. The network speed display method according to claim 1, characterized in that, The method further includes: If the first device has already connected to the second network at the first moment and the first icon already exists in the status bar, then the first icon in the status bar is retained.

3. The network speed display method according to claim 1, characterized in that, The method further includes: If the first device is already connected to the second network at the first moment and the first icon is not present in the status bar, then the first icon is added to the status bar.

4. The network speed display method according to claim 1, characterized in that, The step of obtaining traffic data consumed by the first device from the second device according to a preset period and refreshing the first icon based on the traffic data includes: Traffic query information is sent to the second device according to the preset period; Each time traffic data is received from the second device, the first network speed of the first device is determined based on the traffic data; Refresh the icon content of the first icon to the first network speed.

5. The network speed display method according to claim 4, characterized in that, Determining the first network speed of the first device based on the traffic data includes: The ratio of the first difference to the first duration is determined as the first network speed. The first difference is the difference between the traffic data received this time and the traffic data received last time. The first duration is the duration corresponding to the preset period.

6. The network speed display method according to claim 4, characterized in that, The first device includes system interface services and system services; Sending traffic query information to the second device according to the preset period includes: The system interface service sends first information for querying traffic to the system service according to the preset period; Upon receiving the first information, the system service sends second information to the second device for querying traffic. Each time traffic data sent by the second device is received, determining the first network speed of the first device based on the traffic data includes: In response to receiving traffic data sent by the second device, the system service sends the traffic data to the system interface service. The system interface service responds to the received traffic data and determines the first network speed of the first device based on the traffic data.

7. The network speed display method according to claim 6, characterized in that, The first device further includes a first service, which is used to establish or disconnect a network sharing connection with the second device; After establishing a network sharing connection with the second device, the following is also included: The first service sends a first network broadcast including a first broadcast message, the first broadcast message indicating that network sharing is enabled; The system interface service sends first information for querying traffic to the system service according to the preset period, including: In response to receiving the first network broadcast, the system interface service sends first information for querying traffic to the system service according to the preset period.

8. The network speed display method according to claim 1, characterized in that, The method further includes: Disconnect the network sharing connection with the second device; In response to the first device connecting to the second network, the first icon in the status bar is retained; In response to the first device not being connected to the second network, the first icon is stopped being displayed.

9. The network speed display method according to claim 8, characterized in that, After establishing a network sharing connection with the second device, the method further includes: A second icon is displayed, indicating that the first device is currently sharing the network. After disconnecting the network sharing connection with the second device, the method further includes: Stop displaying the second icon.

10. The network speed display method according to claim 8, characterized in that, The first device includes a system interface service and a first service. The system interface service is used to query traffic data and / or trigger the first icon refresh through the network speed service when the first device and the second device establish the network sharing connection. The first service is used to establish or disconnect the network sharing connection with the second device. After disconnecting the network sharing connection with the second device, the method further includes: The first service sends a first network broadcast including a second broadcast message, the second broadcast message indicating that network sharing is turned off; The system interface service responds to receiving the first network broadcast and the first device connecting to the second network by continuing to run the network speed service.

11. The network speed display method according to claim 10, characterized in that, After disconnecting the network sharing connection with the second device, the method further includes: The system interface service responds to receiving the first network broadcast and the first device not being connected to the second network by disabling the network speed service.

12. The network speed display method according to any one of claims 1-11, characterized in that, The method further includes: If the first device is already connected to the second network at the first moment, then the second network is disconnected after the network sharing connection is successfully established.

13. The network speed display method according to claim 12, characterized in that, The method further includes: If the network sharing connection between the first device and the second device is lost, a new connection is established with the second network.

14. An electronic device, characterized in that, The electronic device includes a memory and a processor. The memory stores a computer program that can run on the processor. When the processor executes the computer program, it implements the network speed display method as described in any one of claims 1 to 13.

15. A chip system comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, characterized in that, The processor is used to execute the computer program to implement the network speed display method as described in any one of claims 1 to 13.

16. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when run on an electronic device, causes the electronic device to perform the network speed display method as described in any one of claims 1 to 13.