CN112612413B - Version management file caching method, device and system and related equipment - Google Patents

Version management file caching method, device and system and related equipment Download PDF

Info

Publication number
CN112612413B
CN112612413B CN202011415921.6A CN202011415921A CN112612413B CN 112612413 B CN112612413 B CN 112612413B CN 202011415921 A CN202011415921 A CN 202011415921A CN 112612413 B CN112612413 B CN 112612413B
Authority
CN
China
Prior art keywords
file
updated
version management
added
management server
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.)
Active
Application number
CN202011415921.6A
Other languages
Chinese (zh)
Other versions
CN112612413A (en
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.)
Haiguang Information Technology Co Ltd
Original Assignee
Haiguang Information 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 Haiguang Information Technology Co Ltd filed Critical Haiguang Information Technology Co Ltd
Priority to CN202011415921.6A priority Critical patent/CN112612413B/en
Publication of CN112612413A publication Critical patent/CN112612413A/en
Application granted granted Critical
Publication of CN112612413B publication Critical patent/CN112612413B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0608Saving storage space on storage systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/0643Management of files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0646Horizontal data movement in storage systems, i.e. moving data in between storage devices or systems
    • G06F3/0652Erasing, e.g. deleting, data cleaning, moving of data to a wastebasket
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0655Vertical data movement, i.e. input-output transfer; data movement between one or more hosts and one or more storage devices
    • G06F3/0656Data buffering arrangements
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/067Distributed or networked storage systems, e.g. storage area networks [SAN], network attached storage [NAS]

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the invention discloses a method, a device, a system and related equipment for caching version management files, wherein the method comprises the following steps: aiming at the working areas to be updated in each working area, sending file information requests to be updated to a version management server; receiving a file information response to be updated returned by the version management server, wherein the file information response to be updated carries the file information to be updated aiming at the working area to be updated; and when the file to be added represented by the file information to be updated exists in the file cache region, establishing a hard link between the file name of the file to be added recorded in the working region to be updated and the file to be added stored in the file cache region. By adopting the scheme, the files stored in the file cache region can be shared by a plurality of working regions, the times of downloading the files from the version management server are reduced, namely the occupation of network bandwidth is reduced, and the disk space required by the stored files is also reduced.

Description

