CN111970364A - Hardware debugging execution method and device, electronic equipment and storage medium - Google Patents

Hardware debugging execution method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN111970364A
CN111970364A CN202010829662.5A CN202010829662A CN111970364A CN 111970364 A CN111970364 A CN 111970364A CN 202010829662 A CN202010829662 A CN 202010829662A CN 111970364 A CN111970364 A CN 111970364A
Authority
CN
China
Prior art keywords
hardware
command
chat room
websocket
connection request
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.)
Pending
Application number
CN202010829662.5A
Other languages
Chinese (zh)
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.)
Ainnovation Chongqing Technology Co ltd
Original Assignee
Ainnovation Chongqing 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 Ainnovation Chongqing Technology Co ltd filed Critical Ainnovation Chongqing Technology Co ltd
Priority to CN202010829662.5A priority Critical patent/CN111970364A/en
Publication of CN111970364A publication Critical patent/CN111970364A/en
Pending legal-status Critical Current

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/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
    • 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)
  • Debugging And Monitoring (AREA)

Abstract

The application provides a hardware debugging execution method and device, electronic equipment and a storage medium, and belongs to the technical field of hardware debugging. The method applied to the front-end command device comprises the following steps: sending a front-end connection request to a background transfer server; receiving connection return information returned by the background transfer server based on the front-end connection request; sending a hardware debugging command to a chat room of a background transfer server through WebSocket; and acquiring a command execution result of the hardware debugging command from the chat room through the Websocket, and sending the command execution result to the chat room through the Websocket by the hardware device. According to the method, data such as the hardware debugging command and the command execution result between the front-end command device and the hardware device are carried out through the WebSocket, development cost is low, time delay is low, a script does not need to be transmitted, the command is directly transmitted to the hardware device to be debugged, real-time feedback is obtained, and hardware debugging efficiency is improved.

Description

