TW201828100A - File reading and writing method, apparatus and system avoiding conflicts between contents submitted by multiple users when operating the same file - Google Patents
File reading and writing method, apparatus and system avoiding conflicts between contents submitted by multiple users when operating the same file Download PDFInfo
- Publication number
- TW201828100A TW201828100A TW106101923A TW106101923A TW201828100A TW 201828100 A TW201828100 A TW 201828100A TW 106101923 A TW106101923 A TW 106101923A TW 106101923 A TW106101923 A TW 106101923A TW 201828100 A TW201828100 A TW 201828100A
- Authority
- TW
- Taiwan
- Prior art keywords
- file
- identification information
- server
- locked
- user identification
- Prior art date
Links
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
Description
本申請案涉及WebIDE(WebIDE是一類讓使用者可以在頁面上編輯代碼的網頁)開發技術領域,尤其涉及一種檔案讀寫方法、裝置和系統。 This application relates to the development field of WebIDE (WebIDE is a kind of webpage for users to edit code on a page), and particularly relates to a file reading and writing method, device and system.
GIT(分散式版本控制系統)和SVN(Subversion,開放原始程式碼的版本控制系統)是開發過程中常用的檔案版本控制工具,常用於團隊開發任務中,但是這兩種工具對系統、環境以及命令熟練度的要求比較高,造成開發人員在使用時開發效率低。 GIT (Distributed Version Control System) and SVN (Subversion, Open Source Code Version Control System) are commonly used file version control tools in the development process, which are often used in team development tasks, but these two tools are for systems, environments, and Command proficiency requirements are relatively high, resulting in developers developing low efficiency when using.
目前,已經有部分WebIDE開發環境(例如國內的Coding.net)讓開發人員可以在瀏覽器中編寫並提交代碼檔案,以解決操作成本高帶來的效率低的問題。例如,一些多人協同開發的系統採用的是用戶端快取的方法,即多個開發人員分別在自己的用戶端快取中記錄對同一個檔案的操作,然後將自己的快取操作提交到伺服器,伺服器獲取各個用戶端的快取操作後將其合併為一個完整的操作,再對檔案進行更新。然而,該方案存在以下問題: (1)開發人員對檔案的讀寫許可權並沒有妥善被控制,由於可以在多個瀏覽器中打開同一個檔案進行編寫,或者多個開發人員打開同一個檔案進行編寫,因此在同一時間對於同一個檔案而言可能會存在被不同的開發人員打開並寫入不同的內容的情況,導致在多個不同的開發人員編寫後提交檔案時檔案的內容存在衝突,或者是檔案的內容出現相互覆蓋的情況,嚴重限制了多個開發人員在多人協作開發中的發揮;(2)用戶端需要有快取,且需要有足夠的許可權操作快取系統,例如ios系統對使用者許可權做嚴格控制,或者使用者手動關閉了許可權,開發人員便會無法進行操作;(3)檔案修改的內容都保存在用戶端,如果開發人員修改了資料但還沒來得及提交到伺服器,此時使用者切換用戶端就會造成資料丟失;(4)所有的運算元據都儲存在用戶端快取,開發人員如果有許可權即可隨意修改快取資料,安全性差。 At present, some WebIDE development environments (such as Coding.net in China) have enabled developers to write and submit code files in the browser to solve the problem of low efficiency caused by high operating costs. For example, some multi-person collaborative development systems use a client-side cache method, in which multiple developers record the operation of the same file in their own client-side cache, and then submit their own cache operations to The server, the server obtains the cache operations of each client and merges them into a complete operation, and then updates the file. However, the solution has the following problems: (1) The developer's read and write permission to the file is not properly controlled, because the same file can be opened in multiple browsers, or multiple developers open the same file. Write, so at the same time for the same file, there may be cases where different developers open and write different content, resulting in conflicts in the contents of the file when submitting files after writing by different developers. Or the content of the files overlaps each other, which seriously limits the development of multiple developers in multi-person collaborative development; (2) the client needs to have a cache, and needs sufficient permission to operate the cache system, for example The ios system strictly controls the user's permission, or the user manually closes the permission, and the developer will not be able to operate; (3) the contents of the file modification are saved on the user side, if the developer has modified the information but has not yet If you have time to submit to the server, the user will lose data when switching users; (4) all the operation data are Stored in the client-side cache, developers can modify the cache data at will if they have permission, and the security is poor.
本申請案旨在至少在一定程度上解決相關技術中的技術問題之一。 The present application is intended to solve at least one of the technical problems in the related art to some extent.
為此,本申請案的第一個目的在於提出一種檔案讀寫方法,該檔案讀寫方法。 To this end, the first object of the present application is to propose a file reading and writing method, the file reading and writing method.
本申請案的第二個目的在於提出一種檔案讀寫裝置。 A second object of the present application is to provide a file reading and writing device.
本申請案的第三個目的在於提出一種檔案讀寫系統。 The third object of the present application is to propose a file reading and writing system.
為達上述目的,本申請案第一方面實施例提出了一種檔案讀寫方法,包括以下步驟:接收訪問請求,並根據所述訪問請求獲取檔案標識資訊和第一使用者標識資訊;在快取伺服器中查詢所述檔案標識資訊對應的鎖定檔案,如果未查詢到所述檔案標識資訊對應的鎖定檔案,則從檔案伺服器獲取所述檔案標識資訊對應的第一原始檔案;根據所述第一使用者標識資訊和所述第一原始檔案生成鎖定檔案,並將所述鎖定檔案提交至所述快取伺服器;以及接收針對所述第一原始檔案的編輯操作,並將編輯後的第一原始檔案提交至所述快取伺服器,以使所述快取伺服器根據所述編輯後的第一原始檔案對所述鎖定檔案進行更新。 To achieve the above objective, the first aspect of the present application provides a file reading and writing method, including the steps of: receiving an access request, and obtaining file identification information and first user identification information according to the access request; The server searches for the lock file corresponding to the file identifier information, and if the lock file corresponding to the file identifier information is not queried, the first original file corresponding to the file identifier information is obtained from the file server; a user identification information and the first original file generating a lock file, and submitting the lock file to the cache server; and receiving an edit operation for the first original file, and the edited An original file is submitted to the cache server, so that the cache server updates the lock file according to the edited first original file.
本申請案實施例的檔案讀寫方法,透過快取伺服器實現了適用於WebIDE系統的檔案鎖定機制,利用快取伺服器作為檔案伺服器和WebIDE伺服器之間緩衝,使用快取機制實現檔案的鎖定,從而使得使用者在對檔案操作的過程中擁有檔案的獨享操作權,避免了多個使用者對同一個檔案操作時提交的內容互相衝突,使得WebIDE系統能夠在多個協作開發過程中發揮更大的作用。此外,使用快取機制實現檔案的鎖定,比每次都修改檔案伺服器的資料庫相比成本更低,且快取機制能夠更加靈活地處理多種檔案、產生同一個檔案的不同副本等等,給使用者更好的體驗。 The file reading and writing method of the embodiment of the present application implements a file locking mechanism suitable for the WebIDE system through the cache server, and uses the cache server as a buffer between the file server and the WebIDE server, and uses the cache mechanism to implement the file. Locking, so that the user has the exclusive operation right of the file during the operation of the file, avoiding conflicts between the content submitted by multiple users when operating the same file, so that the WebIDE system can be in multiple collaborative development processes. Play a bigger role. In addition, using the cache mechanism to lock the file is cheaper than modifying the file server's database each time, and the cache mechanism can handle multiple files more flexibly, generate different copies of the same file, and so on. Give users a better experience.
為達上述目的,本申請案第二方面實施例提出了一種 檔案讀寫裝置,包括:第一接收模組,用於接收訪問請求;第一獲取模組,使用者根據所述訪問請求獲取檔案標識資訊和第一使用者標識資訊;查詢模組,用於在快取伺服器中查詢所述檔案標識資訊對應的鎖定檔案;第二獲取模組,用於當所述查詢模組未查詢到所述檔案標識資訊對應的鎖定檔案時,從檔案伺服器獲取所述檔案標識資訊對應的第一原始檔案;生成模組,用於根據所述第一使用者標識資訊和所述第一原始檔案生成鎖定檔案;提交模組,用於將所述鎖定檔案提交至所述快取伺服器;以及第二接收模組,用於接收針對所述第一原始檔案的編輯操作,其中,所述提交模組將編輯後的第一原始檔案提交至所述快取伺服器,以使所述快取伺服器根據所述編輯後的第一原始檔案對所述鎖定檔案進行更新。 In order to achieve the above objective, the second aspect of the present application provides a file reading and writing device, comprising: a first receiving module, configured to receive an access request; and a first obtaining module, the user acquiring the file according to the access request The identification module and the first user identification information; the query module is configured to query the cache file for the lock file corresponding to the file identifier information; and the second acquisition module is configured to: when the query module is not queried The first original file corresponding to the file identification information is obtained from the file server, and the generating module is configured to use the first user identification information and the first original file. Generating a lock file; submitting a module for submitting the lock file to the cache server; and a second receiving module for receiving an edit operation for the first original file, wherein the submitting The module submits the edited first original file to the cache server, so that the cache server enters the locked file according to the edited first original file. Line updates.
本申請案實施例的檔案讀寫裝置,透過快取伺服器實現了適用於WebIDE系統的檔案鎖定機制,利用快取伺服器作為檔案伺服器和WebIDE伺服器之間緩衝,使用快取機制實現檔案的鎖定,從而使得使用者在對檔案操作的過程中擁有檔案的獨享操作權,避免了多個使用者對同一個檔案操作時提交的內容互相衝突,使得WebIDE系統能夠在多個協作開發過程中發揮更大的作用。此外,使用快取機制實現檔案的鎖定,比每次都修改檔案伺服器的資料庫相比成本更低,且快取機制能夠更加靈活地處理多種檔案、產生同一個檔案的不同副本等等,給使用者更好的體驗。 The file reading and writing device of the embodiment of the present application implements a file locking mechanism suitable for the WebIDE system through the cache server, and uses the cache server as a buffer between the file server and the WebIDE server, and uses the cache mechanism to implement the file. Locking, so that the user has the exclusive operation right of the file during the operation of the file, avoiding conflicts between the content submitted by multiple users when operating the same file, so that the WebIDE system can be in multiple collaborative development processes. Play a bigger role. In addition, using the cache mechanism to lock the file is cheaper than modifying the file server's database each time, and the cache mechanism can handle multiple files more flexibly, generate different copies of the same file, and so on. Give users a better experience.
為達上述目的,本申請案協力廠商面實施例提出了一種檔案讀寫系統,包括:WebIDE伺服器、快取伺服器和檔案伺服器,其中,所述WebIDE伺服器用於接收訪問請求,並根據所述訪問請求獲取檔案標識資訊和第一使用者標識資訊,以及在快取伺服器中查詢所述檔案標識資訊對應的鎖定檔案,如果未查詢到所述檔案標識資訊對應的鎖定檔案,則從檔案伺服器獲取所述檔案標識資訊對應的第一原始檔案,並根據所述第一使用者標識資訊和所述第一原始檔案生成鎖定檔案,並將所述鎖定檔案提交至所述快取伺服器,以及接收針對所述第一原始檔案的編輯操作,並將編輯後的第一原始檔案提交至所述快取伺服器;以及所述快取伺服器用於儲存所述鎖定檔案,並根據所述編輯後的第一原始檔案對所述鎖定檔案進行更新。 In order to achieve the above object, the collaborative manufacturer embodiment of the present application proposes a file reading and writing system, including: a WebIDE server, a cache server, and a file server, wherein the WebIDE server is configured to receive an access request, and Acquiring the file identification information and the first user identification information according to the access request, and querying the lock file corresponding to the file identification information in the cache server, if the lock file corresponding to the file identification information is not queried, Obtaining, by the file server, the first original file corresponding to the file identification information, and generating a lock file according to the first user identification information and the first original file, and submitting the locked file to the cache a server, and receiving an editing operation for the first original file, and submitting the edited first original file to the cache server; and the cache server is configured to store the lock file, and Updating the locked file according to the edited first original file.
本申請案實施例的檔案讀寫系統,透過快取伺服器實現了適用於WebIDE系統的檔案鎖定機制,利用快取伺服器作為檔案伺服器和WebIDE伺服器之間緩衝,使用快取機制實現檔案的鎖定,從而使得使用者在對檔案操作的過程中擁有檔案的獨享操作權,避免了多個使用者對同一個檔案操作時提交的內容互相衝突,使得WebIDE系統能夠在多個協作開發過程中發揮更大的作用。此外,使用快取機制實現檔案的鎖定,比每次都修改檔案伺服器的資料庫相比成本更低,且快取機制能夠更加靈活地處理多種檔案、產生同一個檔案的不同副本等等,給使用者更好的體驗。 The file reading and writing system of the embodiment of the present application implements a file locking mechanism suitable for the WebIDE system through a cache server, and uses a cache server as a buffer between the file server and the WebIDE server, and uses a cache mechanism to implement the file. Locking, so that the user has the exclusive operation right of the file during the operation of the file, avoiding conflicts between the content submitted by multiple users when operating the same file, so that the WebIDE system can be in multiple collaborative development processes. Play a bigger role. In addition, using the cache mechanism to lock the file is cheaper than modifying the file server's database each time, and the cache mechanism can handle multiple files more flexibly, generate different copies of the same file, and so on. Give users a better experience.
本申請案附加的方面和優點將在下面的描述中部分給出,部分將從下面的描述中變得明顯,或透過本申請案的實踐瞭解到。 The additional aspects and advantages of the present invention will be set forth in part in the description which follows.
1‧‧‧WebIDE伺服器 1‧‧‧WebIDE Server
2‧‧‧快取伺服器 2‧‧‧Cache Server
3‧‧‧檔案伺服器 3‧‧‧File Server
101‧‧‧第一接收模組 101‧‧‧First Receiver Module
102‧‧‧第一獲取模組 102‧‧‧First acquisition module
103‧‧‧查詢模組 103‧‧‧Query Module
104‧‧‧第二獲取模組 104‧‧‧Second acquisition module
105‧‧‧生成模組 105‧‧‧Generation module
106‧‧‧提交模組 106‧‧‧Submit module
107‧‧‧第二接收模組 107‧‧‧second receiving module
108‧‧‧第一判斷模組 108‧‧‧First Judgment Module
109‧‧‧第一提示模組 109‧‧‧First reminder module
110‧‧‧第二判斷模組 110‧‧‧Second judgment module
111‧‧‧更新模組 111‧‧‧Update Module
112‧‧‧第三接收模組 112‧‧‧ third receiving module
113‧‧‧解鎖模組 113‧‧‧Unlocking module
114‧‧‧第四接收模組 114‧‧‧fourth receiving module
115‧‧‧替換模組 115‧‧‧Replacement module
116‧‧‧第二提示模組 116‧‧‧Second prompt module
本申請案上述的和/或附加的方面和優點從下面結合附圖對實施例的描述中將變得明顯和容易理解,其中:圖1是本申請案一個實施例的檔案讀寫方法的流程圖;圖2是本申請案一個具體實施例的檔案讀寫方法的流程圖;圖3是本申請案另一個具體實施例的檔案讀寫方法的流程圖;圖4是本申請案另一個具體實施例的檔案讀寫方法的流程圖;圖5是本申請案另一個具體實施例的檔案讀寫方法的流程圖;圖6是本申請案一個實施例的檔案讀寫裝置的結構示意圖;圖7是本申請案一個具體實施例的檔案讀寫裝置的結構示意圖;以及圖8是本申請案一個實施例的檔案讀寫裝置的結構示意圖。 The above and/or additional aspects and advantages of the present application will become apparent and readily understood from the following description of the embodiments in conjunction with the accompanying drawings in which: Figure 1 is a flow of the file reading and writing method of one embodiment of the present application. 2 is a flow chart of a file reading and writing method according to a specific embodiment of the present application; FIG. 3 is a flowchart of a file reading and writing method according to another embodiment of the present application; FIG. 4 is another specific embodiment of the present application; FIG. 5 is a flow chart of a file reading and writing method according to another embodiment of the present application; FIG. 6 is a schematic structural diagram of a file reading and writing device according to an embodiment of the present application; 7 is a schematic structural diagram of a file reading and writing device according to a specific embodiment of the present application; and FIG. 8 is a schematic structural diagram of a file reading and writing device according to an embodiment of the present application.
下面詳細描述本申請案的實施例,所述實施例的示例在附圖中示出,其中自始至終相同或類似的標號表示相同或類似的元件或具有相同或類似功能的元件。下面透過參考附圖描述的實施例是示例性的,旨在用於解釋本申請案,而不能理解為對本申請案的限制。 The embodiments of the present application are described in detail below, and the examples of the embodiments are illustrated in the drawings, wherein the same or similar reference numerals are used to refer to the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are intended to be illustrative, and are not to be construed as limiting.
此外,術語“第一”、“第二”僅用於描述目的,而不能理解為指示或暗示相對重要性或者隱含指明所指示的技術特徵的數量。由此,限定有“第一”、“第二”的特徵可以明示或者隱含地包括一個或者更多個該特徵。在本申請案的描述中,“多個”的含義是兩個或兩個以上,除非另有明確具體的限定。 Moreover, the terms "first" and "second" are used for descriptive purposes only and are not to be construed as indicating or implying a relative importance or implicitly indicating the number of technical features indicated. Thus, features defining "first" and "second" may include one or more of the features either explicitly or implicitly. In the description of the present application, the meaning of "a plurality" is two or more unless specifically and specifically defined otherwise.
流程圖中或在此以其他方式描述的任何過程或方法描述可以被理解為,表示包括一個或更多個用於實現特定邏輯功能或過程的步驟的可執行指令的代碼的模組、片段或部分,並且本申請案的較佳實施方式的範圍包括另外的實現,其中可以不按所示出或討論的順序,包括根據所涉及的功能按基本同時的方式或按相反的順序,來執行功能,這應被本申請案的實施例所屬技術領域的技術人員所理解。 Any process or method description in the flowcharts or otherwise described herein can be understood as a module, segment or code representing code that includes one or more executable instructions for implementing the steps of a particular logical function or process. The scope of the preferred embodiments of the present application includes additional implementations in which the functions may be performed in a substantially simultaneous manner or in an opposite order depending on the functions involved. This should be understood by those skilled in the art to which the embodiments of the present application pertain.
圖1是本申請案一個實施例的檔案讀寫方法的流程圖。 1 is a flow chart of a file reading and writing method according to an embodiment of the present application.
如圖1所示,檔案讀寫方法包括: As shown in Figure 1, the file reading and writing methods include:
S101,接收訪問請求,並根據訪問請求獲取檔案標識 資訊和第一使用者標識資訊。 S101. Receive an access request, and obtain file identification information and first user identification information according to the access request.
在本申請案的實施例中,包括WebIDE伺服器、快取伺服器以及檔案伺服器。其中,WebIDE伺服器可以提供編輯檔案的使用者介面、執行快取伺服器中的操作、或者是和快取伺服器以及檔案伺服器進行交互。檔案伺服器用於儲存檔案的代碼檔案,例如,GIT伺服器用於儲存GIT檔案的代碼檔案,SVN伺服器用於儲存SVN檔案的代碼檔案。而快取伺服器則是使用快取機制來實現儲存鎖定的檔案,例如,可以是noSql快取伺服器,也可以是Redis、Tair或者其它快取伺服器。 In the embodiment of the present application, a WebIDE server, a cache server, and a file server are included. The WebIDE server can provide a user interface for editing the file, perform operations in the cache server, or interact with the cache server and the file server. The file server is used to store the code file of the file. For example, the GIT server is used to store the code file of the GIT file, and the SVN server is used to store the code file of the SVN file. The cache server uses a cache mechanism to implement storage-locked files. For example, it can be a noSql cache server, or a Redis, Tair, or other cache server.
應當理解的是,WebIDE伺服器、快取伺服器以及檔案伺服器可以是單個的伺服器,也可以是由多個伺服器組成的伺服器集群。 It should be understood that the WebIDE server, the cache server, and the file server may be a single server or a server cluster composed of multiple servers.
具體地,WebIDE伺服器接收使用者A發送的訪問某個檔案的訪問請求,並獲取該檔案的檔案標識資訊以及使用者A的使用者標識資訊。其中,檔案標識資訊用於在伺服器端查詢該檔案的唯一標識,例如,檔案標識資訊可以是檔案路徑、檔案的MD5(Message Digest Algorithm 5,訊息摘要演算法第五版)等。使用者標識資訊是用於驗證使用者身份的唯一標識,例如,使用者標識資訊可以是使用者ID(身份標識號碼)等。 Specifically, the WebIDE server receives the access request sent by the user A to access a certain file, and obtains the file identification information of the file and the user identification information of the user A. The file identification information is used to query the unique identifier of the file on the server side. For example, the file identification information may be the file path, the file MD5 (Message Digest Algorithm 5, the fifth version of the message digest algorithm). The user identification information is a unique identifier for verifying the identity of the user. For example, the user identification information may be a user ID (identity identification number) or the like.
S102,在快取伺服器中查詢檔案標識資訊對應的鎖定檔案,如果未查詢到檔案標識資訊對應的鎖定檔案,則從檔案伺服器獲取檔案標識資訊對應的第一原始檔案。 S102: Query the lock file corresponding to the file identifier information in the cache server, and if the lock file corresponding to the file identifier information is not queried, obtain the first original file corresponding to the file identifier information from the file server.
具體地,WebIDE伺服器根據檔案標識資訊在快取伺服器中查詢是否存在與檔案標識資訊對應的檔案,其中,該檔案在快取伺服器中是處於鎖定狀態的,即鎖定檔案。也就是說,在使用者A請求訪問檔案時,並不直接從檔案伺服器獲取檔案,而是先在快取伺服器中查詢是否存在已被鎖定的檔案,如果快取伺服器中不存在已被鎖定的檔案,則再從檔案伺服器獲取該檔案。 Specifically, the WebIDE server searches the cache server for the file corresponding to the file identification information according to the file identification information, wherein the file is locked in the cache server, that is, the file is locked. That is to say, when user A requests access to the file, the file is not directly obtained from the file server, but the cache server is first queried whether there is a file that has been locked, if the cache server does not exist. The file that is locked is then retrieved from the file server.
如果WebIDE伺服器在快取伺服器中未查詢到對應的鎖定檔案,則說明檔案伺服器上儲存的原始檔案目前處於未鎖定的狀態,使用者A有許可權從檔案伺服器上獲取原始檔案並對該原始檔案加鎖,因此,WebIDE伺服器在檔案伺服器中根據檔案標識資訊查找到對應的原始檔案,並獲取該原始檔案。 If the WebIDE server does not query the corresponding lock file in the cache server, the original file stored on the file server is currently in an unlocked state, and user A has the permission to obtain the original file from the file server. The original file is locked. Therefore, the WebIDE server finds the corresponding original file according to the file identification information in the file server, and acquires the original file.
S103,根據第一使用者標識資訊和第一原始檔案生成鎖定檔案,並將鎖定檔案提交至快取伺服器。 S103. Generate a lock file according to the first user identification information and the first original file, and submit the lock file to the cache server.
具體地,WebIDE伺服器將原始檔案的檔案內容展現給使用者A,同時根據使用者A的使用者標識資訊鎖定該原始檔案,以生成包含原始檔案和使用者標識資訊的鎖定檔案。然後,WebIDE伺服器以檔案標識資訊作為鎖定檔案的標識,將鎖定檔案提交至快取伺服器進行儲存。 Specifically, the WebIDE server presents the file content of the original file to the user A, and simultaneously locks the original file according to the user identification information of the user A to generate a locked file containing the original file and the user identification information. Then, the WebIDE server uses the file identification information as the identifier of the locked file, and submits the locked file to the cache server for storage.
應當理解的是,在將鎖定檔案儲存在快取伺服器之後,如果WebIDE伺服器接收到使用者B發送的訪問該檔案的請求後,WebIDE伺服器同樣會以相同的方式先查詢快取伺服器中是否存在該檔案對應的鎖定檔案,如果 WebIDE伺服器查詢到對應的鎖定檔案,由於快取伺服器中存在鎖定檔案,因此使用者B在檔案已被鎖定的狀態下不允許獲取檔案或者是對檔案進行編輯。由此,可以避免使用者A和使用者B同時對檔案進行編輯導致編輯的內容相互衝突的問題。 It should be understood that after the lock file is stored in the cache server, if the WebIDE server receives the request sent by user B to access the file, the WebIDE server will first query the cache server in the same manner. Is there a lock file corresponding to the file? If the WebIDE server queries the corresponding lock file, because the lock file exists in the cache server, User B is not allowed to obtain the file or is in the state that the file is locked. The file is edited. Thereby, it is possible to avoid the problem that the user A and the user B simultaneously edit the file, causing the edited contents to collide with each other.
S104,接收針對第一原始檔案的編輯操作,並將編輯後的第一原始檔案提交至快取伺服器,以使快取伺服器根據編輯後的第一原始檔案對鎖定檔案進行更新。 S104. Receive an editing operation for the first original file, and submit the edited first original file to the cache server, so that the cache server updates the locked file according to the edited first original file.
具體地,使用者A可以對原始檔案的檔案內容進行編輯,當使用者A選擇保存編輯後的內容時,WebIDE伺服器將編輯後的原始檔案加上使用者標識資訊提交至快取伺服器。也就是說,WebIDE伺服器將使用者A編輯後的內容保存至快取伺服器的鎖定檔案中。 Specifically, the user A can edit the file content of the original file. When the user A selects to save the edited content, the WebIDE server submits the edited original file plus the user identification information to the cache server. In other words, the WebIDE server saves the edited content of User A to the cache file of the cache server.
應當理解的是,WebIDE伺服器從檔案伺服器讀寫檔案以及將檔案內容展現給使用者的方式均可採用現有技術實現,例如,WebIDE伺服器使用GitLab API或者Svn API實現檔案的讀寫,使用ACE等開源JS框架實現檔案內容的展現。而快取伺服器中使用的快取,可以用SSD(Solid State Drives,固態硬碟)做快取持久化空間,以得到更大的儲存空間,或者使用Tair集群等快取方案皆可。由於上述方案都是成熟的技術,因此,此處不再複贅。 It should be understood that the way the WebIDE server reads and writes files from the file server and presents the contents of the files to the user can be implemented by using existing technologies. For example, the Web IDE server uses the GitLab API or the Svn API to read and write files. The open source JS framework such as ACE realizes the display of archive content. The cache used in the cache server can use SSD (Solid State Drives) to make a cached persistent space for larger storage space, or use a cache solution such as Tair cluster. Since the above schemes are mature technologies, they are not repeated here.
本申請案實施例的檔案讀寫方法,透過快取伺服器實現了適用於WebIDE系統的檔案鎖定機制,利用快取伺服 器作為檔案伺服器和WebIDE伺服器之間緩衝,使用快取機制實現檔案的鎖定,從而使得使用者在對檔案操作的過程中擁有檔案的獨享操作權,避免了多個使用者對同一個檔案操作時提交的內容互相衝突,使得WebIDE系統能夠在多個協作開發過程中發揮更大的作用。此外,使用快取機制實現檔案的鎖定,比每次都修改檔案伺服器的資料庫相比成本更低,且快取機制能夠更加靈活地處理多種檔案、產生同一個檔案的不同副本等等,給使用者更好的體驗。 The file reading and writing method of the embodiment of the present application implements a file locking mechanism suitable for the WebIDE system through the cache server, and uses the cache server as a buffer between the file server and the WebIDE server, and uses the cache mechanism to implement the file. Locking, so that the user has the exclusive operation right of the file during the operation of the file, avoiding conflicts between the content submitted by multiple users when operating the same file, so that the WebIDE system can be in multiple collaborative development processes. Play a bigger role. In addition, using the cache mechanism to lock the file is cheaper than modifying the file server's database each time, and the cache mechanism can handle multiple files more flexibly, generate different copies of the same file, and so on. Give users a better experience.
圖2是本申請案一個具體實施例的檔案讀寫方法的流程圖。 2 is a flow chart of a file reading and writing method according to a specific embodiment of the present application.
如圖2所示,檔案讀寫方法包括: As shown in Figure 2, the file reading and writing methods include:
S201,接收訪問請求,並根據訪問請求獲取檔案標識資訊和第一使用者標識資訊。 S201. Receive an access request, and obtain file identification information and first user identification information according to the access request.
S202,在快取伺服器中查詢檔案標識資訊對應的鎖定檔案,如果未查詢到檔案標識資訊對應的鎖定檔案,則從檔案伺服器獲取檔案標識資訊對應的第一原始檔案。 S202. Query the lock file corresponding to the file identifier information in the cache server. If the lock file corresponding to the file identifier information is not queried, obtain the first original file corresponding to the file identifier information from the file server.
S203,如果查詢到檔案標識資訊對應的鎖定檔案,則判斷第一使用者標識資訊是否與鎖定檔案對應的第二使用者標識資訊匹配,若第一使用者標識資訊與第二使用者標識資訊匹配,則從快取伺服器中獲取鎖定檔案。 S203. If the locked file corresponding to the file identification information is queried, determine whether the first user identification information matches the second user identification information corresponding to the locked file, and if the first user identification information matches the second user identification information. , then get the lock file from the cache server.
具體地,如果WebIDE伺服器在快取伺服器中查詢到對應的鎖定檔案,則說明檔案伺服器上儲存的原始檔案目前處於鎖定的狀態,則WebIDE伺服器獲取鎖定檔案的使 用者標識資訊,並判斷使用者A的使用者標識資訊和鎖定檔案的使用者標識資訊是否匹配,如果使用者A的使用者標識資訊和鎖定檔案的使用者標識資訊匹配,則WebIDE伺服器判斷使用者A有許可權獲取鎖定檔案並進行編輯。 Specifically, if the WebIDE server queries the corresponding lock file in the cache server, it indicates that the original file stored on the file server is currently locked, and the WebIDE server obtains the user identification information of the locked file, and Determining whether the user identification information of the user A matches the user identification information of the locked file, and if the user identification information of the user A matches the user identification information of the locked file, the WebIDE server determines that the user A has the permission. Get the lock file and edit it.
應當理解的是,在使用者A讀取到鎖定檔案後,該鎖定檔案在快取伺服器中仍然繼續保持鎖定狀態。 It should be understood that after the user A reads the lock file, the lock file still remains locked in the cache server.
在本申請案的一個實施例中,若第一使用者標識資訊與第二使用者標識資訊不匹配,則生成拒絕獲取鎖定檔案的提示資訊。具體地,如果是使用者B訪問快取伺服器中的鎖定檔案,則使用者B的使用者標識資訊和鎖定檔案的使用者標識資訊不匹配,即該鎖定檔案是使用者A鎖定的,則WebIDE伺服器判斷使用者B沒有許可權獲取鎖定檔案進行編輯,生成提示提示資訊提示使用者B。 In an embodiment of the present application, if the first user identification information does not match the second user identification information, generating prompt information for refusing to acquire the locked file is generated. Specifically, if the user B accesses the locked file in the cache server, the user identification information of the user B and the user identification information of the locked file do not match, that is, the locked file is locked by the user A, The WebIDE server determines that User B does not have permission to acquire the lock file for editing, and generates a prompt message prompting User B.
在本申請案的一個實施例中,如果WebIDE伺服器判斷使用者B沒有許可權獲取鎖定檔案進行編輯,則WebIDE伺服器可以為使用者B提供一個鎖定檔案的副本,使用者B可以對副本進行編輯,以使在使用者A對鎖定檔案解鎖後,WebIDE伺服器根據使用者B編輯的副本在處理副本和使用者A編輯的鎖定檔案的衝突之後再進行提交。由此,在使用者B沒有對鎖定檔案編輯的許可權時,可以為使用者B提供一種更加友好的操作方式。 In one embodiment of the present application, if the WebIDE server determines that User B does not have permission to acquire the locked file for editing, the WebIDE server may provide User B with a copy of the locked file, and User B may perform the copy. Editing, so that after User A unlocks the locked file, the WebIDE server submits according to the conflict edited by User B after processing the conflict between the copy and the locked file edited by User A. Thus, User B can provide User B with a more friendly operation when there is no permission to edit the locked file.
S204,接收針對鎖定檔案的編輯操作,並將編輯後的鎖定檔案提交至快取伺服器,以使快取伺服器根據編輯後的鎖定檔案對鎖定檔案進行更新。 S204. Receive an editing operation for the locked file, and submit the edited locked file to the cache server, so that the cache server updates the locked file according to the edited locked file.
具體地,WebIDE伺服器將鎖定檔案的檔案內容展現給使用者A,使用者A可以對檔案內容進行編輯,當使用者A選擇保存編輯後的內容時,WebIDE伺服器將編輯後的鎖定檔案加上使用者標識資訊提交至快取伺服器。也就是說,WebIDE伺服器將使用者A編輯後的內容保存至快取伺服器的鎖定檔案中。 Specifically, the WebIDE server displays the file content of the locked file to the user A, and the user A can edit the file content. When the user A selects to save the edited content, the WebIDE server adds the edited locked file. The user identification information is submitted to the cache server. In other words, the WebIDE server saves the edited content of User A to the cache file of the cache server.
應當理解的是,由於快取伺服器中快取檔案的持久化特性,使用者A在快取伺服器中儲存的鎖定檔案會被持久保持,當使用者A從一個用戶端切換至另一個用戶端時,可以根據使用者A的使用者表示資訊和檔案標識資訊再次讀取快取伺服器中的鎖定檔案進行編輯。 It should be understood that due to the persistence feature of the cache file in the cache server, the lock file stored by the user A in the cache server is persistently maintained, when the user A switches from one client to another. At the end, the user can display the information and the file identification information of the user A to read the locked file in the cache server for editing.
圖3是本申請案另一個具體實施例的檔案讀寫方法的流程圖。 3 is a flow chart of a file reading and writing method according to another embodiment of the present application.
如圖3所示,檔案讀寫方法包括: As shown in Figure 3, the file reading and writing methods include:
S301,接收訪問請求,並根據訪問請求獲取檔案標識資訊和第一使用者標識資訊。 S301. Receive an access request, and obtain file identification information and first user identification information according to the access request.
S302,在快取伺服器中查詢檔案標識資訊對應的鎖定檔案,如果未查詢到檔案標識資訊對應的鎖定檔案,則從檔案伺服器獲取檔案標識資訊對應的第一原始檔案。 S302. Query the lock file corresponding to the file identifier information in the cache server. If the lock file corresponding to the file identifier information is not queried, obtain the first original file corresponding to the file identifier information from the file server.
S303,根據第一使用者標識資訊和第一原始檔案生成鎖定檔案,並將鎖定檔案提交至快取伺服器。 S303. Generate a lock file according to the first user identification information and the first original file, and submit the lock file to the cache server.
S304,接收針對第一原始檔案的編輯操作,並將編輯後的第一原始檔案提交至快取伺服器,以使快取伺服器根據編輯後的第一原始檔案對鎖定檔案進行更新。 S304. Receive an editing operation for the first original file, and submit the edited first original file to the cache server, so that the cache server updates the locked file according to the edited first original file.
S305,從檔案伺服器獲取第二原始檔案,並判斷快取伺服器中鎖定檔案的第一提交資訊與第二原始檔案的第二提交資訊是否匹配,如果第一提交資訊與第二提交資訊匹配,則將鎖定檔案提交至檔案伺服器,以使檔案伺服器將第二原始檔案替換為鎖定檔案。 S305: Obtain a second original file from the file server, and determine whether the first submission information of the locked file in the cache server matches the second submission information of the second original file, if the first submission information matches the second submission information. , the lock file is submitted to the file server, so that the file server replaces the second original file with the lock file.
具體地,WebIDE伺服器根據使用者A編輯的內容對快取伺服器中的鎖定檔案更新後,從檔案伺服器再次獲取檔案伺服器中保存的原始檔案,並從獲取該原始檔案的提交資訊,如果快取伺服器中鎖定檔案的提交資訊和檔案伺服器中原始檔案的提交資訊匹配,則WebIDE伺服器將更新後的鎖定檔案非同步提交至檔案伺服器,將檔案伺服器中的原始檔案替換為更新後的鎖定檔案。 Specifically, after updating the locked file in the cache server according to the content edited by the user A, the WebIDE server obtains the original file saved in the file server again from the file server, and obtains the submission information of the original file. If the submission information of the locked file in the cache server matches the submission information of the original file in the file server, the WebIDE server asynchronously submits the updated locked file to the file server, and replaces the original file in the file server. For the updated lock file.
S306,如果第一提交資訊與第二提交資訊不匹配,則根據第二原始檔案對鎖定檔案進行更新,並根據第二提交資訊更新第一提交資訊,以及將更新後的鎖定檔案提交至檔案伺服器。 S306. If the first submission information does not match the second submission information, update the locked file according to the second original file, update the first submission information according to the second submission information, and submit the updated locked file to the file server. Device.
具體地,如果快取伺服器中鎖定檔案的提交資訊和檔案伺服器中原始檔案的提交資訊不匹配,說明檔案伺服器中原始檔案已經被更新,例如,使用者透過檔案伺服器的用戶端對原始檔案進行了更新,則WebIDE伺服器將鎖定檔案的內容保存為副本,並獲取原始檔案的內容,根據原始檔案的內容對鎖定檔案的內容進行更新。在使用者A在解決鎖定檔案的內容和原始檔案的內容之間的衝突之後,WebIDE伺服器將快取伺服器中的鎖定檔案的提交資訊更 新為檔案伺服器中原始檔案的提交資訊。然後,WebIDE伺服器將更新後的鎖定檔案非同步提交至檔案伺服器,將檔案伺服器中的原始檔案替換為更新後的鎖定檔案。 Specifically, if the submission information of the locked file in the cache server does not match the submission information of the original file in the file server, the original file in the file server has been updated, for example, the user side of the file server through the file server When the original file is updated, the WebIDE server saves the contents of the locked file as a copy, and obtains the contents of the original file, and updates the contents of the locked file according to the content of the original file. After User A resolves the conflict between the content of the locked file and the content of the original file, the WebIDE server updates the submission information of the locked file in the cache server to the submission information of the original file in the file server. Then, the WebIDE server asynchronously submits the updated lock file to the file server, and replaces the original file in the file server with the updated lock file.
圖4是本申請案另一個具體實施例的檔案讀寫方法的流程圖。 4 is a flow chart of a file reading and writing method according to another embodiment of the present application.
如圖4所示,檔案讀寫方法包括: As shown in Figure 4, the file reading and writing methods include:
S401,接收訪問請求,並根據訪問請求獲取檔案標識資訊和第一使用者標識資訊。 S401. Receive an access request, and obtain file identification information and first user identification information according to the access request.
S402,在快取伺服器中查詢檔案標識資訊對應的鎖定檔案,如果未查詢到檔案標識資訊對應的鎖定檔案,則從檔案伺服器獲取檔案標識資訊對應的第一原始檔案。 S402. Query the lock file corresponding to the file identifier information in the cache server. If the lock file corresponding to the file identifier information is not queried, obtain the first original file corresponding to the file identifier information from the file server.
S403,如果查詢到檔案標識資訊對應的鎖定檔案,則判斷第一使用者標識資訊是否與鎖定檔案對應的第二使用者標識資訊匹配,若第一使用者標識資訊與第二使用者標識資訊匹配,則從快取伺服器中獲取鎖定檔案。 S403, if the locked file corresponding to the file identification information is queried, determining whether the first user identification information matches the second user identification information corresponding to the locked file, and if the first user identification information matches the second user identification information , then get the lock file from the cache server.
S404,接收針對鎖定檔案的編輯操作,並將編輯後的鎖定檔案提交至快取伺服器,以使快取伺服器根據編輯後的鎖定檔案對鎖定檔案進行更新。 S404. Receive an editing operation for the locked file, and submit the edited locked file to the cache server, so that the cache server updates the locked file according to the edited locked file.
S405,接收針對快取伺服器中鎖定檔案的解鎖請求,並在判斷第一使用者標識資訊與鎖定檔案對應的第二使用者標識資訊匹配時,從快取伺服器中刪除鎖定檔案。 S405. Receive an unlock request for the locked file in the cache server, and delete the lock file from the cache server when determining that the first user identifier information matches the second user identifier information corresponding to the lock file.
具體地,在使用者A對鎖定檔案編輯完成之後,使用者A可以發送對鎖定檔案進行解鎖的請求,WebIDE伺服器在接收到使用者A發送的解鎖請求後,提示使用者即將 對鎖定檔案解鎖,並提示使用者是否在解鎖前將鎖定檔案提交至檔案伺服器中。在使用者A確認對鎖定檔案解鎖之後,根據檔案標識資訊在快取伺服器中查找到對應的鎖定檔案,並判斷鎖定檔案對應的使用者標識資訊是否和使用者A的使用者標識資訊匹配。如果鎖定檔案對應的使用者標識資訊和使用者A的使用者標識資訊匹配,則WebIDE伺服器從快取伺服器中刪除該鎖定檔案。 Specifically, after the user A edits the lock file, the user A can send a request to unlock the lock file, and after receiving the unlock request sent by the user A, the WebIDE server prompts the user to unlock the lock file. And prompt the user to submit the locked file to the file server before unlocking. After the user A confirms that the locked file is unlocked, the corresponding locked file is found in the cache server according to the file identification information, and it is determined whether the user identification information corresponding to the locked file matches the user identification information of the user A. If the user identification information corresponding to the locked file matches the user identification information of user A, the WebIDE server deletes the locked file from the cache server.
應當理解的是,在鎖定檔案從快取伺服器刪除之後,如果使用者B請求訪問檔案,則WebIDE伺服器則進一步根據步驟S401-S404的方法為使用者B提供單獨操作檔案的獨享操作權。 It should be understood that after the lock file is deleted from the cache server, if the user B requests access to the file, the WebIDE server further provides the user B with the exclusive operation right of the separate operation file according to the methods of steps S401-S404. .
圖5是本申請案另一個具體實施例的檔案讀寫方法的流程圖。 FIG. 5 is a flow chart of a file reading and writing method according to another embodiment of the present application.
如圖5所示,檔案讀寫方法包括: As shown in Figure 5, the file reading and writing method includes:
S501,接收訪問請求,並根據訪問請求獲取檔案標識資訊和第一使用者標識資訊。 S501. Receive an access request, and obtain file identification information and first user identification information according to the access request.
S502,在快取伺服器中查詢檔案標識資訊對應的鎖定檔案,如果未查詢到檔案標識資訊對應的鎖定檔案,則從檔案伺服器獲取檔案標識資訊對應的第一原始檔案。 S502. Query the lock file corresponding to the file identifier information in the cache server. If the lock file corresponding to the file identifier information is not queried, obtain the first original file corresponding to the file identifier information from the file server.
S503,如果查詢到檔案標識資訊對應的鎖定檔案,則判斷第一使用者標識資訊是否與鎖定檔案對應的第二使用者標識資訊匹配,若第一使用者標識資訊與第二使用者標識資訊匹配,則從快取伺服器中獲取鎖定檔案。 S503, if the lock file corresponding to the file identifier information is queried, determining whether the first user identifier information matches the second user identifier information corresponding to the lock file, and if the first user identifier information matches the second user identifier information , then get the lock file from the cache server.
S504,若第一使用者標識資訊與第二使用者標識資訊 不匹配,則生成拒絕獲取鎖定檔案的提示資訊。 S504. If the first user identifier information does not match the second user identifier information, generate prompt information for rejecting the lock file.
S505,接收針對第二使用者標識資訊的替換請求,並根據替換請求將第二使用者標識資訊替換為第一使用者標識資訊,以及生成第二使用者標識資訊被替換的提示資訊。 S505. Receive a replacement request for the second user identifier information, and replace the second user identifier information with the first user identifier information according to the replacement request, and generate prompt information that the second user identifier information is replaced.
具體地,如果使用者B沒有許可權獲取鎖定檔案進行編輯,而使用者B又急需對鎖定檔案進行編輯,此時該檔案被使用者A鎖定,則使用者B可以選擇搶鎖,直接將具有鎖定檔案的讀寫許可權的使用者A變為使用者B具有許可權。也就是說,使用者B發送對快取伺服器中鎖定檔案所對應的使用者標識資訊的替換請求,WebIDE伺服器在接收到使用者B發送的替換請求後,將鎖定檔案的使用者標識資訊替換為使用者B的使用者標識資訊,並生成鎖定檔案的使用者標識資訊被替換的提示資訊以提示使用者A。 Specifically, if user B does not have permission to acquire the locked file for editing, and user B urgently needs to edit the locked file, and the file is locked by user A, user B can choose to steal the lock and directly have User A who locks the read/write permission of the file becomes user B with permission. That is to say, the user B sends a replacement request for the user identification information corresponding to the locked file in the cache server, and the WebIDE server will lock the user identification information of the file after receiving the replacement request sent by the user B. It is replaced with the user identification information of the user B, and generates prompt information for the user identification information of the locked file to be replaced to prompt the user A.
S506,接收針對鎖定檔案的編輯操作,並將編輯後的鎖定檔案提交至快取伺服器,以使快取伺服器根據編輯後的鎖定檔案對鎖定檔案進行更新。 S506. Receive an editing operation for the locked file, and submit the edited locked file to the cache server, so that the cache server updates the locked file according to the edited locked file.
具體地,WebIDE伺服器將鎖定檔案的檔案內容展現給使用者B,使用者B可以對檔案內容進行編輯,當使用者B選擇保存編輯後的內容時,WebIDE伺服器將編輯後的鎖定檔案加上使用者B的使用者標識資訊提交至快取伺服器。也就是說,WebIDE伺服器將使用者B編輯後的內容保存至快取伺服器的鎖定檔案中。 Specifically, the WebIDE server displays the file content of the locked file to the user B, and the user B can edit the file content. When the user B selects to save the edited content, the WebIDE server adds the edited locked file. User B's user identification information is submitted to the cache server. In other words, the WebIDE server saves the edited content of User B to the lock file of the cache server.
本申請案實施例的檔案讀寫方法,為使用者提供檔案鎖定、檔案解鎖和搶鎖等功能,解決了多人協同開發時提交的內容互相衝突、互相覆蓋的問題,同時使用快取伺服器保存鎖定檔案可以解決多個WebIDE伺服器中資訊不同步的問題,使得多人協同開發時能夠充分發揮快速、不受環境限制的優勢。 The file reading and writing method of the embodiment of the present application provides functions such as file locking, file unlocking, and lock-up for the user, and solves the problem that the content submitted by the multi-person collaborative development conflicts and covers each other, and uses the cache server at the same time. Saving the lock file can solve the problem of unsynchronized information in multiple WebIDE servers, so that multi-person collaborative development can fully utilize the advantages of fast and environmentally unrestricted.
為了實現上述實施例,本申請案還提出一種檔案讀寫裝置。 In order to implement the above embodiments, the present application also proposes a file reading and writing device.
圖6是本申請案一個實施例的檔案讀寫裝置的結構示意圖,如圖6所示,檔案讀寫裝置包括:第一接收模組101、第一獲取模組102、查詢模組103、第二獲取模組104、生成模組105、提交模組106和第二接收模組107。 6 is a schematic structural diagram of a file reading and writing device according to an embodiment of the present application. As shown in FIG. 6, the file reading and writing device includes: a first receiving module 101, a first obtaining module 102, an inquiry module 103, and a first The acquisition module 104, the generation module 105, the submission module 106, and the second receiving module 107.
具體地,第一接收模組101用於接收訪問請求。第一獲取模組102使用者根據訪問請求獲取檔案標識資訊和第一使用者標識資訊。具體而言,第一接收模組101接收使用者A發送的訪問某個檔案的訪問請求,第一獲取模組102獲取該檔案的檔案標識資訊以及使用者A的使用者標識資訊。其中,檔案標識資訊用於在伺服器端查詢該檔案的唯一標識,例如,檔案標識資訊可以是檔案路徑、檔案的MD5等。使用者標識資訊是用於驗證使用者身份的唯一標識,例如,使用者標識資訊可以是使用者ID等。 Specifically, the first receiving module 101 is configured to receive an access request. The first obtaining module 102 user obtains the file identification information and the first user identification information according to the access request. Specifically, the first receiving module 101 receives the access request sent by the user A to access a certain file, and the first obtaining module 102 obtains the file identification information of the file and the user identification information of the user A. The file identification information is used to query the unique identifier of the file on the server side. For example, the file identification information may be an archive path, an MD5 of the file, or the like. The user identification information is a unique identifier for verifying the identity of the user. For example, the user identification information may be a user ID or the like.
查詢模組103用於在快取伺服器中查詢檔案標識資訊對應的鎖定檔案。第二獲取模組104用於當查詢模組103未查詢到檔案標識資訊對應的鎖定檔案時,從檔案服器獲 取檔案標識資訊對應的第一原始檔案。具體而言,查詢模組103根據檔案標識資訊在快取伺服器中查詢是否存在與檔案標識資訊對應的檔案,其中,該檔案在快取伺服器中是處於鎖定狀態的,即鎖定檔案。也就是說,在使用者A請求訪問檔案時,並不直接從檔案伺服器獲取檔案,而是先在快取伺服器中查詢是否存在已被鎖定的檔案,如果快取伺服器中不存在已被鎖定的檔案,則再從檔案伺服器獲取該檔案。如果查詢模組103在快取伺服器中未查詢到對應的鎖定檔案,則說明檔案伺服器上儲存的原始檔案目前處於未鎖定的狀態,使用者A有許可權從檔案伺服器上獲取原始檔案並對該原始檔案加鎖,因此,第二獲取模組104在檔案伺服器中根據檔案標識資訊查找到對應的原始檔案,並獲取該原始檔案。 The query module 103 is configured to query the cache file for the lock file corresponding to the file identifier information. The second obtaining module 104 is configured to obtain the first original file corresponding to the file identification information from the file server when the query module 103 does not query the locked file corresponding to the file identification information. Specifically, the query module 103 queries the cache server for the file corresponding to the file identification information according to the file identification information, wherein the file is locked in the cache server, that is, the file is locked. That is to say, when user A requests access to the file, the file is not directly obtained from the file server, but the cache server is first queried whether there is a file that has been locked, if the cache server does not exist. The file that is locked is then retrieved from the file server. If the query module 103 does not query the corresponding lock file in the cache server, it indicates that the original file stored on the file server is currently in an unlocked state, and user A has the permission to obtain the original file from the file server. And the original file is locked. Therefore, the second obtaining module 104 finds the corresponding original file according to the file identification information in the file server, and acquires the original file.
生成模組105用於根據第一使用者標識資訊和第一原始檔案生成鎖定檔案。提交模組106用於將鎖定檔案提交至快取伺服器。具體而言,生成模組105將原始檔案的檔案內容展現給使用者A,同時生成模組105根據使用者A的使用者標識資訊鎖定該原始檔案,以生成包含原始檔案和使用者標識資訊的鎖定檔案。然後,提交模組106以檔案標識資訊作為鎖定檔案的標識,將鎖定檔案提交至快取伺服器進行儲存。 The generating module 105 is configured to generate a lock file according to the first user identification information and the first original file. The submission module 106 is configured to submit the lock file to the cache server. Specifically, the generating module 105 displays the file content of the original file to the user A, and the generating module 105 locks the original file according to the user identification information of the user A to generate the original file and the user identification information. Lock the file. Then, the submitting module 106 uses the file identification information as the identifier of the locked file, and submits the locked file to the cache server for storage.
第二接收模組107用於接收針對第一原始檔案的編輯操作,其中,提交模組106將編輯後的第一原始檔案提交至快取伺服器,以使快取伺服器根據編輯後的第一原始檔 案對鎖定檔案進行更新。具體地,使用者A可以對原始檔案的檔案內容進行編輯,當使用者A選擇保存編輯後的內容時,第二接收模組107接收使用者的編輯操作,提交模組106將編輯後的原始檔案加上使用者標識資訊提交至快取伺服器。也就是說,將使用者A編輯後的內容保存至快取伺服器的鎖定檔案中。 The second receiving module 107 is configured to receive an editing operation for the first original file, where the submitting module 106 submits the edited first original file to the cache server, so that the cache server is based on the edited An original file updates the lock file. Specifically, the user A can edit the file content of the original file. When the user A selects to save the edited content, the second receiving module 107 receives the editing operation of the user, and the submitting module 106 will edit the original content. The file plus the user identification information is submitted to the cache server. In other words, the content edited by user A is saved to the lock file of the cache server.
本申請案實施例的檔案讀寫裝置,透過快取伺服器實現了適用於WebIDE系統的檔案鎖定機制,利用快取伺服器作為檔案伺服器和WebIDE伺服器之間緩衝,使用快取機制實現檔案的鎖定,從而使得使用者在對檔案操作的過程中擁有檔案的獨享操作權,避免了多個使用者對同一個檔案操作時提交的內容互相衝突,使得WebIDE系統能夠在多個協作開發過程中發揮更大的作用。此外,使用快取機制實現檔案的鎖定,比每次都修改檔案伺服器的資料庫相比成本更低,且快取機制能夠更加靈活地處理多種檔案、產生同一個檔案的不同副本等等,給使用者更好的體驗。 The file reading and writing device of the embodiment of the present application implements a file locking mechanism suitable for the WebIDE system through the cache server, and uses the cache server as a buffer between the file server and the WebIDE server, and uses the cache mechanism to implement the file. Locking, so that the user has the exclusive operation right of the file during the operation of the file, avoiding conflicts between the content submitted by multiple users when operating the same file, so that the WebIDE system can be in multiple collaborative development processes. Play a bigger role. In addition, using the cache mechanism to lock the file is cheaper than modifying the file server's database each time, and the cache mechanism can handle multiple files more flexibly, generate different copies of the same file, and so on. Give users a better experience.
圖7是本申請案一個具體實施例的檔案讀寫裝置的結構示意圖,如圖7所示,檔案讀寫裝置包括:第一接收模組101、第一獲取模組102、查詢模組103、第二獲取模組104、生成模組105、提交模組106、第二接收模組107、第一判斷模組108、第一提示模組109、第二判斷模組110、更新模組111、第三接收模組112、解鎖模組113、第四接收模組114、替換模組115和第二提示模組 116。 FIG. 7 is a schematic structural diagram of a file reading and writing device according to an embodiment of the present application. As shown in FIG. 7, the file reading and writing device includes: a first receiving module 101, a first obtaining module 102, and an query module 103. The second obtaining module 104, the generating module 105, the submitting module 106, the second receiving module 107, the first determining module 108, the first prompting module 109, the second determining module 110, the updating module 111, The third receiving module 112, the unlocking module 113, the fourth receiving module 114, the replacement module 115, and the second prompting module 116.
具體地,第一判斷模組108用於當查詢模組103查詢到檔案標識資訊對應的鎖定檔案時,判斷第一使用者標識資訊是否與鎖定檔案對應的第二使用者標識資訊匹配。第二獲取模組104還用於當第一判斷模組108判斷第一使用者標識資訊與第二使用者標識資訊匹配時,從快取伺服器中獲取鎖定檔案。具體地,如果查詢模組103在快取伺服器中查詢到對應的鎖定檔案,則說明檔案伺服器上儲存的原始檔案目前處於鎖定的狀態,則獲取鎖定檔案的使用者標識資訊,第一判斷模組108判斷使用者A的使用者標識資訊和鎖定檔案的使用者標識資訊是否匹配,如果第一判斷模組108判斷使用者A的使用者標識資訊和鎖定檔案的使用者標識資訊匹配,則使用者A有許可權獲取鎖定檔案並進行編輯,因此,第二獲取模組104從快取伺服器中獲取鎖定檔案。 Specifically, the first determining module 108 is configured to determine, when the query module 103 queries the locked file corresponding to the file identification information, whether the first user identification information matches the second user identification information corresponding to the locked file. The second obtaining module 104 is further configured to: when the first determining module 108 determines that the first user identification information matches the second user identification information, obtain the locked file from the cache server. Specifically, if the query module 103 queries the corresponding lock file in the cache server, it indicates that the original file stored on the file server is currently locked, and the user identification information of the locked file is obtained. The module 108 determines whether the user identification information of the user A and the user identification information of the locked file match. If the first determining module 108 determines that the user identification information of the user A matches the user identification information of the locked file, User A has permission to acquire the lock file and edit it. Therefore, the second acquisition module 104 obtains the lock file from the cache server.
第一提示模組109用於當第一判斷模組108判斷第一使用者標識資訊與第二使用者標識資訊不匹配時,生成拒絕獲取鎖定檔案的提示資訊。具體地,如果是使用者B訪問快取伺服器中的鎖定檔案,則第一判斷模組108判斷使用者B的使用者標識資訊和鎖定檔案的使用者標識資訊不匹配,即該鎖定檔案是使用者A鎖定的,則第一判斷模組108判斷使用者B沒有許可權獲取鎖定檔案進行編輯,第一提示模組109生成提示提示資訊提示使用者B。 The first prompt module 109 is configured to generate prompt information for refusing to acquire the locked file when the first determining module 108 determines that the first user identification information does not match the second user identification information. Specifically, if the user B accesses the locked file in the cache server, the first determining module 108 determines that the user identification information of the user B and the user identification information of the locked file do not match, that is, the locked file is If the user A is locked, the first determining module 108 determines that the user B does not have permission to acquire the locked file for editing, and the first prompting module 109 generates a prompting information to prompt the user B.
在本申請案的一個實施例中,檔案讀寫裝置還包括第 二判斷模組110和更新模組111。其中,第二獲取模組104還用於從檔案伺服器獲取第二原始檔案。第二判斷模組110用於判斷快取伺服器中鎖定檔案的第一提交資訊與第二原始檔案的第二提交資訊是否匹配。提交模組106還用於當第二判斷模組110判斷第一提交資訊與第二提交資訊匹配時,將鎖定檔案提交至檔案伺服器,以使檔案伺服器將第二原始檔案替換為鎖定檔案。具體地,提交模組106根據使用者A編輯的內容對快取伺服器中的鎖定檔案更新後,第二獲取模組104從檔案伺服器再次獲取檔案伺服器中保存的原始檔案,並從獲取該原始檔案的提交資訊,如果第二判斷模組110判斷快取伺服器中鎖定檔案的提交資訊和檔案伺服器中原始檔案的提交資訊匹配,則提交模組106將更新後的鎖定檔案非同步提交至檔案伺服器,將檔案伺服器中的原始檔案替換為更新後的鎖定檔案。 In one embodiment of the present application, the file reading and writing device further includes a second determining module 110 and an updating module 111. The second obtaining module 104 is further configured to acquire the second original file from the file server. The second determining module 110 is configured to determine whether the first submission information of the locked file in the cache server matches the second submission information of the second original file. The submitting module 106 is further configured to: when the second determining module 110 determines that the first submitted information matches the second submitted information, submit the locked file to the file server, so that the file server replaces the second original file with the locked file. . Specifically, after the submitting module 106 updates the locked file in the cache server according to the content edited by the user A, the second obtaining module 104 acquires the original file saved in the file server from the file server again, and obtains the file from the file server. The submission information of the original file, if the second determining module 110 determines that the submission information of the locked file in the cache server matches the submission information of the original file in the file server, the submitting module 106 asynchronously updates the updated locked file. Submit to the file server and replace the original file in the file server with the updated lock file.
更新模組111用於當第二判斷模組110判斷第一提交資訊與第二提交資訊不匹配時,根據第二原始檔案對鎖定檔案進行更新,並根據第二提交資訊更新第一提交資訊,其中,提交模組106還用於將更新後的鎖定檔案提交至檔案伺服器。具體地,如果第二判斷模組110判斷快取伺服器中鎖定檔案的提交資訊和檔案伺服器中原始檔案的提交資訊不匹配,說明檔案伺服器中原始檔案已經被更新,例如,使用者透過檔案伺服器的用戶端對原始檔案進行了更新,則更新模組111將鎖定檔案的內容保存為副本,並獲 取原始檔案的內容,根據原始檔案的內容對鎖定檔案的內容進行更新。在使用者A在解決鎖定檔案的內容和原始檔案的內容之間的衝突之後,提交模組106將快取伺服器中的鎖定檔案的提交資訊更新為檔案伺服器中原始檔案的提交資訊。然後,提交模組106將更新後的鎖定檔案非同步提交至檔案伺服器,將檔案伺服器中的原始檔案替換為更新後的鎖定檔案。 The update module 111 is configured to: when the second determining module 110 determines that the first submission information does not match the second submission information, update the locked file according to the second original file, and update the first submission information according to the second submission information, The submitting module 106 is further configured to submit the updated locked file to the file server. Specifically, if the second determining module 110 determines that the submission information of the locked file in the cache server does not match the submission information of the original file in the file server, the original file in the file server has been updated, for example, the user When the client of the file server updates the original file, the update module 111 saves the content of the locked file as a copy, obtains the content of the original file, and updates the content of the locked file according to the content of the original file. After the user A resolves the conflict between the content of the locked file and the content of the original file, the submitting module 106 updates the submission information of the locked file in the cache server to the submission information of the original file in the file server. Then, the submitting module 106 asynchronously submits the updated locked file to the file server, and replaces the original file in the file server with the updated locked file.
在本申請案的一個實施例中,檔案讀寫裝置還包括第三接收模組112和解鎖模組113。其中,第三接收模組112用於接收針對快取伺服器中鎖定檔案的解鎖請求。解鎖模組113用於在第一判斷模組108判斷第一使用者標識資訊與鎖定檔案對應的第二使用者標識資訊匹配時,從快取伺服器中刪除鎖定檔案。具體而言,具體地,在使用者A對鎖定檔案編輯完成之後,使用者A可以發送對鎖定檔案進行解鎖的請求,第三接收模組112在接收到使用者A發送的解鎖請求後,提示使用者即將對鎖定檔案解鎖,並提示使用者是否在解鎖前將鎖定檔案提交至檔案伺服器中。在使用者A確認對鎖定檔案解鎖之後,第一判斷模組108根據檔案標識資訊在快取伺服器中查找到對應的鎖定檔案,並判斷鎖定檔案對應的使用者標識資訊是否和使用者A的使用者標識資訊匹配。如果第一判斷模組108判斷鎖定檔案對應的使用者標識資訊和使用者A的使用者標識資訊匹配,則解鎖模組113從快取伺服器中刪除該鎖定檔案。 In an embodiment of the present application, the file reading and writing device further includes a third receiving module 112 and an unlocking module 113. The third receiving module 112 is configured to receive an unlock request for a locked file in the cache server. The unlocking module 113 is configured to delete the locked file from the cache server when the first determining module 108 determines that the first user identification information matches the second user identification information corresponding to the locked file. Specifically, after the user A finishes editing the lock file, the user A may send a request to unlock the lock file, and the third receiving module 112 prompts the user after receiving the unlock request sent by the user A. The user will unlock the locked file and prompt the user to submit the locked file to the file server before unlocking. After the user A confirms that the locked file is unlocked, the first determining module 108 finds the corresponding locked file in the cache server according to the file identification information, and determines whether the user identification information corresponding to the locked file is related to the user A. User ID information matches. If the first determining module 108 determines that the user identification information corresponding to the locked file matches the user identification information of the user A, the unlocking module 113 deletes the locked file from the cache server.
在本申請案的一個實施例中,檔案讀寫裝置還包括第四接收模組114、替換模組115和第二提示模組116。其中,第四接收模組114用於接收針對第二使用者標識資訊的替換請求。替換模組115用於根據替換請求將第二使用者標識資訊替換為第一使用者標識資訊。第二提示模組116用於生成第二使用者標識資訊被替換的提示資訊。具體地,如果使用者B沒有許可權獲取鎖定檔案進行編輯,而使用者B又急需對鎖定檔案進行編輯,此時該檔案被使用者A鎖定,則使用者B可以選擇搶鎖,直接將具有鎖定檔案的讀寫許可權的使用者A變為使用者B具有許可權。也就是說,使用者B發送對快取伺服器中鎖定檔案所對應的使用者標識資訊的替換請求,第四接收模組114在接收到使用者B發送的替換請求後,替換模組115將鎖定檔案的使用者標識資訊替換為使用者B的使用者標識資訊,第二提示模組116生成鎖定檔案的使用者標識資訊被替換的提示資訊以提示使用者A。 In an embodiment of the present application, the file reading and writing device further includes a fourth receiving module 114, a replacement module 115, and a second prompting module 116. The fourth receiving module 114 is configured to receive a replacement request for the second user identification information. The replacement module 115 is configured to replace the second user identification information with the first user identification information according to the replacement request. The second prompt module 116 is configured to generate prompt information that the second user identification information is replaced. Specifically, if user B does not have permission to acquire the locked file for editing, and user B urgently needs to edit the locked file, and the file is locked by user A, user B can choose to steal the lock and directly have User A who locks the read/write permission of the file becomes user B with permission. That is, the user B sends a replacement request for the user identification information corresponding to the locked file in the cache server, and after receiving the replacement request sent by the user B, the fourth receiving module 114 replaces the module 115. The user identification information of the locked file is replaced with the user identification information of the user B, and the second prompting module 116 generates the prompt information for the user identification information of the locked file to be replaced to prompt the user A.
本申請案實施例的檔案讀寫裝置,為使用者提供檔案鎖定、檔案解鎖和搶鎖等功能,解決了多人協同開發時提交的內容互相衝突、互相覆蓋的問題,同時使用快取伺服器保存鎖定檔案可以解決多個WebIDE伺服器中資訊不同步的問題,使得多人協同開發時能夠充分發揮快速、不受環境限制的優勢。 The file reading and writing device of the embodiment of the present application provides functions such as file locking, file unlocking and lock-up for the user, and solves the problem that the content submitted by the multi-person collaborative development conflicts and covers each other, and uses the cache server at the same time. Saving the lock file can solve the problem of unsynchronized information in multiple WebIDE servers, so that multi-person collaborative development can fully utilize the advantages of fast and environmentally unrestricted.
為了實現上述實施例,本申請案還提出一種檔案讀寫系統。 In order to implement the above embodiments, the present application also proposes a file reading and writing system.
圖8是本申請案一個實施例的檔案讀寫裝置的結構示意圖,如圖8所示,檔案讀寫系統包括:WebIDE伺服器1、快取伺服器2和檔案伺服器3。 FIG. 8 is a schematic structural diagram of a file reading and writing apparatus according to an embodiment of the present application. As shown in FIG. 8, the file reading and writing system includes: a WebIDE server 1, a cache server 2, and a file server 3.
具體地,WebIDE伺服器1用於接收訪問請求,並根據訪問請求獲取檔案標識資訊和第一使用者標識資訊,以及在快取伺服器2中查詢檔案標識資訊對應的鎖定檔案,如果未查詢到檔案標識資訊對應的鎖定檔案,則從檔案伺服器3獲取檔案標識資訊對應的第一原始檔案,並根據第一使用者標識資訊和第一原始檔案生成鎖定檔案,並將鎖定檔案提交至快取伺服器2,以及接收針對第一原始檔案的編輯操作,並將編輯後的第一原始檔案提交至快取伺服器2;以及 Specifically, the WebIDE server 1 is configured to receive an access request, and obtain the file identification information and the first user identification information according to the access request, and query the cache file 2 for the lock file corresponding to the file identification information, if not The locked file corresponding to the file identification information is obtained from the file server 3, and the first original file corresponding to the file identification information is obtained, and the locked file is generated according to the first user identification information and the first original file, and the locked file is submitted to the cache. The server 2, and receiving an editing operation for the first original file, and submitting the edited first original file to the cache server 2;
快取伺服器2用於儲存鎖定檔案,並根據編輯後的第一原始檔案對鎖定檔案進行更新。 The cache server 2 is configured to store the lock file and update the lock file according to the edited first original file.
在本申請案的一個實施例中,WebIDE伺服器1還用於當查詢到檔案標識資訊對應的鎖定檔案時,判斷第一使用者標識資訊是否與鎖定檔案對應的第二使用者標識資訊匹配,若第一使用者標識資訊與第二使用者標識資訊匹配,則從快取伺服器2中獲取鎖定檔案。 In an embodiment of the present application, the WebIDE server 1 is further configured to: when the locked file corresponding to the file identification information is queried, determine whether the first user identification information matches the second user identification information corresponding to the locked file, If the first user identification information matches the second user identification information, the lock file is obtained from the cache server 2.
在本申請案的一個實施例中,WebIDE伺服器1還用於當第一使用者標識資訊與第二使用者標識資訊不匹配時,生成拒絕獲取鎖定檔案的提示資訊。 In an embodiment of the present application, the WebIDE server 1 is further configured to generate prompt information for refusing to acquire the locked file when the first user identification information does not match the second user identification information.
在本申請案的一個實施例中,檔案伺服器3儲存有第二原始檔案,其中第二原始檔案為第一原始檔案更新後的 版本,WebIDE伺服器1還用於從檔案伺服器3獲取第二原始檔案,並判斷快取伺服器2中鎖定檔案的第一提交資訊與第二原始檔案的第二提交資訊是否匹配,當第一提交資訊與第二提交資訊匹配時,將鎖定檔案提交至檔案伺服器3。檔案伺服器3還用於第二原始檔案替換為鎖定檔案。 In an embodiment of the present application, the file server 3 stores a second original file, wherein the second original file is an updated version of the first original file, and the WebIDE server 1 is further used to obtain the first file from the file server 3. Second, the original file, and determine whether the first submission information of the locked file in the cache server 2 matches the second submission information of the second original file, and when the first submission information matches the second submission information, the locked file is submitted to File Server 3. The file server 3 is also used to replace the second original file with a locked file.
在本申請案的一個實施例中,WebIDE伺服器1還用於當第一提交資訊與第二提交資訊不匹配時,根據第二原始檔案對鎖定檔案進行更新,並根據第二提交資訊更新第一提交資訊,以及將更新後的鎖定檔案提交至檔案伺服器3。檔案伺服器3還用於將第二原始檔案替換為更新後的鎖定檔案。 In an embodiment of the present application, the WebIDE server 1 is further configured to: when the first submission information does not match the second submission information, update the locked file according to the second original file, and update the information according to the second submission information. Submit the information and submit the updated lock file to the file server 3. The file server 3 is also used to replace the second original file with the updated lock file.
在本申請案的一個實施例中,WebIDE伺服器1還用於接收針對快取伺服器2中鎖定檔案的解鎖請求,並在判斷第一使用者標識資訊與鎖定檔案對應的第二使用者標識資訊匹配時,從快取伺服器2中刪除鎖定檔案。 In an embodiment of the present application, the WebIDE server 1 is further configured to receive an unlock request for the locked file in the cache server 2, and determine a second user identifier corresponding to the first user identifier information and the lock file. When the information matches, the lock file is deleted from the cache server 2.
在本申請案的一個實施例中,WebIDE伺服器1還用於接收針對第二使用者標識資訊的替換請求,並根據替換請求將第二使用者標識資訊替換為第一使用者標識資訊,以及生成第二使用者標識資訊被替換的提示資訊。 In an embodiment of the present application, the WebIDE server 1 is further configured to receive a replacement request for the second user identification information, and replace the second user identification information with the first user identification information according to the replacement request, and Generate prompt information that the second user identification information is replaced.
另外,根據本申請案實施例的檔案讀寫系統實現方式以及作用可以參考上述實施例中檔案讀寫方法和檔案讀寫裝置的實現方式,為了減少冗餘,此處不做贅述。 In addition, the implementation and function of the file reading and writing system according to the embodiment of the present application can be referred to the implementation manner of the file reading and writing method and the file reading and writing device in the above embodiment. To reduce redundancy, no further details are provided herein.
本申請案實施例的檔案讀寫系統,透過快取伺服器實 現了適用於WebIDE系統的檔案鎖定機制,利用快取伺服器作為檔案伺服器和WebIDE伺服器之間緩衝,使用快取機制實現檔案的鎖定,從而使得使用者在對檔案操作的過程中擁有檔案的獨享操作權,避免了多個使用者對同一個檔案操作時提交的內容互相衝突,使得WebIDE系統能夠在多個協作開發過程中發揮更大的作用。此外,使用快取機制實現檔案的鎖定,比每次都修改檔案伺服器的資料庫相比成本更低,且快取機制能夠更加靈活地處理多種檔案、產生同一個檔案的不同副本等等,給使用者更好的體驗。 The file reading and writing system of the embodiment of the present application implements a file locking mechanism suitable for the WebIDE system through a cache server, and uses a cache server as a buffer between the file server and the WebIDE server, and uses a cache mechanism to implement the file. Locking, so that the user has the exclusive operation right of the file during the operation of the file, avoiding conflicts between the content submitted by multiple users when operating the same file, so that the WebIDE system can be in multiple collaborative development processes. Play a bigger role. In addition, using the cache mechanism to lock the file is cheaper than modifying the file server's database each time, and the cache mechanism can handle multiple files more flexibly, generate different copies of the same file, and so on. Give users a better experience.
進而,為使用者提供檔案鎖定、檔案解鎖和搶鎖等功能,解決了多人協同開發時提交的內容互相衝突、互相覆蓋的問題,同時使用快取伺服器保存鎖定檔案可以解決多個WebIDE伺服器中資訊不同步的問題,使得多人協同開發時能夠充分發揮快速、不受環境限制的優勢。 Furthermore, the user is provided with functions such as file locking, file unlocking and lock-up, which solves the problem that the content submitted by the multi-person collaborative development conflicts and covers each other, and the use of the cache server to save the locked file can solve multiple WebIDE servos. The problem of unsynchronized information in the device makes it possible for multiple people to fully exploit the advantages of being fast and not subject to environmental constraints.
應當理解,本申請案的各部分可以用硬體、軟體、固件或它們的組合來實現。在上述實施方式中,多個步驟或方法可以用儲存在記憶體中且由合適的指令執行系統執行的軟體或固件來實現。例如,如果用硬體來實現,和在另一實施方式中一樣,可用本領域公知的下列技術中的任一項或他們的組合來實現:具有用於對資料信號實現邏輯功能的邏輯門電路的離散邏輯電路,具有合適的組合邏輯門電路的專用積體電路,可程式設計閘陣列(PGA),現場可程式設計閘陣列(FPGA)等。 It should be understood that portions of the present application can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods may be implemented with software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented by any one or combination of the following techniques well known in the art: having logic gates for implementing logic functions on data signals Discrete logic circuits, dedicated integrated circuits with suitable combinational logic gates, programmable gate arrays (PGAs), field programmable gate arrays (FPGAs), etc.
在本說明書的描述中,參考術語“一個實施例”、“一些實施例”、“示例”、“具體示例”、或“一些示例”等的描述意指結合該實施例或示例描述的具體特徵、結構、材料或者特點包含於本申請案的至少一個實施例或示例中。在本說明書中,對上述術語的示意性表述不必須針對的是相同的實施例或示例。而且,描述的具體特徵、結構、材料或者特點可以在任一個或多個實施例或示例中以合適的方式結合。此外,在不相互矛盾的情況下,本領域的技術人員可以將本說明書中描述的不同實施例或示例以及不同實施例或示例的特徵進行結合和組合。 In the description of the present specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" and the like means a specific feature described in connection with the embodiment or example. The structure, materials, or features are included in at least one embodiment or example of the application. In the present specification, the schematic representation of the above terms is not necessarily directed to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in a suitable manner in any one or more embodiments or examples. In addition, various embodiments or examples described in the specification, as well as features of various embodiments or examples, may be combined and combined.
儘管上面已經示出和描述了本申請案的實施例,可以理解的是,上述實施例是示例性的,不能理解為對本申請案的限制,本領域的普通技術人員在本申請案的範圍內可以對上述實施例進行變化、修改、替換和變型。 While the embodiments of the present application have been shown and described above, it is understood that the foregoing embodiments are illustrative and are not to be construed as limiting the scope of the present application. Variations, modifications, substitutions and variations of the above-described embodiments are possible.
Claims (21)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
TW106101923A TW201828100A (en) | 2017-01-19 | 2017-01-19 | File reading and writing method, apparatus and system avoiding conflicts between contents submitted by multiple users when operating the same file |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
TW106101923A TW201828100A (en) | 2017-01-19 | 2017-01-19 | File reading and writing method, apparatus and system avoiding conflicts between contents submitted by multiple users when operating the same file |
Publications (1)
Publication Number | Publication Date |
---|---|
TW201828100A true TW201828100A (en) | 2018-08-01 |
Family
ID=63960235
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
TW106101923A TW201828100A (en) | 2017-01-19 | 2017-01-19 | File reading and writing method, apparatus and system avoiding conflicts between contents submitted by multiple users when operating the same file |
Country Status (1)
Country | Link |
---|---|
TW (1) | TW201828100A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112905533A (en) * | 2021-02-05 | 2021-06-04 | 优车库网络科技发展(深圳)有限公司 | File submission management method, device, equipment and storage medium |
-
2017
- 2017-01-19 TW TW106101923A patent/TW201828100A/en unknown
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112905533A (en) * | 2021-02-05 | 2021-06-04 | 优车库网络科技发展(深圳)有限公司 | File submission management method, device, equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2017028688A1 (en) | Method, device and system for reading and writing files | |
CN108932282B (en) | Database migration method and device and storage medium | |
US20210182311A1 (en) | Storage interface for synchronizing content | |
US9977811B2 (en) | Presenting availability statuses of synchronized objects | |
JP6448609B2 (en) | Data acquisition method and system | |
KR101840996B1 (en) | Checkpoints for a file system | |
EP2863310B1 (en) | Data processing method and apparatus, and shared storage device | |
KR101647535B1 (en) | Cross-channel coauthoring consistency | |
US8965862B2 (en) | Directory oplock | |
US7809778B2 (en) | Idempotent journal mechanism for file system | |
KR101690824B1 (en) | Consistency without ordering dependency | |
US20130198309A1 (en) | Clustering Without Shared Storage | |
KR20130107280A (en) | Directory leasing | |
US20120284244A1 (en) | Transaction processing device, transaction processing method and transaction processing program | |
US20220417251A1 (en) | Team member transfer tool | |
CN110737682A (en) | cache operation method, device, storage medium and electronic equipment | |
JP2012238061A (en) | Transaction processing device, transaction processing method, and transaction processing program | |
TW201828100A (en) | File reading and writing method, apparatus and system avoiding conflicts between contents submitted by multiple users when operating the same file | |
CN117539847A (en) | Data migration method, device, system, computer equipment and storage medium | |
JP2010277347A (en) | Operation exclusive management device and operation exclusive management program |