CN112468502B - Websocket protocol-based embedded equipment remote experiment method - Google Patents

Websocket protocol-based embedded equipment remote experiment method Download PDF

Info

Publication number
CN112468502B
CN112468502B CN202011363836.XA CN202011363836A CN112468502B CN 112468502 B CN112468502 B CN 112468502B CN 202011363836 A CN202011363836 A CN 202011363836A CN 112468502 B CN112468502 B CN 112468502B
Authority
CN
China
Prior art keywords
websocket
command
user
server
message
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
CN202011363836.XA
Other languages
Chinese (zh)
Other versions
CN112468502A (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.)
Hangzhou Dreamvision Network Technology Co ltd
Original Assignee
Hangzhou Dreamvision Network 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 Hangzhou Dreamvision Network Technology Co ltd filed Critical Hangzhou Dreamvision Network Technology Co ltd
Priority to CN202011363836.XA priority Critical patent/CN112468502B/en
Publication of CN112468502A publication Critical patent/CN112468502A/en
Application granted granted Critical
Publication of CN112468502B publication Critical patent/CN112468502B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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]
    • 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/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/141Setup of application sessions
    • 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/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/161Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields
    • H04L69/162Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields involving adaptations of sockets based mechanisms

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Information Transfer Between Computers (AREA)
  • Computer And Data Communications (AREA)

Abstract

A remote experimental method of embedded equipment based on a Websocket protocol comprises the following steps: 1) firstly, building a Websocket server and a Web server; 2) running an embedded device code to establish connection with the Websocket server to wait for binding of a user; 3) a user logs in to establish communication with a Websocket server and then binds online equipment; 4) the embedded equipment waits for a user to send a command and analyzes the command; 5) executing a downloading command to download the file; 6) a user sends an operation command to the embedded equipment to execute the operation command and starts to run the embedded experiment code; 7) the equipment acquires feedback information generated after the embedded equipment executes the user command and feeds back the data to the browser. The invention can realize the two-way communication between the browser and the Websocket server, solves the defects caused by one-time access and one-time response communication in the traditional B/S communication mode, has less control overhead, and has smaller data packet head part for protocol control when data is exchanged between the client and the server after connection is established.

Description

