Batch file processing method, device, computer equipment and readable storage medium

By obtaining and processing parameters in the file directory, batch file processing is realized, which solves the cumbersome and error-prone problems of traditional file processing systems, and improves file management efficiency and correctness.

CN117555855BActive Publication Date: 2024-11-22BEIJING LISICHEN JINZHI TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202410038167.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-01-11
Publication Date
2024-11-22
Estimated Expiration
2044-01-11

AI Technical Summary

Technical Problem

Traditional file processing systems require manual operation of each file. It is complicated and error-prone to processing a large number of files, and lacks batch and automated processing methods.

Method used

By obtaining the source directory and the target directory, extracting preset file parameters, extracting the target file parameters according to the project index, responding to user operations, batches the rewrite results into the data table of the target directory, supporting copying, modifying and parallel processing of files.

Benefits of technology

It realizes efficient processing of batch files, improves file management efficiency, reduces errors, and promotes correct archiving and storage of files.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117555855B_ABST
    Figure CN117555855B_ABST
Patent Text Reader

Abstract

The present invention discloses a batch file processing method, device, computer equipment and readable storage medium, comprising: firstly obtaining a source directory and a target directory, and then extracting preset file parameters from the source directory. According to the project index, the target file parameters of the target file are extracted from these preset file parameters. When the user performs an improvement operation on the target file parameters, the rewriting results are stored in batches in a data table of the target directory. This method can effectively realize the processing of batch files and improve the efficiency of file management.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of file management, and in particular to a batch file processing method, device, computer equipment and readable storage medium. Background Art

[0002] In traditional file processing systems, each file often needs to be manually operated, such as copying, moving or modifying, which is extremely cumbersome and inefficient when processing a large number of files. Especially in scenarios where file parameters need to be modified, if manual methods are used, not only is the operation complicated, but it may also lead to errors. Therefore, it is of great significance to find a method that can process files in batches and automatically. Summary of the invention

[0003] The object of the present invention is to provide a batch file processing method, device, computer equipment and readable storage medium.

[0004] In a first aspect, an embodiment of the present invention provides a batch file processing method, the method comprising:

[0005] Get the source directory and the target directory;

[0006] Extracting the preset file parameters in the source directory;

[0007] Extracting target file parameters of the target file from the preset file parameters according to the project index;

[0008] In response to the user's operation of improving the target file parameters, the rewriting results are stored in batches in the data table of the target directory.

[0009] In a possible implementation, the method further includes:

[0010] In response to a user's copy operation on the target file, obtaining a structured field of the target file;

[0011] The structured fields are written into the data table of the target directory to obtain the target copy file.

[0012] In a possible implementation, the method further includes:

[0013] In response to a user executing a target copy file instruction, determining source data of the target file according to the structured field;

[0014] The source data is used as the execution result of the target copy file.

[0015] In a possible implementation, the structured field includes path data, and in response to the user executing the target copy file instruction, determining the source data of the target file according to the structured field includes:

[0016] In response to a user executing a target copy file instruction, source data of the target file is determined according to the path data.

[0017] In a possible implementation manner, writing the structured field into a data table of the target directory to obtain a target copy file includes:

[0018] The structured fields are written into the data table of the target directory based on the copy-on-write mechanism to obtain a target copy file.

[0019] In a possible implementation, the method further includes:

[0020] In response to a modification operation for modifying the target copied file, obtaining source data for determining the target file according to the structured field;

[0021] Determining, from the source data of the target file, the modified source data corresponding to the modification operation of the target copied file;

[0022] New file parameters are constructed based on the modified source data to obtain a modified target copy file.

[0023] In a possible implementation, the method further includes:

[0024] In response to a user's copy operation on the target file, obtaining a structured field of the target file;

[0025] Calling a preset number of threads to divide the structured field of the target file into a plurality of data blocks, the number of the data blocks being consistent with the preset number;

[0026] The structured fields are written in parallel into the data table of the target directory based on the preset number of threads to obtain a target copy file.

[0027] In a second aspect, an embodiment of the present invention provides a batch file processing device, the device comprising:

[0028] The acquisition module is used to obtain the source directory and the target directory;

[0029] The processing module is used to extract the preset file parameters in the source directory; extract the target file parameters of the target file from the preset file parameters according to the project index; and in response to the user's operation of improving the target file parameters, batch store the rewriting results into the data table of the target directory.

