Method and device for quickly linking files in numerical control system

By setting up the link start file in the CNC system and using recursive nested parsing method, the problem of redundancy in the script file loading in the CNC system is solved, the file linking and flexible configuration are realized, and the system's resource utilization efficiency and scalability are improved.

CN119917457APending Publication Date: 2025-05-02JINAN BODOR LASER CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411863281.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-17
Publication Date
2025-05-02

AI Technical Summary

Technical Problem

Existing CNC systems can easily lead to redundant loading when loading script files, resulting in waste of resources, and it is difficult to achieve flexible and configurable file management.

Method used

By setting up the link start files in the root directory and subdirectories at each level, the link start file content is parsed in recursive nesting. Starting from the top-level root directory, the directory script files are loaded step by step to achieve quick links to the files.

Benefits of technology

This method can quickly locate and load the required files, realize flexible configuration of file links, reduce resource waste, simplify file management complexity, and support system scalability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119917457A_ABST
    Figure CN119917457A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of numerical control system file loading, and particularly relates to a method and device for quickly linking files in a numerical control system.The method comprises the steps that a starting root directory of quick connection is set, and a link starting file under the root directory is found through the link starting root directory; secondly, quickly analyzing the content of the link starting file under the root directory, if the analyzed current line content of the link starting file is not a subdirectory, executing a loading operation on the currently analyzed script file, and if the analyzed current line content of the link starting file is a subdirectory, skipping to the subdirectory, executing a loading operation on the currently analyzed script file, and if the analyzed current line content of the link starting file is a subdirectory, executing a loading operation on the currently analyzed script file; and after the content of the link starting file in the subdirectory is analyzed, skipping to the link starting file in the previous-level directory of the subdirectory to continue to analyze, and so on, and under the nesting action of the link starting file in each level directory, executing the analysis of the link starting file in the subdirectory, and after the content of the link starting file in the subdirectory is analyzed, skipping to the link starting file in the previous-level directory of the subdirectory to continue to analyze. And then the link initial file under each hierarchical directory is analyzed, so that the function of linking the file layer by layer from the top-layer root directory is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of numerical control system file loading, and in particular relates to a method and a device for quickly linking files in a numerical control system. Background Art

[0002] The development direction of CNC systems is often platform-level CNC systems, which can support a variety of machine tools and workflow management. Although system suppliers generally provide relatively complete functions for system operators to use, the needs and application scenarios of on-site customers are not static, and later maintenance often faces the adjustment and optimization of the logical functions of CNC equipment.

[0003] Therefore, the platform-level CNC system also needs to have flexible, changeable and configurable secondary development functions, and the secondary development function is generally implemented through scripts and other methods. First, the logical function is written in the corresponding script file, and then when the CNC system is started, the script file is loaded into the CNC system. When the CNC system executes a specific function, it can drive the external device to generate an external response of the corresponding logical function by calling the corresponding script program. In addition, the loaded script file should be lightweight to reduce the waste of resources caused by redundant loading of unnecessary script files. To achieve this goal, the loading of script files often needs to be controlled through certain loading strategies to achieve flexible configurability and lightweight management of script files. Summary of the invention

[0004] In order to reduce the waste of resources caused by redundant loading of unnecessary script files, the present invention provides a method and device for quickly linking files in a numerical control system to achieve flexible configurability and lightweight management of script files.

[0005] The technical solution of the present invention provides a method for quickly linking files in a numerical control system, comprising: The root directory and each level of subdirectories are configured to include a link start file, wherein the link start file includes configuration information for executing quick links in each level of directories; The link start file content under each level of directory is parsed in a recursive nested manner, starting from the top-level root directory, and the directory script files are loaded layer by layer to achieve fast file linking.

