CN111475476A - SVN-based method and device for preventing multiple persons from waiting for unlocking file - Google Patents

SVN-based method and device for preventing multiple persons from waiting for unlocking file Download PDF

Info

Publication number
CN111475476A
CN111475476A CN202010154533.0A CN202010154533A CN111475476A CN 111475476 A CN111475476 A CN 111475476A CN 202010154533 A CN202010154533 A CN 202010154533A CN 111475476 A CN111475476 A CN 111475476A
Authority
CN
China
Prior art keywords
file
user
operated
svn
latest
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
Application number
CN202010154533.0A
Other languages
Chinese (zh)
Inventor
亓颖
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202010154533.0A priority Critical patent/CN111475476A/en
Publication of CN111475476A publication Critical patent/CN111475476A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/176Support for shared access to files; File sharing support
    • G06F16/1767Concurrency control, e.g. optimistic or pessimistic approaches
    • G06F16/1774Locking methods, e.g. locking methods for file systems allowing shared and concurrent access to files

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a method and a device for avoiding unlocking a file by multiple persons based on SVN (singular value decomposition), wherein the state of the file to be operated is monitored when a file operation request of a user is received; if the file to be operated is in a locked state, copying the file to be operated, and generating an original file copy for a user to operate; receiving an original file copy operated by a user, then continuously monitoring the state of a file to be operated, if the file to be operated is monitored to be unlocked, acquiring the latest file version of the file to be operated, and merging the original file copy operated by the user into the latest file version to obtain a merged file; and submitting the merged file to the SVN server. According to the invention, when a certain file is locked, the user can still modify and submit the file, and the modified content of the user is automatically combined with the locked file, so that the situation that the user circularly waits for the unlocking of the file is avoided, the time of the circular waiting of the user is saved, and the working efficiency is improved.

Description

