CN117440410B - FTP protocol-based debugging control method and debugging controller - Google Patents

FTP protocol-based debugging control method and debugging controller Download PDF

Info

Publication number
CN117440410B
CN117440410B CN202311767387.9A CN202311767387A CN117440410B CN 117440410 B CN117440410 B CN 117440410B CN 202311767387 A CN202311767387 A CN 202311767387A CN 117440410 B CN117440410 B CN 117440410B
Authority
CN
China
Prior art keywords
instruction
ftp
debugging
file
ftp server
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.)
Active
Application number
CN202311767387.9A
Other languages
Chinese (zh)
Other versions
CN117440410A (en
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.)
Guangzhou Tongze Kangwei Technology Co ltd
Original Assignee
Guangzhou Tongze Kangwei Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Tongze Kangwei Technology Co ltd filed Critical Guangzhou Tongze Kangwei Technology Co ltd
Priority to CN202311767387.9A priority Critical patent/CN117440410B/en
Publication of CN117440410A publication Critical patent/CN117440410A/en
Application granted granted Critical
Publication of CN117440410B publication Critical patent/CN117440410B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W24/00Supervisory, monitoring or testing arrangements
    • H04W24/02Arrangements for optimising operational condition
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a debugging control method and a debugging controller based on an FTP protocol, which are used for logging in an FTP server through the FTP protocol, generating an instruction file according to a debugging instruction input by a user, sending a first control instruction to the server, enabling the server to actively establish a first data transmission channel with the debugging controller, transmitting the instruction file to the server through the first channel, sending a second control instruction to control the server to establish a second data transmission channel with target equipment according to the instruction and transmitting the instruction file, and receiving a result file fed back by the target equipment; and sending a query instruction to the designated position of the server until the fact that the result file exists in the designated position is determined, and sending a third control instruction to enable the server to feed back the result file to the debugging controller. By the method, remote debugging control and state monitoring of the target equipment are realized with the help of the transfer station FTP server, and the real-time performance, accuracy and debugging efficiency of the user on equipment state monitoring are improved.

Description