[0006] As a further limitation of the technical solution of the present invention, the steps of parsing the link start file content under each level of directory in a recursive nested manner, starting from the top-level root directory, and loading the directory script file level by level to realize the quick link of the file include: Step 1: Initialize the quick link starting root directory; Step 2: Read the content of the link start file setting line in the root directory and parse it. If it is determined that the root directory contains subdirectories according to the parsing result, execute step 3; otherwise, execute step 7; Step 3: Initialize the quick link starting subdirectory; Step 4: Read the content of the link start file setting line in the subdirectory and parse it; if it is determined that the subdirectory contains a subdirectory according to the parsing result, execute step 3, otherwise execute step 5; Step 5: Load the subdirectory script file; Step 6: Determine whether the parsing of the link start file content in the current subdirectory has been completed; if not, execute step 4; if so, and when the current subdirectory is a first-level subdirectory, execute step 2; Step 7: Load the root directory script file; Step 8: Determine whether the parsing of the link start file content in the current root directory has been completed; if so, end; if not, execute step 2.

[0007] As a further limitation of the technical solution of the present invention, when the link start file is used to link a script file under the directory level of the current link start file, the name of the script file is directly added to the link start file; when linking a subdirectory under the directory level of the current link start file, the subdirectory keyword subdirectory name is added to the link start file.

[0008] As a further limitation of the technical solution of the present invention, step 2.1: reading and parsing the content of a setting line in the link start file in the root directory; Step 2.2: If the content of the current line of the root directory link start file that is parsed starts with a non-subdirectory keyword, execute step 7; Step 2.3: If the content of the current line of the parsed root directory link start file starts with a subdirectory keyword, jump to the subdirectory and execute the link start file under the subdirectory, that is, execute step 3.

[0009] As a further limitation of the technical solution of the present invention, in step 3, the files contained in the subdirectory are the same as the root directory, specifically including the link start file of the subdirectory and the script file under the subdirectory level, or including the link start file of the subdirectory, the script file under the subdirectory level and the subdirectory under the subdirectory level; If the current subdirectory is a subdirectory under the root directory, set the subdirectory to the first-level subdirectory. If the current subdirectory is a subdirectory under a non-root directory, set the subdirectory to a non-first-level subdirectory.

[0010] As a further limitation of the technical solution of the present invention, step 4 specifically includes: Step 4.1: Read the content of the setting line in the link start file in the subdirectory and parse it; Step 4.2: If the content of the current line of the parsed subdirectory link start file starts with a non-subdirectory keyword, execute step 5; Step 4.3: If the content of the current line of the parsed sub-directory link start file starts with the sub-directory keyword, jump to the sub-directory and execute the link start file under the sub-directory, that is, execute step 3.

[0011] As a further limitation of the technical solution of the present invention, step 5 specifically includes: Process the content of the current line of the link start file parsed in step 4.1 to obtain the name of the script file to be loaded, and load the subdirectory script file into the CNC system based on the obtained name of the script file.

[0012] As a further limitation of the technical solution of the present invention, step 6 specifically includes: Step 6.1: Determine whether the parsing of the link start file content in the current subdirectory has been completed; If not, proceed to step 4; if yes, proceed to step 6.2; Step 6.2: Determine whether the current subdirectory is a first-level subdirectory; If yes, jump to the link start file in the root directory to continue parsing, that is, execute step 2; If not, jump to the link start file in the parent directory of the current subdirectory to continue parsing, that is, execute step 4.

[0013] As a further limitation of the technical solution of the present invention, step 7 specifically includes: Process the content of the current line of the link start file parsed in step 2.1 to obtain the name of the script file to be loaded, and load the root directory script file to the CNC system based on the obtained name of the script file.

[0014] In a second aspect, the technical solution of the present invention further provides a device for quickly linking files in a numerical control system, comprising a presetting module and a quick link processing module; A pre-setting module is used to set a root directory and each level of sub-directories to contain a link start file, wherein the link start file contains configuration information that needs to execute quick links under each level of directory; The quick link processing module is used to parse the link start file content under each level of directory in a recursive nested manner, starting from the top-level root directory, and loading the directory script file level by level to achieve quick linking of files.

[0015] As a further limitation of the technical solution of the present invention, the specific processing logic of the quick link processing module includes: Step 1: Initialize the quick link starting root directory; Step 2: Read the content of the link start file setting line in the root directory and parse it. If it is determined that the root directory contains subdirectories according to the parsing result, execute step 3; otherwise, execute step 7; Step 3: Initialize the quick link starting subdirectory; Step 4: Read the content of the link start file setting line in the subdirectory and parse it; if it is determined that the subdirectory contains a subdirectory according to the parsing result, execute step 3, otherwise execute step 5; Step 5: Load the subdirectory script file; Step 6: Determine whether the parsing of the link start file content in the current subdirectory has been completed; if not, execute step 4; if so, and when the current subdirectory is a first-level subdirectory, execute step 2; Step 7: Load the root directory script file; Step 8: Determine whether the parsing of the link start file content in the current root directory has been completed; if so, end; if not, execute step 2.