SVN-based method and device for preventing multiple persons from waiting for unlocking file
Technical Field
The invention relates to the field of file management based on SVN, in particular to a method and a device for avoiding multiple persons waiting for unlocking a file based on SVN.
Background
SVN is a version control software widely used in the software industry, often for code and document management. The "lock-modify-unlock" mode of the SVN itself has irreplaceable advantages in cooperative work. The locking mechanism of the SVN is that when the user 1 locks the file, other users can modify the file locally, but an error is reported when submitting the file, because the user 1 needs to acquire the version modified by the user 1 after unlocking the file, then the operation is locked, and the operation is submitted based on the version modified by the user 1, at this time, the state of the file is still locked, and the other user modifications need to wait for the operation after unlocking the file by the user 2, and the operation is repeated. When a plurality of persons are required to operate and modify a file in daily life, the mode of alternately locking, modifying and submitting the file inevitably has artificial waiting time, and the working efficiency is influenced.
Disclosure of Invention
In order to solve the problems, the invention provides a method and a device for avoiding multiple persons waiting for unlocking a file based on SVN (singular value decomposition), wherein a user modifies and submits a copy file without waiting for unlocking, and the working efficiency is improved.
The technical scheme of the invention is as follows: a method for avoiding multiple persons waiting for unlocking a file based on SVN comprises the following steps:
when a file operation request of a user is received, monitoring the state of a file to be operated;
if the file to be operated is in a locked state, copying the file to be operated, and generating an original file copy for a user to operate;
receiving an original file copy operated by a user, then continuously monitoring the state of a file to be operated, if the file to be operated is monitored to be unlocked, acquiring the latest file version of the file to be operated, and merging the original file copy operated by the user into the latest file version to obtain a merged file;
and submitting the merged file to the SVN server.
Further, still include:
and after the merged file is submitted to the SVN server, informing the user of successful submission.
Further, when a file operation request of a user is received, if the file to be operated is monitored to be in an unlocked state, the latest file version of the file to be operated is directly obtained from the SVN server for the user to operate;
and after receiving the latest file version which is operated by the user, submitting the latest file version to the SVN server.
Further, still include:
and after the latest file version which is operated by the user is submitted to the SVN server, the user is informed that the submission is successful.
Further, the original file copy operated by the user is merged into the latest file version through the merge function of the SVN.
The technical scheme of the invention also comprises a device for avoiding multiple persons waiting for unlocking the file based on the SVN, which comprises,
an operation request receiving module: receiving a file operation request of a user;
an operation file state monitoring and judging module: monitoring and judging the state of a file to be operated;
a copy generation module: copying a file to be operated, and generating an original file copy for user operation;
the operation completion file receiving module: receiving an original file copy finished by user operation;
the latest file version acquisition module: acquiring the latest file version of a file to be operated;
a file merging module: merging the original file copies finished by the user operation into the latest file version to obtain a merged file;
a file submission module: and submitting the merged file to the SVN server.
Further, when the user directly operates on the latest file version of the file to be operated, the operation completion file receiving module receives the latest file version which is operated by the user.
Further, when the user directly operates on the latest file version of the file to be operated, the file submitting module submits the latest file version after the operation to the SVN server.
Further, the device also comprises a control device,
a user notification module: and after the merged file or the latest file version after the operation is finished is submitted to the SVN server, the user is informed that the submission is successful.
Further, the file merging module merges the original file copy operated by the user to the latest file version through the merge function of the SVN.
The invention provides a method and a device for avoiding multiple persons waiting for unlocking a file based on SVN (singular value decomposition), which are used for modifying the locked file by a user in a mode of establishing a copy for the locked file, monitoring the locked file, and merging the copy into an original edition by utilizing the merging function of the SVN and submitting the original edition to an SVN server. According to the invention, when a certain file is locked, the user can still modify and submit the file, and the modified content of the user is automatically combined with the locked file, so that the situation that the user circularly waits for the unlocking of the file is avoided, the time of the circular waiting of the user is saved, and the working efficiency is improved.
Drawings
FIG. 1 is a schematic flow chart of a method according to an embodiment of the present invention.
Fig. 2 is a schematic block diagram of a second structure according to an embodiment of the present invention.
Detailed Description
The present invention will be described in detail below with reference to the accompanying drawings by way of specific examples, which are illustrative of the present invention and are not limited to the following embodiments.
Example one
The embodiment provides a method for avoiding multiple persons waiting for unlocking a file based on SVN, and when the file to be operated is in a locked state, an original file copy is provided for a user to operate, so that the file waiting for unlocking is avoided.
As shown in fig. 1, the method comprises the following steps:
s1, when receiving a file operation request of a user, monitoring the state of a file to be operated;
when a user requests to operate a file, other users may operate the file to be operated to lock the file, so that the method monitors the state of the file to be operated when receiving the file operation request of the user.
S2, copying the file to be operated if the file to be operated is in a locked state, and generating an original file copy for the user to operate;
the state of the file to be operated can be obtained using svn status, where the state unlocked status is 0 and the state locked status is 1. When the status is 1, it is described that another user operates the file to be operated and locks the file, and at this time, the file to be operated is copied, and it is described that the copied file is an original file of the file to be operated acquired from the SVN server, an original file copy is generated, and the user operates on the original file copy.
S3, receiving the original file copy operated by the user, then continuously monitoring the state of the file to be operated, if the file to be operated is unlocked, acquiring the latest file version of the file to be operated, and merging the original file copy operated by the user into the latest file version to obtain a merged file;
after the user finishes operating the original file copy, the original file copy is stored and submitted, at this time, the state of the file to be operated (namely, the operation file requested to be operated by the user, it needs to be noted that the user finishes operating the original file copy of the file) is continuously and continuously monitored until the file to be operated is monitored to be unlocked, the latest version of the file is obtained from the SVN server, and the original file copy finished by the user is automatically merged to the latest file version to obtain a merged file.
It should be noted that, in this embodiment, the original file copy after the operation of the user can be automatically merged into the latest file version through the merge function of the SVN.
And S4, submitting the merged file to an SVN server,
and after the files are automatically merged, the merged files are automatically submitted to the SVN server, and the user is informed after successful submission.
By the method, when the file to be operated is in the locked state, the user can still carry out normal operation and submission, submission errors can not occur, waiting for unlocking is avoided, and time is saved.
In addition, when the user requests operation, the file to be operated is in an unlocked state, and the latest file version is normally and directly acquired for operation. When a file operation request of a user is received, if the file to be operated is monitored to be in an unlocked state, namely status is monitored to be 0, directly acquiring the latest file version of the file to be operated from the SVN server for the user to operate; and then after receiving the latest file version which is operated by the user, submitting the latest file version to the SVN server. The user is also notified after submission of the submission. It should be noted that the latest file version can be obtained by executing the update command.
Example two
The embodiment provides a device for avoiding multiple persons waiting for unlocking a file based on an SVN (singular value decomposition) method for realizing the method in the first embodiment.
As shown in fig. 2, the apparatus includes the following functional modules.
The operation request receiving module 1: receiving a file operation request of a user;
the operating file state monitoring and judging module 2: monitoring and judging the state of a file to be operated;
the copy generation module 3: copying a file to be operated, and generating an original file copy for user operation;
the operation completion file receiving module 4: receiving an original file copy finished by user operation;
the latest file version acquisition module 5: acquiring the latest file version of a file to be operated;
the file merging module 6: merging the original file copies finished by the user operation into the latest file version to obtain a merged file;
the file submission module 7: and submitting the merged file to the SVN server.
In the device, when an operation request receiving module 1 receives a user operation file request, an operation file state monitoring and judging module 2 is informed to carry out state monitoring, if the operation file state monitoring and judging module 2 monitors that a file to be operated is in a locked state, a copy generating module 3 is informed to copy the file to be operated, and an original file copy is generated for the user to operate. After the operation of the user is finished, the operated original file copy is stored and submitted, the operated file receiving module 4 receives the operated original file copy, informs the operation file state monitoring and judging module 2 to continuously monitor the state of the file to be operated, informs the latest file version obtaining module 5 to obtain the latest file version of the file to be operated after the unlocking of the file to be operated is monitored, then the file merging module 6 merges the operated original file copy to the latest file version to obtain a merged file, and then the file submitting module 7 submits the merged file to the SVN server.
It should be noted that, the file merging module 6 merges the original file copy operated by the user into the latest file version through merge function of SVN.
In addition, when the operation request receiving module 1 receives a user operation file request, if the operation file state monitoring and judging module 2 monitors that the file to be operated is in an unlocked state, the latest file version acquiring module 5 is notified to acquire the latest file version of the file to be operated for the user to directly operate on the latest file version, the latest file version is saved and submitted after the operation is completed, the operation completion file receiving module 4 receives the latest file version after the operation is completed, and the file submitting module 7 submits the latest file version after the operation is completed to the SVN server.
In this embodiment, the user notification module 8 is further configured to notify the user that the file is successfully submitted after submitting the merged file or the latest file version after the operation to the SVN server.
The present embodiment is further described below with reference to a specific implementation.
And the user 1 acquires the latest version from the SVN server, executes the SVN lock to lock the file, and changes the file, wherein the file is in a locked state.
When the user N requests to operate a file, the operating file state monitoring and determining module 2 acquires the file state using svnstattus, where the state unlocked status is 0 and the state unlocked status is 1. If the obtaining state value is 0, the user 1 finishes the operation, the file is unlocked, the latest file version obtaining module 5 directly obtains the latest file version from the SVN server by executing the update command, the user locks, edits and submits the latest file version to the SVN server, and the submitted file is automatically unlocked.
If the acquired state value is 1, the file is still in a locked state, the copy generation module 3 copies the original file to generate an original file copy, and the user N edits and modifies the original file copy.
After the operation of the user N is completed and the copy of the original file is saved and submitted, the operation file state monitoring and judging module 2 continuously acquires the file state until the file is unlocked. The latest file version obtaining module 5 obtains the latest file version modified by the user 1 by executing update command, and the file merging module 6 executes SVN merge function to merge the copy modified by the user N into the original file and submit the copy to the SVN server.
And informing the user N of successful submission.
The above disclosure is only for the preferred embodiments of the present invention, but the present invention is not limited thereto, and any non-inventive changes that can be made by those skilled in the art and several modifications and amendments made without departing from the principle of the present invention shall fall within the protection scope of the present invention.

