Equipment management method, communication system and related device

The printer status display is quickly adjusted in electronic devices through the device management service and mDNS module, which solves the problem of inaccurate printer status display after the electronic device switches to the LAN, and improves the user's convenience and printer user experience.

CN120343101AActive Publication Date: 2025-07-18HONOR DEVICE CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202410041968.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-01-10
Publication Date
2025-07-18
Estimated Expiration
2044-01-10

AI Technical Summary

Technical Problem

When electronic devices switch LAN, the printer's up and down status cannot be accurately displayed, resulting in users being unable to print normally, affecting the user experience.

Method used

By introducing device management services and mDNS modules into electronic devices, receiving network service information sent by wireless access devices, quickly adjusting the status display of the printer to ensure that the display is consistent with the actual status.

Benefits of technology

When electronic devices switch LAN, quickly adjust the printer's status display to reduce the time of error display, improve user operation convenience and printer user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120343101A_ABST
    Figure CN120343101A_ABST
Patent Text Reader

Abstract

The invention discloses a device management method, a communication system and a related device, and relates to the field of terminals, and the method comprises the following steps: when an Android mDNS module receives information of a plurality of network services of a second electronic device sent by a wireless access device, a device management service sends an online instruction of the second electronic device to a first application. After the first application receives an online instruction of the second electronic equipment, the first electronic equipment displays a first interface in response to a first operation for displaying the first interface of the first application, and the first interface comprises an online identifier of the second electronic equipment. When the first electronic device disconnects the wireless connection with the wireless access device, the android mDNS module sends a first offline notification of the first network service to the mDNS module. The mDNS module queries states of a plurality of network services. When the plurality of network services are all in an offline state, the device management service sends an offline indication of the second electronic device to the first application.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of terminals, and in particular, to a device management method, a communication system, and related devices. Background Art

[0002] With the development of wireless communication technology, portable electronic devices such as smart phones and tablet computers have begun to support users to share data such as pictures and documents, improving the user's office efficiency and office experience. For example, when a smart phone and a printer are in the same local area network, the smart phone can display that the printer is online. Users can print pictures, documents and other files without copying the data on the smart phone to a computer. Users also do not need to use a data cable to connect the smart phone to the printer to print the pictures and documents on the smart phone. However, when the smart phone switches networks and is no longer in the same local area network as the printer, the smart phone can no longer use the printer for printing, but the smart phone still shows that the printer is online for a certain period of time. In this way, the smart phone cannot accurately display the actual online and offline status of the printer, resulting in users being unable to print files normally, the operation is extremely inconvenient, and the use experience of the printer is affected. Summary of the Invention

[0003] This application provides a device management method, a communication system, and related devices, which realizes that when a first electronic device switches local area networks and is no longer in the same local area network as a second electronic device, the first electronic device can quickly adjust the status display of the second electronic device and reduce the duration of misdisplaying the status of the second electronic device.

[0004] In a first aspect, the present application provides a device management service method, which is applied to a first electronic device. The first electronic device includes an Android mDNS module, a device management service, a first application, and an mDNS module. The method includes: when the mDNS module receives information of multiple network services of a second electronic device sent by a wireless access device, the device management service sends an online indication of the second electronic device to the first application. After the first application receives the online indication of the second electronic device, in response to a first operation of displaying a first interface of the first application, the first electronic device displays the first interface, and the first interface includes an online identifier of the second electronic device. Among them, the multiple network services are used to control the second electronic device, and the multiple network services include a first network service. When the first electronic device disconnects the wireless connection with the wireless access device, the Android mDNS module sends a first offline notification of the first network service to the mDNS module. Among them, the first offline notification is used to indicate that the first network service is in an offline state. In response to the received first offline notification, the mDNS module queries the status of the multiple network services. When the mDNS module determines that all the multiple network services are in an offline state, the device management service sends an offline indication of the second electronic device to the first application. After the first application receives the offline indication of the second electronic device, in response to a second operation of displaying the first interface, the first electronic device displays the first interface, and the first interface includes an offline identifier of the second electronic device. In this way, when the first electronic device switches the local area network and is no longer in the same local area network as the second electronic device, the first electronic device can quickly adjust the status display of the second electronic device and reduce the duration of misdisplaying the status of the second electronic device.

[0005] In a possible implementation manner, the method further includes: when the mDNS module determines that at least one of the multiple network services is in an online state, the device management service sends an online indication of the second electronic device to the first application. After the first application receives the online indication of the second electronic device, in response to a second operation of displaying the first interface, the first electronic device displays the first interface, and the first interface includes an online identifier of the second electronic device. In this way, when the first electronic device switches the local area network and is no longer in the same local area network as the second electronic device, the first electronic device can quickly adjust the status display of the second electronic device and reduce the duration of misdisplaying the status of the second electronic device.

[0006] In a possible implementation, after the first electronic device disconnects the wireless connection with the wireless access device and before the mDNS module determines that at least one of the multiple network services is in an online state, the method further includes: the first electronic device establishes a wireless connection with the wireless access device. In this way, when the first electronic device switches the local area network and is no longer in the same local area network as the second electronic device, the first electronic device can quickly adjust the status display of the second electronic device and reduce the duration of misdisplaying the status of the second electronic device.

[0007] In a possible implementation, the first electronic device further includes a Java singleton thread pool. The mDNS module determines that all of the multiple network services are in an offline state, specifically including: the mDNS module sends a first service parsing instruction of the first network service to the Android mDNS module through the Java singleton thread pool. In response to the first service parsing instruction, the Android mDNS module sends a first mDNS query request of the first network service to the wireless access device. Wherein, the first mDNS query request is used to trigger the second electronic device to send information of the first network service. When the Java singleton thread pool does not receive the information of the first network service within a first time period, the mDNS module determines that the first network service is in an offline state. In this way, concurrent operations generated when checking the status between different network services can be avoided, and at the same time, process blockage caused by continuous waiting because the mDNS module does not receive the information of the network service sent by the second electronic device can also be avoided.

[0008] In a possible implementation, the first electronic device further includes a Java synchronization utility class. The mDNS module sends a first service parsing instruction of the first network service to the Android mDNS module through the Java singleton thread pool, specifically including: the mDNS module creates a first parsing task of the first network service. Wherein, the first parsing task includes the first service parsing instruction. The mDNS module sends the first parsing task to the Java singleton thread pool. After receiving the first parsing task, the Java singleton thread pool creates a first thread. The Java singleton thread pool sends a first service parsing instruction to the Android mDNS module through the first thread. The Java singleton thread pool sends a thread blocking instruction to the Java synchronization utility class. The Java synchronization utility class blocks the first thread in the Java singleton thread pool. When the Java singleton thread pool does not receive the information of the first network service within a first time period, the Java synchronization utility class releases the first thread in the Java singleton thread pool, and the mDNS module determines that the first network service is in an offline state. In this way, concurrent operations generated when checking the status between different network services can be avoided.

[0009] In a possible implementation, after the Java singleton thread pool sends a first service resolution instruction to the Android mDNS module through the first thread, the method further includes: the Java synchronization utility class sets a timer and a timeout parameter. The value of the timeout parameter is the same as the value of the first duration. When the Java singleton thread pool does not receive information about the first network service within the first duration, after the Java synchronization utility class releases the first thread in the Java singleton thread pool, the method further includes: the Java singleton thread pool sends a timer timeout indication message to the mDNS module. Wherein, the timer timeout indication message is used to indicate that the timing duration of the timer exceeds the timeout parameter. The mDNS module determines that the first network service is in an offline state, specifically including: when receiving the timer timeout indication message, the mDNS module determines that the first network service is in an offline state. In this way, it is possible to avoid process blockage caused by the mDNS module continuously waiting because it does not receive information about the network service sent by the second electronic device.

[0010] In a possible implementation, the first offline notification carries a first instance of the first network service, and the first instance includes the service name and service type of the first network service. In the first instance, the IP address of the second electronic device, the device name of the second electronic device, the port number and attributes of the first network service are null values. After the Android mDNS module sends the first offline notification of the first network service to the mDNS module, before the mDNS module sends the first service resolution instruction of the first network service to the Android mDNS module through the Java singleton thread pool, the method further includes: the mDNS module creates a second instance of the first network service. Wherein, the content of the second instance is the same as that of the first instance, and the identifiers of the second instance and the first instance are different. The mDNS module sends the first service resolution instruction of the first network service to the Android mDNS module through the Java singleton thread pool, specifically including: the mDNS module sends the first service resolution instruction of the first network service carrying the second instance to the Android mDNS module through the Java singleton thread pool. In this way, it is possible to avoid the problem that the Android mDNS module does not send an mDNS query response because the service resolution instruction carries a specified instance of the offline notification of the network service.

[0011] In a possible implementation, after the mDNS module determines that the first network service is in the offline state, the method further includes: the mDNS module obtains the multiple network services of the second electronic device from the information of the multiple network services that have been saved. Among them, the multiple network services further include a second network service and a third network service. The mDNS module queries the status of the second network service and the status of the third network service. When the mDNS module determines that all the multiple network services are in the offline state, the device management service sends a offline indication of the second electronic device to the first application, specifically including: when the status of the first network service, the status of the second network service, and the status of the third network service are in the offline state, the device management service sends a offline indication of the second electronic device to the first application. In this way, when the first electronic device switches the local area network and is no longer in the same local area network as the second electronic device, the first electronic device can quickly adjust the status display of the second electronic device and reduce the duration of misdisplaying the status of the second electronic device.

[0012] In a possible implementation, the method further includes: when the mDNS module receives the information of the multiple network services of the second electronic device sent by the wireless access device, the mDNS module saves the information of the multiple network services. In this way, it can be beneficial to the efficiency of the mDNS module to check the status of the network services of the second electronic device when receiving the offline notification of the network service.

[0013] In a possible implementation, the mDNS module saves the information of the multiple network services, specifically including: the mDNS module saves the information of the multiple network services in the form of key-value pairs. Among them, the key in the key-value pair is the device name of the second electronic device, and the value in the key-value pair is the information of the multiple network services. In this way, it can be beneficial to the efficiency of the mDNS module to check the status of the network services of the second electronic device when receiving the offline notification of the network service.

[0014] In a possible implementation, the multiple network services further include a second network service and a third network service. After the Android mDNS module sends a first offline notification of the first network service to the mDNS module, the method further includes: the Android mDNS module waits for a second duration. After waiting for the second duration, the Android mDNS module sends a second offline notification of the second network service and a third offline notification of the third network service to the mDNS module. Wherein, the second offline notification is used to indicate that the second network service is in an offline state, and the third offline notification is used to indicate that the third network service is in an offline state. In response to receiving the second offline notification and the third offline notification, the mDNS module queries the status of the multiple network services. When the mDNS module determines that all the multiple network services are in an offline state, the device management service sends an offline indication of the second electronic device to the first application. After the first application receives the offline indication of the second electronic device, in response to a third operation of displaying the first interface, the first electronic device displays the first interface, and the first interface includes an offline identifier of the second electronic device. In this way, when the first electronic device switches the local area network back and forth, the first electronic device can quickly adjust the status display of the second electronic device, and reduce the duration of misdisplaying the status of the second electronic device.

[0015] In a second aspect, the present application provides an electronic device, which is the first electronic device. The electronic device includes: a display screen, a wireless communication module, one or more processors, and one or more memories. Wherein, the one or more memories, the display screen, and the wireless communication module are coupled to the one or more processors. The one or more memories are used to store computer program code, and the computer program code includes computer instructions. When the one or more processors execute the computer instructions, the method in any possible implementation of the first aspect above is performed. In this way, when the first electronic device switches the local area network and is no longer in the same local area network as the second electronic device, the first electronic device can quickly adjust the status display of the second electronic device, and reduce the duration of misdisplaying the status of the second electronic device.

[0016] In a third aspect, the present application provides a chip system. The chip system is applied to an electronic device. The chip system includes one or more processors, and the processors are used to call computer instructions to make the electronic device perform the method in any possible implementation of the first aspect above. In this way, when the first electronic device switches the local area network and is no longer in the same local area network as the second electronic device, the first electronic device can quickly adjust the status display of the second electronic device, and reduce the duration of misdisplaying the status of the second electronic device.

[0017] Fourthly, the present application provides a computer-readable storage medium, including instructions, which, when running on an electronic device, cause the electronic device to execute the method in any possible implementation manner of the first aspect as described above. In this way, when the first electronic device switches the local area network and is no longer in the same local area network as the second electronic device, the first electronic device can quickly adjust the status display of the second electronic device, reducing the duration of misdisplaying the status of the second electronic device.

[0018] Fifthly, the present application provides a computer program product, which, when running on an electronic device, causes the electronic device to execute the method in any possible implementation manner of the first aspect as described above. In this way, when the first electronic device switches the local area network and is no longer in the same local area network as the second electronic device, the first electronic device can quickly adjust the status display of the second electronic device, reducing the duration of misdisplaying the status of the second electronic device. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 It is a schematic diagram of the architecture of a communication system 10 provided by an embodiment of the present application;

[0020] Figures 2A - 2H It is a set of schematic diagrams of the interface for adding a printer to the trust ring provided by an embodiment of the present application;

[0021] Figures 3A - 3G It is a set of schematic diagrams of the interface for adding a printer to the trust ring provided by an embodiment of the present application;

[0022] Figures 4A - 4E It is a set of schematic diagrams of the interface for adding a printer to the trust ring provided by an embodiment of the present application;

[0023] Figures 4F - 4H It is a set of schematic diagrams of the interface for the status display of a printer provided by an embodiment of the present application;

[0024] Figure 5 It is a schematic diagram of the device architecture of a communication system 10 provided by an embodiment of the present application;

[0025] Figure 6 It is a schematic diagram of the specific process for a printer to go offline normally provided by an embodiment of the present application;

[0026] Figure 7 It is a schematic diagram of the specific process for a printer to go offline abnormally provided by an embodiment of the present application;

[0027] Figures 8A - 8E It is a schematic diagram of the implementation manner of a device management method provided by an embodiment of the present application;

[0028] Figures 9A - 9CSchematic diagram of the implementation of some steps of a device management method provided by an embodiment of the present application;

[0029] Figure 10 Schematic diagram of the process of a network service check provided by an embodiment of the present application;

[0030] Figures 11A - 11B Schematic diagram of the process of another network service check provided by an embodiment of the present application;

[0031] Figures 12A - 12B Schematic diagram of the process of yet another network service check provided by an embodiment of the present application;

[0032] Figures 13A - 13B Schematic diagram of the process of still another network service check provided by an embodiment of the present application;

[0033] Figure 14 Schematic diagram of the hardware structure of an electronic device 100 provided by an embodiment of the present application;

[0034] Figure 15 Schematic diagram of the hardware structure of a printer 200 provided by an embodiment of the present application. Detailed implementation

[0035] The terms used in the following embodiments of the present application are only for the purpose of describing specific embodiments and are not intended to limit the present application. As used in the specification and appended claims of the present application, the singular forms "a", "an", "the", "above-mentioned", "said", and "this" are intended to include the plural forms as well, unless the context clearly dictates otherwise. It should also be understood that the term " / and / " used in the present application refers to any or all possible combinations of one or more of the listed items. In the embodiments of the present application, the terms "first" and "second" are only used for descriptive purposes and cannot be construed as implying relative importance or implicitly indicating the quantity of the indicated technical features. Thus, features defined with "first" and "second" may explicitly or implicitly include one or more of such features. In the description of the embodiments of the present application, unless otherwise stated, the meaning of "plural" is two or more.

[0036] First, an architecture of a communication system provided by an embodiment of the present application is introduced.

[0037] Figure 1 Schematic diagram of the architecture of a communication system 10 provided by an embodiment of the present application.

[0038] Such as Figure 1As shown, the communication system 10 may include: an electronic device 100 (which may be referred to as the first electronic device), a printer 200 (which may be referred to as the second electronic device), and a wireless access device 300. Among them, the electronic device 100 may establish a wireless fidelity (Wi-Fi) connection with the wireless access device 300, and the printer 200 may establish a Wi-Fi connection with the wireless access device 300. Therefore, the electronic device 100 may communicate with the printer 200 through the wireless access device 300 and use the printer 200 for printing. Among them, a specified cloud account may be logged in on the electronic device 100, and the specified cloud account corresponds to a trust ring including one or more electronic devices (which may be simply referred to as devices). The devices within the trust ring corresponding to the specified cloud account are logged in with the specified cloud account or are bound to the specified cloud account.

[0039] In the embodiments of the present application, when the electronic device 100 communicates with the printer 200 through the wireless access device 300, the electronic device 100 and the printer 200 are in the same local area network, and the electronic device 100 may use the printer 200 for printing. At this time, the state of the printer 200 may be referred to as the online state. When the electronic device 100 and / or the printer 200 is disconnected from the wireless access device 300 and the electronic device 100 cannot communicate with the printer 200 through the wireless access device 300, the electronic device 100 and the printer 200 are not in the same local area network, and the electronic device 100 may not use the printer 200 for printing. At this time, the state of the printer 200 may be referred to as the offline state.

[0040] It should be noted that the embodiments of the present application use the printer 200 as an example to illustrate the specific implementation of the technical solution. In actual application scenarios, it is not limited to the printer 200, and other types of electronic devices may also form a communication system 10 with the electronic device 100 and the wireless access device 300 to implement the technical solution provided by the embodiments of the present application. Among them, other types of electronic devices may include, but are not limited to: mobile phones, tablet computers, handheld computers, desktop computers, laptop computers, ultra-mobile personal computers (UMPCs), netbooks, cellular phones, personal digital assistants (PDAs), and smart home devices such as smart large screens and smart speakers, wearable devices such as smart bracelets, smart watches, and smart glasses, etc.

[0041] Next, a method for adding a printer to the trust ring provided by the embodiments of the present application will be introduced.

[0042] Figures 2A - 2H It is a set of interface schematic diagrams for adding a printer to the trust ring provided by the embodiments of the present application.

[0043] As shown Figure 2A in the figure, the electronic device 100 can display a desktop 210. Among them, a page with application icons is displayed on the desktop 210. This page may include multiple application icons (for example, weather application icon, stock application icon, calculator application icon, settings application icon 212, mail application icon, gallery application icon, music application icon, video application icon, browser application icon, smart space application icon, etc.). In the upper part area of the desktop 210, a status bar 211 is displayed, and the status bar 211 may include: one or more signal strength indicators of mobile communication signals (also known as cellular signals), battery status indicator, time indicator, Wi-Fi signal indicator, and so on.

[0044] The electronic device 100 can receive a user's operation (such as a click) on the settings application icon 212. In response to this operation, the electronic device 100 can display as Figure 2B shown in the figure, the settings application interface 220.

[0045] As shown Figure 2B in the figure, the settings application interface 220 may display one or more options, for example, flight mode option, Wi-Fi option, Bluetooth option, smart connection option, mobile network option, security detection option, more connection options 221, and Honor account option, etc.