[0016] When the quick link processing module link start file is used to link the script file under the directory level of the current link start file, the name of the script file is directly added to the link start file; when linking the subdirectory under the directory level of the current link start file, the subdirectory keyword subdirectory name is added to the link start file.

[0017] Step 2 in the processing logic of the quick link processing module specifically includes: Step 2.1: Read the content of the setting line in the link start file in the root directory and parse it; Step 2.2: If the content of the current line of the root directory link start file that is parsed starts with a non-subdirectory keyword, execute step 7; Step 2.3: If the content of the current line of the parsed root directory link start file starts with a subdirectory keyword, jump to the subdirectory and execute the link start file under the subdirectory, that is, execute step 3.

[0018] In step 3 of the processing logic of the quick link processing module, the files contained in the subdirectory are the same as those in the root directory, specifically including the link start file of the subdirectory and the script file under the subdirectory level, or including the link start file of the subdirectory, the script file under the subdirectory level and the subdirectory under the subdirectory level; If the current subdirectory is a subdirectory under the root directory, set the subdirectory to the first-level subdirectory. If the current subdirectory is a subdirectory under a non-root directory, set the subdirectory to a non-first-level subdirectory.

[0019] Step 4 in the processing logic of the quick link processing module specifically includes: Step 4.1: Read the content of the setting line in the link start file in the subdirectory and parse it; Step 4.2: If the content of the current line of the parsed subdirectory link start file starts with a non-subdirectory keyword, execute step 5; Step 4.3: If the content of the current line of the parsed sub-directory link start file starts with the sub-directory keyword, jump to the sub-directory and execute the link start file under the sub-directory, that is, execute step 3.

[0020] Step 5 in the processing logic of the quick link processing module specifically includes: Process the content of the current line of the link start file parsed in step 4.1 to obtain the name of the script file to be loaded, and load the subdirectory script file into the CNC system based on the obtained name of the script file.

[0021] Step 6 in the processing logic of the quick link processing module specifically includes: Step 6.1: Determine whether the parsing of the link start file content in the current subdirectory has been completed; If not, proceed to step 4; if yes, proceed to step 6.2; Step 6.2: Determine whether the current subdirectory is a first-level subdirectory; If yes, jump to the link start file in the root directory to continue parsing, that is, execute step 2; If not, jump to the link start file in the parent directory of the current subdirectory to continue parsing, that is, execute step 4.

[0022] Step 7 in the processing logic of the quick link processing module specifically includes: Process the content of the current line of the link start file parsed in step 2.1 to obtain the name of the script file to be loaded, and load the root directory script file to the CNC system based on the obtained name of the script file.

[0023] The content of the link start file is quickly parsed to realize the fast link of the file. First, the starting root directory of the fast connection is set, and the link start file under the root directory is found through the link start root directory. Secondly, the content of the link start file under the root directory is quickly parsed. If the current line content of the parsed link start file is not a subdirectory, the loading operation is performed on the currently parsed script file. If the current line content of the parsed link start file is a subdirectory, it jumps to the subdirectory and performs the parsing of the link start file in the subdirectory. After the content parsing of the link start file in the subdirectory is completed, it jumps to the link start file in the upper directory of the subdirectory to continue parsing. By analogy, under the nesting effect of the link start files under each level of directory, the link start files under each level of directory are parsed, that is, the function of starting from the top root directory and then linking files layer by layer is realized. Then the function of loading script files in a flexible, configurable and lightweight manner is realized.