FTP protocol-based debugging control method and debugging controller
Technical Field
The present invention relates to the field of network communications technologies, and in particular, to a debug control method and a debug controller based on an FTP protocol.
Background
Because of network environment requirements, the debug controller cannot directly establish connection communication with the CPE device, but the CPE device allows communication with the FTP server, which the debug controller also allows communication with. Therefore, in the prior art, most of CPE equipment automatically uploads a system operation log to an FTP server according to a period, and the FTP server transmits the system operation log to a user for viewing; or a management platform is established to be connected with the CPE equipment, the management platform issues a command to control the CPE equipment to upload the running log or the command result to the FTP server, and the FTP server transmits the running log or the command result to a user for viewing.
However, if the first type of system log is automatically uploaded by the device, the user can only check the system log on time and further perform delay debugging analysis on the device, but cannot debug the device in real time and check the state of the device; if the second method is adopted, a management platform needs to be deployed additionally, management needs to be carried out on the management platform, and more operation resources need to be occupied.
Disclosure of Invention
The invention provides a debugging control method and a debugging controller based on an FTP protocol, which are used for realizing the technical effects of debugging CPE equipment and checking the state of the equipment in real time while a management platform is not deployed.
In order to solve the technical problems, the invention provides a debugging control method based on an FTP protocol, which is applied to a debugging controller and comprises the following steps:
responding to a debugging start instruction, connecting and logging in to a corresponding FTP server through an FTP protocol, generating a corresponding instruction file according to the received debugging instruction, and sending a first control instruction to the FTP server so that the FTP server actively establishes a first data transmission channel with the debugging controller;
transmitting the instruction file to the FTP server through the first data transmission channel, sending a second control instruction to the FTP server, controlling the FTP server to actively establish a second data transmission channel with target equipment, and sending the instruction file to the target equipment through the second data transmission channel so as to enable the target equipment to feed back corresponding result files;
and sending a query instruction to the FTP server to determine whether the result file exists at a designated position, and if the result file exists at the designated position, sending a third control instruction to the FTP server to enable the FTP server to actively feed back the result file to the debugging controller through the first data transmission channel.
According to the debugging control method provided by the invention, after responding to the debugging starting instruction, the system logs in the FTP server through the FTP protocol, generates a corresponding instruction file according to the debugging instruction received from the user, and simultaneously sends a first control instruction to the FTP server, so that the server actively performs data connection with the debugging controller, and a first data transmission channel between the server and the debugging controller is built, so that the debugging controller transmits the instruction file and a second control instruction to the server to control the server to execute subsequent operations.
After the transmission channel is established, the system uploads the instruction file and a second control instruction to the FTP server, controls the FTP server to actively establish a second data transmission channel with the target equipment according to the second control instruction, and sends the instruction file to the target equipment through the established second data transmission channel, so that the target equipment feeds back a corresponding debugging result file after debugging according to the instruction file. According to the method, the remote sending of the modulation instruction to the target equipment can be realized, the target equipment carries out modulation operation according to the modulation instruction, and the corresponding debugging result is fed back, so that a user can determine whether the equipment is required to be debugged in the next step or is kept unchanged according to the feedback debugging result.
And when the FTP server forwards the instruction file for the second time, the debugging controller synchronously sends a query instruction to the designated position of the server to determine whether the result file fed back by the equipment exists, if so, a third control instruction is sent to the server to enable the server to actively download the result file to the debugging controller, and the debugging controller displays the result file to a user. The debugging control method provided by the invention takes the FTP server as the transfer station to realize data communication between the debugging controller, namely the user side, and the CPE equipment, namely the equipment side, thereby realizing remote debugging and state monitoring of the equipment by a user, improving the real-time performance and accuracy of the user for the state monitoring of the equipment, and simultaneously improving the efficiency of the system for remote debugging of the equipment.
As a preferable example, the generating a corresponding instruction file according to the received debug instruction specifically includes:
receiving and analyzing a debugging instruction input by a user, and determining FTP address information and FTP account information of the FTP server and the target equipment;
generating a corresponding instruction file identifier and an FTP uploading path according to the target device and the FTP address information respectively, and integrating the FTP address information, the FTP account information, the FTP uploading path, the instruction file identifier and the debugging instruction to generate the instruction file;
The instruction file identifier is used for being identified by the target device, and the FTP uploading path is used for identifying a transmission path between the designated position and the target device.
In order to realize the remote debugging function aiming at target equipment, the instruction file generated by the debugging control method according to the debugging instruction comprises FTP address information, FTP account information, an instruction file identifier and an FTP uploading path besides the debugging instruction.
The FTP address information is address information corresponding to the FTP server; the FTP account information is the account information content used for logging in the FTP server, and the target equipment can log in the FTP server through the FTP account information and realize feedback transmission of a result file; the instruction file identifier is used for identifying the instruction file so that the target equipment can identify the instruction file through the identifier; the FTP uploading path is used for identifying a transmission path between a designated position on the server and the target equipment, so that the target equipment transmits a result file to the designated position according to the uploading path, and further the debugging controller can conveniently inquire whether the result file exists according to the determined designated position, thereby realizing the closed-loop operation of remote debugging between the server and the target equipment by the debugging controller and ensuring the normal operation of a debugging control method.
The remote debugging and control of the debugging controller to the target equipment can be realized through the parameter contents, and meanwhile, the efficiency, the accuracy and the timeliness of the remote debugging of the equipment by the debugging controller are improved.
As a preferred example, the sending a first control instruction to the FTP server, so that the FTP server actively establishes a first data transmission channel with the debug controller, specifically:
the first control instruction is generated by calling and integrating a PORT command and a STOR command in the FTP protocol, the first control instruction is sent to the FTP server, so that the FTP server is adjusted to an active mode, and a link request signal is sent to a first designated PORT of the debug controller;
and feeding back a corresponding link establishment signal to the FTP server through the first designated port according to the received link request signal, so that the FTP server establishes the first data transmission channel with the debug controller through the first designated port.
In order to improve the debugging efficiency aiming at target equipment, the debugging control method provided by the invention also sends the first control instruction to the FTP server when the instruction file is generated, so that the server is adjusted to an active mode according to the first control instruction, and actively sends a link request signal to a debugging controller. After the debugging controller receives the link request signal, the system feeds back a link establishment signal to the server according to the received request signal, so that the server is ensured to actively establish a data transmission channel with the debugging controller, and then a data link is formed. The stability, safety and confidentiality of the data and files sent to the server by the debugging controller can be improved through the generated first data transmission channel.
As a preferred example, the controlling the FTP server to actively establish a second data transmission channel with the target device, and send the instruction file to the target device through the second data transmission channel specifically includes:
the second control instruction is fetched and integrated according to the PORT command and RETR command in the FTP protocol, the second control instruction is sent to the FTP server, so that the FTP server is adjusted to an active mode, and the second data transmission channel is established with the target equipment through a second designated PORT of the target equipment;
the instruction file is sent to the target equipment through the second data transmission channel, so that the target equipment is debugged according to the instruction file and feeds back a result file according to an FTP uploading path and FTP address information; the result file comprises a debugging result, FTP account information and a result file identifier.
After determining that the FTP server has received the second control instruction and the instruction file sent by the debug controller, the server will adjust the current running mode to the active mode according to the received second control instruction, and establish a second data channel with the target device through a second designated port of the target device, so as to facilitate transmission of the subsequent instruction file.
After the instruction file is transmitted to the target device through the second data transmission channel, the target device will debug the device according to the debug instruction content in the instruction file, collect the operation parameters after debugging of the device, and upload the operation parameters after debugging and the FTP account information and the result file identifier to the FTP server according to the FTP upload path and the FTP address information, thereby realizing the feedback of the target device for the received debug instruction. Meanwhile, as the uploading path of the result file is the FTP uploading path determined by the debugging controller, the debugging controller can determine whether the result file is fed back to the server according to the designated position on the server determined by the FTP uploading path, namely determine whether the target device has executed the debug completion instruction, so that the condition that timeliness of the result file is reduced because the debugging controller cannot determine whether the device has completed debugging is avoided.
As a preferred example, the sending a query instruction to the FTP server determines whether the result file exists at a specified location, and if it is determined that the result file exists at the specified location, sending a third control instruction to the FTP server specifically includes:
Determining the appointed position according to the FTP uploading path, sending a query instruction to the appointed position, and determining whether the result file exists in the appointed position according to the corresponding query feedback instruction;
if the result file exists in the designated position according to the query feedback instruction, retrieving and integrating the result file into the third control instruction according to the PORT command and RETR command in the FTP protocol, and transmitting the third control instruction to the FTP server;
and if the result file does not exist in the appointed position according to the query feedback instruction, sending the query instruction to the FTP server according to a preset query period until the result file exists in the appointed position according to the query feedback instruction.
In order to further improve timeliness of the result file fed back by the target device, after the second control instruction and the instruction file are sent, the system sends a query instruction to a designated position on the server determined according to the FTP uploading path, and determines whether the result file fed back by the target device exists at the designated position according to the query feedback instruction fed back by the server, so as to judge whether the target device has completed a debugging process of the debugging instruction, and further determine whether an error or a fault occurs in the debugging process.
If the result file exists at the designated position according to the received query feedback instruction, the target equipment is indicated to normally execute the debugging instruction and generate a corresponding result file, and the debugging controller can send a third control instruction to the server to call the result file and display the result file to a user for debugging analysis; if the result file does not exist at the designated position according to the received query feedback instruction, the target equipment is indicated to possibly not execute the debugging instruction, or the target equipment is indicated to have errors or faults in the process of executing the debugging instruction, the system continuously transmits the query instruction at the designated position to the server according to the query period until the received query feedback instruction displays the result file at the designated position, or continuously transmits the query instruction at the designated position according to the query period until the received query feedback instruction displays the result file still not exist at the designated position after a certain period of time, and the system indicates that the execution of the instruction file has errors or faults and needs maintenance personnel to perform barrier removal processing.
Correspondingly, the invention also provides a debugging controller, which comprises a debugging starting module, a data transmission module and a result feedback module;
The debugging starting module is used for responding to a debugging starting instruction, connecting and logging in to a corresponding FTP server through an FTP protocol, generating a corresponding instruction file according to the received debugging instruction, and sending a first control instruction to the FTP server so that the FTP server actively establishes a first data transmission channel with the debugging controller;
the data transmission module is used for transmitting the instruction file to the FTP server through the first data transmission channel, sending a second control instruction to the FTP server, controlling the FTP server to actively establish a second data transmission channel with target equipment, and sending the instruction file to the target equipment through the second data transmission channel so as to enable the target equipment to feed back corresponding result files;
and the result feedback module is used for sending a query instruction to the FTP server to determine whether the result file exists at the designated position, and sending a third control instruction to the FTP server if the result file exists at the designated position, so that the FTP server actively feeds back the result file to the debugging controller through the first data transmission channel.
As a preferred example, the debug start module generates a corresponding instruction file according to the received debug instruction, specifically:
receiving and analyzing a debugging instruction input by a user, and determining FTP address information and FTP account information of the FTP server and target address information of the target equipment;
generating a corresponding instruction file identifier and an FTP uploading path according to the target device and the FTP address information respectively, and integrating the FTP address information, the FTP account information, the FTP uploading path, the instruction file identifier and the debugging instruction to generate the instruction file;
the instruction file identifier is used for being identified by the target device, and the FTP uploading path is used for identifying a transmission path between the designated position and the target address information.
As a preferred example, the debug start module sends a first control instruction to the FTP server, so that the FTP server actively establishes a first data transmission channel with the debug controller, specifically:
the first control instruction is generated by calling and integrating a PORT command and a STOR command in the FTP protocol, the first control instruction is sent to the FTP server, so that the FTP server is adjusted to an active mode, and a link request signal is sent to a first designated PORT of the debug controller;
And feeding back a corresponding link establishment signal to the FTP server through the first designated port according to the received link request signal, so that the FTP server establishes the first data transmission channel with the debug controller through the first designated port.
As a preferred example, the data transmission module controls the FTP server to actively establish a second data transmission channel with the target device, and sends the instruction file to the target device through the second data transmission channel, which specifically includes:
the second control instruction is fetched and integrated according to the PORT command and RETR command in the FTP protocol, the second control instruction is sent to the FTP server, so that the FTP server is adjusted to an active mode, and the second data transmission channel is established with the target equipment through a second designated PORT of the target equipment;
the instruction file is sent to the target equipment through the second data transmission channel, so that the target equipment is debugged according to the instruction file and feeds back a result file according to an FTP uploading path and FTP address information; the result file comprises a debugging result, FTP account information and a result file identifier.
As a preferred example, the result feedback module sends a query instruction to the FTP server to determine whether the result file exists at the designated location, and if it is determined that the result file exists at the designated location, sends a third control instruction to the FTP server, specifically:
determining the appointed position according to the FTP uploading path, sending a query instruction to the appointed position, and determining whether the result file exists in the appointed position according to the corresponding query feedback instruction;
if the result file exists in the designated position according to the query feedback instruction, retrieving and integrating the result file into the third control instruction according to the PORT command and RETR command in the FTP protocol, and transmitting the third control instruction to the FTP server;
and if the result file does not exist in the appointed position according to the query feedback instruction, sending the query instruction to the FTP server according to a preset query period until the result file exists in the appointed position according to the query feedback instruction.
Drawings
Fig. 1: a flow diagram of an embodiment of a debug control method based on an FTP protocol provided by the invention;
fig. 2: a schematic diagram of an embodiment of a debug controller provided by the invention;
Fig. 3: the invention provides a networking topology diagram of one embodiment of a debugging control method based on an FTP protocol.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Example 1
Referring to fig. 1, a flow chart of an embodiment of a debug control method based on an FTP protocol provided by the present invention includes steps 101 to 103, where each step is specifically as follows:
step 101: responding to a debugging start instruction, connecting and logging in to a corresponding FTP server through an FTP protocol, generating a corresponding instruction file according to the received debugging instruction, and sending a first control instruction to the FTP server so that the FTP server actively establishes a first data transmission channel with the debugging controller.
According to the debugging control method provided by the embodiment of the invention, after responding to the debugging start instruction, the system logs in the FTP server through the FTP protocol, generates a corresponding instruction file according to the debugging instruction received from the user, and simultaneously sends a first control instruction to the FTP server, so that the server actively performs data connection with the debugging controller, and a first data transmission channel between the server and the debugging controller is built, so that the debugging controller transmits the instruction file and a second control instruction to the server to control the server to execute subsequent operations.
In this embodiment, as shown in fig. 3, fig. 3 is a networking topology diagram of an embodiment of the debug control method based on the FTP protocol provided by the present invention. Wherein, because of network environment requirements, the debug controller cannot directly establish connection communication with the CPE device, but the CPE device allows the communication with the FTP server, and at the same time, the debug controller also allows the communication with the FTP server. Therefore, in order to realize the remote debugging function of the debugging controller on the CPE equipment, the embodiment uses the FTP server as a 'transfer station' through the 5G private network to connect the debugging controller, namely the user end, with the CPE equipment, namely the equipment end, so that the data communication between the debugging controller and the CPE equipment is realized, and further, the remote debugging of the debugging controller on the CPE equipment is realized on the basis of the data communication.
In this embodiment, the debug controller responds to the USER triggering the debug start instruction, connects to the FTP server through the FTP protocol first, and invokes the USER command and PASS command in the FTP protocol to respectively transmit the USER name and password corresponding to the FTP server for login verification, and then logs in to the FTP server. Meanwhile, the debugging controller generates a corresponding instruction file according to the debugging instruction input by the user, and sends the instruction file to the target CPE equipment for remote debugging of the equipment.
Meanwhile, in this embodiment, after the debug controller establishes connection with the FTP server through the USER command and the PASS command, the corresponding established channel is a control channel, and is used for transmitting three control commands in this embodiment, that is, the debug controller may send the USER command and the PASS command, the PORT command and the STOR command, and the PORT command and the RETR command to the FTP server through the control channel, so as to implement remote control on the FTP server, and similarly, the control channel is not a data transmission channel that is set up later in this embodiment, and the data transmission channel in this embodiment is only used for transmitting command files.
Exemplary, in this embodiment, the generating a corresponding instruction file according to the received debug instruction specifically includes:
receiving and analyzing a debugging instruction input by a user, and determining FTP address information and FTP account information of the FTP server and the target equipment;
generating a corresponding instruction file identifier and an FTP uploading path according to the target device and the FTP address information respectively, and integrating the FTP address information, the FTP account information, the FTP uploading path, the instruction file identifier and the debugging instruction to generate the instruction file;
The instruction file identifier is used for being identified by the target device, and the FTP uploading path is used for identifying a transmission path between the designated position and the target device.
In order to realize a remote debugging function for target equipment, the instruction file generated by the debugging control method according to the debugging instruction provided by the embodiment of the invention comprises FTP address information, FTP account information, an instruction file identifier and an FTP uploading path besides the debugging instruction.
The FTP address information is address information corresponding to the FTP server; the FTP account information is the account information content used for logging in the FTP server, and the target equipment can log in the FTP server through the FTP account information and realize feedback transmission of a result file; the instruction file identifier is used for identifying the instruction file so that the target equipment can identify the instruction file through the identifier; the FTP uploading path is used for identifying a transmission path between a designated position on the server and the target equipment, so that the target equipment transmits a result file to the designated position according to the uploading path, and further the debugging controller can conveniently inquire whether the result file exists according to the determined designated position, thereby realizing the closed-loop operation of remote debugging between the server and the target equipment by the debugging controller and ensuring the normal operation of a debugging control method.
The remote debugging and control of the debugging controller to the target equipment can be realized through the parameter contents, and meanwhile, the efficiency, the accuracy and the timeliness of the remote debugging of the equipment by the debugging controller are improved.
In this embodiment, the corresponding instruction file generated by the debug controller according to the debug instruction input by the user includes, besides the debug instruction, FTP address information, FTP account information, an instruction file identifier and an FTP upload path, a file content length, a message identifier and a check code, where a specific combination manner of each item of information in the instruction file is as follows:
as shown in the above table, the instruction file includes the above eight information contents, where the eight information contents are respectively:
instruction file identifier: an identifier, e.g., 0x12345678, between the debug controller and the target CPE device side for identifying the identity.
File content length: for recording the length of the entire file, i.e. determining the length of the entire instruction file.
Message identifier: the identifier is used for determining the corresponding result file of the instruction file, and the content of the identifier is an ID value randomly generated by the debug controller and filled in the field; because the debug controller can send a plurality of instruction files simultaneously, when the target CPE equipment generates a corresponding result file after carrying out debug processing on the instruction files, the target CPE equipment can fill the message identifier into the result file, so that the debug controller can confirm the result file corresponding to each sent instruction file one by one through the message identifier.
Debug instructions: the content of the debugging instruction input by the user.
FTP address information: after the target CPE device executes the instruction file and generates a corresponding result file, the IP address of the FTP server may be determined according to the FTP address information, and the result file may be sent to the determined address.
FTP account information: and when the target CPE equipment needs to upload the result file to the FTP server, the authentication information required by the target CPE equipment comprises the user name and the password of the FTP server and is used for logging in the FTP server.
FTP upload path: reference data for a specific path when the target CPE device needs to upload the result file to the FTP server.
Check code: for calculating a hash value for the whole file after removal of the check code, said hash value being stored in the check code field and used as a check code for the target CPE device to detect said instruction file.
Further, in this embodiment, a first control instruction is sent to the FTP server, so that the FTP server actively establishes a first data transmission channel with the debug controller, specifically:
the first control instruction is generated by calling and integrating a PORT command and a STOR command in the FTP protocol, the first control instruction is sent to the FTP server, so that the FTP server is adjusted to an active mode, and a link request signal is sent to a first designated PORT of the debug controller;
And feeding back a corresponding link establishment signal to the FTP server through the first designated port according to the received link request signal, so that the FTP server establishes the first data transmission channel with the debug controller through the first designated port.
In order to improve the debugging efficiency aiming at the target equipment, the debugging control method provided by the embodiment of the invention also sends the first control instruction to the FTP server when the instruction file is generated, so that the server is adjusted to an active mode according to the first control instruction, and actively sends a link request signal to the debugging controller. After the debugging controller receives the link request signal, the system feeds back a link establishment signal to the server according to the received request signal, so that the server is ensured to actively establish a data transmission channel with the debugging controller, and then a data link is formed. The stability, safety and confidentiality of the data and files sent to the server by the debugging controller can be improved through the generated first data transmission channel.
The STOR command is used for controlling the FTP server to store the data received from the data channel into the file; the PORT command is used for informing the server of the temporary PORT number of the data connection of the user end, namely the debug controller end, so that the server can send the data transmission channel establishment request to the user end, namely the debug controller end, in an active mode to be received, and normal establishment and operation of the data transmission channel are ensured.
Step 102: and transmitting the instruction file to the FTP server through the first data transmission channel, sending a second control instruction to the FTP server, controlling the FTP server to actively establish a second data transmission channel with target equipment, and sending the instruction file to the target equipment through the second data transmission channel so as to enable the target equipment to feed back corresponding result files.
After the transmission channel is established, the system uploads the instruction file and a second control instruction to the FTP server, controls the FTP server to actively establish a second data transmission channel with the target equipment according to the second control instruction, and sends the instruction file to the target equipment through the established second data transmission channel, so that the target equipment feeds back a corresponding debugging result file after debugging according to the instruction file. According to the method, the remote sending of the modulation instruction to the target equipment can be realized, the target equipment carries out modulation operation according to the modulation instruction, and the corresponding debugging result is fed back, so that a user can determine whether the equipment is required to be debugged in the next step or is kept unchanged according to the feedback debugging result.
In this embodiment, before sending the second control instruction, the debug controller first transmits an instruction file to the FTP server, monitors the return code of the FTP server in real time, and sends the second control instruction to the server only after the debug controller determines that the return code of the FTP server is received and determines that the server receives the instruction file according to the received return code.
Otherwise, the debugging controller sends the return code of the real-time monitoring server within a preset period of time, and if the return code monitoring of the debugging controller is not triggered within the preset period of time, the instruction file is not received by the server, the debugging controller sends the instruction file to the FTP server again, and the return code monitoring function is started again.
Exemplary, in this embodiment, the controlling the FTP server to actively establish a second data transmission channel with the target device, and send the instruction file to the target device through the second data transmission channel specifically includes:
the second control instruction is fetched and integrated according to the PORT command and RETR command in the FTP protocol, the second control instruction is sent to the FTP server, so that the FTP server is adjusted to an active mode, and the second data transmission channel is established with the target equipment through a second designated PORT of the target equipment;
the instruction file is sent to the target equipment through the second data transmission channel, so that the target equipment is debugged according to the instruction file and feeds back a result file according to an FTP uploading path and FTP address information; the result file comprises a debugging result, FTP account information and a result file identifier.
After determining that the FTP server has received the second control instruction and the instruction file sent by the debug controller, the server will adjust the current running mode to the active mode according to the received second control instruction, and establish a second data channel with the target device through a second designated port of the target device, so as to facilitate transmission of the subsequent instruction file.
In this embodiment, the RETR command in the first control instruction sent by the debug controller is used to control the FTP server to copy the specified file and transmit it to the opposite end through the data channel, that is, the instruction file is transmitted to the target device through the second data transmission channel.
After the instruction file is transmitted to the target device through the second data transmission channel, the target device will debug the device according to the debug instruction content in the instruction file, collect the operation parameters after debugging of the device, and upload the operation parameters after debugging and the FTP account information and the result file identifier to the FTP server according to the FTP upload path and the FTP address information, thereby realizing the feedback of the target device for the received debug instruction. Meanwhile, as the uploading path of the result file is the FTP uploading path determined by the debugging controller, the debugging controller can determine whether the result file is fed back to the server according to the designated position on the server determined by the FTP uploading path, namely determine whether the target device has executed the debug completion instruction, so that the condition that timeliness of the result file is reduced because the debugging controller cannot determine whether the device has completed debugging is avoided.
In this embodiment, after receiving the instruction file, the target CPE device first analyzes the instruction file to obtain eight information contents including a debug instruction, FTP address information, FTP account information, an instruction file identifier, an FTP upload path, a file content length, a message identifier, and a check code, and first performs triple check on the instruction file identifier, the file content length, and the check code, that is, determines whether the instruction file is a debug instruction file sent by a user through the debug controller, determines whether the received file content length is equal to the file content length recorded in the instruction file, and checks the check code.
If the instruction file identifier fails to be checked, the file is not a remote debugging instruction file sent by a user through a debugging controller, and the target equipment does not need to debug the state parameters according to the content in the file; if the file content length check fails, the file is indicated to have transmission errors or faults in the transmission process, so that the content in the file is lost or redundant, and the target equipment can indicate the loss of the file content in the feedback result file, so that a user is prompted to perform barrier removal processing on the data transmission channel and the server transmission function; if the check code fails to check, it also indicates that the file has transmission errors or faults in the transmission process, so that the device calculates, according to the received file content, that the hash value of the content except the check code is unequal to the check code stored in the check code field in the file, and the device will indicate in the feedback result file, so as to prompt the user to detect the data transmission channel, thereby improving the file transmission stability and efficiency.
The verification method can reduce the probability of failure or error occurrence when the target device analyzes the received instruction file and performs state parameter debugging according to the debugging instruction, and improves the safety of the target device executing the debugging instruction.
After the target device detects the instruction file through the three types of detection, the target device executes the contents of the debugging instruction, and generates a result file after the debugging, and feeds the result file back to the server. The result file fed back by the target device not only comprises the debugged result content, but also comprises a result file identifier, a file content length, a message identifier and a check code.
The result file identifier is an identifier agreed with the debug controller and the target device in this embodiment, for example, 0x87654321, and the file content length, the message identifier and the check code function are all as described above.
Step 103: and sending a query instruction to the FTP server to determine whether the result file exists at a designated position, and if the result file exists at the designated position, sending a third control instruction to the FTP server to enable the FTP server to actively feed back the result file to the debugging controller through the first data transmission channel.
And when the FTP server forwards the instruction file for the second time, the debugging controller synchronously sends a query instruction to the designated position of the server to determine whether the result file fed back by the equipment exists, if so, a third control instruction is sent to the server to enable the server to actively download the result file to the debugging controller, and the debugging controller displays the result file to a user. The debugging control method provided by the invention takes the FTP server as the transfer station to realize data communication between the debugging controller, namely the user side, and the CPE equipment, namely the equipment side, thereby realizing remote debugging and state monitoring of the equipment by a user, improving the real-time performance and accuracy of the user for the state monitoring of the equipment, and simultaneously improving the efficiency of the system for remote debugging of the equipment.
In an exemplary embodiment, the sending a query instruction to the FTP server determines whether the result file exists at the designated location, and if it is determined that the result file exists at the designated location, then sending a third control instruction to the FTP server specifically includes:
determining the appointed position according to the FTP uploading path, sending a query instruction to the appointed position, and determining whether the result file exists in the appointed position according to the corresponding query feedback instruction;
If the result file exists in the designated position according to the query feedback instruction, retrieving and integrating the result file into the third control instruction according to the PORT command and RETR command in the FTP protocol, and transmitting the third control instruction to the FTP server;
and if the result file does not exist in the appointed position according to the query feedback instruction, sending the query instruction to the FTP server according to a preset query period until the result file exists in the appointed position according to the query feedback instruction.
In order to further improve timeliness of the result file fed back by the target device, after the second control instruction and the instruction file are sent, the system sends a query instruction to a designated position on the server determined according to the FTP uploading path, and determines whether the result file fed back by the target device exists at the designated position according to the query feedback instruction fed back by the server, so as to judge whether the target device has completed a debugging process of the debugging instruction, and further determine whether an error or a fault occurs in the debugging process.
If the result file exists at the designated position according to the received query feedback instruction, the target equipment is indicated to normally execute the debugging instruction and generate a corresponding result file, and the debugging controller can send a third control instruction to the server to call the result file and display the result file to a user for debugging analysis; if the result file does not exist at the designated position according to the received query feedback instruction, the target equipment is indicated to possibly not execute the debugging instruction, or the target equipment is indicated to have errors or faults in the process of executing the debugging instruction, the system continuously transmits the query instruction at the designated position to the server according to the query period until the received query feedback instruction displays the result file at the designated position, or continuously transmits the query instruction at the designated position according to the query period until the received query feedback instruction displays the result file still not exist at the designated position after a certain period of time, and the system indicates that the execution of the instruction file has errors or faults and needs maintenance personnel to perform barrier removal processing.
In this embodiment, since the debug controller is required to send a control command like one to the result file corresponding to the active feedback command file of the FTP server, the debug controller needs to determine whether the server has received the result file fed back by the target device. The debug controller in this embodiment performs content query on the corresponding designated location of the server through the FTP upload path determined in the instruction file, determines whether a feedback result file exists therein, and only after the query feedback instruction determines that the feedback result file exists therein, the debug controller sends a third control instruction to the server.
In this embodiment, the third control instruction is a PORT command and a RETR command in the FTP protocol, so that the control server actively downloads the received result question to the debug controller, and after receiving the result file, the debug controller further processes the result file and displays the result to the user after the debug instruction is executed, so that the user can send a subsequent debug instruction, or prompt the user that the debug instruction transmission channel needs the user to perform barrier removal processing, thereby improving the fault detection efficiency of the user.
In order to better illustrate the working principle and the step flow of the debugging control method and the debugging controller based on the FTP protocol, the invention can be but not limited to the related description.
Accordingly, referring to fig. 2, fig. 2 is a schematic structural diagram of an embodiment of a debug controller provided by the present invention, where the debug controller includes a debug start module 201, a data transmission module 202, and a result feedback module 203.
The debug start module 201 is configured to respond to a debug start instruction, connect to and log in to a corresponding FTP server through an FTP protocol, generate a corresponding instruction file according to the received debug instruction, and send a first control instruction to the FTP server, so that the FTP server actively establishes a first data transmission channel with the debug controller.
Further, the debug start module 201 generates a corresponding instruction file according to the received debug instruction, specifically:
receiving and analyzing a debugging instruction input by a user, and determining FTP address information and FTP account information of the FTP server and target address information of the target equipment; generating a corresponding instruction file identifier and an FTP uploading path according to the target device and the FTP address information respectively, and integrating the FTP address information, the FTP account information, the FTP uploading path, the instruction file identifier and the debugging instruction to generate the instruction file; the instruction file identifier is used for being identified by the target device, and the FTP uploading path is used for identifying a transmission path between the designated position and the target address information.
Further, the debug start module 201 sends a first control instruction to the FTP server, so that the FTP server actively establishes a first data transmission channel with the debug controller, specifically:
the first control instruction is generated by calling and integrating a PORT command and a STOR command in the FTP protocol, the first control instruction is sent to the FTP server, so that the FTP server is adjusted to an active mode, and a link request signal is sent to a first designated PORT of the debug controller; and feeding back a corresponding link establishment signal to the FTP server through the first designated port according to the received link request signal, so that the FTP server establishes the first data transmission channel with the debug controller through the first designated port.
The data transmission module 202 is configured to transmit the instruction file to the FTP server through the first data transmission channel, send a second control instruction to the FTP server, control the FTP server to actively establish a second data transmission channel with a target device, and send the instruction file to the target device through the second data transmission channel, so that the target device feeds back a corresponding result file.
Further, the data transmission module 202 controls the FTP server to actively establish a second data transmission channel with the target device, and sends the instruction file to the target device through the second data transmission channel, which specifically includes:
the second control instruction is fetched and integrated according to the PORT command and RETR command in the FTP protocol, the second control instruction is sent to the FTP server, so that the FTP server is adjusted to an active mode, and the second data transmission channel is established with the target equipment through a second designated PORT of the target equipment; the instruction file is sent to the target equipment through the second data transmission channel, so that the target equipment is debugged according to the instruction file and feeds back a result file according to an FTP uploading path and FTP address information; the result file comprises a debugging result, FTP account information and a result file identifier.
The result feedback module 203 is configured to send a query instruction to the FTP server to determine whether the result file exists at the designated location, and if it is determined that the result file exists at the designated location, send a third control instruction to the FTP server, so that the FTP server actively feeds back the result file to the debug controller through the first data transmission channel.
Further, the result feedback module 203 sends a query instruction to the FTP server to determine whether the result file exists at the designated location, and if it is determined that the result file exists at the designated location, sends a third control instruction to the FTP server, specifically:
determining the appointed position according to the FTP uploading path, sending a query instruction to the appointed position, and determining whether the result file exists in the appointed position according to the corresponding query feedback instruction;
if the result file exists in the designated position according to the query feedback instruction, retrieving and integrating the result file into the third control instruction according to the PORT command and RETR command in the FTP protocol, and transmitting the third control instruction to the FTP server; and if the result file does not exist in the appointed position according to the query feedback instruction, sending the query instruction to the FTP server according to a preset query period until the result file exists in the appointed position according to the query feedback instruction.
In summary, the embodiment of the invention provides a debug control method and a debug controller based on an FTP protocol, which logs in to an FTP server through the FTP protocol, generates an instruction file according to a debug instruction input by a user, and sends a first control instruction to the server, so that the server actively establishes a first data transmission channel with the debug controller, and transmits a second control instruction and the instruction file to the server through the first channel, and the control server establishes a second data transmission channel with a target device according to the second control instruction and transmits the instruction file, and simultaneously receives a result file fed back by the target device; and sending a query instruction to the designated position of the server until the fact that the result file exists in the designated position is determined, and sending a third control instruction to enable the server to feed back the result file to the debugging controller. By the method, remote debugging control and state monitoring of the target equipment are realized with the help of the transfer station FTP server, and the real-time performance, accuracy and debugging efficiency of the user on equipment state monitoring are improved.
The foregoing embodiments have been provided for the purpose of illustrating the general principles of the present invention, and are not to be construed as limiting the scope of the invention. It should be noted that any modifications, equivalent substitutions, improvements, etc. made by those skilled in the art without departing from the spirit and principles of the present invention are intended to be included in the scope of the present invention.