Claims (10)

1. A method for avoiding multiple persons waiting for unlocking a file based on SVN is characterized by comprising the following steps:
when a file operation request of a user is received, monitoring the state of a file to be operated;
if the file to be operated is in a locked state, copying the file to be operated, and generating an original file copy for a user to operate;
receiving an original file copy operated by a user, then continuously monitoring the state of a file to be operated, if the file to be operated is monitored to be unlocked, acquiring the latest file version of the file to be operated, and merging the original file copy operated by the user into the latest file version to obtain a merged file;
and submitting the merged file to the SVN server.
2. The SVN-based method for avoiding multiple waiting for a file to unlock of claim 1, further comprising:
and after the merged file is submitted to the SVN server, informing the user of successful submission.
3. The SVN-based method for avoiding unlocking files by multiple persons based on claim 1 or 2, wherein when a file operation request of a user is received, if the file to be operated is monitored to be in an unlocked state, the latest file version of the file to be operated is directly acquired from the SVN server for the user to operate;
and after receiving the latest file version which is operated by the user, submitting the latest file version to the SVN server.
4. The SVN-based method for avoiding multiple waiting for file unlocking according to claim 3, further comprising:
and after the latest file version which is operated by the user is submitted to the SVN server, the user is informed that the submission is successful.
5. The SVN-based method for avoiding multi-person waiting for file unlocking according to claim 1 or 2, wherein the original file copy after user operation is merged to the latest file version through merge function of SVN.
6. A device for preventing multiple persons from waiting for unlocking a file based on SVN is characterized by comprising,
an operation request receiving module: receiving a file operation request of a user;
an operation file state monitoring and judging module: monitoring and judging the state of a file to be operated;
a copy generation module: copying a file to be operated, and generating an original file copy for user operation;
the operation completion file receiving module: receiving an original file copy finished by user operation;
the latest file version acquisition module: acquiring the latest file version of a file to be operated;
a file merging module: merging the original file copies finished by the user operation into the latest file version to obtain a merged file;
a file submission module: and submitting the merged file to the SVN server.
7. The SVN-based multi-person waiting for file unlocking prevention apparatus of claim 6,
when the user directly operates on the latest file version of the file to be operated, the operation completion file receiving module receives the latest file version which is operated by the user.
8. The SVN-based apparatus for avoiding multiple waiting for file unlocking of claim 7, wherein when a user directly operates on the latest file version of a file to be operated, the file submitting module submits the latest file version after the operation to the SVN server.
9. The SVN-based multi-person waiting for file unlocking prevention apparatus of claim 8, further comprising,
a user notification module: and after the merged file or the latest file version after the operation is finished is submitted to the SVN server, the user is informed that the submission is successful.
10. The SVN-based apparatus for avoiding multiple people waiting for a file to unlock according to any of claims 6-9,
and the file merging module merges the original file copy operated by the user into the latest file version through the merge function of the SVN.
CN202010154533.0A 2020-03-08 2020-03-08 SVN-based method and device for preventing multiple persons from waiting for unlocking file Pending CN111475476A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010154533.0A CN111475476A (en) 2020-03-08 2020-03-08 SVN-based method and device for preventing multiple persons from waiting for unlocking file

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010154533.0A CN111475476A (en) 2020-03-08 2020-03-08 SVN-based method and device for preventing multiple persons from waiting for unlocking file

