Device management method, communication system and related apparatus

By introducing the Android mDNS module and device management service into electronic devices, the network service status of printers can be monitored and quickly adjusted, solving the problem of inaccurate status display when switching local area networks and improving the user experience of printers.

CN120343101BActive Publication Date: 2026-03-27HONOR DEVICE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-01-10
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

When electronic devices switch local area networks, the printer's online/offline status cannot be accurately displayed, causing users to be unable to print normally and affecting the user experience.

Method used

By introducing the Android mDNS module, device management service, and mDNS module into electronic devices, the status monitoring and rapid adjustment of multiple network services can be achieved, ensuring timely updates to the printer status display when switching local area networks.

Benefits of technology

When electronic devices switch local area networks, the printer status display can be quickly adjusted to reduce the time of mis-display, thereby improving the accuracy of printer use and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120343101B_ABST
    Figure CN120343101B_ABST
Patent Text Reader

Abstract

The application discloses a device management method, a communication system and related devices, and relates to the terminal field, 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 indication of the second electronic device to a 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 comprises an online identification of the second electronic device. When the first electronic device disconnects the wireless connection with the wireless access device, the Android mDNS module sends a first offline notification of a first network service to an mDNS module. The mDNS module queries the state of the 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] The present application relates to the terminal field, and particularly relates to a device management method, a communication system and related devices. BACKGROUND

[0002] With the development of wireless communication technology, portable electronic devices such as smart phones and tablet computers begin to support users to share pictures, documents and other data, which improves the office efficiency and experience of users. 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 in an online state, and the user can print pictures, documents and other files without copying data on the smart phone to a computer. The user also does not need to use a data line to connect the smart phone to the printer to print pictures and documents on the smart phone. However, when the smart phone switches a network, the smart phone is no longer in the same local area network with the printer, and the smart phone cannot use the printer to print any more, but the smart phone still displays that the printer is in the online state within a certain time period. In this way, the smart phone cannot accurately display the actual online and offline states of the printer, which causes the user to be unable to normally print files, and the operation is extremely inconvenient, and the use experience of the printer is affected. SUMMARY

[0003] The present application provides a device management method, a communication system and related devices, which realize that when a first electronic device switches a local area network and is no longer in the same local area network with a second electronic device, the first electronic device can quickly adjust the state display of the second electronic device, and reduce the time length of misdisplaying the state of the second electronic device.

[0004] In a first aspect, the present application provides a device management service method applied to a first electronic device, the first electronic device comprising an Android mDNS module, a device management service, a first application and an mDNS module, the method comprising: when the mDNS module receives information of a plurality of 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 comprises an online identifier of the second electronic device. Wherein the plurality of network services are used to control the second electronic device, and the plurality of network services comprise 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 state of the plurality of network services. When the mDNS module determines that the plurality of network services are all in the 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 comprises 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 state display of the second electronic device, and reduce the time length of mistakenly displaying the state of the second electronic device.

[0005] In a possible implementation, the method further comprises: when the mDNS module determines that at least one network service of the plurality of 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 comprises 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 state display of the second electronic device, and reduce the time length of mistakenly displaying the state of the second electronic device.

[0006] In a possible implementation, before the mDNS module determines that at least one of the plurality of network services is in the online state after the first electronic device disconnects the wireless connection with the wireless access device, the method further includes: establishing, by the first electronic device, the 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 state display of the second electronic device, and reduce the time length of the false display of the state 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 plurality of network services are in the offline state, specifically including: sending, by the mDNS module, 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. 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 length, the mDNS module determines that the first network service is in the offline state. In this way, concurrent operations generated when the state check is performed between different network services can be avoided, and process blocking caused by continuous waiting of the mDNS module for 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 the first service resolution instruction of the first network service to the Android mDNS module through the Java singleton thread pool, specifically including: creating, by the mDNS module, a first resolution task of the first network service. The first resolution task includes the first service resolution instruction. The mDNS module sends the first resolution task to the Java singleton thread pool. After receiving the first resolution task, the Java singleton thread pool creates a first thread. The Java singleton thread pool sends the first service resolution 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 length, 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 the offline state. In this way, concurrent operations generated when the state check is performed between different network services can be avoided.

[0009] In a possible implementation, after the Java singleton thread pool sends the first service resolution instruction of the first network service 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 time length. After the Java singleton thread pool releases 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 the first time length, the method further includes: the Java singleton thread pool sends timer timeout indication information to the mDNS module. The timer timeout indication information is used to indicate that the timing length of the timer exceeds the timeout parameter. The mDNS module determines that the first network service is in an offline state, specifically including: when the timer timeout indication information is received, the mDNS module determines that the first network service is in an offline state. In this way, flow blocking caused by the mDNS module continuously waiting for the information of the network service sent by the second electronic device can be avoided.

[0010] In a possible implementation, the first offline notification carries a first instance of the first network service, the first instance including a service name and a 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 of the first network service and the attribute in the first instance being empty 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. The second instance and the first instance have the same content, and the second instance and the first instance have different identities. 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, the problem that the Android mDNS module does not send an mDNS query can be avoided because the service resolution instruction carries the 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 obtaining the plurality of network services of the second electronic device from the saved information of the plurality of network services. The plurality of network services further include a second network service and a third network service. The mDNS module queries the state of the second network service and the state of the third network service. When the mDNS module determines that the plurality of network services are all in the offline state, the device management service sends the offline indication of the second electronic device to the first application, specifically including: when the state of the first network service, the state of the second network service and the state of the third network service are in the offline state, the device management service sends the 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 state display of the second electronic device, and reduce the time length of the false display of the state of the second electronic device.

[0012] In a possible implementation, the method further includes: when the mDNS module receives the information of the plurality of network services of the second electronic device sent by the wireless access device, the mDNS module saves the information of the plurality of network services. In this way, the efficiency of the mDNS module in checking the state of the network service of the second electronic device when receiving the offline notification of the network service can be improved.

[0013] In a possible implementation, the mDNS module saves the information of the plurality of network services, specifically including: the mDNS module saves the information of the plurality of network services in the form of key-value pairs. 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 plurality of network services. In this way, the efficiency of the mDNS module in checking the state of the network service of the second electronic device when receiving the offline notification of the network service can be improved.

[0014] In a possible implementation, the plurality of network services further include a second network service and a third network service. After the Android mDNS module sends the first offline notification of the first network service to the mDNS module, the method further includes that the Android mDNS module waits for a second time length. After waiting for the second time length, 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. 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 the received second offline notification and the third offline notification, the mDNS module queries the states of the plurality of network services. When the mDNS module determines that the plurality of network services are all in offline states, 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 offline identification of the second electronic device is included in the first interface. In this way, when the first electronic device switches between local area networks, the first electronic device can quickly adjust the state display of the second electronic device, and reduce the time length of mistakenly displaying the state of the second electronic device.

[0015] In a second aspect, the present application provides an electronic device, which is a first electronic device. The electronic device includes a display screen, a wireless communication module, one or more processors, and one or more memories. The one or more memories, the display screen, the wireless communication module, and the one or more processors are coupled. The one or more memories are configured to store computer program codes, and the computer program codes include computer instructions. When the one or more processors execute the computer instructions, the computer instructions cause the execution of the method in any possible implementation of the first aspect. In this way, when the first electronic device switches between 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 state display of the second electronic device, and reduce the time length of mistakenly displaying the state of the second electronic device.

[0016] In a third aspect, the present application provides a chip system, which is applied to an electronic device. The chip system includes one or more processors. The processor is configured to invoke computer instructions to cause the electronic device to execute the method in any possible implementation of the first aspect. In this way, when the first electronic device switches between 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 state display of the second electronic device, and reduce the time length of mistakenly displaying the state of the second electronic device.

[0017] In a fourth aspect, the present application provides a computer readable storage medium, including instructions, when the instructions are executed on an electronic device, causing the electronic device to perform the method in any possible implementation manner of the first aspect. 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 state display of the second electronic device, and reduce the time length of the false display of the state of the second electronic device.

[0018] In a fifth aspect, the present application provides a computer program product, when the computer program product is executed on an electronic device, causing the electronic device to perform the method in any possible implementation manner of the first aspect. 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 state display of the second electronic device, and reduce the time length of the false display of the state of the second electronic device. BRIEF DESCRIPTION OF DRAWINGS

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

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

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

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

[0023] Figures 4F-4H A set of interface schematic diagrams for displaying a state of a printer are provided for an embodiment of the present application;

[0024] Figure 5 A schematic diagram of an apparatus architecture of a communication system 10 is provided for an embodiment of the present application;

[0025] Figure 6 A specific flowchart of a normal offline of a printer is provided for an embodiment of the present application;

[0026] Figure 7 A specific flowchart of an abnormal offline of a printer is provided for an embodiment of the present application;

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

[0028] Figures 9A-9CPart of the steps of a device management method provided by an embodiment of the present application are shown in the schematic diagram.

[0029] Figure 10 A flowchart of network service inspection provided by an embodiment of the present application is shown in the schematic diagram.

[0030] Figures 11A-11B Another flowchart of network service inspection provided by an embodiment of the present application is shown in the schematic diagram.

[0031] Figures 12A-12B Still another flowchart of network service inspection provided by an embodiment of the present application is shown in the schematic diagram.

[0032] Figures 13A-13B Still another flowchart of network service inspection provided by an embodiment of the present application is shown in the schematic diagram.

[0033] Figure 14 A hardware structure schematic diagram of an electronic device 100 provided by an embodiment of the present application is shown in the schematic diagram.

[0034] Figure 15 A hardware structure schematic diagram of a printer 200 provided by an embodiment of the present application is shown in the schematic diagram. DETAILED DESCRIPTION

[0035] The terms used in the following embodiments of the present application are only for the purpose of describing particular embodiments and are not intended to be limiting of the present application. As used in the specification and the appended claims of the present application, the singular forms "a," "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and / or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and / or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof. In the embodiments of the present application, the terms "first," "second," are used only for the purpose of description, and cannot be understood as indicating relative importance or implicitly indicating the number of technical features indicated. Therefore, the features with "first," "second" can explicitly or implicitly include one or more of the features, and in the description of the embodiments of the present application, the meaning of "a plurality of" is two or more, unless otherwise specified.

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

[0037] Figure 1 An architecture schematic diagram of a communication system 10 provided by an embodiment of the present application is shown in the schematic diagram.

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

[0039] In the embodiment 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 can use the printer 200 to print. At this time, the state of the printer 200 can be referred to as an online state. When the electronic device 100 and / or the printer 200 are disconnected from the wireless access device 300, the electronic device 100 cannot communicate with the printer 200 through the wireless access device 300, and the electronic device 100 and the printer 200 are not in the same local area network. At this time, the electronic device 100 cannot use the printer 200 to print, and the state of the printer 200 can be referred to as an offline state.

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

[0041] Next, the method for adding a printer to a trust circle provided by the embodiment of the present application is introduced.

[0042] Figures 2A-2H A set of interface schematic diagrams for adding a printer into a trust circle provided by the embodiment of the present application.

[0043] As shown in Figure 2A , the electronic device 100 can display a desktop 210. Among them, the desktop 210 displays a page on which application icons are placed. The page can include a plurality of application icons (for example, a weather application icon, a stock application icon, a calculator application icon, a settings application icon 212, a mail application icon, a gallery application icon, a music application icon, a video application icon, a browser application icon, a smart space application icon, etc.). A status bar 211 is displayed in an upper portion area of the desktop 210, and the status bar 211 can include one or more signal strength indicators of a mobile communication signal (also referred to as a cellular signal), a battery status indicator, a time indicator, a Wi-Fi signal indicator, and the like.