Hardware debugging execution method and device, electronic equipment and storage medium
Technical Field
The present application relates to the field of hardware debugging technologies, and in particular, to a hardware debugging execution method and apparatus, an electronic device, and a storage medium.
Background
When the types of current industrial intelligent hardware are in a wide range, more and more intelligent sensors are deployed on a production line of an industrial production line, and after the intelligent hardware is deployed on the industrial production line, once a problem occurs and needs to be debugged, developers need to contact hardware equipment and analyze the problem of the hardware, and usually the problem needs to be checked on site, or an advanced mode is to upload an execution script to the intelligent hardware and download an operation log for analysis after operation.
The traditional hardware debugging method has the problems of high development cost, high data transmission delay and low speed of hardware feedback debugging result.
Disclosure of Invention
In view of this, embodiments of the present disclosure provide a method and an apparatus for executing hardware debugging, an electronic device, and a storage medium, so as to solve the problems in the prior art, such as high development cost, high data transmission delay, and low speed of hardware feedback debugging result.
The embodiment of the application provides a hardware debugging execution method applied to front-end command equipment, which comprises the following steps: sending a front-end connection request to a background transfer server; receiving connection return information returned by the background transfer server based on the front-end connection request, wherein the connection return information is used for indicating that the front-end command device and the hardware device are added into a chat room based on WebSocket; sending a hardware debugging command to the chat room of the background transfer server through WebSocket; and acquiring a command execution result of the hardware debugging command from the chat room through WebSocket, wherein the command execution result is sent to the chat room by the hardware equipment through WebSocket.
In the implementation mode, data such as a hardware debugging command and a command execution result between the front-end command device and the hardware device are carried out through the WebSocket, other devices are remotely connected to run the hardware debugging command in the development process of the hardware device and after the hardware device is deployed, command output is obtained immediately, development cost is low, time delay of communication and debugging command execution feedback is reduced, and hardware debugging efficiency is improved. Meanwhile, the intelligent hardware only needs to run the network service of one WebSocket, the change of the existing system is small, and the change cost of the intelligent hardware is low.
Optionally, after the sending the hardware debugging command to the chat room of the background transit server through the WebSocket, the method further includes: and sending a disconnection request to the chat room through WebSocket so that the background transfer server destroys the chat room based on the disconnection request.
In the implementation mode, after hardware debugging at a certain stage is completed, the chat room is destroyed through the disconnection request, so that the possibility of network attack can be reduced, and the debugging safety is improved.
The embodiment of the application also provides a hardware debugging execution method applied to the background transfer server, and the method comprises the following steps: receiving a front-end connection request sent by front-end command equipment; establishing a chat room based on WebSocket; sending a hardware connection request to a hardware device based on the front-end connection request so that the hardware device joins the chat room based on the hardware connection request; receiving a hardware debugging command sent by the background transfer server through the chat room so that the hardware device obtains the hardware debugging command from the chat room through WebSocket; and receiving a command execution result sent by the hardware equipment through the chat room, so that the front-end command equipment can obtain the command execution result from the chat room through the WebSocket.
In the implementation mode, the communication between the front-end command device and the hardware device is realized through the chat room created by the background transfer server based on the WebSocket, other devices are remotely connected to run hardware debugging commands in the development process of the hardware device and after the hardware device is deployed, the command output is obtained immediately, the development cost is low, the time delay of communication and debugging command execution feedback is reduced, and the hardware debugging efficiency is improved. Meanwhile, the intelligent hardware only needs to run the network service of one WebSocket, the change of the existing system is small, and the change cost of the intelligent hardware is low.
Optionally, the establishing a chat room based on WebSocket includes: and creating an instance with a chat room function by using at least two client agents based on WebSocket, taking the instance as the chat room, wherein the client agents are used for processing key information in the received messages based on key values.
In the above implementation manner, the client agent corresponds to the two instances to implement the chat room function, and the client agent processes the key information in the received message based on the key value, so that the processing efficiency of the background relay server on the data transmitted by the front-end command device and the hardware device can be improved.
Optionally, after receiving, by the chat room, a result of executing the command sent by the hardware device, the method further includes: receiving a disconnection request sent by the background transfer server through the chat room; destroying the chat room based on the disconnect request.
In the implementation mode, after the hardware debugging is completed, the chat room is destroyed based on the disconnection request, so that the possibility of being attacked by a network can be reduced, and the debugging safety is improved.
The embodiment of the application also provides a hardware debugging execution method applied to hardware equipment, and the method comprises the following steps: receiving a hardware connection request sent by a background transfer server; requesting to join the chat room based on the hardware connection; acquiring a hardware debugging command from the chat room through WebSocket, wherein the hardware debugging command is sent to the chat room through WebSocket by a front-end command device; and executing the hardware debugging command, and sending a command execution result of the hardware debugging command to the chat room through WebSocket.
In the implementation mode, the communication between the front-end command device and the hardware device is realized through the chat room created by the background transfer server based on the WebSocket, other devices are remotely connected to run hardware debugging commands in the development process of the hardware device and after the hardware device is deployed, the command output is obtained immediately, the development cost is low, the time delay of communication and debugging command execution feedback is reduced, and the hardware debugging efficiency is improved. Meanwhile, the intelligent hardware only needs to run the network service of one WebSocket, the change of the existing system is small, and the change cost of the intelligent hardware is low.
Optionally, the executing the hardware debug command includes: starting a virtual terminal; and running the hardware debugging command in the virtual terminal in a terminal command mode.
In the implementation mode, the hardware debugging command is directly operated through the virtual terminal after the hardware debugging command is received, hardware execution is not performed based on the operation script, and debugging efficiency is improved.
The embodiment of the present application further provides a hardware debugging execution apparatus applied to a front-end command device, where the apparatus includes: the front-end connection request sending module is used for sending a front-end connection request to the background transfer server; a connection return information receiving module, configured to receive connection return information returned by the background transit server based on the front-end connection request, where the connection return information is used to indicate that the front-end command device and the hardware device have joined a chat room based on WebSocket; the command sending module is used for sending a hardware debugging command to the chat room of the background transfer server through WebSocket; and the execution result receiving module is used for acquiring a command execution result of the hardware debugging command from the chat room through WebSocket, and the command execution result is sent to the chat room through WebSocket by the hardware equipment.
In the implementation mode, data such as a hardware debugging command and a command execution result between the front-end command device and the hardware device are carried out through the WebSocket, other devices are remotely connected to run the hardware debugging command in the development process of the hardware device and after the hardware device is deployed, command output is obtained immediately, development cost is low, time delay of communication and debugging command execution feedback is reduced, and hardware debugging efficiency is improved. Meanwhile, the intelligent hardware only needs to run the network service of one WebSocket, the change of the existing system is small, and the change cost of the intelligent hardware is low.
Optionally, the hardware debugging execution apparatus further includes: and the disconnection request sending module is used for sending a disconnection request to the chat room through WebSocket so that the background transfer server destroys the chat room based on the disconnection request.
In the implementation mode, after hardware debugging at a certain stage is completed, the chat room is destroyed through the disconnection request, so that the possibility of network attack can be reduced, and the debugging safety is improved.
The embodiment of the present application further provides a hardware debugging execution device applied to the background transfer server, the device includes: the front-end connection request receiving module is used for receiving a front-end connection request sent by the front-end command equipment; the chat room establishing module is used for establishing a chat room based on WebSocket; a hardware connection request sending module, configured to send a hardware connection request to a hardware device based on the front-end connection request, so that the hardware device joins the chat room based on the hardware connection request; the command forwarding module is used for receiving a hardware debugging command sent by the background transfer server through the chat room so that the hardware device obtains the hardware debugging command from the chat room through WebSocket; and the execution result forwarding module is used for receiving the command execution result sent by the hardware device through the chat room, so that the front-end command device can obtain the command execution result from the chat room through the WebSocket.
In the implementation mode, the communication between the front-end command device and the hardware device is realized through the chat room created by the background transfer server based on the WebSocket, other devices are remotely connected to run hardware debugging commands in the development process of the hardware device and after the hardware device is deployed, the command output is obtained immediately, the development cost is low, the time delay of communication and debugging command execution feedback is reduced, and the hardware debugging efficiency is improved. Meanwhile, the intelligent hardware only needs to run the network service of one WebSocket, the change of the existing system is small, and the change cost of the intelligent hardware is low.
Optionally, the chat room establishing module is specifically configured to: and creating an instance with a chat room function by using at least two client agents based on WebSocket, taking the instance as the chat room, wherein the client agents are used for processing key information in the received messages based on key values.
In the above implementation manner, the client agent corresponds to the two instances to implement the chat room function, and the client agent processes the key information in the received message based on the key value, so that the processing efficiency of the background relay server on the data transmitted by the front-end command device and the hardware device can be improved.
Optionally, the hardware debugging execution apparatus further includes: the chat room destroying module is used for receiving the disconnection request sent by the background transfer server through the chat room; destroying the chat room based on the disconnect request.
In the implementation mode, after the hardware debugging is completed, the chat room is destroyed based on the disconnection request, so that the possibility of being attacked by a network can be reduced, and the debugging safety is improved.
The embodiment of the present application further provides a hardware debugging execution apparatus applied to a hardware device, where the apparatus includes: the hardware connection request receiving module is used for receiving a hardware connection request sent by the background transfer server; the chat room connecting module is used for requesting to join the chat room based on the hardware connection; the command receiving module is used for acquiring a hardware debugging command from the chat room through WebSocket, and the hardware debugging command is sent to the chat room through WebSocket by front-end command equipment; and the execution result sending module is used for executing the hardware debugging command and sending the command execution result of the hardware debugging command to the chat room through WebSocket.
In the implementation mode, the communication between the front-end command device and the hardware device is realized through the chat room created by the background transfer server based on the WebSocket, other devices are remotely connected to run hardware debugging commands in the development process of the hardware device and after the hardware device is deployed, the command output is obtained immediately, the development cost is low, the time delay of communication and debugging command execution feedback is reduced, and the hardware debugging efficiency is improved. Meanwhile, the intelligent hardware only needs to run the network service of one WebSocket, the change of the existing system is small, and the change cost of the intelligent hardware is low.
Optionally, the execution result sending module is specifically configured to: starting a virtual terminal; and running the hardware debugging command in the virtual terminal in a terminal command mode.
In the implementation mode, the hardware debugging command is directly operated through the virtual terminal after the hardware debugging command is received, hardware execution is not performed based on the operation script, and debugging efficiency is improved.
An embodiment of the present application further provides an electronic device, where the electronic device includes a memory and a processor, where the memory stores program instructions, and the processor executes steps in any one of the above implementation manners when reading and executing the program instructions.
An embodiment of the present application further provides a storage medium, where computer program instructions are stored in the storage medium, and when the computer program instructions are read and executed by a processor, the steps in any one of the above implementation manners are performed.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments of the present application will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and that those skilled in the art can also obtain other related drawings based on the drawings without inventive efforts.
Fig. 1 is a schematic flowchart of a hardware debugging execution method applied to a front-end command device according to an embodiment of the present application.
Fig. 2 is a schematic diagram of a chat room according to an embodiment of the present invention.
Fig. 3 is a schematic flowchart of a hardware debugging execution method applied to a background transit server according to an embodiment of the present application.
Fig. 4 is a schematic block diagram of a chat room according to an embodiment of the present invention.
Fig. 5 is a flowchart illustrating a hardware debugging execution method applied to a hardware device according to an embodiment of the present application.
Fig. 6 is a block diagram of a hardware debug executing apparatus applied to a front-end command device according to an embodiment of the present disclosure.
Fig. 7 is a schematic block diagram of a hardware debugging execution apparatus applied to a background transit server according to an embodiment of the present application.
Fig. 8 is a schematic block diagram of a hardware debug execution apparatus applied to a hardware device according to an embodiment of the present disclosure.
Icon: 40-a hardware debugging execution device; 41-front end connection request sending module; 42-connecting a return information receiving module; 43-a command sending module; 44-an execution result receiving module; 50-hardware debug execution means; 51-front end connection request receiving module; 52-chat room establishment module; 53-hardware connection request sending module; 54-a command forwarding module; 55-execution result forwarding module; 60-hardware debug execution means; 61-hardware connection request receiving module; 62-chat room connection module; 63-a command receiving module; 64-execution result sending module.
Detailed Description
The technical solution in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application.
The existing conventional intelligent hardware debugging method generally comprises the following steps: (1) remotely connecting to intelligent hardware; (2) the running script uploads the log to a cloud terminal for storage; (3) and locally downloading the log analysis log. The time for writing the logs is required to be very reasonable in the whole process, developers need to pay attention to service implementation and consider the time problem of log collection, and the scripts need to be uploaded to equipment and then run to download the running result logs due to the fact that the debugging scripts are changed every time, so that the efficiency is low and tedious in the development stage, the development cost is high, and the problems of high data transmission delay and low efficiency exist.
In order to solve the above problems in the prior art, an embodiment of the present application provides a hardware debugging execution method applied to a front-end command device.
Referring to fig. 1, fig. 1 is a flowchart illustrating a hardware debugging execution method applied to a front-end command device according to an embodiment of the present disclosure. The method comprises the following specific steps:
step S12: and sending a front-end connection request to a background transfer server.
Alternatively, the front-end Command device in this embodiment may be an electronic device capable of outputting a hardware debugging Command through a Command module such as a Command (Command) module, a Shell (Shell) module, or a native (Raw) module, and the electronic device may be an electronic device having a logic calculation function, such as a Personal Computer (PC), a tablet Computer, a smart phone, and a Personal Digital Assistant (PDA).
Alternatively, the front-end connection request may be a HyperText Transfer Protocol (HTTP) request, a Socket (Socket) request, or a connection request based on another network Protocol.
Step S14: and receiving connection return information returned by the background transit server based on the front-end connection request.
The connection return information is used for indicating that the front-end command device and the hardware device are added into the chat room based on the WebSocket.
Optionally, the connection return information in this embodiment may be connection return information returned by the chat room after the front-end command device and the hardware device join the chat room created based on the WebSocket, and the front-end command device may obtain the connection return information by monitoring the chat room.
WebSocket is a Protocol for full duplex communication over a single Transmission Control Protocol (TCP) connection. WebSocket enables data exchange between the client and the server to be simpler, and allows the server to actively push data to the client. In a WebSocket Application Programming Interface (API), a browser and a server only need to complete one handshake, and a persistent connection can be directly established between the browser and the server, and bidirectional data transmission is performed.
In the traditional website pushing, the technology used is Ajax (asynchronous Javascript And XML) polling. Polling is the HTTP request by the browser to the server at a specific time interval (e.g., every 1 second), and then the server returns the most recent data to the client's browser. This conventional model brings with it obvious disadvantages that the browser needs to send requests to the server continuously, however, HTTP requests may contain a long header, where the really valid data may be only a small part, which obviously wastes much resources such as bandwidth. The WebSocket protocol can better save server resources and bandwidth, and can perform communication in real time, so that the embodiment realizes data transmission between the front-end command device and the hardware device based on the WebSocket, and can improve the whole hardware debugging efficiency.
Step S16: and sending a hardware debugging command to a chat room of the background transfer server through WebSocket.
Optionally, the chat Room in this embodiment is an example (Room) with a chat Room function created by WebSocket using at least two Client agents (clients), please refer to fig. 2, and fig. 2 is a schematic diagram of a chat Room provided in this embodiment of the present application. The Client1 and the Client2 correspond to one of a front-end command device and a hardware device, respectively. It should be understood that when the number of the front-end command device and the hardware device is more than one, the number of the corresponding clients may be correspondingly more.
When communicating using HTTP, the Client may choose a sub-project HTTP Client under Apache Jakarta Common, may be used to provide an efficient, up-to-date, feature-rich HTTP-enabled Client programming toolkit, and it supports the most up-to-date versions and recommendations of HTTP.
Step S18: and acquiring a command execution result of the hardware debugging command from the chat room through WebSocket.
Optionally, the hardware device corresponding to the hardware debugging command in this embodiment may be a sensor, a printed circuit board including various components, and the like, and the hardware debugging command may be to control the sensor to obtain sensor data, or to control the printed circuit board to operate to obtain operation states of a power supply, a chip, a crystal oscillator, a reset circuit, a memory, a flash memory, and the like of the printed circuit board.
As an optional implementation manner, when the hardware debugging execution method applied to the front-end command device needs to stop debugging without hardware debugging after sending the hardware debugging command, or needs to stop debugging after receiving the command execution result and completing hardware debugging, the hardware debugging execution method may further actively request to cut off the connection with the chat room, and the specific steps may include:
step S19: and sending a disconnection request to the chat room through WebSocket.
The background transfer server destroys the chat room when receiving the disconnection request, and unnecessary network attack on the non-debugging time period is avoided, so that the data transmission safety is ensured.
In order to cooperate with the hardware debugging execution method applied to the front-end command device, an embodiment of the present application further provides a hardware debugging execution method applied to the background relay server, please refer to fig. 3, and fig. 3 is a schematic flow diagram of the hardware debugging execution method applied to the background relay server provided in the embodiment of the present application. The hardware debugging execution method applied to the background transfer server comprises the following specific steps:
step S21: and receiving a front-end connection request sent by the front-end command equipment.
The background transit server can process the front-end connection request into a Pending (Pending) state after receiving the front-end connection request, and then subsequently creates a chat room and responds to the front-end connection request after determining that the hardware device is accessed to the chat room.
Step S22: and establishing a chat room based on the WebSocket.
Optionally, please refer to fig. 4, where fig. 4 is a schematic block diagram of a chat room according to an embodiment of the present application. The front end commands the Browser program or Browser of the Device to be Browser, the driver program of the hardware Device to be Device, and the background transfer Server to be Server.
The specific establishment steps of the chat room may include: and creating an instance with the function of a chat room by using at least two client agents based on the WebSocket, and taking the instance as the chat room.
The messages sent by the front-end command device and the hardware device to the chat room can be composed of Key messages, and each Client performs different processing on Key information in the received messages based on different Key values (keys).
Step S23: a hardware connection request is sent to the hardware device based on the front-end connection request.
Step S24: and receiving a hardware debugging command sent by the background transfer server through the chat room.
After the hardware device acquires the hardware debugging command by monitoring the chat room, the hardware device can control the hardware to execute actions based on the hardware debugging command, and the hardware debugging execution part is completed.
Step S25: and receiving a command execution result sent by the hardware equipment through the chat room.
The front end command device can complete the whole hardware debugging process after obtaining the command execution result by monitoring the chat room.
In order to cooperate with the front-end command device and the background transfer device, an embodiment of the present application further provides a hardware debugging execution method applied to the hardware device, please refer to fig. 5, where fig. 5 is a schematic flow diagram of the hardware debugging execution method applied to the hardware device provided in the embodiment of the present application, and specific steps may be as follows:
step S32: and receiving a hardware connection request sent by the background transit server.
Step S34: joining the chat room based on the hardware connection request.
Step S36: and acquiring a hardware debugging command from the chat room through WebSocket.
Step S38: and executing the hardware debugging command, and sending a command execution result of the hardware debugging command to the chat room through the Websocket.
Specifically, the step of executing the hardware debug command may specifically include:
step S381: and starting the virtual terminal.
A Virtual Terminal (VT) is a remote Terminal emulation that provides a Telnet protocol similar to the Internet, and may be simply understood as a window that can input a command line and display information during program operation and a program operation result. The virtual terminal provides the following main functions: establishing connection and service for maintaining connection between two equal-layer application entities; control the dialog and negotiations of operations and functions to be performed; establishing and maintaining a data structure representing the state of the terminal; mapping between the terminal characteristics and the standard representation format is performed. Therefore, the embodiment adopts the virtual terminal to carry out communication and hardware debugging command operation, and can ensure the communication simplicity and the hardware debugging command operation efficiency.
Step S382: and executing the hardware debugging command in a terminal command mode in the virtual terminal.
Optionally, the hardware debugging Command in this implementation may be a Command in the form of Shell, Command, or the like, and the virtual Terminal may be a common Windows Terminal or other Terminal. Taking the Shell as an example, the command may be a command in a terminal running environment without a graphical interface, and therefore, the present embodiment may adopt the Shell as a command form of a hardware debugging command to improve command input operation efficiency and interaction simplicity.
Alternatively, the background relay server and the hardware device in this embodiment may be any electronic device capable of performing communication and device control, and the electronic device may be an electronic device having a logic calculation function, such as a Personal Computer (PC), a tablet Computer, a smart phone, a Personal Digital Assistant (PDA), and the like.
In order to cooperate with the above hardware debugging execution method applied to the front-end command device, the embodiment of the present application further provides a hardware debugging execution device 40 applied to the front-end command device. Referring to fig. 6, fig. 6 is a block diagram of a hardware debug executing apparatus applied to a front-end command device according to an embodiment of the present disclosure.
The hardware debug execution apparatus 40 includes:
a front-end connection request sending module 41, configured to send a front-end connection request to the background relay server;
the connection return information receiving module 42 is configured to receive connection return information returned by the background relay server based on the front-end connection request, where the connection return information is used to indicate that the front-end command device and the hardware device have joined the WebSocket-based chat room;
the command sending module 43 is configured to send a hardware debugging command to a chat room of the background transfer server through WebSocket;
and the execution result receiving module 44 is configured to obtain a command execution result of the hardware debugging command from the chat room through the WebSocket, and send the command execution result to the chat room through the WebSocket by the hardware device.
Optionally, the hardware debugging execution apparatus 40 further includes: and the disconnection request sending module is used for sending a disconnection request to the chat room through the WebSocket so that the background transfer server destroys the chat room based on the disconnection request.
In order to cooperate with the above hardware debugging execution method applied to the background transit server, the embodiment of the present application further provides a hardware debugging execution device 50 applied to the background transit server. Referring to fig. 7, fig. 7 is a block diagram illustrating a hardware debugging execution device applied to a background transit server according to an embodiment of the present disclosure.
The hardware debug execution apparatus 50 includes:
a front-end connection request receiving module 51, configured to receive a front-end connection request sent by a front-end command device;
a chat room establishing module 52, configured to establish a chat room based on WebSocket;
a hardware connection request sending module 53, configured to send a hardware connection request to a hardware device based on the front-end connection request, so that the hardware device joins the chat room based on the hardware connection request;
the command forwarding module 54 is configured to receive a hardware debugging command sent by the background transfer server through the chat room, so that the hardware device obtains the hardware debugging command from the chat room through the WebSocket;
and the execution result forwarding module 55 is configured to receive, by the chat room, a command execution result sent by the hardware device, so that the front-end command device obtains the command execution result from the chat room through the WebSocket.
Optionally, the chat room establishing module 52 is specifically configured to: and creating an instance with a chat room function by using at least two client agents based on the WebSocket, taking the instance as the chat room, and processing the key information in the received message by the client agents based on the key value.
Optionally, the hardware debug executing apparatus 50 further includes: the chat room destroying module is used for receiving the disconnection request sent by the background transfer server through the chat room; destroying the chat room based on the disconnect request.
In order to cooperate with the above hardware debugging execution method applied to the hardware device, the embodiment of the present application further provides a hardware debugging execution device 60 applied to the hardware device. Referring to fig. 8, fig. 8 is a block diagram of a hardware debugging execution apparatus applied to a hardware device according to an embodiment of the present disclosure.
The hardware debug execution apparatus 60 includes:
a hardware connection request receiving module 61, configured to receive a hardware connection request sent by the background transit server;
a chat room connection module 62 for joining a chat room based on a hardware connection request;
the command receiving module 63 is configured to obtain a hardware debugging command from the chat room through the WebSocket, where the hardware debugging command is sent to the chat room through the WebSocket by the front-end command device;
and the execution result sending module 64 is configured to execute the hardware debugging command and send a command execution result of the hardware debugging command to the chat room through the WebSocket.
Optionally, the execution result sending module 64 is specifically configured to: starting a virtual terminal; and executing the hardware debugging command in a terminal command mode in the virtual terminal.
The embodiment of the application also provides a readable storage medium, wherein the readable storage medium stores computer program instructions, and the computer program instructions are read by a processor and run to execute the steps in the hardware debugging execution method.
To sum up, the embodiment of the present application provides a hardware debugging execution method, an apparatus, an electronic device, and a storage medium, where the hardware debugging execution method applied to a front-end command device includes: sending a front-end connection request to a background transfer server; receiving connection return information returned by the background transfer server based on the front-end connection request, wherein the connection return information is used for indicating that the front-end command device and the hardware device are added into a chat room based on WebSocket; sending a hardware debugging command to the chat room of the background transfer server through WebSocket; and acquiring a command execution result of the hardware debugging command from the chat room through WebSocket, wherein the command execution result is sent to the chat room by the hardware equipment through WebSocket.
In the implementation mode, data such as a hardware debugging command and a command execution result between the front-end command device and the hardware device are carried out through the WebSocket, other devices are remotely connected to run the hardware debugging command in the development process of the hardware device and after the hardware device is deployed, command output is obtained immediately, development cost is low, time delay of communication and debugging command execution feedback is reduced, and hardware debugging efficiency is improved. Meanwhile, the intelligent hardware only needs to run the network service of one WebSocket, the change of the existing system is small, and the change cost of the intelligent hardware is low.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus may be implemented in other manners. The apparatus embodiments described above are merely illustrative, and for example, the block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of devices according to various embodiments of the present application. In this regard, each block in the block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams, and combinations of blocks in the block diagrams, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, functional modules in the embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Therefore, the present embodiment further provides a readable storage medium, in which computer program instructions are stored, and when the computer program instructions are read and executed by a processor, the computer program instructions perform the steps of any of the block data storage methods. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a RanDom Access Memory (RAM), a magnetic disk, or an optical disk.
The above description is only an example of the present application and is not intended to limit the scope of the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application. It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.