Version management file caching method, device and system and related equipment
Technical Field
The invention relates to the technical field of computer storage, in particular to a version management file caching method, device and system and related equipment.
Background
Version management is the process of recording, tracking, maintaining and controlling the series of changes generated by local improvement and modification of the same product or system to meet different requirements. Its main functions may include:
firstly, files are managed in a centralized mode, and a security authorization mechanism comprises the following steps: version management files required for version management are centrally stored on a server.
Second, file version management: when the version management file is submitted, a new version can be generated on the server, and any version can be acquired and edited at any time.
Third, a comparison of different versions of the source program is provided.
Version management is widely applied to the field of engineering research and development. In development, a plurality of research and development users can establish an independent work area (work area), download and synchronize files of specified versions from a version management system to a local work area, generate new versions after editing, and submit the new versions to a server.
In the prior art, files are downloaded from a version management server, edited and submitted for each work area. The files of each working area are independent from each other, and occupy independent space on a magnetic disk.
In the prior art, because files need to be downloaded from the version management server and stored on the local hard disk respectively for a plurality of working areas controlled by the version management system, the same version management file may be downloaded for a plurality of times and needs to be stored in a plurality of copies, which occupies a large amount of disk space and network bandwidth.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method, an apparatus, a system, and a related device for caching a version management file, so as to solve a problem in the prior art that a disk space and a network bandwidth in a version management file cache occupy high levels.
In a first aspect, an embodiment of the present invention provides a version management file caching method, which is applied to a version management client, where the version management client has a file cache region and work regions, and the method includes:
aiming at the working areas to be updated in each working area, sending file information requests to be updated to a version management server;
receiving a file information response to be updated returned by the version management server, wherein the file information response to be updated carries the file information to be updated aiming at the working area to be updated;
and when the file to be added represented by the file information to be updated exists in the file cache region, establishing a hard link between the file name of the file to be added recorded in the working region to be updated and the file to be added stored in the file cache region.
According to a specific implementation manner of the embodiment of the present invention, after receiving the response of the file information to be updated returned by the version management server, the method further includes:
when the file to be added represented by the file information to be updated does not exist in the file cache region, downloading the file to be added from the version management server and storing the file to be added in the file cache region;
and establishing a hard link between the file name of the file to be added recorded in the working area to be updated and the file to be added stored in the file cache area.
According to a specific implementation manner of the embodiment of the present invention, the downloading the file to be added from the version management server includes:
determining whether a file downloading request for downloading the file to be added is sent to the version management server aiming at other work areas to be updated;
if not, sending a file downloading request for downloading the file to be added to the version management server, and receiving the file to be added returned by the version management server according to the file downloading request;
and if the file to be added is sent, canceling the file downloading request for downloading the file to be added to the version management server, and receiving the file to be added returned by the version management server according to the sent file downloading request.
According to a specific implementation manner of the embodiment of the present invention, the information of the file to be updated includes: the file name of the file to be added and the server file path of the file to be added in the version management server are obtained;
after the receiving of the response of the file information to be updated returned by the version management server, the method further includes:
converting the server file path into a local cache file path according to a preset path conversion rule;
and determining whether the file to be added represented by the file information to be updated exists in the file cache region according to the converted local cache file path and the file name of the file to be added.
According to a specific implementation manner of the embodiment of the present invention, before sending a request for information of a file to be updated to a version management server for a workspace to be updated in each workspace, the method further includes:
acquiring an input command from a user;
and when the input command is a work area updating command, determining the work areas to be updated in the work areas based on the input command.
According to a specific implementation manner of the embodiment of the present invention, after receiving a response of the file information to be updated, which is returned by the version management server, the method further includes:
and when the information of the file to be updated indicates the file to be deleted, canceling the established hard link between the file name of the file to be deleted recorded in the working area to be updated and the file to be deleted stored in the file cache area.
According to a specific implementation manner of the embodiment of the present invention, after the establishing a hard link between the file name of the file to be added recorded in the working area to be updated and the file to be added stored in the file cache area, the method further includes:
generating working area state information of the working area to be updated based on the established hard link, wherein the working area state information represents a file name of the working area to be updated, and the hard link is established in the working area to be updated;
and sending the working area state information of the working area to be updated to the version management server.
According to a specific implementation manner of the embodiment of the present invention, the method further includes:
and deleting the files with the version numbers smaller than the preset version numbers from the file cache region at regular time.
In a second aspect, an embodiment of the present invention provides a version management file caching apparatus, which is applied to a version management client, where the version management client has a file cache region and work regions, and the apparatus includes:
the sending module is used for sending a file information request to be updated to the version management server aiming at the working areas to be updated in each working area;
the receiving module is used for receiving a file information response to be updated returned by the version management server, wherein the file information response to be updated carries the file information to be updated aiming at the working area to be updated;
and the establishing module is used for establishing a hard link between the file name of the file to be added recorded in the working area to be updated and the file to be added stored in the file cache area when the file to be added represented by the file information to be updated exists in the file cache area.
According to a specific implementation manner of the embodiment of the present invention, the method further includes:
the downloading module is used for downloading the file to be added from the version management server and storing the file to be added in the file cache region when the file to be added represented by the file information to be updated does not exist in the file cache region;
the establishing module is further configured to establish a hard link between the file name of the file to be added recorded in the working area to be updated and the file to be added stored in the file cache area after the file to be added is downloaded from the version management server by the downloading module and stored in the file cache area.
According to a specific implementation manner of the embodiment of the present invention, the downloading module is specifically configured to determine whether a file downloading request for downloading the file to be added is sent to the version management server for other work areas to be updated; if not, sending a file downloading request for downloading the file to be added to the version management server, and receiving the file to be added returned by the version management server according to the file downloading request; and if the file to be added is sent, canceling the file downloading request for downloading the file to be added to the version management server, and receiving the file to be added returned by the version management server according to the sent file downloading request.
According to a specific implementation manner of the embodiment of the present invention, the information of the file to be updated includes: the file name of the file to be added and the server file path of the file to be added in the version management server are obtained;
the device, still include:
the judging module is used for converting the server file path into a local cache file path according to a preset path conversion rule after the receiving module receives a file information response to be updated, which is returned by the version management server; and determining whether the file to be added represented by the file information to be updated exists in the file cache region according to the converted local cache file path and the file name of the file to be added.
According to a specific implementation manner of the embodiment of the present invention, the method further includes:
the command processing module is used for acquiring an input command from a user before the sending module sends a file information to be updated request to the version management server aiming at the working areas to be updated in each working area; and when the input command is a work area updating command, determining the work areas to be updated in the work areas based on the input command.
According to a specific implementation manner of the embodiment of the present invention, the method further includes:
and the canceling module is used for canceling the established hard link between the file name of the file to be deleted recorded in the working area to be updated and the file to be deleted stored in the file cache area when the file information to be updated indicates the file to be deleted after the receiving module receives the file information response to be updated returned by the version management server.
According to a specific implementation manner of the embodiment of the present invention, the method further includes:
the information generating module is used for generating working area state information of the working area to be updated based on the established hard link, wherein the working area state information represents that the file name of the hard link is created in the working area to be updated;
the sending module is further configured to send the working area state information of the working area to be updated to the version management server.
According to a specific implementation manner of the embodiment of the present invention, the method further includes:
and the deleting module is used for deleting the files with the version numbers smaller than the preset version numbers from the file cache region at regular time.
In a third aspect, an embodiment of the present invention provides a version management file caching system, including: the version management client and the version management server in any version management file caching device.
In a fourth aspect, an embodiment of the present invention provides an electronic device, where the electronic device includes: the device comprises a shell, a processor, a memory, a circuit board and a power circuit, wherein the circuit board is arranged in a space enclosed by the shell, and the processor and the memory are arranged on the circuit board; a power supply circuit for supplying power to each circuit or device of the electronic apparatus; the memory is used for storing executable program codes; the processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory for performing the method of any preceding claim.
In a fifth aspect, embodiments of the invention provide a computer readable storage medium storing one or more programs which are executable by one or more processors to implement a method as claimed in any preceding claim.
By adopting the version management file caching method provided by the embodiment of the invention, the file cache region is arranged at the version management client and used for storing the file downloaded from the version management server, and aiming at the working region to be updated, when the file to be added which needs to be updated exists in the file cache region, the hard link between the file name of the file to be added recorded in the working region to be updated and the file to be added stored in the file cache region is established, so that the subsequent use of the file to be added can be realized. Compared with the prior art, at this time, the file to be added does not need to be downloaded from the version management server, and only the hard link with the file to be added stored in the file cache region needs to be established, so that the files stored in the file cache region can be shared by a plurality of working regions, the number of times of downloading the files from the version management server is reduced, namely the occupation of network bandwidth is reduced, and the disk space required by the stored files is also reduced.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the embodiments or the prior art descriptions will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a flowchart of a version management file caching method according to an embodiment of the present invention;
FIG. 2 is a detailed flowchart of a version management file caching method according to an embodiment of the present invention;
FIG. 3-1 is a diagram illustrating the storage of a version management file prior to an update in an embodiment of the present invention;
FIG. 3-2 is a schematic diagram of version management file storage after a file is added in the embodiment of the present invention;
3-3 are schematic diagrams of version management file storage after a file is added in the embodiment of the present invention;
3-4 are diagrams illustrating the storage of a version management file after the file is deleted in an embodiment of the present invention;
FIG. 4 is a diagram illustrating the storage of a version management file after a hard link is removed according to an embodiment of the present invention;
fig. 5-1 is a schematic structural diagram of a version management file caching apparatus according to an embodiment of the present invention;
FIG. 5-2 is a schematic structural diagram of another version management file caching apparatus according to an embodiment of the present invention;
fig. 5-3 are schematic structural diagrams of another version management file caching apparatus according to an embodiment of the present invention;
fig. 5-4 are schematic structural diagrams of another version management file caching apparatus according to an embodiment of the present invention;
fig. 5-5 are schematic structural diagrams of another version management file caching apparatus according to an embodiment of the present invention;
fig. 5-6 are schematic structural diagrams of another version management file caching apparatus according to an embodiment of the present invention;
fig. 5-7 are schematic structural diagrams of another version management file caching apparatus according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a version management file caching system according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
Embodiments of the present invention will be described in detail below with reference to the accompanying drawings. It should be understood that the described embodiments are only some embodiments of the invention, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The embodiment of the invention provides a version management file caching method, which is applied to a version management client, wherein the version management client is provided with a file caching area and working areas, and as shown in figure 1, the method comprises the following steps:
and step 11, aiming at the working areas to be updated in each working area, sending a file information request to be updated to the version management server.
And step 12, receiving a file information response to be updated returned by the version management server, wherein the file information response to be updated carries the file information to be updated aiming at the working area to be updated.
And step 13, when the file to be added represented by the file information to be updated exists in the file cache region, establishing a hard link between the file name of the file to be added recorded in the working region to be updated and the file to be added stored in the file cache region.
By adopting the version management file caching method shown in fig. 1 provided by the embodiment of the invention, the version management client is provided with the file cache region for storing the file downloaded from the version management server, and for the working region to be updated, when the file to be added which needs to be updated exists in the file cache region, the hard link between the file name of the file to be added recorded in the working region to be updated and the file to be added stored in the file cache region is established, so that the subsequent use of the file to be added can be realized. Compared with the prior art, at this time, the file to be added does not need to be downloaded from the version management server, and only the hard link with the file to be added stored in the file cache region needs to be established, so that the files stored in the file cache region can be shared by a plurality of working regions, the number of times of downloading the files from the version management server is reduced, namely the occupation of network bandwidth is reduced, and the disk space required by the stored files is also reduced.
In the embodiment of the present invention, in order to implement version management, each version management file created by each user participating in research and development is stored in the version management server, each user may create a working area belonging to each user at the version management client in order to implement use of the version management file, for example, browsing, editing, and the like, and the version management client is further provided with a file cache area for storing a file downloaded from the version management server, and the user may record a file name of a file to be used in the working area created by the user and establish a hard link between the file name of the file and the file stored in the file cache area, so that the user may obtain the file from the file cache area based on the hard link when needing to use the file.
The following describes the above version management file cache provided in the embodiment of the present invention in detail by using a specific embodiment with reference to the accompanying drawings.
As shown in fig. 2, an embodiment of the present invention further provides a version management file caching method, which specifically includes the following steps:
and step 21, the version management client determines the working areas to be updated in each working area.
In the embodiment of the invention, after logging in the version management client, a user can input various commands to the version management client, thereby realizing various operations related to version management. After acquiring an input command from a user, the version management client identifies which command the input command belongs to, and when the input command is an update work area command, the version management client may determine a work area to be updated in each work area based on the input command, for example, determine that a work area created by the user who inputs the update work area command is the work area to be updated.
Step 22, the version management client sends a request for information of the file to be updated to the version management server for requesting to obtain corresponding information of the file to be updated, aiming at the determined work area to be updated.
The file information request to be updated may carry the working area identifier of the working area to be updated.
And step 23, after receiving the file information to be updated request, the version management server acquires the file information to be updated of the working area to be updated.
In the embodiment of the invention, the information of the file to be updated in each working area can be generated in advance based on actual needs and generation rules and stored in the version management server.
In this step, the version management server may obtain the carried work area identifier from the received file information request to be updated, and obtain the corresponding file information to be updated based on the work area identifier.
In the embodiment of the present invention, the updating of the file recorded in the working area may include adding the file and also may include deleting the file, and correspondingly, the information of the file to be updated may include a file name of the file to be added and also a file name of the file to be deleted.
And 24, the version management server returns a file information response to be updated to the version management client, wherein the file information response to be updated carries the file information to be updated aiming at the working area to be updated.
Step 25, the version management client determines whether the information of the file to be updated carried in the response of receiving the information of the file to be updated represents the file to be added or the file to be deleted, if the information of the file to be updated represents the file to be added, step 26 is executed, and if the information of the file to be updated represents the file to be added, step 27 is executed.
Step 26, the information of the file to be updated indicates the file to be deleted, indicates that the file name of the file to be deleted has been recorded in the working area to be updated, and also establishes a hard link between the recorded file name of the file to be deleted and the file to be deleted stored in the file cache area.
Step 27, the information of the file to be updated indicates the file to be added, which indicates that the file to be added needs to be added for the working area to be updated, so in this step, the version management client determines whether the file to be added indicated by the information of the file to be updated exists in the file cache area, if not, step 28 is executed, and if so, step 29 is executed.
In this step, the version management client may query whether the file to be added exists in the file cache region based on the file name of the file to be added included in the file information to be updated.
Further, when the information of the file to be updated further includes a server file path of the file to be added in the version management server, the server file path may be converted into a local cache file path according to a preset path conversion rule, and whether the file to be added exists in the file cache region is determined according to the local cache file path obtained through conversion and the file name of the file to be added.
And step 28, downloading the file to be added from the version management server by the version management client, and storing the file in a file cache region.
In the embodiment of the invention, different users may log in the version management client at the same time and update the respective created working areas, so that the same file to be added may be required to be added to different working areas, and if the file to be added does not exist in the file cache area at the moment, the same file to be added is required to be downloaded.
In order to avoid repeated downloading of the same file to be added aiming at the previous situation, in the step, whether a file downloading request for downloading the file to be added is sent to the version management server aiming at other working areas to be updated or not can be determined;
if not, sending a file downloading request for downloading the file to be added to the version management server, and receiving the file to be added returned by the version management server according to the file downloading request;
and if the file to be added is sent, canceling the file downloading request for downloading the file to be added to the version management server, and receiving the file to be added returned by the version management server according to the sent file downloading request.
In the embodiment of the invention, when different users update the respective created working areas, different files to be added may need to be added to the different working areas, and if the different files to be added do not exist in the file cache area, the files need to be downloaded from the version management server. In order to improve the downloading efficiency for such a situation, simultaneous and parallel downloading for multiple users or multiple work areas, that is, simultaneous downloading with multiple threads, may be supported in this step.
Step 29, establishing a Hard Link (Hard Link) between the file name of the file to be added recorded in the working area to be updated and the file to be added stored in the file cache area.
Through the established hard link, the file itself does not need to be stored in the working area, and when the file needs to be used, the file pointed by the file name can be acquired from the file cache area based on the hard link, so that the storage of multiple copies of the same file is avoided, and the occupation of the disk space is reduced.
By adopting the version management file caching method shown in fig. 2 provided by the embodiment of the invention, the files stored in the file caching area can be shared by a plurality of working areas, and the times of downloading the files from the version management server are reduced, namely the occupation of network bandwidth is reduced, and the disk space required by the stored files is also reduced.
In addition, the method can support simultaneous parallel downloading aiming at a plurality of users or a plurality of working areas, improve the downloading efficiency, avoid repeated downloading of the same file, further reduce the times of downloading the file and reduce the occupation of network bandwidth.
In the embodiment of the present invention, after the hard link between the file name of the file to be added recorded in the working area to be updated and the file to be added stored in the file cache area is established, and after the hard link between the file name of the file to be deleted recorded in the established working area to be updated and the file to be deleted stored in the file cache area is cancelled according to the file to be deleted, the following steps may also be performed:
generating working area state information of the working area to be updated based on the established hard link or the cancelled hard link, wherein the working area state information represents the file name of the hard link established in the working area to be updated; and sending the working area state information of the working area to be updated to the version management server so that the version management server can update the stored working area state information of the working area to be updated.
In the embodiment of the invention, for the version management file stored in the file cache region, the file with the version number smaller than the preset version number can be deleted from the file cache region at regular time, so that the unused file is cleaned, and the occupation of the disk space is further reduced.
Next, a description is given, by way of example, of the version management file caching method provided in the embodiment of the present invention.
As shown in fig. 3-1, a schematic diagram of version management file storage before update is performed on a work area, where a file a #5, a file B #2, and a file B #3 are stored in a file cache area of a version management client, an established work area includes a work area 1 and a work area 2, a file with a hard link established in the work area 1 includes the file B #3, and a file with a hard link established in the work area 2 includes the file a #5 and the file B #2.
When the file a #5 needs to be added for the work area 1, as shown in fig. 3-2, since the file a #5 already exists in the file cache, the file a #5 does not need to be downloaded from the version management server at this time, as long as a hard link is established between the file name of the file a #5 in the work area 1 and the file a #5 stored in the file cache, so that the file name of the file a #5 in the work area 1 points to the file a #5 stored in the file cache.
When it is necessary to add the file B #4 for the working area 1, as shown in fig. 3-3, since the file B #4 does not exist in the file cache area, it is necessary to download the key B #4 from the version management server at this time, and then establish a hard link between the filename of the file B #4 in the working area 1 and the file B #4 stored in the file cache area so that the filename of the file B #4 in the working area 1 points to the file B #4 stored in the file cache area.
When the file a #5 needs to be deleted with respect to the work area 2, the established hard link between the file name of the file a #5 in the work area 2 and the file a #5 stored in the file cache area is revoked as shown in fig. 3 to 4.
In the embodiment of the present invention, when a user needs to edit a file added in a working area, for example, for the file a #5 in the working area 1 in fig. 3-2, the file may be copied from the file cache area, a new file belonging to the user is created, and the file is edited, and meanwhile, as shown in fig. 4, the hard link between the file name of the file a #5 and the file a #5 in the file cache area may be released, so that the file name of the file a #5 in the working area 1 is in a check-out state (check-out), and the file name of the file a #5 refers to the file a #5 stored in the file cache area but refers to a read-write file belonging to the current user.
Based on the same inventive concept, according to the version management file caching method provided in the above embodiment of the present invention, correspondingly, another embodiment of the present invention further provides a version management file caching apparatus applied to a version management client, where the version management client has a file caching area and each working area, and as shown in fig. 5-1, the apparatus includes:
a sending module 51, configured to send a file information request to be updated to the version management server for a to-be-updated working area in each working area;
a receiving module 52, configured to receive a file information response to be updated returned by the version management server, where the file information response to be updated carries file information to be updated for the working area to be updated;
the establishing module 53 is configured to, when a file to be added indicated by the file information to be updated exists in the file cache region, establish a hard link between the file name of the file to be added recorded in the working region to be updated and the file to be added stored in the file cache region.
Further, as shown in fig. 5-2, the apparatus further comprises:
a downloading module 54, configured to, when the file to be added indicated by the file to be updated information does not exist in the file cache region, download the file to be added from the version management server, and store the file in the file cache region;
the establishing module 53 is further configured to establish a hard link between the file name of the file to be added recorded in the working area to be updated and the file to be added stored in the file cache area after the downloading module downloads the file to be added from the version management server and stores the file in the file cache area.
Further, the downloading module 54 is specifically configured to determine whether a file downloading request for downloading the file to be added is sent to the version management server for other work areas to be updated; if not, sending a file downloading request for downloading the file to be added to the version management server, and receiving the file to be added returned by the version management server according to the file downloading request; and if the file to be added is sent, canceling the file downloading request for downloading the file to be added to the version management server, and receiving the file to be added returned by the version management server according to the sent file downloading request.
Further, the file information to be updated includes: the file name of the file to be added and the server file path of the file to be added in the version management server are obtained;
as shown in fig. 5-3, the apparatus further comprises:
the judging module 55 is configured to, after the receiving module receives a file information response to be updated returned by the version management server, convert the server file path into a local cache file path according to a preset path conversion rule; and determining whether the file to be added represented by the file information to be updated exists in the file cache region according to the converted local cache file path and the file name of the file to be added.
As shown in fig. 5-4, the apparatus further comprises:
a command processing module 56, configured to obtain an input command from a user before the sending module sends a request for information of a file to be updated to the version management server for a working area to be updated in each working area; and when the input command is a work area updating command, determining the work areas to be updated in the work areas based on the input command.
As shown in fig. 5-5, the apparatus further comprises:
and a revoking module 57, configured to revoke the established hard link between the file name of the file to be deleted recorded in the working area to be updated and the file to be deleted stored in the file cache area when the file information to be updated indicates the file to be deleted after the receiving module receives the file information response to be updated returned by the version management server.
As shown in fig. 5-6, the apparatus further comprises:
an information generating module 58, configured to generate workspace status information of the workspace to be updated based on the established hard link, where the workspace status information indicates a file name of the workspace to be updated where the hard link has been created;
the sending module 51 is further configured to send the working area state information of the working area to be updated to the version management server.
As shown in fig. 5-7, the apparatus further comprises:
and the deleting module 59 is configured to delete the file with the version number smaller than the preset version number from the file cache area at regular time.
Based on the same inventive concept, according to the version management file caching method provided in the above embodiment of the present invention, correspondingly, another embodiment of the present invention further provides a version management file caching system, as shown in fig. 6, the system includes: the version management client 61 and the version management server 62 in the version management file caching method and the version management file caching device provided by the embodiment of the invention.
For the functions of the version management client 61 and the version management server 62 and the flow of the executed steps, reference may be made to the description of any of the above embodiments of the present invention, which is not repeated herein.
The embodiment of the invention also provides electronic equipment, and the electronic equipment comprises the device in any one of the embodiments.
Fig. 7 is a schematic structural diagram of an embodiment of an electronic device of the present invention, which may implement a process of any of the above embodiments of the present invention, and as shown in fig. 7, the electronic device may include: the device comprises a shell 701, a processor 702, a memory 703, a circuit board 704 and a power circuit 705, wherein the circuit board 704 is arranged inside a space enclosed by the shell 701, and the processor 702 and the memory 703 are arranged on the circuit board 704; a power supply circuit 705 for supplying power to each circuit or device of the electronic apparatus; the memory 703 is used to store executable program code; the processor 702 runs a program corresponding to the executable program code by reading the executable program code stored in the memory 703, for executing the method according to any of the foregoing embodiments.
For the specific execution process of the above steps by the processor 702 and the further steps executed by the processor 702 by running the executable program code, reference may be made to the description of any of the above embodiments of the present invention, which is not described herein again.
The electronic device exists in a variety of forms, including but not limited to:
(1) A mobile communication device: such devices are characterized by mobile communications capabilities and are primarily targeted at providing voice, data communications. Such terminals include: smart phones (e.g., iphones), multimedia phones, functional phones, and low-end phones, among others.
(2) Ultra mobile personal computer device: the equipment belongs to the category of personal computers, has calculation and processing functions and generally has mobile internet access characteristics. Such terminals include: PDA, MID, and UMPC devices, etc., such as ipads.
(3) A portable entertainment device: such devices may display and play multimedia content. This type of device comprises: audio, video players (e.g., ipods), handheld game consoles, electronic books, and smart toys and portable car navigation devices.
(4) A server: the device for providing the computing service comprises a processor, a hard disk, a memory, a system bus and the like, and the server is similar to a general computer architecture, but has higher requirements on processing capacity, stability, reliability, safety, expandability, manageability and the like because high-reliability service needs to be provided.
(5) And other electronic equipment with data interaction function.
Based on the same inventive concept, according to any one of the methods provided by the above embodiments of the present invention, correspondingly, another embodiment of the present invention further provides a computer-readable storage medium having one or more programs, which are executable by one or more processors to implement the method provided by any one of the embodiments of the present invention.
Embodiments of the present invention also provide an application program, which is executed to implement the method provided in any of the embodiments of the present invention.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, as for the apparatus, the electronic device, the computer-readable storage medium, and the application program embodiment, since they are substantially similar to the method embodiment, the description is simple, and the relevant points can be referred to the partial description of the method embodiment.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. The term "comprising", without further limitation, means that the element so defined is not excluded from the group consisting of additional identical elements in the process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments.
In particular, for the apparatus embodiment, since it is substantially similar to the method embodiment, the description is relatively simple, and reference may be made to the partial description of the method embodiment for relevant points.
For convenience of description, the above devices are described as being respectively described in terms of functional division into various units/modules. Of course, the functionality of the units/modules may be implemented in one or more software and/or hardware implementations of the invention.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.
The above description is only for the specific embodiment of the present invention, but the scope of the present invention is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the present invention are included in the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (15)