[0046] The electronic device 100 can receive a user's operation (such as a click) on the more connection options 221. In response to this operation, the electronic device 100 can display as Figure 2C shown in the figure, the more connection interface 230.

[0047] As shown Figure 2C in the figure, the more connection interface 230 may display one or more options, for example, NFC option, Honor Share option, Honor Car Connect option, wireless screen mirroring option, connect to Windows option, print option 231, VPN option, and encrypted DNS option, etc.

[0048] The electronic device 100 can receive a user's operation (such as a click) on the print option 231. In response to this operation, the electronic device 100 can display as Figure 2D shown in the figure, the print settings interface 240.

[0049] As shown Figure 2D in the figure, the print settings interface 240 may display the icon of the electronic device 100 and the icon of the printer 200, text prompt information (such as "Multiple printing methods, a new experience of portable printing", etc.), one or more options (such as, go to print assistant option 241, default printing service option, and print assistant option, etc.).

[0050] The electronic device 100 can receive a user's operation (such as a click) on the go-to print assistant option 241. In response to this operation, the electronic device 100 can display the print assistant interface 250 as shown Figure 2E below.

[0051] As shown Figure 2E below, the print assistant interface 250 can display text prompt messages (such as "Add multiple printers", "Multiple printers / scanners can be added", etc.), an add control 251, and one or more print function options (such as document print option, picture print option, scan option, etc.).

[0052] The electronic device 100 can receive a user's operation (such as a click) on the add control 251. In response to this operation, the electronic device 100 can display the printer addition interface 260 as shown Figure 2F below.

[0053] As shown Figure 2F below, the printer addition interface 260 can display a printer scan icon, text prompt messages (such as "Searching...", etc.), and one or more controls (such as a help control, a stop control, a hotspot addition control, etc.). The printer addition interface 260 can also display devices searched by the electronic device 100 through a short-range communication technology (such as Wi-Fi, Bluetooth, etc.). Among them, after the electronic device 100 searches for the printer 200 through the short-range communication technology, the electronic device 100 can display a device option 261 corresponding to the printer 200 on the printer addition interface 260. Among them, the device option 261 can include the device name of the printer 200 (such as "XX Printer Printer P1") and one or more controls (such as a connection control 262, etc.). The connection control 262 can be used to trigger the electronic device 100 to configure the printer 200 to connect to the local area network where the electronic device 100 is located.

[0054] The electronic device 100 can receive a user's operation (such as a click) on the connection control 262. In response to this operation, when the printer electronic device 100 can display the print assistant interface 250 as shown Figure 2G below.

[0055] As shown Figure 2GAs shown, when the electronic device 100 configures the printer 200 to connect to the local area network where the electronic device 100 is located, the electronic device 100 can bind the device information of the printer 200 to a specified cloud account, so that the printer 200 joins the trust ring corresponding to the specified cloud account. The electronic device 100 can display a printer option 252 on the print assistant interface 250. Among them, the printer option 252 can display the device information of the printer 200 (for example, device name "XX Printer PrinterP1", etc.) and the usage status (for example, "idle", etc.).

[0056] In one implementation, as Figure 2H shown, before the printer 200 joins the trust ring, when the electronic device 100 has configured the printer 200 to connect to the local area network where the electronic device 100 is located, after the electronic device 100 executes Figures 2A - 2D the electronic device 100 can directly display the printer option 252 on the print assistant interface 250. The electronic device 100 can receive an operation (such as a click) of the user on a certain print function option (for example, the document print option 253). In response to this operation, the electronic device 100 can execute the print operation corresponding to the print function option (for example, print a document) through the printer 200. When the print operation is completed, the electronic device 100 can bind the device information of the printer 200 to a specified cloud account, so that the printer 200 joins the trust ring corresponding to the specified cloud account.

[0057] It should be noted that Figures 2A - 2H is only used for exemplary explanation of the present application and does not constitute any limitation to the present application.

[0058] Figures 3A - 3G This is another set of interface schematic diagrams for adding a printer to the trust ring provided by the embodiments of the present application.

[0059] As Figure 3A shown, the electronic device 100 can display a desktop 210. For the description of the desktop 210, reference can be made to the description of the foregoing Figure 2A shown embodiments and will not be elaborated here.

[0060] The electronic device 100 can receive an operation (such as a click) of the user on the smart space application icon 213. In response to this operation, the electronic device 100 can display a smart space application interface 310 as Figure 3B shown.

[0061] As Figure 3B shown, the smart space application interface 310 can display an add control 313 and service cards of one or more devices (for example, the service card 311 of the TV and the service card 312 of the speaker). Among them, a specified cloud account is logged in to the smart space application of the electronic device 100.

[0062] The electronic device 100 can receive an operation (such as a click) from the user on the addition control 313. In response to this operation, the electronic device 100 can display a menu 314 as shown in Figure 3C .

[0063] As shown in Figure 3C , the menu 314 can include an add device control 315. The electronic device 100 can receive an operation (such as a click) from the user on the add device control 315. In response to this operation, the electronic device 100 can display a printer addition interface 260 as shown in Figure 3D .

[0064] As shown in Figure 3D , the description of the printer addition interface 260 can refer to the description in the foregoing Figure 2F -shown embodiment. The electronic device 100 can receive an operation (such as a click) from the user on the connection control 262. In response to this operation, the electronic device 100 can display a smart space application interface 310 as shown in Figure 3E .

[0065] As shown in Figure 3E , when the electronic device 100 configures the printer 200 to connect to the local area network where the electronic device 100 is located, the electronic device 100 can bind the device information of the printer 200 to a specified cloud account, so that the printer 200 joins the trust ring corresponding to the specified cloud account. The electronic device 100 can display a service card 316 of the printer 200 in the smart space application interface 310.

[0066] In one implementation, as shown in Figures 3F - 3G , when the printer 200 joins the trust ring, and before that, the electronic device 100 has configured the printer 200 to connect to the local area network where the electronic device 100 is located. After the electronic device 100 executes Figure 3A , the smart space application interface 310 can directly display the service card 316 of the printer 200. The electronic device 100 can receive an operation (such as a click) from the user on the service card 316. In response to this operation, the electronic device 100 can display a print assistant interface 250. The print assistant interface 250 can display printer options 252. The electronic device 100 can receive an operation (such as a click) from the user on a certain print function option (for example, the document print option 253). In response to this operation, the electronic device 100 can execute the print operation corresponding to the print function option (for example, print a document) through the printer 200. When the print operation is completed, the electronic device 100 can bind the device information of the printer 200 to a specified cloud account, so that the printer 200 joins the trust ring corresponding to the specified cloud account.

[0067] It should be noted that Figures 3A - 3G This is only for exemplary explanation of the present application and does not impose any limitation on the present application.

[0068] Figures 4A - 4E Another schematic diagram of the interface for adding a printer to the trust ring provided by an embodiment of the present application.

[0069] As Figure 4A shown, the electronic device 100 can receive an operation of the user on the status bar 211 (such as swiping down), and in response to this operation, the electronic device 100 can display a control center interface 410 as Figure 4B shown.

[0070] As Figure 4B shown, the control center interface 410 may include one or more function controls (for example, a wireless local area network (WLAN) switch control, a Bluetooth switch control, a low power mode switch control, a brightness adjustment control, a sound adjustment control), a music control card, and a smart interconnection control card 411.

[0071] The electronic device 100 can receive an operation of the user on the smart interconnection control card 411 (such as a click), and in response to this operation, the electronic device 100 can display a smart interconnection interface 420 as Figure 4C shown.

[0072] As Figure 4C shown, the smart interconnection interface 420 may include a device option 421 of the electronic device 100 and a deletion control 422. After the electronic device 100 obtains the online information of other devices within the trust ring, it can display the device options of other devices within the trust ring in the smart interconnection interface 420. Among them, each device within the trust ring is logged in with a specified cloud account or bound to a specified cloud account. For example, after the electronic device 100 discovers that the printer 200 is online, it can display the device option of the printer 200 on the smart interconnection interface 420. The deletion control 422 can be used to trigger the electronic device 100 to delete the device within the trust ring selected by the user from the trust ring, that is, to unbind the device within the trust ring selected by the user from the cloud account logged in on the electronic device 100.

[0073] When the electronic device 100 displays the smart interconnection interface 420, the electronic device 100 can search for the online information of other devices within the trust ring corresponding to the specified cloud account through a short-range communication technology (such as Bluetooth, WiFi) or a cloud server. The electronic device 100 can also search for devices around that are not within the trust ring corresponding to the specified cloud account through a short-range communication technology (such as Bluetooth, WiFi).

[0074] As Figure 4DAs shown, when the electronic device 100 discovers the printer 200 through the near field communication technology, and the printer 200 has not been added to the trust ring corresponding to the specified cloud account, the electronic device 100 can display a ring entry pop-up window 423. The ring entry pop-up window 423 may include the device name 424 of the printer 200 (for example, "XX printer Printer P1"), an add to trust ring control 425, and a cancel add control 426. The add to trust ring control 425 can be used to trigger the electronic device 100 to add the printer 200 to the trust ring corresponding to the specified cloud account logged in on the electronic device 100. The cancel control 426 can be used to trigger the electronic device 100 to cancel the addition of the printer 200 to the trust ring corresponding to the specified cloud account.

[0075] The electronic device 100 may receive a user operation (e.g., a single click) on the add to trust ring control 425. In response to the operation, the electronic device 100 sends the device information of the printer 200 and the designated cloud account to the cloud server, allowing the cloud server to bind the device information of the printer 200 to the designated cloud account, thereby adding the printer 200 to the trust ring corresponding to the designated cloud account. The electronic device 100 may also add the device information of the printer 200 to the local whitelist of devices that have been added to the ring.

[0076] like Figure 4E As shown, after the electronic device 100 is added to the trust ring corresponding to the designated account, the electronic device 100 can display the device option 427 of the printer 200 on the smart interconnection interface 420 after discovering that the printer 200 is online.

[0077] It should be noted that Figures 4A - 4E It is only used to illustrate the present application and does not constitute any limitation to the present application.

[0078] In one possible implementation, Figure 4F As shown, the electronic device 100 can receive a user operation (e.g., a single click) on the smart interconnection option 222 in the setting application interface 220. In response to the operation, the electronic device 100 can display the smart interconnection interface 430.

[0079] like Figure 4G As shown, the smart interconnection interface 430 may include text prompt information such as "Automatically discover devices with the same Honor account logged in with attachments, and intelligently transfer services to bring you a seamless collaborative experience in all scenarios. Learn more", one or more options (for example, application connection options, call sharing options, notification sharing options, keyboard and mouse sharing options, etc.), device list 431, etc., wherein, when the printer 200 joins the trust ring and is online, the device list 431 may include the online identification 432 of the printer 200, the device name of the printer 200 "XX Printer Printer P1", etc.

[0080] As Figure 4H shown, when the printer 200 is in the offline state, the device list 431 may include the offline identifier 433 of the printer 200, the device name "XX Printer Printer P1" of the printer 200, and so on.

[0081] It should be noted that Figures 4F - 4H This is only for exemplary explanation of the present application and does not constitute any limitation to the present application.

[0082] Next, the device architecture of a communication system 10 provided by an embodiment of the present application will be introduced.

[0083] Figure 5 It is a schematic diagram of the device architecture of a communication system 10 provided by an embodiment of the present application.

[0084] As Figure 5 shown, the device architecture of the communication system 10 may include: an electronic device 100, a printer 200, and a wireless access device 300. Among them, the electronic device 100 may include: a service application (which may be referred to as a first application), a wireless access mechanism framework (iconnect), an access networking (Nearby) service (which may also be referred to as a device discovery, connection, networking, and transmission service), an Android mDNS module (NsdManager), and a short-range communication module, where:

[0085] The service application may include application programs such as a print assistant, a control center, and a smart space.

[0086] The iconnect may include a device management application, which may be used to communicate with the device management service and the service application in the Nearby service, and send the data information (such as the online indication / offline indication of the printer 200, etc.) sent by the device management service to the service application. The device management application may also be used to communicate with the cloud server to obtain the device information of the devices that have joined the loop.

[0087] Nearby services may include device management services and the Android mDNS module. Among them: (1) The device management service (DeviceMonitorService) may include a device repository (DeviceRepo), an authentication module (AuthManager), and an mDNS module (MdnsMonitor). The device repository can be used to store device information of devices within the trust ring (such as device name, device status, network services supported by the device, etc.). The authentication module can be used to determine whether a specified electronic device has joined the trust ring. The mDNS module can be used to trigger the Android mDNS module to scan / resolve the network services supported by the printer 200 (subsequently referred to as network services for short). (2) The Android mDNS module may include service discovery, service resolution, network listening, callback management, and network service management. The Android mDNS module can scan the network services supported by the printer 200 through the short-range communication module and resolve the network services supported by the printer 200. When the electronic device 100 switches networks and the electronic device 100 is no longer in the same local area network as the printer 200, the Android mDNS module can also receive a network service offline notification from the short-range communication module. The network service offline notification is used to indicate that a specified network service can no longer be used (i.e., the specified network service has gone offline).

[0088] The short-range communication module can be used to communicate with the wireless access device 300 and the Android mDNS module. The short-range communication module can receive data information sent from the wireless access device 300, such as information about the network services of the printer 200, device information of the printer 200, etc. The short-range communication module can send the received data information to the Android mDNS module.

[0089] The wireless access device 300 can communicate with the printer 200 and the short-range communication module. The wireless access device 300 can receive data information sent by the printer 200, such as information about the network services of the printer 200, device information of the printer 200, etc. The wireless access device 300 can send the received data information to the short-range communication module.

[0090] The printer 200 can communicate with the wireless access device 300, such as sending information about the network services of the printer 200, device information of the printer 200, and so on to the wireless access device 300. It should be noted that when both the printer 200 and the electronic device 100 can communicate with the wireless access device 300, the printer 200 and the electronic device 100 are in the same local area network. At this time, the printer 200 is in the online state; when the printer 200 or the electronic device 100 cannot communicate with the wireless access device 300, the printer 200 and the electronic device 100 are not in the same local area network. At this time, the printer 200 is in the offline state.

[0091] It should be noted that Figure 5 It is only used for exemplary explanation of the present application and does not constitute any limitation to the present application.

[0092] In the embodiments of the present application, information about the network services of the printer 200, device information of the printer 200, etc. can be implemented based on the multicast domain name system (mDNS) protocol. The mDNS protocol (which can be abbreviated as mDNS later) is a network service discovery protocol applied within the scope of a local area network, which broadcasts and resolves network services within the local area network in a multicast manner. mDNS has the following characteristics: 1. mDNS does not require manual configuration of a DNS server or domain name; 2. mDNS only communicates within the local area network; 3. mDNS uses a multicast IP address for communication; 4. mDNS is extended based on the DNS protocol.

[0093] In the embodiments of the present application, the network services of the printer 200 can include one or more network services, where the one or more network services can include: _ipp._tcp service, _ipps._tcp service, _printer._tcp service, and so on. In subsequent embodiments, it is described by taking the network services of the printer 200 including three network services, and these three network services are ipp.tcp service, _ipps._tcp service, and _printer._tcp service as examples. One or more network services of the printer 200 can be used to control the printer 200, so that the electronic device 100 can control the printer 200 to execute the printing function through one or more network services. In specific implementation, the network services of the printer 200 can be different from the examples in the embodiments of the present application. That is to say, the present application does not limit what network services the printer 200 uses.

[0094] The network services described in the embodiments of the present application all refer to the network services of the printer 200.

[0095] Next, a specific process for the normal offline of the printer provided by the embodiments of the present application will be introduced.

[0096] As Figure 6 shown, the devices involved in the specific process of the normal offline of the printer include an electronic device 100, a wireless access device 300, and a printer 200. Among them, the electronic device 100 may include: a business application, a device management application, a device management service, a device warehouse, an authentication module, an mDNS module, an Android mDNS module, and a short-range communication module.

[0097] The specific process for the normal offline of the printer may include:

[0098] S601: The wireless access device 300 checks whether the printer 200 is in the specified local area network.

[0099] Among them, the specified local area network may refer to the local area network where the wireless access device 300 is located.

[0100] Specifically, the wireless access device network 300 may check whether the printer 200 is in the specified local area network according to methods such as a heartbeat mechanism, a timeout mechanism (ARP), and DHCP (Dynamic Host Configuration Protocol). Without limitation, the wireless access device 300 may also check whether the printer is in the specified local area network by other methods, and the present application does not limit this.

[0101] S602: The printer 200 and the wireless access device 300 disconnect the Wi-Fi connection.

[0102] When the printer 200 shuts down or the printer 200 switches the local area network, the printer 200 and the wireless access device 300 disconnect the Wi-Fi connection.

[0103] S603: The wireless access device 300 determines that the printer 200 has exited the specified local area network.

[0104] Specifically, the wireless access device 300 may determine that the printer 200 has exited the specified local area network according to methods such as a heartbeat mechanism, a timeout mechanism (ARP), and DHCP (Dynamic Host Configuration Protocol). Without limitation, the wireless access device 300 may also determine that the printer 200 has exited the specified local area network by other methods, and the present application does not limit this.

[0105] S604: The short-range communication module receives the offline notification of multiple network services (including network service 1, network service 2, and network service 3) broadcast by the wireless access device 300.

[0106] After the wireless access device 300 determines that the printer 200 has exited the specified local area network, the wireless access device 300 may broadcast a notification of the offline status of multiple network services of the printer 200 to each electronic device within the specified local area network. At this time, the electronic device 100 may receive the notification of the offline status of the multiple network services through the short-range communication module. Among them, the notification of the offline status of a certain network service may be used to indicate that the network service can no longer be used (that is, the network service has gone offline).

[0107] Among them, the notification of the offline status of multiple network services may include, but is not limited to: the notification of the offline status of network service 1 (which may be referred to as the first network service) (which may be referred to as the first offline notification), the notification of the offline status of network service 2 (which may be referred to as the second network service) (which may be referred to as the second offline notification), and the notification of the offline status of network service 3 (which may be referred to as the third network service) (which may be referred to as the third offline notification). Among them, the notification of the offline status of network service 1 is used to indicate that network service 1 is in the offline state, the notification of the offline status of network service 2 is used to indicate that network service 2 is in the offline state, and the notification of the offline status of network service 3 is used to indicate that network service 3 is in the offline state.

[0108] Exemplarily, the notification of the offline status of network service 1 may be the notification of the offline status of the _printer._tcp service, the notification of the offline status of network service 2 may be the notification of the offline status of the _ipp._tcp service, and the notification of the offline status of network service 3 may be the notification of the offline status of the _ipps._tcp service.

[0109] S605: The short-range communication module sends a notification of the offline status of multiple network services to the Android mDNS module.