[0030] In a third aspect, an embodiment of the present invention provides a computer device, comprising a processor and a non-volatile memory storing computer instructions, wherein when the computer instructions are executed by the processor, the computer device executes the batch file processing method described in at least one possible implementation of the first aspect.

[0031] In a fourth aspect, an embodiment of the present invention provides a readable storage medium, wherein the readable storage medium includes a computer program, and when the computer program is executed, the computer device where the readable storage medium is located is controlled to execute the batch file processing method described in at least one possible implementation manner of the first aspect.

[0032] Compared with the prior art, the beneficial effects provided by the present invention include: using a batch file processing method, device, computer equipment and readable storage medium disclosed by the present invention, including: firstly obtaining a source directory and a target directory, and then extracting preset file parameters from the source directory. According to the project index, the target file parameters of the target file are extracted from these preset file parameters. When the user performs an improvement operation on the target file parameters, the rewriting results are stored in batches in the data table of the target directory. This method can effectively realize the processing of batch files and improve the efficiency of file management. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only illustrate certain embodiments of the present invention and should not be regarded as limiting the scope. For those of ordinary skill in the art, other related drawings can also be obtained based on these drawings without creative work.

[0034] Figure 1 A schematic block diagram of the steps of a batch file processing method provided by an embodiment of the present invention;

[0035] Figure 2 A schematic block diagram of the structure of a batch file processing device provided by an embodiment of the present invention;

[0036] Figure 3 A schematic block diagram of the computer device structure provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0037] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.

[0038] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0039] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.

[0040] In the description of the present invention, it should be understood that the terms "upper", "lower", "inside", "outside", "left", "right", etc. indicate directions or positional relationships based on the directions or positional relationships shown in the accompanying drawings, or are directions or positional relationships in which the product of the application is usually placed when in use, or are directions or positional relationships commonly understood by those skilled in the art. These directions or positional relationships are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific direction, be constructed and operated in a specific direction, and therefore should not be understood as a limitation on the present invention.

[0041] Furthermore, the terms “first”, “second”, etc. are merely used for distinguishing descriptions and should not be understood as indicating or implying relative importance.

[0042] In the description of the present invention, it is also necessary to explain that, unless otherwise clearly specified and limited, the terms such as "setting" and "connection" should be understood in a broad sense. For example, "connection" can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or an indirect connection through an intermediate medium, or it can be the internal communication of two elements. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0043] The specific implementation modes of the present invention are described in detail below in conjunction with the accompanying drawings.

[0044] In order to solve the technical problems in the aforementioned background technology, Figure 1 A flow chart of a batch file processing method provided in an embodiment of the present disclosure is provided. The batch file processing method is introduced in detail below.

[0045] Step S201, obtaining a source directory and a target directory;

[0046] Step S202, extracting preset file parameters in the source directory;

[0047] Step S203, extracting target file parameters of the target file from the preset file parameters according to the project index;

[0048] Step S204, in response to the user's operation of improving the target file parameters, the rewriting results are stored in batches into the data table of the target directory.

[0049] In the embodiment of the present invention, for example, it is assumed that there is a large manufacturing enterprise that generates a large number of engineering files and reports every day, which need to be classified, sorted and stored. Using the batch file processing method, the enterprise can easily process these files and ensure that they are properly archived and stored. The source directory can be a file server or shared folder within the enterprise, containing various engineering files and reports. The target directory can be a specific folder designated by the enterprise for storing processed files. The preset file parameters may include information such as file name, file size, creation date, etc. For engineering files and reports, the preset file parameters that can be extracted include project number, department, file type, etc. Suppose the enterprise wants to process all engineering files under a specific project. By setting the project index to the unique number of the project, the system will filter out the target file parameters belonging to the project from the preset file parameters. The user may want to classify the engineering files and reports or add other identification information for better organization and retrieval. The user can operate on the target file parameters, such as adding information such as department, version number, etc. to the file. The rewriting results will be stored in batches in a data table in the target directory, which can be used to track the processed files and provide convenient search and management. For example, when an enterprise needs to process all engineering files under a project, the system will obtain the preset file parameters related to the project in the source directory, such as project number and file type. Users can select files for a specific project through the project index, and then improve these files, such as adding the department and version number to the files. Finally, the rewriting results will be stored in the data table of the target directory, making it convenient for enterprises to find, manage and trace the processed files at any time. Through this batch file processing method, enterprises can organize and manage a large number of engineering files and reports more efficiently, ensure that the files are properly archived and the required information is easy to find. This helps to improve work efficiency, reduce errors, and promote team collaboration and knowledge sharing.