[0024] It can be seen from the above technical solutions that the present invention has the following advantages: by setting and parsing the link start file layer by layer, the method can quickly locate and load the required files, and allows the definition of link start files in different levels of directories, thereby realizing flexible configuration of file links. This flexibility enables the system to easily adapt to different file organizational structures and meet diverse file access requirements. Through the parsing and loading of the link start file, users do not need to manually manage complex file paths, but only need to pay attention to the content of the link start file. This greatly simplifies the complexity of file management and reduces the user's learning cost. Since the method supports adding link start files in any level of directory, the system can easily expand the scope and depth of file links. This scalability enables the system to continue to evolve as user needs grow and maintain long-term competitiveness. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] In order to more clearly illustrate the technical solution of the present invention, the accompanying drawings required for use in the description will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.

[0026] Figure 1 A directory organization chart for quick link files.

[0027] Figure 2 Schematic diagram of the process for realizing quick link files. DETAILED DESCRIPTION

[0028] In order to make the purpose, features and advantages of the present invention more obvious and easy to understand, the technical scheme of the present invention will be clearly and completely described below in conjunction with the drawings in this specific embodiment. Obviously, the embodiments described below are only part of the embodiments of the present invention, not all of them. Based on the embodiments in this patent, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this patent.

[0029] An embodiment of the present invention provides a method for quickly linking files in a numerical control system, comprising: setting a root directory and each level of subdirectories to contain a link start file, wherein the link start file contains configuration information that needs to be executed for quick linking under each level of directory; parsing the content of the link start file under each level of directory in a recursive nested manner, starting from the top-level root directory, and loading the directory script file level by level to realize quick linking of files.

[0030] The directory organization structure of the quick link file of the present invention is as follows Figure 1 As shown, the process of implementing quick link files is as follows Figure 2As shown, the root directory and each level of subdirectories contain a link start file LinkFile, which contains the configuration information that needs to be executed for quick linking in each level of directory. The quick link parser is used to quickly parse the content of the link start file LinkFile to realize the quick linking of files. Among them, the content of the link start file LinkFile has two forms of expression. The first form is to link the file in the directory level where the current LinkFile file is located. This method directly adds the file name in the current level directory inside the current LinkFile file. The second form is to link the subdirectory in the directory level where the current LinkFile file is located. This method starts with the keyword INCLUDE, followed by the name of the subdirectory. Through these two forms of expression, you can link to the file in the current directory and the subdirectory of the current directory. Then, through recursive nesting, you can achieve the purpose of linking files layer by layer. In addition, in the link start file LinkFile, you can also add corresponding configuration content according to different application scenarios to realize the flexible configuration of link files and link subdirectories. When the fast link parser parses the content of the link start file LinkFile in the current directory level, if it encounters a statement starting with a non-keyword INCLUDE, it executes the loading of the script file corresponding to the current parsing line. If it encounters a statement starting with the keyword INCLUDE, it switches to the subdirectory specified after INCLUDE and parses the content of the link start file LinkFile in the subdirectory. When the link start file LinkFile in the subdirectory is parsed, it jumps to the link start file LinkFile in the upper directory to continue execution. By analogy, the fast link parser parses the content of the link start file LinkFile in each level of directory, and the function of linking files starting from the top root directory and then layer by layer can be realized. The specific scheme of the present invention is as follows: Step 1: Initialize the quick link starting root directory; The quick link start root directory is the top-level directory for storing script files that need to execute quick links. In addition to the link start file LinkFile, it can also contain script files at the current directory level and subdirectories at the next level. This mainly provides the quick link parser with the file path of the top-level link start, that is, the path of the link start file LinkFile in the top-level directory. That is, when the link start file is used to link the script file under the directory level of the current link start file, the name of the script file is directly added to the link start file; when linking the subdirectory under the directory level of the current link start file, the subdirectory keyword subdirectory name is added to the link start file.