[0110] S606: The Android mDNS module sends a notification of the offline status of multiple network services to the mDNS module.

[0111] S607: The mDNS module sends a notification of the offline status of multiple network services to the device management service.

[0112] S608: When receiving the notification of the offline status of multiple network services, the device management service may set the printer 200 to the offline state through the device repository.

[0113] S609: The device management service sends an offline indication of the printer 200 to the business application through the device management application.

[0114] S610: In response to the operation 1 of displaying the first interface of the business application, the business application may display that the printer 200 is in the offline state through the first interface.

[0115] Exemplarily, when the offline identifier 433 of the printer 200 is displayed in the intelligent interconnection interface 430 as shown in Figure 4H shown, or when in asFigure 4C The device options 427 of the printer 200 are not displayed on the intelligent interconnected interface 420 shown, or when the printer options 252 are not displayed on the print assistant interface 250 shown, it indicates that the printer 200 is in an offline state. Optionally, the electronic device 100 can also display that the printer 200 is in an offline state through other display styles, which is not limited herein. Figure 2E As can be seen from the specific process shown, in the scenario where the printer is normally offline, the state of the printer 200 displayed by the electronic device 100 is consistent with the actual state of the printer 200, that is to say, the electronic device 100 can accurately display the actual state of the printer 200.

[0116] From Figure 6 As can be seen from the specific process shown, in the scenario where the printer is normally offline, the state of the printer 200 displayed by the electronic device 100 is consistent with the actual state of the printer 200, that is to say, the electronic device 100 can accurately display the actual state of the printer 200.

[0117] Next, a specific process for abnormal offline of a printer provided by an embodiment of the present application will be introduced.

[0118] As Figure 7 shown, the devices involved in the specific process of abnormal offline of the printer include the electronic device 100, the wireless access device 300, and the printer 200. Among them, the electronic device 100 may include: a business application, a device management application, a device management service, a device warehouse, an authentication module, an mDNS module, an Android mDNS module, and a short-range communication module.

[0119] The specific process of abnormal offline of the printer may include:

[0120] S701: The wireless access device 300 checks whether the printer 200 is in a specified local area network.

[0121] Among them, this step can refer to Figure 6 the description of S601 shown, which will not be repeated here.

[0122] S702: The short-range communication module in the electronic device 100 disconnects the Wi-Fi connection with the wireless access device 300.

[0123] Specifically, when the electronic device 100 switches the local area network, the electronic device 100 and the wireless access device 300 disconnect the Wi-Fi connection. At this time, there is still a Wi-Fi connection between the wireless access device 300 and the printer 200.

[0124] S703: The short-range communication module determines that the electronic device 100 exits the specified local area network.

[0125] Specifically, when the short - range communication module establishes a Wi - Fi connection with the wireless access device 300, the short - range communication module can establish a socket connection for the mDNS multicast IP address and mDNS multicast port number of the local area network where the wireless access device 300 is located (i.e., the specified local area network). When the short - range communication module disconnects the Wi - Fi connection with the wireless access device 300, the socket connection is interrupted. Therefore, the short - range communication module can determine that the electronic device 100 exits the specified local area network.

[0126] S704: The short - range communication module sends the offline notifications of Network Service 1, Network Service 2, and Network Service 3 to the Android mDNS module.

[0127] Among them, the offline notification of Network Service 1 can be used to indicate that Network Service 1 has gone offline, the offline notification of Network Service 2 can be used to indicate that Network Service 2 has gone offline, and the offline notification of Network Service 3 can be used to indicate that Network Service 3 has gone offline.

[0128] Exemplarily, in the embodiments of the present application, Network Service 1 can be the _printer._tcp service, Network Service 2 can be the _ipp._tcp service, and Network Service 3 can be the _ipps._tcp service. Without limitation, in specific implementations, Network Service 1 can also be the _ipp._tcp service or the _ipps._tcp service, Network Service 2 can also be the _printer._tcp service or the _ipps._tcp service, and Network Service 3 can also be the _ipp._tcp service or the _printer._tcp service. The present application does not limit this.

[0129] S705: The Android mDNS module sends the offline notification of Network Service 1 to the mDNS module.

[0130] When the electronic device 100 switches the local area network, resulting in the disconnection of the Wi - Fi connection between the electronic device 100 and the wireless access device 300, for power consumption considerations, when the Android mDNS module receives the offline notifications of Network Service 1, Network Service 2, and Network Service 3, it will not, as Figure 6 shown, send the offline notifications of all network services to the mDNS module at the same time. Instead, it first sends the offline notification of one network service (the offline notification of Network Service 1 in the embodiments of the present application) to the mDNS module, and then, after waiting for a specified duration T2 (which can be called the second duration, for example, 150 seconds to 180 seconds, etc.), it sends the remaining offline notifications of network services (the offline notifications of Network Service 2 and Network Service 3 in the embodiments of the present application) to the mDNS module uniformly.

[0131] S706: The mDNS module sends a down indication of Network Service 1 to the device management service.

[0132] S707: When receiving the down indication of Network Service 1, the device management service can set Network Service 1 to the down state through the device repository.

[0133] Among them, the down indication of Network Service 1 can be used to indicate that Network Service 1 is in the down state.

[0134] S708: The device management service sends the down indication of Network Service 1 to the business application through the device management application.

[0135] Specifically, when the business application receives the down indication of Network Service 1, the business application will no longer execute the printing function using Printer 200 through Network Service 1.

[0136] S709: In response to an operation 1 (which can be called the first operation) of displaying the first interface of the business application, the business application displays that Printer 200 is in the up state through the first interface.

[0137] Specifically, before the electronic device 100 executes S701, Printer 200 can join the trust ring and be in the same local area network as the electronic device 100, and the electronic device 100 can use the printing function of Printer 200. At this time, in response to the operation 1 of displaying the first interface of the business application, the business application can display in the first interface that Printer 200 is in the up state.

[0138] Since when any network service of Printer 200 is in the up state, the electronic device 100 determines that Printer 200 is in the up state. Therefore, after the electronic device 100 executes S701 - S708, the device management service only sets Network Service 1 to the down state and only sends the down indication of Network Service 1 to the business application. The other two network services are still in the up state. Therefore, the electronic device 100 still determines that Printer 200 is in the up state, and the business application still displays through the first interface that Printer 200 is in the up state.

[0139] Exemplarily, when the online identifier 432 of Printer 200 is displayed in the intelligent interconnection interface 430 as shown in Figure 4G , or when the device option 427 of Printer 200 is displayed on the intelligent interconnection interface 420 as shown in Figure 4C , or when the printer option 252 is displayed in the print assistant interface 250 as shown in Figure 2E , it indicates that the status of Printer 200 is the up state. Optionally, the electronic device 100 can also display the up state of Printer 200 through other display styles, which is not limited here.

[0140] S710: After sending the offline notice of Network Service 1, the Android mDNS module waits for a specified duration T2.

[0141] Among them, the specified duration T2 can be 150 seconds to 180 seconds. Without limitation, the specified duration T2 can also be other values, which are not restricted in this application.

[0142] S711: After waiting for the specified duration T2, the Android mDNS module sends the offline notice of Network Service 2 to the mDNS module.

[0143] Exemplarily, the offline notice of Network Service 2 can be the offline notice of the _ipp._tcp service.

[0144] S712: The mDNS module sends the offline indication of Network Service 2 to the device management service.

[0145] S713: When receiving the offline indication of Network Service 2, the device management service can set Network Service 2 to the offline state through the device repository.

[0146] Among them, the offline indication of Network Service 2 can be used to indicate that Network Service 2 is in the offline state.

[0147] S714: The device management service sends the offline indication of Network Service 2 to the business application through the device management application.

[0148] Specifically, when the business application receives the offline indication of Network Service 2, the business application will no longer execute the printing function using Printer 200 through Network Service 2.

[0149] S715: The Android mDNS module sends the offline notice of Network Service 3 to the mDNS module.

[0150] Exemplarily, the offline notice of Network Service 3 can be the offline notice of the _ipps._tcp service.

[0151] S716: The mDNS module sends the offline indication of Network Service 3 to the device management service.

[0152] S717: When receiving the offline indication of Network Service 3, the device management service can set Network Service 3 to the offline state through the device repository.

[0153] Among them, the offline indication of Network Service 3 can be used to indicate that Network Service 3 is in the offline state.

[0154] S718: The device management service sends the offline indication of Network Service 3 to the business application through the device management application.

[0155] Specifically, when the business application receives the offline instruction of Network Service 3, the business application will no longer use Printer 200 to execute the printing function through Network Service 3.

[0156] S719: The device management service sets Printer 200 to the offline state through the device repository.

[0157] When receiving the offline notification of Network Service 1 and after an interval of a specified duration T2, when the device management service receives the offline notifications of Network Service 2 and Network Service 3, the device management service can determine that all network services of Printer 200 have gone offline. Therefore, the device management service can set Printer 200 to the offline state through the device repository.

[0158] S720: The device management service sends the offline instruction of Printer 200 to the business application through the device management application.

[0159] S721: In response to the operation 2 of displaying the first interface of the business application, the business application can display that Printer 200 is in the offline state through the first interface.

[0160] Among them, operation 2 (which can be called the second operation) can be the same operation as operation 1 or a different operation from operation 1.

[0161] Specifically, the description of this step can refer to Figure 6 the description of S610 in the illustrated embodiment, which will not be elaborated here.

[0162] From Figure 7 the specific process shown, different from Figure 6 the scenario where the printer goes offline normally as shown, in the scenario where the printer goes offline abnormally, when Electronic Device 100 switches the local area network and is no longer in the same local area network as Printer 200, due to power consumption considerations, the Android mDNS module will not send all the received network service offline notifications to the mDNS module at the same time. Instead, it first sends an offline notification of one network service (such as the offline notification of Network Service 1), and after waiting for the specified duration T2, it sends the remaining network service offline notifications (such as the offline notifications of Network Service 2 and Network Service 3).

[0163] Therefore, when the mDNS module receives a notification of a network service going offline (such as a notification of Network Service 1 going offline), and has not yet received notifications of the remaining network services going offline (such as notifications of Network Service 2 going offline and Network Service 3 going offline) during this period of time, the electronic device 100 only sets Network Service 1 to the offline state, and does not set the printer 200 to the offline state. Therefore, at this time, the electronic device 100 still shows that the printer 200 is in the online state. However, at this time, the electronic device 100 is no longer in the same local area network as the printer 200, and the electronic device 100 can no longer use the printing function of the printer 200. The printer 200 is actually in the offline state, and the state of the printer 200 shown by the electronic device 100 is not consistent with the actual state of the printer 200. That is to say, between S702 and S720, the electronic device 100 cannot accurately display the actual state of the printer 200, resulting in the electronic device 100 showing the online state of the printer 200 but the user being unable to print files normally, making the operation extremely inconvenient and affecting the usage experience of the printer.

[0164] Therefore, the present application provides a device management method, which may include: when the printer 200 and the electronic device 100 are in the same local area network, the electronic device 100 can store information about multiple network services of the printer 200. When the electronic device 100 switches the local area network and is no longer in the same local area network as the printer 200, and the mDNS module receives a notification of a network service going offline sent by the Android mDNS module (for example, receives a notification of Network Service 1 going offline, receives a notification of Network Service 2 going offline, and receives a notification of Network Service 3 going offline), the mDNS module can determine all the network services of the printer 200 based on the information about multiple network services of the printer 200. Next, the mDNS module can query the status of all the network services of the printer 200 through the Android mDNS module. If the mDNS module determines that all the network services of the printer 200 are in the offline state, the mDNS module can indicate to the device management service that all the network services of the printer 200 have gone offline. The device management service can set the printer 200 to the offline state through the device repository and send a notification of the printer 200 going offline to the business application. After receiving the notification of the printer 200 going offline, the business application can display that the printer 200 is in the offline state.

[0165] Implementing the device management method provided by the present application can enable the electronic device 100 to quickly adjust the status display of the printer 200 in the scenario where the electronic device 100 switches the local area network and is no longer in the same local area network as the printer 200, so that the state of the printer 200 shown by the electronic device 100 can be consistent with the actual state of the printer 200, reduce the duration of the electronic device 100 misdisplaying the state of the printer 200, facilitate the printing operation of the user, and improve the usage experience of the printer.

[0166] Next, an implementation manner of a device management method provided in an embodiment of this application will be introduced.

[0167] Figures 8A - 8E It is a schematic diagram of an implementation manner of a device management method provided in an embodiment of this application.

[0168] As Figure 8A shown, the devices involved in the implementation manner of this device management method include an electronic device 100, a wireless access device 300, and a printer 200. Among them, the electronic device 100 may include: a business application, a device management application, a device management service, a device warehouse, an authentication module, an mDNS module, an Android mDNS module, and a short-range communication module.

[0169] The implementation manner of this device management method may include:

[0170] Phase 1: The printer 200 goes online (as Figure 8A shown).

[0171] S801: The device management application binds to the device management service.

[0172] When the electronic device 100 is powered on, the device management application can be started. Then, the device management application can bind to the device management service and register a device status monitor in the device management service to implement inter-process communication (IPC) calls. Among them, the device status monitor can be used for the device management application to monitor whether the printer 200 is in an online state.

[0173] S802: The device management application sends the device information of the devices that have joined the loop to the device management service.

[0174] Among them, the "devices that have joined the loop" are also electronic devices that have joined the trust loop. In some application scenarios, if other electronic devices (such as the printer 200, etc.) bind / log in to the same specified cloud account as the electronic device 100 and join the trust loop, the cloud server can send the device information of the devices that have joined the loop to the device management application. Then, the device management application can send the device information of the devices that have joined the loop to the device management service.

[0175] S803: The device management service sends the device information of the devices that have joined the loop to the device warehouse.

[0176] Among them, the device information of the devices that have joined the loop may include the device information of the printer 200.

[0177] S804: The device warehouse saves the device information of the devices that have joined the loop.

[0178] Specifically, if the device information of the device already in the network includes the device information of the printer 200, the electronic device 100 can perform subsequent steps; otherwise, the electronic device 100 does not perform subsequent steps.

[0179] S805: The device management service calls the mDNS listening interface through the mDNS module, triggering the Android mDNS module to scan for specified network services based on mDNS.

[0180] Among them, the "specified network services" described in this step can refer to the network services supported by the printer 200, such as the aforementioned _ipp._tcp service, _ipps._tcp service, _printer._tcp service. In specific implementations, the network services supported by the printer 200 may also be different from the above examples, and this application does not limit this.

[0181] S806: The Android mDNS module listens for broadcast packets on a specified multicast IP address and a specified multicast port number through the short-range communication module.

[0182] Among them, when the electronic device 100 and the wireless access device 300 establish a Wi-Fi connection, the "specified multicast IP address" is the IP address of the local area network where the wireless access device 300 is located (for example, 224.0.0.251), and the "specified multicast port number" is the port number of the local area network where the wireless access device 300 is located (for example, 5353). It should be noted that the specified multicast IP address is not limited to 224.0.0.251 and can also be other IP addresses; the specified multicast port number is not limited to 5353 and can also be other port numbers.

[0183] S807: When the printer 200 and the wireless access device 300 establish a Wi-Fi connection, the printer 200 broadcasts the device information of the printer 200 through the wireless access device 300.

[0184] When the printer 200 and the wireless access device 300 establish a Wi-Fi connection and are in the same local area network as the electronic device 100 and the wireless access device 300, the printer 200 can broadcast the device information of the printer 200 to all devices in the local area network through the wireless access device 300 based on the broadcast packets on the specified multicast IP address and the specified multicast port number.

[0185] Among them, the device information of the printer 200 may include: the domain name of the printer 200, the service names and service types of multiple network services of the printer 200, etc.

[0186] S808: The short-range communication module receives a broadcast packet including the device information of the printer 200 broadcast by the wireless access device 300.

[0187] S809: The Android mDNS module receives a broadcast packet including the device information of the printer 200 sent by the short-range communication module.

[0188] S810: The Android mDNS module sends a service discovery notification to the mDNS module.

[0189] Among them, the service discovery notification is used to indicate that there is a specified network service in the same local area network as the electronic device 100. Each network service of the printer 200 corresponds to a service discovery notification. The service discovery notification may include the service name and service type of the specified network service.

[0190] S811: The mDNS module sends a service resolution instruction to the Android mDNS module.

[0191] Among them, each network service of the printer 200 corresponds to a service resolution instruction. The service resolution instruction may include the service name and service type of the specified network service.

[0192] S812: In response to the service resolution instruction, the Android mDNS module sends an mDNS query request to the wireless access device 300 through the short-range communication module.

[0193] Among them, the mDNS query request may carry: the specified multicast IP address, the specified multicast port number, the domain name of the printer 200, and the service name and service type of the specified network service, etc.

[0194] Among them, each network service of the printer 200 corresponds to an mDNS query request. For example, the _ipp._tcp service corresponds to an mDNS query request, the _ipps._tcp service corresponds to an mDNS query request, and the _printer._tcp service corresponds to an mDNS query request.

[0195] Exemplarily, the mDNS query request corresponding to the _ipp._tcp service may carry the specified multicast IP address 224.0.0.251, the specified multicast port number 5353, the domain name of the printer 200, the service name and service type of the _ipp._tcp service, etc. The information carried by the mDNS query request corresponding to the _ipps._tcp service and the mDNS query request corresponding to the _printer._tcp service may refer to the mDNS query request corresponding to the _ipp._tcp service, which will not be elaborated here.

[0196] S813: The wireless access device 300 sends an mDNS query request to the printer 200.

[0197] S814: The printer 200 sends an mDNS query response to the wireless access device 300.

[0198] Among them, the mDNS query response of the specified network service may include information about the specified network service, and the information about the specified network service may include one or more of the following: specified multicast IP address, specified multicast port number, device identifier of the printer 200, device name of the printer 200, domain name of the printer 200, IP address of the printer 200, service name of the specified network service, service type of the specified network service, port number corresponding to the specified network service, attributes of the specified network service, and so on.

[0199] Among them, each network service of the printer 200 corresponds to an mDNS query response. For example, the _ipp._tcp service corresponds to an mDNS query response, the _ipps._tcp service corresponds to an mDNS query response, and the _printer._tcp service corresponds to an mDNS query response.

[0200] S815: The wireless access device 300 sends an mDNS query response to the Android mDNS module through the short-range communication module.

[0201] S816: The Android mDNS module sends a service resolution notification to the mDNS module.

[0202] Among them, in this step and subsequent embodiments, the service resolution notification may carry a specified instance of the specified network service, and the specified instance of the specified network includes information about the specified network service. Each network service of the printer 200 corresponds to a service resolution notification.

