Method, device and electronic equipment for managing network equipment
By using the master control device to detect and manage IoT devices within a set address set, the problem of network resource waste caused by UDP broadcasting is solved, and efficient device management and resource utilization are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- VIVO MOBILE COMM CO LTD
- Filing Date
- 2023-08-24
- Publication Date
- 2026-07-21
AI Technical Summary
In existing technologies, when IoT devices based on local area networks search for slave devices via UDP broadcast, the already searched devices frequently receive UDP broadcast packets, resulting in a waste of network resources.
The master device probes for slave devices within a predefined set of Internet Protocol addresses and adds the detected slave devices to the managed device list, avoiding repeated probes of already discovered devices. It manages slave devices through UDP unicast and heartbeat detection mechanisms, reducing network resource overhead.
This effectively avoids the frequently received UDP broadcast packets by the already discovered devices, reducing network resource waste and improving device hosting efficiency and network resource utilization.
Smart Images

Figure CN116886575B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of electronic equipment technology, and specifically relates to a management method, management device and electronic equipment for network devices. Background Technology
[0002] In related technologies, IoT devices based on local area networks (LANs) are typically controlled by Ethernet smart devices acting as master devices to control other smart devices. The master device needs to discover slave devices through User Datagram Protocol (UDP) broadcasting.
[0003] UDP broadcasts repeatedly search all Internet Protocol (IP) addresses, causing already found devices to receive UDP broadcast packets frequently, resulting in a waste of network resources. Summary of the Invention
[0004] The purpose of this application is to provide a network device management method, management device, and electronic device that can solve the problem of network resource waste caused by frequently receiving UDP broadcast packets from already discovered devices.
[0005] In a first aspect, embodiments of this application provide a method for managing a network device, executed by a master control device, the method comprising:
[0006] Within the first set of Internet Protocol addresses, detect slave devices connected to any Internet Protocol address within the first set of Internet Protocol addresses;
[0007] If the first slave device is detected, add the device information of the first slave device to the managed device list;
[0008] Upon receiving a device instruction for controlling the first slave device, and if the first slave device is online, the device instruction is sent to the first slave device;
[0009] Based on the first response information corresponding to the device command, the corresponding notification information is output.
[0010] Secondly, embodiments of this application provide a method for managing a network device, executed by a slave device, the method comprising:
[0011] Upon receiving a device instruction from the master control device, the device executes the corresponding device function.
[0012] Send the first response information to the main control device. The first response information is associated with the execution result of the device function.
[0013] Thirdly, embodiments of this application provide a network device management apparatus, applied to a main control device, the management apparatus comprising:
[0014] The detection module is used to detect slave devices connected to any Internet Protocol address within the first Internet Protocol address set.
[0015] The storage module is used to add the device information of the first slave device to the managed device list when the first slave device is detected.
[0016] The sending module is used to send the device instruction to the first slave device when it receives a device instruction for controlling the first slave device and the first slave device is online.
[0017] The output module is used to output corresponding notification information based on the first response information corresponding to the device command.
[0018] Fourthly, embodiments of this application provide a network device management apparatus, applied to a slave device, the management apparatus comprising:
[0019] The execution module is used to execute the device function corresponding to the device instruction when it receives the device instruction sent by the master control device;
[0020] The sending module sends the first response information to the main control device, and the first response information is associated with the execution result of the device function.
[0021] Fifthly, embodiments of this application provide a first electronic device, including a processor and a memory, wherein the memory stores a program or instructions that can run on the processor, and when the program or instructions are executed by the processor, they implement the steps of the method as described in the first aspect.
[0022] In a sixth aspect, embodiments of this application provide a second electronic device, including a processor and a memory, wherein the memory stores a program or instructions that can run on the processor, and the program or instructions, when executed by the processor, implement the steps of the method as described in the second aspect.
[0023] In a seventh aspect, embodiments of this application provide a readable storage medium on which a program or instructions are stored, which, when executed by a processor, implement the steps of the method as described in the first or second aspect.
[0024] Eighthly, embodiments of this application provide a chip including a processor and a communication interface coupled to the processor, the processor being used to run programs or instructions to implement the steps of the methods as described in the first or second aspect.
[0025] Ninthly, embodiments of this application provide a computer program product stored in a storage medium, which is executed by at least one processor to implement the method as described in the first or second aspect.
[0026] In this embodiment of the application, when the master device searches for slave devices, it probes for available slave devices within a pre-defined first set of Internet Protocol addresses. After detecting an available slave device, it adds the first detected slave device to the managed device list. In subsequent probes, the first detected slave device will not be probed repeatedly, which can avoid the already searched devices from frequently receiving UDP broadcast packets and reduce network resource overhead. Attached Figure Description
[0027] Figure 1 One of the flowcharts illustrating a network device management method according to some embodiments of this application is shown;
[0028] Figure 2 Schematic diagrams of network structures in some embodiments of this application are shown;
[0029] Figure 3 A logical schematic diagram of heartbeat detection according to some embodiments of this application is shown;
[0030] Figure 4 A second flowchart illustrating a method for managing a network device according to some embodiments of this application is shown.
[0031] Figure 5 Flowcharts of search devices according to some embodiments of this application are shown;
[0032] Figure 6 Flowcharts illustrating signaling execution of some embodiments of this application are shown;
[0033] Figure 7 A flowchart of a network device management method according to some embodiments of this application is shown in Figure 3.
[0034] Figure 8 One of the structural block diagrams of a network device management apparatus according to some embodiments of this application is shown;
[0035] Figure 9 A second structural block diagram of a network device management apparatus according to some embodiments of this application is shown;
[0036] Figure 10 A structural block diagram of an electronic device according to an embodiment of this application is shown;
[0037] Figure 11 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of this application. Detailed Implementation
[0038] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.
[0039] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such terms can be used interchangeably where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.
[0040] The management method, management device, and electronic device of the network device provided in this application will be described in detail below with reference to the accompanying drawings and through specific embodiments and application scenarios.
[0041] In some embodiments of this application, a method for managing network devices is provided, which is executed by a master control device. Figure 1 One of the flowcharts illustrating a network device management method according to some embodiments of this application is shown, such as... Figure 1 As shown, the method includes:
[0042] Step 102: Within the first set of Internet Protocol addresses, detect slave devices connected to any Internet Protocol address within the first set of Internet Protocol addresses.
[0043] In this embodiment of the application, the first Internet Protocol address set refers to the range of IP addresses that may be assigned to slave devices in the network environment where the current master device is located.
[0044] Specifically, Figure 2 Schematic diagrams of network structures in some embodiments of this application are shown, such as... Figure 2 As shown, a common home IoT environment connects multiple smart devices via a local area network (LAN). The master control device, specifically, refers to the device that acts as the "brain" in the IoT, controlling other smart home devices. The slave devices refer to the other smart home devices in the IoT, such as… Figure 2 The smart speaker, smart rice cooker, smart TV, mobile phone A, and mobile phone B shown can all be slave devices.
[0045] The number of IP addresses on a home LAN is limited. For example, a typical home network subnet mask is a 24-bit subnet mask. If the IP address of the main control device is 192.168.0.4 / 24 and the gateway address is 192.168.0.1, and Dynamic Host Configuration Protocol (DCHP) is enabled, the available IP addresses can be determined to be from 192.168.0.2 to 192.168.0.254. After removing the IP address of the main control device itself, 252 usable IP addresses remain.
[0046] The first set of Internet Protocol (IP) addresses is the set of available IP addresses after removing known occupied IP addresses from all available IP addresses.
[0047] Step 104: If the first slave device is detected, add the device information of the first slave device to the managed device list.
[0048] In this embodiment, the master device detects each IP address in the first Internet Protocol address set and determines whether there is an unrecorded slave device. If a first slave device not recorded in the managed device list is detected, the device information of the first slave device is obtained and added to the managed device list.
[0049] After adding the device information of the first slave device to the managed device list, the first Internet Protocol address set is updated synchronously to remove the detected devices. This prevents the sending of probe information to the detected slave devices during subsequent probes, thus avoiding wasting network resources and interfering with the operation of the detected slave devices.
[0050] Step 106: Upon receiving a device instruction for controlling the first slave device, and provided that the first slave device is online, the device instruction is sent to the first slave device.
[0051] In this embodiment of the application, when a device command sent by a user for controlling the first slave device is received, the master control device determines whether the managed first slave device is online, that is, whether it is in normal working condition.
[0052] If the first slave device is determined to be online, a device command is sent to the first slave device. The master device controls the first slave device to execute the corresponding device function through the device command. At the same time, the master device receives the first response information from the first slave device in response to the device command and determines whether the first slave device has successfully responded to the user's device command based on the first response information.
[0053] Step 108: Based on the first response information corresponding to the device command, output the corresponding notification information.
[0054] In this embodiment of the application, if the master control device receives the first response information and the first response information indicates that the device function corresponding to the device instruction has been successfully executed, the master control device outputs the corresponding notification information to the user to notify the user that the control was successful.
[0055] If the master control device receives the first response information, and the first response information indicates that the device function corresponding to the device instruction failed to execute, the master control device will output the corresponding notification information to the user, informing the user that the control failed and prompting the user with an error message.
[0056] If the main control device does not receive the first response information within the preset time period, a device error message will be generated.
[0057] For example, by quickly detecting the device information of slave devices in the current local area network environment, it is possible to quickly find specific devices. For instance, if a user cannot find their mobile phone, they can use voice control to find the master device, such as a smart speaker. After receiving the user's voice command to find the mobile phone, the smart speaker will detect the mobile phone within the IP address set of the current gateway. After detecting the mobile phone, it will send a device command to the mobile phone to control the mobile phone to make a sound, thus helping the user find the mobile phone quickly.
[0058] For example, by quickly detecting the device information of slave devices in the current local area network environment, it is possible to quickly control smart devices in the current network environment. If a user wants to start a timer, they can do so by voice control to the master device, such as a smart speaker. After receiving the user's voice command to start the timer, the smart speaker will detect devices with timer functionality, such as smart alarm clocks, within the IP address set of the current gateway. Upon detecting a smart alarm clock, it will send a device command to the smart alarm clock, controlling it to start the countdown based on the time duration input by the user's voice.
[0059] In this embodiment of the application, when the master device searches for slave devices, it probes for available slave devices within a pre-defined first set of Internet Protocol addresses. After detecting an available slave device, it adds the first detected slave device to the managed device list. In subsequent probes, the first detected slave device will not be probed repeatedly, which can avoid the already searched devices from frequently receiving UDP broadcast packets and reduce network resource overhead.
[0060] In some embodiments of this application, before detecting slave devices connected to any Internet Protocol address within the first Internet Protocol address set, the method further includes:
[0061] The second Internet Protocol address set is determined based on the Dynamic Host Configuration Protocol of the master control device;
[0062] Based on the list of managed devices, a third set of Internet Protocol addresses is determined. The Internet Protocol addresses in the third set of Internet Protocol addresses are the Internet Protocol addresses of the detected slave devices, and the third set of Internet Protocol addresses is a subset of the second set of Internet Protocol addresses.
[0063] The first Internet Protocol address set is determined by the complement of the third Internet Protocol address set in the second Internet Protocol address set.
[0064] In this embodiment of the application, Dynamic Host Configuration Protocol (DHCP) is used. DHCP allows servers (such as routers and other gateway devices) to dynamically assign IP addresses and configuration information to clients (such as mobile phones, smart home appliances, and other smart devices).
[0065] The master control device is based on the current DHCP protocol. Specifically, it determines the second Internet Protocol address set based on its own IP and subnet mask. This second Internet Protocol address set is the set of all available IPs in the local area network to which the master control device is currently connected, excluding IP information such as network segments, broadcasts, and its own IP.
[0066] The third set of Internet Protocol (IP) addresses is determined based on a list of managed devices and is a collection of the IP addresses of the detected slave devices.
[0067] In the second set of Internet Protocol (IP) addresses, the set of IP addresses of the slave devices that have already been detected is removed, which is the third set of Internet Protocol (IP) addresses. The resulting first set of Internet Protocol (IP) addresses is the set of IP addresses that may be assigned to slave devices that have not yet been detected.
[0068] This application embodiment removes the IP sets of already detected slave devices from the entire set of available IPs in the current network, thereby avoiding repeated detection of already detected slave devices, preventing interference with already detected slave devices, and saving network resources.
[0069] In some embodiments of this application, the management method further includes:
[0070] Based on the list of managed devices, determine the third set of Internet Protocol addresses, which are the Internet Protocol addresses of the detected slave devices.
[0071] Based on the Internet Control Message Protocol, device detection is performed on each Internet Protocol address in the third Internet Protocol address set.
[0072] If the device detection result for any Internet Protocol address in the third Internet Protocol address set fails, delete the device information corresponding to any Internet Protocol address from the managed device list.
[0073] In this embodiment of the application, the Internet Control Message Protocol (ICMP) is used to transmit control information. The fourth Internet Protocol address combination is a set of IPs in "managed state" and "abnormal state". The master control device pulls the set of IPs in managed state and abnormal state from the managed device list and performs ICMP detection.
[0074] Among them, the IP address in the pending management state can be a pending management state added by the user. For example, if a user purchases a new robot vacuum cleaner and manually configures it to connect to the network, the IP address that the robot vacuum cleaner connects to is the IP address in the pending management state.
[0075] An IP address in an abnormal state could be a previously detected slave device that is currently in a heartbeat inactive, offline, or faulty state, resulting in a different IP address.
[0076] When a detection result of a first Internet Protocol address being detected in the third Internet Protocol address set is a failure, the device is removed from the managed device list, i.e., the slave device that is not working properly is removed.
[0077] Optionally, the managed device list and other record information can be stored in the main control device's memory database and persisted to improve storage efficiency and avoid data loss due to device restarts.
[0078] This application embodiment improves hosting efficiency by detecting IP addresses in abnormal or pending hosting states to identify slave devices that are not working properly.
[0079] In some embodiments of this application, the method further includes, before adding the device information of the first slave device to the managed device list:
[0080] Send User Datagram Protocol (UDP) unicast information to the first slave device. The UDP unicast information includes at least one of the following: Internet Protocol (IP) address information of the master device, interface information corresponding to the master device, and identification information of the master device.
[0081] The first step is to add the device information from the device to the managed device list, including:
[0082] Upon receiving device information corresponding to a User Datagram Protocol unicast message, the device information is added to the managed device list.
[0083] In this embodiment, the master device performs a User Datagram Protocol (UDP) unicast to all detected slave devices, specifically including the first slave device. The UDP information includes, but is not limited to, the master device's IP information, the interface information for receiving response information, and the master device's offset identifier, i.e., identification information. This identification information helps the master device verify the authenticity of the response information.
[0084] After sending the UDP unicast information to the first slave device, the first slave device prompts the user for confirmation whether to perform managed operation. Upon receiving the user's confirmation, the first slave device sends its own device information, i.e., the device information of the first slave device, to the master device as a response.
[0085] For example, the device information includes the device name, device IP address, device interface information, and device identification code of the slave device. The device interface information includes, but is not limited to, health check interfaces and control interfaces. Simultaneously, the first slave device retains the unique identifier and notification interface information of the master device.
[0086] After the master device receives the device information of the first slave device, it adds the device information of the first slave device to the managed device list and updates the status of the first slave device from "pending management" to "managed".
[0087] This application embodiment enables the control structure of the managed slave device to be customized individually by unicasting UDP only to the detected slave device, without fixed requirements. It can achieve unified management of smart devices of different manufacturers and specifications, while avoiding frequent UDP broadcasts to devices in the network, thus achieving uninterrupted management.
[0088] In some embodiments of this application, the management method further includes:
[0089] Send a probe heartbeat message to each slave device in the managed device list;
[0090] If the device receives a second response message corresponding to the heartbeat detection information from the second slave device within a preset time period, the device status of the second slave device will be set to online.
[0091] If no second response information is received within a preset time period, the device status of the second slave device will be set to offline.
[0092] In the embodiments of this application, Figure 3The following are schematic diagrams illustrating the logic of heartbeat detection according to some embodiments of this application, such as... Figure 3 As shown, the master device periodically sends heartbeat probe messages to the IP address of each managed slave device in the managed device list.
[0093] For example, heartbeat detection messages can be sent and received through a customized health check interface.
[0094] After receiving the heartbeat detection message from the master device, the slave device returns a second response message to the master device through the same interface. This second response message indicates that the slave device is currently online and can send and receive information normally.
[0095] If the master device receives a second response message from the second slave device within a preset time period, the master device sets the device status of the second slave device to online. It is understood that if the current device status of the second slave device is offline, the offline status will be updated to online. If the current device status of the second slave device is online, the online status will remain unchanged.
[0096] If the master device does not receive the second response information sent by the second slave device within the preset time period, the master device will set the device status of the second slave device to offline status.
[0097] In some implementations, after setting the device status of the second slave device to offline, the master device outputs the corresponding device status information to the user, reminding the user that the second slave device is offline.
[0098] This application embodiment detects the heartbeat of the managed device, thereby enabling real-time updates of the managed slave device's status. This eliminates the need for users to repeatedly check the device status themselves, improving management efficiency.
[0099] In some embodiments of this application, the management method further includes:
[0100] Upon receiving the status information of the third slave device, update the device information of the third slave device in the managed device list based on the status information.
[0101] In this embodiment of the application, the slave device in the managed state, such as the third slave device, periodically reports status information to the master device based on the retained master control identification notification interface and identification information. The status information includes device name, device IP, device interface information and device identification information, etc.
[0102] In some scenarios, such as after the third slave device restarts or reconnects from a network outage, the third slave device immediately reports its status information to the master control device after it starts up or successfully connects to the network.
[0103] After receiving the status information reported by the slave device, the master control device verifies the received information. If it finds that the device information has changed, such as duplicate IP information, it overwrites the original IP information, thereby automatically updating the device information of the third slave device in a timely manner.
[0104] This application embodiment enables slave devices to proactively report status information to the master device, effectively addressing scenarios such as device restarts and IP changes caused by network disconnection and reconnection. It eliminates the need for users to manually reconfigure the managed status, thus improving device management efficiency.
[0105] In some embodiments of this application, Figure 4 A second flowchart illustrating a network device management method according to some embodiments of this application is shown, such as... Figure 4 As shown, the method includes:
[0106] Step 402, search for devices;
[0107] Step 404, Heartbeat Mechanism;
[0108] Step 406, signaling execution.
[0109] The management methods for network devices mainly include device search, heartbeat mechanism, and signaling execution.
[0110] In the device search phase, Figure 5 Flowcharts of search devices according to some embodiments of this application are shown, such as Figure 5 As shown, the method includes:
[0111] Step 502A: Calculate the IP range;
[0112] Step 502B: Retrieve the IP ranges in the "pending management" and "abnormal" states.
[0113] The master control device uses its own IP address and subnet mask to remove information such as network segment, broadcast, and its own IP address, and calculates the range of available IP addresses within the local area network as range 1. The master control device uses the current device list as IP range 2. Range 2 is removed from range 1 to obtain the final range of IP addresses to be detected.
[0114] Step 504, ICMP probe and update.
[0115] Specifically, the ICMP protocol is used to detect the range of IPs to be detected calculated in step 1, obtain the available IP range, add device information to the master device, and mark the status as "detected".
[0116] Asynchronously, retrieve the IP ranges in the "pending management" and "abnormal status" states from the device list, perform ICMP probing, and remove the devices from the list if they are found to be unreachable.
[0117] The preferred approach for recording information is to use an in-memory database combined with file persistence, which can effectively solve the problems of efficiency and restart recovery.
[0118] Step 506, UDP unicast.
[0119] The master control device obtains the IP range of devices in the "detected" state from the device list and performs a UDP unicast search. The UDP information includes, but is not limited to, the master control device's IP information, the received response interface information, and the master control device's unique identifier. The unique identifier can be used by the master control device to verify the authenticity of the response information. After the message is sent, the device status is updated to "pending management".
[0120] Upon receiving the request, the device to be managed requires the user to confirm whether to entrust it with hosting. After confirmation, the device transmits its information to the master device. The response message can be sent as a single message or in multiple messages, including but not limited to the device name, device IP address, device interface information, and device identification code. The device identification code is used by the master device to verify the device's identity after sending the device interface information to the managed device. Device interface information includes, but is not limited to, health check interfaces and control interfaces. Simultaneously, the device to be managed retains the master device's unique identifier and notification interface information.
[0121] Step 508: Collect and store the response.
[0122] Upon receiving the response, the master control device verifies its unique identifier and updates the response information in its storage. The device status is then updated to "managed".
[0123] The logic of the heartbeat mechanism is as follows: Figure 3 As shown, it includes:
[0124] Step 1: The master device sends a message via the health check interface to perform a heartbeat probe based on the IP range of the "Managed" status in the device list. If a normal response is received, the device status is updated to "Running". If there is no response, the device status is updated to "Abnormal".
[0125] Step 2: The managed device periodically reports status information based on the retained master control device notification interface and unique identification code. If the managed device is powered off and restarted, it will report status information immediately after startup. The reported information includes, but is not limited to, device name, device IP, device interface information, and device identification code. After receiving the information, the master control device verifies it, and adds it to the device list if the verification is successful. If duplicate IP information is found, the original IP device information will be overwritten.
[0126] Steps 1 and 2 are not sequential; they are sent to each other periodically by the main control device and the managed device, respectively.
[0127] During the signaling execution phase Figure 6Flowcharts illustrating signaling execution of some embodiments of this application are shown, such as... Figure 6 As shown, the method includes:
[0128] Step 602: Receive user instructions.
[0129] The main control device receives user commands.
[0130] Step 604: Determine if the device is online; if yes, proceed to step 606; otherwise, proceed to step 612.
[0131] The main control device determines whether the managed device is in a "running" state. If so, it continues. If not, it notifies the user to terminate.
[0132] Step 606: Determine if the device command matches; if yes, proceed to step 608; otherwise, proceed to step 612.
[0133] The main control device matches the control interface information provided by the managed device according to the user's instructions. If the match is successful, the operation is executed, carrying the device identification code. If the match fails, the user is notified to terminate the process.
[0134] Step 608: Send device instructions;
[0135] Step 610, collect responses;
[0136] Step 612 reminds the user.
[0137] The main control device collects the response information from the managed devices and informs the user of the execution results.
[0138] In some embodiments of this application, a method for managing a network device is provided, which is executed by a slave device. Figure 7 A flowchart of a network device management method according to some embodiments of this application is shown in Figure 3. Figure 7 As shown, the method includes:
[0139] Step 702: Upon receiving a device instruction from the master control device, execute the device function corresponding to the device instruction;
[0140] Step 704: Send the first response information to the main control device. The first response information is associated with the execution result of the device function.
[0141] In this embodiment, when the master control device receives a device command sent by the user for controlling the slave device, the master control device determines whether the managed slave device is online, i.e., whether it is in normal working condition. If it determines that the first slave device is online, it sends the device command to the slave device.
[0142] After receiving a device instruction from the master device, the slave device parses the instruction and executes the corresponding device function.
[0143] For example, if the slave device is a robotic vacuum cleaner, and the slave device command is used to instruct the robotic vacuum cleaner to clean the target area, then after receiving the slave device command sent by the master device, the robotic vacuum cleaner will immediately go to the target area and carry out the cleaning work.
[0144] For example, if the slave device is an air conditioner, and the device command is used to instruct the air conditioner to start cooling with a target temperature of 24°C, then after receiving the device command sent by the master control device, the air conditioner will start the command and set the target cooling temperature to 24°C.
[0145] The embodiments of this application enable the master control device to quickly identify and manage the slave device, and the managed control interface can be customized separately, enabling unified managed management of IoT devices of different systems and specifications.
[0146] In some embodiments of this application, the management method further includes:
[0147] Upon receiving a unicast message from the master control device, the slave device sends device information corresponding to the slave device to the master control device.
[0148] In this embodiment, the master device unicasts User Datagram Protocol (UDP) to the detected slave device. The UDP information includes, but is not limited to, the master device's IP information, the interface information for receiving the response information, and the master-slave displacement identifier, i.e., identification information. This identification information helps the master device verify the authenticity of the response information.
[0149] After receiving UDP unicast information from the slave device, the slave device prompts the user for confirmation regarding whether to perform managed operation. Upon receiving confirmation from the user, the slave device sends its device information as a response to the master device.
[0150] For example, the device information includes the device name, device IP address, device interface information, and device identification code of the slave device. The device interface information includes, but is not limited to, health check interfaces and control interfaces. Simultaneously, the first slave device retains the unique identifier and notification interface information of the master device.
[0151] This application embodiment enables the control structure of the managed slave device to be customized individually by unicasting UDP only to the detected slave device, without fixed requirements. It can achieve unified management of smart devices of different manufacturers and specifications, while avoiding frequent UDP broadcasts to devices in the network, thus achieving uninterrupted management.
[0152] In some embodiments of this application, the management method further includes:
[0153] Upon receiving a heartbeat detection message from the master control device, a second response message is sent to the master control device within a preset time period.
[0154] In this embodiment, the master device periodically sends heartbeat detection messages to the managed slave devices. After receiving the heartbeat detection messages from the master device, the slave devices return a second response message to the master device through the same interface. This second response message indicates that the master device's current slave devices are online and capable of sending and receiving information normally.
[0155] This application embodiment detects the heartbeat of the managed device, thereby enabling real-time updates of the managed slave device's status. This eliminates the need for users to repeatedly check the device status themselves, improving management efficiency.
[0156] The network device management method provided in this application can be executed by a network device management device. This application uses the example of a network device management device executing a network device management method to illustrate the network device management device provided in this application.
[0157] In some embodiments of this application, a network device management apparatus is provided, applied to a main control device. Figure 8 One of the structural block diagrams of a network device management apparatus according to some embodiments of this application is shown, such as Figure 8 As shown, the management device 800 includes:
[0158] The detection module 802 is used to detect slave devices connected to any Internet Protocol address in the first Internet Protocol address set.
[0159] Storage module 804 is used to add the device information of the first slave device to the managed device list when the first slave device is detected;
[0160] The sending module 806 is used to send the device instruction to the first slave device when it receives a device instruction for controlling the first slave device and the first slave device is online.
[0161] The output module 808 is used to output corresponding notification information based on the first response information corresponding to the device command.
[0162] In this embodiment of the application, when the master device searches for slave devices, it probes for available slave devices within a pre-defined first set of Internet Protocol addresses. After detecting an available slave device, it adds the first detected slave device to the managed device list. In subsequent probes, the first detected slave device will not be probed repeatedly, which can avoid the already searched devices from frequently receiving UDP broadcast packets and reduce network resource overhead.
[0163] In some embodiments of this application, the management device further includes:
[0164] The determination module is used to determine a second Internet Protocol address set based on the Dynamic Host Configuration Protocol of the master device; determine a third Internet Protocol address set based on the list of managed devices, wherein the Internet Protocol addresses in the third Internet Protocol address set are the Internet Protocol addresses of the detected slave devices, and the third Internet Protocol address set is a subset of the second Internet Protocol address set; and determine a first Internet Protocol address set based on the complement of the third Internet Protocol address set in the second Internet Protocol address set.
[0165] This application embodiment removes the IP sets of already detected slave devices from the entire set of available IPs in the current network, thereby avoiding repeated detection of already detected slave devices, preventing interference with already detected slave devices, and saving network resources.
[0166] In some embodiments of this application, the management device further includes:
[0167] The determination module is used to determine a third set of Internet Protocol addresses based on the list of managed devices. The Internet Protocol addresses in the third set of Internet Protocol addresses are the Internet Protocol addresses of the detected slave devices.
[0168] The detection module is specifically used to perform device detection on each Internet Protocol address in the third Internet Protocol address set based on the Internet Control Message Protocol.
[0169] The storage module is also used to delete the device information corresponding to any Internet Protocol address from the managed device list if the device detection result for any Internet Protocol address in the third Internet Protocol address set fails.
[0170] This application embodiment improves hosting efficiency by detecting IP addresses in abnormal or pending hosting states to identify slave devices that are not working properly.
[0171] In some embodiments of this application, the management device further includes:
[0172] The broadcast module is used to send User Datagram Protocol (UDP) unicast information to the first slave device. The UDP unicast information includes at least one of the following: the Internet Protocol (IP) address information of the master device, the interface information corresponding to the master device, and the identification information of the master device.
[0173] The storage module is specifically used to determine that a first slave device has been detected when receiving device information corresponding to user datagram protocol unicast information.
[0174] This application embodiment enables the control structure of the managed slave device to be customized individually by unicasting UDP only to the detected slave device, without fixed requirements. It can achieve unified management of smart devices of different manufacturers and specifications, while avoiding frequent UDP broadcasts to devices in the network, thus achieving uninterrupted management.
[0175] In some embodiments of this application, the sending module is further configured to send a heartbeat detection message to each slave device in the managed device list;
[0176] The management device also includes:
[0177] The status setting module is used to set the device status of the second slave device to online status when it receives the second response information corresponding to the heartbeat detection information sent by the second slave device within a preset time period.
[0178] If no second response information is received within a preset time period, the device status of the second slave device will be set to offline.
[0179] This application embodiment detects the heartbeat of the managed device, thereby enabling real-time updates of the managed slave device's status. This eliminates the need for users to repeatedly check the device status themselves, improving management efficiency.
[0180] In some embodiments of this application, the management device further includes:
[0181] The update module is used to update the device information of the third slave device in the managed device list based on the status information received from the third slave device.
[0182] This application embodiment enables slave devices to proactively report status information to the master device, effectively addressing scenarios such as device restarts and IP changes caused by network disconnection and reconnection. It eliminates the need for users to manually reconfigure the managed status, thus improving device management efficiency.
[0183] In some embodiments of this application, a network device management apparatus is provided, applied to a main control device. Figure 9 A second structural block diagram of a network device management apparatus according to some embodiments of this application is shown, such as... Figure 9 As shown, the management device 900 includes:
[0184] The execution module 902 is used to execute the device function corresponding to the device instruction when it receives the device instruction sent by the master control device;
[0185] The sending module 904 is used to send first response information to the master control device. The first response information is associated with the execution result of the device function.
[0186] The embodiments of this application enable the master control device to quickly identify and manage the slave device, and the managed control interface can be customized separately, enabling unified managed management of IoT devices of different systems and specifications.
[0187] In some embodiments of this application, the management device further includes:
[0188] The sending module is also used to send device information corresponding to the slave device to the master control device when it receives user datagram protocol unicast information sent by the master control device.
[0189] This application embodiment enables the control structure of the managed slave device to be customized individually by unicasting UDP only to the detected slave device, without fixed requirements. It can achieve unified management of smart devices of different manufacturers and specifications, while avoiding frequent UDP broadcasts to devices in the network, thus achieving uninterrupted management.
[0190] In some embodiments of this application, the management device further includes:
[0191] The sending module is also used to send a second response message to the main control device within a preset time period when it receives a heartbeat detection message sent by the main control device.
[0192] This application embodiment detects the heartbeat of the managed device, thereby enabling real-time updates of the managed slave device's status. This eliminates the need for users to repeatedly check the device status themselves, improving management efficiency.
[0193] The management device for the network device in this application embodiment can be an electronic device or a component within an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other devices besides a terminal. For example, the electronic device can be a mobile phone, tablet computer, laptop computer, PDA, in-vehicle electronic device, mobile internet device (MID), augmented reality (AR) / virtual reality (VR) device, robot, wearable device, ultra-mobile personal computer (UMPC), netbook, or personal digital assistant (PDA), etc. It can also be a server, network attached storage (NAS), personal computer (PC), television (TV), ATM, or self-service machine, etc. This application embodiment does not specifically limit the scope of the device.
[0194] The management device for the network device in this application embodiment can be a device with an operating system. This operating system can be Android, iOS, or other possible operating systems; this application embodiment does not specifically limit the specific operating system used.
[0195] The network device management device provided in this application embodiment can implement the various processes implemented in the above method embodiments. To avoid repetition, it will not be described again here.
[0196] Optionally, embodiments of this application also provide an electronic device. Figure 10 A structural block diagram of an electronic device according to an embodiment of this application is shown, such as... Figure 10 As shown, the electronic device 1000 includes a processor 1002, a memory 1004, and a program or instructions stored in the memory 1004 and executable on the processor 1002. When the program or instructions are executed by the processor 1002, they implement the various processes of the above method embodiments and achieve the same technical effects. To avoid repetition, they will not be described again here.
[0197] It is understood that the aforementioned electronic devices include the first electronic device and the second electronic device in the embodiments of this application.
[0198] It should be noted that the electronic devices in the embodiments of this application include the aforementioned mobile electronic devices and non-mobile electronic devices.
[0199] Figure 11A schematic diagram of the hardware structure of an electronic device to implement an embodiment of this application.
[0200] The electronic device 1100 includes, but is not limited to, components such as: radio frequency unit 1101, network module 1102, audio output unit 1103, input unit 1104, sensor 1105, display unit 1106, user input unit 1107, interface unit 1108, memory 1109, and processor 1110.
[0201] Those skilled in the art will understand that the electronic device 1100 may also include a power supply (such as a battery) for supplying power to various components. The power supply may be logically connected to the processor 1110 through a power management system, thereby enabling functions such as managing charging, discharging, and power consumption through the power management system. Figure 11 The electronic device structure shown does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown, or combine certain components, or have different component arrangements, which will not be elaborated here.
[0202] The processor 1110 is configured to: detect slave devices connected to any Internet Protocol address within the first Internet Protocol address set; add the device information of the first slave device to the managed device list when a first slave device is detected; send the device instruction to the first slave device when a device instruction for controlling the first slave device is received and the first slave device is online; and output corresponding notification information based on the first response information corresponding to the device instruction.
[0203] In this embodiment of the application, when the master device searches for slave devices, it probes for available slave devices within a pre-defined first set of Internet Protocol addresses. After detecting an available slave device, it adds the first detected slave device to the managed device list. In subsequent probes, the first detected slave device will not be probed repeatedly, which can avoid the already searched devices from frequently receiving UDP broadcast packets and reduce network resource overhead.
[0204] Optionally, the processor 1110 is further configured to determine a second Internet Protocol address set based on the dynamic host configuration protocol of the master device; determine a third Internet Protocol address set according to the list of managed devices, wherein the Internet Protocol addresses in the third Internet Protocol address set are the Internet Protocol addresses of the detected slave devices, and the third Internet Protocol address set is a subset of the second Internet Protocol address set; and determine a first Internet Protocol address set according to the complement of the third Internet Protocol address set in the second Internet Protocol address set.
[0205] This application embodiment removes the IP sets of already detected slave devices from the entire set of available IPs in the current network, thereby avoiding repeated detection of already detected slave devices, preventing interference with already detected slave devices, and saving network resources.
[0206] Optionally, the processor 1110 is further configured to determine a third Internet Protocol address set based on the managed device list, wherein the Internet Protocol addresses in the third Internet Protocol address set are the Internet Protocol addresses of the detected slave devices; perform device detection on each Internet Protocol address in the third Internet Protocol address set based on the Internet Control Message Protocol; and delete the device information corresponding to any Internet Protocol address in the managed device list if the device detection result for any Internet Protocol address in the third Internet Protocol address set is a detection failure.
[0207] This application embodiment improves hosting efficiency by detecting IP addresses in abnormal or pending hosting states to identify slave devices that are not working properly.
[0208] Optionally, the processor 1110 is further configured to send User Datagram Protocol (UDP) unicast information to the first slave device, the UDP unicast information including at least one of the following: Internet Protocol (IP) address information of the master device, interface information corresponding to the master device, and identification information of the master device; and upon receiving device information corresponding to the UDP unicast information, determine that the first slave device has been detected.
[0209] This application embodiment enables the control structure of the managed slave device to be customized individually by unicasting UDP only to the detected slave device, without fixed requirements. It can achieve unified management of smart devices of different manufacturers and specifications, while avoiding frequent UDP broadcasts to devices in the network, thus achieving uninterrupted management.
[0210] Optionally, the processor 1110 is further configured to send a probe heartbeat message to each slave device in the managed device list; if a second response message corresponding to the probe heartbeat message is received from the second slave device within a preset time period, the device status of the second slave device is set to online; if no second response message is received within a preset time period, the device status of the second slave device is set to offline.
[0211] This application embodiment detects the heartbeat of the managed device, thereby enabling real-time updates of the managed slave device's status. This eliminates the need for users to repeatedly check the device status themselves, improving management efficiency.
[0212] Optionally, the processor 1110 is also configured to update the device information of the third slave device in the managed device list based on the status information received from the third slave device.
[0213] This application embodiment enables slave devices to proactively report status information to the master device, effectively addressing scenarios such as device restarts and IP changes caused by network disconnection and reconnection. It eliminates the need for users to manually reconfigure the managed status, thus improving device management efficiency.
[0214] Optionally, the processor 1110 is further configured to, upon receiving a device instruction sent by the master control device, execute a device function corresponding to the device instruction; and send a first response information to the master control device, the first response information being associated with the execution result of the device function.
[0215] The embodiments of this application enable the master control device to quickly identify and manage the slave device, and the managed control interface can be customized separately, enabling unified managed management of IoT devices of different systems and specifications.
[0216] Optionally, the processor 1110 is also configured to send device information corresponding to the slave device to the master device upon receiving user datagram protocol unicast information sent by the master device.
[0217] This application embodiment enables the control structure of the managed slave device to be customized individually by unicasting UDP only to the detected slave device, without fixed requirements. It can achieve unified management of smart devices of different manufacturers and specifications, while avoiding frequent UDP broadcasts to devices in the network, thus achieving uninterrupted management.
[0218] Optionally, the processor 1110 is also configured to send a second response message to the master control device within a preset time period upon receiving a heartbeat detection message sent by the master control device.
[0219] This application embodiment detects the heartbeat of the managed device, thereby enabling real-time updates of the managed slave device's status. This eliminates the need for users to repeatedly check the device status themselves, improving management efficiency.
[0220] It should be understood that, in this embodiment, the input unit 1104 may include a graphics processing unit (GPU) 11041 and a microphone 11042. The GPU 11041 processes image data of still images or videos obtained by an image capture device (such as a camera) in video capture mode or image capture mode. The display unit 1106 may include a display panel 11061, which may be configured in the form of a liquid crystal display, an organic light-emitting diode, or the like. The user input unit 1107 includes at least one of a touch panel 11071 and other input devices 11072. The touch panel 11071 is also called a touch screen. The touch panel 11071 may include a touch detection device and a touch controller. Other input devices 11072 may include, but are not limited to, physical keyboards, function keys (such as volume control buttons, power buttons, etc.), trackballs, mice, and joysticks, which will not be described in detail here.
[0221] The memory 1109 can be used to store software programs and various data. The memory 1109 may primarily include a first storage area for storing programs or instructions and a second storage area for storing data. The first storage area may store the operating system, application programs or instructions required for at least one function (such as sound playback, image playback, etc.). Furthermore, the memory 1109 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus RAM (DRRAM). The memory 1109 in this embodiment includes, but is not limited to, these and any other suitable types of memory.
[0222] Processor 1110 may include one or more processing units; optionally, processor 1110 integrates an application processor and a modem processor, wherein the application processor mainly handles operations involving the operating system, user interface, and applications, and the modem processor mainly handles wireless communication signals, such as a baseband processor. It is understood that the aforementioned modem processor may also not be integrated into processor 1110.
[0223] This application also provides a readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the various processes of the above method embodiments and achieve the same technical effect. To avoid repetition, they will not be described again here.
[0224] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.
[0225] This application also provides a chip, which includes a processor and a communication interface. The communication interface and the processor are coupled. The processor is used to run programs or instructions to implement the various processes of the above method embodiments and achieve the same technical effect. To avoid repetition, it will not be described again here.
[0226] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.
[0227] This application provides a computer program product, which is stored in a storage medium and executed by at least one processor to implement the various processes of the above method embodiments and achieve the same technical effects. To avoid repetition, it will not be described again here.
[0228] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
[0229] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods of the various embodiments of this application.
[0230] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.
Claims
1. A method for managing network devices, executed by a main control device, characterized in that, The method includes: Within the first set of Internet Protocol addresses, detect slave devices connected to any Internet Protocol address within the first set of Internet Protocol addresses; If the first slave device is detected, add the device information of the first slave device to the managed device list; Upon receiving a device instruction for controlling the first slave device, and if the first slave device is online, the device instruction is sent to the first slave device; Based on the first response information corresponding to the device command, output the corresponding notification information. If the main control device does not receive the first response information within a preset time period, it generates a device error message. Before detecting slave devices connected to any Internet Protocol address within the first Internet Protocol address set, the method further includes: The second Internet Protocol address set is determined based on the Dynamic Host Configuration Protocol of the main control device; Based on the list of hosted devices, a third Internet Protocol address set is determined, wherein the Internet Protocol addresses in the third Internet Protocol address set are the Internet Protocol addresses of the detected slave devices, and the third Internet Protocol address set is a subset of the second Internet Protocol address set; The first Internet Protocol address set is determined based on the complement of the third Internet Protocol address set in the second Internet Protocol address set.
2. The management method according to claim 1, characterized in that, Also includes: Based on the list of hosted devices, a third set of Internet Protocol addresses is determined, wherein the Internet Protocol addresses in the third set of Internet Protocol addresses are the Internet Protocol addresses of the detected slave devices; Based on the Internet Control Message Protocol, device detection is performed on each Internet Protocol address in the third Internet Protocol address set. If the device detection result for any Internet Protocol address in the third Internet Protocol address set fails, the device information corresponding to any Internet Protocol address shall be deleted from the managed device list.
3. The management method according to claim 1, characterized in that, Before adding the device information of the first slave device to the managed device list, the method further includes: Send User Datagram Protocol (UDP) unicast information to the first slave device. The UDP unicast information includes at least one of the following: Internet Protocol (IP) address information of the master device, interface information corresponding to the master device, and identification information of the master device. The first device's device information is added to the managed device list, including: Upon receiving device information corresponding to the User Datagram Protocol unicast information, the device information is added to the managed device list.
4. The management method according to claim 1, characterized in that, Also includes: Send a heartbeat detection message to each slave device in the managed device list; If a second response message corresponding to the heartbeat detection message is received from the second slave device within a preset time period, the device status of the second slave device is set to online. If the second response information is not received within the preset time period, the device status of the second slave device will be set to offline.
5. The management method according to claim 1, characterized in that, Also includes: Upon receiving status information from a third slave device, the device information of the third slave device is updated in the managed device list based on the status information.
6. A method for managing a network device, executed by a slave device, characterized in that, The method includes: Upon receiving a device instruction from the master control device, the device function corresponding to the device instruction is executed; Send a first response message to the main control device, wherein the first response message is associated with the execution result of the device function; The method further includes: Upon receiving a heartbeat detection message from the main control device, a second response message is sent to the main control device within a preset time period.
7. The management method according to claim 6, characterized in that, Also includes: Upon receiving a User Datagram Protocol unicast message from the master control device, the slave device sends device information corresponding to the slave device to the master control device.
8. A management device for network equipment, applied to a main control device, characterized in that, The management device includes: The detection module is used to detect slave devices connected to any Internet Protocol address in the first Internet Protocol address set. The storage module is used to add the device information of the first slave device to the managed device list when the first slave device is detected. The sending module is configured to send the device instruction to the first slave device when it receives a device instruction for controlling the first slave device and the first slave device is online. The output module is used to output corresponding notification information based on the first response information corresponding to the device command. If the main control device does not receive the first response information within a preset time period, it generates a device error message. The determination module is used to determine the second Internet Protocol address set based on the Dynamic Host Configuration Protocol of the main control device; Based on the list of hosted devices, a third Internet Protocol address set is determined, wherein the Internet Protocol addresses in the third Internet Protocol address set are the Internet Protocol addresses of the detected slave devices, and the third Internet Protocol address set is a subset of the second Internet Protocol address set; The first Internet Protocol address set is determined based on the complement of the third Internet Protocol address set in the second Internet Protocol address set.
9. A management device for network devices, applied to slave devices, characterized in that, The management device includes: The execution module is used to execute the device function corresponding to the device instruction when it receives a device instruction sent by the master control device; The sending module is used to send first response information to the main control device, wherein the first response information is associated with the execution result of the device function; The sending module is also used to send a second response message to the main control device within a preset time period when it receives the heartbeat detection message sent by the main control device.
10. A first electronic device, characterized in that, It includes a processor and a memory, the memory storing a program or instructions that can run on the processor, the program or instructions being executed by the processor to implement the steps of the method as described in any one of claims 1 to 5.
11. A second electronic device, characterized in that, It includes a processor and a memory, the memory storing a program or instructions that can run on the processor, the program or instructions being executed by the processor to implement the steps of the method as described in claim 6 or 7.