CN117640717A - Equipment connection method and equipment - Google Patents

Equipment connection method and equipment Download PDF

Info

Publication number
CN117640717A
CN117640717A CN202210999999.XA CN202210999999A CN117640717A CN 117640717 A CN117640717 A CN 117640717A CN 202210999999 A CN202210999999 A CN 202210999999A CN 117640717 A CN117640717 A CN 117640717A
Authority
CN
China
Prior art keywords
vpn
server
connection
electronic equipment
electronic device
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
CN202210999999.XA
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.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN202210999999.XA priority Critical patent/CN117640717A/en
Publication of CN117640717A publication Critical patent/CN117640717A/en
Pending legal-status Critical Current

Links

Abstract

The application provides a device connection method and device. In the method, the electronic equipment responds to a connection operation triggered by a user and sends a connection request to a connection service; the connection request includes a VPN IP address of the electronic device; the connection service determines a target execution service according to the connection request, wherein the target execution service and the electronic equipment have the same network segment address. The electronic device obtains the VPN IP address of the target execution service. And establishing connection between the target execution service and the electronic equipment according to the VPN IP address of the electronic equipment and the VPN IP address of the target execution service. The connection is used for the server to issue the debugging command to the electronic equipment and for the electronic equipment to return the execution result corresponding to the debugging command to the server. Through the scheme, the electronic equipment can be connected with the target execution service in the server, so that a local agent is not required to be configured, the electronic equipment can be efficiently and conveniently accessed to the server remotely, and the debugging cost is saved.

Description

