CN115348020A - Device connection method and device debugging method - Google Patents

Device connection method and device debugging method Download PDF

Info

Publication number
CN115348020A
CN115348020A CN202210981024.4A CN202210981024A CN115348020A CN 115348020 A CN115348020 A CN 115348020A CN 202210981024 A CN202210981024 A CN 202210981024A CN 115348020 A CN115348020 A CN 115348020A
Authority
CN
China
Prior art keywords
key pair
debugging
debugged
equipment
secret key
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
CN202210981024.4A
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.)
Ecarx Hubei Tech Co Ltd
Original Assignee
Ecarx Hubei Tech 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 Ecarx Hubei Tech Co Ltd filed Critical Ecarx Hubei Tech Co Ltd
Priority to CN202210981024.4A priority Critical patent/CN115348020A/en
Publication of CN115348020A publication Critical patent/CN115348020A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/30Public key, i.e. encryption algorithm being computationally infeasible to invert or user's encryption keys not requiring secrecy
    • H04L9/3006Public key, i.e. encryption algorithm being computationally infeasible to invert or user's encryption keys not requiring secrecy underlying computational problems or public-key parameters
    • H04L9/302Public key, i.e. encryption algorithm being computationally infeasible to invert or user's encryption keys not requiring secrecy underlying computational problems or public-key parameters involving the integer factorization problem, e.g. RSA or quadratic sieve [QS] schemes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • 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
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/16Implementing security features at a particular protocol layer
    • H04L63/168Implementing security features at a particular protocol layer above the transport layer

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computing Systems (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The application discloses a device connection method and device and a device debugging method. Wherein, the method comprises the following steps: generating a secret key pair, wherein the secret key pair comprises a first secret key pair and a second secret key pair, and the first secret key pair and the second secret key pair respectively comprise a public key and a private key; the method comprises the steps of sending a public key of a first secret key pair and a private key of a second secret key pair to a debugging server, sending the private key of the first secret key pair and the public key of the second secret key pair to equipment to be debugged, and sending the private key of the first secret key pair to terminal equipment, wherein the debugging server is used for debugging the equipment to be debugged, the first secret key pair is used for achieving data interaction of the debugging server and the equipment to be debugged, and the second secret key pair is used for achieving data interaction of the equipment to be debugged and the terminal equipment. The method and the device solve the technical problems of low efficiency and high cost of solving the problems caused by the fact that research and development personnel still need to debug the equipment locally when the problems occur in the prior art.

Description

Device connection method and device debugging method
Technical Field
The application relates to the field of equipment connection, in particular to the field of data interaction in different local area networks and remote debugging, and relates to an equipment connection method and device and an equipment debugging method.
Background
Aiming at the current vehicle-mounted system, when the system of a client has problems, research personnel needs to debug the equipment locally to troubleshoot the problems; the uncertainty of the position of the equipment to be debugged causes time and labor waste when going on business; in addition, if the problem occurs in an abnormal scene, research and development personnel cannot necessarily be guaranteed to arrive at the site, and therefore the local debugging of the equipment by the research and development personnel causes low efficiency and high cost of debugging the equipment. In view of the above problems, no effective solution has been proposed.
Disclosure of Invention
The embodiment of the application provides a device connection method and device and a device debugging method, so as to at least solve the technical problems of low efficiency and high cost of solving the problems caused by the fact that in the prior art, when a problem occurs, research personnel still need to debug the device locally.
According to an aspect of an embodiment of the present application, there is provided a method for connecting devices, including: generating a secret key pair, wherein the secret key pair comprises a first secret key pair and a second secret key pair, and the first secret key pair and the second secret key pair respectively comprise a public key and a private key; the method comprises the steps of sending a public key of a first secret key pair and a private key of a second secret key pair to a debugging server, sending the private key of the first secret key pair and the public key of the second secret key pair to equipment to be debugged, and sending the private key of the first secret key pair to terminal equipment, wherein the debugging server is used for debugging the equipment to be debugged, the first secret key pair is used for realizing data interaction of the debugging server and the equipment to be debugged, and the second secret key pair is used for realizing data interaction of the equipment to be debugged and the terminal equipment.
Optionally, the sending the private key of the first secret key pair and the public key of the second secret key pair to the device to be debugged, and after sending the private key of the first secret key pair to the terminal device, includes: establishing connection between a debugging server and equipment to be debugged based on the key pair; and establishing connection between the debugging server and the terminal equipment based on the key pair so as to establish connection between the equipment to be debugged and the terminal equipment.
Optionally, establishing a connection between the debugging server and the device to be debugged based on the key pair includes: starting a server program through a public key of a second key pair, and starting a client program through a private key of a first key pair, wherein the server program and the client program are programs based on a secure shell protocol; based on the private key of the first private key pair and the public key of the first private key pair, the device to be debugged is enabled to proxy to the debugging server reversely through the target port by the server-side program and the client-side program, wherein the target port is any unoccupied port on the device to be debugged.
Optionally, establishing a connection between the debugging server and the terminal device based on the key pair includes: establishing connection between the terminal equipment and the debugging server based on a private key of the first private key pair and a public key of the first private key pair; and connecting the terminal equipment with a target port on the equipment to be debugged through a private key of the second private key pair.
Optionally, generating a key pair comprises: receiving a debugging instruction issued by an equipment management platform, wherein the debugging instruction is used for indicating equipment to be debugged; and randomly generating a key pair under the triggering of the debugging instruction.
Optionally, the connection method of the device further includes: receiving a debugging stopping instruction issued by the equipment management platform, wherein the debugging stopping instruction is used for indicating to stop debugging the equipment to be debugged; responding to a debugging stopping instruction, closing a server program and a client program which are locally operated by the equipment to be debugged, wherein the server program and the client program are programs based on a secure shell protocol; and deleting the key pair locally stored in the equipment to be debugged and the debugging server.
According to another aspect of the embodiments of the present application, there is provided a method for debugging a device, including: receiving a public key of a first secret key pair and a private key of a second secret key pair; establishing connection between a debugging server and terminal equipment by adopting a first key pair, and establishing connection between the debugging server and equipment to be debugged by adopting a second key pair; and receiving a debugging instruction from the terminal equipment, and forwarding the debugging instruction to the equipment to be debugged, wherein the debugging instruction is used for debugging the equipment to be debugged.
According to another aspect of the embodiments of the present application, there is also provided a connection device of an apparatus, including: the device comprises a generating module, a generating module and a sending module, wherein the generating module is used for generating a secret key pair, the secret key pair comprises a first secret key pair and a second secret key pair, and the first secret key pair and the second secret key pair respectively comprise a public key and a private key; the transmission module is used for transmitting a public key of the first secret key pair and a private key of the second secret key pair to the debugging server, transmitting the private key of the first secret key pair and the public key of the second secret key pair to the equipment to be debugged, and transmitting the private key of the first secret key pair to the terminal equipment, wherein the debugging server is used for debugging the equipment to be debugged, the first secret key pair is used for realizing data interaction between the debugging server and the equipment to be debugged, and the second secret key pair is used for realizing data interaction between the equipment to be debugged and the terminal equipment.
According to another aspect of the embodiments of the present application, there is also provided a nonvolatile storage medium, in which the nonvolatile storage medium includes a stored program, and in which, when the program is executed, a device in which the nonvolatile storage medium is located is controlled to execute the method for connecting the device and the method for debugging the device.
According to another aspect of the embodiments of the present application, there is also provided a processor configured to run a program stored in a memory, where the program performs the method for connecting a device and the method for debugging a device described above when running.
In the embodiment of the application, a key pair is generated, wherein the key pair comprises a first key pair and a second key pair, and the first key pair and the second key pair respectively comprise a public key and a private key; the method comprises the steps of sending a public key of a first secret key pair and a private key of a second secret key pair to a debugging server, sending the private key of the first secret key pair and the public key of the second secret key pair to equipment to be debugged, and sending the private key of the first secret key pair to terminal equipment, wherein the debugging server is used for debugging the equipment to be debugged, the first secret key pair is used for realizing data interaction between the debugging server and the equipment to be debugged, the second secret key pair is used for realizing the data interaction between the equipment to be debugged and the terminal equipment, and the connection between the equipment to be debugged and the terminal equipment is realized through the two secret key pairs, so that the aim of carrying out data interaction between the equipment to be debugged and the terminal equipment is fulfilled, the technical effect of carrying out remote debugging in different local area networks is realized, and the technical problems caused by the fact that in the prior art, research and development personnel still need to debug the equipment locally are solved with low efficiency and high cost.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
fig. 1 is a flowchart of a method for connecting devices according to an embodiment of the present application;
FIG. 2 is a schematic diagram of a stop commissioning device according to an embodiment of the present application;
FIG. 3 is a flow chart of a method for commissioning a device according to an embodiment of the present application;
FIG. 4 is a schematic diagram of a connection device of an apparatus according to an embodiment of the present application;
fig. 5 is a schematic diagram of a device management platform sending a key pair to each device according to an embodiment of the present application;
FIG. 6 is a schematic diagram of various device connections according to an embodiment of the present application.
Detailed Description
In order to make the technical solutions of the present application better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only some embodiments of the present application, and not all embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present application without making any creative effort shall fall within the protection scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of this application and in the accompanying drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It should be understood that the data so used may be interchanged under appropriate circumstances such that embodiments of the application described herein may be implemented in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
First, some terms or terms appearing in the description of the embodiments of the present application are applicable to the following explanations:
and (4) SSH: a security protocol (secure shell protocol) built on an application layer basis;
a shell: the computer shell layer is used for indicating software for providing an operation interface for a user, receiving a user command and calling a corresponding application program;
reverse proxy: the proxy server receives a network access connection request of the client, then forwards the request to a service server which actually works in the network in a policy manner, and returns a result processed by the service server to the client which initiates the connection request on the network;
ssh client: is a program for logging onto a remote computer and executing commands on the remote computer;
openSSH: the method is based on a client/server working mode, is used for running a safe shell on a remote system, and has two authentication modes of password authentication and secret key pair authentication;
sshd: and the service process is used for realizing the connection request of the remote SSH client side, and carrying out encryption authentication processing on the request.
It should be noted that the method for connecting and debugging the device is implemented by a reverse proxy manner of openSSH, so that only the debugging device is required to integrate the customized openSSH framework in practical application. When the method is implemented, the following requirements are required: a computer (terminal equipment) of a developer supports ssh client connection; debugging the server: the server is a server which has a public network address and supports ssh servers (ssh servers) and ssh clients.
In accordance with an embodiment of the present application, there is provided a method for connecting devices, where the steps illustrated in the flowcharts of the figures may be executed in a computer system, such as a set of computer executable instructions, and where a logical order is illustrated in the flowcharts, in some cases, the steps illustrated or described may be executed in an order different from that described herein.
Fig. 1 is a flowchart of a connection method of a device according to an embodiment of the present application, and as shown in fig. 1, the method includes the steps of:
step S102, generating a secret key pair, where the secret key pair includes a first secret key pair and a second secret key pair, and the first secret key pair and the second secret key pair respectively include a public key and a private key.
In step S102, a key pair is generated by the device management platform; the device management platform and the device to be debugged have a communication relation, and a unique identifier representing the device to be debugged is stored in the device management platform and is represented by a device number (deviceID); the device management platform records the online information and the offline information of all devices including the device to be debugged, and controls the devices, such as upgrading and restarting the devices. The target object logs in through a website of the equipment management platform, finds the equipment to be debugged according to the equipment number (deviceID) and starts a debugging mode, and then the equipment management platform generates two sets of RSA secret keys through a public key encryption algorithm (RSA algorithm), wherein each set of secret key comprises a public key and a private key uniquely corresponding to the public key.
Step S104, sending a public key of the first secret key pair and a private key of the second secret key pair to a debugging server, sending a private key of the first secret key pair and a public key of the second secret key pair to equipment to be debugged, and sending a private key of the first secret key pair to terminal equipment, wherein the debugging server is used for debugging the equipment to be debugged, the first secret key pair is used for realizing data interaction between the debugging server and the equipment to be debugged, and the second secret key pair is used for realizing data interaction between the equipment to be debugged and the terminal equipment.
In step S104, the keys generated in step S102 are respectively sent to corresponding devices, a public key of the first secret key pair is represented by A1, a private key of the first secret key pair is represented by A2, a public key of the second secret key pair is represented by B1, and a private key of the second secret key pair is represented by B2; respectively send A1 to the debugging server, send A2 to terminal equipment and the equipment that waits to debug, send B1 to the equipment that waits to debug to and send B2 to the debugging server, because above-mentioned key pair is based on the RSA algorithm generates, and the key pair has only correspondence, consequently, can carry out the connection debugging based on Secure Shell (SSH) to equipment through the mode of sending the RSA key.
Through the steps, the method for connecting and debugging the equipment is provided, so that the purpose of connecting the equipment in different local area networks can be achieved, and the technical effect of remotely debugging the equipment in different local area networks is achieved.
According to an optional embodiment of the present application, after sending the private key of the first private key pair and the public key of the second private key pair to the device to be debugged and sending the private key of the first private key pair to the terminal device, a connection between the debugging server and the device to be debugged needs to be established based on the private key pairs; and establishing connection between the debugging server and the terminal equipment based on the key pair so as to establish connection between the equipment to be debugged and the terminal equipment.
In this embodiment, since in step S104, A2 and B1 are sent to the device to be debugged, A1 and B2 are sent to the debugging server, and A2 is sent to the terminal device, on the basis that the key pair has a unique corresponding characteristic, the connection between the device to be debugged and the debugging server is realized by pairing B1 and B2, and the connection between the terminal device and the debugging server is established by pairing A1 and A2; and based on the operation, the equipment to be debugged and the terminal equipment are connected with the server to be debugged, so that the connection between the terminal equipment and the equipment to be debugged can be realized in the following.
According to another optional embodiment of the present application, establishing a connection between a debugging server and a device to be debugged based on a key pair includes the following steps: starting a server program through a public key of a second key pair, and starting a client program through a private key of a first key pair, wherein the server program and the client program are programs based on a secure shell protocol; based on the private key of the first secret key pair and the public key of the first secret key pair, the device to be debugged is enabled to reversely proxy to the debugging server through the target port through the server program and the client program, wherein the target port is any unoccupied port on the device to be debugged.
In this embodiment, to connect the debugging server to the device to be debugged, the following operations need to be performed: the device to be debugged starts the sshd server process (namely, the server program) by using the B1, starts the ssh process (namely, the client program) by using the A2, and logs in (connects) the debugging server through any unoccupied port (namely, a target port) in the debugging server; after the device to be debugged starts the sshd server process using B1, because the device to be debugged cannot access the IP of the device to be debugged in the local area network in a conventional manner, the device to be debugged is reversely proxied through the private key A2 ssh of the debugging server, connected with any unoccupied port of the debugging server, and logs onto the debugging server to realize the connection with the debugging server, for example, the device to be debugged may be connected with the debugging server through the proxy port 5822.
According to another alternative embodiment of the present application, establishing a connection between a debugging server and a terminal device based on a key pair includes: establishing connection between the terminal equipment and the debugging server based on a private key of the first secret key pair and a public key of the first secret key pair; and connecting the terminal equipment with a target port on the equipment to be debugged through a private key of the second private key pair.
In this embodiment, to implement connection between the terminal device and the debug server, the following operations need to be performed: the terminal equipment logs in the debugging server through a private key A2 of the debugging server to realize the connection with the debugging server; since the debugging server possesses the private key B2 of the device to be debugged, the terminal device connects the port to which the device to be debugged is connected through ssh B2, for example, if the device to be debugged is connected to the debugging server through the proxy port 5822, the terminal device is also connected to the proxy port 5822 at this time.
According to some alternative embodiments of the present application, generating the key pair comprises: receiving a debugging instruction issued by an equipment management platform, wherein the debugging instruction is used for indicating the debugging of equipment to be debugged; and randomly generating a key pair under the triggering of the debugging instruction.
In some optional embodiments, the key pair mentioned above is generated by the device management platform under a preset condition, for example, in some preferred embodiments, when a developer logs in through a website of the device management platform by using a terminal device, finds a device to be debugged through a deviceID, and clicks to start a remote debugging mode, the device management platform randomly generates two sets of RSA public and private keys through an RSA algorithm.
It should be further noted that, in the embodiments of the present application, the RSA-verified password-free login is used, because the principle of the RSA encryption algorithm is as follows: the result of multiplying two prime numbers is disclosed as an encryption key, and because factorization of the product is difficult, the effect of ensuring safety can be realized; in the embodiment of the present application, the key file is changed every time the debugging is performed, and the ssh connection is encrypted by using the 2048-bit RSA key communication, so that the security of the communication between the devices is ensured.
According to an optional embodiment of the present application, the method for connecting devices further includes: receiving a debugging stopping instruction issued by the equipment management platform, wherein the debugging stopping instruction is used for indicating to stop debugging the equipment to be debugged; responding to a debugging stopping instruction, closing a server program and a client program which are locally operated by the equipment to be debugged, wherein the server program and the client program are programs based on a secure shell protocol; and deleting the key pair locally stored in the equipment to be debugged and the debugging server.
In this embodiment, if the device management platform selects to close the debugging function after finding the device to be debugged through the deviceID, the device management platform issues a debugging stop instruction to the debugging server and the device to be debugged. After receiving the debugging stopping instruction, the debugging server executes the following operations: delete A1 to prevent the device owning A2 from logging in to the debug server without password, while clearing B2. After the debugging stopping instruction is received by the equipment to be debugged, the following operations are executed: firstly, stopping the ssh process and the sshd process, and then deleting A2 and B1; after the above operation, unless the terminal device is connected to the device to be debugged again by using the above device connection method, the terminal device can no longer debug the device to be debugged.
Fig. 2 is a schematic diagram of a device stopping debugging according to an embodiment of the present application, for example, in the process of stopping debugging in the specific implementation, as shown in fig. 2, a developer logs in a device management platform, finds the device through a deviceID, and closes a debugging function, then a debugging server and a debugged device delete an RSA key, and the debugged device stops ssh and sshd processes at the same time, so far, the developer cannot log in the debugging server and the debugged device through ssh without password, and complete the debugging function, and because ssh and sshd services of the debugged device stop working, no additional load is generated on the device.
Fig. 3 is a flowchart of a method for debugging a device according to an embodiment of the present application, where the method shown in fig. 3 includes the following steps:
in step S302, a public key of a first key pair and a private key of a second key pair are received.
In step S202, the debug server receives A1 and B2 sent by the device management platform and writes them into the relevant file, where A1 represents the public key of the first key pair and B2 represents the private key of the second key pair. For example, in one implementation, the debug server writes A1 to a folder under the root directory, e.g., to Ssh/authorized _ keys in this folder; place B2 under the user's root directory, e.g., to Ssh/id _ rsa in this folder.
Step S304, the connection between the debugging server and the terminal equipment is established by adopting the first key pair, and the connection between the debugging server and the equipment to be debugged is established by adopting the second key pair.
In step S204, since the terminal device has A2 and the device to be debugged has B1, the terminal device uses A1 to pair with A2 of the debugging server, logs in the debugging server without a password, and establishes a connection between the debugging server and the terminal device; the debugging server is matched with the B2 and the B1 of the equipment to be debugged, and logs in the equipment to be debugged without a password through reverse proxy to realize the connection between the debugging server and the equipment to be debugged; and finally, the connection between the terminal equipment and the equipment to be debugged is realized through the operation.
Step S306, receiving a debugging instruction from the terminal device, and forwarding the debugging instruction to the device to be debugged, wherein the debugging instruction is used for debugging the device to be debugged.
In step S306, since the connection between the terminal device and the device to be debugged is finally realized by using the debugging server as a medium, the debugging server receives the instruction of the terminal device to debug the device to be debugged, and forwards the instruction to the device to be debugged to realize the purpose of debugging the device to be debugged. For example, in a specific implementation, after a developer connects a device to be debugged through an opennsh reverse proxy, the developer debugs the device to be debugged using rich commands of the shell terminal, such as a top command indicating resource occupation status of each process in a real-time display system, a dumpsys command indicating diagnosis of a user system and providing system service state information, an am command indicating operations of opening or closing a process, sending a broadcast, and the like, and a cat command indicating a display file, a creation file, and a merge file.
Through the steps, the technical effect of remotely debugging the equipment in different local area networks can be achieved.
Fig. 4 is a schematic structural diagram of a connection device of an apparatus according to an embodiment of the present application, and as shown in fig. 4, the device includes:
a generating module 40, configured to generate a key pair, where the key pair includes a first key pair and a second key pair, and the first key pair and the second key pair respectively include a public key and a private key;
the sending module 42 is configured to send a public key of the first secret key pair and a private key of the second secret key pair to the debugging server, send a private key of the first secret key pair and a public key of the second secret key pair to the device to be debugged, and send a private key of the first secret key pair to the terminal device, where the debugging server is configured to debug the device to be debugged, the first secret key pair is used for realizing data interaction between the debugging server and the device to be debugged, and the second secret key pair is used for realizing data interaction between the device to be debugged and the terminal device.
In this embodiment, a connection apparatus of devices is provided, fig. 5 is a schematic diagram of sending a key pair to each device by a device management platform, a sending module 42 executes a flow shown in fig. 5, a terminal device sends A1, A2, B1, and B2 to the device management platform, the device management platform sends A1 and B2 to a debugging server, and the device management platform finds a device to be debugged through a unique identifier deviceID of the device and sends A2 and B1 to the device to be debugged.
Fig. 6 is a schematic diagram of connection of each device according to an embodiment of the present application, and as shown in fig. 6, a device to be debugged connects to a debugging server using B1, starts a sshd server process, and then logs in the debugging server using A2 without a password; the terminal equipment uses A2 to log in a debugging server without a password, the debugging server uses B2 to be connected with the equipment to be debugged, and the terminal equipment uses B2 to be connected with the equipment to be debugged.
The embodiment of the application also provides a nonvolatile storage medium, wherein the nonvolatile storage medium comprises a stored program, and when the program runs, the device where the nonvolatile storage medium is located is controlled to execute the connection method of the device and the debugging method of the device.
The nonvolatile storage medium stores a program for executing the following functions: generating a secret key pair, wherein the secret key pair comprises a first secret key pair and a second secret key pair, and the first secret key pair and the second secret key pair respectively comprise a public key and a private key; the method comprises the steps of sending a public key of a first secret key pair and a private key of a second secret key pair to a debugging server, sending the private key of the first secret key pair and the public key of the second secret key pair to equipment to be debugged, and sending the private key of the first secret key pair to terminal equipment, wherein the debugging server is used for debugging the equipment to be debugged, the first secret key pair is used for realizing data interaction of the debugging server and the equipment to be debugged, and the second secret key pair is used for realizing data interaction of the equipment to be debugged and the terminal equipment. And receiving a public key of the first secret key pair and a private key of the second secret key pair; establishing connection between a debugging server and terminal equipment by adopting a first key pair, and establishing connection between the debugging server and equipment to be debugged by adopting a second key pair; and receiving a debugging instruction from the terminal equipment, and forwarding the debugging instruction to the equipment to be debugged, wherein the debugging instruction is used for debugging the equipment to be debugged.
The embodiment of the application also provides a processor for running the program stored in the memory, wherein the program runs to execute the connection method of the equipment and the debugging method of the equipment.
The processor is used for running a program for executing the following functions: generating a secret key pair, wherein the secret key pair comprises a first secret key pair and a second secret key pair, and the first secret key pair and the second secret key pair respectively comprise a public key and a private key; the method comprises the steps of sending a public key of a first secret key pair and a private key of a second secret key pair to a debugging server, sending the private key of the first secret key pair and the public key of the second secret key pair to equipment to be debugged, and sending the private key of the first secret key pair to terminal equipment, wherein the debugging server is used for debugging the equipment to be debugged, the first secret key pair is used for achieving data interaction of the debugging server and the equipment to be debugged, and the second secret key pair is used for achieving data interaction of the equipment to be debugged and the terminal equipment. And receiving a public key of the first secret key pair and a private key of the second secret key pair; establishing connection between a debugging server and terminal equipment by adopting a first key pair, and establishing connection between the debugging server and equipment to be debugged by adopting a second key pair; and receiving a debugging instruction from the terminal equipment, and forwarding the debugging instruction to the equipment to be debugged, wherein the debugging instruction is used for debugging the equipment to be debugged.
The above-mentioned serial numbers of the embodiments of the present application are merely for description, and do not represent the advantages and disadvantages of the embodiments.
In the above embodiments of the present application, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed technology can be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units may be a logical division, and in actual implementation, there may be another division, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit may be implemented in the form of hardware, or may also be implemented in the form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application, in essence or part of the technical solutions contributing to the related art, or all or part of the technical solutions, may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk, and various media capable of storing program codes.
The foregoing is only a preferred embodiment of the present application and it should be noted that, as will be apparent to those skilled in the art, numerous modifications and adaptations can be made without departing from the principles of the present application and such modifications and adaptations are intended to be considered within the scope of the present application.

Claims (10)

1. A method of connecting devices, comprising:
generating a key pair, wherein the key pair comprises a first key pair and a second key pair, and the first key pair and the second key pair respectively comprise a public key and a private key;
the method comprises the steps of sending a public key of a first secret key pair and a private key of a second secret key pair to a debugging server, sending the private key of the first secret key pair and a public key of the second secret key pair to equipment to be debugged, and sending the private key of the first secret key pair to terminal equipment, wherein the debugging server is used for debugging the equipment to be debugged, the first secret key pair is used for realizing data interaction between the debugging server and the equipment to be debugged, and the second secret key pair is used for realizing data interaction between the equipment to be debugged and the terminal equipment.
2. The method according to claim 1, wherein after sending the private key of the first key pair and the public key of the second key pair to the device to be debugged and sending the private key of the first key pair to the terminal device, the method comprises:
establishing connection between the debugging server and the equipment to be debugged based on the key pair;
and establishing the connection between the debugging server and the terminal equipment based on the key pair so as to establish the connection between the equipment to be debugged and the terminal equipment.
3. The method according to claim 2, wherein establishing the connection between the debugging server and the device to be debugged based on the key pair comprises:
starting a server program through a public key of the second secret key pair, and starting a client program through a private key of the first secret key pair, wherein the server program and the client program are programs based on a secure shell protocol;
and enabling the device to be debugged to reversely proxy to the debugging server through a target port by the server program and the client program based on a private key of the first secret key pair and a public key of the first secret key pair, wherein the target port is any unoccupied port on the device to be debugged.
4. The method of claim 3, wherein establishing the connection between the debugging server and the terminal device based on the key pair comprises:
establishing a connection between the terminal device and the debugging server based on a private key of the first key pair and a public key of the first key pair;
and connecting the terminal equipment with the target port on the equipment to be debugged through a private key of the second private key pair.
5. The method of claim 1, wherein generating a key pair comprises:
receiving a debugging instruction issued by an equipment management platform, wherein the debugging instruction is used for indicating to debug the equipment to be debugged;
and randomly generating the key pair under the triggering of the debugging instruction.
6. The method of connecting devices of claim 5, further comprising:
receiving a debugging stopping instruction issued by the equipment management platform, wherein the debugging stopping instruction is used for indicating to stop debugging the equipment to be debugged;
responding to the debugging stopping instruction, closing a server program and a client program which are locally operated by the equipment to be debugged, wherein the server program and the client program are programs based on a secure shell protocol; and deleting the key pair locally stored in the device to be debugged and the debugging server.
7. A method of commissioning a device, comprising:
receiving a public key of a first secret key pair and a private key of a second secret key pair;
establishing connection between a debugging server and terminal equipment by adopting a first key pair, and establishing connection between the debugging server and equipment to be debugged by adopting a second key pair;
and receiving a debugging instruction from terminal equipment, and forwarding the debugging instruction to the equipment to be debugged, wherein the debugging instruction is used for debugging the equipment to be debugged.
8. A connection device for equipment, comprising:
the device comprises a generating module, a processing module and a processing module, wherein the generating module is used for generating a secret key pair, the secret key pair comprises a first secret key pair and a second secret key pair, and the first secret key pair and the second secret key pair respectively comprise a public key and a private key;
the device comprises a sending module, a debugging server and a second key pair, wherein the sending module is used for sending a public key of the first key pair and a private key of the second key pair to the debugging server, sending a private key of the first key pair and a public key of the second key pair to a device to be debugged, and sending a private key of the first key pair to the terminal device, the debugging server is used for debugging the device to be debugged, the first key pair is used for realizing data interaction between the debugging server and the device to be debugged, and the second key pair is used for realizing data interaction between the device to be debugged and the terminal device.
9. A non-volatile storage medium, comprising a stored program, wherein when the program runs, a device in which the non-volatile storage medium is located is controlled to execute a connection method of the device according to any one of claims 1 to 6 and a debugging method of the device according to claim 7.
10. A processor for running a program stored in a memory, wherein the program when running performs the method of connecting the device of any one of claims 1 to 6 and the method of debugging the device of claim 7.
CN202210981024.4A 2022-08-16 2022-08-16 Device connection method and device debugging method Pending CN115348020A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210981024.4A CN115348020A (en) 2022-08-16 2022-08-16 Device connection method and device debugging method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210981024.4A CN115348020A (en) 2022-08-16 2022-08-16 Device connection method and device debugging method

Publications (1)

Publication Number Publication Date
CN115348020A true CN115348020A (en) 2022-11-15

Family

ID=83952557

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210981024.4A Pending CN115348020A (en) 2022-08-16 2022-08-16 Device connection method and device debugging method

Country Status (1)

Country Link
CN (1) CN115348020A (en)

Similar Documents

Publication Publication Date Title
CN112738805B (en) Device control method and apparatus, storage medium, and electronic device
US9654480B2 (en) Systems and methods for profiling client devices
CN112187831B (en) Equipment network access method and device, storage medium and electronic equipment
CN111193698B (en) Data processing method, device, terminal and storage medium
CN107347047B (en) Attack protection method and device
CN104981784A (en) Software deployment and control method and system
CN111885026B (en) Block chain-based interconnection and intercommunication method and device, storage medium and electronic device
CN101079738B (en) Use the network management software as the safety communication channel of network management basics
US8694993B1 (en) Virtualization platform for secured communications between a user device and an application server
CN104813337A (en) Hardware management interface
CN114826754B (en) Communication method and system between different networks, storage medium and electronic device
CN103179104B (en) A kind of access method of remote service, system and equipment thereof
CN111461720B (en) Identity verification method and device based on blockchain, storage medium and electronic equipment
CN114675567A (en) Access processing method, device and storage medium for remotely controlling terminal
CN114629678B (en) TLS-based intranet penetration method and device
CN112187532A (en) Node control method and system
CN115664989A (en) Monitoring system and method of cloud desktop
CN110519239B (en) Protocol configuration method, device, equipment and readable storage medium
CN117858035B (en) Data processing method, device, computer equipment and medium for remote assistance
CN113938474B (en) Virtual machine access method and device, electronic equipment and storage medium
CN110602133A (en) Intelligent contract processing method, block chain management device and storage medium
CN112822146A (en) Network connection monitoring method, device, system and computer readable storage medium
CN112969046A (en) Video surface signing system and method based on intranet agent
CN115348020A (en) Device connection method and device debugging method
CN113812125A (en) Login behavior verification method, device and system, storage medium 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