File management method and device, electronic equipment and computer program product

By receiving and parsing file management commands through a browser, and monitoring and displaying the file operation process in real time, this solves the problem of high complexity in file management in the Open OnDemand terminal and achieves efficient file management operations.

CN118733527BActive Publication Date: 2026-11-24PEKING UNIV +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202410795696.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-19
Publication Date
2026-11-24
Estimated Expiration
2044-06-19

AI Technical Summary

Technical Problem

The lack of direct support for file management and editing operations in the Open OnDemand terminal leads to increased operational complexity and reduced work efficiency, which is especially important when managing large amounts of data files in a supercomputing environment.

Method used

By receiving file management commands through a browser, monitoring the command character stream in real time, parsing the command execution status, and displaying the execution process through the file operation interface in the browser, file management operations on the computer cluster can be achieved.

Benefits of technology

File management can be completed directly through a browser, which improves file management efficiency, simplifies the operation process, and enhances user experience and work efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118733527B_ABST
    Figure CN118733527B_ABST
Patent Text Reader

Abstract

This invention discloses a file management method, apparatus, electronic device, and computer program product. The method includes: receiving a file management command for a computer cluster via a browser; responding to the file management command by executing the file management operation indicated by the command on the computer cluster; and invoking a file operation interface in the browser to display the execution process of the file management operation. This invention solves the technical problem of low file management efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computers, and more specifically, to a file management method, apparatus, electronic device, and computer program product. Background Technology

[0002] Open OnDemand provides a web-based graphical interface that allows users without a computer science background to easily access high-performance computing resources.

[0003] However, the Open OnDemand terminal lacks direct support for file management and editing operations. Users typically need additional steps to manage files, which not only increases operational complexity but also reduces efficiency. This is especially important in supercomputing environments where the ability to quickly and securely manage large amounts of data files is crucial.

[0004] There is currently no effective solution to the problem of low efficiency in document management. Summary of the Invention

[0005] This invention provides a file management method, apparatus, electronic device, and computer program product to at least solve the technical problem of low file management efficiency.

[0006] According to one aspect of the present invention, a file management method is provided, comprising: receiving a file management command for a computer cluster via a browser; in response to the file management command, performing a file management operation indicated by the file management command on the computer cluster; and invoking a file operation interface in the browser to display the execution process of the file management operation.

[0007] Optionally, in response to the file management command, executing the file management operation indicated by the file management command on the computer cluster includes: caching the command character stream of the file management command through a string buffer, wherein the file management command is a command string including multiple characters, and the command character stream represents the command string input character by character; monitoring the command character stream in the string buffer in real time to determine the command execution state, wherein the command execution state includes at least: a read command name state, a read command parameter state, and a command end state, wherein the read command name state is an initial state, and if the characters in the command character stream satisfy a first condition, the command execution state transitions from the read command name state to the read command parameter state, and if the characters in the command character stream satisfy a second condition, the command execution state transitions from the read command parameter state to the command end state; and when the command execution state is the command end state, performing the file management operation on the computer cluster.

[0008] Optionally, real-time monitoring of the command character stream in the string buffer to determine the command execution state includes: in the case of the read command name state, monitoring whether the last character in the command character stream is a separator character; if the last character in the command character stream is the separator character, determining that the characters in the command character stream satisfy the first condition; if the characters in the command character stream satisfy the first condition, reading the command name in the file management command from the command character stream belonging to the read command name state, and transferring the read command name state to the read command parameter state, wherein the command name is used to indicate the operation type of the file management operation.

[0009] Optionally, real-time monitoring of the command character stream in the string buffer to determine the command execution state includes: in the case of the read command parameter state, monitoring whether the last character in the command character stream is a separator character; if the last character in the command character stream is the separator character, determining that the characters in the command character stream satisfy the second condition; if the characters in the command character stream satisfy the second condition, reading the command parameters in the file management command from the command character stream belonging to the read command parameter state, and transferring the read command parameter state to the command end state, wherein the command parameters are used to indicate the operation parameters of the file management operation.

[0010] Optionally, in the state of reading command parameters, monitoring whether the last character in the command character stream is a separator character includes: in the state of reading command parameters, monitoring whether the last character in the command character stream is a front quotation mark; if the last character in the command character stream is the front quotation mark, monitoring whether the last character in the command character stream is a back quotation mark; if the last character in the command character stream is the back quotation mark, continuing to monitor the command character stream until the last character in the command character stream is a separator character.

[0011] Optionally, the method further includes: in the case of the read command parameter state, monitoring whether the last character in the command character stream is a preset character, wherein the preset character includes at least: quotation mark characters and escape characters, and the quotation mark characters include: opening quotation mark characters and closing quotation mark characters; if the last character in the command character stream is not a preset character, invoking a first reading strategy and continuing to monitor the command character stream until the last character in the command character stream is a target character, wherein the target character is the separator character or the preset character, the first reading strategy reads the command parameter from a first character stream, the first character stream being the command character stream preceding the target character and belonging to the read command parameter state; in the command character stream If the last character in the command character stream is the opening quotation mark, a second reading strategy is invoked, and the command character stream is monitored until the last character in the command character stream is the closing quotation mark. The second reading strategy reads the command parameters from a second character stream, which is the command character stream between the opening quotation mark and the closing quotation mark. If the last character in the command character stream is the escape character, a third reading strategy is invoked, and the command character stream is monitored until the last character in the command character stream is the separator character. The third reading strategy reads the command parameters from a third character stream, which is the command character stream between the escape character and the separator character.

[0012] Optionally, in response to the file management command, performing a file management operation on the computer cluster includes: parsing the file management command to obtain verification information carried by the file management command and the file management operation indicated by the file management command, wherein the verification information includes at least one of the following: identity information and format information; detecting whether each piece of verification information passes verification; and performing the file management operation on the computer cluster if all the verification information passes verification.

[0013] Optionally, invoking the file operation interface in the browser to display the execution process of the file management operation includes:

[0014] When the file management command is a file viewing command, in response to the file viewing command, the file management interface of the computer cluster is invoked, wherein the file operation interface includes at least: the file management interface; and the file management directory of the computer cluster obtained through the file management operation is displayed through the file management interface.

[0015] Optionally, invoking the file operation interface in the browser to display the execution process of the file management operation includes: when the file management command is a file download command, responding to the file download command, invoking the file download interface of the computer cluster, wherein the file operation interface includes at least the file download interface; and in the file download interface, displaying the download progress of downloading the first file from the computer cluster through the file management operation.

[0016] Optionally, invoking the file operation interface in the browser to display the execution process of the file management operation includes: if the file management command is a file editing command, in response to the file editing command, invoking the graphical text editor of the computer cluster; in the graphical text editor, displaying the second file read in the computer cluster through the file management operation.

[0017] According to another aspect of the present invention, a file management device is also provided, comprising: a receiving module for receiving a file management command for a computer cluster via a browser; a response module for performing a file management operation indicated by the file management command on the computer cluster in response to the file management command; and a display module for calling a file operation interface in the browser to display the execution process of the file management operation.

[0018] According to another aspect of the present invention, a non-volatile storage medium is also provided, wherein a computer program is stored in the non-volatile storage medium, and the above-described file management method is executed by running the computer program in the device where the non-volatile storage medium is located.

[0019] According to another aspect of the present invention, an electronic device is also provided, including a memory and a processor, wherein the memory stores a computer program and the processor is configured to execute the above-described file management method through the computer program.

[0020] According to another aspect of the present invention, a computer program product is also provided, including computer instructions that, when executed by a processor, implement the steps of the above-described file management method.

[0021] In this embodiment of the invention, a file management command for a computer cluster is received through a browser; in response to the file management command, the file management operation indicated by the file management command is executed on the computer cluster; the file operation interface in the browser is invoked to display the execution process of the file management operation, so that file management of the computer cluster can be completed through the browser without additional operations, thereby achieving the technical effect of improving file management efficiency and solving the technical problem of low file management efficiency. Attached Figure Description