[0044] The electronic device 100 can receive a user operation (for example, a single click) on the settings application icon 212, and in response to the operation, the electronic device 100 can display a settings application interface 220 as shown in Figure 2B .

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

[0046] The electronic device 100 can receive a user operation (for example, a single click) on the more connection option 221, and in response to the operation, the electronic device 100 can display a more connection interface 230 as shown in Figure 2C .

[0047] As shown in Figure 2C , the more connection interface 230 can display one or more options, for example, an NFC option, a HONOR Share option, a HONOR CarLink option, a wireless projection option, a connection to Windows option, a print option 231, a VPN option, and an encrypted DNS option, and the like.

[0048] The electronic device 100 can receive a user operation (for example, a single click) on the print option 231, and in response to the operation, the electronic device 100 can display a print setting interface 240 as shown in Figure 2D .

[0049] As shown in Figure 2D , the print setting interface 240 can display an icon of the electronic device 100 and an icon of the printer 200, a text prompt information (for example, “Multiple printing methods, portable printing new experience”, etc.), one or more options (for example, a go to print assistant option 241, a default print service option, and a print assistant option, etc.).

[0050] The electronic device 100 can receive a user operation (e.g., a single tap) on the print assistant option 241, and in response to the operation, the electronic device 100 can display a print assistant interface 250 as shown in Figure 2E .

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

[0052] The electronic device 100 can receive a user operation (e.g., a single tap) on the add control 251, and in response to the operation, the electronic device 100 can display a printer add interface 260 as shown in Figure 2F .