[0203] In the embodiments of the present application, being able to receive the mDNS query response is called successful resolution, and being unable to receive the mDNS query response is called failed resolution. For example, if the Android mDNS module receives the mDNS query response corresponding to the _ipps._tcp service, then the _ipps._tcp service is a network service with successful resolution. If the Android mDNS module cannot receive the mDNS query response corresponding to the _ipps._tcp service, then the _ipps._tcp service is a network service with failed resolution.

[0204] S817: The mDNS module saves the information of multiple network services of the printer 200.

[0205] Exemplarily, taking the multiple network services of the printer 200 including Network Service 1, Network Service 2, and Network Service 3 as an example, where Network Service 1 is a _printer._tcp service, Network Service 2 is an _ipp._tcp service, and Network Service 3 is an _ipps._tcp service. When the mDNS module receives a service resolution notification for the _printer._tcp service, the mDNS module can obtain and save the information of the _printer._tcp service from this service resolution notification, such as the device identifier of the printer 200, the device name of the printer 200, the domain name of the printer 200, the IP address of the printer 200, the service name and service type of the _printer._tcp service, the port number corresponding to the _printer._tcp service, the attributes of the _printer._tcp service, etc.; when the mDNS module receives a service resolution notification for the _ipp._tcp service, the mDNS module can obtain and save the information of the _ipp._tcp service from this service resolution notification, such as the device identifier of the printer 200, the device name of the printer 200, the domain name of the printer 200, the IP address of the printer 200, the service name and service type of the _ipp._tcp service, the port number corresponding to the _ipp._tcp service, the attributes of the _ipp._tcp service, etc.; when the mDNS module receives a service resolution notification for the _ipps._tcp service, the mDNS module can obtain and save the information of the _ipps._tcp service from this service resolution notification, such as the device identifier of the printer 200, the device name of the printer 200, the domain name of the printer 200, the IP address of the printer 200, the service name and service type of the _ipps._tcp service, the port number corresponding to the _ipps._tcp service, the attributes of the _ipps._tcp service, etc.

[0206] S818: The mDNS module sends an online indication of Network Service 1 to the device management service.

[0207] Among them, the online indication of Network Service 1 is used to indicate that Network Service 1 is already in an online state.

[0208] S819: The device management service sets Network Service 1 to an online state through the device repository.

[0209] S820: The device management service sends an online indication of Network Service 1 to the business application through the device management application.

[0210] Specifically, after the business application receives the online indication of Network Service 1, the business application will be able to use the printer 200 to perform printing functions through Network Service 1.

[0211] S821: The mDNS module sends a device authentication request to the authentication module.

[0212] Among them, the device authentication request is used to request the authentication module to perform a whitelist authentication on the printer 200. Among them, the device name of the printer 200 is carried in the device authentication request.

[0213] S822: The authentication module queries through the device repository whether the printer 200 has joined the network.

[0214] Specifically, the device repository can store a whitelist including the device names of the devices that have joined the network. The authentication module can send the device name of the printer 200 to the device repository, and the device repository can query whether the device name of the printer 200 exists in the whitelist. If so, the printer 200 has joined the network; if not, the printer 200 has not joined the network.

[0215] S823: When it is determined that the printer 200 has joined the network, the device repository sends indication information 1 to the authentication module.

[0216] When it is determined that the device name of the printer 200 exists in the whitelist, the device repository can determine that the printer 200 has joined the network. The device repository can send indication information 1 to the authentication module, and this indication information 1 can be used to indicate that the printer 200 has joined the network.

[0217] S824: The authentication module sends an online indication of the printer 200 to the device management service.

[0218] Among them, this online indication of the printer 200 can be used to indicate that the printer 200 is in an online state (i.e., has gone online).

[0219] S825: The device management service sets the printer 200 to be in an online state through the device repository.

[0220] S826: The device management service sends an online indication of the printer 200 to the business application through the device management application.

[0221] S827: In response to an operation 1 for displaying the first interface of the business application, the business application displays that the printer 200 is in an online state through the first interface.

[0222] Among them, the description of this step can refer to the description in the foregoing embodiments and will not be elaborated here.

[0223] S828: The mDNS module sends an online indication of network service 2 to the device management service.

[0224] Among them, the online indication of network service 2 is used to indicate that network service 2 is already in an online state.

[0225] S829: The device management service sets Network Service 2 to the online state through the device repository.

[0226] S830: The device management service sends an online indication of Network Service 2 to the business application through the device management application.

[0227] Specifically, after the business application receives the online indication of Network Service 2, the business application will be able to execute the printing function using Printer 200 through Network Service 2.

[0228] S831: The mDNS module sends an online indication of Network Service 3 to the device management service.

[0229] Among them, the online indication of Network Service 3 is used to indicate that Network Service 3 is already in the online state.

[0230] S832: The device management service sets Network Service 3 to the online state through the device repository.

[0231] S833: The device management service sends an online indication of Network Service 3 to the business application through the device management application.

[0232] Specifically, after the business application receives the online indication of Network Service 3, the business application will be able to execute the printing function using Printer 200 through Network Service 3.

[0233] Phase Two: Electronic device 100 switches the local area network (as Figure 8B shown).

[0234] S834: The short-range communication module disconnects the Wi-Fi connection with the wireless access device 300.

[0235] When the electronic device 100 switches the local area network, the short-range communication module in the electronic device 100 disconnects the Wi-Fi connection with the wireless access device 300. At this time, the electronic device 100, the wireless access device 300, and Printer 200 are no longer in the same local area network, while Printer 200 and the wireless access device 300 are in the same local area network.

[0236] S835: The wireless access device 300 checks whether Printer 200 is in the specified local area network.

[0237] Since the wireless access device 300 and Printer 200 are still in the same local area network, the wireless access device 300 can check whether Printer 200 is in the specified local area network. The specific implementation method can refer to the foregoing embodiments.

[0238] S836: The short-range communication module determines that the electronic device 100 exits the specified local area network.

[0239] Among them, the description of this step can refer to the description of the foregoing embodiments.

[0240] Phase 3: Check whether the printer 200 is offline.

[0241] S837: The short - distance communication module sends the offline notifications of Network Service 1, Network Service 2, and Network Service 3 to the Android mDNS module.

[0242] Among them, the description of this step can refer to the description in the foregoing embodiments.

[0243] S838: The Android mDNS module sends the offline notification of Network Service 1 to the mDNS module.

[0244] Among them, the description of this step can refer to the description in the foregoing embodiments.

[0245] The first case: As Figure 8B shown, after S834 and before S840A, the electronic device 100 re - establishes a Wi - Fi connection with the wireless access device 300.

[0246] S839A: The short - distance communication module establishes a Wi - Fi connection with the wireless access device 300.

[0247] S840A: The mDNS module checks the status of Network Service 1.

[0248] Among them, the mDNS module can trigger the Android mDNS module to send an mDNS query request for Network Service 1 (which can be called the first mDNS query request) to the wireless access device 300. If the wireless access device 300 can send this mDNS query request to the printer 200, and the Android mDNS module can receive the mDNS query response of Network Service 1 sent by the printer 200 in response to this mDNS query request through the wireless access device 300, and then the mDNS module can receive the service resolution notification of Network Service 1 sent by the Android mDNS module in response to this mDNS query response, the mDNS module can determine that Network Service 1 is in the online state. If the mDNS module cannot receive the service resolution notification of Network Service 1, the mDNS module can determine that Network Service 1 is in the offline state. The specific implementation method will be described in detail in the subsequent embodiments.

[0249] S841A: The mDNS module determines that Network Service 1 is in the online state.

[0250] S842A: The mDNS module sends an online indication of Network Service 1 to the device management service.

[0251] S843A: The device management service sets Network Service 1 to the online state through the device repository.

[0252] S844A: The device management service sends an online indication of Network Service 1 to the business application through the device management application.

[0253] For the description of this step, reference can be made to the foregoing embodiments and will not be elaborated here.

[0254] S845A: The mDNS module determines that at least one network service is in an online state.

[0255] Exemplarily, in step S841A, the mDNS module determines that Network Service 1 is in an online state, satisfying the condition that at least one network service is in an online state. Therefore, the mDNS module can execute steps S846A - S849A to adjust Printer 200 to an online state.

[0256] S846A: The mDNS module sends indication information 2 to the device management service.

[0257] Among them, the indication information 2 can be used to indicate that at least one network service is in an online state.

[0258] S847A: The device management service sets Printer 200 to an online state through the device repository.

[0259] S848A: The device management service sends an online indication of Printer 200 to the business application through the device management application.

[0260] Among them, the online indication of Printer 200 can be used to indicate that Printer 200 is in an online state.

[0261] S849A: In response to the operation 2 of displaying the first interface of the business application, the business application displays that Printer 200 is in an online state through the first interface.

[0262] Among them, this step can refer to the description in the foregoing embodiments and will not be elaborated here.

[0263] S850A: After sending the offline notification of Network Service 1, the Android mDNS module waits for a specified duration T2.

[0264] Among them, this step can refer to the description in the foregoing embodiments and will not be elaborated here.

[0265] S851A: After waiting for the specified duration T2, the Android mDNS module sends an offline notification of Network Service 2 and an offline notification of Network Service 3 to the mDNS module.

[0266] Among them, this step can refer to the description in the foregoing embodiments and will not be elaborated here.

[0267] S852A: The mDNS module checks the status of Network Service 2.

[0268] S853A: The mDNS module determines that Network Service 2 is in the online state.

[0269] S854A: The mDNS module sends an online indication of Network Service 2 to the device management service.

[0270] S855A: The device management service sets Network Service 2 to the online state through the device repository.

[0271] S856A: The device management service sends an online indication of Network Service 2 to the business application through the device management application.

[0272] For the description of this step, reference can be made to the foregoing embodiments, which will not be elaborated here.

[0273] S857A: The mDNS module checks the status of Network Service 3.

[0274] S858A: The mDNS module determines that Network Service 3 is in the online state.

[0275] S859A: The mDNS module sends an online indication of Network Service 3 to the device management service.

[0276] S860A: The device management service sets Network Service 3 to the online state through the device repository.

[0277] S861A: The device management service sends an online indication of Network Service 3 to the business application through the device management application.

[0278] For the description of this step, reference can be made to the foregoing embodiments, which will not be elaborated here.

[0279] S862A: The mDNS module determines that at least one network service is in the online state.

[0280] Exemplarily, in steps S853A and S858A, the mDNS module determines that Network Service 2 and Network Service 3 are in the online state, meeting the condition that at least one network service is in the online state. Therefore, the mDNS module can execute steps S863A - S866A to adjust Printer 200 to the online state.

[0281] S863A: The mDNS module sends indication information 2 to the device management service.

[0282] Among them, the indication information 2 can be used to indicate that at least one network service is in the online state.

[0283] S864A: The device management service sets Printer 200 to the online state through the device repository.

[0284] S865A: The device management service sends an online indication of the printer 200 to the business application through the device management application.

[0285] Among them, the online indication of the printer 200 can be used to indicate that the printer 200 is in an online state.

[0286] S866A: In response to the operation 3 of displaying the first interface of the business application, the business application displays that the printer 200 is in an online state through the first interface.

[0287] Among them, operation 2 and operation 3 (which can be called the third operation) can be different operations or the same operation. This step can refer to the description in the foregoing embodiments and will not be elaborated here.

[0288] The second case: As Figure 8C shown, after S834 and before S840B, the electronic device 100 establishes a Wi-Fi connection with the wireless access device 300 again. However, before S853B, the electronic device 100 disconnects the Wi-Fi connection with the wireless access device 300 again.

[0289] S839B: The short-range communication module establishes a Wi-Fi connection with the wireless access device 300.

[0290] S840B: The mDNS module checks the status of network service 1.

[0291] S841B: The mDNS module determines that network service 1 is in an online state.

[0292] S842B: The mDNS module sends an online indication of network service 1 to the device management service.

[0293] S843B: The device management service sets network service 1 to be in an online state through the device repository.

[0294] S844B: The device management service sends an online indication of network service 1 to the business application through the device management application.

[0295] S845B: The mDNS module determines that at least one network service is in an online state.

[0296] S846B: The mDNS module sends indication information 2 to the device management service.

[0297] S847B: The device management service sets the printer 200 to be in an online state through the device repository.

[0298] S848B: The device management service sends an online indication of the printer 200 to the business application through the device management application.

[0299] S849B: In response to operation 2 of the display service application on the first interface, the service application displays through the first interface that the printer 200 is in the online state.

[0300] S850B: After sending the offline notification of network service 1, the Android mDNS module waits for a specified duration T2.

[0301] S851B: After waiting for the specified duration T2, the Android mDNS module sends the offline notifications of network service 2 and network service 3 to the mDNS module.

[0302] Among them, the descriptions of S839B to S851B can refer to Figure 8B S839A to S851A in

[0303] S852B: The short - range communication module disconnects the Wi - Fi connection with the wireless access device 300.

[0304] S853B: The mDNS module checks the status of network service 2.

[0305] S854B: The mDNS module determines that network service 2 is in the offline state.

[0306] S855B: The mDNS module sends an offline indication of network service 2 to the device management service.

[0307] S856B: The device management service sets network service 2 to the offline state through the device repository.

[0308] S857B: The device management service sends an offline indication of network service 2 to the service application through the device management application.

[0309] The description of this step can refer to the foregoing embodiments and will not be elaborated here.

[0310] S858B: The mDNS module checks the status of network service 3.

[0311] S859B: The mDNS module determines that network service 3 is in the offline state.

[0312] S860B: The mDNS module sends an offline indication of network service 3 to the device management service.

[0313] S861B: The device management service sets network service 3 to the offline state through the device repository.

[0314] S862B: The device management service sends an offline indication of network service 3 to the service application through the device management application.

[0315] For the description of this step, reference can be made to the foregoing embodiments and will not be elaborated herein.

[0316] S863B: The mDNS module obtains multiple network services supported by the printer 200 (including Network Service 1, Network Service 2, and Network Service 3) according to the information of the multiple network services saved.

[0317] Specifically, since in Figure 8A S817, the mDNS module has saved the information of multiple network services of the printer 200, therefore, the mDNS module can obtain the multiple network services supported by the printer 200 according to the saved information of the multiple network services. Among them, the multiple network services can include Network Service 1, Network Service 2, and Network Service 3.

[0318] S864B: The mDNS module checks the status of Network Service 1.

[0319] S865B: The mDNS module determines that Network Service 1 is in the offline state.

[0320] S866B: The mDNS module sends an offline indication of Network Service 1 to the device management service.

[0321] S867B: The device management service sets Network Service 1 to the offline state through the device repository.

[0322] S868B: The device management service sends an offline indication of Network Service 1 to the business application through the device management application.

[0323] For the description of this step, reference can be made to the foregoing embodiments and will not be elaborated herein.

[0324] S869B: The mDNS module determines that all the multiple network services are in the offline state.

[0325] Exemplarily, in steps S854B, S859B, and S869B, the mDNS module determines that Network Service 1, Network Service 2, and Network Service 3 are all in the offline state. Therefore, the mDNS module determines that all the multiple network services are in the offline state, and the mDNS module can execute steps S870B - S873B to adjust the printer 200 to the offline state.

[0326] S870B: The mDNS module sends indication information 3 to the device management service.

[0327] Among them, the indication information 3 can be used to indicate that all the multiple network services are in the offline state.

[0328] S871B: The device management service sets the printer 200 to the offline state through the device repository.

[0329] S872B: The device management service sends a printer 200 offline indication to the business application through the device management application.

[0330] S873B: In response to an operation 3 for displaying a first interface of the business application, the business application displays, through the first interface, that the printer 200 is in an offline state.

[0331] For the description of this step, reference can be made to the foregoing embodiments, and details are not described herein again.

[0332] The third case: As Figure 8D shown, after S834, the electronic device 100 does not establish a Wi-Fi connection with the wireless access device 300 anymore.

[0333] S839C: The mDNS module checks the status of network service 1.

[0334] S840C: The mDNS module determines that network service 1 is in an offline state.

[0335] S841C: The mDNS module sends a network service 1 offline indication to the device management service.

[0336] S842C: The device management service sets network service 1 to an offline state through the device repository.

[0337] S843C: The device management service sends a network service 1 offline indication to the business application through the device management application.

[0338] For the description of this step, reference can be made to the foregoing embodiments, and details are not described herein again.

[0339] S844C: The mDNS module obtains multiple network services supported by the printer 200 (including network service 1, network service 2, and network service 3) according to the information of multiple saved network services.

[0340] For the description of this step, reference can be made to the foregoing embodiments, and details are not described herein again.

[0341] S845C: The mDNS module checks the status of network service 2.

[0342] S846C: The mDNS module determines that network service 2 is in an offline state.

[0343] S847C: The mDNS module sends a network service 2 offline indication to the device management service.

[0344] S848C: The device management service sets network service 2 to an offline state through the device repository.

[0345] S849C: The device management service sends a network service 2 offline instruction to the business application through the device management application.

[0346] For the description of this step, reference can be made to the foregoing embodiments and will not be elaborated here.

[0347] S850C: The mDNS module checks the status of network service 3.

[0348] S851C: The mDNS module determines that network service 3 is in the offline state.

[0349] S852C: The mDNS module sends a network service 3 offline instruction to the device management service.

[0350] S853C: The device management service sets network service 3 to the offline state through the device repository.

[0351] S854C: The device management service sends a network service 3 offline instruction to the business application through the device management application.

[0352] For the description of this step, reference can be made to the foregoing embodiments and will not be elaborated here.

[0353] S855C: The mDNS module determines that multiple network services are all in the offline state.

[0354] Exemplarily, in steps S840C, S846C, and S851C, the mDNS module determines that network service 1, network service 2, and network service 3 are all in the offline state. Therefore, the mDNS module determines that multiple network services are all in the offline state, and the mDNS module can execute steps S856C - S859C to adjust the printer 200 to the offline state.

[0355] S856C: The mDNS module sends indication information 3 to the device management service.

[0356] Among them, the indication information 3 can be used to indicate that multiple network services are all in the offline state.

[0357] S857C: The device management service sets the printer 200 to the offline state through the device repository.

[0358] S858C: The device management service sends a printer 200 offline instruction to the business application through the device management application.

[0359] S859C: In response to an operation 2 for displaying the first interface of the business application, the business application displays that the printer 200 is in the offline state through the first interface.

[0360] For the description of this step, reference can be made to the foregoing embodiments and will not be elaborated here.

[0361] S860C: After sending the offline notice of Network Service 1, the Android mDNS module waits for a specified duration T2.

[0362] S861C: After waiting for the specified duration T2, the Android mDNS module sends the offline notices of Network Service 2 and Network Service 3 to the mDNS module.

[0363] S862C: The mDNS module checks the status of Network Service 2.

[0364] S863C: The mDNS module determines that Network Service 2 is in the offline state.

[0365] S864C: The mDNS module sends an offline indication of Network Service 2 to the device management service.