1. A version management file caching method is characterized by being applied to a version management client, wherein the version management client is used for logging in different users and operating aiming at respective created working areas, the version management client is provided with a file caching area and at least two working areas, and the number of the working areas is at least two, and the method comprises the following steps:
aiming at the working areas to be updated in each working area, sending file information requests to be updated to a version management server;
receiving a file information response to be updated returned by the version management server, wherein the file information response to be updated carries the file information to be updated aiming at the working area to be updated;
when the file to be added represented by the file information to be updated exists in the file cache region, establishing a hard link between the file name of the file to be added recorded in the working region to be updated and the file to be added stored in the file cache region;
after receiving the response of the file information to be updated returned by the version management server, the method further comprises:
when the file to be added represented by the file information to be updated does not exist in the file cache region, downloading the file to be added from the version management server and storing the file to be added in the file cache region;
establishing a hard link between the file name of the file to be added recorded in the working area to be updated and the file to be added stored in the file cache area;
wherein the downloading of the file to be added from the version management server includes:
determining whether a file downloading request for downloading the file to be added is sent to the version management server aiming at other work areas to be updated;
if not, sending a file downloading request for downloading the file to be added to the version management server, and receiving the file to be added returned by the version management server according to the file downloading request;
and if the file to be added is sent, canceling the file downloading request for downloading the file to be added to the version management server, and receiving the file to be added returned by the version management server according to the sent file downloading request.
2. The method according to claim 1, wherein the file information to be updated comprises: the file name of the file to be added and the server file path of the file to be added in the version management server;
after the receiving of the response of the file information to be updated returned by the version management server, the method further includes:
converting the server file path into a local cache file path according to a preset path conversion rule;
and determining whether the file to be added represented by the file information to be updated exists in the file cache region according to the converted local cache file path and the file name of the file to be added.
3. The method according to claim 1, before sending a request for information of a file to be updated to a version management server for a workspace to be updated of the workspaces, further comprising:
acquiring an input command from a user;
and when the input command is a work area updating command, determining the work areas to be updated in the work areas based on the input command.
4. The method according to claim 1, after said receiving a response of file information to be updated returned by said version management server, further comprising:
and when the information of the file to be updated indicates the file to be deleted, canceling the established hard link between the file name of the file to be deleted recorded in the working area to be updated and the file to be deleted stored in the file cache area.
5. The method according to claim 1, further comprising, after the establishing a hard link between the file name of the file to be added recorded in the workspace to be updated and the file to be added stored in the file cache, the method further comprising:
generating working area state information of the working area to be updated based on the established hard link, wherein the working area state information represents a file name of the working area to be updated, and the hard link is established in the working area to be updated;
and sending the working area state information of the working area to be updated to the version management server.
6. The method of claim 1, further comprising:
and deleting the files with the version numbers smaller than the preset version numbers from the file cache region at regular time.
7. A version management file caching device is applied to a version management client, the version management client is used for logging in different users and operating aiming at respective created working areas, the version management client is provided with a file caching area and at least two working areas, and the device comprises:
the sending module is used for sending a file information request to be updated to the version management server aiming at the working areas to be updated in each working area;
the receiving module is used for receiving a file information response to be updated returned by the version management server, wherein the file information response to be updated carries the file information to be updated aiming at the working area to be updated;
the establishing module is used for establishing a hard link between the file name of the file to be added recorded in the working area to be updated and the file to be added stored in the file cache area when the file to be added represented by the file information to be updated exists in the file cache area;
wherein, the device still includes:
the downloading module is used for downloading the file to be added from the version management server and storing the file to be added in the file cache region when the file to be added represented by the file information to be updated does not exist in the file cache region;
the establishing module is further configured to establish a hard link between the file name of the file to be added recorded in the working area to be updated and the file to be added stored in the file cache area after the downloading module downloads the file to be added from the version management server and stores the file in the file cache area;
the downloading module is specifically configured to determine whether a file downloading request for downloading the file to be added is sent to the version management server for other work areas to be updated; if the file to be added is not sent, sending a file downloading request for downloading the file to be added to the version management server, and receiving the file to be added returned by the version management server according to the file downloading request; and if the file to be added is sent, canceling sending a file downloading request for downloading the file to be added to the version management server, and receiving the file to be added returned by the version management server according to the sent file downloading request.
8. The apparatus of claim 7, wherein the file information to be updated comprises: the file name of the file to be added and the server file path of the file to be added in the version management server;
the device, still include:
the judging module is used for converting the server file path into a local cache file path according to a preset path conversion rule after the receiving module receives the file information response to be updated returned by the version management server; and determining whether the file to be added represented by the file information to be updated exists in the file cache region according to the converted local cache file path and the file name of the file to be added.
9. The apparatus of claim 7, further comprising:
the command processing module is used for acquiring an input command from a user before the sending module sends a file information to be updated request to the version management server aiming at the working areas to be updated in each working area; and when the input command is a work area updating command, determining the work areas to be updated in the work areas based on the input command.
10. The apparatus of claim 7, further comprising:
and the canceling module is used for canceling the established hard link between the file name of the file to be deleted recorded in the working area to be updated and the file to be deleted stored in the file cache area when the file information to be updated indicates the file to be deleted after the receiving module receives the file information response to be updated returned by the version management server.
11. The apparatus of claim 7, further comprising:
the information generation module is used for generating working area state information of the working area to be updated based on the established hard link, wherein the working area state information represents the file name of the hard link established in the working area to be updated;
the sending module is further configured to send the work area state information of the work area to be updated to the version management server.
12. The apparatus of claim 7, further comprising:
and the deleting module is used for deleting the files with the version numbers smaller than the preset version numbers from the file cache region at regular time.
13. A version management file caching system, comprising: the version management client and the version management server of any one of claims 7-12.
14. An electronic device, characterized in that the electronic device comprises: the device comprises a shell, a processor, a memory, a circuit board and a power circuit, wherein the circuit board is arranged in a space enclosed by the shell, and the processor and the memory are arranged on the circuit board; a power supply circuit for supplying power to each circuit or device of the electronic apparatus; the memory is used for storing executable program codes; the processor executes a program corresponding to the executable program code by reading the executable program code stored in the memory for performing the method of any of the preceding claims 1-6.
15. A computer readable storage medium, characterized in that the computer readable storage medium stores one or more programs which are executable by one or more processors to implement the method of any of the preceding claims 1-6.
CN202011415921.6A 2020-12-04 2020-12-04 Version management file caching method, device and system and related equipment Active CN112612413B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011415921.6A CN112612413B (en) 2020-12-04 2020-12-04 Version management file caching method, device and system and related equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011415921.6A CN112612413B (en) 2020-12-04 2020-12-04 Version management file caching method, device and system and related equipment

