Intelligent device remote management method and device
By using Android's native NsdManager and Web service modules within a local area network, automatic discovery and unified management of smart devices are achieved, solving the problems of complex device discovery and poor compatibility in existing technologies, and improving operation and maintenance efficiency and the real-time nature of device management.
Patent Information
- Application Number
- CN202610077987.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-21
- Publication Date
- 2026-05-29
AI Technical Summary
Existing technologies rely on public network connections to the cloud for local area network management of smart devices, which makes them unusable in scenarios without a public network or with an unstable network. Device discovery is complex and lacks automation, functions are scattered and have poor compatibility, resulting in high operation and maintenance costs and low efficiency.
Device discovery is achieved using the DNS-SD protocol based on Android's native NsdManager. Combined with the Web service module, it provides API interfaces and a visual page to enable automatic device registration and management. It supports multi-dimensional operations and data storage and transmits commands within the local area network, avoiding reliance on the public network.
It enables efficient device management in scenarios without public network or with limited network coverage, reduces operation and maintenance complexity and costs, improves the efficiency of device cluster management, adapts to different brand terminals, and meets real-time control requirements.
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent device operation and maintenance and local area network management technology, specifically providing a method and device for remote management of intelligent devices. Background Technology
[0002] In scenarios such as elevator screens, commercial advertising screens, and industrial control terminals, devices are typically deployed in clusters within a local area network (LAN). They need to implement functions such as device status monitoring, basic control (screen on / off, restart), application management, and log reporting. Existing technologies have the following problems: Reliance on public network and cloud: Most control solutions rely on public network connection to cloud server, which cannot be used in scenarios without public network or with unstable network, and there are risks to data transmission security. Device discovery is complex: It lacks a lightweight LAN device discovery mechanism, requires manual configuration of device IPs, and cannot automatically identify device clusters within the LAN; Dispersed management functions: Basic control, application management, log reporting and other functions are scattered across different tools, requiring on-site operation by maintenance personnel or remote control through multiple software programs, which is inefficient. Poor compatibility: The control interfaces of different brands of equipment are not uniform, making it difficult to achieve unified management across device clusters. In addition, there is a lack of visual control interface, resulting in a high operating threshold.
[0003] To address the aforementioned issues, there is an urgent need for a local area network (LAN) intelligent device management solution that does not require a public network, supports automatic device discovery, integrates functions, and has strong compatibility, in order to reduce operation and maintenance costs and improve management efficiency. Summary of the Invention
[0004] This invention addresses the shortcomings of the prior art by providing a highly practical method for remote control of intelligent devices.
[0005] A further technical objective of this invention is to provide a reasonably designed, safe, and applicable remote control device for intelligent equipment.
[0006] The technical solution adopted by this invention to solve its technical problem is: A method for remote control of intelligent devices firstly involves a core service module serving as the system entry point, responsible for initialization, starting scheduled tasks, and managing resource lifecycles. The local area network device discovery module is implemented based on Android's native NsdManager and uses the DNS-SD protocol to complete device discovery; The Web service module is built on the AndServer framework to create local Web services, with the default port 2618, and provides a dual management method of "API interface + visual page"; The equipment management module enables multi-dimensional equipment operation; The data storage module is responsible for data persistence and temporary storage.
[0007] Furthermore, the local area network device discovery module includes: (1) Service registration: When the device starts up, it registers its own services. The service type is "_android._tcp.", the service name format is "AndroidDevice - device model", and the port is fixed at 26888; (2) Device search: Start device scanning, filter its own services, parse the service information, add it to the device list through the OnDeviceFoundListener callback, and mark it as "online"; (3) Status maintenance: When the device is offline, the device status is updated to "offline" through the onServiceLost callback of NsdManager, and the device record is retained for subsequent rediscovery.
[0008] Furthermore, in the API interface and visualization page of the Web service module, The API interface follows the RESTful specification and covers five major categories of interfaces: device management, basic control, application management, log management, and program information. It sends commands to devices via IP address. The visualization page provides a web-based management interface that supports device list display, device information query, and command issuance.
[0009] Furthermore, the device management module includes: (1) The basic control unit calls the screenOn() / screenoff() method of the StandbyHelper class to control the screen through the system power management interface, send the ACTION_REBOOT broadcast or execute the “reboot” system command, execute the Shell command “rm -rf / sdcard / Android / data / com.inspur.ISMSB / ”, and clear the cache of the specified application; (2) The application management unit obtains information about the applications installed on the device through PackageManager, starts the application by “amstart package_name”, stops the application by “am force-stop package_name”, uninstalls the application by “pm uninstall package_name”, and starts the application without a specified Activity by Monkey command; Provides a file upload interface to upload the APK to the device's temporary directory, execute the "pm install -r" command to install it, and automatically delete the temporary files after installation;
[0010] (3) The log management unit compresses the log files in the / sdcard / inspur / log directory into zip_log.zip using ZipUtil and downloads them via the Web interface; When executing the Ping command, a timestamp is automatically added and stored in / sdcard / inspur / log / ping.log for network connectivity analysis; the device's SN, MAC, and IP information are periodically encrypted and reported to a designated server.
[0011] (4) The program information unit reads the “schedule_command.txt” file in the device, parses the list and status of the program to be played, and displays it through the Web interface to view the information of the currently playing program.
[0012] Furthermore, the data storage module includes: (1) Maintain a list of local area network devices in memory, including device IP, model, port, and status, and support adding, removing and updating operations; (2) Log files are stored by default in / sdcard / inspur / log, including application runtime logs and Ping logs; (3) Hardware parameters of the cache device: MAC address, SN number, Android version, and screen resolution.
[0013] Furthermore, the control process is as follows: S1, System initialization phase; S2, Equipment Discovery Phase; S3, Control and Interaction Phase; S4, Log reporting stage.
[0014] Furthermore, in step S1, CoreService is started, foreground notifications are created, the local area network device discovery module is initialized, its own service is registered, device search is started, the Web service is started on port 2618, the API interface and visualization page are initialized, the top Activity of the stack is checked at regular intervals, and log heartbeat reporting is performed at regular intervals. In step S2, the LAN device discovery module scans for devices with the service type "_android._tcp." within the LAN, resolves their IP address and model number, adds them to the device list, marks online devices as "online" and offline devices as "offline", and allows real-time viewing via a web page.
[0015] Furthermore, in step S3, the maintenance personnel access "http: / / deviceIP:2618" through a browser to enter the Web management page, select the target device to view hardware information and the list of installed applications or playing programs, and issue management commands. After receiving the commands, the Web service module calls the corresponding unit of the device management module to execute them. The execution result is returned to the Web page through the API interface, displaying the "success / failure" status and the reason. In step S4, the scheduled task triggers log heartbeat reporting, collects device SN, MAC, IP and current time information, and sends it to "https: / / msr.inspur.com / prod-api / api / device / log / heartbeat" after SM4 encryption; Receive the encrypted command returned by the server, decrypt it, call the device management module to execute it, and record the execution result in the log; Manually download log files via the web interface for troubleshooting.
[0016] A remote control device for intelligent devices includes: at least one memory and at least one processor; The at least one memory is used to store a machine-readable program; The at least one processor is used to call the machine-readable program to execute a method for remote control of intelligent devices.
[0017] Compared with the prior art, the intelligent device remote control method and apparatus of the present invention have the following outstanding advantages: All functions of this invention are implemented based on a local area network (LAN), making it suitable for scenarios without a public network or with limited network access (such as industrial workshops and closed campuses), avoiding the security risks and latency associated with public network transmission. Devices automatically register and search upon startup, eliminating the need for manual IP configuration. Maintenance personnel can quickly obtain a list of all devices within the LAN, improving cluster management efficiency.
[0018] It provides a one-stop solution for device monitoring, basic operation, application management, and log reporting, replacing multiple scattered tools and reducing operational complexity. Local area network command transmission latency is <1 second, web page loading time is <3 seconds, and device operation (such as screen activation and application launch) response time is <2 seconds, meeting real-time management requirements. Developed based on Android native APIs and general Shell commands, it is compatible with Android 7.0 and above, supports smart terminals from different brands, and eliminates the need for customized development for specific device models. Detailed Implementation
[0019] To enable those skilled in the art to better understand the present invention, the present invention will be further described in detail below with reference to specific embodiments. Obviously, the described embodiments are merely some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0020] The following is a preferred embodiment: Example
[0021] In this embodiment, a method for remotely managing smart devices is proposed. First, the core service module serves as the system entry point, responsible for initializing and starting scheduled tasks (device status detection, log heartbeat reporting), and managing resource lifecycles (such as service start / stop, thread creation / destruction). In Android O and above, foreground notifications (notification channel ID "andserver_channel") ensure that services are not reclaimed by the system.
[0022] The local area network device discovery module is implemented based on Android's native NsdManager (network service discovery) and uses the DNS-SD protocol to complete device discovery.
[0023] include: (1) Service registration: When the device starts up, it registers its own services. The service type is "_android._tcp.", the service name format is "AndroidDevice - device model" (such as "AndroidDevice-MIUI13"), and the port is fixed at 26888, so that other devices can recognize it; (2) Device search: Start device scanning, filter its own services, parse the service information (IP address, port, device model) of other devices, add them to the device list through the OnDeviceFoundListener callback, and mark them as "online"; (3) Status maintenance: When the device is offline, the device status is updated to "offline" through the onServiceLost callback of NsdManager, and the device record is retained for subsequent rediscovery.
[0024] The Web service module is built on the AndServer framework to create local Web services, with the default port 2618, and provides a dual management approach of "API interface + visual page".
[0025] include: API Interface: Following the RESTful specification, it covers five major categories of interfaces: device management, basic control, application management, log management, and program information, and supports sending commands via device IP. Visualized interface: Provides a web-based management interface that supports device list display (including online status markers), device information query (hardware parameters, application list), and command issuance (one-click screen on / off, application start / stop), without the need to install any additional client.
[0026] Access is only permitted within the local area network (LAN). Before issuing commands, the validity of the device's IP address is verified to prevent unauthorized cross-LAN manipulation.
[0027] The equipment management module enables multi-dimensional equipment operation; include: (1) The basic control unit calls the screenOn() / screenoff() method of the StandbyHelper class to control the screen through the system power management interface, send ACTION_REBOOT broadcast or execute the “reboot” system command (requires system privileges), which is suitable for device freezing scenarios; Execute the shell command "rm -rf / sdcard / Android / data / com.inspur.ISMSB / " to clear the cache of the specified application and resolve application lag issues;
[0028] (2) The application management unit obtains information about the applications installed on the device (package name, application name, version) through PackageManager, supports filtering system applications, starts the application with "am start package name", stops the application with "am force-stop package name", uninstalls the application with "pm uninstall package name", and supports starting applications without a specified Activity through Monkey command; It provides a file upload interface, supporting uploading APKs to the device's temporary directory and executing the "pm install -r" command to install them. After installation, the temporary files are automatically deleted.
[0029] (3) The log management unit compresses the log files in the / sdcard / inspur / log directory into zip_log.zip using ZipUtil, supports downloading via the Web interface, automatically adds a timestamp (format "yyyy-MM-dd HH:mm:ss") when executing the Ping command, and stores it in / sdcard / inspur / log / ping.log for network connectivity analysis; it also periodically encrypts (SM4 algorithm) the device SN, MAC, IP and other information and reports it to the designated server, and supports receiving remote management commands; (4) The program information unit reads the “schedule_command.txt” file (path / sdcard / inspur / program / ) in the device, parses the list and status of the program to be played, and displays it through the Web interface, supporting the viewing of the information of the currently playing program.
[0030] The data storage module is responsible for data persistence and temporary storage; include: (1) Device list storage: Maintain a list of local area network devices in memory, including device IP, model, port and status, and support adding, removing and updating operations; (2) Log storage: Log files are stored by default in / sdcard / inspur / log, including application running logs and Ping logs, and can be split by time; (3) Hardware information storage: cache device MAC address, SN number, Android version, screen resolution and other hardware parameters to avoid repeated acquisition.
[0031] The operation process consists of four main stages: initialization, device discovery, management and control interaction, and log reporting, as detailed below: S1. System Initialization Phase: Start CoreService, create foreground notifications (Android O and above), prevent services from being recycled, initialize the local area network device discovery module, register its own services, start device search, start the Web service (port 2618), initialize API interfaces and visualization pages, check the top Activity every 30 seconds (to ensure the control application is running in the foreground), and perform log heartbeat reporting every 60 seconds.
[0032] S2, Device Discovery Phase: The device discovery module scans devices with the service type "_android._tcp." on the local area network, resolves their IP and model, and adds them to the device list; online devices are marked "online" and offline devices are marked "offline", which can be viewed in real time via a web page.
[0033] S3, Control and Interaction Phase; Maintenance personnel can access the Web management page via a browser by visiting "http: / / deviceIP:2618", query the device list, select the target device, and view its hardware information, installed applications, or playback program list. They can then issue management commands (such as "screen on" or "restart application"). After receiving the commands, the Web service module calls the corresponding unit of the device management module to execute them. The execution results are returned to the Web page via the API interface, displaying the "success / failure" status and the reason.
[0034] S4, Log reporting phase; A scheduled task triggers a log heartbeat report, collecting information such as device SN, MAC, IP, and current time, and sending it to "https: / / msr.inspur.com / prod-api / api / device / log / heartbeat" after encryption via SM4. Receive encrypted instructions (such as "clearCache" and "deviceRestart") returned by the server, decrypt them, call the device management module to execute them, and record the execution results in the log; It supports manually downloading log files via a web interface for troubleshooting. Example
[0035] Taking elevator screen cluster management as an example, an office building has 50 elevator screens (all connected to the same local area network) that need to be remotely managed: Maintenance personnel can access the web address of any elevator screen (http: / / 192.168.1.100:2618) via PC to view the online status, Android version, and currently playing program of 50 elevator screens on the web page. They can issue "restart device" commands to offline devices and "clear cache" commands to devices experiencing lag. They can also batch view the installed applications of all elevator screens, remotely install the "elevator monitoring application" on devices that do not have it installed via the APK upload interface, download the Ping logs of the specified elevator screens, analyze their network connectivity with the server, and troubleshoot data reporting failures.
[0036] System Deployment: 1) Install this system application on each elevator screen and grant it "Backend Service", "Storage", and "Network" permissions; 2) After the application starts, it automatically registers local area network services, starts the web service (port 2618), and schedules tasks. Device discovery and monitoring: 1) Maintenance personnel open a browser on a PC, enter the IP address (e.g., 192.168.1.100) and port 2618 of any elevator screen, and access the Web management page; 2) Click "Device List" to view the IP address, model, and online status of 50 elevator screens; offline devices are marked in red. Device discovery and monitoring: 1) Select the offline device (IP: 192.168.1.105), click "Restart Device", wait 30 seconds after the command is issued, and the device will come back online; 2) Select the lagging device (IP: 192.168.1.110), click "Clear Cache", and check the application's running status after the process is complete; 3) Select the device that does not have the "Elevator Monitoring Application" installed, upload the application installation package using the "APK Upload" function, click "Install", and the application will start automatically after installation; Logs and troubleshooting: 1) For devices that fail to report data, download their Ping logs (path / sdcard / inspur / log / ping.log) and analyze network connectivity; 2) Check the device heartbeat reporting log to confirm whether there are any abnormalities in receiving server commands, and adjust the encryption or transmission parameters accordingly. Example
[0037] A remote control device for intelligent devices includes: at least one memory and at least one processor; The at least one memory is used to store a machine-readable program; The at least one processor is used to call the machine-readable program to execute a method for remote control of intelligent devices.
[0038] The processor can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), off-the-shelf programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The processor can be a microprocessor or any conventional processor.
[0039] Memory is used to store computer programs and / or modules. The processor implements various functions of the electronic device by running or executing the computer programs and / or modules stored in the memory, and by accessing data stored in the memory. Memory can mainly include a program storage area and a data storage area. The program storage area can store the operating system, at least one application program required for a function, etc.; the data storage area can store data created based on the use of the terminal, etc. In addition, memory can also include high-speed random access memory, and can also include non-volatile memory, such as hard disks, RAM, plug-in hard disks, smart memory cards (SMC), secure digital cards (SD cards), flash memory cards, at least one disk storage device, flash memory devices, or other volatile solid-state storage devices.
[0040] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for remote control of intelligent devices, characterized in that, Firstly, the core service module serves as the system entry point, responsible for initializing and starting scheduled tasks, and managing resource lifecycles; The local area network device discovery module is implemented based on Android's native NsdManager and uses the DNS-SD protocol to complete device discovery; The Web service module is built on the AndServer framework to create local Web services, with the default port 2618, and provides a dual management approach of "API interface + visual page"; The equipment management module enables multi-dimensional equipment operation; The data storage module is responsible for data persistence and temporary storage.
2. The method for remote control of intelligent devices according to claim 1, characterized in that, The local area network device discovery module includes: (1) Service registration: When the device starts up, it registers its own services. The service type is "_android._tcp.", the service name format is "AndroidDevice - device model", and the port is fixed at 26888; (2) Device search: Start device scanning, filter its own services, parse the service information, add it to the device list through the OnDeviceFoundListener callback, and mark it as "online"; (3) Status maintenance: When the device is offline, the device status is updated to "offline" through the onServiceLost callback of NsdManager, and the device record is retained for subsequent rediscovery.
3. The method for remote control of intelligent devices according to claim 2, characterized in that, In the web service module, in the API interface and the visualization page, The API interface follows the RESTful specification and covers five major categories of interfaces: device management, basic control, application management, log management, and program information. It sends commands to devices via IP address. The visualization page provides a web-based management interface that supports device list display, device information query, and command issuance.
4. The method for remote control of intelligent devices according to claim 3, characterized in that, The device management module includes: (1) The basic control unit calls the screenOn() / screenoff() method of the StandbyHelper class to control the screen through the system power management interface, send the ACTION_REBOOT broadcast or execute the "reboot" system command, and execute the Shell command "rm -rf / sdcard / Android / data / com.inspur.ISMSB / " to clear the cache of the specified application; (2) The application management unit obtains information about the applications installed on the device through PackageManager, starts the application with "am start package_name", stops the application with "am force-stop package_name", uninstalls the application with "pm uninstall package_name", and starts the application without a specified Activity through Monkey command; Provides a file upload interface to upload the APK to the device's temporary directory, execute the "pm install -r" command to install it, and automatically delete the temporary files after installation; (3) The log management unit compresses the log files in the / sdcard / inspur / log directory into zip_log.zip using ZipUtil and downloads them via the Web interface; When executing the Ping command, a timestamp is automatically added and stored in / sdcard / inspur / log / ping.log for network connectivity analysis; the device's SN, MAC, and IP information are periodically encrypted and reported to a designated server. (4) The program information unit reads the "schedule_command.txt" file in the device, parses the list and status of the program to be played, and displays it through the Web interface to view the information of the currently playing program.
5. The method for remote control of intelligent devices according to claim 4, characterized in that, The data storage module includes: (1) Maintain a list of local area network devices in memory, including device IP, model, port, and status, and support adding, removing and updating operations; (2) Log files are stored by default in / sdcard / inspur / log, including application runtime logs and Ping logs; (3) Hardware parameters of the cache device: MAC address, SN number, Android version, and screen resolution.
6. The method for remote control of intelligent devices according to claim 5, characterized in that, The control process is as follows: S1, System initialization phase; S2, Equipment Discovery Phase; S3, Control and Interaction Phase; S4, Log reporting stage.
7. The method for remote control of intelligent devices according to claim 6, characterized in that, In step S1, CoreService is started, foreground notifications are created, the local area network device discovery module is initialized, its own service is registered, device search is started, the Web service is started on port 2618, the API interface and visualization page are initialized, the top Activity of the stack is checked at regular intervals, and log heartbeat reporting is performed at regular intervals. In step S2, the LAN device discovery module scans for devices with the service type "_android._tcp." within the LAN, resolves their IP address and model number, adds them to the device list, marks online devices as "online" and offline devices as "offline", and allows real-time viewing via a web page.
8. The method for remote control of intelligent devices according to claim 7, characterized in that, In step S3, the maintenance personnel access "http: / / deviceIP:2618" through a browser to enter the Web management page, select the target device to view hardware information and the list of installed applications or playback programs, and issue management commands. After receiving the commands, the Web service module calls the corresponding unit of the device management module to execute them. The execution result is returned to the Web page through the API interface, displaying the "success / failure" status and the reason. In step S4, the scheduled task triggers log heartbeat reporting, collects device SN, MAC, IP and current time information, and sends it to "https: / / msr.inspur.com / prod-api / api / device / log / heartbeat" after SM4 encryption; Receive the encrypted command returned by the server, decrypt it, call the device management module to execute it, and record the execution result in the log; Manually download log files via the web interface for troubleshooting.
9. A remote control device for intelligent equipment, characterized in that, include: At least one memory and at least one processor; The at least one memory is used to store a machine-readable program; The at least one processor is configured to invoke the machine-readable program to perform the method according to any one of claims 1 to 8.