[0366] S865C: The device management service sets Network Service 2 to the offline state through the device repository.

[0367] S866C: The device management service sends an offline indication of Network Service 2 to the business application through the device management application.

[0368] For the description of this step, reference can be made to the foregoing embodiments, and details will not be repeated here.

[0369] S867C: The mDNS module checks the status of Network Service 3.

[0370] S868C: The mDNS module determines that Network Service 3 is in the offline state.

[0371] S869C: The mDNS module sends an offline indication of Network Service 3 to the device management service.

[0372] S870C: The device management service sets Network Service 3 to the offline state through the device repository.

[0373] S871C: The device management service sends an offline indication of Network Service 3 to the business application through the device management application.

[0374] For the description of this step, reference can be made to the foregoing embodiments, and details will not be repeated here.

[0375] S872C: The mDNS module obtains the multiple network services supported by the printer 200 (including Network Service 1, Network Service 2, and Network Service 3) according to the information of the multiple saved network services.

[0376] For the description of this step, reference can be made to the foregoing embodiments, and details will not be repeated here.

[0377] S873C: The mDNS module checks the status of Network Service 1.

[0378] S874C: The mDNS module determines that network service 1 is in the offline state.

[0379] S875C: The mDNS module sends an offline indication of network service 1 to the device management service.

[0380] S876C: The device management service sets network service 1 to the offline state through the device repository.

[0381] S877C: The device management service sends an offline indication of network service 1 to the business application through the device management application.

[0382] For the description of the above steps, reference can be made to the foregoing embodiments and will not be elaborated herein.

[0383] S878C: The mDNS module determines that multiple network services are all in the offline state.

[0384] Exemplarily, in steps S863C, S868C, and S874C, the mDNS module determines that network service 1, network service 2, and network service 3 are all in the offline state. Therefore, the mDNS module determines that multiple network services are all in the offline state, and the mDNS module can execute steps S879C - S882C to adjust printer 200 to the offline state.

[0385] S879C: The mDNS module sends indication information 3 to the device management service.

[0386] Among them, indication information 3 can be used to indicate that multiple network services are all in the offline state.

[0387] S880C: The device management service sets printer 200 to the offline state through the device repository.

[0388] S881C: The device management service sends an offline indication of printer 200 to the business application through the device management application.

[0389] S882C: In response to operation 3 for displaying the first interface of the business application, the business application displays that printer 200 is in the offline state through the first interface.

[0390] For the description of the above steps, reference can be made to the foregoing embodiments and will not be elaborated herein.

[0391] The fourth case: As Figure 8E shown, after S859D and before S863D, the electronic device 100 establishes a Wi-Fi connection with the wireless access device 300 again.

[0392] S839D: The mDNS module checks the status of network service 1.

[0393] S840D: The mDNS module determines that network service 1 is in the offline state.

[0394] S841D: The mDNS module sends an offline indication of network service 1 to the device management service.

[0395] S842D: The device management service sets network service 1 to the offline state through the device repository.

[0396] S843D: The device management service sends an offline indication of network service 1 to the business application through the device management application.

[0397] For the description of the above steps, reference can be made to the foregoing embodiments, which will not be elaborated here.

[0398] S844D: The mDNS module obtains multiple network services supported by the printer 200 (including network service 1, network service 2, and network service 3) according to the information of multiple saved network services.

[0399] For the description of this step, reference can be made to the foregoing embodiments, which will not be elaborated here.

[0400] S845D: The mDNS module checks the status of network service 2.

[0401] S846D: The mDNS module determines that network service 2 is in the offline state.

[0402] S847D: The mDNS module sends an offline indication of network service 2 to the device management service.

[0403] S848D: The device management service sets network service 2 to the offline state through the device repository.

[0404] S849D: The device management service sends an offline indication of network service 2 to the business application through the device management application.

[0405] For the description of the above steps, reference can be made to the foregoing embodiments, which will not be elaborated here.

[0406] S850D: The mDNS module checks the status of network service 3.

[0407] S851D: The mDNS module determines that network service 3 is in the offline state.

[0408] S852D: The mDNS module sends an offline indication of network service 3 to the device management service.

[0409] S853D: The device management service sets network service 3 to the offline state through the device repository.

[0410] S854D: The device management service sends a downline indication of Network Service 3 to the business application through the device management application.

[0411] For the description of the above steps, reference can be made to the foregoing embodiments, which will not be elaborated herein.

[0412] S855D: The mDNS module determines that multiple network services are all in the downline state.

[0413] Exemplarily, in steps S840D, S846D, and S851D, the mDNS module determines that Network Service 1, Network Service 2, and Network Service 3 are all in the downline state. Therefore, the mDNS module determines that multiple network services are all in the downline state, and the mDNS module can execute steps S856D - S859D to adjust Printer 200 to the downline state.

[0414] S856D: The mDNS module sends indication information 3 to the device management service.

[0415] Among them, the indication information 3 can be used to indicate that multiple network services are all in the downline state.

[0416] S857D: The device management service sets Printer 200 to the downline state through the device repository.

[0417] S858D: The device management service sends a downline indication of Printer 200 to the business application through the device management application.

[0418] S859D: In response to the operation 2 of displaying the first interface of the business application, the business application displays that Printer 200 is in the downline state through the first interface.

[0419] For the description of the above steps, reference can be made to the foregoing embodiments, which will not be elaborated herein.

[0420] S860D: After sending the downline notification of Network Service 1, the Android mDNS module waits for a specified duration T2.

[0421] S861D: After waiting for the specified duration T2, the Android mDNS module sends the downline notifications of Network Service 2 and Network Service 3 to the mDNS module.

[0422] S862D: The short - range communication module establishes a Wi - Fi connection with the wireless access device 300.

[0423] S863D: The mDNS module checks the status of Network Service 2.

[0424] S864D: The mDNS module determines that Network Service 2 is in the online state.

[0425] S865D: The mDNS module sends an online indication of Network Service 2 to the device management service.

[0426] S866D: The device management service sets Network Service 2 to the online state through the device repository.

[0427] S867D: The device management service sends an online indication of Network Service 2 to the business application through the device management application.

[0428] For the description of this step, reference can be made to the foregoing embodiments, and details will not be repeated here.

[0429] S868D: The mDNS module checks the status of Network Service 3.

[0430] S869D: The mDNS module determines that Network Service 3 is in the online state.

[0431] S870D: The mDNS module sends an online indication of Network Service 3 to the device management service.

[0432] S871D: The device management service sets Network Service 3 to the online state through the device repository.

[0433] S872D: The device management service sends an online indication of Network Service 3 to the business application through the device management application.

[0434] For the description of this step, reference can be made to the foregoing embodiments, and details will not be repeated here.

[0435] S873D: The mDNS module determines that at least one network service is in the online state.

[0436] Exemplarily, in steps S864D and S869D, the mDNS module determines that Network Service 2 and Network Service 3 are in the online state, meeting the condition that at least one network service is in the online state. Therefore, the mDNS module can execute steps S874D - S877D to adjust Printer 200 to the online state.

[0437] S874D: The mDNS module sends indication information 2 to the device management service.

[0438] Among them, the indication information 2 can be used to indicate that at least one network service is in the online state.

[0439] S875D: The device management service sets Printer 200 to the online state through the device repository.

[0440] S876D: The device management service sends an online indication of Printer 200 to the business application through the device management application.

[0441] Among them, the online indication of the printer 200 can be used to indicate that the printer 200 is in an online state.

[0442] S877D: In response to operation 3 of displaying the first interface of the service application, the service application displays that the printer 200 is in an online state through the first interface.

[0443] This step can refer to the description in the foregoing embodiments and will not be elaborated here.

[0444] In a specific implementation manner, there are also situations different from the above Figures 8B - 8E , for example:

[0445] The fifth situation: Based on Figure 8B the first situation shown, after S834 and before S840A, the electronic device 100 establishes a Wi-Fi connection with the wireless access device 300 again, but the network service 1 has an abnormality. Therefore, in S841A, the mDNS module determines that the network service 1 is in an offline state. At this time, the mDNS module needs to check the status of the network service 2 and the network service 3, and the executed process is Figure 8D S844C to S845C in Figure 8B , and then, it is determined that the network service 2 is in an online state and the network service 3 is in an online state. Next, the executed process can refer to Figure 8B S853A to S865A in

[0446] The sixth situation: Based on Figure 8E the fourth situation shown, after S858D and before S862D, the electronic device 100 establishes a Wi-Fi connection with the wireless access device 300 again, but at this time, the network services 2 and 3 have abnormalities. Therefore, in S863D, the mDNS module determines that the network service 2 is in an offline state. At this time, the execution is as Figure 8D S863C to S865C in Figure 8D ; in S867D, the mDNS module determines that the network service 3 is in an offline state. At this time, the execution is as Figure 8D S867C to S869C in Figure 8B , and then, the mDNS module needs to check the status of the network service 1 and execute

[0447] S870C to S871C in

[0448] From the above several situations, it can be seen that:

[0449] (1) When receiving the offline notification of Network Service 1, the mDNS module first checks the status of Network Service 1. If Network Service 1 is in the online state, the mDNS module instructs the service application through the device management service to display the online state of Printer 200. At this time, there is no need to check the status of Network Service 2 and Network Service 3. If Network Service 1 is in the offline state, the mDNS module then obtains multiple network services of Printer 200 through the saved information of multiple network services, and checks the status of network services other than Network Service 1 (in the embodiment of the present application, the status of Network Service 2 and Network Service 3). If at least one network service is in the online state, the mDNS module instructs the service application through the device management service to display the online state of Printer 200; if all three network services supported by Printer 200 are in the offline state, the mDNS module instructs the service application through the device management service to display the offline state of Printer 200.

[0450] (2) When receiving the offline notifications of Network Service 2 and Network Service 3, the mDNS module first checks the status of Network Service 2 and Network Service 3. If Network Service 2 and / or Network Service 3 is in the online state, the mDNS module instructs the service application through the device management service to display the online state of Printer 200. At this time, there is no need to check the status of Network Service 1. If Network Service 2 and Network Service 3 are in the offline state, the mDNS module then obtains multiple network services of Printer 200 through the saved information of multiple network services, and checks the status of network services other than Network Service 2 and Network Service 3 (in the embodiment of the present application, the status of Network Service 1). If at least one network service is in the online state, the mDNS module instructs the service application through the device management service to display the online state of Printer 200; if multiple network services are all in the offline state, the mDNS module instructs the service application through the device management service to display the offline state of Printer 200.

[0451] In this way, by implementing the device management method provided in the present application, in the scenario where Electronic Device 100 switches the local area network and is no longer in the same local area network as Printer 200, Electronic Device 100 can quickly adjust the status display of Printer 200, so that the status of Printer 200 displayed on Electronic Device 100 can be consistent with the actual status of Printer 200, reducing the duration of incorrect status display of Printer 200 on Electronic Device 100, facilitating the printing operation of the user, and enhancing the usage experience of the printer.

[0452] For example, when the device management method provided in the present application is not implemented, when the electronic device 100 switches the local area network and is no longer in the same local area network as the printer 200, since the mDNS module needs to wait for the offline notifications of network service 2 and network service 3 within 150 to 180 seconds after receiving the offline notification of network service 1, network service 2 and network service 3 are still in the online state within these 150 to 180 seconds. Therefore, the electronic device 100 will still display that the printer 200 is in the online state, resulting in the inconsistent state of the printer 200 displayed and the actual state of the printer 200.

[0453] However, when the device management method provided in the present application is implemented, when the mDNS module receives the offline notification of network service 1, it will check the status of multiple network services and determine the status of the printer 200 according to the status of multiple network services. In this way, the electronic device 100 can quickly adjust the status display of the printer 200 and reduce the duration of the electronic device 100 misdisplaying the status of the printer 200. For example, when there are 3 network services for the printer 200, the duration of the electronic device 100 misdisplaying the status of the printer 200 is only 3 seconds, rather than 150 to 180 seconds when this method is not implemented.

[0454] Meanwhile, when the device management method provided in the present application is implemented, when the mDNS module receives the offline notifications of network service 2 and network service 3, it will also check the status of multiple network services and determine the status of the printer 200 according to the status of multiple network services. In this way, it can be avoided that before the mDNS module of the electronic device 100 receives the offline notifications of network service 2 and network service 3, due to re-establishing a Wi-Fi connection with the wireless access device 300 again and thus returning to the local area network where the printer 200 is located, the electronic device 100 accurately displays that the status of the printer 200 is in the online state. Then, however, because the mDNS module receives the offline notifications of network service 2 and network service 3, the electronic device 100 sets and displays the printer 200 as being in the offline state again, resulting in the problem that the actual state of the printer 200 is inconsistent with the state of the printer 200 displayed by the electronic device 100.

[0455] Further, Figures 8A - 8E Some steps are described in detail.

[0456] Figures 9A - 9C This is a schematic diagram of the implementation of some steps of a device management method provided in an embodiment of the present application.

[0457] Such as Figures 9A - 9CAs shown, the devices involved in the specific process of the device management method include electronic device 100, wireless access device 300, and printer 200. Among them, the modules involved in electronic device 100 include: mDNS module, Java singleton thread pool, Android mDNS module, and short-range communication module.

[0458] The specific process of the device management method may include:

[0459] Partial steps in Stage 1 when printer 200 goes online are specifically implemented (as Figure 9A shown):

[0460] S901: The mDNS module calls the mDNS listening interface to trigger the Android mDNS module to scan for specified network services based on mDNS.

[0461] S902: The Android mDNS module listens for broadcast packets on the specified multicast IP address and specified multicast port number through the short-range communication module.

[0462] S903: When printer 200 and wireless access device 300 establish a Wi-Fi connection, printer 200 broadcasts the device information of printer 200 through wireless access device 300.

[0463] S904: The Android mDNS module receives, through the short-range communication module, a broadcast packet including the device information of printer 200 broadcast by wireless access device 300.

[0464] Among them, the descriptions of S901 to S904 can refer to the relevant descriptions in the foregoing Figure 8A embodiment.

[0465] S905: The Android mDNS module sends multiple service discovery notifications to the mDNS module.

[0466] Among them, the service discovery notification of the specified network service may carry the specified instance corresponding to the specified network service. The specified instance in the service discovery notification may include: the service type and service name of the specified network service, but information such as the IP address of printer 200, the port number of the specified network service, and attributes is null. Among them, the type of the specified instance carried by the service discovery notification may be an NsdServiceInfo instance, and each NsdServiceInfo instance is set with a unique identifier to distinguish each NsdServiceInfo instance.

[0467] In subsequent embodiments, the type of the specified instance carried in the service resolution instruction, service resolution notification, and offline notification of the specified network service may also be an NsdServiceInfo instance. It should be noted that the specified instance carried in the service resolution instruction of the specified network service includes the service type and service name of the specified network service, but the IP address of the printer 200, the device name of the printer 200, the port number and attributes of the specified network service, etc. are null values; the specified instance carried in the offline notification of the specified network service includes the service type and service name of the specified network service, but the IP address of the printer 200, the device name of the printer 200, the port number and attributes of the specified network service, etc. are null values; and the specified instance carried in the service resolution notification of the specified network service includes the information of the specified network service.

[0468] Exemplarily, in this step, the service discovery notification of network service 1 carries the specified instance A1 of network service 1, and the specified instance A1 includes the service type and service name of network service 1, but the IP address of the printer 200, the port number and attributes of network service 1, etc. are null values; the service discovery notification of network service 2 carries the specified instance B1 of network service 2, and the specified instance B1 includes the service type and service name of network service 2, but the IP address of the printer 200, the port number and attributes of network service 2, etc. are null values; the service discovery notification of network service 3 carries the specified instance C1 of network service 3, and the specified instance C1 includes the service type and service name of network service 3, but the IP address of the printer 200, the port number and attributes of network service 3, etc. are null values.

[0469] S906: The mDNS module sends service resolution instructions for multiple network services to the Java singleton thread pool.

[0470] Among them, in this step, the service resolution instruction of the specified network service may carry the specified instance of the specified network service. The specified instance of the service resolution instruction may include the service type and service name of the specified network service, but the IP address of the printer 200, the port number of the specified network service, and attributes, etc. are null values.

[0471] The specified instance in the service resolution instruction of the specified network service can be created by the mDNS module or carried by the service discovery notification of the specified network service. If the specified instance in the service resolution instruction of the specified network service is created by the mDNS module, the identifier of the specified instance in the service resolution instruction of the specified network service is different from the identifier of the specified instance in the service discovery notification of the specified network service; if the specified instance in the service resolution instruction of the specified network service is carried by the service discovery notification of the specified network service, the identifier of the specified instance in the service resolution instruction of the specified network service is the same as the identifier of the specified instance in the service discovery notification of the specified network service.

[0472] Exemplarily, the service resolution instruction of network service 1 (which can be referred to as the first service resolution instruction) carries the specified instance A2 of network service 1. The specified instance A2 includes: the service type and service name of network service 1, but information such as the IP address of printer 200, the port number and attributes of network service 1 is null.

[0473] If the specified instance A2 can be created by the mDNS module, at this time the identifier of the specified instance A2 is different from the identifier of the specified instance A1; if the specified instance A2 is carried by the service discovery notification of network service 1, then the specified instance A2 is the specified instance A1, and the identifier of the specified instance A2 is the same as the identifier of the specified instance A1. However, in any case, the content of the specified instance A2 is the same as the content of the specified instance A1.

[0474] S907: The Java singleton thread pool sends the service resolution instruction of network service 1 to the Android mDNS module.

[0475] Generally, for different network services, the sending of the mDNS query request triggered by the service resolution instruction and the receiving of the mDNS query response do not support concurrent operations between different network services. That is to say, only after the mDNS query request triggered by the service resolution instruction of the previous network service has been sent and the Android mDNS module has received the mDNS query response corresponding to the mDNS query request, can the mDNS module send the service resolution instruction of the next network service and then trigger the sending of the mDNS query request and the receiving of the mDNS query response of the next network service.

[0476] However, the generation time of the service resolution instruction is relatively short, while the time for the Android mDNS module to receive the mDNS query response is relatively long. Therefore, if the Android mDNS module has not received the mDNS query response of the previous network service, and the mDNS module has sent the service resolution instruction of the next network service to the Android mDNS module, it will not only cause the Android mDNS module to be unable to receive the mDNS query response of the previous network service, but also cause the Android mDNS module to be unable to receive the mDNS query response of the next network service.

[0477] Therefore, in Figure 9A the mDNS module sends the service resolution instructions of multiple network services to the Java singleton thread pool. Then, the Java singleton thread pool creates a thread to send the service resolution instruction of the specified network service to the Android mDNS module, and blocks the thread to wait for the mDNS query response of the specified network service. In this way, when the Android mDNS module receives the mDNS query response of the specified network service, the Java singleton thread pool will send the service resolution instruction of the next network service to the Android mDNS module, avoiding concurrent operations. The specific implementation method will be described in detail in the following embodiments.