[0050] In a possible implementation, the method further includes:

[0051] (1) in response to a user's copy operation on the target file, obtaining a structured field of the target file;

[0052] (2) Writing the structured fields into the data table of the target directory to obtain the target copy file.

[0053] In the embodiment of the present invention, for example, a manufacturing enterprise performs batch processing of engineering files. Now assume that the enterprise needs to obtain the structured fields of the files when processing engineering files according to the requirements of a specific project, and write them into a data table for more sophisticated management and analysis. The source directory is still the file server or shared folder within the enterprise. The target directory is still a specified specific folder for storing processed files and related structured field information. Extract preset file parameters such as file name, size, and creation date. Use the project index to select the files of a specific project. The user improves the target file parameters and stores the results in the data table. The user may want to extract more detailed information from each file when copying the file to the target directory. For example, when processing engineering files, the user can specify to extract structured fields such as project name, author, version number, etc. from the metadata, tags, or specific locations of the file. The system will automatically extract structured fields from the target file according to the extraction rules defined by the user. These structured fields will be written into the data table together with other information of the file to form a complete record. For example, in a manufacturing enterprise scenario, when a user copies the engineering files of a specific project to the target directory, the system automatically extracts structured fields from each file, such as project name, author, version number, etc., and writes these fields into a data table. In this way, the enterprise can view the detailed information of each file in the data table and conduct more convenient and accurate management, analysis and query.

[0054] In a possible implementation, the method further includes:

[0055] (1) in response to a user executing a target copy file instruction, determining source data of the target file according to the structured field;

[0056] (2) Using the source data as the execution result of the target copy file.

[0057] In an embodiment of the present invention, for example, it is assumed that there is a manufacturing enterprise that needs to process engineering files in batches and store related structured fields and source data. Using this technical solution, the enterprise can extract structured fields from the target file according to user-defined rules, determine the source data of the file according to these fields, and associate it with the target copy file. The source directory is a file server or shared folder within the enterprise, containing various engineering files and reports. The target directory is a designated specific folder for storing processed files and related structured field information. Preset file parameters and target file parameters are extracted, and the user improves the target file parameters and stores the results in a data table. According to the rules defined by the user, the system extracts structured fields according to the content, metadata or specific location of the target file. For example, for engineering files, users can define fields such as project name, author, version number, etc. to be extracted from the file content. According to the structured fields of the target file, the system determines the source data related to the file. For example, if the structured field includes a project number, the system can determine which specific project the file belongs to according to the number and find the project data related to it. The system associates the acquired source data with the target copy file and stores it in the data table. The target copy file recorded in the data table will contain the source data information related to it. For example, in the scenario of a manufacturing enterprise, when a user copies a project file to the target directory, the system automatically extracts structured fields from the file, such as project name, author, and version number. Then, the system determines which project the file belongs to based on these fields and obtains the project data related to it. Finally, the system associates the source data with the target copy file and stores it in the data table as the execution result.

[0058] In a possible implementation, the structured field includes path data, and the aforementioned step of determining the source data of the target file according to the structured field in response to the user executing the target copy file instruction can be implemented through the following example.

[0059] (1) In response to a user executing a target copy file instruction, source data of the target file is determined according to the path data.