Equipment connection method and equipment
Technical Field
The application relates to the technical field of internet, in particular to a device connection method and device.
Background
With the rapid development of internet ecology, more and more developers are rushing into the application development field, and meanwhile, the requirements of test equipment are also obviously increased. The real machine platform is a platform for intensively providing equipment sharing service, and can provide the functions of online using various testing equipment for developers.
In the operation of the current real machine platform, a large amount of electronic equipment needs to be purchased and centrally managed. The electronic equipment is connected to the local agent machine through a data line, an agent plug-in is installed in the local agent machine, and the local agent machine operates agent service, so that the electronic equipment can be connected to a real machine platform. The user can apply for using the electronic equipment through the real machine platform, so that the work such as application debugging and the like can be performed.
Because the electronic equipment is connected to the real machine platform and depends on the local agent machine, the local agent machine has higher equipment cost and complex environment configuration, and the electronic equipment cannot be connected to the real machine platform anytime and anywhere. In addition, the electronic equipment needs to be connected with the local agent machine through a data line, and the development of a real machine platform is limited by the serial port number and the power supply limitation of the local agent machine.
Disclosure of Invention
The application provides a device connection method and device, which are used for providing a high-efficiency and rapid connection mode of true equipment.
In a first aspect, the present application provides a device connection method that may be performed by a debug system comprising a server and an electronic device, the services comprising a connection service and an execution service. The device connection method comprises the following steps:
The electronic equipment responds to the connection operation triggered by the user and sends a connection request to the connection service; the connection request includes a virtual private network internet protocol, VPN, IP, address of the electronic device; the connection service determines a target execution service according to the connection request, wherein the target execution service and the electronic equipment have the same network segment address; the electronic equipment acquires a VPN IP address of the target execution service; establishing connection between the target execution service and the electronic equipment according to the VPN IP address of the electronic equipment and the VPN IP address of the target execution service; the connection is used for the server to issue a debugging command to the electronic equipment and for the electronic equipment to return an execution result corresponding to the debugging command to the server.
Based on the method, the electronic equipment can be connected with the target execution service in the server, so that a local agent is not required to be configured, the electronic equipment can be efficiently and conveniently accessed to the server remotely, and further the electronic equipment can be used as a true machine device for debugging, and the debugging cost is saved.
In one possible design, the server includes a plurality of execution services having the same network segment address as the electronic device, and the target execution service is an execution service with the least number of currently connected devices among the plurality of execution services.
By the design, the execution service which is the same as the network section of the electronic equipment and has the least number of the current connected equipment can be used as the target execution service, so that a plurality of execution services in the server can be used in a balanced mode, and resource waste of the execution service is prevented.
In one possible design, the connection request further includes a daemon port identification of the electronic device; the daemon port identification is used for the electronic device and the target execution service to establish the connection.
By the design, the connection request can comprise the daemon port identification of the electronic device, so that the connection between the target execution service and the electronic device through the daemon port exposed by the electronic device is convenient.
In one possible design, after the target execution service establishes a connection with the electronic device, the method further includes: and the server stores the equipment information of the electronic equipment into an equipment database of the server.
Through the design, the server can store the equipment information of the electronic equipment into the equipment database, so that the subsequent user equipment can conveniently request to use the electronic equipment for debugging.
In one possible design, before the target execution service establishes a connection with the electronic device, the method further includes: the server receives a VPN verification request sent by the electronic equipment, wherein the VPN verification request is used for requesting the server to verify whether VPN account information corresponding to the electronic equipment exists; when the VPN account information corresponding to the electronic equipment does not exist, the server creates a VPN account corresponding to the electronic equipment, and the server sends the VPN account information corresponding to the electronic equipment; the electronic equipment acquires a VPN IP address of the electronic equipment according to the VPN account information; when the VPN account information corresponding to the electronic equipment exists, the electronic equipment acquires the VPN IP address of the electronic equipment according to the VPN account information.
Through the design, the server can create the VPN account for the electronic equipment, so that the electronic equipment can acquire the VPN IP address of the electronic equipment according to the VPN account information, and further the server can build the execution service in the electronic equipment and the server into the same virtual local area network, and the connection between the electronic equipment and the execution service in the server is convenient.
In one possible design, before the electronic device obtains the VPN IP address of the electronic device according to the VPN account information, the method further includes: if the electronic equipment does not have the corresponding certificate information of the VPN account locally, the electronic equipment downloads the VPN certificate information locally and generates a configuration file required for establishing the connection.
Through the design, the electronic equipment can download VPN certificate information to the local and generate the configuration file, so that connection with the target execution service can be established in the virtual local area network corresponding to the electronic equipment, and the electronic equipment can be efficiently accessed to the real machine platform.
In one possible design, the method further comprises: the server distributes VPN IP addresses for each execution service; and the server allocates a VPN IP address for the electronic device.
Through the design, the server can respectively allocate the VPN IP address for each execution service and allocate the VPN IP address for the electronic equipment, so that the server can build the electronic equipment and the execution service into the same virtual local area network, and connection between the electronic equipment and the execution service is convenient to build.
In one possible design, after the target execution service establishes a connection with the electronic device, the method further includes: the server receives an equipment application request sent by user equipment, wherein the equipment application request is used for requesting to debug by using the electronic equipment; the target execution service sends the debugging command to the electronic equipment through the connection; the electronic equipment executes the debugging command and sends an execution result corresponding to the debugging command to the target execution service through the connection; and the server sends an execution result corresponding to the debugging command to the user equipment.
Through the design, after the electronic equipment is connected with the target execution service, the user equipment can apply for using the electronic equipment for debugging, remote debugging is realized, and the debugging efficiency is improved.
In a second aspect, the present application provides a device connection method, which may be performed by an electronic device. The device connection method comprises the following steps:
Responding to the connection operation triggered by the user, and sending a connection request to the connection service of the server; wherein the connection request includes a virtual private network internet protocol, VPN, IP, address of the electronic device; acquiring a VPN IP address of a target execution service; the target execution service is an execution service with the same network segment address as the electronic equipment in the server; establishing connection with the target execution service according to the VPN IP address of the target execution service; the connection is used for the server to issue a debugging command to the electronic equipment and for the electronic equipment to return an execution result corresponding to the debugging command to the server.
In one possible design, the server includes a plurality of execution services having the same network segment address as the electronic device, and the target execution service is an execution service with the least number of currently connected devices among the plurality of execution services.
In one possible design, the connection request further includes a daemon port identification of the electronic device; the daemon port identification is used for the electronic device and the target execution service to establish the connection.
In one possible design, before the connection is established between the VPN IP address according to the target execution service and the target execution service in the server, the method further includes: a VPN verification request is sent to the server, and the VPN verification request is used for requesting the server to verify whether VPN account information corresponding to the electronic equipment exists or not; when the VPN account information corresponding to the electronic equipment does not exist, receiving the VPN account information corresponding to the electronic equipment, which is sent by the server, and acquiring a VPN IP address of the electronic equipment according to the VPN account information; and when the VPN account information corresponding to the electronic equipment exists, acquiring the VPN IP address of the electronic equipment according to the VPN account information.
In one possible design, before the acquiring the VPN IP address of the electronic device according to the VPN account information, the method further includes: and if the certificate information corresponding to the VPN account does not exist, downloading the VPN certificate information to the local, and generating a configuration file required for establishing connection.
In one possible design, after the VPN IP address according to the target execution service establishes a connection with the target execution service in the server, the method further includes: receiving a debugging command sent by the target connection service through the connection, wherein the debugging command is sent to the server by user equipment; executing the debugging command, and sending an execution result corresponding to the debugging command to the target execution service through the connection.
In a third aspect, the present application provides a device connection method that can be executed by a server including a connection service and an execution service. The device connection method comprises the following steps: the connection service receives a connection request sent by the electronic equipment; the connection request includes a virtual private network internet protocol, VPN, IP, address of the electronic device; the connection service determines a target execution service according to the connection request, wherein the target execution service and the electronic equipment have the same network segment address; the target execution service establishes connection with the electronic equipment according to the VPN IP address of the electronic equipment; the connection is used for the server to issue a debugging command to the electronic equipment and for the electronic equipment to return an execution result corresponding to the debugging command to the server.
In one possible design, the server includes a plurality of execution services having a same network segment address as the electronic device, the connection service determining a target execution service according to the connection request, including: the connection service takes the execution service with the least number of the current connection devices in the plurality of execution services as the target execution service.
In one possible design, the connection request further includes a daemon port identification of the electronic device; the daemon port identification is used for the electronic device and the target execution service to establish the connection.
In one possible design, after the target execution service establishes a connection with the electronic device according to the VPN IP address of the electronic device, the method further includes: the server stores the device information of the electronic device into a device database of the server.
In one possible design, before the target execution service establishes a connection with the electronic device according to the VPN IP address of the electronic device, the method further includes: the server receives a VPN verification request sent by the electronic equipment, wherein the VPN verification request is used for requesting the server to verify whether VPN account information corresponding to the electronic equipment exists; when the VPN account information corresponding to the electronic equipment does not exist, the server creates a VPN account corresponding to the electronic equipment, and the server sends the VPN account information corresponding to the electronic equipment.
In one possible design, the method further comprises: the server distributes VPN IP addresses for each execution service; and the server allocates a VPN IP address for the electronic device.
In one possible design, after the target execution service establishes a connection with the electronic device, the method further includes: the server receives an equipment application request sent by user equipment, wherein the equipment application request is used for requesting to debug by using the electronic equipment; the target execution service sends the debugging command to the electronic equipment through the connection; the target execution service receives an execution result corresponding to the debugging command sent by the electronic equipment; and the server sends an execution result corresponding to the debugging command to the user equipment.
In a fourth aspect, the present application provides a debug system, including a server and an electronic device;
the electronic equipment is used for responding to the connection operation triggered by the user and sending a connection request to the server; the connection request includes a virtual private network internet protocol, VPN, IP, address of the electronic device; acquiring a VPN IP address of the target execution service; establishing connection with the target execution service according to the VPN IP address of the target execution service;
the server is used for determining a target execution service according to the connection request through a connection service, wherein the target execution service and the electronic equipment have the same network segment address; establishing the connection with the electronic equipment according to the VPN IP address of the electronic equipment through the target execution service;
The connection is used for the server to issue a debugging command to the electronic equipment and for the electronic equipment to return an execution result corresponding to the debugging command to the server.
In one possible design, the server is further configured to: when the server comprises a plurality of execution services with the same network segment address as the electronic equipment, the execution service with the least number of currently connected equipment in the plurality of execution services is used as the target execution service through the connection service.
In one possible design, the connection request further includes a daemon port identification of the electronic device; the daemon port identification is used for the electronic device and the target execution service to establish the connection.
In one possible design, the server is further configured to: after a connection is established with the electronic device according to the VPN IP address of the electronic device through the target execution service, the device information of the electronic device is stored in a device database of the server.
In one possible design, the server is further configured to: before the connection is established with the electronic equipment according to the VPN IP address of the electronic equipment through the target execution service, receiving a VPN verification request sent by the electronic equipment, wherein the VPN verification request is used for requesting the server to verify whether VPN account information corresponding to the electronic equipment exists; when the VPN account information corresponding to the electronic equipment does not exist, creating a VPN account corresponding to the electronic equipment, and sending the VPN account information corresponding to the electronic equipment;
The electronic device is further configured to: a VPN verification request is sent to the server, and the VPN verification request is used for requesting the server to verify whether VPN account information corresponding to the electronic equipment exists or not; when the VPN account information corresponding to the electronic equipment does not exist, receiving the VPN account information corresponding to the electronic equipment, which is sent by the server, and acquiring a VPN IP address of the electronic equipment according to the VPN account information; and when the VPN account information corresponding to the electronic equipment exists, acquiring the VPN IP address of the electronic equipment according to the VPN account information.
In one possible design, the electronic device is further configured to: before the VPN IP address of the electronic equipment is obtained according to the VPN account information, if the certificate information corresponding to the VPN account does not exist, the VPN certificate information is downloaded to the local, and a configuration file required for establishing connection is generated.
In one possible design, the server is further configured to: receiving an equipment application request sent by user equipment, wherein the equipment application request is used for requesting to debug by using the electronic equipment; transmitting the debug command to the electronic device through the connection by the target execution service; receiving an execution result corresponding to the debug command sent by the electronic equipment through the target execution service; transmitting an execution result corresponding to the debugging command to the user equipment;
The electronic device is further configured to: receiving the debug command over the connection; executing the debugging command, and sending an execution result corresponding to the debugging command to the target execution service through the connection.
In a fifth aspect, the present application provides an electronic device comprising at least one processor and at least one memory, the at least one memory storing computer program instructions that, when executed by the electronic device, perform the method performed by the electronic device of any of the above aspects and embodiments thereof.
In a sixth aspect, the present application provides an electronic device, the electronic device including a plurality of functional modules; the plurality of functional modules interact to implement the method performed by the electronic device in any of the aspects and embodiments thereof. The plurality of functional modules may be implemented based on software, hardware, or a combination of software and hardware, and the plurality of functional modules may be arbitrarily combined or divided based on the specific implementation.
In a seventh aspect, the present application provides a server comprising at least one processor coupled to at least one memory, the at least one processor configured to read a computer program stored in the at least one memory to perform the method performed by the server in any of the above aspects and embodiments thereof.
In an eighth aspect, the present application provides a server comprising a plurality of functional modules; the plurality of functional modules interact to implement the method performed by the server in any of the aspects and embodiments thereof described above. The plurality of functional modules may be implemented based on software, hardware, or a combination of software and hardware, and the plurality of functional modules may be arbitrarily combined or divided based on the specific implementation.
In a ninth aspect, the present application also provides a computer program product comprising instructions which, when run on a computer, cause the computer to perform the method performed by the first electronic device, the third electronic device or the server of any of the above aspects and embodiments thereof.
In a tenth aspect, the present application further provides a computer readable storage medium having stored therein a computer program which, when executed by a computer, causes the computer to perform the method performed by the first electronic device, the third electronic device or the server in any of the above aspects and embodiments thereof.
In an eleventh aspect, the present application further provides a chip for reading a computer program stored in a memory, and executing the method executed by the first electronic device, the third electronic device or the server in any of the above aspects and embodiments thereof.
In a twelfth aspect, the present application further provides a chip system, where the chip system includes a processor, and the processor is configured to support the computer apparatus to implement the method performed by the first electronic device, the third electronic device, or the server in any one of the foregoing aspects and embodiments thereof. In one possible design, the chip system further includes a memory for storing programs and data necessary for the computer device. The chip system may be formed of a chip or may include a chip and other discrete devices.
Drawings
FIG. 1 is a schematic view of an application scenario of a real machine platform system;
FIG. 2 is a schematic diagram of the architecture of each device in a real machine platform system;
FIG. 3 is a flow chart of a method for connecting a real machine device;
fig. 4 is an application scenario schematic diagram of a device connection method provided in an embodiment of the present application;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application;
fig. 6 is a software structural block diagram of an electronic device according to an embodiment of the present application;
FIG. 7 is a schematic diagram of a debug system according to an embodiment of the present disclosure;
fig. 8 is a schematic view of a scenario of a VPN networking method provided in an embodiment of the present application;
Fig. 9 is a flowchart of a method for connecting electronic devices to VPN according to an embodiment of the present application;
fig. 10 is a schematic flow chart of a device connection method according to an embodiment of the present application;
fig. 11 is an application interface schematic diagram of a connection application according to an embodiment of the present application;
fig. 12 is a schematic diagram of a connection page according to an embodiment of the present application;
fig. 13 is a schematic diagram of a server distributing execution services to electronic devices according to an embodiment of the present application;
FIG. 14 is a schematic diagram of a connection page according to an embodiment of the present disclosure;
FIG. 15 is a flow chart of a method for device application and use provided in an embodiment of the present application;
fig. 16 is a schematic diagram of an equipment application page provided in an embodiment of the present application;
fig. 17 is a schematic diagram of a debug page according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application more apparent, the embodiments of the present application will be described in further detail with reference to the accompanying drawings. Wherein in the description of embodiments of the present application, the terms "first," "second," and the like are used for descriptive purposes only and are not to be construed as indicating or implying a relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include one or more such feature.
It should be understood that in embodiments of the present application, "at least one" means one or more, and "a plurality" means two or more. "and/or", describes an association relationship of an association object, and indicates that there may be three relationships, for example, a and/or B, and may indicate: a alone, a and B together, and B alone, wherein A, B may be singular or plural. The character "/" generally indicates that the context-dependent object is an "or" relationship. "at least one (item) below" or the like, refers to any combination of these items, including any combination of single item(s) or plural items(s). For example, at least one (one) of a, b or c may represent: a, b, c, a and b, a and c, b and c, or a, b and c, wherein a, b and c can be single or multiple.
With the rapid development of internet ecology, more and more developers are rushing into the application development field, and meanwhile, the requirements of test equipment are also obviously increased. The real machine platform is a platform for intensively providing equipment sharing service, and can provide the functions of online using various testing equipment for developers.
Fig. 1 is a schematic view of an application scenario of a real machine platform system. Referring to fig. 1, the real machine platform system includes a real machine platform, which is a tool platform for centrally providing a real machine sharing service, and a real machine database, which is a relational database for storing attribute information of real machine devices connected to the real machine platform, wherein the attribute information of the real machine devices may include internet protocol (internet protocol, IP) addresses, serial Numbers (SNs), brands, models, device usage statuses, and the like of the real machine devices. In implementation, the real machine platform and the real machine database can be implemented through at least one computing device, for example, a real machine platform server can implement functions of the real machine platform and the real machine database. The real machine platform system shown in fig. 1 further comprises a local agent machine, and the real machine device can be connected to the local agent machine through a data line. The local proxy machine can be provided with a proxy plug-in, and the local proxy machine runs the proxy plug-in so as to assist the real machine equipment to access the real machine platform. The real machine device can be a personal device, various brands of commodity devices or laboratory devices, etc.
Based on the real machine platform system shown in fig. 1, fig. 2 is a schematic architecture diagram of each device in the real machine platform system. Referring to fig. 2, the user equipment is a device applying for using a real machine device. The server is used for realizing functions of the real machine platform and the equipment database, and comprises functional modules such as equipment management, equipment connection service, equipment authentication, equipment database and the like. The agent is used for assisting the real machine equipment to access the server, the agent comprises functional modules such as agent service, a debugging tool and the like, and the debugging tool comprises a debugging client and a debugging server. The Daemon program corresponding to the debugging tool is installed on the real machine equipment. The debugging tool may be an operating system adapting tool, and the debugging tools adapted by different operating systems may be the same or different, for example, in fig. 2, the debugging tool is an android debug bridge (Android debug bridge, ADB), the debugging Client may be an ADB Client, the debugging Server may be an ADB Server, a Daemon corresponding to the debugging tool is also called a Daemon, and typically, when the system background runs for a long time, for example, when the debugging tool is an ADB, the Daemon may be an android debug Daemon (Android debug bridge Daemon, adbd).
The function of each module is further described below:
a debug tool, such as ADB, is a tool that establishes communication between an agent and a real machine device and manages the real machine device, and the agent may call the debug tool to send a debug command to the real machine device, and the debug command may be used to instruct the real machine device to perform various operations.
ADB clients run on agents that can call clients through debug commands.
The ADB Server runs on the proxy for managing communications between the debug client and daemon processes in the real machine device.
The adbd runs on the real machine equipment, and the real machine equipment can automatically run the adbd after starting the debugging function.
The proxy service is a background service running on the proxy machine and is used for reporting the state of the real machine equipment, receiving an operation instruction issued by the equipment connection service and issuing the operation instruction to the debugging client side on the proxy machine.
The device authentication is operated on the server and used for authenticating the true device and judging whether the true device is legal or not.
The device management is run on the server for managing information of the real machine device and providing information of the real machine device to the user device.
Based on the architecture shown in fig. 2, fig. 3 is a flow chart of a method for connecting a real device. Referring to fig. 3, the method includes the steps of:
S301: the proxy initiates a proxy service.
Alternatively, the proxy may expose the background process port to establish a connection with the server after the proxy initiates the proxy service, e.g., the proxy may expose the background process port 5037 after the proxy initiates the proxy service.
S302: the real machine equipment starts the debugging function and automatically runs the daemon.
The user can connect the real machine device to the agent machine through the data line, and the real machine device can start the adbd in the background to expose the process port to establish connection with the agent machine. Such as a real machine device may expose a process port 5555. After the real machine equipment is connected to the agent machine through the data line, the agent machine can automatically start the ADB Server in the background and expose the background process ports, such as the exposure port 5037.
S303: the ADB Server scans the exposed port of the real machine equipment and establishes communication connection with the real machine equipment.
S304: the proxy service initiates a device query instruction (ADB devices) at a set period and issues the device query instruction to an ADB Client, which sends the device query instruction to the ADB Server.
S305: the ADB Server may obtain device connection information of the real device through a communication connection with the real device.
S306: the ADB Server sends the device connection information to the ADB Client, which sends the device connection information to the proxy service.
S307: the proxy service transmits device connection information to the device connection service.
S308: and the equipment authentication authenticates the true equipment corresponding to the equipment connection information, and determines that the authentication of the true equipment is passed.
S309: the device management service stores device information of the real device into a device database.
According to the equipment connection method, in the current operation of the real machine platform, a large number of real machine platform operators are required to purchase and centrally manage the real machine equipment. The real machine equipment needs to be connected to the proxy machine through a data line, that is, the access of the real machine equipment to the real machine platform is necessary to depend on the local proxy machine, but the proxy machine equipment has higher cost and complex environment configuration, and the proxy machine can only be placed in a fixed place and can not be accessed to the real machine platform anytime and anywhere. In addition, as the real machine equipment needs to be connected with the proxy machine through a data line, the development of a real machine platform can be restricted by the serial port number and the power supply limitation of the proxy machine.
Based on the above problems, the present application provides a device connection method, which is used to provide a high-efficient and fast connection mode of a real device.
Fig. 4 is an application scenario schematic diagram of a device connection method provided in an embodiment of the present application. Referring to fig. 4, the scenario includes a server, a real machine device, and a user device, wherein the real machine device includes at least one electronic device, such as a personal device, various branded goods devices, or laboratory devices, etc. For convenience of description, in the following description, the electronic device is a real device, and the user device is a device used by a user applying for using the real device.
Referring to fig. 4, in an embodiment of the present application, the electronic device may communicate with the server through a wireless local area network or a cellular mobile network, for example, the electronic device may communicate with the server through a wireless fidelity (wireless fidelity, wi-Fi) network, a fourth generation mobile communication technology (the 4th generation mobile communication technology,4G), a fifth generation mobile communication technology (the 4th generation mobile communication technology,5G), and so on. Compared with the scenario shown in fig. 1, the proxy machine is not involved in the embodiment of the present application, that is, in the device connection method provided in the embodiment of the present application, the proxy machine is not required to assist the electronic device in accessing the server, that is, the data line is not required to be used to connect the electronic device and the proxy machine.
In the device connection method provided by the embodiment of the application, the electronic device can be provided with the connection application, the electronic device can interact with the server through the connection application, the server comprises the connection service and a plurality of execution services, the connection service can distribute target execution services for the electronic device, and the target execution services can establish connection with the electronic device, so that the electronic device is connected to the real machine platform. The user may use the user device to apply for remote debugging using the electronic device to the server. By the device connection method provided by the embodiment of the application, the electronic device can be connected with the target execution service in the server so as to be connected with the real machine platform, a local agent is not required to be configured, the debugging cost is saved, and the connection between the electronic device and the server of the real machine platform is efficiently and conveniently established.
Embodiments of an electronic device, and for using such an electronic device, are described below. The electronic device in the embodiment of the present application may be a tablet computer, a mobile phone, a vehicle-mounted device, an Augmented Reality (AR)/Virtual Reality (VR) device, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (personal digital assistant, PDA), a wearable device, or the like, and the embodiment of the present application does not limit the specific type of the electronic device.
Fig. 5 is a schematic structural diagram of an electronic device 100 according to an embodiment of the present application. As shown in fig. 5, the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (universal serial bus, USB) interface 130, a charge management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, keys 190, a motor 191, an indicator 192, a camera 193, a display 194, a user identification module (subscriber identification module, SIM) card interface 195, and the like.
The processor 110 may include one or more processing units, such as: the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), a controller, a memory, a video codec, a digital signal processor (digital signal processor, DSP), a baseband processor, and/or a neural network processor (neural-network processing unit, NPU), etc. Wherein the different processing units may be separate devices or may be integrated in one or more processors. The controller may be a neural hub and a command center of the electronic device 100, among others. The controller can generate operation control signals according to the instruction operation codes and the time sequence signals to finish the control of instruction fetching and instruction execution. A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may hold instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to reuse the instruction or data, it can be called directly from the memory. Repeated accesses are avoided and the latency of the processor 110 is reduced, thereby improving the efficiency of the system.
The USB interface 130 is an interface conforming to the USB standard specification, and may specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, or the like. The USB interface 130 may be used to connect a charger to charge the electronic device 100, and may also be used to transfer data between the electronic device 100 and a peripheral device. The charge management module 140 is configured to receive a charge input from a charger. The power management module 141 is used for connecting the battery 142, and the charge management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and/or the charge management module 140 and provides power to the processor 110, the internal memory 121, the external memory, the display 194, the camera 193, the wireless communication module 160, and the like.
The wireless communication function of the electronic device 100 may be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, a modem processor, a baseband processor, and the like. The antennas 1 and 2 are used for transmitting and receiving electromagnetic wave signals. Each antenna in the electronic device 100 may be used to cover a single or multiple communication bands. Different antennas may also be multiplexed to improve the utilization of the antennas. For example: the antenna 1 may be multiplexed into a diversity antenna of a wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
The mobile communication module 150 may provide a solution for wireless communication including 2G/3G/4G/5G, etc., applied to the electronic device 100. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (low noise amplifier, LNA), etc. The mobile communication module 150 may receive electromagnetic waves from the antenna 1, perform processes such as filtering, amplifying, and the like on the received electromagnetic waves, and transmit the processed electromagnetic waves to the modem processor for demodulation. The mobile communication module 150 can amplify the signal modulated by the modem processor, and convert the signal into electromagnetic waves through the antenna 1 to radiate. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be disposed in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be provided in the same device as at least some of the modules of the processor 110.
The wireless communication module 160 may provide solutions for wireless communication including wireless local area network (wireless local area networks, WLAN) (e.g., wireless fidelity (wireless fidelity, wi-Fi) network), bluetooth (BT), global navigation satellite system (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), near field wireless communication technology (near field communication, NFC), infrared technology (IR), etc., as applied to the electronic device 100. The wireless communication module 160 may be one or more devices that integrate at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the electromagnetic wave signals, filters the electromagnetic wave signals, and transmits the processed signals to the processor 110. The wireless communication module 160 may also receive a signal to be transmitted from the processor 110, frequency modulate it, amplify it, and convert it to electromagnetic waves for radiation via the antenna 2.
In some embodiments, antenna 1 and mobile communication module 150 of electronic device 100 are coupled, and antenna 2 and wireless communication module 160 are coupled, such that electronic device 100 may communicate with a network and other devices through wireless communication techniques. The wireless communication techniques may include the Global System for Mobile communications (global system for mobile communications, GSM), general packet radio service (general packet radio service, GPRS), code division multiple access (code division multiple access, CDMA), wideband code division multiple access (wideband code division multiple access, WCDMA), time division code division multiple access (time-division code division multiple access, TD-SCDMA), long term evolution (long term evolution, LTE), BT, GNSS, WLAN, NFC, FM, and/or IR techniques, among others. The GNSS may include a global satellite positioning system (global positioning system, GPS), a global navigation satellite system (global navigation satellite system, GLONASS), a beidou satellite navigation system (beidou navigation satellite system, BDS), a quasi zenith satellite system (quasi-zenith satellite system, QZSS) and/or a satellite based augmentation system (satellite based augmentation systems, SBAS).
The display 194 is used to display a display interface of an application, such as a display page of an application installed on the electronic device 100. The display 194 includes a display panel. The display panel may employ a liquid crystal display (liquid crystal display, LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED) or an active-matrix organic light-emitting diode (matrix organic light emitting diode), a flexible light-emitting diode (flex), a mini, a Micro led, a Micro-OLED, a quantum dot light-emitting diode (quantum dot light emitting diodes, QLED), or the like. In some embodiments, the electronic device 100 may include 1 or N display screens 194, N being a positive integer greater than 1.
The camera 193 is used to capture still images or video. The object generates an optical image through the lens and projects the optical image onto the photosensitive element. The photosensitive element may be a charge coupled device (charge coupled device, CCD) or a Complementary Metal Oxide Semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, which is then transferred to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV, or the like format. In some embodiments, electronic device 100 may include 1 or N cameras 193, N being a positive integer greater than 1.
The internal memory 121 may be used to store computer executable program code including instructions. The processor 110 executes various functional applications of the electronic device 100 and data processing by executing instructions stored in the internal memory 121. The internal memory 121 may include a storage program area and a storage data area. The storage program area may store an operating system, software code of at least one application program, and the like. The storage data area may store data (e.g., captured images, recorded video, etc.) generated during use of the electronic device 100, and so forth. In addition, the internal memory 121 may include a high-speed random access memory, and may further include a nonvolatile memory such as at least one magnetic disk storage device, a flash memory device, a universal flash memory (universal flash storage, UFS), and the like.
The external memory interface 120 may be used to connect an external memory card, such as a Micro SD card, to enable expansion of the memory capabilities of the electronic device. The external memory card communicates with the processor 110 through an external memory interface 120 to implement data storage functions. For example, files such as pictures and videos are stored in an external memory card.
The electronic device 100 may implement audio functions through an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, an application processor, and the like. Such as music playing, recording, etc.
The sensor module 180 may include a pressure sensor 180A, an acceleration sensor 180B, a touch sensor 180C, and the like, among others.
The pressure sensor 180A is used to sense a pressure signal, and may convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A may be disposed on the display screen 194.
The touch sensor 180C, also referred to as a "touch panel". The touch sensor 180C may be disposed on the display 194, and the touch sensor 180C and the display 194 form a touch screen, which is also referred to as a "touch screen". The touch sensor 180C is used to detect a touch operation acting thereon or thereabout. The touch sensor may communicate the detected touch operation to the application processor to determine the touch event type. Visual output related to touch operations may be provided through the display 194. In other embodiments, the touch sensor 180C may also be disposed on the surface of the electronic device 100 at a different location than the display 194.
The keys 190 include a power-on key, a volume key, etc. The keys 190 may be mechanical keys. Or may be a touch key. The electronic device 100 may receive key inputs, generating key signal inputs related to user settings and function controls of the electronic device 100. The motor 191 may generate a vibration cue. The motor 191 may be used for incoming call vibration alerting as well as for touch vibration feedback. For example, touch operations acting on different applications (e.g., photographing, audio playing, etc.) may correspond to different vibration feedback effects. The touch vibration feedback effect may also support customization. The indicator 192 may be an indicator light, may be used to indicate a state of charge, a change in charge, a message indicating a missed call, a notification, etc. The SIM card interface 195 is used to connect a SIM card. The SIM card may be contacted and separated from the electronic device 100 by inserting the SIM card interface 195 or extracting it from the SIM card interface 195.
It is to be understood that the components shown in fig. 5 are not to be construed as a particular limitation of the electronic device 100, and the electronic device may include more or less components than illustrated, or may combine certain components, or may split certain components, or may have a different arrangement of components. Furthermore, the combination/connection relationship between the components in fig. 5 is also adjustable and modifiable.
Fig. 6 is a software structural block diagram of an electronic device according to an embodiment of the present application. As shown in fig. 6, the software structure of the electronic device may be a hierarchical architecture, for example, the software may be divided into several layers, each layer having a distinct role and division of work. The layers communicate with each other through a software interface. In some embodiments, the operating system is divided into four layers, from top to bottom, an application layer, an application framework layer (FWK), a runtime (run time) and a system library, and a kernel layer, respectively.
The application layer may include a series of application packages (application package). As shown in fig. 6, the application layer may include a camera, settings, skin modules, user Interfaces (UIs), three-way applications, and the like. The three-party application program can comprise a gallery, calendar, conversation, map, navigation, WLAN, bluetooth, music, video, short message, and the like. In the embodiment of the application program, the application program may further include a connection application, where the connection application is used to establish a connection with the target execution service in the server, so that the electronic device is connected to the real machine platform, and the electronic device may be used as the real machine device to execute the debug function.
The application framework layer provides an application programming interface (application programming interface, API) and programming framework for application programs of the application layer. The application framework layer may include some predefined functions. As shown in FIG. 6, the application framework layer may include a window manager, a content provider, a view system, a telephony manager, a resource manager, and a notification manager.
The window manager is used for managing window programs. The window manager can acquire the size of the display screen, judge whether a status bar exists, lock the screen, intercept the screen and the like. The content provider is used to store and retrieve data and make such data accessible to applications. The data may include video, images, audio, calls made and received, browsing history and bookmarks, phonebooks, etc.
The view system includes visual controls, such as controls to display text, controls to display pictures, and the like. The view system may be used to build applications. The display interface may be composed of one or more views. For example, a display interface including a text message notification icon may include a view displaying text and a view displaying a picture.
The telephony manager is for providing communication functions of the electronic device. Such as the management of call status (including on, hung-up, etc.).
The resource manager provides various resources for the application program, such as localization strings, icons, pictures, layout files, video files, and the like.
The notification manager allows the application to display notification information in a status bar, can be used to communicate notification type messages, can automatically disappear after a short dwell, and does not require user interaction. Such as notification manager is used to inform that the download is complete, message alerts, etc. The notification manager may also be a notification in the form of a chart or scroll bar text that appears on the system top status bar, such as a notification of a background running application, or a notification that appears on the screen in the form of a dialog window. For example, a text message is prompted in a status bar, a prompt tone is emitted, the electronic device vibrates, and an indicator light blinks, etc.
The runtime includes a core library and a virtual machine. The runtime is responsible for the scheduling and management of the operating system.
The core library consists of two parts: one part is a function which needs to be called by java language, and the other part is a core library of an operating system. The application layer and the application framework layer run in a virtual machine. The virtual machine executes java files of the application program layer and the application program framework layer as binary files. The virtual machine is used for executing the functions of object life cycle management, stack management, thread management, security and exception management, garbage collection and the like.
The system library may include a plurality of functional modules. For example: surface manager (surface manager), media library (media library), three-dimensional graphics processing library (e.g., openGL ES), two-dimensional graphics engine (e.g., SGL), image processing library, etc.
The surface manager is used to manage the display subsystem and provides a fusion of 2D and 3D layers for multiple applications.
Media libraries support a variety of commonly used audio, video format playback and recording, still image files, and the like. The media library may support a variety of audio and video encoding formats, such as MPEG4, h.264, MP3, AAC, AMR, JPG, PNG, etc.
The three-dimensional graphic processing library is used for realizing three-dimensional graphic drawing, image rendering, synthesis, layer processing and the like.
The 2D graphics engine is a drawing engine for 2D drawing.
The kernel layer is a layer between hardware and software. The inner core layer at least comprises a display driver, a camera driver, an audio driver and a sensor driver.
The hardware layer may include various sensors such as acceleration sensors, gyroscopic sensors, touch sensors, and the like.
It should be noted that the structures shown in fig. 5 and fig. 6 are only an example of the electronic device provided in the embodiments of the present application, and the electronic device provided in the embodiments of the present application is not limited in any way, and in a specific implementation, the electronic device may have more or fewer devices or modules than those shown in fig. 5 or fig. 6.
The following describes a device connection method provided in an embodiment of the present application.
Fig. 7 is a schematic architecture diagram of a debug system provided in an embodiment of the present application, and referring to fig. 7, the debug system includes a server, an electronic device, and a user device. The server includes modules of device management services, device databases, executive services, connection services, virtual private network (virtual private network, VPN) services, and the like. It should be noted that, in the embodiment of the present application, the server may include a plurality of execution services, and one execution service is taken as an example in fig. 7.
Referring to fig. 7, a connection application is installed on an electronic device, where the connection application supports functions such as user login, electronic device list, VPN certificate download, VPN connection, device connection, and the like, and when the electronic device starts the connection application, the electronic device may trigger to start a daemon corresponding to a debugging tool. It should be noted that, the debugging tool in the embodiment of the present application may be a debugging tool corresponding to an operating system of an electronic device, for example, when the operating system of the electronic device is an android system, the debugging tool may be an ADB; when the operating system of the electronic device is a honest system, the debugging tool may be a honest debugging tool.
The functions of each module in the server are described below:
the connection service includes a device connection, device authentication, and execution service allocation sub-module. The connection service may be used to provide an interface to a connection application of the electronic device to establish a communication connection between the server and the electronic device, and the device authentication is used to authenticate the electronic device and determine whether the electronic device is legal.
The execution service is a module deployed on a server and comprises sub-modules such as a proxy service, a debugging client, a debugging server and the like.
The VPN service is configured to implement functions such as VPN account generation, VPN certificate download, and VPN service, and the VPN service may be configured to implement the service module and the electronic device in the same local area network.
The device management service is used for managing device information of the electronic device and providing the device information of the electronic device to the user device.
It should be noted that the structure of the server and the electronic device in the debug system shown in fig. 7 and the functions of each service are only examples and not limited, in the specific implementation, there may be more or fewer services in the server, and the functions executed by each service may also be executed by other services.
Based on the debug system shown in fig. 7, the device connection method provided in the embodiment of the present application is further described below. The device connection method provided in the embodiment of the present application may include three parts, namely VPN networking, device connection, device application and use, and the VPN networking method, the device connection method, the device application and use method in the embodiment of the present application are described below respectively:
1. VPN networking method
In the embodiment of the application, when the electronic device and the execution service in the server are in the same local area network, the electronic device can establish communication connection with the execution service, so that the electronic device is connected to the real machine platform. Optionally, the electronic device connection application has a VPN Client function, and the execution service in the server also has the VPN Client function, and the VPN service in the server may configure the execution service and the electronic device into the same lan environment.
In an alternative embodiment, at least one VPN Server may be built on the VPN service, and each VPN Server may allocate a network segment IP address to a VPN Client, so that multiple VPN clients are built into the same local area network.
For example, fig. 8 is a schematic view of a VPN networking method according to an embodiment of the present application. Referring to fig. 8, the VPN service in the Server may start the VPN Server, where the VPN service obtains an IP address of one VPN Server, for example, the IP address of the VPN Server obtained by VPN service 1 in fig. 8 is 10.6.12.4.
The server may install the VPN Client in an executive service that initiates the VPN Client service. Executing service 1 starts VPN Client service in FIG. 8, accesses VPN Server, and VPN Server can assign IP address of same network segment as VPN Server to VPN Client, for example VPN Server assigns IP address of VPN Client to executing service 1 as 10.6.12.5. Similarly, executing service 2 may also initiate a VPN Client service, accessing VPN Server, which assigns the IP address of VPN Client for executing service 2 as 10.6.12.6. Through the above networking procedure, VPN service 1, executive service 1 and executive service 2 are in the same local area network.
The electronic device may launch the connection application in response to a user-triggered operation, and the user may log into the user account on the connection application. The connection application has a VPN Client function, and the VPN service may assign a VPN Client IP address to the electronic device. Fig. 9 is a flowchart of a method for connecting electronic devices to VPN according to an embodiment of the present application. Referring to fig. 9, the method includes the steps of:
s901: the electronic device checks whether VPN account information corresponding to the user account of the connection application exists for VPN service on the server, and if not, the electronic device enters S902; if so, the process advances to S903.
Alternatively, the electronic device may send a VPN verification request to the server, where the VPN verification request is used to request the server to verify whether VPN account information corresponding to the user account exists. After receiving the VPN verification request sent by the electronic device, the server may query whether VPN account information corresponding to the user account exists.
S902: the VPN Server creates a VPN account for the user account.
S903: the electronic equipment judges whether certificate information corresponding to the VPN account is stored locally or not; if yes, go to S905; if not, the process advances to S904.
The certificate information corresponding to the VPN account may include a CA certificate and a private key certificate.
S904: and the electronic equipment downloads the certificate information corresponding to the VPN account to the appointed directory, and generates a configuration file required by VPN Client connection.
S905: a connection application on the electronic device initiates a VPN connection request to connect to a VPN Server.
After the connection application is connected to the VPN Server, the electronic device may be used as a VPN Client, the VPN Server may allocate an IP address of the VPN Client to the electronic device, for example, in fig. 8, the VPN Server may allocate an IP address of the VPN Client to the electronic device may be 10.6.12.122.
By the method, the execution service in the server and the electronic equipment can be in the same local area network, so that VPN networking is completed, at the moment, the execution service in the server can be in communication connection with the electronic equipment, and the electronic equipment is used as a usable true equipment.
2. Device connection method
Fig. 10 is a flowchart of a device connection method according to an embodiment of the present application. Referring to fig. 10, the method includes the steps of:
s1001: the electronic device initiates a connection application.
In an alternative embodiment, the electronic device may launch a connectivity application and log into the user account. Optionally, after detecting that the user account logs in, the electronic device may scan a daemon port of the electronic device, and if the daemon port already exists, it indicates that the daemon has normally operated; if the daemon port does not exist, the electronic device can call the daemon port through the shell command to trigger the daemon to run.
S1002: and the electronic equipment responds to the connection operation triggered by the user and sends a connection request to the server.
In an alternative implementation manner, after the electronic device starts the connection application, an application interface of the connection application may be displayed on the display screen, and fig. 11 is a schematic diagram of an application interface of the connection application provided in the embodiment of the present application. Referring to fig. 11, the interface may include registered devices of the user account currently logged in, such as the currently used electronic device, displayed as a "native device" in the interface, and may also include other registered devices under the user account, such as devices 1-3 in fig. 11. Referring to fig. 11, the use duration and connection status of each device may also be displayed in the application interface. The user may click on a control for entering a connection page corresponding to the local device, e.g., the user may click on a page jump control shown in fig. 11, and the electronic device may display the connection page corresponding to the local device.
Fig. 12 is a schematic diagram of a connection page according to an embodiment of the present application. Referring to fig. 12, the connection page may include information of VPN state, VPN area, VPN IP address, daemon port, etc. It is understood that the VPN IP address may be an IP address of a VPN Client allocated by the VPN Server to the electronic device in the VPN networking stage. Optionally, the connection operation triggered by the user may be that the user may click on a connection control in the connection page, and the electronic device may send a connection request to the server in response to the connection operation triggered by the user.
In an alternative embodiment, the electronic device may send a connection request to the server through an API interface of the server, where the API interface in the server may forward the connection request to a device connection sub-module in the connection service; the connection request may include parameters such as VPN IP address, daemon port identifier of the electronic device.
S1003: and the connection service in the server determines a target execution service module corresponding to the electronic equipment according to the received connection request.
In the embodiment of the application, the server may include a plurality of execution services, and each execution service may establish a connection with at least one electronic device, so that the server may establish a connection with a plurality of electronic devices at the same time, and perform operations such as application debugging by using a plurality of electronic devices. Optionally, according to the foregoing VPN networking manner in the embodiment of the present application, the VPN Server may allocate an IP address of the VPN Client to each execution service, so that each execution service in the Server corresponds to a VPN IP address, and execution services in the same IP network segment may form an execution service cluster.
In an alternative embodiment, the server may allocate an executive service to the electronic device that is in the same IP network segment as the electronic device. When the plurality of executing services in the server and the electronic device are in the same IP network segment, the connection service may use the executing service with the least number of currently connected devices in the plurality of executing services as a target executing service, and the target executing service may be allocated to the electronic device for establishing a communication connection between the electronic device and the server. Alternatively, the execution service allocation sub-module in the connection service in the server shown in fig. 7 may perform the step of allocating the target execution service for the electronic device.
For example, fig. 13 is a schematic diagram of a server distributing an execution service to an electronic device according to an embodiment of the present application. Referring to fig. 13, in fig. 13, an example is taken in which a server includes two execution service clusters, and an execution service cluster a includes an execution service 1 to an execution service 3, where VPN IP addresses of the execution services in the execution service cluster a are allocated to a VPN service 1; the execution service cluster B includes execution services 4 to 6, and VPN IP addresses of the execution services in the execution service cluster B are allocated to the VPN service 2. The VPN Client IP address and number of connected devices for each executive service is shown in fig. 13. Assuming that the VPN Client IP address of the electronic device is 10.6.12.122, the server determines that the electronic device and the executive service cluster a are in the same IP network segment, and the executive service 2 is the executive service with the least number of currently connected devices in the executive service cluster a, and the server may assign the executive service 2 as a target executive service to the electronic device.
In some embodiments, after determining the target execution service corresponding to the electronic device, the connection service may perform the splicing process according to the VPN IP address and the daemon port identifier of the electronic device in the connection request, to obtain the connection execution command. For example, when the debug tool is ADB, the VPN IP address of the electronic device is 10.6.12.122, and the daemon port identifier is 5556, the connection execution command obtained by the connection service splicing may be: "adb connect 10.6.12.122:5556". The connection service may send the connection execution command to the target execution service, and if the target execution service determined by the connection service is the execution service 2 in fig. 13, the connection service may call an API interface of the execution service 2 to send the connection execution command to the execution service 2 according to the VPN IP address (10.6.12.6) of the execution service 2.
S1004: the target execution service in the server establishes a connection with the electronic device according to the VPN IP address of the electronic device.
In an alternative embodiment, the target execution service may obtain the VPN IP address of the electronic device from the connection request, the electronic device may obtain the VPN IP address of the target execution service, and the target execution service and the electronic device may establish a connection according to the VPN IP address of the electronic device and the VPN IP address of the target execution service.
In this embodiment of the present application, referring to fig. 7, the execution service may include sub-modules such as a proxy service, a debug client, and a debug server, where after receiving a connection execution command, the target execution service may call the debug client on the target execution service, so that the debug client establishes a connection with the debug server, the debug client sends the connection execution command to the debug server, and the debug server executes the connection execution command to establish a connection with the electronic device through a daemon port exposed by the electronic device.
For example, fig. 14 is a schematic diagram of a connection page provided in an embodiment of the application. Referring to fig. 14, after the electronic device establishes a connection with the target execution service, the electronic device may display "connected" in the connection page.
S1005: the server stores device information of the electronic device in a device database.
In an alternative embodiment, after the target execution service in the server establishes a connection with the electronic device, the connection service in the server may send the device information of the electronic device to the device management service, and the device management service stores the device information of the electronic device in the device database. For example, the device information of the electronic device may include at least one of a VPN IP address of the electronic device, a model number of the electronic device, a serial number of the electronic device, and the like.
The operation of the device management service storing the device information of the electronic device into the device database may also be referred to as a device warehousing operation, where the device management service performs the device warehousing operation and may be regarded as accessing the electronic device into the real machine platform, and thereafter, the electronic device may be used as one of the real machine platforms.
3. Device application and use
In this embodiment of the present application, after the server performs the device warehousing operation on the electronic device, other users may apply for using the electronic device to the server by using the user device. For example, a developer user may browse a device application page using a user device and apply for using an electronic device in the device application page. For another example, if a customer service person of a certain brand needs to deal with the equipment problem, the user can install a connection application on the electronic equipment, access his or her electronic equipment to the real machine platform, and the customer service person can apply for using the electronic equipment of the user on the equipment application page to deal with the equipment problem.
The embodiment of the application also provides a device application and use method of the true machine device. Fig. 15 is a flowchart of a method for applying and using a device according to an embodiment of the present application. Referring to fig. 15, the method includes the steps of:
S1501: and the user equipment responds to the user-triggered application using the operation of the electronic equipment and sends an equipment application request to the server.
In an alternative implementation manner, the user device may display a device application page, and the user may trigger an operation of applying for using the electronic device in the device application page. For example, fig. 16 is a schematic diagram of an equipment application page provided in an embodiment of the present application. Referring to fig. 16, the device application page may include a device list, and the user may select a filtering condition in the device application page to filter the electronic devices displayed in the device list. The screening conditions may include device type, brand, operating system, zone, etc. conditions as in fig. 16. The device application page may include information of a plurality of electronic devices, and the information of each electronic device in fig. 16 may include a brand of the electronic device, a model number of the electronic device, a serial number of the electronic device, and an operating system. The user may click on the "immediately used" control corresponding to the electronic device in the device application page shown in fig. 16, and the user device may send a device application request to the server.
S1502: the server inquires the device information of the electronic device from the device database according to the received device application request, and updates the device use state of the electronic device to be occupied.
In an alternative embodiment, after receiving the device application request, the device management service in the server may query the device database for the device information of the electronic device according to the serial number of the electronic device in the device application request. The device management service updates the use state of the electronic device to be occupied, and can also update the user of the electronic device to be the user account name corresponding to the user device. In the above way, the user equipment successfully applies for using the electronic equipment.
S1503: the user device receives a user input debug command.
After the user equipment successfully applies for using the electronic equipment, a debugging page can be displayed. The user can input a debugging command in the debugging page, wherein the debugging command is a command which the user wants to run on the electronic equipment, and by the mode, remote debugging on the electronic equipment can be realized.
For example, fig. 17 is a schematic diagram of a debug page provided in an embodiment of the present application. Referring to fig. 17, a display interface of an electronic device (e.g., device 1 in fig. 17) and information guiding a user to remotely connect the electronic device to debug may be displayed in a debug page, and an input box for a user to input a debug command may be further included in the debug page. The user may input a debug command in the input box and click on the execution control after the debug box to trigger the user device to send the debug command to the server.
S1504: the user equipment sends the debug command to the server.
Optionally, the device management service in the server may receive a debug command sent by the user device, and the device management service may obtain connection information of the electronic device, for example, the device management service may determine a target execution service corresponding to the electronic device. The device management service sends the debug command to the target execution service. The proxy service in the target execution service can call up the debugging client and send the debugging command to the debugging client, and the debugging client sends the debugging command to the debugging server.
S1505: the server sends the debug command to the electronic device.
In an alternative embodiment, the target execution service of the server may send the debug command to the electronic device. Optionally, the debugging server in the target execution service may send the debugging command to the electronic device through a daemon port of the electronic device.
S1506: the electronic device executes the debug command.
In this embodiment of the present application, after receiving a debug command sent by a target execution service, the electronic device may execute the debug command and obtain an execution result after executing the debug command.
Optionally, after the electronic device executes the debug command, if the execution result includes a transformation of the display interface, the electronic device may display the execution result in a display screen of the electronic device.
S1507: and the electronic equipment sends an execution result corresponding to the debugging command to the server.
Optionally, the electronic device may send an execution result corresponding to the debug command to a target execution service, where the target execution service sends the execution result corresponding to the debug command to the device management service.
S1508: and the server sends an execution result corresponding to the debugging command to the user equipment.
In an alternative embodiment, the device management service may send the execution result corresponding to the debug command to the user device.
S1509: and the user equipment displays the execution result.
Optionally, after receiving the execution result sent by the server, the user equipment may display the execution result in the debug page for the user to view. The user device may display the execution result in the debug page shown in fig. 17.
Based on the above embodiments, the present application further provides an electronic device, including at least one processor and at least one memory, where the at least one memory stores computer program instructions, and when the electronic device is running, the at least one processor executes a method executed by the electronic device in each method described in the embodiments of the present application. S1001 to S1002 and S1004 executed by the electronic device in the embodiment shown in fig. 10 are executed, for example; also for example, S1506-S1507 performed by the electronic device in the embodiment shown in fig. 15 are performed.
Based on the above embodiments, the present application further provides an electronic device, including a plurality of functional modules; the functional modules interact to realize functions executed by the first electronic device or the third electronic device in the methods described in the embodiments of the present application. S1001 to S1002 and S1004 executed by the electronic device in the embodiment shown in fig. 10 are executed, for example; also for example, S1506-S1507 performed by the electronic device in the embodiment shown in fig. 15 are performed. The plurality of functional modules may be implemented based on software, hardware, or a combination of software and hardware, and the plurality of functional modules may be arbitrarily combined or divided based on the specific implementation.
Based on the above embodiments, the present application further provides a server, where the server includes at least one processor and at least one memory, where the at least one memory stores computer program instructions, and where the at least one processor performs functions performed by the server in the methods described in the embodiments of the present application when the server is running. S1003-S1005 performed by the server in the embodiment shown in fig. 10 are performed. Also for example, S1502, S1504-S1505, S1507-S1508 performed by the electronic device in the embodiment shown in FIG. 15 are performed.
Based on the above embodiments, the present application further provides a server, including a plurality of functional modules; the functional modules interact to realize functions executed by the server in the methods described in the embodiments of the present application. S1003-S1005 performed by the server in the embodiment shown in fig. 10 are performed. Also for example, S1502, S1504-S1505, S1507-S1508 performed by the electronic device in the embodiment shown in FIG. 15 are performed. The plurality of functional modules may be implemented based on software, hardware, or a combination of software and hardware, and the plurality of functional modules may be arbitrarily combined or divided based on the specific implementation.
Based on the above embodiments, the present application also provides a computer program which, when run on a computer, causes the computer to perform the methods described in the embodiments of the present application.
Based on the above embodiments, the present application also provides a computer-readable storage medium having stored therein a computer program which, when executed by a computer, causes the computer to perform the methods described in the embodiments of the present application.
Based on the above embodiments, the present application further provides a chip, where the chip is configured to read a computer program stored in a memory, and implement the methods described in the embodiments of the present application.
Based on the above embodiments, the present application provides a chip system including a processor for supporting a computer device to implement the methods described in the embodiments of the present application. In one possible design, the chip system further includes a memory for storing programs and data necessary for the computer device. The chip system can be composed of chips, and can also comprise chips and other discrete devices.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be apparent to those skilled in the art that various modifications and variations can be made in the present application without departing from the scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims and the equivalents thereof, the present application is intended to cover such modifications and variations.

Claims (17)

1. The device connection method is characterized by being applied to a debugging system, wherein the debugging system comprises a server and electronic devices; the server comprises a connection service and an execution service; the method comprises the following steps:
the electronic equipment responds to the connection operation triggered by the user and sends a connection request to the connection service; the connection request includes a virtual private network internet protocol, VPN, IP, address of the electronic device;
the connection service determines a target execution service according to the connection request, wherein the target execution service and the electronic equipment have the same network segment address;
the electronic equipment acquires a VPN IP address of the target execution service;
establishing connection between the target execution service and the electronic equipment according to the VPN IP address of the electronic equipment and the VPN IP address of the target execution service; the connection is used for the server to issue a debugging command to the electronic equipment and for the electronic equipment to return an execution result corresponding to the debugging command to the server.
2. The method of claim 1, wherein the server comprises a plurality of executive services having the same network segment address as the electronic device, the target executive service being the least number of currently connected devices of the plurality of executive services.
3. The method of claim 1 or 2, wherein the connection request further comprises a daemon port identification of the electronic device; the daemon port identification is used for the electronic device and the target execution service to establish the connection.
4. A method according to any of claims 1-3, wherein after the target executive service establishes a connection with the electronic device, the method further comprises:
and the server stores the equipment information of the electronic equipment into an equipment database of the server.
5. The method of any of claims 1-4, wherein prior to the target execution service establishing a connection with the electronic device, the method further comprises:
the server receives a VPN verification request sent by the electronic equipment, wherein the VPN verification request is used for requesting the server to verify whether VPN account information corresponding to the electronic equipment exists;
when the VPN account information corresponding to the electronic equipment does not exist, the server creates a VPN account corresponding to the electronic equipment, and the server sends the VPN account information corresponding to the electronic equipment; the electronic equipment acquires a VPN IP address of the electronic equipment according to the VPN account information;
When the VPN account information corresponding to the electronic equipment exists, the electronic equipment acquires the VPN IP address of the electronic equipment according to the VPN account information.
6. The method of claim 5, wherein prior to the electronic device obtaining the VPN IP address of the electronic device from the VPN account information, the method further comprises:
if the electronic equipment does not have the corresponding certificate information of the VPN account locally, the electronic equipment downloads the VPN certificate information locally and generates a configuration file required for establishing the connection.
7. The method of any one of claims 1-6, wherein the method further comprises:
the server distributes VPN IP addresses for each execution service; and
the server allocates a VPN IP address for the electronic device.
8. The method of any of claims 1-7, wherein after the target execution service establishes a connection with the electronic device, the method further comprises:
the server receives an equipment application request sent by user equipment, wherein the equipment application request is used for requesting to debug by using the electronic equipment;
the target execution service sends the debugging command to the electronic equipment through the connection;
The electronic equipment executes the debugging command and sends an execution result corresponding to the debugging command to the target execution service through the connection;
and the server sends an execution result corresponding to the debugging command to the user equipment.
9. A device connection method, characterized by being applied to an electronic device, the method comprising:
responding to the connection operation triggered by the user, and sending a connection request to the connection service of the server; wherein the connection request includes a virtual private network internet protocol, VPN, IP, address of the electronic device;
acquiring a VPN IP address of a target execution service; the target execution service is an execution service with the same network segment address as the electronic equipment in the server;
establishing connection with the target execution service according to the VPN IP address of the target execution service; the connection is used for the server to issue a debugging command to the electronic equipment and for the electronic equipment to return an execution result corresponding to the debugging command to the server.
10. The method of claim 9, wherein the server comprises a plurality of executive services having the same network segment address as the electronic device, the target executive service being the least number of currently connected devices of the plurality of executive services.
11. The method of claim 9 or 10, wherein the connection request further comprises a daemon port identification of the electronic device; the daemon port identification is used for the electronic device and the target execution service to establish the connection.
12. The method according to any of claims 9-11, wherein before the establishing a connection according to the VPN IP address of the target execution service with the target execution service in the server, the method further comprises:
a VPN verification request is sent to the server, and the VPN verification request is used for requesting the server to verify whether VPN account information corresponding to the electronic equipment exists or not;
when the VPN account information corresponding to the electronic equipment does not exist, receiving the VPN account information corresponding to the electronic equipment, which is sent by the server, and acquiring a VPN IP address of the electronic equipment according to the VPN account information;
and when the VPN account information corresponding to the electronic equipment exists, acquiring the VPN IP address of the electronic equipment according to the VPN account information.
13. The method of claim 12, wherein prior to the acquiring the VPN IP address of the electronic device from the VPN account information, the method further comprises:
And if the certificate information corresponding to the VPN account does not exist, downloading the VPN certificate information to the local, and generating a configuration file required for establishing connection.
14. The method according to any of claims 9-13, wherein after the establishing a connection according to the VPN IP address of the target execution service with the target execution service in the server, the method further comprises:
receiving a debugging command sent by the target connection service through the connection, wherein the debugging command is sent to the server by user equipment;
executing the debugging command, and sending an execution result corresponding to the debugging command to the target execution service through the connection.
15. An electronic device comprising at least one processor coupled to at least one memory, the at least one processor configured to read a computer program stored by the at least one memory to perform the method of any of claims 9-14.
16. A server comprising at least one processor coupled to at least one memory, the at least one processor configured to read a computer program stored in the at least one memory to perform the functions performed by the server in the method of any of claims 1-8.
17. A computer readable storage medium having instructions stored therein which, when run on a computer, cause the computer to perform the method of any one of claims 9-14 or perform the functions performed by the server in the method of any one of claims 1-8.
CN202210999999.XA 2022-08-19 2022-08-19 Equipment connection method and equipment Pending CN117640717A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210999999.XA CN117640717A (en) 2022-08-19 2022-08-19 Equipment connection method and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210999999.XA CN117640717A (en) 2022-08-19 2022-08-19 Equipment connection method and equipment

Publications (1)

Publication Number Publication Date
CN117640717A true CN117640717A (en) 2024-03-01

Family

ID=90027529

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210999999.XA Pending CN117640717A (en) 2022-08-19 2022-08-19 Equipment connection method and equipment

Country Status (1)

Country Link
CN (1) CN117640717A (en)

Similar Documents

Publication Publication Date Title
EP4002108B1 (en) Application start method and electronic device
CN112291764B (en) Content connection system
CN111684778B (en) Implementation method of application function and electronic equipment
CN111434132A (en) Method and terminal for opening account of eSIM card
WO2022089207A1 (en) Cross-device application interaction method, electronic device, and server
CN113094123A (en) Method and device for realizing functions in application program, electronic equipment and storage medium
CN112738143B (en) Account number binding method, device and system
CN110602686A (en) Method for using remote SIM module and electronic equipment
CN115080941B (en) Account login method and electronic equipment
CN115499897B (en) WiFi network access method and related device
CN112860445B (en) Method and terminal for sharing data between fast application and native application
CN116431044A (en) Method and device for starting application program and terminal equipment
EP4095723B1 (en) Permission reuse method, permission reuse-based resource access method, and related device
CN115048642A (en) Communication method between trusted applications in multiple trusted execution environments and electronic equipment
WO2023005711A1 (en) Service recommendation method and electronic device
CN117640717A (en) Equipment connection method and equipment
CN114862398A (en) Distributed safety equipment-based risk control method and related device
CN110868640A (en) Resource transfer method, device, equipment and storage medium
CN114741008B (en) Distributed cross-device cooperation method, electronic device and communication system
CN115981576B (en) Method for sharing data, electronic device and storage medium
CN117216428B (en) Webpage resource request method, terminal equipment and computer readable storage medium
WO2023165413A1 (en) Application development system and method, and device
CN117950677A (en) Software distribution method, electronic equipment and system
CN117857646A (en) Data network sharing method, electronic equipment and storage medium
CN116933219A (en) Application program authority management method, system and related 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