Websocket protocol-based embedded device remote experiment method
Technical Field
The invention relates to the field of Internet and communication, in particular to a Websocket protocol and an HTTP protocol. In particular to an embedded device remote experimental method based on a Websocket protocol.
Background
With the development of the times, the internet becomes a convenient communication mode, and remote data interaction can be carried out through the network. Embedded devices are also increasingly popular in the lives of the public, and access to a network is achieved through a Websocket protocol and an HTTP protocol, so that the embedded devices are remotely controlled, and embedded experiments are further remotely performed.
WebSocket is the full duplex communication standard between a Web browser and a Web server, wherein the WebSocket protocol is defined by the IETF positioning standard, and the WebSocketAPI is defined by the W3C positioning standard. Once the communication connection of the WebSocket protocol is established between the Web server and the client, all communication is carried out by means of the special protocol. And in the communication process, data in any format such as JSON, XML, HTML or pictures and the like are mutually transmitted. Because the protocol is established on the basis of the HTTP, the connection is still initiated at the client, and once the WebSocket communication connection is established, any party can directly send a message to the other party regardless of the server or the client.
HTTP is known as Hyper Text Transfer Protocol, is translated into hypertext Transfer Protocol, and is the most widely used network Protocol on the internet. The HTTP protocol is the basis for data exchange over the Web and is a "client-server" protocol. That is, the request is typically initiated by a recipient, such as a browser. A complete Web document is usually composed of different sub-documents, such as text, layout descriptions, pictures, video, scripts, etc. HTTP was originally designed to provide a method of publishing and receiving HTML pages.
Disclosure of Invention
In order to solve the problems that field laboratory workers in a campus are too intensive in an epidemic situation period and embedded equipment is expensive and difficult to purchase by students, the invention provides a Websocket protocol-based embedded equipment remote experiment method, which is used for remotely operating the embedded equipment to perform embedded experiments.
The invention mainly relates to the connection of embedded equipment to a network, so that the embedded equipment can be connected with a Websocket server, and the connection between the embedded equipment and a Web server can be established. The invention does not relate to the building process of the Websocket server and the Web server and the design of the front-end interface of the webpage. However, for the purpose of illustrating the complete flow of the present invention, the Websocket server and the Web server and the front-end interface function will be mentioned slightly but not expanded as an emphasis.
A remote experimental method of embedded equipment based on a Websocket protocol comprises the following steps:
1) firstly, a Websocket server and a Web server are built, and the method specifically comprises the following steps:
the Websocket server is used as a bridge for communication between the browser user and the embedded device, so that the user can establish connection with the embedded device through the Websocket server. The Web server is used for storing user registration information, equipment registration information and experimental code files uploaded by the browser, and providing a downloading interface to enable the embedded equipment to obtain the experimental code files on the browser.
2) The method comprises the following steps of running embedded device codes and further establishing connection with a Websocket server to wait for binding of a user, wherein the steps specifically comprise:
the device is characterized in that two local process codes are respectively a Websocket process and a Dev process, and the Websocket process is used for establishing communication with a Websocket server, so that the device can be connected with the Websocket server and bound by a user. The Dev process is used for analyzing and processing the Websocket message content, and the two processes adopt a message queue mode to realize inter-process communication. The embedded device realizes the receiving, sending and analyzing processing of the Websocket message by using two processes, can reduce the difficulty of realizing and debugging the code, and can quickly and efficiently modify the code by modularization and division of labor.
The main function of the inter-process communication is to forward PayloadData (data load) of a user message received by the Websocket process from the Websocket server to the Dev process, and the Dev process is responsible for initiating a device login message and analyzing a message body, and executing a corresponding command after analyzing a specific command. The device logs in to the Websocket server by running the two processes. The embedded device end sends heartbeat messages ping to the Websocket server at regular time, and the Websocket server returns pong messages to inform the device end of normal connection after receiving the messages, so that the embedded device end and the Websocket server can know whether the connection between the embedded device end and the Websocket server is interrupted or not in time. The heartbeat messages are sent regularly, so that the equipment can be kept in an online state, and at the moment, a user can bind the online equipment through the Websocket server.
3) The method comprises the following steps that a user logs in to establish communication with a Websocket server, and then binds online equipment, and specifically comprises the following steps:
and the user performs login operation through the browser, and sends a login message to the Web server to verify whether the user exists, if so, the login is successful, and otherwise, the login fails. And then, the Web server realizes the operation of binding the user and the embedded equipment, and the binding information is stored in a database. And then the Websocket server realizes the one-to-one forwarding function of the message between the user and the embedded device bound by the user through the binding information in the database.
4) The embedded device waits for a user to send a command and analyzes the command, and the method specifically comprises the following steps:
the method comprises the steps that a user sends a command through a browser, the command is forwarded to an embedded device bound by the user through a Websocket server, the device receives the message through a Websocket process, the content of the message is forwarded to a Dev process for analysis processing, the Dev process obtains the type of the executed command through judging PayloadData content in an Xml format, the type of the command comprises a downloading command and an operating command, the operating command is a command commonly used by a Linux system, and the downloading command is the Websocket server.
5) Executing a download command to download a file, specifically comprising:
the download command is first executed to download the code of the embedded experiment to be executed onto the embedded device. A user sends a downloading command in a browser in a button clicking mode, and adds the file name of the uploaded experiment related file as content into PayloadData of the Websocket message in an Xml format. The embedded device end Websocket process receives the message forwarded by the Websocket server and writes the message content in the Xml format into the message queue, the Dev process obtains PayloadData in the Xml format by reading the message queue and analyzes the message, the PayloadData is known as a downloading command through the name of the root node of the Xml, the name of an experimental file to be downloaded is obtained through the child nodes under the root node, then a homonymous file is created locally, a file downloading interface provided by the Web server is accessed through a GET method provided by a libcurl library, and the data fed back by the Web server is stored in the homonymous file locally of the embedded device to realize the function of file downloading.
6) The method for sending the operation command by the user to the embedded equipment to execute the operation command and start to run the embedded experiment code specifically comprises the following steps:
the method comprises the steps that a user writes an operation command to be sent in through a sending frame of a browser, the browser packages the content of the sending frame into an Xml format and sends the Xml format to a Websocket server, an embedded device end Websocket process receives a message forwarded by the Websocket server and transmits the PayloadData content of the message into a message queue, a Dev process analyzes the PayloadData in the Xml format, after the analyzed root node name is known as the operation command, a specific command to be executed is obtained through analyzing a child node name, and then the command operation is achieved through a system/pop function.
7) The method for acquiring feedback information generated after the embedded device executes the user command and feeding data back to the browser includes:
the method comprises the steps that a Dev process acquires feedback data of operation executed by the embedded device after executing an operation command sent by a user, then the acquired data are sent to a message queue in a message queue mode, a Websocket process acquires data to be sent in the message queue, the data are packaged into data in accordance with a frame format of a Websocket protocol through the Websocket protocol and sent to a Websocket server, the Websocket server forwards a message to a browser, and the user can immediately acquire the feedback data of the embedded device.
The purpose of embedded equipment remote experiment based on the Websocket protocol is achieved through the 7 steps.
The invention has the advantages that the first point uses the Websocket protocol to carry out communication, thereby realizing bidirectional communication between the browser and the Websocket server; secondly, the defect caused by one-time access and one-time response communication in the traditional B/S communication mode is overcome, such as the problem of poor real-time performance; and thirdly, the control overhead is less, and the header of a data packet for protocol control is smaller when data is exchanged between the client and the server after the connection is established.
Drawings
FIG. 1 is an overall block diagram of the process of the present invention.
Fig. 2 is a Websocket communication establishment and data interaction flow diagram of the method of the present invention.
Fig. 3 is an overall flowchart of the Websocket process of the method of the present invention.
Fig. 4 is an overall flowchart of a Dev process of an embedded device remote experiment method provided by the present invention.
Fig. 5 is a flowchart of the Dev process parsing the message body sent by the Websocket process in the method of the present invention.
FIG. 6 is a flow chart of a method of the present invention for executing a download command to download a file from a Web server.
Fig. 7 is a flowchart of the method of the present invention for executing operation commands and transferring embedded device feedback data to the Websocket server.
FIG. 8 is a diagram of the interprocess communication relationship of the method of the present invention.
Fig. 9 is a flow chart of the overall operation of the method of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings.
Referring to fig. 1, it can be seen that an overall framework diagram of the remote experimental method for embedded devices based on the Websocket protocol provided by the present invention includes 5 parts, which are respectively a browser, a Web server, a Websocket server, a database, and an embedded device. The browser mainly has the functions of interacting with a user, and comprises the steps of inputting and sending user commands, displaying feedback data of the embedded equipment, uploading files and the like. The Web server is mainly used for storing information of the user and the equipment and binding information of the user and the embedded equipment, storing the experiment files uploaded by the user and providing a file downloading interface for the embedded equipment. The Websocket server acquires the binding information of the user and the embedded equipment by inquiring the database, and forwards the message sent by the browser to the corresponding embedded equipment. The embedded device receives the message forwarded by the Websocket server, analyzes and obtains the command sent by the browser, executes corresponding operation (including operation command and download command), and forwards the feedback data of the embedded device to the browser for display through the Websocket server.
The invention mainly completes the access of the embedded device to the network, so that the embedded device can be discovered and bound by the user, and the embedded device conforms to the overall framework. The embedded device end is specifically realized through two processes, the Websocket process is used for receiving and sending Websocket messages and forwarding the Websocket messages, the Dev process is used for analyzing the Websocket messages and executing corresponding operations, and data generated after the embedded device executes user commands can be acquired and placed into a message queue to wait for the Websocket process to send the messages to the Websocket server. The invention separates the receiving and sending functions and the analyzing and processing functions of the Websocket message of the embedded device by the idea of module separation, so that the program structure is clear and convenient to maintain and realize.
Referring to fig. 2, a flow chart of Websocket communication establishment and data interaction can be seen, that first, to establish Websocket communication, a message request protocol is sent through an HTTP protocol to be upgraded to a Websocket protocol, and a Websocket server formally starts Websocket communication after responding to a request and returning a confirmation message. At the moment, the embedded device sends login information to the Websocket server, the Websocket server queries the database to find the registered device, login is completed, and then the Websocket information can be normally sent. The same is true for the browser side. In order to ensure that the connection between the embedded device and the Websocket is effective, the embedded device can send a heartbeat message ping to the Websocket server, and the Websocket server returns a pong message to indicate that the connection is normal. If the heartbeat keep-alive cannot be normally carried out for some reasons, the embedded device end and the Websocket server cancel the connection.
Referring to fig. 3, the whole flow chart of the Websocket process of the method of the present invention can be seen. First, configuration information including a route of the Websocket server and a registered device number is obtained by reading a configuration file. A message queue is then created to await interprocess communication. And then configuring related content of the Websocket client comprises configuring four callback functions as an on _ open function, an on _ close function, an on _ fail function and an on _ message function respectively. The on _ open function is used for processing a registration connection opening event between the Websocket client and the Websocket server, creating a thread for heartbeat keep-alive after the registration connection opening event is successfully opened, and sending ping messages according to a certain time interval; the on _ close function is used for processing a connection closing event between the Websocket client and the Websocket server; the on _ fail function is used for processing a connection failure event between the Websocket client and the Websocket server; the on _ message function is used for processing a message event connected and received between the Websocket client and the Websocket server, and after receiving the message, the received Websocket message is sent to a message queue to wait for the Dev process to carry out analysis processing.
Referring to fig. 4, it can be seen that the overall flow chart of the Dev process, first, the configuration file is read to obtain the device ID, the initialization of the embedded device is completed, and then the related configuration of the message queue is configured, so that the Dev process and the Websocket process share one message queue to prepare for the inter-process communication. In order to realize asynchronous processing of receiving and sending messages during interprocess communication, a special receiving thread is created for blocking messages waiting for being sent by the Websocket process. And waiting for receiving the communication of the message sent by the Websocket process in the Dev process, sending the device login information to the Websocket process by sending the device login information to the message queue, and packaging the message by the Websocket process and sending the message to the Websocket server. After the receiving thread receives the message body sent from the Websocket process, the Dev process parses the message body in the Xml format (the format of the message body of the Websocket message is in the Xml format, which is used for negotiation or other formats such as json), and obtains the command sent by the user. The commands include two types, one is an operation command such as "ls", "cd", "cp" and a run code command, and the other is a download command for notifying the embedded device to download the cross-compiled executable file uploaded by the user to the embedded device. And finally, uploading the printing information of the embedded equipment after executing the corresponding operation to a Web server through an HTTP protocol.
Referring to fig. 5, it can be seen that in the flowchart of the Dev process parsing the message sent by the Websocket process, the message sent by the Websocket process is first obtained through a receiving thread, the message is in an Xml format, and Xml nodes and data in the nodes are parsed through an Xml related library function. Whether the command contained in the message is an operation command or a download command is known by judging the name of the root node, and if the command is judged to be the operation command, the corresponding operation is executed through a system function or a pop function. And if the command is a download command, accessing a corresponding interface provided by the Web server through a GET method of the libcurl library to download the file. Referring to fig. 6, it can be seen a flowchart of the Dev process downloading a file from a Web server; the method comprises the steps of obtaining a downloading command by analyzing Xml information sent by a Sip process, obtaining the name of a file to be downloaded at the same time, accessing a Web interface by taking an ID number and a file name of equipment as parameters through a GET method, transmitting an experiment code on a Web server to embedded equipment by the Web server in a mode of responding to a request, and writing received data into the file by the embedded equipment to realize the process of downloading the file from a Web end to the embedded equipment end by creating a file with the same name locally. Referring to 7, it can be seen that a result of the feedback of the execution command is returned to the Websocket server and forwarded to the browser through the server, when the Xml message is analyzed as the operation command, a specific execution command is obtained, the command is executed by using a system or pop function, and the feedback data printed by the embedded device is stored in a specified file to be read in an output redirection manner. The data is stored in the memory by reading the file to be read, and finally the Dev process writes the data into the message queue to wait for the Websocket process to acquire the data and send the data to the Websocket server, and finally the data is forwarded to the browser for instant display through the Websocket server.
A diagram of inter-process communication relationships can be seen with reference to fig. 8. The Dev process and the Websocket process realize an asynchronous processing mode of data receiving and sending in a multithreading mode, the Dev process creates a waiting thread for processing the message sent to the message queue by the Websocket process, and the same is true for the Websocket process. However, since the device log-in message is sent by the Dev process, the Websocket process can establish connection with the Websocket server only after the Dev sends the device log-in message to the Websocket process, the configured callback function on _ open function can successfully establish connection and then establish a thread for sending the heartbeat packet, the callback function on _ message can receive the message of the Websocket server and then forward the message to the Dev process, and the waiting thread of the Dev process can relieve the blocking state to process the message forwarded by the Websocket process, thereby starting the communication flow between the whole embedded device and the Websocket server, the Web server.
Referring to fig. 9, a complete flow of the embedded device remote experiment based on the Websocket protocol is described by taking a specific embedded experiment (IIC experiment) as an example.
Firstly, a user generates an executable file i2c of an application layer in a local virtual machine through cross compiling, and also needs to generate related driver codes i2c. And the user uploads the generated code to the Web server through the browser. And the embedded device side starts to execute the Websocket process and the Dev process to complete the operation of logging in the Websocket server by the device. At the moment, a user can see that the equipment is on-line after logging in the Websocket server through the browser, and then selects the embedded equipment to be bound to bind.
After binding is successful, a user sends a download (i2c and i2c. ko files) command to a Websocket server through a browser, the download command comprises a file name, the Websocket process of the device receives a message and then forwards the load content of the Websocket message to a Dev process, the Dev process finds that the download command is the download command after analyzing, obtains the file names i2c and i2c. ko to be downloaded, accesses a download interface of the Web server through an HTTP protocol, and transmits the file name and the device ID as parameters to the Web server, so that the download file is the file transmitted to the device by the user, and meanwhile, an i2c and i2c. ko homonymic empty file are created locally, the Web service returns the downloaded file data to the embedded device, and the embedded device writes the data transmitted by the Web server into the local homonymic file to complete the operation of downloading the file. After the file is downloaded, the byte size of the downloaded file is returned to the Websocket server and forwarded to the browser by the Websocket server, and the user judges whether the file is downloaded correctly or not by checking the size of the downloaded file.
Then, after the browser acquires information of the embedded device for completing file downloading, a user inputs an operation command 'insmod i2 c.ko' to dynamically load a driving module, the command is finally analyzed by a Dev process operated by the embedded device like the process, the operation command is obtained through analysis, then a system/pop function is called to execute the operation command, a device printing message after the command is executed is acquired through output redirection, then the acquired data is sent to a message queue through the Dev process, then the acquired data is sent to a server through a Websocket process, and finally the server is forwarded to the browser to be seen by the user. If the module loading succeeds in executing the command again, the embedded device will generate an error message, which will be uploaded to the browser in the same manner.
After the drive module is loaded successfully, a user sends a "/i 2 c" command, the embedded device receives the message and then analyzes the message to find that an operation command is executed through a system or pop function, the "/i 2 c" command is executed, each IIC device access bus has an address, address information of the IIC device is obtained by operating the "/i 2 c" command, after the print information is obtained in a redirection mode, the print information of the embedded device after the application program is executed is obtained by reading a redirection file, the print information is finally sent to a Websocket server through a Websocket process, then the print information is forwarded to a browser through the Websocket server, the user obtains a result, and the experiment is completed.
Through the above process, it can be known that the embedded remote experiment can be realized through the method of the present invention.
The embodiments described in this specification are merely illustrative of implementations of the inventive concept and the scope of the present invention should not be considered limited to the specific forms set forth in the embodiments but rather by the equivalents thereof as may occur to those skilled in the art upon consideration of the present inventive concept.