[0060] In the embodiment of the present invention, illustratively, in the previous scenario, we take the batch processing of engineering files by a manufacturing enterprise as an example. Now assume that the enterprise needs to determine the source data according to the path data of the file when copying the engineering file to the target directory. The location of the source directory and the target directory is obtained, the preset file parameters and the target file parameters are extracted, the user improves the target file parameters, and the results are stored in the data table. According to the rules defined by the user, the system extracts the structured fields from the path data of the target file. For example, if the path data represents a specific department or project to which the file belongs, the system can extract this information from the path as a structured field. According to the path data of the target file, the system determines the source data related to the file. If the path data contains a project number or a department name, the system can determine which specific project or department the file belongs to based on this information, and find the project or department data related to it. The obtained source data is associated with the target copy file and stored in the data table. The target copy file recorded in the data table will contain the source data information related to it. For example, in the scenario of a manufacturing enterprise, when the user copies the engineering file to the target directory, the system extracts the structured fields according to the path data of the file. For example, the path data may contain a project number and a department name. The system can determine which specific project or department the file belongs to based on these fields, and find the project or department data related to it. The system then associates the source data with the target copy file and stores it in the data table as the execution result of the target copy file. Enterprises can more accurately determine the source data of a file based on the file's path data. In this way, enterprises can more accurately associate and query files based on the location and hierarchy of the files. This approach makes file management more flexible and efficient, and also provides more possibilities for data analysis.

[0061] In a possible implementation, the aforementioned step of writing the structured field into the data table of the target directory to obtain the target copy file can be implemented through the following example.

[0062] (1) Based on the copy-on-write mechanism, the structured field is written into the data table of the target directory to obtain a target copy file.

[0063] In the embodiment of the present invention, exemplary, exemplary, suppose there is a manufacturing enterprise, they need to batch process engineering files and store related structured fields and source data. Using this technical solution, the enterprise can extract structured fields from the target file according to the rules defined by the user, determine the source data of the file according to these fields, and associate it with the target copy file. The source directory is a file server or shared folder within the enterprise, containing various engineering files and reports. The target directory is a designated specific folder for storing processed files and related structured field information. The process of writing the structured field into the target directory data table adopts a copy-on-write mechanism. When the user executes the target copy file instruction, the system writes the extracted structured field into the data table of the target directory based on the copy-on-write mechanism. This means that when writing the data table, the existing target copy file is not directly modified, but a copy is created and the structured field is written into the data table of the copy. By using the copy-on-write mechanism, the system can avoid directly modifying the target copy file, thereby maintaining the integrity and data consistency of the file. For example, in the scenario of a manufacturing enterprise, when a user copies a project file to the target directory, the system automatically extracts structured fields from the file, such as project name, author, and version number. The system then determines which project the file belongs to based on these fields and obtains the project data related to it. Next, the system uses a copy-on-write mechanism to write the extracted structured fields into the data table of the target directory and obtain a copy of the target copy file. In this way, the enterprise can view the detailed information of each file in the data table and manage, analyze and query it more conveniently and accurately. By using this method based on the copy-on-write mechanism, the enterprise is able to simultaneously retain the integrity of the original file and create a copy of the target copy file to store the structured fields. This method can effectively manage a large number of engineering files and reports and provide more efficient file organization, query and analysis functions. In addition, since the target copy file is not directly modified, it can also prevent accidental data corruption or erroneous modification. Therefore, this method provides enterprises with a reliable and secure way to process batch files.

[0064] In a possible implementation manner, the embodiment of the present invention further provides the following implementation manner.

[0065] (1) in response to a modification operation for modifying the target copy file, obtaining source data of the target file determined according to the structured field;

[0066] (2) determining, from the source data of the target file, the modified source data corresponding to the modification operation of the target copy file;

[0067] (3) Constructing new file parameters based on the modified source data to obtain a modified target copy file.

[0068] In the embodiment of the present invention, for example, in a manufacturing enterprise scenario, it is assumed that a project file named "design report.docx" is copied to a target directory. According to the previous technical solutions and scenarios, the system automatically extracts structured fields such as project name, author, and version number from the file.

[0069] Now, assuming that the user performs a modification operation on the target copy file, such as changing some contents of the design report or adding new contents, the system according to the method of claim 3 will respond to the modification operation and obtain source data related to the target file.

[0070] By analyzing the source data of the target file, the system can determine the modified source data corresponding to the modification operation on the target copy file. For example, the system may find that the design report belongs to an engineering project named "Project A", and the source data related to the project includes information such as project progress and key milestones.

[0071] Next, based on the modified source data, the system will construct a new file parameter to generate a new copy of the modified source data together with the original file, that is, the modified target copy file. In this example, the system will combine the user's modification operation with the source data of Project A to generate a new design report copy with updated content and related data.