[0022] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, illustrate exemplary embodiments of the invention and, together with their description, serve to explain the invention and do not constitute an undue limitation thereof. In the drawings:

[0023] Figure 1 This is a flowchart of a file management method according to an embodiment of the present invention;

[0024] Figure 2 This is a schematic diagram illustrating the use of terminal file management functionality according to an embodiment of the present invention;

[0025] Figure 3 This is a schematic diagram of an input file viewing command according to an embodiment of the present invention;

[0026] Figure 4 This is a schematic diagram of a file management directory according to an embodiment of the present invention;

[0027] Figure 5 This is a schematic diagram of an input file download command according to an embodiment of the present invention;

[0028] Figure 6 This is a schematic diagram of an input file editing command according to an embodiment of the present invention;

[0029] Figure 7 This is a schematic diagram of a graphical text editor according to an embodiment of the present invention;

[0030] Figure 8 This is a schematic diagram of a browser terminal system according to an embodiment of the present invention;

[0031] Figure 9 This is a schematic diagram of command recognition according to an embodiment of the present invention;

[0032] Figure 10 This is a schematic diagram illustrating a document viewing method according to an embodiment of the present invention;

[0033] Figure 11 This is a schematic diagram illustrating a file download according to an embodiment of the present invention;

[0034] Figure 12 This is a schematic diagram of a document editing function according to an embodiment of the present invention;

[0035] Figure 13 This is a schematic diagram of a file management device according to an embodiment of the present invention;

[0036] Figure 14 This is a structural block diagram of a computer terminal according to an embodiment of the present invention. Detailed Implementation

[0037] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0038] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0039] First, some nouns or terms that appear in the description of the embodiments of this application shall be interpreted as follows:

[0040] High-performance computing platforms refer to a collection of systems and devices specifically designed to perform complex and data-intensive computing tasks. These platforms typically include computers with high-speed processors, large amounts of memory, high-speed network connections, and large-scale storage systems.

[0041] A terminal provides a way for users to enter commands and receive system output, allowing them to interact with a computer system. In a command-line interface, users can enter commands via the keyboard and see the system's responses and output on the screen. Terminals can also be used to access remote computer systems, connect to remote servers over a network, and execute commands and operations.

[0042] According to an embodiment of the present invention, a file management method embodiment is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0043] Figure 1 This is a flowchart of a file management method according to an embodiment of the present invention, such as... Figure 1 As shown, the method includes the following steps:

[0044] Step S102: Receive file management commands for the computer cluster through a browser;

[0045] Step S104: In response to the file management command, perform the file management operation indicated by the file management command on the computer cluster;

[0046] Step S106: Call the file operation interface in the browser to display the execution process of file management operations.

[0047] In this embodiment of the invention, a file management command for a computer cluster is received through a browser; in response to the file management command, the file management operation indicated by the file management command is executed on the computer cluster; the file operation interface in the browser is invoked to display the execution process of the file management operation, so that file management of the computer cluster can be completed through the browser without additional operations, thereby achieving the technical effect of improving file management efficiency and solving the technical problem of low file management efficiency.

[0048] In step S102 above, the computer cluster can be a supercomputing cluster, which is a high-performance computing cluster composed of multiple computers used for large-scale, complex scientific computing and data processing. Supercomputing clusters typically consist of dozens or even hundreds of computers connected together via a high-speed network to collectively complete tasks requiring substantial computing resources. Supercomputing clusters are usually equipped with state-of-the-art processors, large-capacity memory, and storage systems, providing extremely high computing performance and throughput to solve complex problems in fields such as science, engineering, and medicine.

[0049] In step S102 above, the file management command can be an interactive command initiated by the user through a browser.

[0050] In step S102 above, the browser can display the usage rules of each file management command through the command prompt area.

[0051] Optionally, the command prompt area can be triggered by a command button in the browser. When the user clicks the command button, the command button is triggered, and the command prompt area is displayed.

[0052] In step S102 above, the file management commands include at least: file viewing command, file download command, and file editing command.

[0053] In step S102 above, trigger buttons corresponding to file management commands can also be pre-arranged in the browser. For example, the trigger buttons include: a first trigger button corresponding to the file viewing command, a second trigger button corresponding to the file download command, and a third trigger button corresponding to the file editing command. After the user clicks the trigger button, the trigger button can automatically input the command line in character form of the corresponding file management command.

[0054] In step S102 above, the browser can be executed on the user's terminal. The terminal is connected to the computer cluster through the browser's server. When the user enters a file management command for the computer cluster in the browser, each character in the file management command is sent to the server in a timely manner. The server recognizes and responds to the characters entered by the user, and then controls the browser to display the file operation interface and controls the computer cluster to perform file management operations based on the response results.

[0055] In step S106 above, the file operation interface can display the execution process of file management operations, interact with the user, and receive operation commands issued by the user based on the file operation interface.

[0056] In step S106 above, the file operation interface corresponds to the file management command, so different file management commands correspond to different file operation interfaces.

[0057] Optionally, different file operation interfaces can be displayed in different areas of the browser.

[0058] As an optional embodiment, in response to a file management command, executing the file management operation indicated by the file management command on the computer cluster includes: caching the command character stream of the file management command through a string buffer, wherein the file management command is a command string including multiple characters, and the command character stream represents the command string entered character by character; monitoring the command character stream in the string buffer in real time to determine the command execution state, wherein the command execution state includes at least: read command name state, read command parameter state, and command end state, the read command name state is the initial state, if the characters in the command character stream satisfy a first condition, the command execution state transitions from the read command name state to the read command parameter state, if the characters in the command character stream satisfy a second condition, the command execution state transitions from the read command parameter state to the command end state; and when the command execution state is the command end state, performing the file management operation on the computer cluster.

[0059] In the above embodiments of the present invention, a string buffer is used to cache the command character stream in the file management command. Parsing can be performed in real time based on the command string in the string buffer. Since the command character stream in the file management command can carry multiple command information, such as command name and command parameters, the command execution status corresponding to the command character stream can be monitored in real time while parsing the command character stream. When the command character stream meets the current command execution status, it can be parsed to obtain the command information carried in the command character stream under the current command execution status, and the command execution status of the command character stream can be transferred to the next command execution status for continued monitoring until the command execution status is transferred to the command end status, indicating that the complete file management command has been obtained, and the file management operation indicated by the file management command can be executed, thereby realizing the parsing and response to the file management command.

[0060] It should be noted that file management commands are command strings containing multiple characters, and the command character stream consists of the characters already entered when the command string is input.

[0061] As an optional embodiment, real-time monitoring of the command character stream in the string buffer to determine the command execution state includes: in the case of reading the command name state, monitoring whether the last character in the command character stream is a separator character; if the last character in the command character stream is a separator character, determining that the characters in the command character stream satisfy a first condition; if the characters in the command character stream satisfy the first condition, reading the command name from the command character stream belonging to the read command name state, and transferring the read command name state to the read command parameter state, wherein the command name is used to indicate the operation type of the file management operation.

[0062] In the above embodiments of the present invention, a delimiter character can be used as a separator between the command name and command parameters in the command string of the file management command. Furthermore, when monitoring the command character stream, the delimiter character in the command character stream can be used as a transition condition for the command execution state. If a delimiter character is detected in the command character stream when reading the command name, the command execution state is transitioned from the read command name state to the read command parameter state. Then, the command name in the file management command is read from the command string in the command character stream belonging to the read command name state, before the delimiter character. Based on the read command name, the operation type of the file management operation can be indicated, thereby realizing the selection of the operation type.

[0063] As an optional embodiment, real-time monitoring of the command character stream in the string buffer to determine the command execution state includes: in the case of reading command parameters, monitoring whether the last character in the command character stream is a separator character; if the last character in the command character stream is a separator character, determining that the characters in the command character stream satisfy a second condition; if the characters in the command character stream satisfy the second condition, reading the command parameters in the file management command from the command character stream belonging to the read command parameter state, and transferring the read command parameter state to the command end state, wherein the command parameters are used to indicate the operation parameters of the file management operation.