Publications (1)

Publication Number Publication Date
CN111475476A true CN111475476A (en) 2020-07-31

Family

ID=71747234

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010154533.0A Pending CN111475476A (en) 2020-03-08 2020-03-08 SVN-based method and device for preventing multiple persons from waiting for unlocking file

Country Status (1)

Country Link
CN (1) CN111475476A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101158980A (en) * 2007-12-04 2008-04-09 威盛电子股份有限公司 Multiple modes search method and system
CN104933088A (en) * 2015-05-13 2015-09-23 深圳市中幼国际教育科技有限公司 Remote editing method and system
CN106469150A (en) * 2015-08-14 2017-03-01 阿里巴巴集团控股有限公司 File read/write method, device and system
CN110120940A (en) * 2019-04-12 2019-08-13 华中科技大学 A kind of file system resource partition method towards Docker container

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101158980A (en) * 2007-12-04 2008-04-09 威盛电子股份有限公司 Multiple modes search method and system
CN104933088A (en) * 2015-05-13 2015-09-23 深圳市中幼国际教育科技有限公司 Remote editing method and system
CN106469150A (en) * 2015-08-14 2017-03-01 阿里巴巴集团控股有限公司 File read/write method, device and system
CN110120940A (en) * 2019-04-12 2019-08-13 华中科技大学 A kind of file system resource partition method towards Docker container

Similar Documents

Publication Publication Date Title
CN110741350B (en) Backup and restore architecture for distributed computing systems
US8689179B2 (en) Transportable refactoring object
US5659682A (en) Scheme to determine completion of directory operations for server recovery
US5941999A (en) Method and system for achieving high availability in networked computer systems
KR100553984B1 (en) Service processing system, processing result management apparatus, and method for checking processing result in service processing system
US5095421A (en) Transaction processing facility within an operating system environment
CN1918572A (en) Apparatus, system, method for enabling web-applications to access enterprise managed data
US7343377B1 (en) Method and system for verifying the integrity of a database
CN1423192A (en) Soft installatign on mobile computering apparatus using configuration manager rolling back and safety characteristic
JPH0465414B2 (en)
US8219597B2 (en) Information processing apparatus and method
EP1875347A2 (en) Fault tolerant distributed lock management
CN110413687B (en) Distributed transaction fault processing method and related equipment based on node interaction verification
US20030050937A1 (en) System for adaptively identifying data for storage
CN102761604B (en) Request processing system, request processing method and server
CN111475476A (en) SVN-based method and device for preventing multiple persons from waiting for unlocking file
KR100744738B1 (en) Link processing apparatus and method for processing link
US8127175B2 (en) High availability of JCA inflowed transactions
CN113448493B (en) Method, electronic device and computer readable medium for backing up data
CN113703831A (en) Method, device, equipment and medium for realizing service idempotency
JP2004005505A (en) Computer readable program for letting computer execute program formation
JP2004127253A (en) Information processing apparatus and version check method
CN111258823A (en) Method and system for switching master server and slave server
US11847498B2 (en) Multi-region deployment of jobs in a federated cloud infrastructure
JP2014142741A (en) Job re-execution support system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20200731

RJ01 Rejection of invention patent application after publication