[0072] In this way, enterprises can retain the integrity of the original files in the target directory and generate modified target copy files based on the modification operations and related source data. This enables enterprises to trace back and understand the modification history of each file when necessary, and have more comprehensive and accurate file management capabilities. At the same time, by building new file parameters based on the modified source data, the system can automatically update the target copy file to ensure its consistency with the related data.

[0073] In summary, in a manufacturing enterprise, when a user modifies a target copy file, the system can respond to the operation and obtain the source data related to the target file. Then, based on the modified source data, the system will construct new file parameters and generate a modified target copy file that contains the updated content and related data. In this way, enterprises can flexibly manage and update engineering files and ensure the consistency of files and their related data.

[0074] In a possible implementation manner, the embodiment of the present invention further provides the following implementation manner.

[0075] (1) in response to a user's copy operation on the target file, obtaining a structured field of the target file;

[0076] (2) calling a preset number of threads to divide the structured field of the target file into a plurality of data blocks, where the number of the data blocks is consistent with the preset number;

[0077] (3) Based on the preset number of threads, the structured fields are written in parallel into a data table of the target directory to obtain a target copy file.

[0078] In the embodiment of the present invention, for example, in the scenario of a manufacturing enterprise, it is assumed that a user wants to copy a batch of engineering files to a target directory. According to the previous technical solutions and scenarios, the system will respond to the user's copy operation and obtain the structured fields of the target file.

[0079] Based on the above scheme, the system will call a preset number of threads to process the structured fields of the target file. Assuming that the preset number of threads is 4, the system will divide the structured fields of the target file into 4 data blocks, each of which contains the same number of fields.

[0080] Next, the system will use these four threads in parallel to write the structured fields into the data table of the target directory. Each thread is responsible for processing a data block and writing the fields in it to the corresponding position in the data table. Through parallel processing, the system can speed up processing and improve efficiency.

[0081] In this example, assume that the target file that the user wants to copy is a design report, which contains structured fields such as project name, author, and version number. The system calls 4 threads to process these fields and divides them into 4 data blocks. Each thread is responsible for writing the fields in a data block to the data table in the target directory, and finally a target copy file related to the design report is obtained.

[0082] In this way, the system can process a large number of structured fields in parallel and write them into the data table of the target directory. This allows enterprises to efficiently copy and process engineering files and quickly obtain the structured field information related to each file. At the same time, by using multi-threaded parallel processing, the system can also increase processing speed and reduce waiting time.

[0083] In summary, in a manufacturing enterprise, when a user performs a copy operation on a target file, the system responds to the operation and obtains the structured fields of the target file. Then, the system calls a preset number of threads, divides the structured fields into a corresponding number of data blocks, and uses these threads to write the fields to the data table of the target directory in parallel, and finally obtains the target copy file. In this way, enterprises can efficiently copy and process a large number of engineering files and achieve faster file management and query.

[0084] The following provides an overall implementation process of an embodiment of the present invention. "1) The user selects a source directory node and a target directory node. For example, the user selects source directory A and target directory B. 2) From the node table corresponding to the database, extract the file name, file attributes and other field data (ranging from a few to hundreds of thousands) under the source directory node into the memory. In this example, we assume that there are 3 files under source directory A, file 1, file 2, and file 3. The names, attributes and other data of these three files are extracted into the memory. "3) Rewrite the field data of the source data one by one (according to business requirements), for example, change the status field from approved to pending file status. For example, we change the status of file 1 from "approved" to "pending". "4) Write the rewritten data in batches into the data table under the target project and directory node. The batch here refers to the database-specific batch operation method, such as committing 1,000 records once. Similar batch writing methods can greatly improve data writing efficiency. Therefore, we write the rewritten data of file 1, file 2, and file 3 in batches into the data table under the target directory B. For example, the actual copy and write insert time of 186 files with a total size of 11.1G is 2.7 seconds. 5) Use the copy-on-write mechanism, that is, only copy the file header, etc. For structured field data, the file content itself is not copied. When the file is logically copied to multiple places, when reading the file itself, the underlying read actually points to the same physical path and the same file, thereby realizing the read sharing of the file data itself. Therefore, although the data of file 1, file 2 and file 3 have been copied to the target directory B, their contents are not actually copied. Only new records pointing to them are added in the data table in the database. "6) When a part of the data needs to be modified, this part of the data is copied to a new path to generate a new file and then edited and modified, instead of copying all the original files on the project on the underlying file system. For example, if we need to modify file 1, we copy the data of file 1 to a new path to generate a new file 1, and then edit and modify it. In this way, the solution of the present invention improves the file copying performance while avoiding the operation of copying the original file on the underlying file system, only copies the structured data in the database, and uses the write-time copy mechanism to realize the read sharing and high efficiency of data copying. "In addition, in the process of executing the above steps, incremental replication and parallel replication can also be used. In the incremental replication method, only the changed part of the file is copied to reduce the amount of copied data and the time consumption of the copy operation. This method can improve the copying efficiency, especially when the number of files is large. The file data can be processed in blocks, and multiple threads or processes can be used to achieve parallel replication to speed up the copying speed.By processing multiple file data blocks simultaneously, the overall replication efficiency can be improved, especially on multi-core database systems. The above solution can improve replication efficiency, reduce the time consumption of replication operations, and improve performance when processing a large number of files.