Publications (2)

Publication Number Publication Date
CN112612413A CN112612413A (en) 2021-04-06
CN112612413B true CN112612413B (en) 2023-02-21

Family

ID=75229048

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011415921.6A Active CN112612413B (en) 2020-12-04 2020-12-04 Version management file caching method, device and system and related equipment

Country Status (1)

Country Link
CN (1) CN112612413B (en)

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101505300B (en) * 2009-03-13 2013-05-22 张昊 System for data synchronization between server and terminal on the basis of Linux and synchronization method thereof
CN101882156B (en) * 2010-06-13 2012-07-25 用友软件股份有限公司 Controllable cache method and system of Silverlight client side
CN104980494B (en) * 2015-05-14 2018-07-13 大连理工大学 A kind of cloud storage download shared platform and method with local cache
CN105468686A (en) * 2015-11-17 2016-04-06 北京奇虎科技有限公司 Method and device for reducing redundant data
CN106066686B (en) * 2016-05-31 2019-02-05 Oppo广东移动通信有限公司 A kind of information processing method and terminal device
CN108804321A (en) * 2018-05-25 2018-11-13 武汉华工正源光子技术有限公司 A kind of automatic test software update system and method
CN111831475A (en) * 2019-05-31 2020-10-27 北京嘀嘀无限科技发展有限公司 Data backup method and device, node equipment and readable storage medium