Claims (10)

1. The debugging control method based on the FTP protocol is characterized by being applied to a debugging controller and comprising the following steps of:
responding to a debugging start instruction, connecting and logging in to a corresponding FTP server through an FTP protocol, generating a corresponding instruction file according to the received debugging instruction, and sending a first control instruction to the FTP server so that the FTP server actively establishes a first data transmission channel with the debugging controller;
transmitting the instruction file to the FTP server through the first data transmission channel, sending a second control instruction to the FTP server, controlling the FTP server to actively establish a second data transmission channel with target equipment, and sending the instruction file to the target equipment through the second data transmission channel so as to enable the target equipment to feed back corresponding result files;
And sending a query instruction to the FTP server to determine whether the result file exists at a designated position, and if the result file exists at the designated position, sending a third control instruction to the FTP server to enable the FTP server to actively feed back the result file to the debugging controller through the first data transmission channel.
2. The method for controlling debugging based on FTP protocol as claimed in claim 1, wherein said generating a corresponding instruction file according to the received debugging instruction comprises:
receiving and analyzing a debugging instruction input by a user, and determining FTP address information and FTP account information of the FTP server and the target equipment;
generating a corresponding instruction file identifier and an FTP uploading path according to the target device and the FTP address information respectively, and integrating the FTP address information, the FTP account information, the FTP uploading path, the instruction file identifier and the debugging instruction to generate the instruction file;
the instruction file identifier is used for being identified by the target device, and the FTP uploading path is used for identifying a transmission path between the designated position and the target device.
3. The method for controlling debugging based on the FTP protocol as claimed in claim 1, wherein said sending a first control command to said FTP server to enable said FTP server to actively establish a first data transmission channel with said debug controller comprises:
the first control instruction is generated by calling and integrating a PORT command and a STOR command in the FTP protocol, the first control instruction is sent to the FTP server, so that the FTP server is adjusted to an active mode, and a link request signal is sent to a first designated PORT of the debug controller;
and feeding back a corresponding link establishment signal to the FTP server through the first designated port according to the received link request signal, so that the FTP server establishes the first data transmission channel with the debug controller through the first designated port.
4. The method for controlling debugging based on FTP protocol as claimed in claim 1, wherein said controlling said FTP server to actively establish a second data transmission channel with a target device, and send said instruction file to the target device through said second data transmission channel, specifically comprises:
The second control instruction is fetched and integrated according to the PORT command and RETR command in the FTP protocol, the second control instruction is sent to the FTP server, so that the FTP server is adjusted to an active mode, and the second data transmission channel is established with the target equipment through a second designated PORT of the target equipment;
the instruction file is sent to the target equipment through the second data transmission channel, so that the target equipment is debugged according to the instruction file and feeds back a result file according to an FTP uploading path and FTP address information; the result file comprises a debugging result, FTP account information and a result file identifier.
5. The method for controlling debugging based on FTP protocol as claimed in claim 1, wherein said sending a query command to said FTP server determines whether said result file exists at a specified location, and if it is determined that said result file exists at said specified location, sending a third control command to said FTP server, specifically:
determining the appointed position according to the FTP uploading path, sending a query instruction to the appointed position, and determining whether the result file exists in the appointed position according to the corresponding query feedback instruction;
If the result file exists in the designated position according to the query feedback instruction, retrieving and integrating the result file into the third control instruction according to the PORT command and RETR command in the FTP protocol, and transmitting the third control instruction to the FTP server;
and if the result file does not exist in the appointed position according to the query feedback instruction, sending the query instruction to the FTP server according to a preset query period until the result file exists in the appointed position according to the query feedback instruction.
6. The debugging controller is characterized by comprising a debugging starting module, a data transmission module and a result feedback module;
the debugging starting module is used for responding to a debugging starting instruction, connecting and logging in to a corresponding FTP server through an FTP protocol, generating a corresponding instruction file according to the received debugging instruction, and sending a first control instruction to the FTP server so that the FTP server actively establishes a first data transmission channel with the debugging controller;
the data transmission module is used for transmitting the instruction file to the FTP server through the first data transmission channel, sending a second control instruction to the FTP server, controlling the FTP server to actively establish a second data transmission channel with target equipment, and sending the instruction file to the target equipment through the second data transmission channel so as to enable the target equipment to feed back corresponding result files;
And the result feedback module is used for sending a query instruction to the FTP server to determine whether the result file exists at the designated position, and sending a third control instruction to the FTP server if the result file exists at the designated position, so that the FTP server actively feeds back the result file to the debugging controller through the first data transmission channel.
7. The debug controller of claim 6, wherein the debug start module generates a corresponding instruction file based on the received debug instruction, specifically:
receiving and analyzing a debugging instruction input by a user, and determining FTP address information and FTP account information of the FTP server and target address information of the target equipment;
generating a corresponding instruction file identifier and an FTP uploading path according to the target device and the FTP address information respectively, and integrating the FTP address information, the FTP account information, the FTP uploading path, the instruction file identifier and the debugging instruction to generate the instruction file;
the instruction file identifier is used for being identified by the target device, and the FTP uploading path is used for identifying a transmission path between the designated position and the target address information.
8. The debug controller of claim 6, wherein the debug start module sends a first control command to the FTP server to cause the FTP server to actively establish a first data transmission channel with the debug controller, specifically:
the first control instruction is generated by calling and integrating a PORT command and a STOR command in the FTP protocol, the first control instruction is sent to the FTP server, so that the FTP server is adjusted to an active mode, and a link request signal is sent to a first designated PORT of the debug controller;
and feeding back a corresponding link establishment signal to the FTP server through the first designated port according to the received link request signal, so that the FTP server establishes the first data transmission channel with the debug controller through the first designated port.
9. The debug controller of claim 6, wherein the data transmission module controls the FTP server to actively establish a second data transmission channel with the target device, and send the instruction file to the target device through the second data transmission channel, specifically comprising:
The second control instruction is fetched and integrated according to the PORT command and RETR command in the FTP protocol, the second control instruction is sent to the FTP server, so that the FTP server is adjusted to an active mode, and the second data transmission channel is established with the target equipment through a second designated PORT of the target equipment;
the instruction file is sent to the target equipment through the second data transmission channel, so that the target equipment is debugged according to the instruction file and feeds back a result file according to an FTP uploading path and FTP address information; the result file comprises a debugging result, FTP account information and a result file identifier.
10. The debug controller of claim 6, wherein the result feedback module sends a query command to the FTP server to determine whether the result file exists at a specified location, and if the result file exists at the specified location, sends a third control command to the FTP server, specifically:
determining the appointed position according to the FTP uploading path, sending a query instruction to the appointed position, and determining whether the result file exists in the appointed position according to the corresponding query feedback instruction;
If the result file exists in the designated position according to the query feedback instruction, retrieving and integrating the result file into the third control instruction according to the PORT command and RETR command in the FTP protocol, and transmitting the third control instruction to the FTP server;
and if the result file does not exist in the appointed position according to the query feedback instruction, sending the query instruction to the FTP server according to a preset query period until the result file exists in the appointed position according to the query feedback instruction.
CN202311767387.9A 2023-12-21 2023-12-21 FTP protocol-based debugging control method and debugging controller Active CN117440410B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311767387.9A CN117440410B (en) 2023-12-21 2023-12-21 FTP protocol-based debugging control method and debugging controller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311767387.9A CN117440410B (en) 2023-12-21 2023-12-21 FTP protocol-based debugging control method and debugging controller