[0064] In the above embodiments of the present invention, a delimiter character can be used as a separator between the command name and command parameters in the command string of the file management command. Furthermore, when monitoring the command character stream, the delimiter character in the command character stream can be used as a transition condition for the command execution state. If a delimiter character is detected in the command character stream when reading command parameters, the command execution state is transitioned from the read command parameters state to the command end state. Then, the command parameters in the file management command are read from the command string in the command character stream belonging to the read command parameters state that is before the delimiter character. Based on the read command parameters, the operation parameters of the file management operation can be indicated, thereby realizing the determination of the operation parameters.

[0065] As an optional embodiment, when the command execution state transitions to the command termination state, the file management operation can be determined and executed based on the command name read from the read command name state and the command parameters read from the read command parameter state.

[0066] As an optional embodiment, when reading command parameters, monitoring whether the last character in the command character stream is a separator character includes: when reading command parameters, monitoring whether the last character in the command character stream is a front quotation mark; if the last character in the command character stream is a front quotation mark, monitoring whether the last character in the command character stream is a back quotation mark; if the last character in the command character stream is a back quotation mark, continuing to monitor the command character stream until the last character in the command character stream is a separator character.

[0067] In the above embodiments of the present invention, multiple command parameters can exist in the command string of a file management command. These multiple command parameters can be separated by a delimiter character. To avoid using the delimiter character that separates the command parameters as the delimiter character controlling the transition of command execution state, multiple command parameters can be enclosed in quotation marks. Thus, when monitoring the read command parameter state, the presence of a front quotation mark character in the command character stream can be monitored first. If a front quotation mark character is detected, the monitoring of the command character stream continues, and the command execution state will not be transitioned based on the detected delimiter character until a back quotation mark character is detected. At this point, the string between the front and back quotation marks characters in the command character stream is determined to be a command parameter. Furthermore, monitoring can continue until a delimiter character not within quotation marks is detected, at which point the command execution state transition is performed, ensuring that complete command parameters can be obtained from the command character stream.

[0068] As an optional embodiment, if the last character in the command character stream is not a front quotation mark, the command character stream is monitored until the last character in the command character stream is a separator character.

[0069] As an optional embodiment, the method further includes: when the command parameter reading state is in progress, monitoring whether the last character in the command character stream is a preset character, wherein the preset character includes at least: quotation mark characters and escape characters, and the quotation mark characters include: opening quotation mark characters and closing quotation mark characters; when the last character in the command character stream is not a preset character, invoking a first reading strategy and continuing to monitor the command character stream until the last character in the command character stream is a target character, wherein the target character is a separator character or a preset character, and the first reading strategy reads command parameters from a first character stream, wherein the first character stream is the command character stream that precedes the target character and belongs to the command parameter reading state; If the last character in the command character stream is a front quotation mark, the second read strategy is invoked, and the command character stream continues to be monitored until the last character in the command character stream is a back quotation mark. The second read strategy reads the command parameters from the second character stream, which is the command character stream between the front quotation mark and the back quotation mark. If the last character in the command character stream is an escape character, the third read strategy is invoked, and the command character stream continues to be monitored until the last character in the command character stream is a separator character. The third read strategy reads the command parameters from the third character stream, which is the command character stream between the escape character and the separator character.

[0070] It should be noted that there can be various forms of command parameters in the command string of file management commands. Different reading strategies can be used to read parameters for different forms of command parameters. Therefore, when reading command parameters from the command character stream, you can first detect the parameter type of the command parameter, and then select the appropriate reading strategy to read the parameter based on the detected parameter type.

[0071] Optionally, different forms of command parameters can be indicated using different preset characters. Therefore, by monitoring the preset characters in the command character stream, a reading strategy can be selected.

[0072] In the above embodiments of the present invention, the command character stream is monitored in real time. If no preset character is detected, it indicates that a first reading strategy is needed to read the command parameters. If a preset character is detected, it indicates that a special reading strategy is needed, and further identification of the type of the preset character is required. If the preset character is a quotation mark, a second reading strategy indicated by the quotation mark can be used to read the command parameters. If the preset character is an escape character, a third reading strategy indicated by the escape character can be used to read the command parameters. Thus, during the parameter parsing process, command parameters enclosed in quotation marks and backslash escape characters can be correctly processed to ensure that spaces and quotation marks in the command parameters are correctly processed and to prevent security issues such as injection attacks.

[0073] As an optional embodiment, in response to a file management command, performing a file management operation on the computer cluster includes: parsing the file management command to obtain the verification information carried by the file management command and the file management operation indicated by the file management command, wherein the verification information includes at least one of the following: identity information and format information; detecting whether each piece of verification information passes verification; and performing a file management operation on the computer cluster if all verification information passes verification.

[0074] In the above embodiments of the present invention, in response to a file management command, the file management command can be parsed. While parsing the file management operation from the command string of the file management command, the verification information carried by the file management command can also be parsed and verified. If all the verification information in the file management command passes the verification, it is determined that the file management operation indicated by the file management command can be used to perform the file management operation on the computer cluster.

[0075] Optionally, the verification information may include the identity information of the user who inputs the file management command. Verifying the identity information can check whether the user who inputs the file management command has the permission to perform the file management operation, that is, to perform permission verification. If the permission verification is successful, the identity information is determined to have passed the verification; otherwise, the identity information is determined to have failed the verification.

[0076] Optionally, the user's identity information can be determined based on the intervals between the strings in the user's input file management command. Different users may exhibit differences in key order when inputting command strings, such as the time intervals between characters. This key order difference can serve a similar function to the differences in human fingerprints, allowing for the identification of the user's identity information.

[0077] Optionally, based on the format information, the correctness of the command format of the file management command can be checked. If the command format is correct, the verification passes; if the command format is incorrect, the verification fails.

[0078] Optionally, if the file management command contains address information, the verification can be performed based on the format information. It can also verify whether the address information is correct, such as checking whether the file / location indicated by the address information exists in the computer cluster. If the file / location indicated by the address information exists, the verification passes; if the file / location indicated by the address information does not exist, the verification fails.

[0079] As an optional embodiment, calling the file operation interface in the browser to display the execution process of the file management operation includes: when the file management command is a file viewing command, responding to the file viewing command, calling the file management interface of the computer cluster, wherein the file operation interface includes at least: a file management interface; and displaying the file management directory of the computer cluster obtained through the file management operation through the file management interface.

[0080] In the above embodiments of the present invention, when the file management command is a file viewing command, the file operation interface includes at least a file management interface corresponding to the file viewing command. When responding to the file viewing command, the file management directory of the computer cluster can be obtained according to the file management operation indicated by the file viewing command, and the file management directory can be displayed in the file management interface.

[0081] Optionally, the file management interface can also receive file operation commands issued by users for the file management directory.

[0082] As an optional embodiment, calling the file operation interface in the browser to display the execution process of the file management operation includes: when the file management command is a file download command, responding to the file download command, calling the file download interface of the computer cluster, wherein the file operation interface includes at least: a file download interface; and displaying the download progress of the first file downloaded from the computer cluster through the file management operation in the file download interface.

[0083] In the above embodiments of the present invention, when the file management command is a file download command, the file operation interface includes at least a file download interface corresponding to the file download command. When responding to the file download command, a first file can be selected from the computer cluster for download according to the file management operation indicated by the file download command, and the download progress of the first file can be displayed on the file download interface.

[0084] As an optional embodiment, when the file management command is a file download command, it can be detected whether the file management operation indicated by the file download command is to download a single file or a folder. If it is determined that a single file is to be downloaded, the file can be directly downloaded as the first file. If it is determined that a folder is to be downloaded, the file size in the folder can be detected. If the file size is greater than a preset size threshold, the files in the folder are compressed into a first file for download. If the file size is not greater than the preset size threshold, each file in the folder is downloaded as a second file.

[0085] Optionally, the file size within the folder can be expressed as the number of files in the folder and the file volume within the folder. If the number of files in the folder is greater than a preset number threshold, it indicates that the file size of the folder is greater than a preset size threshold; if the file volume within the folder is greater than a preset volume threshold, it indicates that the file size of the folder is greater than a preset size threshold.