[0031] Step 2: Read the content of the link start file setting line in the root directory and parse it. If it is determined that the root directory contains subdirectories according to the parsing result, execute step 3; otherwise, execute step 7; It should be noted that this application uses a fast connection parser to parse the link start file. The specific steps are as follows: Step 2.1: The fast link parser reads a line of content in the link start file LinkFile in the root directory and parses it. The fast link parser of the present invention adopts lexical (Flex) grammar (Bison) analysis to parse the content of the link start file LinkFile. The lexical grammar parsing method has the outstanding advantages of fast execution speed and easy expansion. Two grammar rules are defined inside the fast link parser, which are respectively used to link files and subdirectories in the same directory of LinkFile. The first grammar rule is used to link subdirectories. Its format starts with the keyword INCLUDE, followed by the name of the subdirectory. The second grammar rule is used to link files. Its format starts with the non-keyword INCLUDE and only contains the name of the file to be linked. In addition, the name of the subdirectory and the name of the file are limited to alphanumeric and underscore, but the first letter must be a letter or an underscore; Step 2.2: If the current line of the root directory link start file LinkFile parsed by the quick link parser starts with a non-keyword INCLUDE and contains only the file name, execute step 7; Step 2.3: If the current line of the root directory link start file LinkFile parsed by the quick link parser starts with the keyword INCLUDE, followed by a line of a subdirectory name, jump to the subdirectory and execute the link start file LinkFile under the subdirectory, that is, execute step 3; Step 3: Initialize the quick link starting subdirectory; In this step, the files contained in the subdirectory are the same as those in the root directory, specifically including the link start file of the subdirectory and the script file under the subdirectory level, or including the link start file of the subdirectory, the script file under the subdirectory level and the subdirectory under the subdirectory level; If the current subdirectory is a subdirectory under the root directory, set the subdirectory to the first-level subdirectory. If the current subdirectory is a subdirectory under a non-root directory, set the subdirectory to a non-first-level subdirectory.

[0032] Step 4: Read the content of the link start file setting line in the subdirectory and parse it; if it is determined that the subdirectory contains a subdirectory according to the parsing result, execute step 3, otherwise execute step 5; Specifically, step 4.1: the fast link parser reads a line of content in the link start file LinkFile in the subdirectory and parses it; Step 4.2: If the content of the current line of the subdirectory link start file LinkFile parsed by the quick link parser starts with a non-keyword INCLUDE and contains only the file name, execute step 5; Step 4.3: If the current line of the subdirectory link start file LinkFile parsed by the quick link parser starts with the keyword INCLUDE, followed by a line of the subdirectory name, jump to the subdirectory and execute the link start file LinkFile under the subdirectory, that is, execute step 3; Step 5: Load the subdirectory script file; Process the content of the current line of the link start file parsed in step 4.1 to obtain the name of the script file to be loaded, and load the subdirectory script file into the CNC system based on the obtained name of the script file.

[0033] Step 6: Determine whether the parsing of the link start file content in the current subdirectory has been completed; if not, execute step 4; if so, and when the current subdirectory is a first-level subdirectory, execute step 2; This step specifically includes: Step 6.1: Determine whether the quick link parser has completed parsing the content of the link start file LinkFile in the current subdirectory; Step 6.2: If the parsing of the content of the link start file LinkFile in the current subdirectory is not completed, execute step 4; Step 6.3: If the parsing of the LinkFile content in the current subdirectory has been completed, execute step 6.4; Step 6.4: Determine whether the current subdirectory is a first-level subdirectory; Step 6.5: If the current subdirectory is a first-level subdirectory, it means that the parsing of the link start file LinkFile in the current first-level subdirectory is completed, then jump to the link start file LinkFile in the root directory to continue parsing, that is, execute step 2; Step 6.6: If the current subdirectory is not the first-level subdirectory, it means that the parsing of the link start file LinkFile in the current subdirectory is completed, then jump to the link start file LinkFile in the parent directory of the current subdirectory to continue parsing, that is, execute step 4. Step 7: Load the root directory script file; In this step, the content of the current line of the link start file LinkFile parsed by the fast link parser in step 2.1 is processed. At this time, the content of the current line of the link start file LinkFile corresponds to the name of a script file to be loaded, which is loaded into the CNC system, and then step 8 is executed; Step 8: Determine whether the parsing of the link start file content in the current root directory has been completed; if so, end; if not, execute step 2.

[0034] The embodiment of the present invention also provides a device for quickly linking files in a numerical control system, comprising a presetting module and a quick link processing module; A pre-setting module is used to set a root directory and each level of sub-directories to contain a link start file, wherein the link start file contains configuration information that needs to execute quick links under each level of directory; The quick link processing module is used to parse the link start file content under each level of directory in a recursive nested manner, starting from the top-level root directory, and loading the directory script file level by level to achieve quick linking of files.