Publications (2)

Publication Number Publication Date
CN117440410A CN117440410A (en) 2024-01-23
CN117440410B true CN117440410B (en) 2024-03-12

Family

ID=89550206

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311767387.9A Active CN117440410B (en) 2023-12-21 2023-12-21 FTP protocol-based debugging control method and debugging controller

Country Status (1)

Country Link
CN (1) CN117440410B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103780933A (en) * 2012-10-18 2014-05-07 腾讯科技(深圳)有限公司 Remote control method and control apparatus for multimedia terminal
US8972561B1 (en) * 2009-05-13 2015-03-03 Tellabs Operations, Inc. Methods and apparatus for obtaining network information using file transfer
CN105744004A (en) * 2016-04-29 2016-07-06 广东凯通软件开发有限公司 Distributed database file transmission method and system based on FTP
CN112165480A (en) * 2020-09-22 2021-01-01 北京字跳网络技术有限公司 Information acquisition method and device and electronic equipment

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9118599B2 (en) * 2012-04-13 2015-08-25 Verizon Patent And Licensing Inc. Network testing using a control server
CN111131407B (en) * 2019-12-09 2021-05-11 深圳市盛铂科技有限公司 Network equipment connection method and network equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8972561B1 (en) * 2009-05-13 2015-03-03 Tellabs Operations, Inc. Methods and apparatus for obtaining network information using file transfer
CN103780933A (en) * 2012-10-18 2014-05-07 腾讯科技(深圳)有限公司 Remote control method and control apparatus for multimedia terminal
CN105744004A (en) * 2016-04-29 2016-07-06 广东凯通软件开发有限公司 Distributed database file transmission method and system based on FTP
CN112165480A (en) * 2020-09-22 2021-01-01 北京字跳网络技术有限公司 Information acquisition method and device and electronic equipment