[0086] As an optional embodiment, calling the file operation interface in the browser to display the execution process of the file management operation includes: when the file management command is a file editing command, in response to the file editing command, calling the graphical text editor of the computer cluster; in the graphical text editor, displaying the second file read in the computer cluster through the file management operation.

[0087] In the above embodiments of the present invention, when the file management command is a file editing command, the file operation interface includes at least a file operation interface corresponding to the file editing command. When responding to the file editing command, a second file can be read from the computer cluster according to the file management operation indicated by the file editing command, and the file content of the second file can be displayed in the file operation interface.

[0088] Optionally, the file management interface can also receive file editing commands issued by the user for the first file.

[0089] The present invention also provides a preferred embodiment, which provides a browser terminal system for high-performance computing platforms. While directly connecting to the supercomputing cluster through the browser terminal, it introduces a browser-based file management service. This file management service is seamlessly integrated into the browser terminal, providing users with an intuitive way to directly access and manage high-performance computing resources. It allows users to directly interact with the file system through the browser on the terminal, improving the convenience and efficiency of operation.

[0090] Figure 2 This is a schematic diagram illustrating the use of terminal file management functionality according to an embodiment of the present invention, such as... Figure 2 As shown, through the file management commands integrated within the browser terminal system, users can directly view, download, and edit files in the cluster through the browser on the terminal, simplifying file operations and enabling the file management service to be seamlessly integrated into the browser-based terminal session, thus providing an intuitive and efficient file operation interface.

[0091] Optionally, file management commands may include at least: file viewing commands, file download commands, and file editing commands.

[0092] Optionally, the browser can display descriptions of file management commands in the command prompt area, such as... Figure 2 As shown, the command prompt area displays the following: The file viewing command is "fsnav", used to jump to the file system. The corresponding description is "After entering this command, you will jump to the file system, where you can upload and download files"; the file download command is "getfile [filename or folder name]", used to download files. The corresponding description is "After entering this command, you can download the specified file or folder. When downloading a folder and a large number of files, the system will automatically compress them. Example usage: 'getfile repor.txt' or 'getfile images / '"; the file editing command is "editfile [filename]", used to jump to the editing page. The corresponding file description is "After entering this command, the specified file will open in the editor, allowing you to edit it. Example usage: 'editfile config.yaml'".

[0093] Figure 3 This is a schematic diagram of an input file viewing command according to an embodiment of the present invention, such as... Figure 3As shown, in a browser-based terminal environment, when a user enters the file viewing command "fsnav", the system will activate the file management service of the computer cluster and directly navigate the user to the current directory of the file system without requiring manual navigation.

[0094] Figure 4 This is a schematic diagram of a file management directory according to an embodiment of the present invention, such as... Figure 4 As shown, when the user is navigated to the current directory of the file system (i.e., the file management directory), the file management directory can be displayed through the file operation interface in the browser. The user can then upload or download files based on the file management interface, which is extremely convenient for quickly reviewing configuration files, logs, or other text files. Furthermore, the file viewing command supports different file formats, providing a clear viewing experience.

[0095] Figure 5 This is a schematic diagram of an input file download command according to an embodiment of the present invention, such as... Figure 5 As shown, after the user enters the file download command "getfile repor.txt", the terminal, through direct interaction with the browser, allows the user to easily download the file from the computer cluster to their local machine. This meets the user's file transfer needs in remote work scenarios, as the download process can be triggered with simplified command input, improving the convenience of user operation; furthermore, during the download process, the file download progress can be displayed through the file operation interface in the browser.

[0096] Figure 6 This is a schematic diagram of an input file editing command according to an embodiment of the present invention, such as... Figure 6 As shown, after the user enters the file editing command "editfile test.txt", the file management service can be activated to intelligently navigate the user to a graphical text editor.

[0097] Figure 7 This is a schematic diagram of an input graphical text editor according to an embodiment of the present invention, such as... Figure 7 As shown, a graphical text editor can be displayed through the browser's file operation interface via file editing commands. This graphical text editor will directly open the corresponding file based on the filename in the received file editing command, allowing users to easily perform editing operations. This enables users to directly launch the graphical text editor by entering the filename in the command line and perform real-time editing, improving editing efficiency and user experience. Users can complete file editing and saving without leaving the browser or switching to another text editor, achieving high efficiency and simplification of the file editing process.

[0098] As an optional implementation, the browser is primarily responsible for providing a terminal access interface with integrated file management functions, allowing users to interact directly with the supercomputing cluster (i.e., computer cluster) through a standard browser. This enables users to link the file system of the supercomputing cluster (i.e., computer cluster) within the browser and directly upload, download, and edit files without relying on external tools or performing complex command-line operations.

[0099] Figure 8 This is a schematic diagram of a browser terminal system according to an embodiment of the present invention, such as... Figure 8 As shown, the browser terminal system mainly includes a command recognition part and a terminal file management part. The command recognition part includes a command triggering module and a command parsing module, and the terminal file management part includes a file viewing module, a file downloading module, and a file editing module.

[0100] As an optional implementation, in a browser-based high-performance computing cluster terminal system, users input file management commands via a WebSocket connection. These commands need to be parsed and processed in real time. This mechanism greatly enhances the interactivity and responsiveness of the terminal interface, as each keystroke is instantly sent to the server. This real-time character stream processing improves system responsiveness, but it also introduces a technical challenge: accurately identifying the complete command and its parameters intended by the user from the character-by-character data stream for various file management commands. To address this issue, this application designs a command parser capable of efficiently extracting and parsing user commands and parameters from a continuous input stream.

[0101] As an optional example, a command parser may include at least a command triggering module and a command parsing module.

[0102] Optionally, the command triggering module responds to file management commands by running a specific script on the SSH server. When a user issues a file management command, the command triggering module generates relevant real-time status information, which can be sent as command response data to the browser's terminal. This response data will be directly displayed on the browser interface, indicating to the user that the relevant file management operation is in progress. The command parsing module in the front-end system monitors and captures this response data from the command triggering module, identifying the specific file operation requested by the user and its related parameters, such as the specific filename.

[0103] Figure 9 This is a schematic diagram of command recognition according to an embodiment of the present invention, such as... Figure 9As shown, command recognition is performed by a command parser. The state machine-based command parser uses a string buffer to accumulate input characters. This string buffer is the core of the entire parsing process, responsible for constructing the user's complete command-line input. By continuously appending input characters to this buffer, after receiving sufficient information, the command is segmented and parsed according to the syntax rules of file management commands. Specifically, this includes the following steps:

[0104] Step S902: Read the command name. In the command name reading state (i.e., the initial state), the command parser continuously reads the input characters until it encounters the first delimiter (such as a space or newline character), which is considered the command name.

[0105] Step S904, read parameters. After the state machine transitions from the read command name state to the read parameter state, it begins to parse the command parameters in the command line.

[0106] Optionally, command arguments are usually separated by spaces, but if command arguments contain spaces, they need to be enclosed in quotation marks.

[0107] Optionally, the command parser also needs to process the content within quotes and escape characters when reading parameters.

[0108] Step S906, Command End. When the command parser detects a newline character or the end of the command string, it transitions from the parameter reading state to the command end state. This command end state signifies the end of a command line, and the command parser then combines the command name and command parameters accumulated in the string buffer, preparing for execution.

[0109] As an optional example, the ending portion of the S906 command above includes the following steps:

[0110] Step S90601: Determine if the current period contains special characters. If not, proceed to step S90602; if yes, proceed to step S90606.

[0111] Step S90602: Process ordinary parameter characters, and then execute step S90603.

[0112] Step S90603: Determine whether the current character is a space or a newline character. If not, proceed to step S90604; if yes, proceed to step S90605.

[0113] Step S90604: Add the character to the current parameter.

[0114] Step S90605: Determine whether all parameters have been read. If yes, proceed to step S908; otherwise, return to step S904 and continue reading parameters.

[0115] Step S90606: Process special characters, then proceed to step S90607.