[0035] In some embodiments, the specific processing logic of the quick link processing module includes: Step 1: Initialize the quick link starting root directory; Step 2: Read the content of the link starting file setting line in the root directory and parse it. When it is determined that the root directory contains subdirectories based on the parsing results, execute step 3, otherwise, execute step 7; Step 3: Initialize the quick link starting subdirectory; Step 4: Read the content of the link starting file setting line in the subdirectory and parse it; When it is determined that the subdirectory contains subdirectories based on the parsing results, execute step 3, otherwise execute step 5; Step 5: Load the subdirectory script file; Step 6: Determine whether the parsing of the link starting file content in the current subdirectory has been completed; if not, execute step 4; if so, and the current subdirectory is the first-level subdirectory, execute step 2; Step 7: Load the root directory script file; Step 8: Determine whether the parsing of the link starting file content in the current root directory has been completed; if so, end, if not, execute step 2.

[0036] When the quick link processing module link start file is used to link the script file under the directory level of the current link start file, the name of the script file is directly added to the link start file; when linking the subdirectory under the directory level of the current link start file, the subdirectory keyword subdirectory name is added to the link start file.

[0037] Step 2 in the processing logic of the quick link processing module specifically includes: Step 2.1: Read the content of the set line in the link start file in the root directory and parse it; Step 2.2: If the content of the current line of the parsed root directory link start file starts with a non-subdirectory keyword, execute step 7; Step 2.3: If the content of the current line of the parsed root directory link start file starts with a subdirectory keyword, jump to the subdirectory and execute the link start file under the subdirectory, that is, execute step 3.

[0038] In step 3 of the processing logic of the quick link processing module, the files contained in the subdirectory are the same as those in the root directory, specifically including the link start file of the subdirectory and the script file under the subdirectory level, or including the link start file of the subdirectory, the script file under the subdirectory level and the subdirectory under the subdirectory level; If the current subdirectory is a subdirectory under the root directory, set the subdirectory to the first-level subdirectory. If the current subdirectory is a subdirectory under a non-root directory, set the subdirectory to a non-first-level subdirectory.

[0039] Step 4 in the processing logic of the quick link processing module specifically includes: Step 4.1: Read the content of the set line in the link start file in the sub-directory and parse it; Step 4.2: If the content of the current line of the parsed sub-directory link start file starts with a non-sub-directory keyword, execute step 5; Step 4.3: If the content of the current line of the parsed sub-directory link start file starts with a sub-directory keyword, jump to the sub-directory and execute the link start file under the sub-directory, that is, execute step 3.

[0040] Step 5 in the processing logic of the quick link processing module specifically includes: processing the content of the current line of the link start file parsed in step 4.1, obtaining the name of the script file to be loaded, and loading the sub-directory script file into the CNC system based on the obtained script file name.

[0041] Step 6 in the processing logic of the quick link processing module specifically includes: Step 6.1: Determine whether the parsing of the link start file content in the current subdirectory has been completed; if not, execute step 4; if so, execute step 6.2; Step 6.2: Determine whether the current subdirectory is a first-level subdirectory; if so, jump to the link start file in the root directory to continue parsing, that is, execute step 2; if not, jump to the link start file in the parent directory of the current subdirectory to continue parsing, that is, execute step 4.

[0042] Step 7 in the processing logic of the quick link processing module specifically includes: processing the content of the current line of the link start file parsed in step 2.1, obtaining the name of the script file to be loaded, and loading the root directory script file into the CNC system based on the obtained script file name.

[0043] Specifically, the quick link processing module includes a quick link parser, which is used to parse the content of the link start file LinkFile.

[0044] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for quickly linking files in a numerical control system, characterized in that: include: The root directory and each level of subdirectories are configured to include a link start file, wherein the link start file includes configuration information for executing quick links in each level of directories; The link start file content under each level of directory is parsed in a recursive nested manner, starting from the top-level root directory, and the directory script files are loaded layer by layer to achieve fast file linking.