[0478] S908: In response to the service resolution instruction of Network Service 1, the Android mDNS module sends an mDNS query request for Network Service 1 to the wireless access device 300 through the short-range communication module.

[0479] S909: The wireless access device 300 sends an mDNS query request for Network Service 1 to the printer 200.

[0480] S910: In response to the mDNS query request for Network Service 1, the printer 200 sends an mDNS query response for Network Service 1 to the wireless access device 300.

[0481] S911: The wireless access device 300 sends the mDNS query response for Network Service 1 to the Android mDNS module through the short-range communication module.

[0482] Among them, the descriptions of S908 to S911 can refer to the descriptions in the foregoing embodiments.

[0483] S912: The Android mDNS module sends a service resolution notification for Network Service 1 to the Java singleton thread pool.

[0484] S913: The Java singleton thread pool sends a service resolution notification for Network Service 1 to the mDNS module.

[0485] Among them, the service resolution notification of Network Service 1 can carry the specified instance A3 of Network Service 1. The specified instance A3 includes the information of Network Service 1 (such as the device name of Printer 200, the domain name of Printer 200, the IP address of Printer 200, the port number of Network Service 1, the attributes of Network Service 1, the service name and service type of Network Service 1, etc.).

[0486] It should be noted that in this step, the identifier of the specified instance A3 is the same as the identifier of the specified instance A2 in the service resolution instruction of Network Service 1.

[0487] For the subsequent descriptions of the service resolution notification of Network Service 2 and its corresponding specified instance B3, and the service resolution notification of Network Service 3 and its corresponding specified instance C3, reference can be made to the description of the service resolution notification of Network Service 1 and the specified instance A3 in this step.

[0488] Then, the process of the Java singleton thread pool sending the service resolution instruction of Network Service 2 to the Android mDNS module and the subsequent processes can refer to S907 - S913. Among them, the service resolution instruction of Network Service 2 carries the specified instance B2 of Network Service 2, and the service resolution notification of Network Service 2 carries the specified instance B3 of Network Service 2.

[0489] Next, the process of the Java singleton thread pool sending the service resolution instruction of Network Service 3 to the Android mDNS module and the subsequent processes can refer to S907 - S913. Among them, the service resolution instruction of Network Service 3 carries the specified instance C2 of Network Service 3, and the service resolution notification of Network Service 3 carries the specified instance C3 of Network Service 3.

[0490] Specific implementation method of step S817:

[0491] The mDNS module can save the information of multiple network services of Printer 200 in the form of key - value pairs. Among them, the key is the device name of Printer 200, and the value is the specified instance 2 (such as the PrinterSrcInfo instance). Specifically as follows:

[0492] S914: The mDNS module obtains the specified instance 2 corresponding to Printer 200.

[0493] Specifically, the mDNS module can use the device name of Printer 200 as the key to obtain the specified instance 2 corresponding to this key.

[0494] S915: When the specified instance 2 is successfully obtained, the mDNS module adds the information of the specified network service in each service resolution notification to the specified instance 2.

[0495] S916: When the acquisition of the specified instance 2 fails, the mDNS module creates the specified instance 2 and adds the information of the specified network service in each service resolution notification to the specified instance 2.

[0496] Among them, the specified instance 2 (such as the PrinterSrcInfo instance) may include: the IP address of the printer 200, the port numbers of each network service, the device name of the printer 200, the service types and service names of each network service, etc.

[0497] Exemplarily, the data structure of the specified instance 2 (such as the PrinterSrcInfo instance) may be as follows:

[0498] Device name of printer 200: XXX

[0499] IP address of printer 200: xxx.xxx.xxx.xxx

[0500] Device identifier of printer 200: xxx

[0501] Domain name of printer 200: XXXX

[0502] Online network service set: the service types and service names of each network service, the port numbers of each network service.

[0503] Among them, in the data structure of the specified instance 2, the same parts in the information of each network service such as the device name of the printer 200, the IP address of the printer 200, the device identifier of the printer 200, and the domain name of the printer 200 can be called the common information of each network service, and the different parts in the information of each network service such as the service types and service names of each network service, and the port numbers of each network service are called non-common information. The online network service set can be used to store the non-common information of each network service.

[0504] Such as Figures 9B - 9C As shown, in the embodiment of the present application, taking the example of checking the status of network service 1, the specific process of checking the status of the specified network service is specifically described. Figures 8B - 8E The specific implementation of checking the status of network service 2 and checking the status of network service 3 can refer to Figures 9B - 9C .