Also Published As

Publication number Publication date
CN112612413A (en) 2021-04-06

Similar Documents

Publication Publication Date Title
KR101643022B1 (en) Catalog-based software component management
CN110765744B (en) Multi-user collaborative document editing method and system
KR101503209B1 (en) Method and system for dynamically creating and servicing master-slave pairs within and across switch fabrics of a portable computing device
CN109408751B (en) Data processing method, terminal, server and storage medium
US8880651B2 (en) Method and system for efficient download of data package
JP2010134630A (en) Information processing apparatus, divided management server, information processing method, divided management method, program and information processing system
CN111258958A (en) Data acquisition method, data providing method and device
CN104396219A (en) User-specific roaming settings
CN109522043B (en) Method and device for managing configuration data and storage medium
CN102255866A (en) Method and device for downloading data
WO2022192559A1 (en) Technologies for managing collaborative and multiplatform media content playlists
WO2017083157A1 (en) Creating and modifying applications from a mobile device
CN110652728A (en) Game resource management method and device, electronic equipment and storage medium
WO2024120355A1 (en) Association information display method and apparatus, device, storage medium, and program product
CN112612413B (en) Version management file caching method, device and system and related equipment
CN111258959A (en) Data acquisition method, data providing method and device
CN112691382B (en) Resource processing method, device and computer readable storage medium
CN111880896B (en) Method and device for rapidly restoring container and running state data
CN112036133B (en) File storage method and device, electronic equipment and storage medium
CN112559568A (en) Virtual article determination method and device and computer readable storage medium
CN104618421A (en) Method and device for distributing storage resources
JP7293544B2 (en) Q&A system update processing method and device
CN113996066A (en) Game application updating method and device, storage medium and computer equipment
CN112733892B (en) Data interaction method and device for model training
CN115878385A (en) Data copying method and device, electronic equipment and storage medium

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
GR01 Patent grant
GR01 Patent grant