2. The method for quickly linking files in a numerical control system according to claim 1, characterized in that: The steps of parsing the link start file content under each level of directory in a recursive nested manner, starting from the top-level root directory, and loading the directory script files layer by layer to realize the quick link of the file include: Step 1: Initialize the quick link starting root directory; Step 2: Read the content of the link start file setting line in the root directory and parse it. If it is determined that the root directory contains subdirectories according to the parsing result, execute step 3; otherwise, execute step 7; Step 3: Initialize the quick link starting subdirectory; Step 4: Read the content of the link start file setting line in the subdirectory and parse it; if it is determined that the subdirectory contains a subdirectory according to the parsing result, execute step 3, otherwise execute step 5; Step 5: Load the subdirectory script file; Step 6: Determine whether the parsing of the link start file content in the current subdirectory has been completed; if not, execute step 4; if so, and when the current subdirectory is a first-level subdirectory, execute step 2; Step 7: Load the root directory script file; Step 8: Determine whether the parsing of the link start file content in the current root directory has been completed; if so, end; if not, execute step 2.

3. The method for quickly linking files in a numerical control system according to claim 2, characterized in that: When the link start file is used to link a script file under the directory level of the current link start file, the name of the script file is directly added to the link start file; when linking a subdirectory under the directory level of the current link start file, the subdirectory keyword subdirectory name is added to the link start file.

4. The method for quickly linking files in a numerical control system according to claim 3, characterized in that: Step 2 specifically includes: Step 2.1: Read the content of the setting line in the link start file in the root directory and parse it; Step 2.2: If the content of the current line of the root directory link start file that is parsed starts with a non-subdirectory keyword, execute step 7; Step 2.3: If the content of the current line of the parsed root directory link start file starts with a subdirectory keyword, jump to the subdirectory and execute the link start file under the subdirectory, that is, execute step 3.

5. The method for quickly linking files in a numerical control system according to claim 3 or 4, characterized in that: In step 3, the files contained in the subdirectory are the same as those in the root directory, specifically including the link start file of the subdirectory and the script file under the subdirectory level, or including the link start file of the subdirectory, the script file under the subdirectory level and the subdirectory under the subdirectory level; If the current subdirectory is a subdirectory under the root directory, set the subdirectory to the first-level subdirectory. If the current subdirectory is a subdirectory under a non-root directory, set the subdirectory to a non-first-level subdirectory.

6. The method for quickly linking files in a numerical control system according to claim 5, characterized in that: Step 4 specifically includes: Step 4.1: Read the content of the setting line in the link start file in the subdirectory and parse it; Step 4.2: If the content of the current line of the parsed subdirectory link start file starts with a non-subdirectory keyword, execute step 5; Step 4.3: If the content of the current line of the parsed sub-directory link start file starts with the sub-directory keyword, jump to the sub-directory and execute the link start file under the sub-directory, that is, execute step 3.

7. The method for quickly linking files in a numerical control system according to claim 6, characterized in that: Step 5 specifically includes: Process the content of the current line of the link start file parsed in step 4.1 to obtain the name of the script file to be loaded, and load the subdirectory script file into the CNC system based on the obtained name of the script file.

8. The method for quickly linking files in a numerical control system according to claim 7, characterized in that: Step 6 specifically includes: Step 6.1: Determine whether the parsing of the link start file content in the current subdirectory has been completed; If not, proceed to step 4; if yes, proceed to step 6.2; Step 6.2: Determine whether the current subdirectory is a first-level subdirectory; If yes, jump to the link start file in the root directory to continue parsing, that is, execute step 2; If not, jump to the link start file in the parent directory of the current subdirectory to continue parsing, that is, execute step 4.

9. The method for quickly linking files in a numerical control system according to any one of claims 2 to 4, characterized in that: Step 7 specifically includes: Process the content of the current line of the link start file parsed in step 2.1 to obtain the name of the script file to be loaded, and load the root directory script file to the CNC system based on the obtained script file name.

10. A device for quickly linking files in a numerical control system, characterized in that: Including a preset module and a quick link processing module; A pre-setting module is used to set a root directory and each level of sub-directories to contain a link start file, wherein the link start file contains configuration information that needs to execute quick links under each level of directory; The quick link processing module is used to parse the link start file content under each level of directory in a recursive nested manner, starting from the top-level root directory, and loading the directory script file level by level to achieve quick linking of files.