Remote interaction method and device based on HTTP (Hyper Text Transport Protocol) and medium
By using a remote interaction method based on the HTTP protocol, the problems of limited functionality and complex cross-platform deployment of remote interaction devices are solved, achieving cross-platform compatibility and security, supporting advanced file transfer functions, and improving operational efficiency.
Patent Information
- Application Number
- CN202511253535.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-03
- Publication Date
- 2025-10-31
AI Technical Summary
Existing remote interaction devices have limited functionality, making it difficult to meet the needs of massive data interaction scenarios. Furthermore, cross-platform deployment is complex and has poor security.
It adopts a remote interaction method based on the HTTP protocol, which supports remote command execution, file upload and download by modifying configuration files and operation whitelists on a remote server. It achieves cross-platform compatibility and security, and supports segmented transmission and breakpoint resume.
It enables one-click operation across platforms, improves operational security, supports advanced file transfer functions, and saves time.
Smart Images

Figure CN120881057A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of remote interaction technology, and in particular to a remote interaction method, device and medium based on the HTTP protocol. Background Technology
[0002] With the development and popularization of the Internet, the demand for remote management and automated operation and maintenance is growing. Traditional remote operation methods such as SSH (Secure Shell) and RDP (Remote Desktop Protocol), while powerful, have problems such as complex deployment, strong dependencies, closed protocols, and poor security.
[0003] While existing remote interaction devices using tools developed in Go have high execution efficiency, they are limited by compilation characteristics and require separate compilation and installation packages for different platforms such as Windows, Linux, and macOS, resulting in a cumbersome cross-platform deployment process.
[0004] Some remote interaction devices are based on Web technology, but they generally suffer from limited functionality, with most only supporting simple command-line interaction or file transfer, making it difficult to meet users' remote interaction needs in scenarios involving massive amounts of data. Summary of the Invention
[0005] This application provides a remote interaction method, device, and medium based on the HTTP protocol to solve the following technical problem: existing remote interaction devices generally have limited functionality and are difficult to meet users' remote interaction needs in scenarios involving massive data interaction.
[0006] The embodiments of this application adopt the following technical solutions:
[0007] This application provides a remote interaction method based on the HTTP protocol. It includes modifying a configuration file and an operation whitelist on a remote server based on client information; wherein the remote server also contains a JAR file compiled from a Java program and start / stop scripts; receiving a remote interaction request sent by the client via the HTTP protocol, comparing the remote interaction request with the modified configuration file and operation whitelist; if the comparison result meets preset conditions, executing the corresponding operation on the remote server based on the remote interaction request; wherein the corresponding operation includes at least one of remote command execution and file upload or download; after successful operation execution, returning the execution result to the client via an HTTP response.
[0008] In one implementation of this application, modifying the configuration file and operation whitelist based on client information specifically includes: obtaining basic client information and client operation requirement information; wherein, the basic client information includes at least one of the following: the authorized user identity corresponding to the client, the port usage rules of the network environment where the client is located, and the security level requirements for identity authentication; the client operation requirement information includes at least one of the following: the remote commands that the client needs to execute, the directory range of files that the client needs to upload or download, and the client operation scenario; modifying the configuration file based on the basic client information; wherein, the configuration file includes at least one of the following: username, password, and device startup port number; and modifying the operation whitelist based on the client operation requirement information; wherein, the operation whitelist includes at least one of the following: allowed commands, allowed directories, and file upload paths.
[0009] In one implementation of this application, after receiving a remote interaction request sent by the client via the HTTP protocol, the method further includes: after initiating the remote interaction operation, obtaining the username and password corresponding to the client from the configuration file; encrypting the username and password to generate a target token, and storing the target token in a cache; receiving a reference token from the remote interaction request; comparing the reference token with the target token, and if the comparison matches, determining that the client's identity authentication is successful.
[0010] In one implementation of this application, the remote interaction request is compared with the modified configuration file and operation whitelist, specifically including: obtaining the modified operation whitelist from the cache; dividing the operation whitelist into multiple groups based on the content of the operation whitelist; wherein the group includes at least one of command group, directory group, and file path group; obtaining request operation information from the remote interaction request, and selecting the corresponding group from the operation whitelist based on the type of request operation information; comparing the request operation information with the selected corresponding group, and if the request operation information exists in the corresponding group, determining that the comparison result meets the requirements.
[0011] In one implementation of this application, the execution of corresponding operations based on a remote interaction request specifically includes: if the remote interaction request includes file upload or download, comparing the file size with a preset threshold; if it is greater than the preset threshold, then the file is transferred in chunks, and chunk upload or chunk download is initiated; if it is not greater than the preset threshold, then the file is transferred directly, and the file to be uploaded is sent to the remote server via an HTTP request, or the downloaded file is sent to the client via an HTTP response.
[0012] In one implementation of this application, initiating chunked upload or chunked download specifically includes: if it is a file upload, dividing the file to be uploaded into multiple chunks of fixed data size, and sending each chunk to a remote server sequentially according to the file order; wherein each chunk includes at least one of a file identifier, a chunk number, and a total number of chunks; creating a temporary storage directory for each chunk, storing the received chunk data sequentially based on the chunk number, and recording the received chunk numbers; after all chunks are received, merging the chunk data according to the number order to generate a complete file, and writing it to the target path; if it is a file download, sending the read file stream chunks to the client, and concatenating the chunk data into a complete file on the client.
[0013] In one implementation of this application, after the corresponding operation is performed based on the remote interaction request, the method further includes: if the file upload is interrupted, the client re-initiates the upload request; wherein the upload request contains the number of the transmitted fragment; the uploaded fragments are verified based on the transmitted fragment numbers, and a list of unuploaded fragments is returned; the file is uploaded based on the list of unuploaded fragments; if the file download is interrupted, a re-download request is received from the client; wherein the re-download request contains the number of bytes downloaded, and the position to continue downloading is determined based on the number of bytes downloaded.
[0014] In one implementation of this application, after returning the execution result to the client via an HTTP response, the method further includes: writing the information collected during the remote interaction into a log file; wherein the collected information includes at least one of client information, operation execution information, and operation status information; and saving the log file for a preset duration, and automatically archiving or deleting it after the preset duration is reached.
[0015] This application provides a remote interaction device based on the HTTP protocol, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, which, when executed by the at least one processor, enable the at least one processor to: modify a configuration file and an operation whitelist on a remote server based on client information; wherein the remote server is also provided with a JAR package compiled based on a JAVA program and start / stop scripts; receive a remote interaction request sent by the client via the HTTP protocol, and compare the remote interaction request with the modified configuration file and operation whitelist; if the comparison result meets preset conditions, execute the corresponding operation on the remote server based on the remote interaction request; wherein the corresponding operation includes at least one of remote command execution and file upload or download; after successful operation execution, return the execution result to the client via an HTTP response.
[0016] This application provides a non-volatile computer storage medium storing computer-executable instructions. These instructions are configured to: modify a configuration file and an operation whitelist on a remote server based on client information; wherein the remote server also contains a JAR file compiled from a JAVA program and startup / stop scripts; receive a remote interaction request sent by the client via HTTP protocol, and compare the remote interaction request with the modified configuration file and operation whitelist; if the comparison result meets preset conditions, execute the corresponding operation on the remote server based on the remote interaction request; wherein the corresponding operation includes at least one of remote command execution and file upload or download; after successful operation execution, return the execution result to the client via an HTTP response.
[0017] The above-mentioned technical solutions adopted in this application embodiment can achieve the following beneficial effects: This application embodiment is based on JAVA development, and a set of code compiles into a jar package that can be run with one click on any platform with a JAVA environment, resulting in stronger cross-platform compatibility and automatic adaptation to differences in paths, encoding, line breaks, etc., of different operating systems. This application embodiment has a whitelist configuration function, ensuring that only operations or commands in the whitelist can be executed, thereby improving operational security. Furthermore, operations set through the whitelist support advanced functions such as segmented file transfer, segmented upload, and resume interrupted downloads, facilitating user operation and saving time. Attached Figure Description
[0018] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. In the drawings:
[0019] Figure 1 A flowchart illustrating a remote interaction method based on the HTTP protocol provided in this application embodiment;
[0020] Figure 2 A schematic diagram of a remote interaction process based on the HTTP protocol provided in an embodiment of this application;
[0021] Figure 3 This is a schematic diagram of the structure of a remote interactive device based on the HTTP protocol, provided as an embodiment of this application.
[0022] Figure label:
[0023] 200: Remote interactive device based on HTTP protocol; 201: Processor; 202: Memory. Detailed Implementation
[0024] This application provides a remote interaction method, device, and medium based on the HTTP protocol.
[0025] To enable those skilled in the art to better understand the technical solutions in this application, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this specification, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this application.
[0026] The technical solutions proposed in the embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
[0027] Figure 1 This is a flowchart illustrating a remote interaction method based on the HTTP protocol, provided as an embodiment of this application. Figure 1 As shown, the remote interaction method based on the HTTP protocol includes the following steps:
[0028] Step 101: On the remote server, modify the configuration file and operation whitelist based on the client information.
[0029] In one implementation of this application, client basic information and client operation requirement information are obtained. The client basic information includes at least one of the following: the authorized user identity corresponding to the client, the port usage rules of the network environment where the client is located, and the security level requirements for identity authentication. The client operation requirement information includes at least one of the following: the remote commands the client needs to execute, the directory range of files the client needs to upload or download, and the client operation scenario. A configuration file is modified based on the client basic information; the configuration file includes at least one of the following: username, password, and device startup port number. An operation whitelist is modified based on the client operation requirement information; the operation whitelist includes at least one of the following: allowed commands, allowed directories, and file upload paths. The remote server also includes a JAR package compiled from a JAVA program and startup / stop scripts.
[0030] Specifically, before deploying the device, basic client information and operational requirements are first collected. Basic client information includes the authorized user's identity, port usage rules of the network environment, and security level requirements for authentication. Operational requirements include the remote commands to be executed, the directory range for uploading or downloading files, and the specific operational scenarios.
[0031] The Java-compiled JAR file, startup and shutdown scripts, initial configuration file, and initial operation whitelist are placed in a designated directory on the remote server to deploy the basic files required for the remote interactive device to run. Based on the collected client information, the configuration file is modified. For example, if the client corresponds to a specific authorized user, the corresponding username is set in the configuration file to associate client operation permissions; a password with sufficient complexity is set according to the security level requirements of identity authentication, serving as the basis for generating the client authentication token; the device startup port number is specified in the configuration file based on the port usage rules of the client's network environment, ensuring that the port is not occupied and that client access is allowed, guaranteeing the normal establishment of subsequent HTTP communication. Furthermore, the operation whitelist is adjusted based on client operation requirements. For remote commands that the client needs to execute, commands that have undergone security verification are added to the whitelist, restricting the execution of only these commands; based on the directory range of files that the client needs to upload or download, the whitelist clearly specifies the allowed directories and file upload paths, prohibiting access to unauthorized sensitive directories; simultaneously, the whitelist content is further filtered based on the risk level of the client's operation scenario, for example, only low-risk operations are retained in production environments to ensure operational security.
[0032] Furthermore, the startup script on the remote server is run. The script calls the server's Java environment to load the JAR file and start the device. During the device startup process, it automatically reads the modified configuration file and operation whitelist, completes parameter initialization, and adapts to the current server operating system's path, encoding, and other characteristics. After startup, a test request is initiated through the client to verify whether the port, username, and password in the configuration file are effective, and whether the operation whitelist accurately restricts the scope of operations, ensuring that the device can respond normally to the client's remote interaction requests.
[0033] Step 102: Receive the remote interaction request sent by the client via the HTTP protocol, and compare the remote interaction request with the modified configuration file and operation whitelist.
[0034] In one implementation of this application, after initiating the remote interaction operation, the username and password corresponding to the client are obtained from the configuration file. The username and password are encrypted to generate a target token, which is then stored in a cache. A reference token is received from the remote interaction request, and the reference token is compared with the target token. If the comparison matches, the client's identity authentication is deemed successful.
[0035] Specifically, after the remote interaction device starts, it automatically reads the contents of the configuration file and extracts the username and password corresponding to the client. Using a preset encryption algorithm, such as a hash algorithm combining timestamps and random numbers, the username and password obtained from the configuration file are encrypted to generate a unique target token. After generating the target token, the device stores it in a local cache and associates it with the corresponding client identifier and token validity period. The caching mechanism ensures that the token can be read quickly. When the client initiates a remote interaction request, it carries a reference token in the request. After receiving the request, the device extracts the reference token from the request as the basis for authentication, retrieves the target token corresponding to the client from the cache, and compares it with the reference token in the request. During the comparison process, it not only verifies whether the token strings match completely, but also checks whether the target token is within its validity period to ensure that the token has not expired or been tampered with.
[0036] In one implementation of this application, the modified operation whitelist is retrieved from the cache. Based on the contents of the operation whitelist, it is divided into multiple groups; each group includes at least one of the following: command group, directory group, and file path group. Request operation information is obtained from the remote interaction request, and the corresponding group is selected from the operation whitelist based on the type of the request operation information. The request operation information is compared with the selected corresponding group; if the request operation information exists in the corresponding group, the comparison result is determined to meet the requirements.
[0037] Specifically, after the device starts or the whitelist is updated, the modified whitelist content is loaded into the cache to ensure quick access to the latest rules during subsequent verification. When verification of remote interaction requests is required, the device reads the updated operation whitelist from the cache. The operation whitelist content obtained from the cache is parsed, and the operation whitelist is divided into multiple groups according to the operation type. Among them, the command group contains all allowed remote commands, such as system query commands and process management commands; the directory group covers directory paths that are allowed to perform file operations, such as creating, deleting, and viewing; and the file path group explicitly specifies the specific paths where files are allowed to be uploaded or downloaded. This grouping enables precise management of different types of operations.
[0038] Furthermore, when a client initiates a remote interaction request, the device receives the request and extracts specific operation information from it, including the type and content of the operation, providing a basis for subsequent group matching and comparison. Based on the type of the extracted request operation information, the device selects the corresponding group from the pre-defined groups. For example, if the request operation is to execute a remote command, the command group is selected; if the request operation is to access a directory to download a file, the directory group is selected; if the request operation is to upload a file to a specific path, the file path group is selected. The extracted request operation information is then compared one by one with the content in the selected corresponding group. Furthermore, during the comparison process, appropriate rules can be adopted based on the characteristics of different groups. For example, the command group uses exact matching to ensure that the requested command is completely consistent with the whitelisted commands; the directory group uses prefix matching to ensure that the requested directory is within the whitelisted directory range; and the file path group uses exact matching to ensure that the uploaded path is completely consistent with the whitelisted path.
[0039] If a matching entry exists in the corresponding group, the comparison result is deemed satisfactory, and the device allows the request to proceed. If no matching entry exists in the corresponding group, the comparison result is deemed unsatisfactory, the device refuses to execute the request, and returns an insufficient permissions message to the client.
[0040] Step 103: If the comparison result meets the preset conditions, execute the corresponding operation on the remote server based on the remote interaction request.
[0041] In one implementation of this application, the corresponding operation includes at least one of remote command execution and file upload or download. If the comparison result meets the preset conditions, and the remote interaction request includes file upload or download, the file size is compared with a preset threshold. If it is greater than the preset threshold, the file is transferred in chunks, and chunk upload or download is initiated. If it is not greater than the preset threshold, the file is transferred directly, and the file to be uploaded is sent to the remote server via an HTTP request, or the downloaded file is sent to the client via an HTTP response.
[0042] Specifically, for requests involving file upload or download, the device extracts file size information. In upload scenarios, this information is obtained from the client request; in download scenarios, it is obtained from the server's file system. This information is then compared with a preset file size threshold. This file size threshold can be 5MB or 10MB, and this embodiment does not impose any limitation on it.
[0043] If the file size exceeds a preset threshold, it is determined to be a file transfer scenario involving fragmented transmission. The device initiates the fragmented transmission logic: For upload operations, the client divides the file into fixed-size fragments and sends them sequentially. Each fragment carries metadata such as a unique file identifier and fragment number. For download operations, the server divides the file into fragments according to the same rules. The client can specify the starting position to request fragments, ensuring that interrupted transmissions can be resumed when the network fluctuates.
[0044] If the file size is not greater than a preset threshold, it is determined to be a direct file transfer scenario. The device uses a conventional HTTP transmission method: during upload, the client encapsulates the entire file to be transferred in the HTTP request body and sends it to the remote server. After receiving it, the server directly writes it to the specified path. During download, the server reads the complete data of the file to be transferred, encapsulates it in the HTTP response body, and returns it to the client. After receiving it, the client saves it as a local file.
[0045] If the request is to execute a command, simply execute the command. Return the command output to the client. Specifically, the device executes the command in an isolated process environment through the Java system execution interface, preventing command execution from affecting the device's own operation. During execution, the standard output stream and error output stream of the command are captured in real time to obtain the command execution result and exception information. Normal output data after command execution is read, converted to a string according to character encoding, and redundant newline characters or spaces are removed to ensure clear and readable output. If command execution fails, error output information is captured, and an error message text is generated.
[0046] In one implementation of this application, if file upload is interrupted, the client re-initiates the upload request; wherein the upload request includes the segment numbers of the already transmitted segments. The uploaded segments are verified based on the transmitted segment numbers, and a list of unuploaded segments is returned. File upload is performed based on the list of unuploaded segments. If file download is interrupted, a re-download request is received from the client; wherein the re-download request includes the number of bytes already downloaded, and the position to continue downloading is determined based on the number of bytes already downloaded.
[0047] Specifically, during file upload, the network connection status and transmission progress are monitored in real time. When an upload interruption is detected, the client re-initiates the upload request, including the fragment numbers of the already transmitted fragments. Upon receiving this resume request, the device extracts the fragment number information to verify the uploaded fragments. Based on the received transmitted fragment numbers, the corresponding fragment file is retrieved from the server's temporary storage directory. By comparing the continuity of fragment numbers and checking the integrity of fragment files, the set of successfully uploaded fragments is confirmed, while fragments that may have been lost or corrupted during transmission are marked. The verified uploaded fragment numbers are compared with the total number of file fragments to calculate the fragment numbers that have not been uploaded, generating a list of unuploaded fragments. This list is returned to the client via an HTTP response, informing them of the fragment numbers that need to be transmitted, providing a basis for subsequent resume uploads.
[0048] Furthermore, after receiving the list of unuploaded fragments, the client only re-initiates upload requests for the fragments in the list, each fragment carrying a corresponding number and a unique file identifier. When the device receives these fragments, it stores them in a designated location in a temporary directory according to their numbers, ensuring that the fragments are correctly assembled in order. In file download scenarios, when transmission is interrupted, the client sends a re-download request, containing the number of bytes already downloaded, such as 5MB. The device parses this request, obtains the number of bytes already downloaded, and, combined with the total size of the target file, determines the starting position for continuing the download. The device calculates the byte offset for continuing the download based on the number of bytes already downloaded; for example, if the starting position is 5MB = 5 × 1024 × 1024 bytes, the target file is opened on the server side, and file data is read starting from this offset. Subsequent data fragments are sent to the client via an HTTP response. Upon receiving this, the client resumes writing from the corresponding position in the local file, achieving breakpoint resumption until the file download is complete.
[0049] Step 104: After the operation is successfully executed, the execution result will be returned to the client via an HTTP response.
[0050] In one implementation of this application, information collected during remote interaction is written to a log file; the collected information includes at least one of client information, operation execution information, and operation status information. The log file is saved for a preset duration, and automatically archived or deleted after the preset duration.
[0051] Specifically, this application embodiment also records the requested operation log, including client information, specific operations, operation output, operation status, etc. The log file is stored in plain text format and can be directly retrieved through command-line tools or text editors. The device also provides an API interface, allowing external auditing systems to query log entries within a specified time range, client IP, or operation type by calling the interface. The interface returns structured data, facilitating statistical analysis or report generation by the auditing system.
[0052] Figure 2 This application provides a schematic diagram of a remote interaction process based on the HTTP protocol, as shown in the embodiment. Figure 2 As shown, the remote interaction device is deployed on a remote server. After modifying the configuration file and operation whitelist, the device is started. The client sends a request to the device via HTTP. Upon receiving the request, the device verifies the token's validity. If verification is successful, it compares the requested operation with the whitelist. If the operation exists, it executes the operation and returns the operation output to the client. Otherwise, it returns an error message to the client. Furthermore, it logs the operation of this request.
[0053] Figure 3 This is a schematic diagram illustrating the structure of a remote interactive device based on the HTTP protocol, provided as an embodiment of this application. Figure 3 As shown, a remote interaction device 200 based on the HTTP protocol includes: at least one processor 201; and a memory 202 communicatively connected to the at least one processor 201. The memory 202 stores instructions executable by the at least one processor 201, which, when executed, enable the at least one processor 201 to: modify a configuration file and an operation whitelist on a remote server based on client information; wherein the remote server also contains a JAR file compiled from a JAVA program and startup / stop scripts; receive a remote interaction request sent by the client via the HTTP protocol, and compare the remote interaction request with the modified configuration file and operation whitelist; if the comparison result meets preset conditions, execute the corresponding operation on the remote server based on the remote interaction request; wherein the corresponding operation includes at least one of remote command execution and file upload or download; and after successful operation execution, return the execution result to the client via an HTTP response.
[0054] This application provides a non-volatile computer storage medium storing computer-executable instructions. These instructions are configured to: modify a configuration file and an operation whitelist on a remote server based on client information; wherein the remote server also contains a JAR file compiled from a JAVA program and startup / stop scripts; receive a remote interaction request sent by the client via HTTP protocol, and compare the remote interaction request with the modified configuration file and operation whitelist; if the comparison result meets preset conditions, execute the corresponding operation on the remote server based on the remote interaction request; wherein the corresponding operation includes at least one of remote command execution and file upload or download; after successful operation execution, return the execution result to the client via an HTTP response.
[0055] The various embodiments in this application are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the embodiments of apparatus, devices, and non-volatile computer storage media are basically similar to the method embodiments, so the descriptions are relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0056] The above descriptions are merely embodiments of this application and are not intended to limit the scope of this application. For those skilled in the art, various modifications and variations can be made to the embodiments of this application. These modifications or substitutions do not cause the essence of the corresponding technical solutions to depart from the spirit and scope of the technical solutions in the embodiments of this application.
Claims
1. A remote interaction method based on the HTTP protocol, characterized in that, The method includes: On the remote server, the configuration file and operation whitelist are modified based on the client information; the remote server also contains a JAR package compiled from a JAVA program and start / stop scripts. Receive a remote interaction request sent by the client via the HTTP protocol, and compare the remote interaction request with the modified configuration file and the operation whitelist; If the comparison result meets the preset conditions, the corresponding operation is executed on the remote server based on the remote interaction request; wherein the corresponding operation includes at least one of remote command execution and file upload or download; After the operation is successfully executed, the result will be returned to the client via an HTTP response.
2. The remote interaction method based on the HTTP protocol according to claim 1, characterized in that, The modification of the configuration file and operation whitelist based on client information specifically includes: Obtain basic client information and client operation requirements information; wherein, the basic client information includes at least one of the following: the authorized user identity corresponding to the client, the port usage rules of the network environment where the client is located, and the security level requirements for identity authentication; the client operation requirements information includes at least one of the following: the remote command that the client needs to execute, the directory range of files that the client needs to upload or download, and the client operation scenario; The configuration file is modified based on the client's basic information; wherein the configuration file includes at least one of the following: username, password, and device startup port number; The operation whitelist is modified based on the client operation requirement information; wherein the operation whitelist includes at least one of the following: allowed commands, allowed directories, and file upload paths.
3. The remote interaction method based on the HTTP protocol according to claim 1, characterized in that, After receiving the remote interaction request sent by the client via the HTTP protocol, the method further includes: After initiating the remote interaction operation, the username and password corresponding to the client are obtained from the configuration file; The username and password are encrypted to generate a target token, and the target token is stored in the cache; Receive the reference token from the remote interaction request; The reference token is compared with the target token. If they match, the client's identity authentication is deemed successful.
4. The remote interaction method based on the HTTP protocol according to claim 1, characterized in that, The step of comparing the remote interaction request with the modified configuration file and the operation whitelist specifically includes: Retrieve the modified whitelist of the operation from the cache; Based on the contents of the operation whitelist, the operation whitelist is divided into multiple groups; wherein, the group includes at least one of the following: command group, directory group, and file path group; Obtain request operation information from the remote interaction request, and select the corresponding group from the operation whitelist based on the type of the request operation information; The request operation information is compared with the selected corresponding group. If the request operation information exists in the corresponding group, the comparison result is determined to meet the requirements.
5. A remote interaction method based on the HTTP protocol according to claim 1, characterized in that, The execution of the corresponding operation based on the remote interaction request specifically includes: If the remote interaction request includes file upload or download, the file size will be compared with a preset threshold; If the value exceeds the preset threshold, then the file will be transferred in chunks, and chunk upload or chunk download will be initiated. If the value is not greater than the preset threshold, then the file is directly transferred. The file to be uploaded is sent to the remote server via an HTTP request, or the downloaded file is sent to the client via an HTTP response.
6. The remote interaction method based on the HTTP protocol according to claim 5, characterized in that, The initiation of segmented upload or segmented download specifically includes: If the file is being uploaded, the file to be uploaded is divided into multiple segments of fixed data size, and each segment is sent to the remote server in the order of file sequence; wherein each segment includes at least one of the following: file identifier, segment number, and total number of segments; A temporary storage directory is created for each of the aforementioned fragments, and the received fragment data is stored sequentially based on the fragment number, while the received fragment number is recorded. After all fragments are received, the fragment data are merged according to the number order to generate a complete file, which is then written to the target path. If the file is to be downloaded, the read file stream is split into segments and sent to the client, where the segmented data is then assembled into a complete file.
7. A remote interaction method based on the HTTP protocol according to claim 5, characterized in that, After the execution of the corresponding operation based on the remote interaction request, the method further includes: If the file upload is interrupted, the client will re-initiate the upload request; wherein the upload request contains the fragment numbers that have been transmitted; The uploaded fragments are verified based on the transmitted fragment numbers, and a list of fragments that have not been uploaded is returned. Files are uploaded based on the list of unuploaded fragments; If the file download is interrupted, a re-download request is received from the client; wherein, the re-download request contains the number of bytes already downloaded, and the position to continue downloading is determined based on the number of bytes already downloaded.
8. A remote interaction method based on the HTTP protocol according to claim 1, characterized in that, After returning the execution result to the client via an HTTP response, the method further includes: Information collected during remote interaction is written to a log file; wherein the collected information includes at least one of client information, operation execution information, and operation status information. The log files are saved for a preset duration, and automatically archived or deleted after the preset duration is reached.
9. A remote interactive device based on the HTTP protocol, characterized in that, The device includes a memory for storing computer program instructions and a processor for executing the program instructions, wherein when the computer program instructions are executed by the processor, the device is triggered to perform the method described in any one of claims 1-8.
10. A non-volatile computer storage medium storing computer-executable instructions, characterized in that, The computer-executable instructions are capable of performing the method described in any one of claims 1-8.
Citation Information
Patent Citations
Safety control method, device and system
CN104270347A
Method and apparatus for realizing remote command execution
CN106161592A
Method for remotely controlling Android device through MQTT message based on multi-factor identity verification
CN119210815A
System and method for secure management of mobile user access to network resources
US20130029641A1