CN101739466A - File managing method and file managing device - Google Patents
File managing method and file managing device Download PDFInfo
- Publication number
- CN101739466A CN101739466A CN201010034262A CN201010034262A CN101739466A CN 101739466 A CN101739466 A CN 101739466A CN 201010034262 A CN201010034262 A CN 201010034262A CN 201010034262 A CN201010034262 A CN 201010034262A CN 101739466 A CN101739466 A CN 101739466A
- Authority
- CN
- China
- Prior art keywords
- management information
- file
- content
- changed
- change
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Document Processing Apparatus (AREA)
Abstract
The invention discloses a file managing method. The method comprises the following steps of: judging that file content is modified; and generating management information indicating modification situation for the modified file content. The invention also discloses a file managing device, which comprises a content modification detection unit and a management information maintenance unit connected with each other, wherein the content modification detection unit is used for judging that the file content is modified and informing the management information maintenance unit; and the management information maintenance unit is used for generating the management information indicating the modification situation for the modified file content. Consequently, the method and the device can automatically add the management information for a modified file, which can effectively improve working efficiency and bring convenience to the management on the file.
Description
Technical Field
The invention relates to the field of file processing, in particular to a file management method and device.
Background
With the rapid development of computer technology and information technology, computers have become essential tools for people's daily life, work and study, and more data information is stored on computers in the form of electronic documents. The form brings convenience to people and simultaneously has the problem of difficult maintenance. Many electronic document contents need to be modified and maintained continuously, especially code information, and in many cases, a plurality of teams maintain a great deal of electronic document information together, and files are changed continuously in the process, including adding and deleting files or file contents. How to better manage and maintain these electronic files has become an invisible issue.
In the current code management field, no matter the merge function of the current diff/patch tool or the svn tool, there is no function of inserting management information of different formats into a change file in batch, let alone a function of exporting statistical records while inserting management information.
In the field of development tools, some software such as Eclipse has a function of inserting comments, but only comments in a fixed format and fixed content can be inserted, and the functions of automatically selecting the format and adding management information in batches cannot be completed, and the function of deriving statistical records cannot be completed.
In fact, at present, management information can be added to a changed file only in a manual mode, so that the work efficiency is low, the error rate is high, and the efficient and automatic management of the file is not facilitated.
Disclosure of Invention
In view of the above, the main objective of the present invention is to provide a file management method and apparatus, which automatically add management information to a changed file to improve work efficiency and facilitate file management.
In order to achieve the purpose, the technical scheme of the invention is realized as follows:
a method of file management, the method comprising:
the file content is judged to have been changed, and management information indicating the change is generated for the changed file content.
The change is deletion of file content, and the process of generating the management information includes:
the format of the management information and the current system time are acquired, and the declaration of the deleted content, the current system time, and the explanatory information are collectively inserted into the file in the acquired management information format.
The change is an increase in file content, and the process of generating the management information includes:
acquiring the format of the management information and the current system time; management information indicating the start part of the changed content is written, and management information indicating the end part of the changed content is written after the end of the addition information.
Further accumulating and recording the total number of lines changed in all the current files and the number of lines changed in the current files; the position where the change occurs is a position where the management information is inserted.
Further comprising:
and writing the variable value of the change line number of the file content and the path and the name of the currently changed file into the result statistical file.
The determination that the content of the file is changed is realized by a difference technology.
Further comprising:
and confirming that the contents of all files needing to be changed are changed, and writing the final statistical information into the result statistical file.
A file management device including a content change detection unit and a management information maintenance unit connected to each other; wherein,
the content change detection unit is used for judging that the file content is changed and notifying the management information maintenance unit;
and the management information maintenance unit is used for generating management information for indicating the change situation aiming at the changed file content.
Further comprising a statistical unit;
the management information maintenance unit is further used for sending an operation result related to management information adding operation to the statistical unit;
and the statistical unit is used for performing statistical operation according to the received management information adding operation result and aiming at the file content change condition.
The management information maintenance unit comprises a management information adding decision module, a management information format control module and a management information adding execution module which are connected; wherein,
the management information adding decision module is used for determining whether to add management information or not and informing the management information format control module when determining that the management information is to be added;
the management information format control module is used for determining a management information format to be added and informing the management information adding execution module;
the management information adding and executing module is used for executing the management information adding operation including the acquisition of the current system time.
Therefore, the method and the device can automatically add the management information aiming at the changed file, thereby effectively improving the working efficiency and facilitating the management of the file.
Drawings
FIG. 1 is a flowchart of file management according to an embodiment of the present invention;
FIG. 2 is a flowchart of file management according to another embodiment of the present invention;
FIG. 3 is a flowchart of file management according to another embodiment of the present invention;
FIG. 4 is a simplified file management process of the present invention;
FIG. 5 is a diagram of a file management apparatus according to an embodiment of the present invention.
Detailed Description
In summary, the file management method provided by the invention comprises the following steps: the file content is judged to have been changed, and management information indicating the change is generated for the changed file content.
The file management device provided by the invention comprises a content change detection unit and a management information maintenance unit which are connected; wherein the content change detection unit is configured to determine that a file content has been changed and notify the management information maintenance unit of the change; and the management information maintenance unit is used for generating management information for indicating the change situation aiming at the changed file content.
Referring to fig. 1, fig. 1 is a flowchart of file management according to an embodiment of the present invention, where the flowchart includes the following steps:
step 101: reading in the description information input by the user and carrying out initialization processing on the related variable.
Step 102: and detecting the content of the file change.
Specifically, the present invention can detect the file by applying a method currently called as a differential technique, which can find the difference between two sets of file sets based on content comparison and update the old file set according to the difference between the two sets of file sets. Thus, a differencing technique may be applied to compare the same file at different times to determine what has changed in the file.
Step 103: judging whether the information needs to be deleted according to the detection result of the file change content, and if so, entering step 104; otherwise, go directly to step 110.
Step 104: and (5) processing the statistical information.
A specific statistical information processing procedure will be described later with respect to fig. 2.
Step 105: and accumulating and recording the total number of deleted lines in all the current files and the number of deleted lines in the current file.
Step 106: judging whether the management information can be inserted into the current position, and if so, entering step 107; otherwise, return to step 102.
Specifically, in general, if the file content is changed, management information needs to be inserted; however, management information is not generally inserted when the current file is the first line of the x.xml, and management information is not generally inserted when the last line end character of the change content is "\".
Step 107: and acquiring the format of the management information according to the file extension.
Step 108: the current system time is obtained.
Step 109: and writing the management information in the corresponding format, and returning to the step 102.
Specifically, the declaration of the deleted content, the time (i.e., the current system time), and the explanatory information set by the user may be collectively inserted into the file in the acquired management information format.
Step 110: judging whether information needs to be added or not, and if so, performing step 111; otherwise, go directly to step 120.
Step 111: and (5) processing the statistical information.
A specific statistical information processing procedure will be described later with respect to fig. 2.
Step 112: and accumulating and recording the total number of rows added in all the current files and the number of rows added in the current file.
Step 113: judging whether the management information can be inserted into the current position, and if so, entering step 114; otherwise, return to step 102.
Specifically, in general, if the file content is changed, management information needs to be inserted; however, management information is not generally inserted when the current file is the first line of the x.xml, and management information is not generally inserted when the last line end character of the change content is "\".
Step 114: the management information processing is added, and the process returns to step 102.
A specific addition management information processing procedure will be described later with respect to fig. 3.
Step 120: judging whether the update of the file set is finished, and if so, entering a step 121; otherwise, return to step 102.
Step 121: judging whether the variable values of the deletion and the line number increase of the file are 0, if so, ending the process; otherwise, step 122 is entered.
Step 122: and writing the deleted and row number increased variable values of the file into a result counting file, and resetting the variable values.
Specifically, since it can be confirmed that all the contents of the files to be changed have been changed already by the execution of step 122, the final statistical information can be written in the result statistics file.
Referring to fig. 2, fig. 2 is a file management flowchart according to another embodiment of the present invention, and the statistical information processing process specifically described in the flowchart includes the following steps:
step 201: judging whether the current file path and name are written into the result statistical file or not, and if so, ending the statistical information processing process; otherwise, step 202 is entered.
Step 202: judging whether the variable values of the deletion and the line number increase of the file are 0, if so, directly entering the step 204; otherwise, step 203 is entered.
Step 203: and writing the deleted and row number increased variable values of the file into a result counting file, and resetting the variable values.
Step 204: and writing the path and the name of the current changed file into the result statistical file.
Referring to fig. 3, fig. 3 is a file management flowchart of another embodiment of the present invention, and the added management information processing process specifically described in the flowchart includes the following steps:
step 301: and acquiring the format of the management information according to the file extension.
Step 302: the current system time is obtained.
Step 303: management information indicating the start part of the changed content is written.
Specifically, the declaration of the start of the add operation, the time (i.e., the current system time), and the explanatory information set by the user may be collectively inserted into the file in the acquired management information format.
Step 304: and detecting the content of the file change.
Step 305: judging whether the adding information is finished according to the detection result of the file change content, and if so, entering step 306; otherwise, return to step 304.
Step 306: management information indicating the end portion of the changed content is written.
Specifically, the declaration of the end of the add operation, the time (i.e., the current system time), and the explanatory information set by the user may be collectively inserted into the file in the acquired management information format.
In practical application, the inserted management information can be displayed in a proper format according to the file extension name, so that the effect of not influencing the realization function of the code file is achieved. Also, the format of the inserted management information may be various, and one of the formats is shown in table 1:
TABLE 1
As can be seen from the above, the present invention can count change information for a user when performing file management, and the change information includes: adding line number; deleting the number of lines; the total number of change rows; the path of the change and the file name. It is also possible to automatically locate the position where the management information is displayed and display the time when the management information is added at the start of all the changed blocks and display the management information at the position where the content is deleted, including: declare that a portion of the content is deleted here; and displaying the record information uniformly given by the user, such as the function of the current modification and the like.
Further, the management information may be displayed at the beginning and end portions of the changed block to which the content is added, including: declare that a portion of the content is added here; and displaying the record information uniformly given by the user, such as the function of the current modification and the like. Moreover, the management information can be inserted and displayed in a proper format according to the file extension name, so that the effect of not influencing the realization function of the code file is achieved.
Specifically, change information of the file content may be counted, such as: in the process of reading in differential file information and detecting and updating files by applying a differential technology, accumulating and recording the number of lines of deletion/addition of each file and recording the changed file path and name according to records of a differential processing process; when the processing for the file is finished, the related information is appended to the end of the file of the specific recording file.
The position of adding the management information can be automatically located, and the file content updating position is usually the position of displaying the management information, such as: the information which needs to be deleted or added in the current line is determined by means of the difference technology, then the management information adding processing is carried out at the position by applying the method, and the position of the management information added at the next position can be continuously searched by means of the difference technology.
The time to join the management information may be displayed at the beginning of all change blocks, such as: when the position for inserting the management information is located, the current system time is acquired and inserted.
Management information may be added at the position where the content is deleted, such as: if the difference technology is combined to confirm that the operation to be executed at present is to delete part of the content, firstly, a statement of deleting the content and the record information originally specified by the user are inserted therein (for example, the user only needs to input the record information once for the function of the current modification, and the like), and then, the difference technology is applied to delete the corresponding content. If the current position is confirmed to have the adding operation, the management information can be displayed at the beginning and the end parts of the change block added with the content, and the method comprises the following steps: declare that a portion of the content is added here; and displaying the uniformly given record information, such as the function of the current modification and the like.
Specifically, if it is confirmed in conjunction with the difference technique that the operation to be currently performed is to add part of the content, a change statement and the record information originally specified by the user are first inserted therein (for example, the user only needs to input the record information once for the function of the current modification, etc.), and the beginning part of the changed content is indicated here. And then the file information is updated by applying a difference technology. After the update is completed, the description of the change content and the management information specified by the user are inserted again, and the description is the position where the change information is completed. If it is confirmed that the current position has both the deletion operation and the addition operation, only the record of the change management information may be inserted.
The operational concepts of fig. 1-3 can be simplified as shown in fig. 4. Referring to fig. 4, fig. 4 is a simplified diagram of a file management process according to the present invention, which includes the following steps:
step 410: and judging that the content of the file is changed.
Step 420: management information indicating a change situation is generated for the changed file content.
The change may be an addition and/or a deletion, and may further perform a statistical operation on the change of the file content.
According to the process, the method can automatically add management information aiming at the changed file; therefore, the working efficiency can be effectively improved, and the management of the files is facilitated.
To implement the above-described flow, the arrangement shown in fig. 5 may be entered. Referring to fig. 5, fig. 5 is a diagram of a file management apparatus according to an embodiment of the present invention, where the apparatus includes a content change detection unit, a management information maintenance unit, and a statistics unit that can be connected in pairs; the management information maintenance unit comprises a management information adding decision module, a management information format control module and a management information adding execution module which are connected.
In specific application, the content change detection unit can determine that the file content is changed by applying a difference technology and the like, and notify the management information maintenance unit and the statistical unit of the change, and the management information maintenance unit executes management information adding operation including acquiring a management information format and acquiring the current system time; the management information maintenance unit may further transmit an operation result related to the management information adding operation to the statistical unit, and the statistical unit may perform a statistical operation based on the received management information adding operation result and the file content change condition.
Inside the management information maintenance unit, a management information addition decision module is used for determining whether to add the management information or not and informing the management information format control module when determining to add the management information, the management information format control module determines the management information format to be added and informs the management information addition execution module of the situation, and the management information addition operation including the acquisition of the current system time is finally executed by the management information addition execution module.
The specific operations that can be implemented by the functional entities in fig. 5 are described in detail in fig. 1 to 4, and are not described again here.
The file to which the management information is added may be a single file or a file set including a plurality of files.
In summary, the present invention can determine that a file content has been changed, and generate management information indicating a change situation for the changed file content, regardless of the method or the apparatus. Therefore, the working efficiency can be effectively improved, and the management of the files is facilitated.
The above description is only exemplary of the present invention and should not be taken as limiting the scope of the present invention, and any modifications, equivalents, improvements, etc. that are within the spirit and principle of the present invention should be included in the present invention.
Claims (10)
1. A file management method, characterized in that the method comprises:
the file content is judged to have been changed, and management information indicating the change is generated for the changed file content.
2. The method of claim 1, wherein the change is a deletion of a file content, and wherein generating the management information comprises:
the format of the management information and the current system time are acquired, and the declaration of the deleted content, the current system time, and the explanatory information are collectively inserted into the file in the acquired management information format.
3. The method of claim 1, wherein the change is an addition of file content, and wherein generating the management information comprises:
acquiring the format of the management information and the current system time; management information indicating the start part of the changed content is written, and management information indicating the end part of the changed content is written after the end of the addition information.
4. The method of any one of claims 1 to 3, further cumulatively recording the total number of changed lines in all current files and the number of changed lines in the current file; the position where the change occurs is a position where the management information is inserted.
5. The method of any one of claims 1 to 3, further comprising:
and writing the variable value of the change line number of the file content and the path and the name of the currently changed file into the result statistical file.
6. A method according to any one of claims 1 to 3, wherein said determining that the content of the document has been altered is performed by a differencing technique.
7. The method of claim 1, further comprising:
and confirming that the contents of all files needing to be changed are changed, and writing the final statistical information into the result statistical file.
8. A file management apparatus, characterized in that the apparatus includes a content change detection unit and a management information maintenance unit connected to each other; wherein,
the content change detection unit is used for judging that the file content is changed and notifying the management information maintenance unit;
and the management information maintenance unit is used for generating management information for indicating the change situation aiming at the changed file content.
9. The apparatus of claim 8, further comprising a statistics unit;
the management information maintenance unit is further used for sending an operation result related to management information adding operation to the statistical unit;
and the statistical unit is used for performing statistical operation according to the received management information adding operation result and aiming at the file content change condition.
10. The device according to claim 8 or 9, wherein the management information maintenance unit comprises a management information addition decision module, a management information format control module and a management information addition execution module which are connected; wherein,
the management information adding decision module is used for determining whether to add management information or not and informing the management information format control module when determining that the management information is to be added;
the management information format control module is used for determining a management information format to be added and informing the management information adding execution module;
the management information adding and executing module is used for executing the management information adding operation including the acquisition of the current system time.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201010034262A CN101739466A (en) | 2010-01-18 | 2010-01-18 | File managing method and file managing device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201010034262A CN101739466A (en) | 2010-01-18 | 2010-01-18 | File managing method and file managing device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN101739466A true CN101739466A (en) | 2010-06-16 |
Family
ID=42462949
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201010034262A Pending CN101739466A (en) | 2010-01-18 | 2010-01-18 | File managing method and file managing device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN101739466A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104933101A (en) * | 2015-05-29 | 2015-09-23 | 南车株洲电力机车研究所有限公司 | SVN-based method for automatic statistics of configuration audit information |
CN106155750A (en) * | 2016-07-29 | 2016-11-23 | 腾讯科技(深圳)有限公司 | The loading method of a kind of resource file and device |
CN114185861A (en) * | 2021-12-08 | 2022-03-15 | 国网福建省电力有限公司经济技术研究院 | A basic resource sharing management system based on the Internet of Things and its management method |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7418656B1 (en) * | 2003-10-03 | 2008-08-26 | Adobe Systems Incorporated | Dynamic annotations for electronics documents |
-
2010
- 2010-01-18 CN CN201010034262A patent/CN101739466A/en active Pending
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7418656B1 (en) * | 2003-10-03 | 2008-08-26 | Adobe Systems Incorporated | Dynamic annotations for electronics documents |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104933101A (en) * | 2015-05-29 | 2015-09-23 | 南车株洲电力机车研究所有限公司 | SVN-based method for automatic statistics of configuration audit information |
CN104933101B (en) * | 2015-05-29 | 2018-05-29 | 南车株洲电力机车研究所有限公司 | A kind of configuration audit information method for automatically counting based on SVN |
CN106155750A (en) * | 2016-07-29 | 2016-11-23 | 腾讯科技(深圳)有限公司 | The loading method of a kind of resource file and device |
CN106155750B (en) * | 2016-07-29 | 2018-09-07 | 腾讯科技(深圳)有限公司 | A kind of loading method and device of resource file |
CN114185861A (en) * | 2021-12-08 | 2022-03-15 | 国网福建省电力有限公司经济技术研究院 | A basic resource sharing management system based on the Internet of Things and its management method |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9773165B2 (en) | Method and system for webpage regression testing | |
CN109271315B (en) | Script code detection method, script code detection device, computer equipment and storage medium | |
US8752009B2 (en) | Source code comparison device, source code comparison method and source code comparison program | |
US20080189639A1 (en) | Dynamically detecting exceptions based on data changes | |
CN108733712B (en) | Question-answering system evaluation method and device | |
CN109710631A (en) | Auxiliary generates method, apparatus, equipment and the computer storage medium of SQL code | |
CN108073707B (en) | Financial business data updating method and device and computer readable storage medium | |
CN103019398A (en) | Character input method and character input device | |
EP2988226A1 (en) | Electronic document data updating method and device | |
CN114201615B (en) | Scientific research data change review method and server based on data snapshot | |
CN114090671A (en) | Data import method and device, electronic equipment and storage medium | |
CN102067117A (en) | Method for displaying and operating table | |
CN110046009B (en) | Recording method, recording device, server and readable storage medium | |
CN111338625A (en) | Data processing method, system, terminal equipment and storage medium | |
CN113190401A (en) | Fast game abnormity monitoring method, electronic equipment, mobile terminal and storage medium | |
CN101739466A (en) | File managing method and file managing device | |
CN108694172B (en) | Information output method and device | |
CN109460318B (en) | Import method of rollback archive collected data, computer device and computer readable storage medium | |
CN110825944A (en) | Webpage table data acquisition method and device, computer equipment and storage medium | |
CN113868137A (en) | Method, device and system for processing buried point data and server | |
CN110674033B (en) | Method, device, equipment and storage medium for processing code | |
CN116303627B (en) | Query method and device for semiconductor test data, electronic equipment and storage medium | |
CN111832268A (en) | Information interaction method, readable storage medium and electronic device | |
CN102799597A (en) | Content extraction method | |
CN116775197A (en) | An algorithm editing method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C12 | Rejection of a patent application after its publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20100616 |