[0116] Step S90607: Determine if the current character is a quotation mark. If yes, proceed to step S90608; otherwise, proceed to step S90609.

[0117] Step S90608: Process the parameters within the quotation marks, and then execute step S90603.

[0118] Step S90609: Determine if the current character is a backslash. If so, proceed to step S90610.

[0119] Step S90610: Process escape parameters to achieve escape processing of command parameters.

[0120] Step S908: Execute the command. Upon command completion, the command parser calls the corresponding processing function to perform the actual management operation. These functions perform the appropriate logical operations (i.e., management operations) based on the command type and parameters, such as opening, editing, or downloading a file.

[0121] In the embodiments of the present invention described above, command parameters may include file paths, options, etc., and these command parameters may contain spaces, quotation marks, and other characters requiring special handling. To ensure accurate parsing of these command parameters and prevent security issues such as injection attacks, this application employs specific strategies to handle quotation marks and escape characters. During parameter parsing, command parameters enclosed in quotation marks and backslash escape characters are correctly handled to ensure that spaces and quotation marks in the command parameters are correctly understood. Simultaneously, before performing any file operations, the command parameters are rigorously validated, including checking the validity of the path, to prevent security vulnerabilities such as path traversal. These validations ensure that the input command parameters do not lead to unauthorized access to unauthorized parts of the file system.

[0122] As an optional implementation, users may output a large amount of log information, such as error details, system status updates, debugging information, etc., which typically contain a lot of text. When processing this log information, using simple string matching methods can be inefficient. The Boyer-Moore algorithm provides efficient string matching, allowing certain unnecessary parts to be skipped during the text search process, thus significantly reducing the number of comparisons and improving search speed.

[0123] Figure 10 This is a schematic diagram of a file viewing method according to an embodiment of the present invention, such as... Figure 10As shown, a file viewing function is implemented based on a file viewing module. This file viewing function includes at least the following main processes: parsing user input stream, validating command format, capturing file system address, and viewing the file system. Specifically, it includes the following steps:

[0124] Step S1001: Parse the user input stream.

[0125] Step S1002: Determine whether the command format verification is passed. If yes, proceed to step S1003; otherwise, proceed to step S1007.

[0126] Step S1003: Obtain the file system address, and then execute step S1004.

[0127] Step S1004: Determine whether the address format and validity verification are passed. If yes, proceed to step S1005; otherwise, proceed to step S1009.

[0128] Step S1005: Determine whether the user permission check has passed. If yes, proceed to step S1006; otherwise, proceed to step S1014.

[0129] Step S1006: View the file system.

[0130] Step S1007 returns a command format error message, and then proceeds to step S1008.

[0131] Step S1008 prompts for the correct command format.

[0132] Step S1009: Determine if the address format is incorrect. If yes, proceed to step S1010; otherwise, proceed to step S1011.

[0133] Step S1010 prompts that the user's address format is incorrect.

[0134] Step S1011: Determine if the path is invalid. If yes, proceed to step S1012; otherwise, proceed to step S1013.

[0135] Step S1012 prompts that the user path is invalid.

[0136] Step S1013: Record the error log.

[0137] Step S1014 returns a permission error message.

[0138] In the above embodiments of the present invention, after a user enters a file viewing command in a browser, the system accurately parses the command in the input / output stream. The system listens to the input / output stream in the terminal and captures the command string after detecting the user's input. When recognizing file management commands, it also checks whether the command string conforms to predefined format rules and whether the file system path is a valid system path. If the command format does not conform to the specifications, the system will return an error message to the user, indicating that the file management command cannot be recognized or the file path is invalid.

[0139] As an optional implementation, once the file management command passes format validation, the system proceeds to the file system address acquisition stage. In this stage, the command parser resolves the user-specified file path, verifying whether the path points to a file that exists and that the user has permission to access. Path validity verification is performed by querying the file system's directory structure, ensuring that the requested directory does indeed exist in the HPC cluster's file system. Once the address is confirmed to be correct, the file system will be activated to provide the user with file viewing services.

[0140] Figure 11 This is a schematic diagram of a file download according to an embodiment of the present invention, such as... Figure 11 As shown, a file download function is implemented based on the file download module. This file download function includes at least the following main processes: user input stream parsing, command format validation, file address acquisition, file validation, and file download. Specifically, it includes the following steps:

[0141] Step S1101: Parse the user input stream.

[0142] Step S1102: Determine whether the file download command passes the format verification. If yes, proceed to step S1103; otherwise, proceed to step S1108.

[0143] Step S1103: Obtain the download file address, and then proceed to step S1104.

[0144] Step S1104: Check if the download file address exists in the cluster's file system. If it does, proceed to step S1105; otherwise, proceed to step S1110.

[0145] Step S1105: Determine whether the user has download permission for the file indicated by the download file address. If yes, proceed to step S1106; otherwise, proceed to step S1111.

[0146] Step S1106: Determine whether the download target is a folder. If yes, proceed to step S1112; otherwise, proceed to step S1107.

[0147] Step S1107: Download the file.

[0148] Step S1108 returns a command format error message, and then proceeds to step S1109.

[0149] Step S1109 prompts for the correct command format.

[0150] Step S1110 returns an error message indicating that the file does not exist.

[0151] Step S1111 returns a permission error message.

[0152] Step S1112: Count the number of files in the folder, and then proceed to step S1113.

[0153] Step S1113: Compare the number of files with a preset number threshold to determine if the number of files is too large. If yes, proceed to step S1114; otherwise, proceed to step S1115.

[0154] Step S1114: Compress and download the folder.

[0155] Step S1115: Download all files directly.

[0156] In the above embodiments of the present invention, the user enters a file download command through a browser. After the system captures the file download command, it begins to parse the command, identify command keywords and subsequent parameters, such as the file path. After parsing, the system needs to check whether the command format is correct, especially the path format, and whether the user has sufficient permissions to access the specified path. If the path format is incorrect or the permissions are insufficient, the system will immediately return an error message to the user and provide the correct command format.

[0157] As an optional example, after the command passes basic format and permission checks, the system will determine whether the user wants to download a single file or a folder based on the path. For a single file, the system obtains the file's actual address in the HPC cluster based on the file path provided by the user; after obtaining the file address, the system directly performs the download operation through the browser interface, downloading the file from the HPC cluster's file system to the local machine.

[0158] As an alternative example, when a user requests to download a folder, the system needs to traverse the entire folder, determine the total number of files inside, and select different download strategies based on the statistical results.

[0159] As an optional implementation, if the number of files in a folder is small, the entire folder will be downloaded directly. This avoids the overhead of compression while maintaining the integrity of the file structure. In this case, the system will download each file one by one, creating the corresponding directory structure on the user's local machine to preserve the original file organization.

[0160] As an alternative implementation, if the folder contains a large number of files, the entire folder will be compressed into a single archive to reduce transmission time and improve network efficiency. This strategy significantly improves transmission efficiency by reducing the number of files and the overall size. After compression, the system sends this archive to the user.

[0161] Figure 12 This is a schematic diagram of a document editing function according to an embodiment of the present invention, such as... Figure 12 As shown, the file editing function includes key processes such as user input parsing, command format validation, file location and validation, and finally, providing a file editing environment. Specifically, it includes the following steps: After the user enters a command in a browser-based terminal, the command is executed on the computer cluster and returns file information. The system captures the command in the input / output stream. If file validation is successful, the system will parse the accurate file path; otherwise, the system will return a clear error message to the user, pointing out the non-compliance of the command, such as an incorrect command format or an incompatible file path, and providing modification suggestions. After command and file validation, the system confirms that the user has editing permissions for the file and then provides the user with an interactive browser editor environment, allowing the user to edit the file as quickly as in a local editor.

[0162] As an alternative example, in addition to capturing file management-related commands through the user input / output stream in the terminal, one could consider adding user interface elements to the browser terminal, such as introducing a dedicated file management jump button, to improve the user experience and operational intuitiveness.

