Search

CN-122027395-A - Remote debugging method, first terminal, second terminal, equipment and storage medium

CN122027395ACN 122027395 ACN122027395 ACN 122027395ACN-122027395-A

Abstract

The disclosure provides a remote debugging method, a first terminal, a second terminal, equipment and a storage medium, and relates to the technical field of computers, in particular to the fields of mobile computing, network security, remote operation and maintenance and the like. The method comprises the steps that a first terminal initiates a registration request to a server deployed in a public network based on a built-in WireGuard kernel module, the first terminal receives a WireGuard configuration file issued by the server through the WireGuard kernel module, the first terminal joins a virtual debugging local area network under the condition that the first terminal loads the WireGuard configuration file through the WireGuard kernel module, remote debugging is conducted under the condition that the first terminal is in direct communication with at least one second terminal, wherein the first terminal is a terminal to be debugged, and the at least one second terminal comprises a terminal used by a developer or a terminal used by operation staff.

Inventors

  • CHU JIAQI
  • ZHANG CHAO

Assignees

  • 北京百度网讯科技有限公司

Dates

Publication Date
20260512
Application Date
20260120

Claims (17)

  1. 1. A remote debugging method, comprising: the first terminal initiates a registration request to a server deployed in a public network based on a built-in WireGuard kernel module; the first terminal receives WireGuard configuration files issued by the server through the WireGuard kernel module; Under the condition that the first terminal loads the WireGuard configuration file through the WireGuard kernel module, the first terminal is added into a virtual debugging local area network according to the WireGuard configuration file; The first terminal is used for remote debugging under the condition of being configured to directly communicate with at least one second terminal joining the virtual debugging local area network, wherein the first terminal is a terminal to be debugged, and the at least one second terminal comprises a terminal used by a developer or a terminal used by an operation and maintenance personnel.
  2. 2. The method of claim 1, wherein the first terminal joining a virtual debug local area network according to the WireGuard configuration file with the WireGuard configuration file loaded through the WireGuard kernel module, comprises: The first terminal extracts a virtual IP address and a secret key corresponding to the virtual debugging local area network from the WireGuard configuration file; The first terminal automatically establishes a VPN tunnel according to the virtual IP address and the secret key, wherein the VPN tunnel is a proprietary VPN encryption tunnel generated based on WireGuard protocols; and the first terminal joins the virtual debugging local area network according to the private VPN encryption tunnel.
  3. 3. The method of claim 1 or 2, further comprising: The first terminal activates at least one debugging service port in the virtual debugging local area network; the first terminal opens at least one debugging link according to the at least one debugging service port; the first terminal establishes a connection with the at least one second terminal according to the at least one debug link to communicate directly with the at least one second terminal in the virtual debug local area network.
  4. 4. The method of claim 3, wherein the first terminal is deployed in an intranet or a closed network that is not in communication with an extranet, and the at least one second terminal is deployed in the extranet.
  5. 5. The method of any of claims 1-4, wherein the WireGuard kernel module is integrated with the first terminal in the form of a software development kit, or in the form of a WireGuard client.
  6. 6. The method of any of claims 1-4, further comprising: And integrating the WireGuard kernel module through a system application programming interface under the condition that the first terminal is Android equipment.
  7. 7. The method of claim 6, wherein the Android device comprises at least one of a self-service terminal, a smart gate inhibition, a conference integrated machine, and an industrial tablet.
  8. 8. A remote debugging method, comprising: The server is configured to add at least one second terminal into the same virtual debugging local area network as the first terminal, wherein the first terminal is a terminal to be debugged, and the at least one second terminal comprises a terminal used by a developer or a terminal used by an operation and maintenance personnel; The at least one second terminal communicates directly with the first terminal in the virtual debug local area network; and the at least one second terminal remotely debugs the first terminal according to the debugging command.
  9. 9. The method of claim 8, wherein the at least one second terminal is configured by the server to join the same virtual debug local area network as the first terminal, comprising: The at least one second terminal receives WireGuard configuration files uniformly coordinated by the server based on a built-in WireGuard kernel module, wherein the WireGuard configuration files are WireGuard configuration files which are the same as those issued by the server to the first terminal; the at least one second terminal extracts a virtual IP address and a secret key corresponding to the virtual debugging local area network from the WireGuard configuration file; The at least one second terminal automatically establishes a VPN tunnel according to the virtual IP address and the secret key, wherein the VPN tunnel is a proprietary VPN encryption tunnel generated based on WireGuard protocols; And the at least one second terminal joins the virtual debugging local area network according to the private VPN encryption tunnel.
  10. 10. The method of claim 8 or 9, wherein the at least one second terminal communicates directly with the first terminal in the virtual debug local area network, comprising: the at least one second terminal establishes a connection with the first terminal through at least one debug link, and communicates directly with the first terminal in the virtual debug local area network; The at least one debug link is a debug link which is started by the first terminal after the at least one debug service port is activated by the virtual debug local area network.
  11. 11. The method according to claim 8 or 9, wherein the at least one second terminal remotely debugs the first terminal according to a debug command, comprising: and the at least one second terminal calls an Android debug bridge or a secure shell protocol tool through an integrated development environment so as to remotely debug the first terminal.
  12. 12. The method of any of claims 9-11, wherein the WireGuard kernel module is integrated with the first terminal in the form of a software development kit, or in the form of a WireGuard client.
  13. 13. A first terminal, comprising: The sending module is used for initiating a registration request to a server deployed in the public network based on a WireGuard kernel module built in the first terminal; The receiving module is used for receiving the WireGuard configuration file issued by the server through the WireGuard kernel module; the network access module is used for adding a virtual debugging local area network according to the WireGuard configuration file under the condition that the WireGuard configuration file is loaded through the WireGuard kernel module; The remote debugging module is used for carrying out remote debugging under the condition that a first terminal is configured to be in direct communication with at least one second terminal joining the virtual debugging local area network, wherein the first terminal is a terminal to be debugged, and the at least one second terminal comprises a terminal used by a developer or a terminal used by operation and maintenance personnel.
  14. 14. A second terminal, comprising: the configuration module is used for configuring at least one second terminal to be added into the same virtual debugging local area network by the server, wherein the first terminal is a terminal to be debugged, and the at least one second terminal comprises a terminal used by a developer or a terminal used by operation and maintenance personnel; the communication module is used for directly communicating with the first terminal in the virtual debugging local area network; and the debugging module is used for remotely debugging the first terminal according to the debugging command.
  15. 15. An electronic device, comprising: at least one processor, and A memory communicatively coupled to the at least one processor, wherein, The memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-12.
  16. 16. A non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the method of any one of claims 1-12.
  17. 17. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any of claims 1-12.