Claims (12)

1. A hardware debugging execution method is applied to a front-end command device, and comprises the following steps:
sending a front-end connection request to a background transfer server;
receiving connection return information returned by the background transfer server based on the front-end connection request, wherein the connection return information is used for indicating that the front-end command device and the hardware device are added into a chat room based on WebSocket;
sending a hardware debugging command to the chat room of the background transfer server through WebSocket;
and acquiring a command execution result of the hardware debugging command from the chat room through WebSocket, wherein the command execution result is sent to the chat room by the hardware equipment through WebSocket.
2. The method of claim 1, wherein after the sending a hardware debug command to the chat room of the background transit server through WebSocket, the method further comprises:
and sending a disconnection request to the chat room through WebSocket so that the background transfer server destroys the chat room based on the disconnection request.
3. A hardware debugging execution method is applied to a background transit server, and comprises the following steps:
receiving a front-end connection request sent by front-end command equipment;
establishing a chat room based on WebSocket;
sending a hardware connection request to a hardware device based on the front-end connection request so that the hardware device joins the chat room based on the hardware connection request;
receiving a hardware debugging command sent by the background transfer server through the chat room so that the hardware device obtains the hardware debugging command from the chat room through WebSocket;
and receiving a command execution result sent by the hardware equipment through the chat room, so that the front-end command equipment can obtain the command execution result from the chat room through the WebSocket.
4. The method of claim 3, wherein establishing the chat room based on the WebSocket comprises:
and creating an instance with a chat room function by using at least two client agents based on WebSocket, taking the instance as the chat room, wherein the client agents are used for processing key information in the received messages based on key values.
5. The method of claim 3 or 4, wherein after receiving the command execution result sent by the hardware device through the chat room, the method further comprises:
receiving a disconnection request sent by the background transfer server through the chat room;
destroying the chat room based on the disconnect request.
6. A hardware debugging execution method is applied to a hardware device, and comprises the following steps:
receiving a hardware connection request sent by a background transfer server;
requesting to join a chat room based on the hardware connection;
acquiring a hardware debugging command from the chat room through WebSocket, wherein the hardware debugging command is sent to the chat room through WebSocket by a front-end command device;
and executing the hardware debugging command, and sending a command execution result of the hardware debugging command to the chat room through WebSocket.
7. The method of claim 6, wherein the executing the hardware debug command comprises:
starting a virtual terminal;
and running the hardware debugging command in the virtual terminal in a terminal command mode.
8. A hardware debugging execution device is applied to a front-end command device, and comprises:
the front-end connection request sending module is used for sending a front-end connection request to the background transfer server;
a connection return information receiving module, configured to receive connection return information returned by the background transit server based on the front-end connection request, where the connection return information is used to indicate that the front-end command device and the hardware device have joined a chat room based on WebSocket;
the command sending module is used for sending a hardware debugging command to the chat room of the background transfer server through WebSocket;
and the execution result receiving module is used for acquiring a command execution result of the hardware debugging command from the chat room through WebSocket, and the command execution result is sent to the chat room through WebSocket by the hardware equipment.
9. A hardware debugging execution device is applied to a background transit server, and the device comprises:
the front-end connection request receiving module is used for receiving a front-end connection request sent by the front-end command equipment;
the chat room establishing module is used for establishing a chat room based on WebSocket;
a hardware connection request sending module, configured to send a hardware connection request to a hardware device based on the front-end connection request, so that the hardware device joins the chat room based on the hardware connection request;
the command forwarding module is used for receiving a hardware debugging command sent by the background transfer server through the chat room so that the hardware device obtains the hardware debugging command from the chat room through WebSocket;
and the execution result forwarding module is used for receiving the command execution result sent by the hardware device through the chat room, so that the front-end command device can obtain the command execution result from the chat room through the WebSocket.
10. A hardware debugging execution device is applied to hardware equipment, and the device comprises:
the hardware connection request receiving module is used for receiving a hardware connection request sent by the background transfer server;
the chat room connecting module is used for joining the chat room based on the hardware connection request;
the command receiving module is used for acquiring a hardware debugging command from the chat room through WebSocket, and the hardware debugging command is sent to the chat room through WebSocket by front-end command equipment;
and the execution result sending module is used for executing the hardware debugging command and sending the command execution result of the hardware debugging command to the chat room through WebSocket.
11. An electronic device comprising a memory having stored therein program instructions and a processor that, when executed, performs the steps of the method of any of claims 1-7.
12. A storage medium having stored thereon computer program instructions for executing the steps of the method according to any one of claims 1 to 7 when executed by a processor.
CN202010829662.5A 2020-08-17 2020-08-17 Hardware debugging execution method and device, electronic equipment and storage medium Pending CN111970364A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010829662.5A CN111970364A (en) 2020-08-17 2020-08-17 Hardware debugging execution method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010829662.5A CN111970364A (en) 2020-08-17 2020-08-17 Hardware debugging execution method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN111970364A true CN111970364A (en) 2020-11-20