[0163] The embodiments described above address the frequent file management needs in high-performance computing applications. By providing file viewing, editing, and downloading functions, users can directly access the file management system through their terminals to view, download, and edit files within the cluster. This simplifies file operations and streamlines the user's workflow. Users can directly upload, download, and edit files by connecting to the file system within their browser terminals, without relying on external tools or complex command-line operations. This makes it easy for users without technical backgrounds to use, achieving the technical effect of optimizing terminal file management operations and improving operational efficiency.

[0164] According to an embodiment of the present invention, a file management device embodiment is also provided. It should be noted that the file management device can be used to execute the file management method in the embodiment of the present invention, and the file management method in the embodiment of the present invention can be executed in the file management device.

[0165] Figure 13 This is a schematic diagram of a file management device according to an embodiment of the present invention, such as... Figure 13 As shown, the device may include: a receiving module 1302, used to receive file management commands for the computer cluster via a browser; a response module 1304, used to execute file management operations indicated by the file management commands on the computer cluster in response to the file management commands; and a display module 1306, used to call the file operation interface in the browser and display the execution process of the file management operations.

[0166] It should be noted that the receiving module 1302 in this embodiment can be used to execute step S102 in this application embodiment, the response module 1304 in this embodiment can be used to execute step S104 in this application embodiment, and the display module 1306 in this embodiment can be used to execute step S106 in this application embodiment. The examples and application scenarios implemented by the above modules and corresponding steps are the same, but are not limited to the content disclosed in the above embodiments.

[0167] In this embodiment of the invention, a file management command for a computer cluster is received through a browser; in response to the file management command, the file management operation indicated by the file management command is executed on the computer cluster; the file operation interface in the browser is invoked to display the execution process of the file management operation, so that file management of the computer cluster can be completed through the browser without additional operations, thereby achieving the technical effect of improving file management efficiency and solving the technical problem of low file management efficiency.

[0168] As an optional embodiment, the response module includes: a caching unit for caching a command character stream of file management commands through a string buffer, wherein the file management command is a command string including multiple characters, and the command character stream represents the command string input character by character; a monitoring unit for monitoring the command character stream in the string buffer in real time and determining the command execution state, wherein the command execution state includes at least: read command name state, read command parameter state, and command end state, the read command name state is the initial state, the command execution state transitions from the read command name state to the read command parameter state when the characters in the command character stream meet a first condition, and the command execution state transitions from the read command parameter state to the command end state when the characters in the command character stream meet a second condition; and an execution unit for performing file management operations on the computer cluster when the command execution state is the command end state.

[0169] As an optional embodiment, the monitoring unit includes: a first monitoring subunit, configured to monitor whether the last character in the command character stream is a separator character when the command name is read; a first determining subunit, configured to determine that the characters in the command character stream satisfy a first condition when the last character in the command character stream is a separator character; and a first reading subunit, configured to read the command name in the file management command from the command character stream belonging to the read command name state when the characters in the command character stream satisfy the first condition, and to transfer the read command name state to the read command parameter state, wherein the command name is used to indicate the operation type of the file management operation.

[0170] As an optional embodiment, the monitoring unit includes: a second monitoring subunit, configured to monitor whether the last character in the command character stream is a separator character when the command parameter reading state is in progress; a second determining subunit, configured to determine that the characters in the command character stream satisfy a second condition when the last character in the command character stream is a separator character; and a second reading subunit, configured to read the command parameters in the file management command from the command character stream belonging to the command parameter reading state when the characters in the command character stream satisfy the second condition, and to transfer the command parameter reading state to the command end state, wherein the command parameters are used to indicate the operation parameters of the file management operation.

[0171] As an optional embodiment, the second monitoring subunit includes: a third monitoring subunit, used to monitor whether the last character in the command character stream is a front quotation mark when the command parameter reading status is active; a fourth monitoring subunit, used to monitor whether the last character in the command character stream is a back quotation mark when the last character in the command character stream is a front quotation mark; and a fifth monitoring subunit, used to continue monitoring the command character stream when the last character in the command character stream is a back quotation mark until the last character in the command character stream is a separator character.

[0172] As an optional embodiment, the device further includes: a sixth monitoring subunit, configured to monitor whether the last character in the command character stream is a preset character when the command parameter reading state is in progress, wherein the preset character includes at least: quotation mark characters and escape characters, and the quotation mark characters include: opening quotation mark characters and closing quotation mark characters; and a first calling subunit, configured to call a first reading strategy and continue monitoring the command character stream when the last character in the command character stream is not a preset character, until the last character in the command character stream is a target character, wherein the target character is a separator character or a preset character, and the first reading strategy reads command parameters from a first character stream, the first character stream being the command character stream preceding the target character and belonging to the command parameter reading state; The second calling subunit is used to invoke the second reading strategy when the last character in the command character stream is a front quotation mark, and continue monitoring the command character stream until the last character in the command character stream is a back quotation mark. The second reading strategy reads command parameters from the second character stream, which is the command character stream between the front quotation mark and the back quotation mark. The third calling subunit is used to invoke the third reading strategy when the last character in the command character stream is an escape character, and continue monitoring the command character stream until the last character in the command character stream is a separator character. The third reading strategy reads command parameters from the third character stream, which is the command character stream between the escape character and the separator character.

[0173] As an optional embodiment, the response module includes: a parsing unit, used to parse the file management command to obtain the verification information carried by the file management command and the file management operation indicated by the file management command, wherein the verification information includes at least one of the following: identity information and format information; a monitoring unit, used to detect whether each piece of verification information passes the verification; and an execution unit, used to execute the file management operation on the computer cluster if all the verification information passes the verification.

[0174] As an optional embodiment, the display module includes: a first invocation unit, configured to invoke the file management interface of the computer cluster in response to a file viewing command when the file management command is a file viewing command, wherein the file operation interface includes at least a file management interface; and a first display unit, configured to display the file management directory of the computer cluster obtained through file management operations via the file management interface.

[0175] As an optional embodiment, the display module includes: a second invocation unit, configured to invoke the file download interface of the computer cluster in response to the file download command when the file management command is a file download command, wherein the file operation interface includes at least: a file download interface; and a second display unit, configured to display the download progress of the first file downloaded from the computer cluster through file management operations in the file download interface.

[0176] As an optional embodiment, the demonstration module includes: a third invocation unit, used to invoke a graphical text editor of the computer cluster in response to a file editing command when the file management command is a file editing command; and a third display unit, used to display a second file read from the computer cluster through file management operations in the graphical text editor.

[0177] Embodiments of the present invention may provide an electronic device that identifies a computer terminal, which may be any one of a group of computer terminals. Optionally, in this embodiment, the computer terminal may also be replaced by a mobile terminal or other terminal device.

[0178] Optionally, in this embodiment, the computer terminal may be located in at least one of a plurality of network devices in a computer network.

[0179] In this embodiment, the computer terminal described above can execute the program code for the following steps in the file management method: receiving a file management command for the computer cluster through a browser; responding to the file management command, performing the file management operation indicated by the file management command on the computer cluster; and calling the file operation interface in the browser to display the execution process of the file management operation.

[0180] Figure 14 This is a structural block diagram of a computer terminal according to an embodiment of the present invention, such as... Figure 14 As shown, the computer terminal 1400 may include one or more (only one is shown in the figure) processors 1402 and memory 1404.

[0181] The memory can be used to store software programs and modules, such as the program instructions / modules corresponding to the file management method and apparatus in this embodiment of the invention. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, thereby realizing the aforementioned file management method. The memory may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include memory remotely located relative to the processor, and these remote memories can be connected to the terminal 1400 via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0182] The processor can access information and applications stored in memory via a transmission device to perform the following steps: receiving file management commands for the computer cluster via a browser; executing file management operations indicated by the file management commands on the computer cluster in response to the file management commands; and displaying the execution process of the file management operations by calling the file operation interface in the browser.

[0183] Optionally, the processor may also execute program code with the following steps: caching the command character stream of file management commands through a string buffer, wherein the file management command is a command string containing multiple characters, and the command character stream represents the command string input character by character; monitoring the command character stream in the string buffer in real time to determine the command execution state, wherein the command execution state includes at least: read command name state, read command parameter state, and command end state, the read command name state is the initial state, and when the characters in the command character stream meet a first condition, the command execution state transitions from the read command name state to the read command parameter state, and when the characters in the command character stream meet a second condition, the command execution state transitions from the read command parameter state to the command end state; and when the command execution state is the command end state, performing file management operations on the computer cluster.