[0053] As shown in Figure 2F , the printer add interface 260 can display a printer scan icon, a text prompt (e.g., "Searching...", etc.), and one or more controls (e.g., a help control, a stop control, a hotspot add control, etc.). The printer add interface 260 can also display devices searched by the electronic device 100 through a short-range communication technology (e.g., Wi-Fi, Bluetooth, etc.). When 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 add interface 260. The device option 261 can include a device name (e.g., "XX Printer Printer P1") of the printer 200 and one or more controls (e.g., 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 a local area network in which the electronic device 100 is located.

[0054] The electronic device 100 can receive a user operation (e.g., a single tap) on the connection control 262, and in response to the operation, the electronic device 100 can display the print assistant interface 250 as shown in Figure 2G .

[0055] As shown in Figure 2G , the print assistant interface 250 can display a text prompt (e.g., "Add multiple printers", "Multiple printers / scanners can be added", etc.), an add control 251, and one or more print function options (e.g., a document print option, a picture print option, and a scan option, etc.).As 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 the specified cloud account, so that the printer 200 joins the trust circle corresponding to the specified cloud account. The electronic device 100 can display the printer option 252 on the print assistant interface 250. The printer option 252 can display the device information (for example, the device name "XX printer PrinterP1") and the usage (for example, "idle") of the printer 200.

[0056] In an implementation manner, as Figure 2H shown, before the printer 200 joins the trust circle, 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 executes Figures 2A-2D after that, the electronic device 100 can directly display the printer option 252 on the print assistant interface 250. The electronic device 100 can receive the operation (for example, single click) of the user on a certain print function option (for example, the document printing option 253), and in response to the operation, the electronic device 100 can execute the print operation (for example, print the document) corresponding to the print function option through the printer 200. When the print operation is completed, the electronic device 100 can bind the device information of the printer 200 to the specified cloud account, so that the printer 200 joins the trust circle corresponding to the specified cloud account.

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

[0058] Figures 3A-3G Another set of interface schematic diagrams for adding printers into the trust circle provided by the embodiments of the present application.

[0059] As Figure 3A shown, the electronic device 100 can display the desktop 210. For the description of the desktop 210, please refer to the foregoing Figure 2A embodiment, which will not be repeated here.

[0060] The electronic device 100 can receive the operation (for example, single click) of the user on the smart space application icon 213, and in response to the operation, the electronic device 100 can display the smart space application interface 310 as Figure 3B shown.

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

[0062] The electronic device 100 can receive a user operation (e.g., a single tap) on the add control 313, and in response to the operation, the electronic device 100 can display a menu 314 as shown in Figure 3C .

[0063] The menu 314 can include an add device control 315, as shown in Figure 3C . The electronic device 100 can receive a user operation (e.g., a single tap) on the add device control 315, and in response to the operation, the electronic device 100 can display a printer add interface 260 as shown in Figure 3D .

[0064] The description of the printer add interface 260 can refer to the description in the foregoing Figure 3D embodiment shown in Figure 2F . The electronic device 100 can receive a user operation (e.g., a single tap) on the connection control 262, and in response to the operation, the electronic device 100 can display a smart space application interface 310 as shown in Figure 3E .

[0065] When the electronic device 100 configures the printer 200 to be connected 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 circle corresponding to the specified cloud account, as shown in Figure 3E .

[0066] In an implementation manner, when the printer 200 joins the trust circle, the electronic device 100 has configured the printer 200 to be connected to the local area network where the electronic device 100 is located, as shown in Figures 3F-3G . After the electronic device 100 executes Figure 3A , the smart space application interface 310 can directly display a service card 316 of the printer 200. The electronic device 100 can receive a user operation (e.g., a single tap) on the service card 316, and in response to the operation, the electronic device 100 can display a print assistant interface 250. The print assistant interface 250 can display a printer option 252. The electronic device 100 can receive a user operation (e.g., a single tap) on a certain print function option (e.g., a document printing option 253), and in response to the operation, the electronic device 100 can execute a print operation (e.g., print a document) corresponding to the print function option 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 circle corresponding to the specified cloud account.

[0067] It should be noted that Figures 3A-3G are used only for illustrative purposes and do not constitute any limitation to the present application.

[0068] Figures 4A-4E Another set of interface schematic diagrams for adding a printer into a trust ring are provided for embodiments of the present application.

[0069] As Figure 4A indicated, the electronic device 100 can receive a user operation (e.g., a downward swipe) on the status bar 211, and in response to the operation, the electronic device 100 can display a control center interface 410 as Figure 4B indicated.

[0070] As Figure 4B indicated, the control center interface 410 can include one or more function controls (e.g., 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 a user operation (e.g., a single tap) on the smart interconnection control card 411, and in response to the operation, the electronic device 100 can display a smart interconnection interface 420 as Figure 4C indicated.

[0072] As Figure 4C indicated, the smart interconnection interface 420 can include a device option 421 of the electronic device 100 and a delete control 422. After obtaining the online information of other devices in the trust ring, the electronic device 100 can display the device options of the other devices in the trust ring in the smart interconnection interface 420. Among them, each device in the trust ring logs in or is bound to a specified cloud account. For example, after discovering that the printer 200 is online, the electronic device 100 can display the device option of the printer 200 on the smart interconnection interface 420. The delete control 422 can be used to trigger the electronic device 100 to delete the device selected by the user in the trust ring from the trust ring, that is, to unbind the device selected by the user in the trust ring 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 in the trust ring corresponding to the specified cloud account through a close-range communication technology (e.g., Bluetooth, WiFi) or a cloud server. The electronic device 100 can also search for devices around that are not in the trust ring corresponding to the specified cloud account through a close-range communication technology (e.g., Bluetooth, WiFi).

[0074] As Figure 4DAs shown, when electronic device 100 discovers printer 200 via near-field communication (NFC) technology, and printer 200 is not added to the trust ring corresponding to the specified cloud account, electronic device 100 can display an "Into the Trust Ring" pop-up window 423. This pop-up window 423 may include the device name 424 of printer 200 (e.g., "XX Printer P1"), an "Add to Trust Ring" control 425, and an "Cancel Add" control 426. The "Add to Trust Ring" control 425 can be used to trigger electronic device 100 to add printer 200 to the trust ring corresponding to the specified cloud account logged in on electronic device 100. The "Cancel Add" control 426 can be used to trigger electronic device 100 to cancel adding printer 200 to the trust ring corresponding to the specified cloud account.

[0075] Electronic device 100 can receive user actions (e.g., clicks) on the trust ring control 425. In response to this action, electronic device 100 sends the printer 200's device information and a specified cloud account to the cloud server, allowing the cloud server to bind the printer 200's device information to the specified cloud account, thereby adding the printer 200 to the trust ring corresponding to the specified cloud account. Electronic device 100 can also add the printer 200's device information to its local whitelist of devices already in the trust ring.

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

[0077] It should be noted that, Figures 4A-4E This is for illustrative purposes only and does not constitute any limitation on this application.

[0078] In one possible implementation, such as Figure 4F As shown, the electronic device 100 can receive user operations (e.g., clicks) on the smart connectivity option 222 in the settings application interface 220, and in response to the operation, the electronic device 100 can display the smart connectivity interface 430.

[0079] like Figure 4G As shown, the smart interconnection interface 430 may include text prompts such as "Automatically discover nearby devices logged in with the same Honor account, intelligently transfer services, and bring you a seamless collaborative experience across all scenarios. Learn more," one or more options (e.g., application continuation options, call sharing options, notification sharing options, keyboard and mouse sharing options, etc.), and a device list 431. When the printer 200 is added to the trust ring and is online, the device list 431 may include the printer 200's online identifier 432 and the printer 200's device name "XX Printer P1," etc.

[0080] As shown in Figure 4H When the printer 200 is in the offline state, the offline identifier 433 of the printer 200, the device name "XX Printer Printer P1" of the printer 200, and the like can be included in the device list 431.

[0081] It should be noted that Figures 4F-4H Only for exemplary explanation of the present application, and does not constitute any limitation on the present application.

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

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

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

[0085] The service application can include a print assistant, a control center, a smart space, and the like.

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

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

[0088] The short-distance communication module can be used to communicate with the wireless access device 300 and the Android mDNS module. The short-distance communication module can receive the data information sent from the wireless access device 300, such as the information of the network service of the printer 200, the device information of the printer 200, etc. The short-distance 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-distance communication module. The wireless access device 300 can receive the data information sent by the printer 200, such as the information of the network service of the printer 200, the device information of the printer 200, etc. The wireless access device 300 can send the received data information to the short-distance communication module.

[0090] The printer 200 can communicate with the wireless access device 300, for example, send information of network services of the printer 200, device information of the printer 200, and the like to the wireless access device 300. It should be noted that when the printer 200 and the electronic device 100 can both communicate with the wireless access device 300, the printer 200 and the electronic device 100 are in the same local area network, and at this time, the printer 200 is in an 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, and at this time, the printer 200 is in an offline state.

[0091] It should be noted that, Figure 5 The above merely exemplarily explains the present application, and does not constitute any limitation on the present application.

[0092] In the embodiments of the present application, the information of network services of the printer 200, the device information of the printer 200, and the like can be implemented based on a multicast domain name system (multicast domain name system, mDNS) protocol. The mDNS protocol (hereinafter can be referred to as mDNS) is a network service discovery protocol applied in a local area network, which broadcasts and resolves network services in the local area network in a multicast manner. The mDNS has the following characteristics: 1. The mDNS does not need to manually configure a DNS server or a domain name; 2. The mDNS only communicates in the local area network; 3. The mDNS uses a multicast IP address for communication; 4. The 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, wherein the one or more network services can include: _ipp._tcp service, _ipps._tcp service, _printer._tcp service, and the like. In subsequent embodiments, the network services of the printer 200 include three network services, which are the ipp.tcp service, the _ipps._tcp service, and the _printer._tcp service, which are exemplarily described. The 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 perform a printing function through the 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, the present application does not limit what network services are used by the printer 200.

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

[0095] Next, a specific process of the printer normal offline provided by the embodiment of the application is introduced.

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

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

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

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

[0100] Specifically, the wireless access device 300 can check whether the printer 200 is in the specified local area network according to the heartbeat mechanism, the timeout mechanism (ARP), the DHCP (Dynamic Host Configuration Protocol), etc. Not limited to this, the wireless access device 300 can also check whether the printer is in the specified local area network by other methods, which is not limited by the application.

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

[0102] When the printer 200 is powered off 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 can determine that the printer 200 has exited the specified local area network according to the heartbeat mechanism, the timeout mechanism (ARP), the DHCP (Dynamic Host Configuration Protocol), etc. Not limited to this, the wireless access device 300 can also determine that the printer 200 has exited the specified local area network by other methods, which is not limited by the application.

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

[0106] After the wireless access device 300 determines that the printer 200 has exited the designated local area network, the wireless access device 300 can broadcast offline notifications of a plurality of network services of the printer 200 to electronic devices within the designated local area network. At this time, the electronic device 100 can receive the offline notifications of the plurality of network services through the short-distance communication module. The offline notification of a certain network service can be used to indicate that the network service can no longer be used (i.e., the network service is offline).

[0107] The offline notifications of the plurality of network services can include, but are not limited to, an offline notification of network service 1 (may be referred to as a first offline notification), an offline notification of network service 2 (may be referred to as a second offline notification), and an offline notification of network service 3 (may be referred to as a third offline notification). The offline notification of network service 1 is used to indicate that network service 1 is in an offline state, the offline notification of network service 2 is used to indicate that network service 2 is in an offline state, and the offline notification of network service 3 is used to indicate that network service 3 is in an offline state.

[0108] For example, the offline notification of network service 1 can be an offline notification of a _printer._tcp service, the offline notification of network service 2 can be an offline notification of an _ipp._tcp service, and the offline notification of network service 3 can be an offline notification of an _ipps._tcp service.

[0109] S605: The short-distance communication module sends the offline notifications of the plurality of network services to the Android mDNS module.

[0110] S606: The Android mDNS module sends the offline notifications of the plurality of network services to the mDNS module.

[0111] S607: The mDNS module sends the offline notifications of the plurality of network services to the device management service.

[0112] S608: When receiving the offline notifications of the plurality of network services, the device management service can set the printer 200 in an offline state through the device repository.

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

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

[0115] For example, when the offline identifier 433 of the printer 200 is displayed in the smart interconnection interface 430 as shown in FIG. 4B, or when the offline identifier 433 of the printer 200 is displayed in the smart interconnection interface 430 as shown in FIG. 4C, the service application can display that the printer 200 is in an offline state through the smart interconnection interface 430. Figure 4H For example, when the offline identifier 433 of the printer 200 is displayed in the smart interconnection interface 430 as shown in FIG. 4B, or when the offline identifier 433 of the printer 200 is displayed in the smart interconnection interface 430 as shown in FIG. 4C, the service application can display that the printer 200 is in an offline state through the smart interconnection interface 430.Figure 4C The device option 427 of the printer 200 is not displayed on the smart interconnection interface 420 shown, or Figure 2E The print assistant interface 250 shown does not display the printer option 252, which indicates that the printer 200 is in an offline state. Alternatively, the electronic device 100 can also display that the printer 200 is in an offline state through other display styles, which are not limited herein.

[0116] From Figure 6 As can be seen from the specific process shown, in the scenario that 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, the electronic device 100 can accurately display the actual state of the printer 200.

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

[0118] As Figure 7 As shown, the specific process of printer abnormal offline involves the electronic device 100, the wireless access device 300 and the printer 200. Among them, the electronic device 100 can 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-distance communication module.

[0119] The specific process of printer abnormal offline can 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 the description of S601 shown, which will not be repeated here. Figure 6

[0122] S702: The short-distance 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, the wireless access device 300 and the printer 200 still have a Wi-Fi connection.

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

[0125] ​Specifically, when the short-range communication module and the wireless access device 300 establish the Wi-Fi connection, the short-range communication module can establish a socket connection of the mDNS multicast IP address and the mDNS multicast port number of the local area network (i.e., the specified local area network) where the wireless access device 300 is located. When the short-range communication module disconnects the Wi-Fi connection with the wireless access device 300, the socket connection is interrupted, and thus 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 notification of the network service 1, the offline notification of the network service 2, and the offline notification of the network service 3 to the Android mDNS module.

[0127] The offline notification of the network service 1 can be used to indicate that the network service 1 has been offline, the offline notification of the network service 2 can be used to indicate that the network service 2 has been offline, and the offline notification of the network service 3 can be used to indicate that the network service 3 has been offline.

[0128] For example, the network service 1 in the embodiment of the application can be a _printer. tcp service, the network service 2 can be an _ipp. tcp service, and the network service 3 can be an _ipps. tcp service. However, the network service 1 can also be an _ipp. tcp service or an _ipps. tcp service, the network service 2 can also be a _printer. tcp service or an _ipps. tcp service, and the network service 3 can also be an _ipp. tcp service or a _printer. tcp service, which is not limited in the application.

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

[0130] When the electronic device 100 switches the local area network and causes the electronic device 100 and the wireless access device 300 to disconnect the Wi-Fi connection, for the consideration of power consumption, the Android mDNS module does not send the offline notifications of all the network services to the mDNS module at the same time when receiving the offline notification of the network service 1, the offline notification of the network service 2, and the offline notification of the network service 3, but sends the offline notification of one of the network services (the offline notification of the network service 1 in the embodiment of the application) to the mDNS module first, and then sends the offline notifications of the remaining network services (the offline notification of the network service 2 and the offline notification of the network service 3 in the embodiment of the application) to the mDNS module after waiting for a specified time T2 (which can be referred to as a second time, for example, 150 seconds to 180 seconds, etc.). Figure 6

[0131] ​S706: The mDNS module sends the offline indication of the network service 1 to the device management service.

[0132] S707: When receiving the offline indication of the network service 1, the device management service can set the network service 1 to be offline through the device repository.

[0133] The offline indication of the network service 1 can be used to indicate that the network service 1 is in the offline state.

[0134] S708: The device management service sends the offline indication of the network service 1 to the business application through the device management application.

[0135] Specifically, after the business application receives the offline indication of the network service 1, the business application will no longer use the printer 200 to perform the printing function through the network service 1.

[0136] S709: In response to operation 1 (which can be referred to as a first operation) of displaying the first interface of the business application, the business application displays that the printer 200 is in the online state through the first interface.

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

[0138] Since the electronic device 100 determines that the printer 200 is in the online state when any one of the network services of the printer 200 is in the online state, after the electronic device 100 performs S701-S708, the device management service only sets the network service 1 to be offline, and only sends the offline indication of the network service 1 to the business application, and the other two network services are still in the online state. Therefore, the electronic device 100 still determines that the printer 200 is in the online state, and the business application still displays that the printer 200 is in the online state through the first interface.

[0139] For example, when the online identifier 432 of the printer 200 is displayed in the smart interconnection interface 430 as shown in FIG. 4B, or the device option 427 of the printer 200 is displayed on the smart interconnection interface 420 as shown in FIG. 4A, or the printer option 252 is displayed in the printing assistant interface 250 as shown in FIG. 4C, it indicates that the state of the printer 200 is the online state. Figure 4G Figure 4C Figure 2E ​​​

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

[0141] The specified time duration T2 can be 150-180 seconds. Without limitation, the specified time duration T2 can also be other values, which are not limited by the present application.

[0142] S711: After waiting for the specified time duration T2, the Android mDNS module sends the offline notification of network service 2 to the mDNS module.

[0143] For example, the offline notification of network service 2 can be the offline notification of _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 in the offline state through the device warehouse.

[0146] 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, after the business application receives the offline indication of network service 2, the business application will no longer use the printer 200 to perform the printing function through network service 2.

[0149] S715: The Android mDNS module sends the offline notification of network service 3 to the mDNS module.

[0150] For example, the offline notification of network service 3 can be the offline notification of _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 in the offline state through the device warehouse.

[0153] 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, after the service application receives the offline indication of the network service 3, the service application will no longer perform the printing function by the printer 200 through the network service 3.

[0156] S719: The device management service sets the printer 200 in the offline state through the device warehouse.

[0157] When receiving the offline notification of the network service 1, and after waiting for a specified time T2, the device management service receives the offline notification of the network service 2 and the offline notification of the network service 3, the device management service can determine that all network services of the printer 200 have been offline. Therefore, the device management service can set the printer 200 in the offline state through the device warehouse.

[0158] S720: The device management service sends an offline indication of the printer 200 to the service application through the device management application.

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

[0160] The operation 2 (which can be referred to as a second operation) can be the same operation as the operation 1, or can be a different operation from the operation 1.

[0161] Specifically, the description of this step can refer to the description of S610 in the embodiment shown in Figure 6 and will not be repeated here.

[0162] From the specific process shown in Figure 7 It can be seen that, unlike the scenario of the normal offline of the printer shown in Figure 6 In the scenario of the abnormal offline of the printer, when the electronic device 100 switches the local area network and is no longer in the same local area network as the printer 200, the Android mDNS module will not send all offline notifications of the network services to the mDNS module at the same time for the consideration of power consumption, but first sends an offline notification of a network service (such as the offline notification of the network service 1), and after waiting for a specified time T2, sends offline notifications of the remaining network services (such as the offline notification of the network service 2 and the offline notification of the network service 3).

[0163] Therefore, when the mDNS module receives the offline notification of one network service (such as the offline notification of network service 1), and has not received the offline notification of the remaining network services (such as the offline notification of network service 2 and the offline notification of network service 3) for 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, and thus the electronic device 100 still displays that the printer 200 is in the online state at this time. 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, and the printer 200 is actually in the offline state, and the state of the printer 200 displayed by the electronic device 100 is inconsistent with the actual state of the printer 200, that is, the electronic device 100 cannot accurately display the actual state of the printer 200 between S702-S720, causing the electronic device 100 to display the online state of the printer 200 but the user cannot normally print a file, resulting in extremely inconvenient operation and affecting the use experience of the printer.

[0164] Therefore, the present application provides a device management method, which can include: when the printer 200 and the electronic device 100 are in the same local area network, the electronic device 100 can store the information of the 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 the offline notification of the network service sent by the Android mDNS module (for example, receives the offline notification of network service 1, receives the offline notification of network service 2, and receives the offline notification of network service 3), the mDNS module can determine all network services of the printer 200 based on the information of the multiple network services of the printer 200. Next, the mDNS module can query the state of all network services of the printer 200 through the Android mDNS module. If the mDNS module determines that all network services of the printer 200 are in the offline state, the mDNS module can indicate to the device management service that all network services of the printer 200 have been offline, the device management service can set the printer 200 to the offline state through the device warehouse, and send the offline indication of the printer 200 to the business application. After receiving the offline indication of the printer 200, 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 quickly adjust the state display 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, so that the state of the printer 200 displayed by the electronic device 100 is consistent with the actual state of the printer 200, reduces the duration of the electronic device 100 mistakenly displaying the state of the printer 200, facilitates the printing operation of the user, and improves the use experience of the printer.

[0166] The following describes an implementation of a device management method provided by an embodiment of the present application.

[0167] Figures 8A-8E An implementation of a device management method provided by an embodiment of the present application is shown in the following.

[0168] As shown in the following, Figure 8A The device management method implementation involves an electronic device 100, a wireless access device 300, and a printer 200. The electronic device 100 can include a service 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-distance communication module.

[0169] The device management method implementation can include the following steps.

[0170] Stage 1: The printer 200 is online (as shown in the following). Figure 8A

[0171] S801: The device management application binds 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 the device management service and register a device state listener in the device management service to realize inter-process communication (IPC) calling. The device state listener can be used for the device management application to listen to whether the printer 200 is in an online state.

[0173] S802: The device management application sends device information of a device that has entered a trust ring to the device management service.

[0174] The "device that has entered a trust ring" is an electronic device that has joined the trust ring. In some application scenarios, if other electronic devices (such as the printer 200) bind / login to the same specified cloud account as the electronic device 100 and join the trust ring, the cloud server can send the device information of the device that has entered the trust ring to the device management application, and then the device management application can send the device information of the device that has entered the trust ring to the device management service.

[0175] S803: The device management service sends the device information of the device that has entered the trust ring to the device warehouse.

[0176] The device information of the device that has entered the trust ring can include the device information of the printer 200.

[0177] S804: The device warehouse saves the device information of the device that has entered the trust ring.

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

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

[0180] The "specified network service" described in this step can refer to a network service supported by the printer 200, such as the aforementioned _ipp._tcp service, _ipps._tcp service, and _printer._tcp service. In a specific implementation, the network service supported by the printer 200 can also be different from the above examples, which is not limited in the present application.

[0181] S806: The Android mDNS module listens to a broadcast packet of a specified multicast IP address and a specified multicast port number through the short-distance communication module.

[0182] 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, but can also be other IP addresses; the specified multicast port number is not limited to 5353, but 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 the printer 200, the electronic device 100, and the wireless access device 300 are in the same local area network, 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 packet of the specified multicast IP address and the specified multicast port number.

[0185] The device information of the printer 200 can include the domain name of the printer 200, the service name and service type of the multiple network services of the printer 200, and the like.

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

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

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

[0189] The service discovery notification is used to indicate that the specified network service exists in the same local area network as the electronic device 100. Each network service of the printer 200 corresponds to one service discovery notification. The service discovery notification can include the service name and the service type of the specified network service.

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

[0191] Each network service of the printer 200 corresponds to one service resolution instruction. The service resolution instruction can include the service name and the 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-distance communication module.

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

[0194] Each network service of the printer 200 corresponds to one mDNS query request, for example, the _ipp. _tcp service corresponds to one mDNS query request, the _ipps. _tcp service corresponds to one mDNS query request, and the _printer. _tcp service corresponds to one mDNS query request.

[0195] For example, the mDNS query request corresponding to the _ipp. _tcp service can 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 the 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 can refer to the information carried by the mDNS query request corresponding to the _ipp. _tcp service, which is not described 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] The mDNS query response of the specified network service can include information of the specified network service, which can include one or more of the following: a specified multicast IP address, a specified multicast port number, a device identifier of the printer 200, a device name of the printer 200, a domain name of the printer 200, an IP address of the printer 200, a service name of the specified network service, a service type of the specified network service, a port number corresponding to the specified network service, attributes of the specified network service, and the like.

[0199] 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 the mDNS query response to the Android mDNS module through the short-distance communication module.

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

[0202] In this step and subsequent embodiments, the service resolution notification can carry a specified instance of a specified network service, and the specified instance of the specified network includes information of 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, if the mDNS query response can be received, it is called a resolution success, and if the mDNS query response cannot be received, it is called a resolution failure. For example, if the Android mDNS module receives the mDNS query response corresponding to the _ipps._tcp service, the _ipps._tcp service is a network service of the resolution success. If the Android mDNS module cannot receive the mDNS query response corresponding to the _ipps._tcp service, the _ipps._tcp service is a network service of the resolution failure.

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

[0205] For example, the plurality of network services of the printer 200 include a network service 1, a network service 2 and a network service 3, the network service 1 is a _printer. tcp service, the network service 2 is an _ipp. tcp service, and the network service 3 is an _ipps. tcp service. When the mDNS module receives the service resolution notification of the _printer. tcp service, the mDNS module can obtain and save the information of the _printer. tcp service from the service resolution notification, for example, 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 the service type of the _printer. tcp service, the port number corresponding to the _printer. tcp service, the attribute of the _printer. tcp service, and the like. When the mDNS module receives the service resolution notification of the _ipp. tcp service, the mDNS module can obtain and save the information of the _ipp. tcp service from the service resolution notification, for example, 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 the service type of the _ipp. tcp service, the port number corresponding to the _ipp. tcp service, the attribute of the _ipp. tcp service, and the like. When the mDNS module receives the service resolution notification of the _ipps. tcp service, the mDNS module can obtain and save the information of the _ipps. tcp service from the service resolution notification, for example, 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 the service type of the _ipps. tcp service, the port number corresponding to the _ipps. tcp service, the attribute of the _ipps. tcp service, and the like.

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

[0207] The online indication of the network service 1 is used to indicate that the network service 1 is in an online state.

[0208] S819: The device management service sets the network service 1 in the online state through the device warehouse.

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

[0210] Specifically, after the business application receives the online indication of the network service 1, the business application can use the printer 200 to perform a printing function through the network service 1.

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

[0212] The device authentication request is used to request the authentication module to perform whitelist authentication on the printer 200. The device authentication request carries the device name of the printer 200.

[0213] S822: The authentication module queries whether the printer 200 has entered the loop through the device warehouse.

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

[0215] S823: When it is determined that the printer 200 has entered the loop, the device warehouse 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 warehouse can determine that the printer 200 has entered the loop. The device warehouse can send indication information 1 to the authentication module, which can be used to indicate that the printer 200 has entered the loop.

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

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

[0219] S825: The device management service sets the printer 200 in the online state through the device warehouse.

[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 operation 1 of displaying the first interface of the business application, the business application displays, through the first interface, that the printer 200 is in the online state.

[0222] The description of this step can refer to the description in the foregoing embodiments, which will not be described here.

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

[0224] The online indication of the network service 2 is used to indicate that the network service 2 has been in the online state.

[0225] S829: The device management service sets the network service 2 to be online through the device repository.

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

[0227] Specifically, after the business application receives the online indication of the network service 2, the business application can perform the printing function by using the printer 200 through the network service 2.

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

[0229] The online indication of the network service 3 is used to indicate that the network service 3 has been in the online state.

[0230] S832: The device management service sets the network service 3 to be online through the device repository.

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

[0232] Specifically, after the business application receives the online indication of the network service 3, the business application can perform the printing function by using the printer 200 through the network service 3.

[0233] Stage two: The electronic device 100 switches the local area network (for example, as shown in FIG. 8). Figure 8B

[0234] S834: The short-distance 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-distance 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 the printer 200 are no longer in the same local area network, and the printer 200 and the wireless access device 300 are in the same local area network.

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

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

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

[0239] ​The description of this step can be found in the foregoing embodiments.

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

[0241] S837: The short-range communication module sends offline notifications for network service 1, network service 2, and network service 3 to the Android mDNS module.

[0242] The explanation of this step can be found in the description in the foregoing embodiments.

[0243] S838: The Android mDNS module sends a notification to the mDNS module that network service 1 is offline.

[0244] The explanation of this step can be found in the description in the foregoing embodiments.

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

[0246] S839A: Short-range communication module establishes Wi-Fi connection for wireless access device 300.

[0247] The S840A mDNS module checks the status of network service 1.

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

[0249] The S841A:mDNS module determines that network service 1 is online.

[0250] The S842A:mDNS module sends a network service 1 online instruction to the device management service.

[0251] S843A: The device management service sets network service 1 to be online through the device warehouse.

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

[0253] The description about this step can refer to the foregoing embodiments, which will not be repeated here.

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

[0255] For example, in step S841A, the mDNS module determines that the network service 1 is in the online state, which meets the condition that at least one network service is in the online state. Therefore, the mDNS module can perform steps S846A-S849A for adjusting the printer 200 to be in the online state.

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

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

[0258] S847A: The device management service sets the printer 200 to be in the online state through the device warehouse.

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

[0260] The online indication of the printer 200 can be used to indicate that the printer 200 is in the online state.

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

[0262] The description about this step can refer to the foregoing embodiments, which will not be repeated here.

[0263] S850A: After sending the offline notification of the network service 1, the Android mDNS module waits for a specified time T2.

[0264] The description about this step can refer to the foregoing embodiments, which will not be repeated here.

[0265] S851A: After waiting for the specified time T2, the Android mDNS module sends the offline notification of the network service 2 and the offline notification of the network service 3 to the mDNS module.

[0266] The description about this step can refer to the foregoing embodiments, which will not be repeated 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 the online state of network service 2 through the device warehouse.

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

[0272] The description of this step can refer to the foregoing embodiments and will not be repeated 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 the online state of network service 3 through the device warehouse.

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

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

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

[0280] For example, in steps S853A and S858A, the mDNS module determines that network service 2 and network service 3 are in the online state, which meets the condition that at least one network service is in the online state, and therefore, the mDNS module can perform steps S863A-S866A for adjusting the printer 200 to the online state.

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

[0282] 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 the online state of the printer 200 through the device warehouse.

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

[0285] The online indication of the printer 200 can be used to indicate that the printer 200 is in the online state.

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

[0287] The operation 2 and the operation 3 (which can be referred to as 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 described here.

[0288] The second case: as shown in FIG. 8B, after S834, before S840B, the electronic device 100 establishes the Wi-Fi connection with the wireless access device 300 again. But before S853B, the electronic device 100 disconnects the Wi-Fi connection with the wireless access device 300 again. Figure 8C

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

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

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

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

[0293] S843B: The device management service sets the network service 1 in the online state through the device warehouse.

[0294] S844B: The device management service sends the online indication of the 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 the online state.

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

[0297] S847B: The device management service sets the printer 200 in the online state through the device warehouse.

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

[0299] S849B: In response to operation 2 of displaying the first interface of the service application, 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 the network service 1, the Android mDNS module waits for a specified time duration T2.

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

[0302] The descriptions of S839B-S851B can be referred to the descriptions of S839A-S851A in the foregoing embodiment. Figure 8B

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

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

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

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

[0307] S856B: The device management service sets, through the device warehouse, that the network service 2 is in the offline state.

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

[0309] The description of this step can be referred to the foregoing embodiment, which will not be repeated here.

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

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

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

[0313] S861B: The device management service sets, through the device warehouse, that the network service 3 is in the offline state.

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

[0315] ​The description of this step can refer to the foregoing embodiments, which will not be repeated here.

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

[0317] Specifically, since the mDNS module saves the information of the plurality of network services of the printer 200 in S817, the mDNS module can acquire the plurality of network services supported by the printer 200 according to the saved information of the plurality of network services. The plurality of network services can include the network service 1, the network service 2 and the network service 3. Figure 8A S864B: The mDNS module checks the state of the network service 1.

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

[0319] S866B: The mDNS module sends the offline indication of the network service 1 to the device management service.

[0320] S867B: The device management service sets the network service 1 in the offline state through the device warehouse.

[0321] S868B: The device management service sends the offline indication of the network service 1 to the business application through the device management application.

[0322] The description of this step can refer to the foregoing embodiments, which will not be repeated here.

[0323] S869B: The mDNS module determines that the plurality of network services are all in the offline state.

[0324] For example, in steps S854B, S859B and S869B, the mDNS module determines that the network service 1, the network service 2 and the network service 3 are all in the offline state, so the mDNS module determines that the plurality of network services are all in the offline state, and the mDNS module can execute steps S870B-S873B for adjusting the printer 200 to be in the offline state.

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

[0326] The indication information 3 can be used to indicate that the plurality of network services are all in the offline state.

[0327] S871B: The device management service sets the printer 200 in the offline state through the device warehouse.

[0328] The description of this step can refer to the foregoing embodiments, which will not be repeated here.

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

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

[0331] The description about this step can refer to the foregoing embodiments, which will not be repeated here.

[0332] The third case: as shown in FIG. 8C, after S834, the electronic device 100 does not establish the Wi-Fi connection with the wireless access device 300 again. Figure 8D

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

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

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

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

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

[0338] The description about this step can refer to the foregoing embodiments, which will not be repeated here.

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

[0340] The description about this step can refer to the foregoing embodiments, which will not be repeated here.

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

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

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

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

[0345] ​S849C: The device management service sends the offline indication of the network service 2 to the business application through the device management application.

[0346] The description about this step can refer to the foregoing embodiments, which will not be repeated here.

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

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

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

[0350] S853C: The device management service sets the printer 200 in the offline state through the device warehouse.

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

[0352] The description about this step can refer to the foregoing embodiments, which will not be repeated here.

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

[0354] For example, in steps S840C, S846C and S851C, the mDNS module determines that the network service 1, the network service 2 and the network service 3 are all in the offline state, and thus the mDNS module determines that all the network services are in the offline state. The mDNS module can perform steps S856C-S859C for adjusting the printer 200 to be in the offline state.

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

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

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

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

[0359] S859C: In response to the operation 2 of 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] The description about this step can refer to the foregoing embodiments, which will not be repeated here.

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

[0362] S861C: After waiting for the specified time duration T2, the Android mDNS module sends the offline notification of network service 2 and the offline notification of 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 the offline indication of network service 2 to the device management service.

[0366] S865C: The device management service sets network service 2 in the offline state through the device warehouse.

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

[0368] The description of this step can refer to the foregoing embodiments, which 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 the offline indication of network service 3 to the device management service.

[0372] S870C: The device management service sets network service 3 in the offline state through the device warehouse.

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

[0374] The description of this step can refer to the foregoing embodiments, which will not be repeated here.

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

[0376] The description of this step can refer to the foregoing embodiments, which will not be repeated here.

[0377] S873C: The mDNS module checks the status of network service 1.

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

[0379] The S875C:mDNS module sends a shutdown instruction for network service 1 to the device management service.

[0380] S876C: The device management service sets network service 1 to be offline through the device warehouse settings.

[0381] S877C: The device management service sends a shutdown instruction for network service 1 to the business application through the device management application.

[0382] For an explanation of the above steps, please refer to the foregoing embodiments, which will not be repeated here.

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

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

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

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

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

[0388] S881C: The Device Management Service sends a decommissioning instruction for printer 200 to the business application through the Device Management application.

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

[0390] For an explanation of the above steps, please refer to the foregoing embodiments, which will not be repeated here.

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

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

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

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

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

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

[0397] The description of the above steps can refer to the foregoing embodiments and will not be repeated here.

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

[0399] The description of the above steps can refer to the foregoing embodiments and will not be repeated here.

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

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

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

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

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

[0405] The description of the above steps can refer to the foregoing embodiments and will not be repeated here.

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

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

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

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

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

[0411] The description of the above steps can refer to the foregoing embodiments, which will not be repeated here.

[0412] S855D: The mDNS module determines that the plurality of network services are in the down state.

[0413] For example, in steps S840D, S846D, S851D, the mDNS module determines that the network service 1, the network service 2, and the network service 3 are in the down state, and thus the mDNS module determines that the plurality of network services are in the down state, and the mDNS module can perform steps S856D-S859D for adjusting the printer 200 to be in the down state.

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

[0415] The indication information 3 can be used to indicate that the plurality of network services are in the down state.

[0416] S857D: The device management service sets the printer 200 to be in the down state through the device warehouse.

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

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

[0419] The description of the above steps can refer to the foregoing embodiments, which will not be repeated here.

[0420] S860D: After sending the down notification of the network service 1, the Android mDNS module waits for a specified time T2.

[0421] S861D: After waiting for the specified time T2, the Android mDNS module sends the down notification of the network service 2 and the down notification of the network service 3 to the mDNS module.

[0422] S862D: The short-distance communication module and the wireless access device 300 establish a Wi-Fi connection.

[0423] S863D: The mDNS module checks the state of the network service 2.

[0424] S864D: The mDNS module determines that the network service 2 is in the up state.

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

[0426] S866D: The device management service sets the network service 2 to be online through the device repository.

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

[0428] The description of this step can refer to the foregoing embodiments, which will not be repeated here.

[0429] S868D: The mDNS module checks the status of the network service 3.

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

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

[0432] S871D: The device management service sets the network service 3 to be online through the device repository.

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

[0434] The description of this step can refer to the foregoing embodiments, which will not be repeated here.

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

[0436] For example, in steps S864D and S869D, the mDNS module determines that the network service 2 and the network service 3 are in the online state, which meets the condition that at least one network service is in the online state, and therefore, the mDNS module can perform steps S874D-S877D for adjusting the printer 200 to be in the online state.

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

[0438] 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 the printer 200 to be online through the device repository.

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

[0441] The printer 200 online indicator can be used to indicate that the printer 200 is online.

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

[0443] This step can be referred to the description in the foregoing embodiments, and will not be repeated here.

[0444] In specific implementation methods, there are also those different from the above. Figures 8B-8E For example:

[0445] Fifth scenario: Based on Figure 8B In the first scenario shown, after S834 and before S840A, electronic device 100 re-establishes a Wi-Fi connection with wireless access device 300, but network service 1 malfunctions. Therefore, in S841A, the mDNS module determines that network service 1 is offline. At this point, the mDNS module needs to check the status of network service 2 and network service 3. The execution process is as follows: Figure 8D In the S844C to S845C, it is then determined that network service 2 and network service 3 are online. The subsequent execution process can be found by referring to [the relevant documentation]. Figure 8B S853A to S865A. Then, the subsequent procedures can be referred to... Figure 8B S850A~S865A.

[0446] The sixth scenario: based on Figure 8E In the fourth scenario shown, after S858D and before S862D, electronic device 100 re-establishes a Wi-Fi connection with wireless access device 300. However, network services 2 and 3 malfunction at this time. Therefore, in S863D, the mDNS module determines that network service 2 is offline. At this point, the following steps are executed: Figure 8D In S863C~S865C; S867D, the mDNS module determines that network service 3 is offline. At this time, the following steps are executed: Figure 8D In S867C~S869C, the mDNS module next needs to check the status of network service 1 and execute... Figure 8D In the S870C to S871C, after confirming that network service 1 is online, the following procedure can be followed. Figure 8B S841A~S849A.

[0447] The application does not limit itself to the scenarios described in the examples above; other scenarios may also occur in the specific implementation, and this application does not impose any restrictions on them.

[0448] From the above situations, we can see that:

[0449] (1) When receiving the offline notification of network service 1, the mDNS module first checks the state of network service 1. If network service 1 is in the online state, the mDNS module instructs the business application to display the online state of the printer 200 through the device management service, and at this time, it is not necessary to check the state of network service 2 and the state of network service 3. If network service 1 is in the offline state, the mDNS module further obtains the multiple network services of the printer 200 through the saved information of the multiple network services, and checks the state of the network service other than network service 1 (the state of network service 2 and the state of network service 3 in the embodiment of the present application). If at least one network service is in the online state, the mDNS module instructs the business application to display the online state of the printer 200 through the device management service; if all the three network services supported by the printer 200 are in the offline state, the mDNS module instructs the business application to display the offline state of the printer 200 through the device management service.

[0450] (2) When receiving the offline notification of network service 2 and the offline notification of network service 3, the mDNS module first checks the state of network service 2 and the state of network service 3. If network service 2 and / or network service 3 is in the online state, the mDNS module instructs the business application to display the online state of the printer 200 through the device management service, and at this time, it is not necessary to check the state of network service 1. If network service 2 and network service 3 are in the offline state, the mDNS module further obtains the multiple network services of the printer 200 through the saved information of the multiple network services, and checks the state of the network service other than network service 2 and network service 3 (the state of network service 1 in the embodiment of the present application). If at least one network service is in the online state, the mDNS module instructs the business application to display the online state of the printer 200 through the device management service; if all the multiple network services are in the offline state, the mDNS module instructs the business application to display the offline state of the printer 200 through the device management service.

[0451] In this way, by implementing the device management method provided in the present application, in the case that the electronic device 100 switches the local area network and is no longer in the same local area network with the printer 200, the electronic device 100 can quickly adjust the state display of the printer 200, so that the state of the printer 200 displayed by the electronic device 100 is consistent with the actual state of the printer 200, the time length of the false display of the state of the printer 200 by the electronic device 100 is reduced, the printing operation of the user is facilitated, and the use experience of the printer is improved.

[0452] For example, when the device management method provided by the embodiment of 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 with the printer 200, since the mDNS module needs to wait for the offline notification of the network service 2 and the offline notification of the network service 3 within 150-180 seconds after receiving the offline notification of the network service 1, and the network service 2 and the network service 3 are still in the online state within the 150-180 seconds, the electronic device 100 will still display that the printer 200 is in the online state, resulting in that the displayed state of the printer 200 is inconsistent with the actual state of the printer 200.

[0453] However, when the device management method provided by the embodiment of the present application is implemented, the mDNS module will check the states of the plurality of network services when receiving the offline notification of the network service 1, and determine the state of the printer 200 according to the states of the plurality of network services, so that the electronic device 100 can quickly adjust the state display of the printer 200 and reduce the time length of the false display of the state of the printer 200 by the electronic device 100. For example, when the network services of the printer 200 are 3, the time length of the false display of the state of the printer 200 by the electronic device 100 is only 3 seconds, instead of 150-180 seconds when the method is not implemented.

[0454] Meanwhile, when the device management method provided by the embodiment of the present application is implemented, the mDNS module will also check the states of the plurality of network services when receiving the offline notification of the network service 2 and the offline notification of the network service 3, and determine the state of the printer 200 according to the states of the plurality of network services. In this way, the problem that the electronic device 100 accurately displays that the state of the printer 200 is the online state when the electronic device 100 re-enters the local area network of the printer 200 due to the re-establishment of the Wi-Fi connection with the wireless access device 300 before the mDNS module receives the offline notification of the network service 2 and the offline notification of the network service 3, and then the electronic device 100 is caused to set and display that the printer 200 is in the offline state due to the reception of the offline notification of the network service 2 and the offline notification of the network service 3 by the mDNS module, resulting in that the actual state of the printer 200 is inconsistent with the displayed state of the printer 200 by the electronic device 100, can be avoided.

[0455] Further, some steps of the device management method provided by the embodiment of the present application are described in detail. Figures 8A-8E

[0456] Figures 9A-9C The implementation schematic diagram of some steps of the device management method provided by the embodiment of the present application.

[0457] For example, Figures 9A-9C ​As shown, the specific flow of the device management method involves the electronic device 100, the wireless access device 300, and the printer 200. The modules involved in the electronic device 100 include the mDNS module, the Java singleton thread pool, the Android mDNS module, and the short-distance communication module.

[0458] The specific flow of the device management method can include:

[0459] Part of the steps in stage one are specifically implemented (as shown in Figure 9A

[0460] S901: The mDNS module calls the mDNS listening interface, triggering the Android mDNS module to scan the specified network service based on mDNS.

[0461] S902: The Android mDNS module listens to the broadcast packet of the specified multicast IP address and the specified multicast port number through the short-distance communication module.

[0462] S903: 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.

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

[0464] The descriptions of S901-S904 can be referred to the related descriptions in the foregoing Figure 8A

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

[0466] The service discovery notification of the specified network service can carry the specified instance corresponding to the specified network service. The specified instance in the service discovery notification can include the service type and the service name of the specified network service, but the IP address of the printer 200, the port number of the specified network service, and the attribute information are null. The type of the specified instance carried by the service discovery notification can be the NsdServiceInfo instance, and each NsdServiceInfo instance is set with a unique identifier for distinguishing the NsdServiceInfo instances.

[0467] ​​In subsequent embodiments, the type of the specified instance carried by the service resolution instruction, the service resolution notification and the offline notification of the specified network service can also be the NsdServiceInfo instance. It should be noted that the specified instance carried by the service resolution instruction of the specified network service includes the service type and the 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 the attribute of the specified network service and the like are null values; the specified instance carried by the offline notification of the specified network service includes the service type and the 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 the attribute of the specified network service and the like are null values; and the specified instance carried by the service resolution notification of the specified network service includes the information of the specified network service.

[0468] For example, in this step, the service discovery notification of the network service 1 carries the specified instance A1 of the network service 1, which includes the service type and the service name of the network service 1, but the ip address of the printer 200, the port number and the attribute of the network service 1 and the like are null values; the service discovery notification of the network service 2 carries the specified instance B1 of the network service 2, which includes the service type and the service name of the network service 2, but the ip address of the printer 200, the port number and the attribute of the network service 2 and the like are null values; and the service discovery notification of the network service 3 carries the specified instance C1 of the network service 3, which includes the service type and the service name of the network service 3, but the ip address of the printer 200, the port number and the attribute of the network service 3 and the like are null values.

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

[0470] In this step, the service resolution instruction of the specified network service can carry the specified instance of the specified network service. The specified instance of the service resolution instruction can include the service type and the service name of the specified network service, but the ip address of the printer 200, the port number and the attribute of the specified network service and the like 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] For example, the service resolution instruction of the network service 1 (which can be referred to as the first service resolution instruction) carries the specified instance A2 of the network service 1. The specified instance A2 includes the service type and the service name of the network service 1, but the ip address of the printer 200, the port number and the attribute of the network service 1, and the like are null values.

[0473] If the specified instance A2 can be created by the mDNS module, 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 the network service 1, 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, 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 the network service 1 to the Android mDNS module.

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

[0476] However, the service resolution instruction is generated in a short time, while the Android mDNS module receives the mDNS query response in a long time. 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, not only the Android mDNS module cannot receive the mDNS query response of the previous network service, but also the Android mDNS module cannot 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 thread created by the Java singleton thread pool sends the service resolution instruction of a 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 sends the service resolution instruction of the next network service to the Android mDNS module, avoiding the occurrence of concurrent operations. The specific implementation manner will be described in detail in the subsequent embodiments.

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

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

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

[0481] S911: The wireless access device 300 sends the mDNS query response of the network service 1 to the Android mDNS module through the short-distance communication module.

[0482] The descriptions of S908-S911 can refer to the descriptions in the foregoing embodiments.

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

[0484] S913: The Java singleton thread pool sends the service resolution notification of the network service 1 to the mDNS module.

[0485] The service resolution notification of the network service 1 can carry the specified instance A3 of the network service 1. The specified instance A3 includes information of the network service 1 (for example, the device name of the printer 200, the domain name of the printer 200, the IP address of the printer 200, the port number of the network service 1, the attribute of the network service 1, the service name and the service type of the 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 the network service 1.

[0487] The service resolution notification of the subsequent network service 2 and its corresponding specified instance B3, the service resolution notification of the network service 3 and its corresponding specified instance C3 are described below. The description of the service resolution notification of the network service 1 and the specified instance A3 in this step can be referred to.

[0488] Then, the Java singleton thread pool sends the service resolution instruction of the network service 2 and the subsequent process to the Android mDNS module. The service resolution instruction of the network service 2 carries the specified instance B2 of the network service 2, and the service resolution notification of the network service 2 carries the specified instance B3 of the network service 2. The subsequent process can be referred to S907-S913.

[0489] Next, the Java singleton thread pool sends the service resolution instruction of the network service 3 and the subsequent process to the Android mDNS module. The service resolution instruction of the network service 3 carries the specified instance C2 of the network service 3, and the service resolution notification of the network service 3 carries the specified instance C3 of the network service 3. The subsequent process can be referred to S907-S913.

[0490] The specific implementation of step S817 is as follows:

[0491] The mDNS module can save the information of the multiple network services of the printer 200 in the form of key-value pairs, where the key is the device name of the printer 200, and the value is the specified instance 2 (for example, the PrinterSrcInfo instance). The specific implementation is as follows:

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

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

[0494] S915: When the specified instance 2 is obtained successfully, 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 specified instance 2 acquisition 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] The specified instance 2 (for example, the PrinterSrcInfo instance) can include the ip address of the printer 200, the port number of each network service, the device name of the printer 200, the service type and service name of each network service, and the like.

[0497] For example, the data structure of the specified instance 2 (for example, the PrinterSrcInfo instance) can be as follows:

[0498] The device name of the printer 200: XXX

[0499] The ip address of the printer 200: xxx.xxx.xxx.xxx

[0500] The device identification of the printer 200: xxx

[0501] The domain name of the printer 200: XXXX

[0502] The online network service set: the service type and service name of each network service, and the port number of each network service.

[0503] In the data structure of the specified instance 2, the same part 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 identification of the printer 200, and the domain name of the printer 200, can be referred to as the common information of each network service, and the different part in the information of each network service, such as the service type and service name of each network service, and the port number of each network service, can be referred to as the non-common information. The online network service set can be used to store the non-common information of each network service.

[0504] As shown in FIG. 8A, Figures 9B-9C the embodiment of the present application takes the status of the network service 1 as an example to specifically explain the specific process of checking the status of the specified network service, Figures 8B-8E the specific implementation of checking the status of the network service 2 and the status of the network service 3 can refer to Figures 9B-9C .

[0505] As shown in FIG. 8A, Figure 9B the mDNS module checks the status of the network service 1, and determines the case that the network service 1 is in the online state (that is, Figure 8B the specific implementation of S840A-S841A in FIG. 8A, Figure 8C S840B-S841B in FIG. 8B, and the like):

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

[0507] If the specified instance carried in the service resolution instruction of the specified network service at the stage of checking whether the printer 200 is offline is the specified instance of the offline notification of the specified network service, since the Android mDNS module records that the specified network service corresponding to the specified instance has sent the offline notification based on the identifier of the specified instance carried in the offline notification of the specified network service before the Android mDNS module sends the offline notification of the specified network service, when the Java singleton thread pool transmits 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 the offline notification based on the identifier of the specified instance, at this time, the Android mDNS module will not send the mDNS query request, and will not send the data information to the mDNS module, the mDNS module will determine that the specified network service is in the offline state, which may cause the state of the specified network service to be inaccurate.

[0508] Therefore, in the embodiment of the present application, at the stage of checking whether the printer 200 is offline, the mDNS module creates the specified instance corresponding to each network service, and the service resolution instruction of each network service in the subsequent steps carries the specified instance created by the mDNS module, instead of the specified instance in the offline notification of the network service. In this way, when the mDNS module sends the service resolution instruction of each network service to the Android mDNS module through the Java singleton thread pool, the specified instance that is not recorded by the Android mDNS module is transmitted, so that the Android mDNS module can normally send the mDNS query request. The specified instance corresponding to each network service created by the mDNS module includes the service type and the service name of each network service, but the ip address of the printer 200, the device name of the printer 200, the port number and the attribute of each network service, and the like are null values.

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

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

[0511] The service resolution instruction of the network service 1 carries the specified instance A5.

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

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

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

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

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

[0517] The mDNS query response of the network service 1 includes the information of the network service 1.

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

[0519] The service resolution notification for network service 1 may carry a designated instance A6 of network service 1, and the designated instance A6 may include information about network service 1. The identifier of the designated instance A6 may be the same as the identifier of the designated instance A5. For a description of the information of network service 1, please refer to the foregoing embodiments.

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

[0521] S926A: When a service resolution notification for network service 1 is received, the mDNS module can determine that network service 1 is online.

[0522] like Figure 9C As shown, the mDNS module checks the status of network service 1 and determines if network service 1 is offline (i.e., Figure 8D S839C~S840C, S873C~S874C Figure 8E (Specific implementations of S839D to S840D, etc.)

[0523] The S917B:mDNS module creates a specified instance A5 for network service 1.

[0524] For an explanation of this step, please refer to the foregoing embodiments.

[0525] The S918B mDNS module sends a service resolution command for 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 for network service 1 to the Android mDNS module.

[0528] S920B: In response to the service resolution command for 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.

[0529] It should be noted that, in Figure 8D S839C~S840C, S873C~S874C Figure 8E In the cases shown in S839D to S840D, the electronic device 100 is not on the same local area network as the wireless access device 300 and the printer 200. Therefore, the short-range communication module can send an mDNS query request for network service 1, but the wireless access device 300 cannot receive the mDNS query request for network service 1, and therefore cannot send the mDNS query request for network service 1 to the printer 200.

[0530] S921B: If, within a specified time T3 (which can be called the first time) after the Java singleton thread pool sends the service resolution instruction for network service 1, the mDNS module does not receive the 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 an offline state.

[0531] Generally, when electronic device 100 and printer 200 are not on the same local area network, the Android mDNS module will not receive an mDNS query response. Consequently, the Java singleton thread pool and the mDNS module will not receive the corresponding service resolution notification, causing the Android mDNS module to continuously wait for an mDNS query response, and the Java singleton thread pool and the mDNS module to continuously wait for the corresponding service resolution notification, thus blocking the process. However, in this embodiment, if the mDNS module does not receive a service resolution notification for network service 1 within a specified time T3 after the Java singleton thread pool sends the service resolution instruction for network service 1, it can determine that network service 1 is offline and proceed with the subsequent process, thus solving the process blocking problem and allowing the subsequent process to proceed smoothly. The specific implementation will be described in detail in the following embodiments.

[0532] It should be noted that, Figures 9A-9C For the processes of modules not covered in this document, please refer to the aforementioned embodiments.

[0533] Furthermore, combining Figures 9B-9C This section details the specific implementation of checking the status of printer 200, based on the method used to check the status of a specified network service.

[0534] 1. When the Android mDNS module sends a notification that network service 1 is offline, check the status of printer 200. Figure 10 , Figures 11A-11B ):

[0535] Figure 10 , Figures 11A-11B This explanation will take the example of checking the status of printer 200 when the Android mDNS module sends a notification that network service 1 is offline. 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] like Figure 10 As shown, when the Android mDNS module sends a notification that network service 1 is offline, before checking the status of network service 1, the electronic device 100 re-establishes a Wi-Fi connection with the wireless access device 300 (e.g., Figure 8BThe first case shown, Figure 8C The second case shown:

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

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

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

[0540] In this step, the mDNS module creates a specified instance of a specified network service, and performs a subsequent process based on the created specified instance, instead of performing a subsequent process using the specified instance carried in the offline notification of the specified network service. 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, the Android mDNS module does not determine that the specified network service corresponding to the specified instance has sent an offline notification, and the Android mDNS module can send an mDNS query request, thereby improving the accuracy of state checking of the specified network service.

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

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

[0543] S1004: The mDNS module determines whether there is currently a resolution task identical to the resolution task of the network service 1.

[0544] Specifically, the mDNS module can determine whether there is currently a resolution task identical to the resolution task of the network service 1 according to the service name and the service type. If the mDNS module already has a resolution task including the service name and the service type of the network service 1, there is currently a resolution task identical to the resolution task of the network service 1. Otherwise, there is not currently a resolution task identical to the resolution task of the network service 1.

[0545] S1005A: If there is a resolution task identical to the resolution task of the network service 1, the mDNS module discards the created resolution task of the network service 1.

[0546] S1005B: If there is no resolving task same as the resolving task of the network service 1, the mDNS module saves the created resolving task of the network service 1.

[0547] Specifically, the mDNS module can store the resolving task of the network service 1 in the form of a key-value pair in a key-value pair set (map), the key can be a string splicing of the service name + service type of the network service 1, and the value can be the specified instance A5 of the network service 1, etc.

[0548] S1006: The mDNS module sends the resolving task of the 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 resolving task of the network service 1 to the Java singleton thread pool. When the Java singleton thread pool receives the resolving task of the network service 1, the Java singleton thread pool can be started.

[0550] Check the status of the network service 1:

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

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

[0553] Among them, the service resolving instruction of the network service 1 carries the specified instance A5 in this step, which can include the service type and service name of the network service 1, but the attributes of the network service 1, the port number of the network service 1, etc., the IP address of the printer 200, etc. Information is null.

[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 a timeout parameter.

[0556] Among them, the value of the timeout parameter can be preferably set to 1000 milliseconds, which can be the same as the specified time T3 described above.

[0557] After S1008 and before S1009, the Android mDNS module can send an mDNS query request of the network service 1 to the wireless access device 300 through the short-distance communication module in response to the service resolving instruction of the network service 1 (which can be referred to the foregoing embodiments, Figure 10The similar steps in the subsequent checking of the state of the network 2 and the checking of the state of the network service 3 are described with reference to this paragraph.

[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 the thread 1 in the Java singleton thread pool.

[0560] The blocking of the thread 1 can mean the suspension of the execution of the thread 1. The descriptions of the blocking of the thread 2, the blocking of the thread 3, the blocking of the thread 4 and the like in the subsequent embodiments can refer to the description in this paragraph.

[0561] The execution of S1010-S1011 can avoid the concurrent operation of the sending of the mDNS query request and the receiving of the mDNS query response of different network services.

[0562] S1012: The Android mDNS module sends the service resolution notification of the 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 can receive the mDNS query response of the network service 1 sent by the short-distance communication module (which can refer to the foregoing embodiments, Figure 10 The similar steps in the subsequent checking of the state of the network 2 and the checking of the state of the network service 3 are described with reference to this paragraph.

[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 the thread 1 in the Java singleton thread pool.

[0567] The release of the thread 1 can mean triggering the thread 1 to continue execution. The descriptions of the release of the thread 2, the release of the thread 3, the release of the thread 4 and the like in the subsequent embodiments can refer to the description in this paragraph.

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

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

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

[0571] S1019: The device management service sets the network service 1 to be in the online state through the device warehouse.

[0572] It is determined 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] 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 be in the online state through the device warehouse.

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

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

[0579] As Figures 11A-11B shown, when the Android mDNS module sends the offline notification of the network service 1, before checking the state of the network service 1, the electronic device 100 does not reestablish the Wi-Fi connection with the wireless access device 300 (for example Figure 8D the third case, Figure 8E the fourth case):

[0580] After S1001-S1006 in Figure 10 are performed:

[0581] Check the state of the network service 1:

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

[0583] S1102: The Java singleton thread pool sends the service resolution instruction of the network service 1 to the Android mDNS module through the 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 a timeout parameter and a 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, the Java synchronization utility class releases thread 1 in the Java singleton thread pool without receiving the service resolution notification of network service 1.

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

[0592] The timer timeout indication information is used to indicate that the timing duration of the timer exceeds the timeout parameter.

[0593] S1108: After receiving the timer timeout indication information, the mDNS module determines that network service 1 is in an offline state.

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

[0595] S1110: The device management service sets network service 1 in an offline state through the device warehouse.

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

[0597] S1112: The mDNS module obtains a plurality of network services (including network service 1, network service 2, and network service 3) supported by the printer 200 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] 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 resolution task for network service 2 based on the specified instance B5 and a resolution task for network service 3 based on the specified instance C5.

[0602] The descriptions of the resolution task for network service 2 and the resolution task for network service 3 can refer to the aforementioned resolution task for network service 1.

[0603] S1116: The mDNS module determines whether there is a resolution task identical to the resolution task for network service 2 and the resolution task for network service 3.

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

[0605] S1117A: If there is a resolution task identical to the resolution task for network service 2 and the resolution task for network service 3, the mDNS module discards the created resolution task for network service 2 and the resolution task for network service 3.

[0606] S1117B: If there is no resolution task identical to the resolution task for network service 2 and the resolution task for network service 3, the mDNS module saves the created resolution task for network service 2 and the resolution task for network service 3.

[0607] S1118: The mDNS module sends the resolution task for network service 2 and the resolution task for 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 resolution instruction of network service 2 to the Android mDNS module through thread 2 (carrying the specified instance B5).

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

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

[0613] The description of this step can refer to the aforementioned 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, the Java singleton thread pool does not receive the service resolution notification of the 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 the timer timeout indication information to the mDNS module.

[0619] The timer timeout indication information is used to indicate that the timing duration of the timer exceeds the timeout parameter.

[0620] S1126: After receiving the timer timeout indication information, the mDNS module determines that the network service 2 is in an offline state.

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

[0622] S1128: The device management service sets the network service 2 in the offline state through the device warehouse.

[0623] Check the state of the network service 3:

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

[0625] S1130: The Java singleton thread pool sends the service resolution instruction of the network service 3 to the Android mDNS module through the 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 the thread blocking instruction to the Java synchronization utility class.

[0630] S1133: When receiving the thread blocking instruction, the Java synchronization utility class blocks the 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, the Java singleton thread pool does not receive the service resolution notification of the 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 information to the mDNS module.

[0634] The timer timeout indication information is used to indicate that the timing duration of the timer exceeds the timeout parameter.

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

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

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

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

[0639] S1139: The mDNS module determines that a plurality of network services are in an offline state.

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

[0641] The indication information 3 can be used to indicate that a plurality of network services are in an offline state.

[0642] S1141: The device management service sets the printer 200 in an offline state through the device warehouse.

[0643] It should be noted that Figures 11A-11B The flow of the module not involved in the foregoing embodiments can be referred to the foregoing embodiments.

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

[0645] Figures 12A-12B 、 Figures 13A-13B Take the case of checking the state of the printer 200 when the Android mDNS module sends an offline notification of the network service 2 and an offline notification of the network service 3. Among them, Figures 12A-12B 、 Figures 13A-13B The modules of the electronic device 100 involved can include: a device management service, a device warehouse, an Android mDNS module, an mDNS module, a Java singleton thread pool and a Java synchronization tool class.

[0646] As Figures 12A-12BAs shown, when the Android mDNS module sends the offline notification of network service 2 and the offline notification of network service 3, before checking the state of network service 2 and the state of network service 3, the electronic device 100 establishes the Wi-Fi connection with the wireless access device 300 again (for example Figure 8B The first case shown, Figure 8E The fourth case shown:

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

[0648] The description of the specified instance B4 carried by the offline notification of network service 2 and the specified instance C4 carried by the offline notification of network service 3 can refer to the description of the specified instance A4 carried by 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] The description of the specified instance B6 of network service 2 and the specified instance C6 of network service 3 can refer to the description of the specified instance B5 of network service 2 and the specified instance C5 of network service 3.

[0652] S1204: The mDNS module creates the resolution task of network service 2 based on the specified instance B6 and creates the resolution task of network service 3 based on the specified instance C6.

[0653] The description of the resolution task of network service 2 and the resolution task of network service 3 can refer to the description of the resolution task of network service 1.

[0654] S1205: The mDNS module determines whether there is a resolution task same as the resolution task of network service 2 and the resolution task of network service 3.

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

[0656] S1206: If there is a resolution task same as the resolution task of network service 2 and the resolution task of network service 3, the mDNS module discards the created resolution task of network service 2 and the resolution task of network service 3.

[0657] S1207: If there is no resolving task identical to the resolving task of the network service 2 and the resolving task of the network service 3, the mDNS module saves the created resolving task of the network service 2 and the resolving task of the network service 3.

[0658] S1208: The mDNS module sends the resolving task of the network service 2 and the resolving task of the network service 3 to the Java singleton thread pool.

[0659] Check the state of the network service 2:

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

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

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

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

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

[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 the thread 4 in the Java singleton thread pool.

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

[0668] S1214: The Android mDNS module sends the service resolving notification of the 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 embodiments.

[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 the thread 4 in the Java singleton thread pool.

[0673] S1218: The Java singleton thread pool sends the service resolving notification of the 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 the online indication of network service 2 to the device management service.

[0676] S1221: The device management service sets network service 2 in the online state through the device warehouse.

[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 the 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 the thread blocking instruction to the Java synchronization utility class.

[0684] S1226: When receiving the thread blocking instruction, the Java synchronization utility class blocks the 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 the 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 the thread release instruction to the Java synchronization utility class.

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

[0690] S1230: When receiving the thread release instruction, the Java synchronization utility class releases the 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 in the online state through the device warehouse.

[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] The description of indication information 2 can refer to the description in the foregoing embodiments.

[0698] S1237: The device management service sets printer 200 in the online state through the device warehouse.

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

[0700] As Figures 13A-13B indicated, when the Android mDNS module sends the offline notification of network service 2 and the offline notification of network service 3, before checking the state of network service 2 and the state of network service 3, the electronic device 100 has disconnected the Wi-Fi connection with the wireless access device 300 (for example Figure 8C indicated in the second case, Figure 8D indicated in the third case):

[0701] After performing S1201-S1208 of Figure 12A :

[0702] Check the state of network service 2:

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

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

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

[0706] S1303: The Java synchronization utility class sets the timeout parameter and the timer.

[0707] The description of this step can refer 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 the thread 4 in the Java singleton thread pool.

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

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

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

[0713] The timer timeout indication information is used to indicate that the timing duration of the timer exceeds the timeout parameter.

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

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

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

[0717] Check the state of the network service 3:

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

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

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

[0721] S1313: The Java synchronization utility class sets the timeout parameter and the timer.

[0722] The description of this step can refer 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, the Java singleton thread pool does not receive the service resolution 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 the timer timeout indication information to the mDNS module.

[0728] The timer timeout indication information is used to indicate that the timing duration of the timer exceeds the timeout parameter.

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

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

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

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

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

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

[0735] 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 the resolution task of the network service 1 based on the specified instance A6.

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

[0738] S1325: The mDNS module determines whether there is a resolution task identical to the resolution task of the network service 1.

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

[0740] S1326A: If there is a resolution task identical to the resolution task of the network service 1, the mDNS module discards the created resolution task of the network service 1.

[0741] S1326B: If there is no resolution task identical to the resolution task of the network service 1, the mDNS module saves the created resolution task of the network service 1.

[0742] S1327: The mDNS module sends the resolution task of the network service 1 to the Java singleton thread pool.

[0743] Check the status of the network service 1:

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

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

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

[0747] S1330: The Java synchronization utility class sets a timeout parameter and a 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 the 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 length of the timer exceeds the timeout parameter, the Java singleton thread pool does not receive the service resolution notification of the network service 1, and the Java synchronization utility class releases the 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] The timer timeout indication information is used to indicate that the timing length of the timer exceeds the timeout parameter.

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

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

[0757] S1337: The device management service sets the network service 1 to be offline through the device warehouse.

[0758] It is determined that the printer 200 is in an offline state:

[0759] S1338: The mDNS module determines that the plurality of network services are all in an offline state.

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

[0761] The indication information 3 can be used to indicate that the plurality of network services are all in an offline state.

[0762] S1340: The device management service sets the printer 200 to be offline through the device warehouse.

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

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

[0765] In a possible implementation, in the printer 200 online stage, after the Android mDNS module sends the service discovery notification to the mDNS module, the mDNS module can create the specified instance A2 of the network service 1, the specified instance B2 of the network service 2, and the specified instance C2 of the network service 3, and implement part or all of the steps in the foregoing Figure 10 based on the foregoing created specified instances.

[0766] Figure 14 A hardware structure schematic diagram of an electronic device 100 provided in the embodiments of the present application.

[0767] As shown in Figure 14 , the electronic device 100 can 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), which can be connected through a bus.

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

[0769] The processor 1401 can include one or more processor units. For example, the processor 1401 can 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. Different processing units can be independent devices or integrated into one or more processors. The controller can generate operation control signals according to instruction operation codes and timing signals, and complete the control of fetching and executing instructions.

[0770] The processor 1401 can also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 1401 is a cache memory. The memory can save instructions or data that the processor 1401 has just used or repeatedly uses. If the processor 1401 needs to use the instructions or data again, it can directly call from the memory. This avoids repeated access and reduces the waiting time of the processor 1401, thereby improving the efficiency of the system.

[0771] In some embodiments, the processor 1401 can include one or more interfaces. The interfaces can 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, for storing various software programs and / or sets of instructions. In specific implementations, the memory 1402 can include a volatile memory, such as a random access memory (RAM), and / or 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 can also include a combination of the above-mentioned types of memories. The memory 1402 can also store some program codes to facilitate the processor 1401 to invoke the program codes stored in the memory 1402 to implement the implementation methods of the embodiments of the present application in the electronic device 100. The memory 1402 can store an operating system, such as an embedded operating system, e.g., uCOS, VxWorks, RTLinux, etc.

[0773] The wireless communication module 1403 can provide solutions for wireless communication applied on the electronic device 100, including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) network), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR) technology, 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 signals to be sent from the processor 1401, perform frequency modulation and amplification, and radiate the signals out as electromagnetic waves via an antenna. In some embodiments, the electronic device 100 can also emit signal probes or scan devices in the vicinity of the electronic device 100 through the Bluetooth module (not shown) and the WLAN module (not shown) in the wireless communication module 1403, and establish a wireless communication connection with the devices in the vicinity to transmit data. Among them, the Bluetooth module can provide solutions for one or more Bluetooth communications including 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. Figure 14 Figure 14

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

[0775] The camera 1405 is used to capture still images or videos. An object projects an optical image through a lens to a photosensitive element. The photosensitive element can 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, which is then transmitted to an ISP for conversion into a digital image signal. The ISP outputs the digital image signal to a DSP for processing. The DSP converts the digital image signal into an image signal in a standard format such as RGB, YUV, etc. In some embodiments, the electronic device 100 can include 1 or N cameras 1405, N being a positive integer greater than 1.

[0776] The audio module 1406 can be used to convert digital audio information into an analog audio signal 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 can also be disposed in the processor 1401, or some functional modules of the audio module 1406 can be disposed in the processor 1401.

[0777] Microphone 1407, also known as a "microphone" or "voice transducer," is used to collect sound signals from the environment surrounding the electronic device. This sound signal is then converted into an electrical signal, which undergoes a series of processing steps, such as analog-to-digital conversion, to obtain a digital audio signal that can be processed by the processor 1401 of the electronic device. When making a phone call or sending a voice message, the user can speak by bringing their mouth close to the microphone 1407, inputting the sound signal into the microphone 1407. The electronic device 100 may have at least one microphone 1407. In some embodiments, the electronic device 100 may have two microphones 1407, which, in addition to collecting sound signals, can also perform noise reduction. In other embodiments, the electronic device 100 may have three, four, or more microphones 1407, enabling sound signal collection, noise reduction, sound source identification, and directional recording, among other functions.

[0778] Electronic device 100 may also include a sensor module ( Figure 14 (Not shown in the image). The sensor module may include multiple sensor elements, such as a touch sensor (…). Figure 14 (Not shown in the image). A touch sensor can also be called a "touch device". A touch sensor can be placed on the display screen 1404, and the touch sensor and the display screen 1404 together form a touch screen, also called a "touchscreen". The touch sensor can be used to detect touch operations applied to or near it.

[0779] It should be noted that, Figure 14 The electronic device 100 shown is merely an illustrative explanation of the hardware structure of the electronic device provided in this application and does not constitute a specific limitation on 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] like Figure 15 As 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. Wherein:

[0782] The processor 1501 can include one or more processing units, e.g., 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. Different processing units can be independent devices or integrated in one or more processors.

[0783] The controller can be the nerve center and command center of the printer 200. The controller can generate operation control signals according to instruction operation codes and timing signals, and complete the control of instruction fetching and instruction execution.

[0784] The processor 1501 can also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 1501 is a cache memory. The memory can save instructions or data that the processor 1501 has just used or repeatedly uses. If the processor 1501 needs to use the instructions or data again, it can directly call from the memory. This avoids repeated access and reduces the waiting time of the processor 1501, thereby improving the efficiency of the system.

[0785] In some embodiments, the processor 1501 can be used to analyze the signal received by the wireless communication module 1503 and demodulate the signal. The processor 1501 can respond according to the analysis result and perform corresponding operations, such as performing sensing operations, etc. In some embodiments, the processor 1501 can also be used to generate signals such as Wi-Fi signals, Bluetooth signals, etc. transmitted outward by the wireless communication module 1503.

[0786] The memory 1502 is coupled to the processor 1501 and is used to store various software programs and / or groups of instructions. In specific implementations, the memory 1502 can include high-speed random access memory, and can also include 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 an embedded operating system uCOS, VxWorks, RTLinux, etc. The memory 1502 can also store a communication program that can be used to communicate with the wireless access device 300 or other devices.

[0787] The wireless communication module 1503 can include a Wi-Fi module. The Wi-Fi module can provide a solution for Wi-Fi wireless communication applied on the printer 200. In which, the Wi-Fi protocol used in the Wi-Fi module can be IEEE 802.11a, 802.11b, 802.11n, 802.11ac, 802.11ax, etc.

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

[0789] Possibly, the Wi-Fi module can be integrated with other communication modules (for example, Bluetooth communication module). The Wi-Fi module can listen to the signals transmitted by other devices, such as measurement signals, scanning signals, etc., and can send response signals, such as measurement responses, scanning 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 near field wireless communication technology to perform 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 near field wireless communication technology to perform 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 paper documents. In one 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 printer 200 shown is only one implementation of the embodiments of the present application, and in actual applications, the printer 200 can also include more or fewer components, which are not limited here.

[0794] In the above embodiments, the term "when" can be interpreted as meaning "if" or "after" or "in response to determining" or "in response to detecting" depending on the context. Similarly, the phrase "on determining" or "if detecting (a stated condition or event)" can be interpreted as meaning "if determining" or "in response to determining" or "on detecting (a stated condition or event)" or "in response to detecting (a stated condition or event)" depending on the context.

[0795] In the above embodiments, all or some of the flowcharts or functions can be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or some of the flowcharts or functions can be implemented 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, all or some of the flowcharts or functions described in the embodiments of the present application are generated. The computer can be a general purpose computer, a special purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center through wired (such as coaxial cable, optical fiber, digital subscriber line) or wireless (such as infrared, wireless, microwave, etc.) mode. The computer readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. integrated with one or more available media. The available media can be magnetic media (such as floppy disk, hard disk, magnetic tape), optical media (such as DVD), or semiconductor media (such as solid state disk), etc.

[0796] A person of ordinary skill in the art can understand that all or part of the flow of the above-mentioned embodiment method can be instructed by a computer program to complete the relevant hardware, and the program can be stored in a computer readable storage medium, and the program can include the flow of each method embodiment as described above when executed. The aforementioned storage medium includes ROM or random access memory (RAM), magnetic disk or optical disk, and various program code storage media.

Claims

1. A method for managing equipment, characterized in that, Applied to a first electronic device, the first electronic device including an Android mDNS module, a device management service, a first application, and the mDNS module, the method includes: When the mDNS module receives information about multiple network services of the second electronic device sent by the wireless access device, the device management service sends an online instruction of the second electronic device to the first application. After the first application receives the online instruction of the second electronic device, in response to a first operation of displaying the first interface of the first application, the first electronic device displays the first interface, which includes the online identifier of the second electronic device; wherein, the plurality of network services are used to control the second electronic device, and the plurality of network services include the first network service; When the first electronic device disconnects from 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 offline. In response to the received first offline notification, the mDNS module queries the status of the plurality of network services; When the mDNS module determines that all of the multiple network services are offline, the device management service sends an offline instruction for the second electronic device to the first application; After the first application receives the offline instruction of the second electronic device, in response to the second operation of displaying the first interface, the first electronic device displays the first interface, which includes the 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 plurality of network services is online, the device management service sends an online instruction for the second electronic device to the first application. After the first application receives the online instruction from the second electronic device, in response to the second operation of displaying the first interface, the first electronic device displays the first interface, which includes the online identifier of the second electronic device.

3. The method according to claim 2, characterized in that, After the first electronic device disconnects its wireless connection with the wireless access device, and before the mDNS module determines that at least one of the plurality of network services is online, the method further includes: The first electronic device establishes a wireless connection with the wireless access device.

4. The method according to claim 1, characterized in that, The first electronic device also includes a Java singleton thread pool; the mDNS module determines that all the multiple network services are offline, specifically including: 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. In response to the first service resolution instruction, the Android mDNS module sends a first mDNS query request for 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 from the first network service within a first time period, the mDNS module determines that the first network service is offline.

5. The method according to claim 4, characterized in that, The first electronic device also includes a Java synchronization utility class; 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 creates a first resolution task for the first network service; wherein the first resolution task includes the first service resolution instruction; The mDNS module sends the first resolution task to the Java singleton thread pool; Upon receiving the first parsing task, the Java singleton thread pool creates the first thread; The Java singleton thread pool sends a first service resolution 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 from 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 offline.

6. The method according to claim 5, characterized in that, After the Java singleton thread pool sends the 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. After the Java singleton thread pool does not receive information from the first network service within a first time period, and 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 timer's duration has exceeded the timeout parameter; The mDNS module determines that the first network service is offline, specifically including: When the timer timeout indication information is received, the mDNS module determines that the first network service is offline.

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. In the first instance, the IP address of the second electronic device, the device name of the second electronic device, the port number of the first network service, and the attribute are empty 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 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, but 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 carrying the second instance of the first network service to the Android mDNS module through the Java singleton thread pool.

8. The method according to claim 4, characterized in that, After the mDNS module determines that the first network service is offline, 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; wherein, the multiple network services also 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 offline, the device management service sends an 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 all offline, the device management service sends an offline instruction for 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 about multiple network services from a second electronic device sent by a wireless access device, the mDNS module saves the information about the multiple network services.

10. The method according to claim 9, characterized in that, The mDNS module stores information about the multiple network services, specifically including: The mDNS module stores information about the multiple network services in 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 information about the multiple network services.

11. The method according to claim 1, characterized in that, The plurality of network services further includes 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 for the second network service and a third offline notification for the third network service to the mDNS module; wherein, the second offline notification is used to indicate that the second network service is offline, and the third offline notification is used to indicate that the third network service is offline. In response to the received second and third offline notifications, the mDNS module queries the status of the plurality of network services; When the mDNS module determines that all of the multiple network services are offline, the device management service sends an offline instruction for the second electronic device to the first application; After the first application receives the offline instruction of the second electronic device, in response to the third operation of displaying the first interface, the first electronic device displays the first interface, which includes the offline identifier of the second electronic device.

12. An electronic device, specifically a first electronic device, 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, and 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, the computer program code including computer instructions, which, when executed by the one or more processors, cause the method as described in any one of claims 1-11 to be performed.

13. A chip system, characterized in that, The chip system is applied to an electronic device, the chip system including one or more processors, the processors being configured to invoke computer instructions to cause the electronic device to perform the method as described in any one of claims 1-11.

14. A computer-readable storage medium comprising instructions, characterized in that, When the instructions are executed on an electronic device, the electronic device causes the electronic device to perform the method as described in any one of claims 1-11.

15. A computer program product, characterized in that, When the computer program product is run on an electronic device, it causes the electronic device to perform the method as described in any one of claims 1-11.

Citation Information

Patent Citations

  • Method and system for managing multi-screen interactive equipment

    CN103702184A

  • State display method and device, terminal equipment, cloud server and medium

    CN116339879A