Claims (1)

1. A remote experimental method of embedded equipment based on a Websocket protocol comprises the following steps:
1) building a Websocket server and a Web server, and specifically comprising the following steps:
the Websocket server is used as a bridge for communication between the browser user and the embedded equipment, so that the user can establish connection with the embedded equipment through the Websocket server; the Web server is used for storing user registration information, equipment registration information and experimental code files uploaded by the browser, and providing a downloading interface so that the embedded equipment can acquire the experimental code files on the browser;
2) the method comprises the following steps of running embedded equipment codes and further establishing connection with a Websocket server to wait for binding of a user, wherein the method specifically comprises the following steps:
the device is characterized in that the device has two local process codes which are respectively a Websocket process and a Dev process, wherein the Websocket process is used for establishing communication with a Websocket server, so that the device can be connected with the Websocket server and is bound by a user; the Dev process is used for analyzing and processing the Websocket message content, and the two processes adopt a message queue mode to realize inter-process communication;
the main function of the inter-process communication is to forward PayloadData of user information received by the Websocket process and sent from the Websocket server to the Dev process, wherein the Dev process is responsible for initiating equipment login information and analyzing an information body, and executing a corresponding command after analyzing a specific command; the device logs in the Websocket server by running the two processes; the embedded device end sends heartbeat messages ping to the Websocket server at regular time, and the Websocket server returns a pong message after receiving the messages to inform the device end that the connection is normal, so that the embedded device end and the Websocket server can know whether the connection between the embedded device end and the Websocket server is interrupted in time; the heartbeat messages are sent regularly, so that the equipment can be kept in an online state, and at the moment, a user can bind the online equipment through the Websocket server;
3) the method comprises the following steps that a user logs in to establish communication with a Websocket server, and then binds online equipment, and specifically comprises the following steps:
the user performs login operation through the browser, whether the user exists is verified by sending a login message to the Web server, if so, the login is successful, otherwise, the login fails; then, the operation of binding the user and the embedded equipment is realized through a Web server, and the binding information is stored in a database; then the Websocket server realizes the one-to-one forwarding function of the message between the user and the embedded device bound by the user through the binding information in the database;
4) the embedded device waits for a user to send a command and analyzes the command, and the method specifically comprises the following steps:
the method comprises the steps that a user sends a command through a browser, the command is forwarded to embedded equipment bound by the user through a Websocket server, the equipment receives the message through a Websocket process, the content of the message is forwarded to a Dev process for analysis and processing, the Dev process knows the type of the executed command by judging PayloadData content in an Xml format, the command type comprises a downloading command and an operating command, the operating command is a command commonly used by a Linux system, and the downloading command is the command and the Websocket server;
5) executing a download command to download a file, specifically comprising:
firstly, executing a downloading command to download a code of an embedded experiment to be executed to the embedded equipment; a user sends a downloading command in a browser in a button clicking mode, and adds a file name of an uploaded experiment related file serving as a content into PayloadData of a Websocket message in an Xml format; the embedded device end Websocket process receives the message forwarded by the Websocket server and writes the message content in the Xml format into the message queue, the Dev process obtains PayloadData in the Xml format by reading the message queue and analyzes the message, the PayloadData is known as a downloading command through the name of the root node of the Xml, the name of an experimental file to be downloaded is obtained through the child nodes under the root node, then a homonymous file is created locally, a file downloading interface provided by the Web server is accessed through a GET method provided by a libcur library, and the data fed back by the Web server is stored in the homonymous file locally of the embedded device to realize the function of file downloading;
6) the method for the embedded equipment to execute the operation command and start running the embedded experiment code by the user sending the operation command specifically comprises the following steps:
a user writes an operation command to be sent in a sending frame of a browser, the browser packages the content of the sending frame into an Xml format and sends the Xml format to a Websocket server, a Websocket process at an embedded device receives a message forwarded by the Websocket server and transmits the PayloadData content of the message into a message queue, a Dev process analyzes the PayloadData in the Xml format, after the analyzed root node name is known as the operation command, a specific command to be executed is obtained by analyzing a child node name, and then the command operation is realized through a system/pop function;
7) the method for acquiring feedback information generated after the embedded device executes the user command and feeding data back to the browser includes:
the method comprises the steps that a Dev process acquires feedback data of operation executed by the embedded device after executing an operation command sent by a user, then the acquired data are sent to a message queue in a message queue mode, a Websocket process acquires data to be sent in the message queue, the data are packaged into data in accordance with a frame format of a Websocket protocol through the Websocket protocol and sent to a Websocket server, the Websocket server forwards a message to a browser, and the user can immediately acquire the feedback data of the embedded device.
CN202011363836.XA 2020-11-27 2020-11-27 Websocket protocol-based embedded equipment remote experiment method Active CN112468502B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011363836.XA CN112468502B (en) 2020-11-27 2020-11-27 Websocket protocol-based embedded equipment remote experiment method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011363836.XA CN112468502B (en) 2020-11-27 2020-11-27 Websocket protocol-based embedded equipment remote experiment method