[0184] Optionally, the processor may also execute program code that performs the following steps: in the read command name state, monitor whether the last character in the command character stream is a separator character; if the last character in the command character stream is a separator character, determine that the characters in the command character stream satisfy a first condition; if the characters in the command character stream satisfy the first condition, read the command name from the command character stream belonging to the read command name state, and transfer the read command name state to the read command parameter state, wherein the command name is used to indicate the operation type of the file management operation.

[0185] Optionally, the processor may also execute program code that performs the following steps: in the case of reading command parameters, monitor whether the last character in the command character stream is a separator character; if the last character in the command character stream is a separator character, determine that the characters in the command character stream satisfy the second condition; if the characters in the command character stream satisfy the second condition, read the command parameters in the file management command from the command character stream belonging to the read command parameters state, and transfer the read command parameters state to the command end state, wherein the command parameters are used to indicate the operation parameters of the file management operation.

[0186] Optionally, the processor may also execute program code that performs the following steps: when reading command parameter status, monitor whether the last character in the command character stream is a front quotation mark; if the last character in the command character stream is a front quotation mark, monitor whether the last character in the command character stream is a back quotation mark; if the last character in the command character stream is a back quotation mark, continue monitoring the command character stream until the last character in the command character stream is a separator character.

[0187] Optionally, the processor may also execute program code with the following steps: In the case of reading command parameters, monitor whether the last character in the command character stream is a preset character, wherein the preset character includes at least: quotation mark characters and escape characters, and the quotation mark characters include: opening quotation mark characters and closing quotation mark characters; if the last character in the command character stream is not a preset character, invoke the first reading strategy and continue monitoring the command character stream until the last character in the command character stream is a target character, wherein the target character is a separator character or a preset character; the first reading strategy reads command parameters from the first character stream, where the first character stream consists of command characters preceding the target character and belonging to the command parameter reading state. If the last character in the command character stream is a front quotation mark, the second read strategy is invoked, and the command character stream is monitored until the last character is a back quotation mark. The second read strategy reads command parameters from the second character stream, which is the command character stream between the front and back quotation marks. If the last character in the command character stream is an escape character, the third read strategy is invoked, and the command character stream is monitored until the last character is a separator character. The third read strategy reads command parameters from the third character stream, which is the command character stream between the escape character and the separator character.

[0188] Optionally, the processor may also execute program code that performs the following steps: parses the file management command to obtain the verification information carried by the file management command and the file management operation indicated by the file management command, wherein the verification information includes at least one of the following: identity information and format information; detects whether each piece of verification information passes verification; and performs file management operation on the computer cluster if all verification information passes verification.

[0189] Optionally, the processor may also execute program code that performs the following steps: when the file management command is a file viewing command, in response to the file viewing command, the file management interface of the computer cluster is invoked, wherein the file operation interface includes at least: a file management interface; and the file management directory of the computer cluster obtained through file management operations is displayed through the file management interface.

[0190] Optionally, the processor may also execute program code that performs the following steps: when the file management command is a file download command, in response to the file download command, the file download interface of the computer cluster is invoked, wherein the file operation interface includes at least: a file download interface; and the download progress of the first file downloaded from the computer cluster through file management operations is displayed in the file download interface.

[0191] Optionally, the processor may also execute program code that performs the following steps: when the file management command is a file editing command, in response to the file editing command, invokes the graphical text editor of the computer cluster; in the graphical text editor, displays the second file read from the computer cluster through the file management operation.

[0192] This invention provides a file management solution. In this embodiment, a file management command for a computer cluster is received via a browser; in response to the command, the file management operation instructed by the command is executed on the computer cluster; and the file operation interface in the browser is invoked to display the execution process of the file management operation. Thus, file management of the computer cluster can be completed through the browser without additional operations, thereby improving file management efficiency and solving the problem of low file management efficiency.

[0193] Those skilled in the art will understand that Figure 14 The structure shown is for illustrative purposes only. The computer terminal can also be a smartphone (such as an Android phone, an iOS phone, etc.), a tablet computer, a mobile internet device (MID), a PAD, and other terminal devices. Figure 14 This does not limit the structure of the aforementioned electronic device. For example, the computer terminal 1400 may also include components that are more advanced than those described above. Figure 14 The more or fewer components shown (such as network interfaces, display devices, etc.), or having the same Figure 14 The different configurations shown.

[0194] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a computer program instructing the hardware related to the terminal device. The computer program can be stored in a non-volatile medium, which may include: flash drive, read-only memory (ROM), random access memory (RAM), magnetic disk or optical disk, etc.

[0195] Embodiments of the present invention also provide a non-volatile storage medium. Optionally, in this embodiment, the aforementioned non-volatile storage medium can be used to store the program code executed by the file management method provided in the above embodiments.

[0196] Optionally, in this embodiment, the non-volatile storage medium may be located in any computer terminal in a group of computer terminals in a computer network, or in any mobile terminal in a group of mobile terminals.

[0197] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for performing the following steps: receiving a file management command for the computer cluster via a browser; in response to the file management command, performing the file management operation indicated by the file management command on the computer cluster; and calling the file operation interface in the browser to display the execution process of the file management operation.

[0198] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for performing the following steps: caching a command character stream of file management commands through a string buffer, wherein the file management command is a command string including multiple characters, and the command character stream represents the command string input character by character; monitoring the command character stream in the string buffer in real time to determine the command execution state, wherein the command execution state includes at least: read command name state, read command parameter state, and command end state, the read command name state is the initial state, and when the characters in the command character stream satisfy a first condition, the command execution state transitions from the read command name state to the read command parameter state, and when the characters in the command character stream satisfy a second condition, the command execution state transitions from the read command parameter state to the command end state; when the command execution state is the command end state, performing file management operations on the computer cluster.

[0199] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for performing the following steps: in the read command name state, monitoring whether the last character in the command character stream is a separator character; if the last character in the command character stream is a separator character, determining that the characters in the command character stream satisfy a first condition; if the characters in the command character stream satisfy the first condition, reading the command name in the file management command from the command character stream belonging to the read command name state, and transferring the read command name state to the read command parameter state, wherein the command name is used to indicate the operation type of the file management operation.

[0200] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for performing the following steps: in the case of reading command parameters, monitoring whether the last character in the command character stream is a separator character; if the last character in the command character stream is a separator character, determining that the characters in the command character stream satisfy a second condition; if the characters in the command character stream satisfy the second condition, reading the command parameters in the file management command from the command character stream belonging to the read command parameters state, and transferring the read command parameters state to the command end state, wherein the command parameters are used to indicate the operation parameters of the file management operation.

[0201] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for performing the following steps: when reading command parameter status, monitoring whether the last character in the command character stream is a front quotation mark; if the last character in the command character stream is a front quotation mark, monitoring whether the last character in the command character stream is a back quotation mark; if the last character in the command character stream is a back quotation mark, continuing to monitor the command character stream until the last character in the command character stream is a separator character.

[0202] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for performing the following steps: In the case of reading command parameters, monitoring whether the last character in the command character stream is a preset character, wherein the preset character includes at least: quotation mark characters and escape characters, and the quotation mark characters include: opening quotation mark characters and closing quotation mark characters; if the last character in the command character stream is not a preset character, invoking a first reading strategy and continuing to monitor the command character stream until the last character in the command character stream is a target character, wherein the target character is a separator character or a preset character, and the first reading strategy reads command parameters from a first character stream, wherein the first character stream is preceding the target character and belongs to the read command stream. The command character stream is in the parameter state. If the last character in the command character stream is a front quotation mark, the second read strategy is invoked, and the command character stream is monitored until the last character is a back quotation mark. The second read strategy reads the command parameters from the second character stream, which is the command character stream between the front quotation mark and the back quotation mark. If the last character in the command character stream is an escape character, the third read strategy is invoked, and the command character stream is monitored until the last character is a separator character. The third read strategy reads the command parameters from the third character stream, which is the command character stream between the escape character and the separator character.