Description

Remote debugging method, first terminal, second terminal, equipment and storage medium Technical Field The present disclosure relates to the field of computer technology, and in particular, to the fields of mobile computing, network security, remote operation and maintenance, and the like. Background In order to avoid the unsafe exposure of traditional intelligent hardware devices (such as intelligent access control, intelligent terminals, control devices of the internet of things and the like) in public internet environments, the traditional intelligent hardware devices are usually deployed in an enterprise intranet or a closed network, so that the traditional intelligent hardware devices cannot be directly accessed by external developers or operation and maintenance personnel for remote debugging and maintenance, and the intelligent hardware devices can be directly accessed by the external developers or the operation and maintenance personnel in any public internet environments. Disclosure of Invention The disclosure provides a remote debugging method, a first terminal, a second terminal, equipment and a storage medium. According to one aspect of the disclosure, a remote debugging method is provided, and the remote debugging method comprises the steps that a first terminal initiates a registration request to a server deployed on a public network based on a built-in WireGuard kernel module, the first terminal receives a WireGuard configuration file issued by the server through a WireGuard kernel module, the first terminal adds a virtual debugging local area network according to the WireGuard configuration file under the condition that the first terminal loads the WireGuard configuration file through the WireGuard kernel module, the first terminal carries out remote debugging under the condition that the first terminal is configured to directly communicate with at least one second terminal added to the virtual debugging local area network, the first terminal is a terminal to be debugged, and the at least one second terminal comprises a terminal used by a developer or a terminal used by operation and maintenance personnel. According to another aspect of the disclosure, a remote debugging method is provided, wherein at least one second terminal is configured by a server to join the same virtual debugging local area network as a first terminal, the first terminal is a terminal to be debugged, the at least one second terminal comprises a terminal used by a developer or a terminal used by operation and maintenance personnel, the at least one second terminal is in direct communication with the first terminal in the virtual debugging local area network, and the at least one second terminal carries out remote debugging on the first terminal according to a debugging command. According to another aspect of the disclosure, a first terminal is provided, which comprises a sending module, a receiving module, a network access module and a remote debugging module, wherein the sending module is used for sending a registration request to a server deployed on a public network based on a WireGuard kernel module built in the first terminal, the receiving module is used for receiving a WireGuard configuration file issued by the server through a WireGuard kernel module, the network access module is used for adding a virtual debugging local area network according to the WireGuard configuration file when the WireGuard configuration file is loaded through the WireGuard kernel module, the remote debugging module is used for conducting remote debugging when the first terminal is configured to be in direct communication with at least one second terminal added into the virtual debugging local area network, and the first terminal is a terminal to be debugged, and the at least one second terminal comprises a terminal used by a developer or a terminal used by an operation and maintenance person. According to another aspect of the disclosure, a second terminal is provided, which comprises a configuration module, a communication module and a debugging module, wherein the configuration module is used for at least one second terminal to be configured by a server to join the same virtual debugging local area network as a first terminal, the first terminal is a terminal to be debugged, the at least one second terminal comprises a terminal used by a developer or a terminal used by an operation and maintenance personnel, the communication module is used for directly communicating with the first terminal in the virtual debugging local area network, and the debugging module is used for remotely debugging the first terminal according to a debugging command. According to another aspect of the present disclosure, there is provided an electronic device including: at least one processor, and A memory communicatively coupled to the at least one processor, wherein, The memory stores instructions executable by the at least one processor to enable the at lea