Family

ID=73387834

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010829662.5A Pending CN111970364A (en) 2020-08-17 2020-08-17 Hardware debugging execution method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111970364A (en)

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104298591A (en) * 2013-07-18 2015-01-21 阿里巴巴集团控股有限公司 WebApp remote debugging method and system
CN105959160A (en) * 2016-07-01 2016-09-21 瑞斯康达科技发展股份有限公司 Debugging information transmission method and apparatus
US20160344599A1 (en) * 2015-05-22 2016-11-24 Microsoft Technology Licensing, Llc Connection management between applications and service resources
CN106201745A (en) * 2016-07-08 2016-12-07 深圳中兴网信科技有限公司 The remote debugging method of application program, remote debugging system and terminal
CN106254436A (en) * 2016-07-28 2016-12-21 腾讯科技(深圳)有限公司 A kind of method of remote debugging, relevant device and system
CN106506644A (en) * 2016-11-07 2017-03-15 深圳市共进电子股份有限公司 Terminal Debugging message collection method and system
CN106598803A (en) * 2016-04-29 2017-04-26 福建先创通信有限公司 Method for remotely monitoring operation of host system
CN108011883A (en) * 2017-12-05 2018-05-08 深圳市创维软件有限公司 A kind of remote debugging method, terminal device and server
CN109117361A (en) * 2018-06-21 2019-01-01 腾讯科技(深圳)有限公司 A kind of remote debugging method of small routine, relevant device and system
US20190020673A1 (en) * 2017-07-11 2019-01-17 Viaforensics, Llc Methods and apparatuses for improved mobile app security testing via bridged native and web user interface interaction
CN109344065A (en) * 2018-09-27 2019-02-15 迈普通信技术股份有限公司 Remote debugging method, debugging server and target machine

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104298591A (en) * 2013-07-18 2015-01-21 阿里巴巴集团控股有限公司 WebApp remote debugging method and system
US20160344599A1 (en) * 2015-05-22 2016-11-24 Microsoft Technology Licensing, Llc Connection management between applications and service resources
CN106598803A (en) * 2016-04-29 2017-04-26 福建先创通信有限公司 Method for remotely monitoring operation of host system
CN105959160A (en) * 2016-07-01 2016-09-21 瑞斯康达科技发展股份有限公司 Debugging information transmission method and apparatus
CN106201745A (en) * 2016-07-08 2016-12-07 深圳中兴网信科技有限公司 The remote debugging method of application program, remote debugging system and terminal
CN106254436A (en) * 2016-07-28 2016-12-21 腾讯科技(深圳)有限公司 A kind of method of remote debugging, relevant device and system
CN106506644A (en) * 2016-11-07 2017-03-15 深圳市共进电子股份有限公司 Terminal Debugging message collection method and system
US20190020673A1 (en) * 2017-07-11 2019-01-17 Viaforensics, Llc Methods and apparatuses for improved mobile app security testing via bridged native and web user interface interaction
CN108011883A (en) * 2017-12-05 2018-05-08 深圳市创维软件有限公司 A kind of remote debugging method, terminal device and server
CN109117361A (en) * 2018-06-21 2019-01-01 腾讯科技(深圳)有限公司 A kind of remote debugging method of small routine, relevant device and system
CN109344065A (en) * 2018-09-27 2019-02-15 迈普通信技术股份有限公司 Remote debugging method, debugging server and target machine

