CN113992647B - Terminal control method of self-adaptive network based on CGI - Google Patents

Terminal control method of self-adaptive network based on CGI Download PDF

Info

Publication number
CN113992647B
CN113992647B CN202111222585.8A CN202111222585A CN113992647B CN 113992647 B CN113992647 B CN 113992647B CN 202111222585 A CN202111222585 A CN 202111222585A CN 113992647 B CN113992647 B CN 113992647B
Authority
CN
China
Prior art keywords
terminal
cgi
network
instruction data
end page
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202111222585.8A
Other languages
Chinese (zh)
Other versions
CN113992647A (en
Inventor
赵洋
杨丽波
车文哲
冯浚峰
龚军号
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sichuan Jiuzhou Electronic Technology Co Ltd
Original Assignee
Sichuan Jiuzhou Electronic Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sichuan Jiuzhou Electronic Technology Co Ltd filed Critical Sichuan Jiuzhou Electronic Technology Co Ltd
Priority to CN202111222585.8A priority Critical patent/CN113992647B/en
Publication of CN113992647A publication Critical patent/CN113992647A/en
Application granted granted Critical
Publication of CN113992647B publication Critical patent/CN113992647B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • H04L67/025Protocols based on web technology, e.g. hypertext transfer protocol [HTTP] for remote control or remote monitoring of applications
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/2801Broadband local area networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/10Active monitoring, e.g. heartbeat, ping or trace-route
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/26Special purpose or proprietary protocols or architectures

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Health & Medical Sciences (AREA)
  • Cardiology (AREA)
  • General Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • Telephonic Communication Services (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention discloses a terminal control method of a self-adaptive network based on CGI, which comprises the following steps: starting a network detection process after a front-end page is started, when the network state is marked as a local area network, the front-end page directly calls a terminal CGI interface through a terminal equipment local area network address to complete control, when the network state is marked as the Internet, the front-end page directly uploads terminal CGI interface instruction data to an MQTT server, forwards the terminal CGI interface instruction data, and a terminal plug-in receives the terminal CGI interface instruction data through subscribing a specified theme, transmits the terminal CGI interface instruction data to a terminal CGI module to process corresponding instruction data and acquire an execution result; the terminal plug-in unit returns the unique code of the control instruction and the execution result of the instruction to the MQTT server, and the MQTT server forwards the result to the front-end page, so that the terminal remote control under the Internet state is completed; the invention improves the control efficiency of the terminal.

Description

Terminal control method of self-adaptive network based on CGI
Technical Field
The invention relates to the technical field of Internet, in particular to a terminal control method of a self-adaptive network based on CGI.
Background
MQTT (Message Queuing Telemetry Transport, message queue telemetry transport) is a lightweight instant messaging protocol developed by IBM corporation. The MQTT adopts a publish/subscribe mode rather than a traditional request/response mode, and this lighter-weight mode makes the MQTT more suitable for low-power and network bandwidth-limited internet of things devices. As an instant messaging protocol with low cost and low bandwidth occupation, the method has wider application in the aspects of Internet of things, small-sized equipment, mobile application and the like.
CGI: the universal gateway interface (Common Gateway Interface) is a standard interface for Web server hosts to provide information services. Through the CGI interface, the Web server can acquire information submitted by the client, transfer the information to a CGI program of the server for processing, and finally return a result to the client.
Along with the development of information technology in recent years, the influence of intelligent control on the life style of people is larger and larger, intelligent terminal equipment is in the face of new development opportunities, and meanwhile, new challenges are faced, and how to realize flexible control of terminal equipment in different network environments, adapt to various network environments and improve control efficiency is one of the focuses of attention.
Most of the existing terminal remote control methods need to redefine a new control interface according to the requirement of an access platform, the original CGI interface of the terminal cannot be directly reused, and a large amount of development work is needed according to a platform interface protocol when the terminal is accessed;
the existing control method only carries out remote control through the Internet singly, can not control when equipment is not connected with the Internet (assembly and maintenance or network abnormality), simultaneously carries out remote control through the Internet singly, has the problems of delay, poor stability and the like when the network is poor, and besides, also faces the problem of high concurrency processing when a platform is connected with mass equipment.
Disclosure of Invention
In order to solve the problems in the prior art, the invention aims to provide a terminal control method of a self-adaptive network based on CGI, and the invention improves the control efficiency of a terminal.
In order to achieve the above purpose, the invention adopts the following technical scheme: the terminal control method of the self-adaptive network based on the CGI comprises a front-end page, an MQTT server, a terminal plug-in and a terminal CGI interface, and the terminal control method comprises the following steps:
starting a network detection process in the background after the front-end page is started, automatically attempting to connect the terminal equipment through the local area network, if the connection is possible, keeping heartbeat detection with the terminal equipment, marking the network state as the local area network, and immediately marking the network state as the Internet once the heartbeat detection is not passed;
when the network state is marked as a local area network, the front-end page directly calls a terminal CGI interface of the terminal equipment through a terminal equipment local area network address to complete the control of the terminal equipment, when the network state is marked as the Internet, the front-end page directly uploads terminal CGI interface instruction data to the MQTT server, the MQTT server forwards the terminal CGI interface instruction data through a specified theme, and the terminal plug-in receives the terminal CGI interface instruction data through subscribing the specified theme and transmits the terminal CGI interface instruction data to a terminal CGI module to process corresponding instruction data and acquire an execution result;
and then the terminal plug-in unit returns the unique control instruction code and the instruction execution result to the MQTT server, and the MQTT server identifies the returned result according to the unique control instruction code and forwards the result to the front-end page, so that the terminal remote control under the Internet state is completed.
The beneficial effects of the invention are as follows:
the invention performs scheduling based on the original CGI interface of the terminal to control the terminal, and solves the problems of development workload increase and low access efficiency caused by the fact that the original CGI interface of the terminal cannot be reused and the terminal is required to perform interface development to meet the access requirement of a platform. Meanwhile, the invention can control the terminal under both the Internet environment and the local area network environment, automatically detects, identifies and preferentially selects the network self-adaptive mode of the local area network, directly calls the terminal CGI through the local area network to control the equipment, and solves the problem that the equipment cannot be controlled when the equipment is not connected with the Internet (the installation and maintenance or the network is abnormal); the self-adaptive mechanism of network automatic detection and identification is used for preferentially selecting the local area network for equipment control, so that the problems of delay, poor stability and the like when the network is poor are solved by singly performing remote control through the Internet, and meanwhile, the control signals are not forwarded through the central server in a centralized way, so that the concurrent processing problem when the platform is accessed to mass equipment is solved.
Drawings
FIG. 1 is a flow chart of an embodiment of the present invention.
Detailed Description
Embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
Examples
As shown in FIG. 1, the terminal control method of the self-adaptive network based on the CGI mainly depends on the combination of a front-end page, an MQTT server, a terminal plug-in unit and a terminal CGI interface. The front-end page starts a network detection process in the background after being started, automatically tries to connect the equipment through the local area network, keeps heartbeat detection with the equipment if the equipment can be connected, marks the network state as the local area network, and immediately marks the network state as the Internet once the heartbeat detection is not passed. When the network state is marked as a local area network, the front-end page directly calls a CGI (common gateway interface) of the equipment through the address of the local area network of the equipment to complete the control of the equipment, when the network state is marked as the Internet, the page directly uploads the CGI instruction data to the MQTT server, the MQTT server forwards the CGI instruction data through a specified theme, and the terminal plug-in receives the interface instruction data through subscribing the specified theme and transmits the interface instruction data to the terminal CGI module to process the corresponding instruction data and acquire an execution result. And then the terminal plug-in unit returns the unique control instruction code and the instruction execution result to the MQTT server, and the MQTT server identifies the returned result according to the unique control instruction code and forwards the result to the front-end page, so that the terminal remote control under the Internet state is completed.
Wherein, the control instruction protocol is defined as follows:
the control instruction execution result return protocol is defined as follows:
the foregoing examples merely illustrate specific embodiments of the invention, which are described in greater detail and are not to be construed as limiting the scope of the invention. It should be noted that it will be apparent to those skilled in the art that several variations and modifications can be made without departing from the spirit of the invention, which are all within the scope of the invention.

Claims (1)

1. The terminal control method of the self-adaptive network based on the CGI is characterized by comprising a front-end page, an MQTT server, a terminal plug-in and a terminal CGI interface, and the terminal control method comprises the following steps:
starting a network detection process in the background after the front-end page is started, automatically attempting to connect the terminal equipment through the local area network, if the connection is possible, keeping heartbeat detection with the terminal equipment, marking the network state as the local area network, and immediately marking the network state as the Internet once the heartbeat detection is not passed;
when the network state is marked as a local area network, the front-end page directly calls a terminal CGI interface of the terminal equipment through a terminal equipment local area network address to complete the control of the terminal equipment, when the network state is marked as the Internet, the front-end page directly uploads terminal CGI interface instruction data to the MQTT server, the MQTT server forwards the terminal CGI interface instruction data through a specified theme, and the terminal plug-in receives the terminal CGI interface instruction data through subscribing the specified theme and transmits the terminal CGI interface instruction data to a terminal CGI module to process corresponding instruction data and acquire an execution result;
and then the terminal plug-in unit returns the unique control instruction code and the instruction execution result to the MQTT server, and the MQTT server identifies the returned result according to the unique control instruction code and forwards the result to the front-end page, so that the terminal remote control under the Internet state is completed.
CN202111222585.8A 2021-10-20 2021-10-20 Terminal control method of self-adaptive network based on CGI Active CN113992647B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111222585.8A CN113992647B (en) 2021-10-20 2021-10-20 Terminal control method of self-adaptive network based on CGI

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111222585.8A CN113992647B (en) 2021-10-20 2021-10-20 Terminal control method of self-adaptive network based on CGI

Publications (2)

Publication Number Publication Date
CN113992647A CN113992647A (en) 2022-01-28
CN113992647B true CN113992647B (en) 2023-10-24

Family

ID=79739683

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111222585.8A Active CN113992647B (en) 2021-10-20 2021-10-20 Terminal control method of self-adaptive network based on CGI

Country Status (1)

Country Link
CN (1) CN113992647B (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1462890A1 (en) * 2003-03-28 2004-09-29 Kabushiki Kaisha Toyota Jidoshokki Inspection data communications system and inspection data communicating method for loom
EP1462892A1 (en) * 2003-03-28 2004-09-29 Kabushiki Kaisha Toyota Jidoshokki Inspection data communications system and inspection data communicating method
CN103019197A (en) * 2012-12-03 2013-04-03 海信集团有限公司 Method and system for conducting long-range control on intelligent terminal device
CN103297310A (en) * 2013-06-20 2013-09-11 哈尔滨工业大学 ARM-based (Acorn RISC (reduced instruction set computer) Machine-based) intelligent home monitoring system and method
CN103901842A (en) * 2014-03-07 2014-07-02 华南理工大学 Weeding robot control system based on wireless local area network and method
CN104168250A (en) * 2013-05-15 2014-11-26 腾讯科技(深圳)有限公司 CGI frame-based service flow control method and apparatus
CN104270662A (en) * 2014-10-27 2015-01-07 冠捷显示科技(厦门)有限公司 System of terminal equipment for controlling intelligent television through browser
CN106789468A (en) * 2016-12-22 2017-05-31 Tcl集团股份有限公司 A kind of appliances equipment control method and system based on intelligent terminal
CN109088723A (en) * 2018-10-26 2018-12-25 四川长虹电器股份有限公司 A kind of long-range control method based on MQTT agreement
CN111338255A (en) * 2020-03-11 2020-06-26 芜湖职业技术学院 Control system of intelligent atomizer

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1462890A1 (en) * 2003-03-28 2004-09-29 Kabushiki Kaisha Toyota Jidoshokki Inspection data communications system and inspection data communicating method for loom
EP1462892A1 (en) * 2003-03-28 2004-09-29 Kabushiki Kaisha Toyota Jidoshokki Inspection data communications system and inspection data communicating method
CN103019197A (en) * 2012-12-03 2013-04-03 海信集团有限公司 Method and system for conducting long-range control on intelligent terminal device
CN104168250A (en) * 2013-05-15 2014-11-26 腾讯科技(深圳)有限公司 CGI frame-based service flow control method and apparatus
CN103297310A (en) * 2013-06-20 2013-09-11 哈尔滨工业大学 ARM-based (Acorn RISC (reduced instruction set computer) Machine-based) intelligent home monitoring system and method
CN103901842A (en) * 2014-03-07 2014-07-02 华南理工大学 Weeding robot control system based on wireless local area network and method
CN104270662A (en) * 2014-10-27 2015-01-07 冠捷显示科技(厦门)有限公司 System of terminal equipment for controlling intelligent television through browser
CN106789468A (en) * 2016-12-22 2017-05-31 Tcl集团股份有限公司 A kind of appliances equipment control method and system based on intelligent terminal
CN109088723A (en) * 2018-10-26 2018-12-25 四川长虹电器股份有限公司 A kind of long-range control method based on MQTT agreement
CN111338255A (en) * 2020-03-11 2020-06-26 芜湖职业技术学院 Control system of intelligent atomizer

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
Yang Tiejun ; Li Xudong.Design and implementation of embedded terminal for Grain Monitoring and Control System.《2010 International Conference On Computer Design and Applications》.2010,576-579. *
基于CGI接口实现嵌入式系统远程控制;姚洪智、郑雪峰、曹磊;《微机发展》;7-13 *
基于物联网的智能温室控制系统的研究与设计;余风军;《基于物联网的智能温室控制系统的研究与设计》;全文 *

Also Published As

Publication number Publication date
CN113992647A (en) 2022-01-28

Similar Documents

Publication Publication Date Title
US7287057B2 (en) Accessing information using an instant messaging system
CN102833323A (en) Method and system for remote control of controlled terminal by server
US20140323166A1 (en) Method, device and system for voice communication
KR20040023633A (en) Keeping persistency while switching between modalities
CN107682460B (en) Distributed storage cluster data communication method and system
WO2021016755A1 (en) Data transmission method and apparatus
WO2020199472A1 (en) Recognition model optimization method and device
CN111490947A (en) Data packet transmitting method, data packet receiving method, system, device and medium
CN113992647B (en) Terminal control method of self-adaptive network based on CGI
CN114866528A (en) Data communication method based on MQTT and Websocket
US20060150245A1 (en) System and method of automatically transforming instant message transmission modes on internet
CN109756503B (en) Communication protocol design method of fire-fighting robot
CN106357454A (en) Log system control device and method
CN114063542B (en) Terminal remote control method
CN101383777B (en) Apparatus and method for connecting Bluetooth equipment and flash equipment
CN111724262B (en) Subsequent package query system of application server and working method thereof
CN111897496B (en) Method for improving network IO read-write performance in distributed system
CN113094165A (en) Method for increasing speed of loading application program at cloud end
JPH10327212A (en) Network connection control system and storage medium
CN100547969C (en) The method and data handling system and the resource management system that are used for instantaneous message communicating
CN108174458B (en) Method and device for wireless connection between mobile terminal and wearable device, mobile terminal and wearable device
CN111190746A (en) VxWorks 653-based multi-core partition real-time operating system and communication method
CN102571620B (en) Method and device for carrying out webpage communication, and webpage server
CN112180883A (en) Industrial equipment management method and Internet of things management platform
CN111131746A (en) Terminal service control method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant