Remote debugging method, device, electronic equipment and storage medium
The remote debugging method using a proxy server to allocate sessions based on authentication passwords addresses inefficiencies in existing methods, ensuring secure and efficient fault handling without firewalls or VPNs, enhancing debugging performance.
Patent Information
- Application Number
- CN202111160107.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-30
- Publication Date
- 2024-12-06
- Estimated Expiration
- 2041-09-30
AI Technical Summary
Existing remote debugging technologies fail to address the inefficiencies in handling faults or problems in a timely manner due to the need for network configurations like firewalls and VPNs, leading to low debugging efficiency.
A remote debugging method utilizing a proxy server to allocate debugging sessions based on matching authentication passwords between a debugging server and client, enabling secure and efficient information forwarding without requiring firewalls or VPNs.
Enables timely and high-performance fault handling by establishing secure, quasi-real-time connections for remote debugging, improving efficiency and responsiveness in complex online environments.
Smart Images

Figure CN114090422B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of remote debugging technology, and in particular to a remote debugging method, device, electronic device and storage medium. Background Art
[0002] At present, developers monitor through online monitoring systems that a user has a fault when using an application on a terminal, or users pass on the problems encountered in the process of using an application on a terminal to developers through feedback, so that developers can understand the various problems that users encounter when using the application on the terminal, and thus need to debug. The existing solution is to perform specific network configuration before debugging to remotely connect to the user terminal, for example, setting up a firewall, VPN (i.e., virtual private network), etc., so faults or problems cannot be handled in a timely manner, and the debugging efficiency is relatively low. Summary of the invention
[0003] In order to solve the above technical problems or at least partially solve the above technical problems, the present application provides a remote debugging method, device, electronic device and storage medium.
[0004] In a first aspect, the present application provides a remote debugging method, which is executed by a proxy server and includes:
[0005] Determine the matching debugging server and the matching client to be debugged according to the debugging authentication passwords generated by the debugging server and the client to be debugged respectively, and allocate corresponding debugging sessions to the matching debugging server and the client to be debugged;
[0006] Through the debugging session, the debugging instruction sent by the debugging server is forwarded to the matching client to be debugged, and the execution result of the debugging instruction by the client to be debugged is forwarded to the debugging server.
[0007] In a second aspect, the present application provides a remote debugging method, which is executed by a debugging server, and includes:
[0008] Generate a corresponding debugging authentication password according to the device identification of the client to be debugged, and send the debugging authentication password to the proxy server, so that the proxy server determines the matching debugging server and the client to be debugged according to the debugging authentication passwords generated by the debugging server and the client to be debugged, respectively, and allocates a corresponding debugging session to the matching debugging server and the client to be debugged;
[0009] After the debugging session is allocated, the debugging instruction is determined and sent to the proxy server so that the proxy server forwards the debugging instruction issued by the debugging server to the matching client to be debugged through the debugging session and forwards the execution result of the debugging instruction by the client to be debugged to the debugging server.
[0010] In a third aspect, the present application provides a remote debugging method, which is executed by a client to be debugged, and the method includes:
[0011] Generate a corresponding debugging authentication password according to the device identification of the client to be debugged, and send the debugging authentication password to the proxy server, so that the proxy server determines the matching debugging server and the client to be debugged according to the debugging authentication passwords generated by the debugging server and the client to be debugged respectively, and allocates a corresponding debugging session to the matching debugging server and the client to be debugged, and forwards the debugging instruction issued by the debugging server to the matching client to be debugged through the debugging session;
[0012] After the debugging session is allocated, the debugging instruction sent by the proxy server is received, the debugging instruction is executed, and the execution result is sent to the proxy server.
[0013] In a fourth aspect, the present application provides a remote debugging device, comprising:
[0014] The session allocation module is used to determine the matching debugging server and the client to be debugged according to the debugging authentication passwords generated by the debugging server and the client to be debugged respectively, and allocate corresponding debugging sessions to the matching debugging server and the client to be debugged;
[0015] The information forwarding module is used to forward the debugging instruction issued by the debugging server to the matching client to be debugged through the debugging session, and forward the execution result of the debugging instruction by the client to be debugged to the debugging server.
[0016] In a fifth aspect, the present application provides a remote debugging device, comprising:
[0017] A password generation module, used to generate a corresponding debugging authentication password according to the device identification of the client to be debugged, and send the debugging authentication password to the proxy server, so that the proxy server determines the matching debugging server and the client to be debugged according to the debugging authentication passwords generated by the debugging server and the client to be debugged respectively, and allocates a corresponding debugging session to the matching debugging server and the client to be debugged;
[0018] The instruction issuing module is used to determine the debugging instruction after allocating the debugging session, send the debugging instruction to the proxy server so that the proxy server can forward the debugging instruction issued by the debugging server to the matching client to be debugged through the debugging session, and forward the execution result of the debugging instruction by the client to be debugged to the debugging server.
[0019] In a sixth aspect, the present application provides a remote debugging device, including:
[0020] A password generation module is used to generate a corresponding debugging authentication password according to the device identification of the client to be debugged, and send the debugging authentication password to the proxy server, so that the proxy server determines the matching debugging server and the client to be debugged according to the debugging authentication passwords generated by the debugging server and the client to be debugged respectively, and allocates a corresponding debugging session to the matching debugging server and the client to be debugged, and forwards the debugging instruction issued by the debugging server to the matching client to be debugged through the debugging session;
[0021] The instruction execution module is used to receive the debugging instruction sent by the proxy server after the debugging session is allocated, execute the debugging instruction, and send the execution result to the proxy server.
[0022] In a seventh aspect, the present application provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus;
[0023] Memory, used to store computer programs;
[0024] The processor is used to implement the steps of the above remote debugging method when executing the program stored in the memory.
[0025] In an eighth aspect, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above-mentioned remote debugging method are implemented.
[0026] The method provided in the embodiment of the present application allocates corresponding debugging sessions to the matching debugging server and the client to be debugged, and uses the proxy server as a transfer station for the debugging session to forward information between the debugging server and the client to be debugged. This method does not require the setting of firewalls, VPNs (i.e., virtual private networks), etc., can handle faults or problems in a timely manner, has high real-time performance, and thus improves the efficiency of fault debugging. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0028] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0029] Figure 1 A schematic diagram of a system architecture involved in an embodiment of the present application;
[0030] Figure 2 A flowchart of a remote debugging method provided in an embodiment of the present application;
[0031] Figure 3 A structural block diagram of a remote debugging device provided in an embodiment of the present application;
[0032] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0033] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0034] The present application embodiment provides a remote debugging solution, such as Figure 1 As shown, the system architecture of the present application includes a debugging server 110 , a proxy server 120 , and a client 130 to be debugged.
[0035] The debugging server 110 may be a debugging server or a server cluster formed by multiple debugging servers. The debugging server 110 serves as a debugging background for debugging staff (eg, developers) to issue debugging instructions.
[0036] Among them, the proxy server 120 can be a proxy server (for example, an instant messaging (IM) signaling proxy server) or a server cluster formed by multiple proxy servers. The proxy server 120 serves as a transit station between the debugging server 110 and the client 130 to be debugged, and can allocate debugging sessions, forward information, etc.
[0037] The client to be debugged 130 is installed on a terminal, which is called the terminal to be debugged. The client to be debugged 130 can be any client, such as a video playback client, a news client, a recruitment client, etc.
[0038] In the first aspect, based on the above system architecture, the present application provides a remote debugging method, which is executed by the proxy server 120 in the system architecture. The proxy server 120 is a communication intermediary between the debugging server and the client to be debugged, and intervenes in the entire debugging process, such as Figure 2 As shown, the remote debugging method includes:
[0039] S210, determining the matching debugging server and the client to be debugged according to the debugging authentication passwords generated by the debugging server and the client to be debugged respectively, and allocating corresponding debugging sessions to the matching debugging server and the client to be debugged;
[0040] For example, when the debugging staff monitors through the online monitoring system that a user has a malfunction when using an application on the terminal, or the user transmits the problems encountered in the process of using an application on the terminal to the back-end staff through feedback, there is a need for remote debugging. At this time, the back-end staff makes a debugging request and applies for permission approval. To ensure safety, only the approved staff can debug the client to be debugged. After approval, the debugging server, that is, the back-end server, sets a debugging flag for the device identification of each client to be debugged in the preset interface, which means that the client to be debugged corresponding to the device identification will enter the debugging state later; then, the debugging server generates the corresponding debugging authentication password. When the client to be debugged is started, it will request the preset interface, parse the requested information to obtain the debugging flag, and then generate a debugging authentication password based on the device information.
[0041] That is, when the need for remote debugging arises, the debugging server can generate a debugging authentication password, and when the preset interface has a debugging flag, the client to be debugged can generate a debugging authentication password.
[0042] Among them, both the debugging server and the client to be debugged will generate a debugging authentication password, and the debugging authentication passwords generated by the two are compared. If the debugging authentication passwords of the two are consistent, it can be considered that the two are matched. It can be seen that the debugging authentication password is used to match the debugging server and the client to be debugged. Among them, the specific information contained in the debugging authentication password can be set according to the specific situation. For example, the debugging authentication password contains the device information corresponding to the client to be debugged. If the debugging authentication password generated by the debugging server and the debugging authentication password generated by the client to be debugged contain the same device information, it can be considered that the debugging authentication passwords of the two are consistent.
[0043] The device information is the device information of the terminal to be debugged, for example, the device identification.
[0044] In specific implementation, the matching process in step S210 may specifically include:
[0045] S211, receiving the debugging authentication password sent by the debugging server and the debugging authentication password generated by the client to be debugged;
[0046] S212: performing consistency comparison between the debugging authentication password sent by the debugging server and the debugging authentication password sent by the client to be debugged, and determining that the debugging server and the client to be debugged corresponding to the consistent debugging authentication passwords are matched.
[0047] In specific implementation, when it is necessary to debug clients on multiple terminals at the same time, since each client to be debugged will generate a debugging authentication password, multiple clients to be debugged will correspond to multiple debugging authentication passwords, and the debugging server will also generate multiple debugging authentication passwords for these multiple clients, so it is necessary to match the debugging authentication password sent by the debugging server with the debugging authentication password generated by the client to be debugged. For example, when it is necessary to debug three clients, the debugging server will generate three debugging authentication passwords, and then send these three debugging authentication passwords to the proxy server; three clients to be debugged will generate three debugging authentication passwords, and each client to be debugged will send its own generated debugging authentication password to the proxy server, so that the proxy server will also receive three debugging authentication passwords from the clients to be debugged. At this time, the proxy server needs to compare the consistency of the three debugging authentication passwords from the debugging server and the three debugging authentication passwords from the debugging clients, so as to obtain three pairs of consistent debugging authentication passwords, thereby forming three pairs of matching debugging servers and clients to be debugged.
[0048] It is understandable that allocating a debugging session, ie, a debugging Session, to a matching debugging server and a client to be debugged is actually allocating a special debugging channel, which is only used to debug the matching client to be debugged. The proxy server serves as a transfer station in the debugging session.
[0049] Of course, there are also cases where the matching fails, that is, the debugging authentication password generated by the debugging server is inconsistent with the debugging authentication password generated by the client to be debugged. At this time, the proxy server can feedback the matching failure message to the client to be debugged and the debugging server, and the client to be debugged then ends the debugging, and the debugging server notifies the staff who requested remote debugging.
[0050] S220: forwarding the debugging instruction issued by the debugging server to the matching client to be debugged through the debugging session, and forwarding the execution result of the debugging instruction by the client to be debugged to the debugging server.
[0051] In specific implementation, the debugging server will issue corresponding debugging instructions to the proxy server for the failure or problem of a client to be debugged, and then the proxy server will forward the received debugging instructions to the client to be debugged. When the client to be debugged receives the debugging instructions, the SDK (software development kit) integrated in the client to be debugged will parse the debugging instructions in turn and dispatch the parsed contents to the corresponding modules for execution. After each module is executed, the client to be debugged will collect the output information generated during the execution process and send the execution results to the proxy server, and then the proxy server will feed back the execution results to the debugging server, so that the debugging staff can know the debugging results, whether the debugging is successful or failed, or whether further debugging is needed, and then issue the next debugging instruction.
[0052] Based on the above steps, the debugging server and the client to be debugged are assigned corresponding debugging sessions, and the proxy server is used as a transfer station for the debugging session to forward information between the debugging server and the client to be debugged. This method does not require the setting of firewalls, VPNs (i.e., virtual private networks), etc., and can handle faults or problems in a timely manner with high real-time performance, thereby improving the efficiency of fault debugging.
[0053] In specific implementation, the present application may also include:
[0054] S200, setting a corresponding session identifier for the debugging session according to the debugging authentication passwords generated by the debugging server and the client to be debugged respectively, and saving the session identifier locally;
[0055] S230. Before each forwarding operation, compare the session identifier carried in the information to be forwarded with the session identifier stored locally. If the comparison is successful, perform the forwarding operation; the session identifier carried in the information to be forwarded is generated based on the debugging authentication password generated by the sending device of the information to be forwarded.
[0056] Among them, step S200 and step S230 are executed after step S210.
[0057] That is to say, after the debugging session is allocated, a corresponding session identifier is set for the debugging session and the session identifier is stored locally. Thus, before each forwarding operation, the session identifier carried in the information to be forwarded is compared with the session identifier stored locally, and if the comparison is successful, the forwarding operation is performed.
[0058] It is understandable that saving locally means saving on the proxy server, and the session identifier set by the proxy server for the debugging session is stored locally, so the session identifier can also be called a local session identifier.
[0059] It is understandable that the session identifier is generated based on the debugging authentication password, and the debugging authentication password is used to match the debugging server and the client to be debugged. Therefore, by comparing the session identifiers, it can be confirmed whether the communicating parties are matching debugging servers and clients to be debugged. In this way, before forwarding information each time, the proxy server compares the session identifier carried in the information with the local session identifier, which can ensure the security of each forwarding operation, that is, forwarding the information to the matching debugging server or client to be debugged.
[0060] Of course, in order to distinguish different debugging sessions, in addition to the debugging authentication password, the serial number can also be used. The debugging authentication password can be set according to the device information, and the serial number can be set according to the number of current debugging sessions. For example, if there are 4 debugging sessions, the serial numbers can be set to 001, 002, 003, and 004, etc., so as to further distinguish different debugging sessions.
[0061] In specific implementation, the specific process of setting the corresponding session identifier for the debugging session in step S200 may include: generating a first session identifier according to the serial number corresponding to the debugging session and the debugging authentication password generated by the debugging server, and generating a second session identifier according to the serial number and the debugging authentication password generated by the client to be debugged.
[0062] That is, the local session identifier includes the first session identifier and the second session identifier, and the first session identifier and the second session identifier both include the serial number and the debugging authentication password. The session identifier carried in the information can also be generated by the information sending device based on the debugging authentication password and serial number generated by it.
[0063] In specific implementation, the specific process of comparing the session identifier carried in the information to be forwarded with the session identifier stored locally in step S230 includes: if the information to be forwarded is a debugging instruction sent by the debugging server, the session identifier carried in the debugging instruction is compared with the second session identifier; if the information to be forwarded is an execution result sent by the client to be debugged, the session identifier carried in the execution result is compared with the first session identifier.
[0064] That is to say, if the information to be forwarded is a debugging instruction, the session identifier carried in the debugging instruction is compared with the second session identifier. The session identifier carried in the debugging instruction is generated based on the debugging authentication password generated by the debugging server, and the second session identifier is generated based on the debugging authentication password generated by the client to be debugged. Therefore, in addition to the comparison of the serial numbers, the debugging authentication password generated by the debugging server is compared with the debugging authentication password generated by the client to be debugged. If the information to be forwarded is an execution result, the session identifier carried in the execution result is compared with the first session identifier. The first session identifier is generated based on the debugging authentication password generated by the debugging server, and the session identifier carried in the execution result is generated based on the debugging authentication password generated by the client to be debugged. Therefore, in addition to the comparison of the serial numbers, the debugging authentication password generated by the debugging server is compared with the debugging authentication password generated by the client to be debugged. It can be seen that both methods are cross-comparison methods, thereby ensuring that the communicating parties are matching clients to be debugged and debugging servers.
[0065] In specific implementation, in order to clarify the exit mechanism of the debugging session, after the execution result of the last debugging instruction by the client to be debugged is forwarded to the debugging server in step S220, the debugging session is marked as an illegal state.
[0066] It is understandable that after the debugging session is allocated in step S210, the debugging session is in a legal state, and communication can be carried out through the debugging session. However, after the debugging session is marked as an illegal state, the proxy server will not forward information even if it receives information sent by the debugging server or the client to be debugged.
[0067] In actual scenarios, the local session identifier can be disconnected with a certain flag bit. In this way, when the proxy server compares the session identifier before forwarding information, if it finds a certain flag bit in the local session identifier, it will consider that the debugging session is in an illegal state and can no longer be forwarded.
[0068] Of course, when the proxy server confirms that the debugging session is in an illegal state, it will notify the client to be debugged to exit the debugging state, so that the client to be debugged will perform a cleanup operation, that is, clean up some intermediate data generated during the execution of debugging instructions to avoid occupying too much memory.
[0069] It is understandable that assigning debugging sessions to the debugging server and the client to be debugged actually creates a debugging channel with a private protocol. The online user of the client to be debugged can receive debugging instructions in a timely manner, and the offline user of the client to be debugged can also actively pull debugging instructions from the background server through http, which can achieve quasi-real-time connection between the background server and the terminal device, and improve the remote fault resolution effect and response speed.
[0070] In a second aspect, based on the above system architecture, the present application also provides a remote debugging method, which is executed by a debugging server and includes:
[0071] S240, generating a corresponding debugging authentication password according to the device identification of the client to be debugged, and sending the debugging authentication password to the proxy server, so that the proxy server determines the matching debugging server and the client to be debugged according to the debugging authentication passwords generated by the debugging server and the client to be debugged, respectively, and allocates a corresponding debugging session to the matching debugging server and the client to be debugged;
[0072] S250: After the debugging session is allocated, a debugging instruction is determined, and the debugging instruction is sent to the proxy server so that the proxy server forwards the debugging instruction issued by the debugging server to the matching client to be debugged through the debugging session, and forwards the execution result of the debugging instruction by the client to be debugged to the debugging server.
[0073] Among them, the above steps S240 and S250 correspond to S210 and S220 in the first aspect.
[0074] Through S250, the debugging server determines whether the debugging is successful or whether further debugging is required according to the received execution result.
[0075] In specific implementation, the method may further include: setting a debugging flag for the device identification of each client to be debugged in the preset interface. In this way, in S240, a corresponding debugging authentication password may be generated specifically according to the device identification of the client to be debugged and the debugging flag. At this time, the debugging authentication password includes the device identification and the debugging flag.
[0076] For example, when there is a need for debugging, the staff sets a debugging flag for the device identifier corresponding to the client to be debugged in its preset interface through the debugging server, thereby starting the subsequent steps.
[0077] Of course, if there is no debugging mark, you can also enter the subsequent steps. At this time, you can notify the terminal to enter the debugging state in other ways, for example, the debugging server sends a text message notification to the terminal, notifies through a mini program, and other notification methods.
[0078] In a third aspect, based on the above system architecture, the present application further provides a remote debugging method, which is executed by a client to be debugged, and includes:
[0079] S260, generating a corresponding debugging authentication password according to the device identification of the client to be debugged, and sending the debugging authentication password to the proxy server, so that the proxy server determines the matching debugging server and the client to be debugged according to the debugging authentication passwords generated by the debugging server and the client to be debugged respectively, and allocates a corresponding debugging session to the matching debugging server and the client to be debugged, and forwards the debugging instruction issued by the debugging server to the matching client to be debugged through the debugging session;
[0080] S270: After the debugging session is allocated, a debugging instruction sent by the proxy server is received, the debugging instruction is executed, and the execution result is sent to the proxy server.
[0081] Among them, the above steps S260 and S270 correspond to S240, S250 and S210, S220.
[0082] In specific implementation, after receiving the debugging instruction, the client to be debugged sends the debugging instruction to the module that can execute the debugging instruction, and the module executes the debugging instruction to obtain the execution result. Different debugging instructions may be executed by different modules, and the module here can be a functional module in the client to be debugged, or a hardware module or functional module of the terminal where the client to be debugged is located.
[0083] In specific implementation, the method may further include: obtaining a debugging identifier in a preset interface. Thus, in S260, a corresponding debugging authentication password may be generated according to the device identifier of the client to be debugged and the debugging identifier. At this time, the debugging authentication password includes the device identifier and the debugging identifier.
[0084] For example, when the client to be debugged is started, it will go to the preset interface to request information. If it is found through analysis that the obtained information contains a debugging flag, the client to be debugged enters the debugging state.
[0085] For example, in a specific scenario, when the debugging staff (for example, the developer) monitors through the online monitoring system that a user has a problem when using an application on the terminal, or the user passes the problem encountered in the process of using an application on the terminal to the back-end staff through feedback, the need for remote debugging arises. At this time, the back-end staff makes a debugging request and applies for permission approval. To ensure security, only approved staff can debug the client to be debugged. After approval, perform the following steps to implement remote debugging of the client to be debugged:
[0086] (1) The debugging server, i.e., the background server, sets a debugging flag for the device identification of each client to be debugged in a preset interface, which means that the client to be debugged corresponding to the device identification will enter a debugging state later; then, the debugging server generates a corresponding debugging authentication password, which is referred to as a first debugging authentication password, and sends the first debugging authentication password to the proxy server, wherein the first debugging authentication password specifically includes the debugging flag and the device information of the client to be debugged; wherein the preset interface is an interface agreed upon in advance and known to both the client and the server;
[0087] (2) When the client to be debugged is started, it will request the preset interface, parse the requested information to obtain the debugging flag, and then generate a debugging authentication password based on the debugging flag and device information. The password is called the second debugging authentication password, and then the second debugging authentication password is sent to the proxy server; the second debugging authentication password also includes the debugging flag and the device information of the client to be debugged;
[0088] (3) The proxy server compares the received first debugging authentication password and the second debugging authentication password. If there are consistent first debugging authentication password and second debugging authentication password, it is considered that the client to be debugged and the debugging server corresponding to the two passwords match. At this time, a corresponding debugging session is allocated to the matching client to be debugged and debugging server, and a corresponding session identifier is set for the debugging session and saved locally, which is called a local session identifier; wherein the local session identifier includes the first session identifier and the second session identifier, the first session identifier includes the serial number and the debugging authentication password generated by the debugging server, and the second session identifier includes the serial number and the debugging authentication password generated by the client to be debugged; if there are no consistent first debugging authentication password and second debugging authentication password, it is considered that the match fails, and the proxy server feeds back a message of the match failure to the client to be debugged and the debugging server, the client to be debugged ends the debugging process, and the debugging server notifies the staff who requested remote debugging;
[0089] (4) The debugging server formulates a debugging instruction for the fault or problem of the client to be debugged, and sends the debugging instruction and the session identifier generated by the debugging server (the session identifier includes the serial number and the debugging authentication password generated by the debugging server) to the proxy server; after receiving the debugging instruction, the proxy server compares the session identifier carried in the debugging instruction with the second session identifier. If the two are consistent, the comparison is successful, and the debugging instruction is sent to the client to be debugged; after the client to be debugged receives the debugging instruction, it sends the debugging instruction to the corresponding module for execution, obtains the execution result, and sends the execution result and the session identifier generated by the client to be debugged (the session identifier includes the serial number and the debugging authentication password generated by the client to be debugged) to the proxy server; after receiving the execution result, the proxy server compares the session identifier carried in the execution result with the first session identifier. If the two are consistent, the comparison is successful, and the execution result is sent to the debugging server; after receiving the execution result, the debugging server determines whether the debugging is successful, the debugging fails, or further debugging is required. If further debugging is required, the debugging instruction for further debugging is sent to the proxy server, and the above process is repeated until the final debugging result can be determined based on the execution result.
[0090] (5) When the final debugging result can be determined based on the execution result, that is, after the proxy server forwards the execution result of the last debugging instruction of the client to be debugged to the debugging server, the local session identifier is disconnected with a certain flag bit. In this way, when the proxy server compares the session identifiers before forwarding the information subsequently, if it finds that a certain flag bit exists in the local session identifier, it is considered that the debugging session is in an illegal state at this time and the forwarding operation can no longer be performed.
[0091] (6) The debugging client exits the debugging state and cleans up the intermediate data generated during the debugging process.
[0092] It can be seen that in the above process, the proxy server is used as an intermediary between the debugging server and the client to be debugged. There is no need to set up a firewall, VPN (i.e., virtual private network), etc., and faults or problems can be handled in a timely manner, achieving a quasi-real-time effect, improving the efficiency of debugging and locating problems, and being able to locate various problems arising in complex online environments more timely; moreover, it is determined whether the next debugging instruction needs to be issued based on the execution result of a debugging instruction, and debugging instructions are issued one by one instead of issuing a large amount of data at one time; in addition, after debugging is completed, the debugging session is set to an illegal state, which shows that the exit mechanism of the debugging session is very clear; in addition, the proxy server will compare the session identifier before forwarding information each time to ensure security.
[0093] In a fourth aspect, the present application provides a remote debugging device, such as Figure 3 As shown, the device 300 includes:
[0094] The session allocation module 310 is used to determine the matching debugging server and the client to be debugged according to the debugging authentication passwords generated by the debugging server and the client to be debugged respectively, and allocate corresponding debugging sessions to the matching debugging server and the client to be debugged;
[0095] The information forwarding module 320 is used to forward the debugging instruction issued by the debugging server to the matching client to be debugged through the debugging session and forward the execution result of the debugging instruction by the client to be debugged to the debugging server.
[0096] In a fifth aspect, the present application provides a remote debugging device, the device comprising:
[0097] A password generation module, used to generate a corresponding debugging authentication password according to the device identification of the client to be debugged, and send the debugging authentication password to the proxy server, so that the proxy server determines the matching debugging server and the client to be debugged according to the debugging authentication passwords generated by the debugging server and the client to be debugged respectively, and allocates a corresponding debugging session to the matching debugging server and the client to be debugged;
[0098] The instruction issuing module is used to determine the debugging instruction after allocating the debugging session, send the debugging instruction to the proxy server so that the proxy server can forward the debugging instruction issued by the debugging server to the matching client to be debugged through the debugging session, and forward the execution result of the debugging instruction by the client to be debugged to the debugging server.
[0099] In a sixth aspect, the present application provides a remote debugging device, the device comprising:
[0100] A password generation module is used to generate a corresponding debugging authentication password according to the device identification of the client to be debugged, and send the debugging authentication password to the proxy server, so that the proxy server determines the matching debugging server and the client to be debugged according to the debugging authentication passwords generated by the debugging server and the client to be debugged respectively, and allocates a corresponding debugging session to the matching debugging server and the client to be debugged, and forwards the debugging instruction issued by the debugging server to the matching client to be debugged through the debugging session;
[0101] The instruction execution module is used to receive the debugging instruction sent by the proxy server after the debugging session is allocated, execute the debugging instruction, and send the execution result to the proxy server.
[0102] Seventh, such as Figure 4As shown, an embodiment of the present application provides an electronic device, which may be a push server or a user device, and includes a processor 111, a communication interface 112, a memory 113, and a communication bus 114, wherein the processor 111, the communication interface 112, and the memory 113 communicate with each other through the communication bus 114.
[0103] Memory 113, used for storing computer programs;
[0104] In one embodiment of the present application, the processor 111 is used to implement the remote debugging method provided by any one of the aforementioned method embodiments when executing the program stored in the memory 113.
[0105] An embodiment of the present application further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the remote debugging method provided in any of the aforementioned method embodiments are implemented.
[0106] It is understandable that the explanations, examples, beneficial effects, etc. of the relevant contents of the remote debugging device, electronic device, and computer-readable storage medium provided in the embodiments of the present application can refer to the corresponding parts in the remote debugging method and will not be repeated here.
[0107] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0108] The foregoing is merely a specific embodiment of the present invention, which enables those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features claimed herein.
Claims
1. A remote debugging method, characterized in that: The method is executed by a proxy server, and the method includes: Determine the matching debugging server and the matching client to be debugged according to the debugging authentication passwords generated by the debugging server and the client to be debugged respectively, and allocate corresponding debugging sessions to the matching debugging server and the client to be debugged; Through the debugging session, the debugging instruction issued by the debugging server is forwarded to the matching client to be debugged, and the execution result of the debugging instruction by the client to be debugged is forwarded to the debugging server; According to the debugging authentication passwords respectively generated by the debugging server and the client to be debugged, a corresponding session identifier is set for the debugging session, and the session identifier is stored locally, including: Generate a first session identifier according to the serial number corresponding to the debugging session and the debugging authentication password generated by the debugging server, and generate a second session identifier according to the serial number and the debugging authentication password generated by the client to be debugged; Before each forwarding operation, the session identifier carried in the information to be forwarded is compared with the session identifier stored locally. If the comparison is successful, the forwarding operation is performed; the session identifier carried in the information to be forwarded is generated according to the debugging authentication password generated by the sending device of the information to be forwarded; The comparing the session identifier carried in the information to be forwarded with the session identifier stored locally includes: If the information to be forwarded is a debugging instruction sent by the debugging server, the session identifier carried in the debugging instruction is compared with the second session identifier; if the information to be forwarded is an execution result sent by the client to be debugged, the session identifier carried in the execution result is compared with the first session identifier.
2. The method according to claim 1, characterized in that The step of determining the matching debugging server and the client to be debugged according to the debugging authentication passwords respectively generated by the debugging server and the client to be debugged includes: Receiving the debugging authentication password sent by the debugging server and the debugging authentication password generated by the client to be debugged; The debugging authentication password sent by the debugging server is compared with the debugging authentication password sent by the client to be debugged for consistency, and the debugging server and the client to be debugged corresponding to the consistent debugging authentication passwords are determined to be matched.
3. The method according to claim 1, characterized in that The method further includes: after forwarding the execution result of the last debugging instruction by the client to be debugged to the debugging server, marking the debugging session as an illegal state.
4. A remote debugging method, characterized in that: The method is executed by a debugging server, and the method includes: Generate a corresponding debugging authentication password according to the device identification of the client to be debugged, and send the debugging authentication password to the proxy server, so that the proxy server determines the matching debugging server and the client to be debugged according to the debugging authentication passwords generated by the debugging server and the client to be debugged, respectively, and allocates a corresponding debugging session to the matching debugging server and the client to be debugged; After the debugging session is allocated, a debugging instruction is determined, and the debugging instruction is sent to the proxy server so that the proxy server forwards the debugging instruction issued by the debugging server to the matching client to be debugged through the debugging session, and forwards the execution result of the debugging instruction by the client to be debugged to the debugging server; Generate a corresponding debugging authentication password according to the device identification of the client to be debugged, and send the debugging authentication password to the proxy server, so that the proxy server sets a corresponding session identification for the debugging session and stores the session identification locally, including generating a first session identification according to a serial number corresponding to the debugging session and the debugging authentication password generated by the debugging server, and generating a second session identification according to the serial number and the debugging authentication password generated by the client to be debugged; Before each forwarding operation, the session identifier carried in the information to be forwarded is compared with the session identifier stored locally. If the comparison is successful, the forwarding operation is performed; the session identifier carried in the information to be forwarded is generated according to the debugging authentication password generated by the sending device of the information to be forwarded; The comparing the session identifier carried in the information to be forwarded with the session identifier stored locally includes: if the information to be forwarded is a debugging instruction sent by the debugging server, comparing the session identifier carried in the debugging instruction with the second session identifier; if the information to be forwarded is an execution result sent by the client to be debugged, comparing the session identifier carried in the execution result with the first session identifier.
5. The method according to claim 4, characterized in that Also includes: Set a debugging flag for the device ID of each client to be debugged in the preset interface; The generating a corresponding debugging authentication password according to the device identification of the client to be debugged includes: generating a corresponding debugging authentication password according to the device identification of the client to be debugged and the debugging flag.
6. A remote debugging method, characterized in that: The method is executed by a client to be debugged, and the method includes: Generate a corresponding debugging authentication password according to the device identification of the client to be debugged, and send the debugging authentication password to the proxy server, so that the proxy server determines the matching debugging server and the client to be debugged according to the debugging authentication passwords generated by the debugging server and the client to be debugged respectively, and allocates a corresponding debugging session to the matching debugging server and the client to be debugged, and forwards the debugging instruction issued by the debugging server to the matching client to be debugged through the debugging session; After the debugging session is allocated, the debugging instruction sent by the proxy server is received, the debugging instruction is executed, and the execution result is sent to the proxy server; Generate a corresponding debugging authentication password according to the device identifier of the client to be debugged, and send the debugging authentication password to the proxy server, so that the proxy server sets a corresponding session identifier for the debugging session and stores the session identifier locally, including generating a first session identifier according to the serial number corresponding to the debugging session and the debugging authentication password generated by the debugging server, and generating a second session identifier according to the serial number and the debugging authentication password generated by the client to be debugged, and before each forwarding operation, compare the session identifier carried in the information to be forwarded with the session identifier stored locally, and if the comparison is successful, perform the forwarding operation; the session identifier carried in the information to be forwarded is generated according to the debugging authentication password generated by the sending device of the information to be forwarded; The comparing the session identifier carried in the information to be forwarded with the session identifier stored locally includes: if the information to be forwarded is a debugging instruction sent by the debugging server, comparing the session identifier carried in the debugging instruction with the second session identifier; if the information to be forwarded is an execution result sent by the client to be debugged, comparing the session identifier carried in the execution result with the first session identifier.
7. The method according to claim 6, characterized in that Also includes: Get debug flag in preset interface; The generating a corresponding debugging authentication password according to the device identification of the client to be debugged includes: generating a corresponding debugging authentication password according to the device identification of the client to be debugged and the debugging flag.
8. A remote debugging device, characterized in that: include: The session allocation module is used to determine the matching debugging server and the client to be debugged according to the debugging authentication passwords generated by the debugging server and the client to be debugged respectively, and allocate corresponding debugging sessions to the matching debugging server and the client to be debugged; An information forwarding module, used for forwarding the debugging instruction issued by the debugging server to the matching client to be debugged through the debugging session, and forwarding the execution result of the debugging instruction by the client to be debugged to the debugging server; According to the debugging authentication passwords respectively generated by the debugging server and the client to be debugged, a corresponding session identifier is set for the debugging session, and the session identifier is stored locally, including: Generate a first session identifier according to the serial number corresponding to the debugging session and the debugging authentication password generated by the debugging server, and generate a second session identifier according to the serial number and the debugging authentication password generated by the client to be debugged; Before each forwarding operation, the session identifier carried in the information to be forwarded is compared with the session identifier stored locally. If the comparison is successful, the forwarding operation is performed; the session identifier carried in the information to be forwarded is generated according to the debugging authentication password generated by the sending device of the information to be forwarded; The comparing the session identifier carried in the information to be forwarded with the session identifier stored locally includes: If the information to be forwarded is a debugging instruction sent by the debugging server, the session identifier carried in the debugging instruction is compared with the second session identifier; if the information to be forwarded is an execution result sent by the client to be debugged, the session identifier carried in the execution result is compared with the first session identifier.
9. A remote debugging device, characterized in that: include: A password generation module, used to generate a corresponding debugging authentication password according to the device identification of the client to be debugged, and send the debugging authentication password to the proxy server, so that the proxy server determines the matching debugging server and the client to be debugged according to the debugging authentication passwords generated by the debugging server and the client to be debugged respectively, and allocates a corresponding debugging session to the matching debugging server and the client to be debugged; An instruction issuing module is used to determine the debugging instruction after allocating the debugging session, and send the debugging instruction to the proxy server so that the proxy server forwards the debugging instruction issued by the debugging server to the matching client to be debugged through the debugging session, and forwards the execution result of the debugging instruction by the client to be debugged to the debugging server; Generate a corresponding debugging authentication password according to the device identification of the client to be debugged, and send the debugging authentication password to the proxy server, so that the proxy server sets a corresponding session identification for the debugging session and stores the session identification locally, including generating a first session identification according to a serial number corresponding to the debugging session and the debugging authentication password generated by the debugging server, and generating a second session identification according to the serial number and the debugging authentication password generated by the client to be debugged; Before each forwarding operation, the session identifier carried in the information to be forwarded is compared with the session identifier stored locally. If the comparison is successful, the forwarding operation is performed; the session identifier carried in the information to be forwarded is generated according to the debugging authentication password generated by the sending device of the information to be forwarded; The comparing the session identifier carried in the information to be forwarded with the session identifier stored locally includes: if the information to be forwarded is a debugging instruction sent by the debugging server, comparing the session identifier carried in the debugging instruction with the second session identifier; If the information to be forwarded is the execution result sent by the client to be debugged, the session identifier carried in the execution result is compared with the first session identifier.
10. A remote debugging device, characterized in that: include: A password generation module is used to generate a corresponding debugging authentication password according to the device identification of the client to be debugged, and send the debugging authentication password to the proxy server, so that the proxy server determines the matching debugging server and the client to be debugged according to the debugging authentication passwords generated by the debugging server and the client to be debugged respectively, and allocates a corresponding debugging session to the matching debugging server and the client to be debugged, and forwards the debugging instruction issued by the debugging server to the matching client to be debugged through the debugging session; An instruction execution module, for receiving a debugging instruction sent by the proxy server after the debugging session is allocated, executing the debugging instruction, and sending the execution result to the proxy server; Generate a corresponding debugging authentication password according to the device identification of the client to be debugged, and send the debugging authentication password to the proxy server, so that the proxy server sets a corresponding session identification for the debugging session and stores the session identification locally, including generating a first session identification according to a serial number corresponding to the debugging session and the debugging authentication password generated by the debugging server, and generating a second session identification according to the serial number and the debugging authentication password generated by the client to be debugged; Before each forwarding operation, the session identifier carried in the information to be forwarded is compared with the session identifier stored locally. If the comparison is successful, the forwarding operation is performed; the session identifier carried in the information to be forwarded is generated according to the debugging authentication password generated by the sending device of the information to be forwarded; The comparing the session identifier carried in the information to be forwarded with the session identifier stored locally includes: if the information to be forwarded is a debugging instruction sent by the debugging server, comparing the session identifier carried in the debugging instruction with the second session identifier; If the information to be forwarded is the execution result sent by the client to be debugged, the session identifier carried in the execution result is compared with the first session identifier.
11. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, for implementing the steps of the method described in any one of claims 1 to 7 when executing a program stored in a memory.
12. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