[0085] Please refer to Figure 2 , Figure 2 A batch file processing device 110 provided in an embodiment of the present invention includes:

[0086] An acquisition module 1101 is used to acquire a source directory and a target directory;

[0087] Processing module 1102 is used to extract preset file parameters in the source directory; extract target file parameters of the target file from the preset file parameters according to the project index; and in response to the user's operation of improving the target file parameters, batch store the rewriting results into the data table of the target directory.

[0088] It should be noted that the implementation principle of the aforementioned batch file processing device 110 can refer to the implementation principle of the aforementioned batch file processing method, and will not be repeated here. It should be understood that the division of the various modules of the above device is only a division of logical functions. In actual implementation, they can be fully or partially integrated into a physical entity, or physically separated. And these modules can all be implemented in the form of software calling through processing elements; they can also be all implemented in the form of hardware; some modules can also be implemented in the form of software calling through processing elements, and some modules can be implemented in the form of hardware. For example, the batch file processing device 110 can be a separate processing element, or it can be integrated in a chip of the above device. In addition, it can also be stored in the memory of the above device in the form of program code, and called and executed by a processing element of the above device. The implementation of other modules is similar. In addition, these modules can be fully or partially integrated together, or they can be implemented independently. The processing element described here can be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each of the above modules can be completed by an integrated logic circuit of hardware in the processor element or instructions in the form of software.

[0089] For example, the above modules may be one or more integrated circuits configured to implement the above methods, such as one or more application specific integrated circuits (ASIC), or one or more microprocessors (digital signal processors, DSP), or one or more field programmable gate arrays (FPGA), etc. For another example, when a module above is implemented in the form of a processing element scheduling program code, the processing element may be a general-purpose processor, such as a central processing unit (CPU) or other processor that can call program code. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).

[0090] The embodiment of the present invention provides a computer device 100, which includes a processor and a non-volatile memory storing computer instructions. When the computer instructions are executed by the processor, the computer device 100 executes the aforementioned batch file processing device 110. Figure 3 As shown, Figure 3 The computer device 100 provided in the embodiment of the present invention is a structural block diagram. The computer device 100 includes a batch file processing device 110, a memory 111, a processor 112 and a communication unit 113.

[0091] To achieve data transmission or interaction, the memory 111, the processor 112 and the communication unit 113 are electrically connected to each other directly or indirectly. For example, these components can be electrically connected to each other through one or more communication buses or signal lines. The batch file processing device 110 includes at least one software function module that can be stored in the memory 111 in the form of software or firmware or fixed in the operating system (OS) of the computer device 100. The processor 112 is used to execute the batch file processing device 110 stored in the memory 111, such as the software function modules and computer programs included in the batch file processing device 110.

[0092] An embodiment of the present invention provides a readable storage medium, which includes a computer program. When the computer program is executed, the computer device where the readable storage medium is located is controlled to execute the aforementioned batch file processing method.

[0093] For the purpose of illustration, the foregoing description is made with reference to specific embodiments. However, the above illustrative discussion is not intended to be exhaustive or to limit the present disclosure to the precise form disclosed. In accordance with the above teachings, numerous modifications and variations are possible. These embodiments are selected and described in order to best illustrate the principles of the present disclosure and its practical application, so that those skilled in the art can best utilize the present disclosure and utilize various embodiments with different modifications to suit the intended specific application. For the purpose of illustration, the foregoing description is made with reference to specific embodiments. However, the above illustrative discussion is not intended to be exhaustive or to limit the present disclosure to the precise form disclosed. In accordance with the above teachings, numerous modifications and variations are possible. These embodiments are selected and described in order to best illustrate the principles of the present disclosure and its practical application, so that those skilled in the art can best utilize the present disclosure and utilize various embodiments with different modifications to suit the intended specific application.

Claims

1. A batch file processing method, It is characterized in that The method comprises: Get the source directory and the target directory; Extracting preset file parameters in the source directory; the preset file parameters include project number, department and file type; Extracting target file parameters of the target file from the preset file parameters according to the project index; In response to the user's operation of improving the target file parameters, the rewriting results are stored in batches in the data table of the target directory; the improvement operation includes adding the department and version number to the file; The method further comprises: In response to a user's copy operation on the target file, obtaining a structured field of the target file; Writing the structured fields into the data table of the target directory to obtain a target copy file; The method further comprises: In response to a user executing a target copy file instruction, determining source data of the target file according to the structured field; Using the source data as the execution result of the target copy file, associating the source data with the target copy file, and storing it in a data table as the execution result; The structured field includes path data, and in response to the user executing the target copy file instruction, determining the source data of the target file according to the structured field includes: In response to a user executing a target copy file instruction, determining source data of the target file according to the path data; The step of writing the structured field into the data table of the target directory to obtain the target copy file includes: Writing the structured fields into the data table of the target directory based on a copy-on-write mechanism to obtain a target copy file; The method further comprises: In response to a modification operation for modifying the target copied file, determining source data of the target file according to the structured field; Determining, from the source data of the target file, the modified source data corresponding to the modification operation of the target copied file; Generate a new copy of the modified source data and the original file as a modified target copy file; The method further comprises: Calling a preset number of threads to divide the structured field of the target file into a plurality of data blocks, where the number of the data blocks is consistent with the preset number; The structured fields are written in parallel into the data table of the target directory based on the preset number of threads to obtain a target copy file.

2. A batch file processing device, It is characterized in that The device comprises: An acquisition module is used to acquire a source directory and a target directory; a processing module is used to extract preset file parameters in the source directory; the preset file parameters include project number, department and file type; Extracting target file parameters of the target file from the preset file parameters according to the project index; in response to the user's operation of improving the target file parameters, storing the rewriting results in batches into the data table of the target directory; The processing module is also used for: In response to a user's copy operation on the target file, a structured field of the target file is obtained; the structured field is written into a data table of the target directory to obtain a target copy file; in response to a user's use of an instruction to execute the target copy file, source data of the target file is determined according to the structured field; the source data is used as an execution result of the target copy file, the source data is associated with the target copy file, and is stored in a data table as an execution result; the improved operation includes adding a department and a version number to the file; The structured field includes path data, and the processing module is specifically used for: In response to a user executing a target copy file instruction, source data of the target file is determined according to the path data; the structured field is written into a data table of the target directory based on a copy-on-write mechanism to obtain a target copy file; The processing module is also used for: In response to a modification operation for modifying the target copy file, source data of the target file is determined according to the structured field; modified source data corresponding to the modification operation of the target copy file is determined from the source data of the target file; a new copy is generated together with the modified source data and the original file as a modified target copy file; a preset number of threads are called to divide the structured field of the target file into a plurality of data blocks, the number of the data blocks being consistent with the preset number; based on the preset number of threads, the structured field is written in parallel into a data table of the target directory to obtain a target copy file.

3. A computer device, It is characterized in that The computer device comprises a processor and a non-volatile memory storing computer instructions. When the computer instructions are executed by the processor, the computer device executes the batch file processing method described in claim 1.

4. A readable storage medium, It is characterized in that The readable storage medium includes a computer program, and when the computer program is executed, the computer device where the readable storage medium is located is controlled to execute the batch file processing method described in claim 1.

Citation Information

Patent Citations

  • File archiving method and device, computer equipment and storage medium

    CN109918471A

  • Distributed file system directory cloning method and device and medium

    CN115344550A

  • Project batch identification information adding method and device, and terminal

    CN115687338A

  • Systems and Methods for Large Scale Complex Storage Operation Execution

    US20210141763A1