Similar Documents

Publication Publication Date Title
CN102457565B (en) The method of mobile terminal network visiting and proxy server
CN104967542B (en) A kind of test method, the device and system of the mobile terminal page
CN106649024A (en) Method and device for real-time monitoring of application performance
CN115297183A (en) Data processing method and device, electronic equipment and storage medium
CN105450479A (en) Method and apparatus for monitoring module
CN118250324A (en) Internet of Things device interaction management method, device and system
CN111163155A (en) Reconciliation file transmission method, system, server and storage medium
CN117519753A (en) Remote upgrading method, device and equipment of terminal equipment and storage medium
CN115883647B (en) Business log recording method, system, device, terminal, server and medium
CN114006916A (en) Method, device and system for collecting device logs
CN111970364A (en) Hardware debugging execution method and device, electronic equipment and storage medium
JP2009110041A (en) Web screen sharing system, sharing terminal and sharing program
CN114297062A (en) Service testing method and device, electronic equipment and storage medium
CN113590243A (en) Energy enterprise project creation method and device, computer equipment and medium
JP2006085623A (en) Web monitoring system, data processing method, and monitored device
CN118210674A (en) Application request tracking method, system, equipment and medium
CN117938891A (en) Environmental monitoring method, device, electronic equipment and storage medium
HK1204695A1 (en) Method for webpage sharing, device and system thereof
CN108924773A (en) Message treatment method and device
CN103647812A (en) A method and an apparatus for displaying a picture on different terminal devices
CN110548285B (en) Game communication control method and device, medium and electronic equipment
CN107682432A (en) Data handling system and method based on Spark
CN109981738B (en) A cloud server suitable for narrowband IoT applications
CN101917476A (en) Hyper text transmission protocol (HTTP) message processing method and client system thereof
CN114466401A (en) Image transmission method and electronic 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
RJ01 Rejection of invention patent application after publication

Application publication date: 20201120

RJ01 Rejection of invention patent application after publication