Publications (2)

Publication Number Publication Date
CN112468502A CN112468502A (en) 2021-03-09
CN112468502B true CN112468502B (en) 2022-07-01

Family

ID=74809180

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011363836.XA Active CN112468502B (en) 2020-11-27 2020-11-27 Websocket protocol-based embedded equipment remote experiment method

Country Status (1)

Country Link
CN (1) CN112468502B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116149883B (en) * 2023-04-21 2023-07-25 杭州实在智能科技有限公司 RPA software rapid embedding method and system for Web system

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102546800A (en) * 2012-01-06 2012-07-04 华为技术有限公司 Handshake and communication methods for gateway, gateway and Web communication system
CN103491179A (en) * 2013-09-27 2014-01-01 百视通网络电视技术发展有限责任公司 Multi-screen interaction method and system based on Web
EP2963885A1 (en) * 2014-07-03 2016-01-06 HOB GmbH & Co. KG A client-server-communication system running a client-side-script-program
CN105530321A (en) * 2016-02-15 2016-04-27 上海斐讯数据通信技术有限公司 Method, client, server and system for accessing equipment by browser client
CN107332932A (en) * 2017-08-09 2017-11-07 南京阿凡达机器人科技有限公司 A kind of robot system remote upgrade method based on FOTA
CN108228625A (en) * 2016-12-15 2018-06-29 腾讯科技(深圳)有限公司 A kind of PUSH message processing method and processing device
CN109861836A (en) * 2017-11-30 2019-06-07 北京亿阳信通科技有限公司 A kind of network management device and its management method

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102546800A (en) * 2012-01-06 2012-07-04 华为技术有限公司 Handshake and communication methods for gateway, gateway and Web communication system
CN103491179A (en) * 2013-09-27 2014-01-01 百视通网络电视技术发展有限责任公司 Multi-screen interaction method and system based on Web
EP2963885A1 (en) * 2014-07-03 2016-01-06 HOB GmbH & Co. KG A client-server-communication system running a client-side-script-program
CN105530321A (en) * 2016-02-15 2016-04-27 上海斐讯数据通信技术有限公司 Method, client, server and system for accessing equipment by browser client
CN108228625A (en) * 2016-12-15 2018-06-29 腾讯科技(深圳)有限公司 A kind of PUSH message processing method and processing device
CN107332932A (en) * 2017-08-09 2017-11-07 南京阿凡达机器人科技有限公司 A kind of robot system remote upgrade method based on FOTA
CN109861836A (en) * 2017-11-30 2019-06-07 北京亿阳信通科技有限公司 A kind of network management device and its management method

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
Design and Implementation of Real-time Embedded Data Acquisition and Classification with Web-based Configuration and Visualization;Santi Nuratch;《2018 International Conference on Embedded Systems and Intelligent Technology & International Conference on Information and Communication Technology for Embedded Systems (ICESIT-ICICTES)》;20180823;全文 *
实时大规模远程实验通信方案研究;谌建飞等;《计算机工程与应用》;20181001;全文 *
开放共享嵌入式系统实验网络平台建设;徐志江等;《实验室研究与探索》;20150515;全文 *