[0203] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for performing the following steps: parsing a file management command to obtain the verification information carried by the file management command and the file management operation indicated by the file management command, wherein the verification information includes at least one of the following: identity information and format information; detecting whether each verification information passes verification; and performing a file management operation on the computer cluster if all verification information passes verification.

[0204] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for performing the following steps: when the file management command is a file viewing command, in response to the file viewing command, the file management interface of the computer cluster is invoked, wherein the file operation interface includes at least: a file management interface; and the file management directory of the computer cluster obtained through the file management operation is displayed through the file management interface.

[0205] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for performing the following steps: when the file management command is a file download command, in response to the file download command, the file download interface of the computer cluster is invoked, wherein the file operation interface includes at least: a file download interface; in the file download interface, the download progress of downloading the first file from the computer cluster through file management operations is displayed.

[0206] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for performing the following steps: when the file management command is a file editing command, in response to the file editing command, invoking the graphical text editor of the computer cluster; in the graphical text editor, displaying the second file read from the computer cluster through the file management operation.

[0207] Embodiments of the present invention also provide a computer program product, including a computer program. Optionally, in this embodiment, when the computer program is executed by a processor, it implements the steps of the file management method provided in the above embodiments.

[0208] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0209] In the above embodiments of the present invention, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0210] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For instance, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.

[0211] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0212] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0213] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a non-volatile storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a non-volatile storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned non-volatile storage medium includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.

[0214] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. A file management method, characterized in that, include: The browser receives file management commands for the computer cluster. The browser has a pre-installed trigger button for the file management command. When the trigger button is clicked, it automatically inputs the command line in character form of the corresponding file management command. In response to the file management command, the file management operation indicated by the file management command is executed on the computer cluster; The file operation interface in the browser is invoked to display the execution process of the file management operation; Specifically, in response to the file management command, executing the file management operation indicated by the file management command on the computer cluster includes: The command character stream of the file management command is cached by a string buffer, wherein the file management command is a command string consisting of multiple characters, and the command character stream represents the command string input character by character; The command character stream in the string buffer is monitored in real time to determine the command execution state. The command execution state includes at least three states: read command name state, read command parameter state, and command end state. The read command name state is the initial state. When the characters in the command character stream meet a first condition, the command execution state transitions from the read command name state to the read command parameter state. When the characters in the command character stream meet a second condition, the command execution state transitions from the read command parameter state to the command end state. When the command execution status is the command end status, file management operations are performed on the computer cluster.

2. The method according to claim 1, characterized in that, Real-time monitoring of the command character stream in the string buffer to determine the command execution status includes: In the state of reading command name, monitor whether the last character in the command character stream is a separator character; If the last character in the command character stream is the separator character, it is determined that the characters in the command character stream satisfy the first condition; If the characters in the command character stream satisfy the first condition, the command name in the file management command is read from the command character stream belonging to the read command name state, and the read command name state is transferred to the read command parameter state, wherein the command name is used to indicate the operation type of the file management operation.

3. The method according to claim 1, characterized in that, Real-time monitoring of the command character stream in the string buffer to determine the command execution status includes: In the case of the read command parameter state, monitor whether the last character in the command character stream is a separator character; If the last character in the command character stream is the delimiter character, it is determined that the characters in the command character stream satisfy the second condition; If the characters in the command character stream satisfy the second condition, the command parameters in the file management command are read from the command character stream belonging to the read command parameter state, and the read command parameter state is transferred to the command end state, wherein the command parameters are used to indicate the operation parameters of the file management operation.

4. The method according to claim 3, characterized in that, In the case of the read command parameter state, monitoring whether the last character in the command character stream is a separator character includes: In the state of reading command parameters, monitor whether the last character in the command character stream is a front quotation mark character; If the last character in the command character stream is the opening quotation mark, monitor whether the last character in the command character stream is the closing quotation mark. If the last character in the command character stream is the back quotation mark character, continue monitoring the command character stream until the last character in the command character stream is a separator character.

5. The method according to claim 3, characterized in that, The method further includes: In the state of reading command parameters, it is monitored whether the last character in the command character stream is a preset character, wherein the preset character includes at least: quotation mark characters and escape characters, and the quotation mark characters include: opening quotation mark characters and closing quotation mark characters; If the last character in the command character stream is not a preset character, the first reading strategy is invoked, and the command character stream is monitored until the last character in the command character stream is the target character, wherein the target character is the separator character or the preset character, the first reading strategy reads the command parameters from the first character stream, and the first character stream is the command character stream that is before the target character and belongs to the state of reading command parameters; If the last character in the command character stream is the opening quotation mark, the second reading strategy is invoked, and the command character stream is monitored until the last character in the command character stream is the closing quotation mark. The second reading strategy reads the command parameters from a second character stream, which is the command character stream between the opening quotation mark and the closing quotation mark. If the last character in the command character stream is the escape character, a third reading strategy is invoked, and the command character stream is monitored until the last character in the command character stream is the separator character. The third reading strategy reads the command parameters from a third character stream, which is the command character stream between the escape character and the separator character.

6. The method according to claim 1, characterized in that, In response to the file management command, performing file management operations on the computer cluster includes: Parse the file management command to obtain the verification information carried by the file management command and the file management operation indicated by the file management command, wherein the verification information includes at least one of the following: identity information and format information; Check whether each of the verification messages passes verification; If all the verification information passes verification, the file management operation is performed on the computer cluster.

7. The method according to claim 1, characterized in that, The process of displaying the file management operation by invoking the file operation interface in the browser includes: When the file management command is a file viewing command, in response to the file viewing command, the file management interface of the computer cluster is invoked, wherein the file operation interface includes at least the file management interface; The file management interface displays the file management directory of the computer cluster obtained through the file management operation.

8. The method according to claim 1, characterized in that, The process of displaying the file management operation by invoking the file operation interface in the browser includes: When the file management command is a file download command, in response to the file download command, the file download interface of the computer cluster is invoked, wherein the file operation interface includes at least the file download interface; The file download interface displays the download progress of the first file downloaded from the computer cluster through the file management operation.

9. The method according to claim 1, characterized in that, The process of displaying the file management operation by invoking the file operation interface in the browser includes: When the file management command is a file editing command, in response to the file editing command, the graphical text editor of the computer cluster is invoked; In the graphical text editor, a second file read from the computer cluster via the file management operation is displayed.

10. A document management device, characterized in that, include: The receiving module is used to receive file management commands for the computer cluster through a browser. The browser has a pre-installed trigger button corresponding to the file management command. After the trigger button is clicked, the trigger button automatically inputs the command line in character form of the corresponding file management command. The response module is used to execute the file management operation indicated by the file management command on the computer cluster in response to the file management command; The display module is used to call the file operation interface in the browser and display the execution process of the file management operation; The response module includes: A caching unit is used to cache the command character stream of the file management command through a string buffer, wherein the file management command is a command string including multiple characters, and the command character stream represents the command string input character by character; The monitoring unit is used to monitor the command character stream in the string buffer in real time and determine the command execution state. The command execution state includes at least: read command name state, read command parameter state, and command end state. The read command name state is the initial state. When the characters in the command character stream meet a first condition, the command execution state transitions from the read command name state to the read command parameter state. When the characters in the command character stream meet a second condition, the command execution state transitions from the read command parameter state to the command end state. An execution unit is configured to perform file management operations on the computer cluster when the command execution state is the command end state.

11. A non-volatile storage medium, characterized in that, The non-volatile storage medium stores a computer program, wherein the device containing the non-volatile storage medium executes the file management method of any one of claims 1 to 9 by running the computer program.

12. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to execute the file management method of any one of claims 1 to 9 through the computer program.

13. A computer program product comprising computer instructions, characterized in that, When the computer instructions are executed by the processor, they implement the steps of the file management method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Mobile terminal file management method and system

    CN106250455A