[0505] Such as Figure 9B As shown, the mDNS module checks the status of network service 1 and determines the situation where network service 1 is in the online state (that is, Figure 8B the specific implementation of S840A~S841A in Figure 8C S840B~S841B in

[0506] S917A: The mDNS module creates the specified instance A5 of network service 1.

[0507] When, during the stage of checking whether the printer 200 is offline, the specified instance carried in the service resolution instruction of the specified network service is the specified instance passed in by the offline notification of the specified network service, since before the Android mDNS module sends the offline notification of the specified network service, the Android mDNS module will record that the specified network service corresponding to the specified instance has sent an offline notification based on the identifier of the specified instance carried in the offline notification of the specified network service. Therefore, when the Java singleton thread pool passes the specified instance to the Android mDNS module again, the Android mDNS module can determine that the specified network service corresponding to the specified instance has sent an offline notification based on the identifier of the specified instance. At this time, the Android mDNS module will not send an mDNS query request, nor will it send data information to the mDNS module. The mDNS module will determine that the specified network service is in an offline state, which easily causes the status of the specified network service to be inaccurate compared to the actual situation.

[0508] Therefore, in the embodiments of the present application, during the stage of checking whether the printer 200 is offline, the mDNS module creates corresponding specified instances for each network service. In subsequent steps, the service resolution instructions of each network service carry the specified instances created by the mDNS module, rather than the specified instances in the offline notifications of the network services. In this way, when the mDNS module sends the service resolution instructions of each network service to the Android mDNS module through the Java singleton thread pool, the passed-in specified instances are not recorded by the Android mDNS module. Therefore, the Android mDNS module can normally send mDNS query requests. Among them, the specified instances corresponding to each network service created by the mDNS module include the service type and service name of each network service, but information such as the IP address of the printer 200, the device name of the printer 200, the port numbers and attributes of each network service are null values.

[0509] Exemplarily, before S917A, if the Android mDNS module sends a network service 1 offline notification to the mDNS module, the network service 1 offline notification may carry a specified instance A4 of network service 1 (which may be referred to as the first instance). The specified instance A4 may include the service type and service name of network service 1, but the IP address of printer 200, the port number of network service 1, and attributes and other information are null values. In this step, the mDNS module creates a specified instance A5 of network service 1 (which may be referred to as the second instance), and the specified instance A5 may include the service type and service name of network service 1, but the IP address of printer 200, the port number of network service 1, and attributes and other information are null values. That is to say, the content of specified instance A4 is the same as that of specified instance A5, but the identifier of specified instance A4 and the identifier of specified instance A5 are different. In the subsequent process, the service resolution instruction of network service 1 carries specified instance A5, rather than specified instance A4. The description of this part related to network service 2 and network service 3 in the subsequent embodiments can refer to this paragraph.

[0510] S918A: The mDNS module sends a service resolution instruction of network service 1 to the Java singleton thread pool.

[0511] Among them, the service resolution instruction of network service 1 carries specified instance A5.

[0512] S919A: The Java singleton thread pool sends a service resolution instruction of network service 1 to the Android mDNS module.

[0513] S920A: In response to the service resolution instruction of network service 1, the Android mDNS module sends an mDNS query request of network service 1 to the wireless access device 300 through the short-range communication module.

[0514] S921A: The wireless access device 300 sends an mDNS query request of network service 1 to the printer 200.

[0515] S922A: In response to the mDNS query request of network service 1, the printer 200 sends an mDNS query response of network service 1 to the wireless access device 300.

[0516] S923A: The Android mDNS module receives the mDNS query response of network service 1 sent by the wireless access device 300 through the short-range communication module.

[0517] Among them, the mDNS query response of network service 1 includes the information of network service 1.

[0518] S924A: The Android mDNS module sends a service resolution notification of network service 1 to the Java singleton thread pool.

[0519] Among them, the service resolution notification of Network Service 1 can carry the specified instance A6 of Network Service 1, and the specified instance A6 can include the information of Network Service 1. The identifier of the specified instance A6 can be the same as that of the specified instance A5. For the description of the information about Network Service 1, reference can be made to the foregoing embodiments.

[0520] S925A: The Java singleton thread pool sends a service resolution notification of Network Service 1 to the mDNS module.

[0521] S926A: When receiving the service resolution notification of Network Service 1, the mDNS module can determine that Network Service 1 is in the online state.

[0522] As Figure 9C shown, the mDNS module checks the status of Network Service 1 and determines the situation where Network Service 1 is in the offline state (i.e., Figure 8D the specific implementations in S839C - S840C, S873C - S874C in Figure 8E and S839D - S840D in

[0523] S917B: The mDNS module creates the specified instance A5 of Network Service 1.

[0524] For the description of this step, reference can be made to the foregoing embodiments.

[0525] S918B: The mDNS module sends a service resolution instruction of Network Service 1 to the Java singleton thread pool.

[0526] Among them, the service resolution instruction of Network Service 1 carries the specified instance A5.

[0527] S919B: The Java singleton thread pool sends a service resolution instruction of Network Service 1 to the Android mDNS module.

[0528] S920B: In response to the service resolution instruction of Network Service 1, the Android mDNS module sends an mDNS query request of Network Service 1 to the wireless access device 300 through the short - range communication module.

[0529] It should be noted that in Figure 8D the situations shown in S839C - S840C, S873C - S874C in Figure 8E and S839D - S840D in

[0530] S921B: When, within a specified duration T3 (which can be referred to as the first duration) after the Java singleton thread pool sends a service resolution instruction for Network Service 1, the mDNS module does not receive a service resolution notification for Network Service 1 sent by the Android mDNS module through the Java singleton thread pool, it is determined that Network Service 1 is in the offline state.

[0531] Generally, when the electronic device 100 and the printer 200 are not in the same local area network, the Android mDNS module does not receive an mDNS query response, so the Java singleton thread pool and the mDNS module do not receive the corresponding service resolution notification either. As a result, the Android mDNS module keeps waiting for the mDNS query response, and the Java singleton thread pool and the mDNS module also keep waiting for the corresponding service resolution notification, leading to the blockage of the process. In the embodiment of the present application, when, within the specified duration T3 after the Java singleton thread pool sends a service resolution instruction for Network Service 1, the mDNS module does not receive a service resolution notification for Network Service 1, it can be determined that Network Service 1 is in the offline state, and subsequent processes are carried out, solving the problem of process blockage and enabling the subsequent processes to proceed smoothly. The specific implementation will be described in detail in the subsequent embodiments.

[0532] It should be noted that Figures 9A - 9C The processes of the modules not involved can refer to the foregoing embodiments.

[0533] Furthermore, in combination with Figures 9B - 9C , on the basis of describing the implementation method of checking the status of the specified network service in detail, the specific implementation of checking the status of the printer 200 is described.

[0534] I. When the Android mDNS module sends a offline notification for Network Service 1, check the status of the printer 200 ( Figure 10 , Figures 11A - 11B ):

[0535] Figure 10 , Figures 11A - 11B Taking the example of checking the status of the printer 200 when the Android mDNS module sends a offline notification for Network Service 1. Among them, Figure 10 , Figures 11A - 11B The modules of the electronic device 100 involved may include: device management service, device repository, Android mDNS module, mDNS module, Java singleton thread pool, and Java synchronization utility class.

[0536] As Figure 10 shown, when the Android mDNS module sends a offline notification for Network Service 1, before checking the status of Network Service 1, the electronic device 100 re - establishes a Wi - Fi connection with the wireless access device 300 (for example Figure 8BThe first case shown Figure 8C The second case shown):

[0537] S1001: The Android mDNS module sends a network service 1 offline notification to the mDNS module (carrying the specified instance A4 of network service 1).

[0538] Among them, the description of this step can refer to the description of the foregoing embodiment.

[0539] S1002: The mDNS module creates the specified instance A5 of network service 1.

[0540] In this step, the mDNS module creates the specified instance of the specified network service and executes the subsequent process based on the created specified instance, rather than using the specified instance carried by the offline notification of the specified network service to execute the subsequent process. In this way, since the created specified instance is not recorded by the Android mDNS module, when the Android mDNS module receives the created specified instance, it will not determine that the specified network service corresponding to the specified instance has sent an offline notification. The Android mDNS module can send an mDNS query request to improve the accuracy of the status check of the specified network service.

[0541] S1003: The mDNS module creates a parsing task for network service 1 based on the specified instance A5.

[0542] Specifically, the parsing task of network service 1 (which can be called the first parsing task) can include: the service name and service type of network service 1, the service parsing instruction of network service 1, and the parsing result callback. The service parsing instruction of network service 1 can carry the specified instance A5 of network service 1, and the parsing result callback is used for the Android mDNS module to send a service parsing notification of network service 1 to the mDNS module.

[0543] S1004: The mDNS module determines whether there is currently a parsing task that is the same as the parsing task of network service 1.

[0544] Specifically, the mDNS module can determine whether there is currently a parsing task that is the same as the parsing task of network service 1 according to the service name and service type. If the mDNS module already has a parsing task that includes the service name and service type of network service 1, then there is currently a parsing task that is the same as the parsing task of network service 1. Otherwise, there is currently no parsing task that is the same as the parsing task of network service 1.

[0545] S1005A: If there is a parsing task that is the same as the parsing task of network service 1, the mDNS module discards the created parsing task of network service 1.

[0546] S1005B: If there is no parsing task identical to the parsing task of Network Service 1, the mDNS module saves the created parsing task of Network Service 1.

[0547] Specifically, the mDNS module can store the parsing task of Network Service 1 in a key-value pair set (map) in the form of key-value pairs. The key can be the string concatenation of the service name and service type of Network Service 1, and the value can be the specified instance A5 of Network Service 1, etc.

[0548] S1006: The mDNS module sends the parsing task of Network Service 1 to the Java singleton thread pool.

[0549] Specifically, the mDNS module can call the submit method in the Java singleton thread pool to send the parsing task of Network Service 1 to the Java singleton thread pool. When the Java singleton thread pool receives the parsing task of Network Service 1, it can start the Java singleton thread pool.

[0550] Check the status of Network Service 1:

[0551] S1007: The Java singleton thread pool creates Thread 1 (which can be referred to as the first thread).

[0552] S1008: The Java singleton thread pool sends the service parsing instruction of Network Service 1 to the Android mDNS module through this Thread 1 (carrying the specified instance A5).

[0553] Among them, in this step, the service parsing instruction of Network Service 1 carries the specified instance A5. The specified instance A5 can include the service type and service name of Network Service 1, but information such as the attributes of Network Service 1, the port number of Network Service 1, etc., and the IP address of Printer 200, etc. are null values.

[0554] S1009: The Java synchronization utility class sets the timeout parameter and the timer.

[0555] Exemplarily, the Java synchronization utility class can be CountDownLatch, which supports setting the timeout parameter.

[0556] Among them, the value of the timeout parameter can preferably be set to 1000 milliseconds, and this value can be the same as the aforementioned specified duration T3.

[0557] After S1008 and before S1009, the Android mDNS module can, in response to the service parsing instruction of Network Service 1, send an mDNS query request for Network Service 1 to the wireless access device 300 through the short-range communication module (which can refer to the foregoing embodiment). Figure 10(not shown in the previous embodiments). Similar steps for checking the status of Network 2 and the status of Network Service 3 later shall refer to this description.

[0558] S1010: The Java singleton thread pool sends a thread blocking instruction to the Java synchronization utility class.

[0559] S1011: When receiving the thread blocking instruction, the Java synchronization utility class blocks Thread 1 in the Java singleton thread pool.

[0560] Herein, blocking Thread 1 may refer to pausing the execution of Thread 1. Descriptions regarding blocking Thread 2, Thread 3, Thread 4, etc. in subsequent embodiments can refer to this description.

[0561] Executing S1010 - S1011 can avoid concurrent operations of sending mDNS query requests and receiving mDNS query responses for different network services.

[0562] S1012: The Android mDNS module sends a service resolution notification of Network Service 1 to the Java singleton thread pool, and the timing duration of the timer does not exceed the timeout parameter.

[0563] After S1009 and before S1012, the Android mDNS module may receive an mDNS query response of Network Service 1 sent by the short - range communication module (which can refer to the previous embodiments, Figure 10 (not shown in the previous embodiments). Similar steps for checking the status of Network 2 and the status of Network Service 3 later shall refer to this description.

[0564] S1013: The Java singleton thread pool sends a thread release instruction to the Java synchronization utility class.

[0565] S1014: The Java singleton thread pool sends a timing cancellation instruction to the Java synchronization utility class.

[0566] S1015: When receiving the thread release instruction, the Java synchronization utility class releases Thread 1 in the Java singleton thread pool.

[0567] Herein, releasing Thread 1 may refer to triggering Thread 1 to continue execution. Descriptions regarding releasing Thread 2, Thread 3, Thread 4, etc. in subsequent embodiments can refer to this description.

[0568] S1016: The Java singleton thread pool sends a service resolution notification of Network Service 1 to the mDNS module.

[0569] S1017: When receiving the service resolution notification of Network Service 1, the mDNS module can determine that Network Service 1 is in the online state.

[0570] S1018: The mDNS module sends an online indication of Network Service 1 to the device management service.

[0571] S1019: The device management service sets Network Service 1 to the online state through the device repository.

[0572] Determine that the printer 200 is in the online state:

[0573] S1020: The mDNS module determines that at least one network service is in the online state.

[0574] S1021: The mDNS module sends indication information 2 to the device management service.

[0575] Among them, the indication information 2 can be used to indicate that at least one network service is in the online state.

[0576] S1022: The device management service sets the printer 200 to the online state through the device repository.

[0577] This step can refer to the foregoing embodiments and will not be elaborated here.

[0578] It should be noted that Figure 10 The processes of the modules not involved can refer to the foregoing embodiments.

[0579] Such as Figures 11A - 11B shown, when the Android mDNS module sends a offline notification of Network Service 1, before checking the status of Network Service 1, the electronic device 100 does not establish a Wi-Fi connection with the wireless access device 300 again (for example Figure 8D shown in the third case, Figure 8E shown in the fourth case):

[0580] After executing Figure 10 S1001 - S1006 therein:

[0581] Check the status of Network Service 1:

[0582] S1101: The Java singleton thread pool creates Thread 1.

[0583] S1102: The Java singleton thread pool sends the service parsing instruction of Network Service 1 to the Android mDNS module through this Thread 1 (carrying the specified instance A5).

[0584] The description of this step can refer to the foregoing embodiments.

[0585] S1103: The Java synchronization utility class sets the timeout parameter and the timer.

[0586] The description of this step can refer to the foregoing embodiments.

[0587] S1104: The Java singleton thread pool sends a thread blocking instruction to the Java synchronization utility class.

[0588] S1105: When receiving the thread blocking instruction, the Java synchronization utility class blocks thread 1 in the Java singleton thread pool.

[0589] The description of this step can refer to the foregoing embodiments.

[0590] S1106: When the timing duration of the timer exceeds the timeout parameter and the Java singleton thread pool does not receive the service resolution notification of Network Service 1, the Java synchronization utility class releases thread 1 in the Java singleton thread pool.

[0591] S1107: The Java singleton thread pool sends a timer timeout indication message to the mDNS module.

[0592] Among them, the timer timeout indication message is used to indicate that the timing duration of the timer exceeds the timeout parameter.

[0593] S1108: After receiving the timer timeout indication message, the mDNS module determines that Network Service 1 is in the offline state.

[0594] S1109: The mDNS module sends an offline indication of Network Service 1 to the device management service.

[0595] S1110: The device management service sets Network Service 1 to the offline state through the device repository.

[0596] S1111: The mDNS module uses the device name of Printer 200 as the key to obtain the corresponding specified instance 2.

[0597] S1112: The mDNS module obtains multiple network services supported by Printer 200 (including Network Service 1, Network Service 2, and Network Service 3) from the specified instance 2.

[0598] S1113: The mDNS module creates a specified instance B5 of Network Service 2.

[0599] S1114: The mDNS module creates a specified instance C5 of Network Service 3.

[0600] Among them, the description of the specified instance B5 of Network Service 2 and the specified instance C5 of Network Service 3 can refer to the foregoing specified instance A5 of Network Service 1.

[0601] S1115: The mDNS module creates a parsing task for Network Service 2 based on the specified instance B5 and a parsing task for Network Service 3 based on the specified instance C5.

[0602] Among them, for the descriptions of the parsing task of Network Service 2 and the parsing task of Network Service 3, reference can be made to the parsing task of the foregoing Network Service 1.

[0603] S1116: The mDNS module determines whether there are currently parsing tasks identical to the parsing task of Network Service 2 and the parsing task of Network Service 3.

[0604] This step can refer to Figure 10 the description of S1004 in

[0605] S1117A: If there are parsing tasks identical to the parsing task of Network Service 2 and the parsing task of Network Service 3, the mDNS module discards the created parsing tasks of Network Service 2 and Network Service 3.

[0606] S1117B: If there are no parsing tasks identical to the parsing task of Network Service 2 and the parsing task of Network Service 3, the mDNS module saves the created parsing tasks of Network Service 2 and Network Service 3.

[0607] S1118: The mDNS module sends the parsing tasks of Network Service 2 and Network Service 3 to the Java singleton thread pool.

[0608] Check the status of Network Service 2:

[0609] S1119: The Java singleton thread pool creates Thread 2.

[0610] S1120: The Java singleton thread pool sends the service parsing instruction of Network Service 2 to the Android mDNS module (carrying the specified instance B5) through this Thread 2.

[0611] The description of this step can refer to the foregoing embodiments.

[0612] S1121: The Java synchronization utility class sets the timeout parameter and the timer.

[0613] The description of this step can refer to the foregoing embodiments.

[0614] S1122: The Java singleton thread pool sends a thread blocking instruction to the Java synchronization utility class.

[0615] S1123: When receiving the thread blocking instruction, the Java synchronization utility class blocks Thread 2 in the Java singleton thread pool.

[0616] The description of this step can refer to the foregoing embodiments.

[0617] S1124: When the timing duration of the timer exceeds the timeout parameter and the Java singleton thread pool does not receive the service resolution notification of Network Service 2, the Java synchronization utility class releases the thread 2 in the Java singleton thread pool.

[0618] S1125: The Java singleton thread pool sends a timer timeout indication message to the mDNS module.

[0619] Among them, the timer timeout indication message is used to indicate that the timing duration of the timer exceeds the timeout parameter.

[0620] S1126: After receiving the timer timeout indication message, the mDNS module determines that Network Service 2 is in the offline state.

[0621] S1127: The mDNS module sends an offline indication of Network Service 2 to the device management service.

[0622] S1128: The device management service sets Network Service 2 to the offline state through the device repository.

[0623] Check the status of Network Service 3:

[0624] S1129: The Java singleton thread pool creates thread 3.

[0625] S1130: The Java singleton thread pool sends the service resolution instruction of Network Service 3 to the Android mDNS module through this thread 3 (carrying the specified instance C5).

[0626] The description of this step can refer to the foregoing embodiments.

[0627] S1131: The Java synchronization utility class sets the timeout parameter and the timer.

[0628] The description of this step can refer to the foregoing embodiments.

[0629] S1132: The Java singleton thread pool sends a thread blocking instruction to the Java synchronization utility class.

[0630] S1133: When receiving the thread blocking instruction, the Java synchronization utility class blocks thread 3 in the Java singleton thread pool.

[0631] The description of this step can refer to the foregoing embodiments.

[0632] S1134: When the timing duration of the timer exceeds the timeout parameter and the Java singleton thread pool does not receive the service resolution notification of Network Service 3, the Java synchronization utility class releases the thread 3 in the Java singleton thread pool.

[0633] S1135: The Java singleton thread pool sends a timer timeout indication message to the mDNS module.

[0634] Among them, the timer timeout indication message is used to indicate that the timing duration of the timer has exceeded the timeout parameter.

[0635] S1136: After receiving the timer timeout indication message, the mDNS module determines that network service 3 is in the offline state.

[0636] S1137: The mDNS module sends an offline indication of network service 3 to the device management service.

[0637] S1138: The device management service sets network service 3 to the offline state through the device repository.

[0638] Determine that the printer 200 is in the offline state:

[0639] S1139: The mDNS module determines that multiple network services are all in the offline state.

[0640] S1140: The mDNS module sends indication message 3 to the device management service.

[0641] Among them, indication message 3 can be used to indicate that multiple network services are all in the offline state.

[0642] S1141: The device management service sets the printer 200 to the offline state through the device repository.

[0643] It should be noted that Figures 11A - 11B the processes of the modules not involved can refer to the foregoing embodiments.

[0644] II. When the Android mDNS module sends the offline notifications of network service 2 and network service 3, check the status of the printer 200 ( Figures 12A - 12B , Figures 13A - 13B ):

[0645] Figures 12A - 12B , Figures 13A - 13B Taking the case where the Android mDNS module sends the offline notifications of network service 2 and network service 3 and checks the status of the printer 200 as an example. Among them, Figures 12A - 12B , Figures 13A - 13B the modules of the electronic device 100 involved may include: the device management service, the device repository, the Android mDNS module, the mDNS module, the Java singleton thread pool, and the Java synchronization utility class.

[0646] Such as Figures 12A - 12BAs shown, when the Android mDNS module sends the offline notifications for Network Service 2 and Network Service 3, before checking the statuses of Network Service 2 and Network Service 3, the electronic device 100 re - establishes a Wi - Fi connection with the wireless access device 300 (for example Figure 8B the first case shown Figure 8E the fourth case shown):

[0647] S1201: The Android mDNS module sends the offline notification for Network Service 2 (carrying the specified instance B4 of Network Service 2) and the offline notification for Network Service 3 (the specified instance C4 of Network Service 3) to the mDNS module.

[0648] Among them, for the description of the specified instance B4 carried in the offline notification of Network Service 2 and the specified instance C4 carried in the offline notification of Network Service 3, reference can be made to the specified instance A4 carried in the offline notification of Network Service 1.

[0649] S1202: The mDNS module creates the specified instance B6 of Network Service 2.

[0650] S1203: The mDNS module creates the specified instance C6 of Network Service 3.

[0651] Among them, for the description of the specified instance B6 of Network Service 2 and the specified instance C6 of Network Service 3, reference can be made to the specified instance B5 of Network Service 2 and the specified instance C5 of Network Service 3 mentioned above.

[0652] S1204: The mDNS module creates the resolution task for Network Service 2 based on the specified instance B6 and creates the resolution task for Network Service 3 based on the specified instance C6.

[0653] Among them, for the description of the resolution task of Network Service 2 and the resolution task of Network Service 3, reference can be made to the resolution task of Network Service 1 mentioned above.

[0654] S1205: The mDNS module determines whether there are currently resolution tasks that are the same as the resolution tasks of Network Service 2 and Network Service 3.

[0655] This step can refer to the description of the foregoing embodiments.

[0656] S1206: If there are resolution tasks that are the same as the resolution tasks of Network Service 2 and Network Service 3, the mDNS module discards the created resolution tasks of Network Service 2 and Network Service 3.

[0657] S1207: If there is no parsing task that is the same as the parsing task of Network Service 2 and the parsing task of Network Service 3, the mDNS module saves the created parsing tasks of Network Service 2 and Network Service 3.

[0658] S1208: The mDNS module sends the parsing tasks of Network Service 2 and Network Service 3 to the Java singleton thread pool.

[0659] Check the status of Network Service 2:

[0660] S1209: The Java singleton thread pool creates Thread 4.

[0661] S1210: The Java singleton thread pool sends the service parsing instruction of Network Service 2 to the Android mDNS module through this Thread 4 (carrying the specified instance B6).

[0662] The description of this step can refer to the foregoing embodiment.

[0663] S1211: The Java synchronization utility class sets the timeout parameter and the timer.

[0664] The description of this step can refer to the foregoing embodiment.

[0665] S1212: The Java singleton thread pool sends a thread blocking instruction to the Java synchronization utility class.

[0666] S1213: When receiving the thread blocking instruction, the Java synchronization utility class blocks Thread 4 in the Java singleton thread pool.

[0667] The description of this step can refer to the foregoing embodiment.

[0668] S1214: The Android mDNS module sends a service parsing notification of Network Service 2 to the Java singleton thread pool, and the timing duration of the timer does not exceed the timeout parameter.

[0669] The description of this step can refer to the foregoing embodiment.

[0670] S1215: The Java singleton thread pool sends a thread release instruction to the Java synchronization utility class.

[0671] S1216: The Java singleton thread pool sends a timing cancellation instruction to the Java synchronization utility class.

[0672] S1217: When receiving the thread release instruction, the Java synchronization utility class releases Thread 4 in the Java singleton thread pool.

[0673] S1218: The Java singleton thread pool sends a service parsing notification of Network Service 2 to the mDNS module.

[0674] S1219: When receiving the service resolution notification of Network Service 2, the mDNS module can determine that Network Service 2 is in the online state.

[0675] S1220: The mDNS module sends an online indication of Network Service 2 to the device management service.

[0676] S1221: The device management service sets Network Service 2 to the online state through the device repository.

[0677] Check the status of Network Service 3:

[0678] S1222: The Java singleton thread pool creates Thread 5.

[0679] S1223: The Java singleton thread pool sends the service resolution instruction of Network Service 3 to the Android mDNS module through this Thread 5 (carrying the specified instance C6).

[0680] The description of this step can refer to the foregoing embodiments.

[0681] S1224: The Java synchronization utility class sets the timeout parameter and the timer.

[0682] The description of this step can refer to the foregoing embodiments.

[0683] S1225: The Java singleton thread pool sends a thread blocking instruction to the Java synchronization utility class.

[0684] S1226: When receiving the thread blocking instruction, the Java synchronization utility class blocks Thread 5 in the Java singleton thread pool.

[0685] The description of this step can refer to the foregoing embodiments.

[0686] S1227: The Android mDNS module sends a service resolution notification of Network Service 3 to the Java singleton thread pool, and the timing duration of the timer does not exceed the timeout parameter.

[0687] The description of this step can refer to the foregoing embodiments.

[0688] S1228: The Java singleton thread pool sends a thread release instruction to the Java synchronization utility class.

[0689] S1229: The Java singleton thread pool sends a timing cancellation instruction to the Java synchronization utility class.

[0690] S1230: When receiving the thread release instruction, the Java synchronization utility class releases Thread 5 in the Java singleton thread pool.

[0691] S1231: The Java singleton thread pool sends a service resolution notification of Network Service 3 to the mDNS module.

[0692] S1232: When receiving the service resolution notification of Network Service 3, the mDNS module can determine that Network Service 3 is in the online state.

[0693] S1233: The mDNS module sends an online indication of Network Service 3 to the device management service.

[0694] S1234: The device management service sets Network Service 3 to the online state through the device repository.

[0695] S1235: The mDNS module determines that at least one network service is in the online state.

[0696] S1236: The mDNS module sends indication information 2 to the device management service.

[0697] For the description of indication information 2, reference can be made to the description in the foregoing embodiments.

[0698] S1237: The device management service sets Printer 200 to the online state through the device repository.

[0699] It should be noted that Figures 12A - 12B For the processes of the modules not involved, reference can be made to the foregoing embodiments.

[0700] Such as Figures 13A - 13B shown, in the scenario where the Android mDNS module sends the offline notifications of Network Service 2 and Network Service 3, before checking the statuses of Network Service 2 and Network Service 3, the electronic device 100 has disconnected the Wi-Fi connection with the wireless access device 300 (such as Figure 8C the second case shown, Figure 8D the third case shown):

[0701] After executing Figure 12A S1201 - S1208:

[0702] Check the status of Network Service 2:

[0703] S1301: The Java singleton thread pool creates Thread 4.

[0704] S1302: The Java singleton thread pool sends the service resolution instruction of Network Service 2 to the Android mDNS module through this Thread 4 (carrying the specified instance B6).

[0705] For the description of this step, reference can be made to the foregoing embodiments.

[0706] S1303: Set timeout parameters and a timer for the Java synchronization utility class.

[0707] For the description of this step, reference may be made to the foregoing embodiments.

[0708] S1304: The Java singleton thread pool sends a thread blocking instruction to the Java synchronization utility class.

[0709] S1305: When receiving the thread blocking instruction, the Java synchronization utility class blocks thread 4 in the Java singleton thread pool.

[0710] For the description of this step, reference may be made to the foregoing embodiments.

[0711] S1306: When the elapsed time of the timer exceeds the timeout parameter and the Java singleton thread pool does not receive a service resolution notification from network service 2, the Java synchronization utility class releases thread 4 in the Java singleton thread pool.

[0712] S1307: The Java singleton thread pool sends a timer timeout indication message to the mDNS module.

[0713] Among them, the timer timeout indication message is used to indicate that the elapsed time of the timer exceeds the timeout parameter.

[0714] S1308: After receiving the timer timeout indication message, the mDNS module determines that network service 2 is in the offline state.

[0715] S1309: The mDNS module sends an offline indication of network service 2 to the device management service.

[0716] S1310: The device management service sets network service 2 to the offline state through the device repository.

[0717] Check the status of network service 3:

[0718] S1311: The Java singleton thread pool creates thread 5.

[0719] S1312: The Java singleton thread pool sends a service resolution instruction for network service 3 to the Android mDNS module (carrying the specified instance C6) through this thread 5.

[0720] For the description of this step, reference may be made to the foregoing embodiments.

[0721] S1313: Set timeout parameters and a timer for the Java synchronization utility class.

[0722] For the description of this step, reference may be made to the foregoing embodiments.

[0723] S1314: The Java singleton thread pool sends a thread blocking instruction to the Java synchronization utility class.

[0724] S1315: When receiving the thread blocking instruction, the Java synchronization utility class blocks the thread 5 in the Java singleton thread pool.

[0725] The description of this step can refer to the foregoing embodiments.

[0726] S1316: When the timing duration of the timer exceeds the timeout parameter and the Java singleton thread pool does not receive the service parsing notification of the network service 3, the Java synchronization utility class releases the thread 5 in the Java singleton thread pool.

[0727] S1317: The Java singleton thread pool sends a timer timeout indication message to the mDNS module.

[0728] Among them, the timer timeout indication message is used to indicate that the timing duration of the timer exceeds the timeout parameter.

[0729] S1318: After receiving the timer timeout indication message, the mDNS module determines that the network service 3 is in the offline state.

[0730] S1319: The mDNS module sends an offline indication of the network service 3 to the device management service.

[0731] S1320: The device management service sets the network service 3 to the offline state through the device repository.

[0732] S1321: The mDNS module uses the device name of the printer 200 as the key to obtain the corresponding specified instance 2.

[0733] S1322: The mDNS module obtains multiple network services supported by the printer 200 (including network service 1, network service 2, and network service 3) from the specified instance 2.

[0734] S1323: The mDNS module creates a specified instance A6 of the network service 1.

[0735] Among them, the specified instance A6 of the network service 1 can refer to the foregoing specified instance A5 of the network service 1.

[0736] S1324: The mDNS module creates a parsing task of the network service 1 based on the specified instance A6.

[0737] This step can refer to the foregoing embodiments.

[0738] S1325: The mDNS module determines whether there is currently a parsing task that is the same as the parsing task of the network service 1.

[0739] This step can refer to the foregoing embodiments.

[0740] S1326A: If there is a parsing task identical to the parsing task of Network Service 1, the mDNS module discards the created parsing task of Network Service 1.

[0741] S1326B: If there is no parsing task identical to the parsing task of Network Service 1, the mDNS module saves the created parsing task of Network Service 1.

[0742] S1327: The mDNS module sends the parsing task of Network Service 1 to the Java singleton thread pool.

[0743] Check the status of Network Service 1:

[0744] S1328: The Java singleton thread pool creates Thread 6.

[0745] S1329: The Java singleton thread pool sends the service parsing instruction of Network Service 1 to the Android mDNS module (carrying the specified instance A6) through this Thread 6.

[0746] The description of this step can refer to the foregoing embodiments.

[0747] S1330: The Java synchronization utility class sets the timeout parameter and the timer.

[0748] The description of this step can refer to the foregoing embodiments.

[0749] S1331: The Java singleton thread pool sends a thread blocking instruction to the Java synchronization utility class.

[0750] S1332: When receiving the thread blocking instruction, the Java synchronization utility class blocks Thread 6 in the Java singleton thread pool.

[0751] The description of this step can refer to the foregoing embodiments.

[0752] S1333: When the timing duration of the timer exceeds the timeout parameter and the Java singleton thread pool does not receive the service parsing notification of Network Service 1, the Java synchronization utility class releases Thread 6 in the Java singleton thread pool.

[0753] S1334: The Java singleton thread pool sends timer timeout indication information to the mDNS module.

[0754] Among them, the timer timeout indication information is used to indicate that the timing duration of the timer has exceeded the timeout parameter.

[0755] S1335: After receiving the timer timeout indication information, the mDNS module determines that Network Service 1 is in the offline state.

[0756] S1336: The mDNS module sends a downline indication of Network Service 1 to the device management service.

[0757] S1337: The device management service sets Network Service 1 to the downline state through the device repository.

[0758] Determine that the printer 200 is in the downline state:

[0759] S1338: The mDNS module determines that multiple network services are all in the downline state.

[0760] S1339: The mDNS module sends indication information 3 to the device management service.

[0761] Among them, the indication information 3 can be used to indicate that multiple network services are all in the downline state.

[0762] S1340: The device management service sets the printer 200 to the downline state through the device repository.

[0763] It should be noted that Figures 13A - 13B The processes of the modules not involved in can refer to the foregoing embodiments.

[0764] In a possible implementation manner, not limited to the three network services in the above example, the network services supported by the printer 200 can also be 2 network services, 4 network services, etc., and the implementation manner can refer to the processes described in the embodiments of the present application.

[0765] In a possible implementation manner, during the online stage of the printer 200, after the Android mDNS module sends a service discovery notification to the mDNS module, the mDNS module can create a specified instance A2 of Network Service 1, a specified instance B2 of Network Service 2, and a specified instance C2 of Network Service 3, and implement Figure 10 Some or all of the steps in.

[0766] Figure 14 It is a schematic hardware structure diagram of an electronic device 100 provided by an embodiment of the present application.

[0767] As Figure 14 shown, the electronic device 100 may include a processor 1401, a memory 1402, a wireless communication module 1403, a display screen 1404, a camera 1405 (optional), an audio module 1406 (optional), and a microphone 1407 (optional). The processor 1401, the memory 1402, the wireless communication module 1403, the display screen 1404, the camera 1405 (optional), the audio module 1406 (optional), and the microphone 1407 (optional) may be connected through a bus.

[0768] It can be understood that the structure schematically shown in the embodiments of the present application does not constitute a specific limitation on the electronic device 100. In some other embodiments of the present application, the electronic device 100 may further include more or fewer components than those Figure 14 shown, or combine some components, or split some components, or have different component arrangements. Figure 14 The components shown can be implemented in hardware, software, or a combination of software and hardware.

[0769] The processor 1401 may include one or more processor units. For example, the processor 1401 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Among them, different processing units may be independent devices or integrated in one or more processors. The controller can generate operation control signals according to the instruction operation code and timing signals to complete the control of fetching and executing instructions.

[0770] A memory may also be provided in the processor 1401 for storing instructions and data. In some embodiments, the memory in the processor 1401 is a cache memory. This memory can save the instructions or data that the processor 1401 has just used or recycled. If the processor 1401 needs to use the instruction or data again, it can directly call it from the memory. This avoids repeated accesses, reduces the waiting time of the processor 1401, and thus improves the efficiency of the system.

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

[0772] The memory 1402 is coupled to the processor 1401 and is used to store various software programs and / or multiple sets of instructions. In a specific implementation, the memory 1402 may include a volatile memory, such as a random access memory (RAM); it may also include a non-volatile memory, such as a ROM, a flash memory, a hard disk drive (HDD), or a solid-state drive (SSD); the memory 1402 may also include a combination of the above types of memories. The memory 1402 may further store some program codes so that the processor 1401 can call the program codes stored in the memory 1402 to implement the implementation method of the embodiments of the present application in the electronic device 100. The memory 1402 may store an operating system, such as an embedded operating system like uCOS, VxWorks, RTLinux, etc.

[0773] The wireless communication module 1403 can provide solutions for wireless communications applied to the electronic device 100, including wireless local area networks (WLANs) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc. The wireless communication module 1403 can be one or more devices integrating at least one communication processing module. The wireless communication module 1403 receives electromagnetic waves via an antenna, performs frequency modulation and filtering processing on the electromagnetic wave signals, and sends the processed signals to the processor 1401. The wireless communication module 1403 can also receive the signals to be sent from the processor 1401, perform frequency modulation and amplification on them, and convert them into electromagnetic waves through the antenna for radiation. In some embodiments, the electronic device 100 can also detect or scan devices near the electronic device 100 by transmitting signals through the Bluetooth module ( Figure 14 not shown), WLAN module ( Figure 14 not shown) in the wireless communication module 1403, and establish a wireless communication connection with the nearby devices to transmit data. Among them, the Bluetooth module can provide solutions for one or more Bluetooth communications including classic Bluetooth (basic rate / enhanced data rate, BR / EDR) or Bluetooth low energy (BLE), and the WLAN module can provide solutions for one or more WLAN communications including Wi-Fi direct, Wi-Fi LAN, or Wi-Fi softAP.

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

[0775] The camera 1405 is used to capture static images or videos. An object generates an optical image through a lens and projects it onto a photosensitive element. The photosensitive element may be a charge-coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then transmits the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard format such as RGB or YUV. In some embodiments, the electronic device 100 may include one or N cameras 1405, where N is a positive integer greater than 1.

[0776] The audio module 1406 can be used to convert digital audio information into an analog audio signal for output, and can also be used to convert an analog audio input into a digital audio signal. The audio module 1406 can also be used to encode and decode audio signals. In some embodiments, the audio module 1406 may also be disposed in the processor 1401, or some functional modules of the audio module 1406 may be disposed in the processor 1401.

[0777] The microphone 1407, also known as a "microphone" or "transmitter", can be used to collect sound signals in the environment around the electronic device, convert the sound signals into electrical signals, and then process the electrical signals through a series of operations such as analog-to-digital conversion to obtain an audio signal in digital form that can be processed by the processor 1401 of the electronic device. When making a call or sending a voice message, the user can speak close to the microphone 1407 with their mouth to input the sound signal into the microphone 1407. The electronic device 100 may be provided with at least one microphone 1407. In some other embodiments, the electronic device 100 may be provided with two microphones 1407, which can not only collect sound signals but also implement a noise reduction function. In some other embodiments, the electronic device 100 may also be provided with three, four or more microphones 1407 to implement functions such as collecting sound signals, noise reduction, identifying the sound source, and implementing a directional recording function.

[0778] The electronic device 100 may further include a sensor module ( Figure 14 not shown in the figure). The sensor module may include a plurality of sensor components, such as a touch sensor ( Figure 14 not shown in the figure), etc. The touch sensor may also be referred to as a "touch control device". The touch sensor may be disposed on the display screen 1404, and together with the display screen 1404, form a touch screen, also known as a "touch control screen". The touch sensor can be used to detect touch operations acting thereon or nearby.

[0779] It should be noted that Figure 14 the electronic device 100 shown in the figure is only used to exemplarily explain the hardware structure of the electronic device provided in this application, and does not constitute a specific limitation to this application.

[0780] Figure 15 This is a schematic diagram of the hardware structure of a printer 200 provided in an embodiment of this application.

[0781] As Figure 15 shown, the printer 200 may include: a processor 1501, a memory 1502, a wireless communication module 1503, a power switch 1504, and a printing module 1505. Among them:

[0782] The processor 1501 may include one or more processing units. For example, the processor 1501 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Among them, different processing units may be independent devices or integrated in one or more processors.

[0783] Among them, the controller may be the nerve center and command center of the printer 200. The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of fetching and executing instructions.

[0784] A memory may also be provided in the processor 1501 for storing instructions and data. In some embodiments, the memory in the processor 1501 is a cache memory. This memory can save the instructions or data that the processor 1501 has just used or recycled. If the processor 1501 needs to use the instruction or data again, it can be directly called from the memory. This avoids repeated accesses, reduces the waiting time of the processor 1501, and thus improves the efficiency of the system.

[0785] In some embodiments, the processor 1501 may be used to parse the signals received by the wireless communication module 1503 and demodulate the signals. The processor 1501 can respond according to the parsing results and perform corresponding operations, such as performing sensing operations, etc. In some embodiments, the processor 1501 may also be used to generate the signals sent out by the wireless communication module 1503, such as Wi-Fi signals, Bluetooth signals, etc.

[0786] The memory 1502 is coupled to the processor 1501 and is used to store various software programs and / or multiple sets of instructions. In a specific implementation, the memory 1502 may include a high-speed random access memory and may also include a non-volatile memory, such as one or more disk storage devices, flash memory devices, or other non-volatile solid-state storage devices. The memory 1502 can store an operating system, such as embedded operating systems like uCOS, VxWorks, RTLinux, etc. The memory 1502 can also store a communication program, which can be used to communicate with the wireless access device 300 or other devices.

[0787] The wireless communication module 1503 may include a Wi-Fi module. The Wi-Fi module may provide a solution for Wi-Fi wireless communication applied to the printer 200. Among them, the Wi-Fi protocol used in the Wi-Fi module may be IEEE802.11a, 802.11b, 802.11n, 802.11ac, 802.11ax, etc.

[0788] Possibly, the wireless communication module 1503 may further include other communication modules to provide solutions for other wireless communications (for example, Bluetooth (BT), Global Navigation Satellite System (GNSS), Frequency Modulation (FM), Near Field Communication (NFC), Infrared (IR)).

[0789] Possibly, the Wi-Fi module may be integrated with other communication modules (such as a Bluetooth communication module). The Wi-Fi module can monitor signals transmitted by other devices, such as measurement signals, scan signals, etc., and can send response signals, such as measurement responses, scan responses, etc., so that other devices can discover the wireless access device 300 and establish a wireless communication connection with other devices through one or more of WLAN, Bluetooth, or other short-range wireless communication technologies for data transmission.

[0790] In some other embodiments, one or more of the Wi-Fi modules can also transmit signals, such as broadcast probe signals, beacon signals, so that other devices can discover the wireless access device 300 and establish a wireless communication connection with other devices through WLAN or other short-range wireless communication technologies for data transmission.

[0791] The power switch 1504 can be used to turn off or turn on the printer 200.

[0792] The printing module 1505 can be used to print out paper documents. In a possible implementation, the printing module 1505 can also copy paper documents or scan electronic documents from paper documents.

[0793] It should be noted that Figure 15 The illustrated printer 200 is only one implementation of the embodiments of the present application. In actual applications, the printer 200 may further include more or fewer components, which are not limited here.

[0794] As used in the foregoing embodiments, depending on the context, the term "when" may be construed to mean "if", "after", "in response to determining", or "in response to detecting". Similarly, depending on the context, the phrase "upon determining" or "if (the stated condition or event) is detected" may be construed to mean "if determined", "in response to determining", "when (the stated condition or event) is detected", or "in response to detecting (the stated condition or event)".

[0795] In the foregoing embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented by software, it may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in the embodiments of the present application are generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (such as coaxial cable, optical fiber, digital subscriber line) or wirelessly (such as infrared, wireless, microwave, etc.). The computer-readable storage medium may be any available medium accessible by a computer or a data storage device such as a server or data center that includes one or more integrated available media. The available medium may be a magnetic medium (such as a floppy disk, hard disk, magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid-state drive), etc.

[0796] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the foregoing embodiments can be completed by relevant hardware instructed by a computer program. The program can be stored in a computer-readable storage medium. When the program is executed, it may include the processes of the foregoing method embodiments. The foregoing storage media include various media that can store program codes, such as ROM or random access memory RAM, magnetic disks, or optical discs.

Claims

1. A device management method, characterized in that, Applied to a first electronic device, the first electronic device includes an Android mDNS module, a device management service, a first application, and an mDNS module. The method includes: When the mDNS module receives information about multiple network services of a second electronic device sent by a wireless access device, the device management service sends an online indication of the second electronic device to the first application; After the first application receives the online indication of the second electronic device, in response to a first operation of displaying a first interface of the first application, the first electronic device displays the first interface, and the first interface includes an online identifier of the second electronic device; wherein, the multiple network services are used to control the second electronic device, and the multiple network services include a first network service; When the first electronic device disconnects the wireless connection with the wireless access device, the Android mDNS module sends a first offline notification of the first network service to the mDNS module; wherein, the first offline notification is used to indicate that the first network service is in an offline state; In response to the received first offline notification, the mDNS module queries the status of the multiple network services; When the mDNS module determines that all the multiple network services are in an offline state, the device management service sends an offline indication of the second electronic device to the first application; After the first application receives the offline indication of the second electronic device, in response to a second operation of displaying the first interface, the first electronic device displays the first interface, and the first interface includes an offline identifier of the second electronic device.

2. The method according to claim 1, characterized in that The method further includes: When the mDNS module determines that at least one of the multiple network services is in an online state, the device management service sends an online indication of the second electronic device to the first application; After the first application receives the online indication of the second electronic device, in response to a second operation of displaying the first interface, the first electronic device displays the first interface, and the first interface includes an online identifier of the second electronic device.

3. The method according to claim 2, wherein Before the mDNS module determines that at least one of the multiple network services is in an online state after the first electronic device disconnects the wireless connection with the wireless access device, the method further includes: The first electronic device establishes a wireless connection with the wireless access device.

4. The method according to claim 1, wherein The first electronic device further includes a Java singleton thread pool; the mDNS module determines that all the multiple network services are in an offline state, specifically including: The mDNS module sends a first service resolution instruction of the first network service to the Android mDNS module through the Java singleton thread pool; In response to the first service resolution instruction, the Android mDNS module sends a first mDNS query request of the first network service to the wireless access device; wherein, the first mDNS query request is used to trigger the second electronic device to send information about the first network service; When the Java singleton thread pool does not receive information of the first network service within the first duration, the mDNS module determines that the first network service is in an offline state.

5. The method according to claim 4, wherein The first electronic device further includes a Java synchronization utility class; the mDNS module sends a first service parsing instruction of the first network service to the Android mDNS module through the Java singleton thread pool, which specifically includes: The mDNS module creates a first parsing task for the first network service; wherein, the first service parsing instruction is included in the first parsing task; The mDNS module sends the first parsing task to the Java singleton thread pool; After receiving the first parsing task, the Java singleton thread pool creates a first thread; The Java singleton thread pool sends the first service parsing instruction to the Android mDNS module through the first thread; The Java singleton thread pool sends a thread blocking instruction to the Java synchronization utility class; The Java synchronization utility class blocks the first thread in the Java singleton thread pool; When the Java singleton thread pool does not receive information of the first network service within the first duration, the Java synchronization utility class releases the first thread in the Java singleton thread pool, and the mDNS module determines that the first network service is in an offline state.

6. The method according to claim 5, characterized in that, After the Java singleton thread pool sends the first service parsing instruction to the Android mDNS module through the first thread, the method further includes: The Java synchronization utility class sets a timer and timeout parameters; the value of the timeout parameter is the same as the value of the first duration; After the Java synchronization utility class releases the first thread in the Java singleton thread pool when the Java singleton thread pool does not receive information of the first network service within the first duration, the method further includes: The Java singleton thread pool sends timer timeout indication information to the mDNS module; wherein, the timer timeout indication information is used to indicate that the timing duration of the timer exceeds the timeout parameter; The mDNS module determines that the first network service is in an offline state, which specifically includes: When receiving the timer timeout indication information, the mDNS module determines that the first network service is in an offline state.

7. The method according to claim 4, characterized in that, The first offline notification carries a first instance of the first network service, the first instance includes the service name and service type of the first network service, and the IP address of the second electronic device, the device name of the second electronic device, the port number and attributes of the first network service in the first instance are null values; After the Android mDNS module sends the first offline notification of the first network service to the mDNS module, and before the mDNS module sends the first service parsing instruction of the first network service to the Android mDNS module through the Java singleton thread pool, the method further includes: The mDNS module creates a second instance of the first network service; wherein, the content of the second instance is the same as that of the first instance, and the identifier of the second instance is different from that of the first instance; The mDNS module sends a first service parsing instruction of the first network service to the Android mDNS module through the Java singleton thread pool, specifically including: The mDNS module sends, through the Java singleton thread pool, the first service parsing instruction of the first network service carrying the second instance to the Android mDNS module.

8. The method according to claim 4, wherein After the mDNS module determines that the first network service is in the offline state, the method further includes: The mDNS module obtains the multiple network services of the second electronic device from the saved information of the multiple network services; wherein, the multiple network services further include a second network service and a third network service; The mDNS module queries the status of the second network service and the status of the third network service; When the mDNS module determines that all the multiple network services are in the offline state, the device management service sends a offline indication of the second electronic device to the first application, specifically including: When the status of the first network service, the status of the second network service, and the status of the third network service are in the offline state, the device management service sends a offline indication of the second electronic device to the first application.

9. The method according to claim 8, characterized in that, The method further includes: When the mDNS module receives information on multiple network services of the second electronic device sent by a wireless access device, the mDNS module saves the information on the multiple network services.

10. The method according to claim 9, wherein The mDNS module saves the information on the multiple network services, specifically including: The mDNS module saves the information on the multiple network services in the form of key-value pairs; wherein, the key in the key-value pair is the device name of the second electronic device, and the value in the key-value pair is the information on the multiple network services.

11. The method according to claim 1, characterized in that, The multiple network services further include a second network service and a third network service; after the Android mDNS module sends a first offline notification of the first network service to the mDNS module, the method further includes: The Android mDNS module waits for a second duration; After waiting for the second duration, the Android mDNS module sends a second offline notification of the second network service and a third offline notification of the third network service to the mDNS module; wherein, the second offline notification is used to indicate that the second network service is in the offline state, and the third offline notification is used to indicate that the third network service is in the offline state; In response to the received second offline notification and third offline notification, the mDNS module queries the status of the multiple network services; When the mDNS module determines that all the multiple network services are in the offline state, the device management service sends a offline indication of the second electronic device to the first application; After the first application receives the offline indication of the second electronic device, in response to a third operation of displaying the first interface, the first electronic device displays the first interface, and the offline identifier of the second electronic device is included in the first interface.

12. An electronic device, which is a first electronic device, is characterized in that, The electronic device includes: a display screen, a wireless communication module, one or more processors, and one or more memories; wherein, the one or more memories, the display screen, the wireless communication module are coupled to the one or more processors, and the one or more memories are used to store computer program code, and the computer program code includes computer instructions. When the one or more processors execute the computer instructions, the method described in any one of claims 1-11 is performed.

13. A chip system, characterized in that, The chip system is applied to an electronic device, and the chip system includes one or more processors, and the processors are used to call computer instructions to cause the electronic device to perform the method described in any one of claims 1-11.

14. A computer-readable storage medium, comprising instructions, characterized in that, When the instruction runs on an electronic device, the electronic device is caused to perform the method described in any one of claims 1-11.

15. A computer program product, characterized in that, When the computer program product runs on an electronic device, the electronic device is caused to perform the method described in any one of claims 1-11.

Citation Information

Patent Citations

  • Method and system for managing multi-screen interactive equipment

    CN103702184A

  • Mobile terminal and intelligent household appliance interconnecting method and device

    CN104113458A

  • Household electrical appliance state information notification method and household electrical appliance state information notification device

    CN105471682A

  • Method and device for updating service state of mDNS gateway

    CN111131452A

  • State display method and device, terminal equipment, cloud server and medium

    CN116339879A