Also Published As

Publication number Publication date
CN112468502A (en) 2021-03-09

Similar Documents

Publication Publication Date Title
US7665094B2 (en) Systems and methods for mobile communication
US6014702A (en) Host information access via distributed programmed objects
US6041365A (en) Apparatus and method for high performance remote application gateway servers
EP1259042B1 (en) Trusted internet clipboard
JP4867482B2 (en) Control program and communication system
US7299403B1 (en) Methods and apparatus for obtaining a state of a browser
US6938087B1 (en) Distributed universal communication module for facilitating delivery of network services to one or more devices communicating over multiple transport facilities
US7818294B2 (en) Apparatus, system, and method for implementing an IMS SOAP gateway
US20170357541A1 (en) Method for flow control and for reliable communication in a collaborative environment
US6795851B1 (en) Web-based client/server communication channel with automated client-side channel endpoint feature detection and selection
US8291486B2 (en) Gateway device having socket library for monitoring, communication method of gateway device having socket library for monitoring, and communication program of gateway device having socket library for monitoring
JPH10187575A (en) Client-object api/gateway for enabling oltp through internet
JP2002510412A (en) Data download process and device from server computer to client computer
US10367894B2 (en) Information processing apparatus, method for controlling the same, non-transitory computer-readable storage medium, and information processing system
WO2001054369A2 (en) System and method for computer network uploading
CN112468502B (en) Websocket protocol-based embedded equipment remote experiment method
JP2002207604A (en) Method and device for remotely using data processing object connected to communication network
Mesnil Mobile and Web Messaging: Messaging Protocols for Web and Mobile Devices
US20040167960A1 (en) Network service interceptor
WO2017211302A1 (en) Application program development method, apparatus and system
JP2004246747A (en) Wrapping method and system of existing service
US20020062340A1 (en) System for modifying a web page
JP2000250838A (en) Method and system for packaging application program, and recording medium programmed and recorded with the method
CN112380034B (en) Remote experimental method for embedded equipment
Wang et al. The websocket api

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