Also Published As

Publication number Publication date
CN117440410A (en) 2024-01-23

Similar Documents

Publication Publication Date Title
JP6258974B2 (en) Base station maintenance equipment, method, apparatus and system, mobile terminal, and base station
CN101848114A (en) Fault detection method and device
CN112995233B (en) RSSP-II protocol secure connection establishment method and system
CN108833565A (en) A kind of method, apparatus of monitoring server, server and storage medium
CN107948063B (en) Method for establishing aggregation link and access equipment
CN106160852A (en) The network system of a kind of transmission equipment and remote upgrade method thereof
CN113821242B (en) Intelligent firmware matching method and system
CN117440410B (en) FTP protocol-based debugging control method and debugging controller
CN111885203A (en) Method for remote management based on CMSP
US11165602B2 (en) Communication system, controlled device, and control method for communication system
KR100362643B1 (en) Remote control apparatus based on web and method thereof
US6724731B1 (en) Radio communication system and control method, and information processing apparatus used therein
CN116248721A (en) Management method and device of Internet of things equipment, computer equipment and storage medium
WO2015101212A1 (en) Transmission link use method and multimode base station
CN116112559A (en) Remote server management control method, system and storage medium
CN110430157B (en) System and method for remotely operating and maintaining speed regulator of water turbine
CN114615239A (en) Data transmission method, device, system and storage medium
CN111488231A (en) Operation diagnosis method, device, system, master control device and computer readable storage medium for operation diagnosis
CN105323088A (en) Springboard processing method and springboard processing device
CN111427861A (en) Distributed file system configuration method and device
CN114024712B (en) Authentication method, authentication device, computer equipment and storage medium
CN115022378B (en) Transmission valve control equipment communication method and system, valve tower monitoring equipment and storage medium
CN112654059B (en) Method and device for determining reason of abnormal transmission communication of base station
TWM461117U (en) Machine to machine service cloud system
CN115001958A (en) Data transmission method, server in-band device and server management 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
GR01 Patent grant
GR01 Patent grant