WO2021164165A1 - File lock processing method and apparatus, electronic device, and storage medium - Google Patents

File lock processing method and apparatus, electronic device, and storage medium Download PDF

Info

Publication number
WO2021164165A1
WO2021164165A1 PCT/CN2020/098005 CN2020098005W WO2021164165A1 WO 2021164165 A1 WO2021164165 A1 WO 2021164165A1 CN 2020098005 W CN2020098005 W CN 2020098005W WO 2021164165 A1 WO2021164165 A1 WO 2021164165A1
Authority
WO
WIPO (PCT)
Prior art keywords
file
lock
request
file lock
blocking
Prior art date
Application number
PCT/CN2020/098005
Other languages
French (fr)
Chinese (zh)
Inventor
臧林劼
何营
Original Assignee
苏州浪潮智能科技有限公司
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 苏州浪潮智能科技有限公司 filed Critical 苏州浪潮智能科技有限公司
Publication of WO2021164165A1 publication Critical patent/WO2021164165A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/176Support for shared access to files; File sharing support
    • G06F16/1767Concurrency control, e.g. optimistic or pessimistic approaches
    • G06F16/1774Locking methods, e.g. locking methods for file systems allowing shared and concurrent access to files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/182Distributed file systems
    • G06F16/1824Distributed file systems implemented using Network-attached Storage [NAS] architecture
    • G06F16/183Provision of network file services by network file servers, e.g. by using NFS, CIFS
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/52Program synchronisation; Mutual exclusion, e.g. by means of semaphores
    • G06F9/524Deadlock detection or avoidance

Definitions

  • This application relates to the field of computer technology, and more specifically, to a file lock processing method and device, an electronic device, and a computer-readable storage medium.
  • the storage server will have a huge number of clients, and multiple clients will access files on the server at the same time, which will inevitably cause file conflicts. Collaboration between terminals and ensuring the consistency of file data have become the focus of software users and developers.
  • File lock is a mechanism to achieve file synchronization in multitasking operation scenarios, ensuring file data consistency and preventing conflicts. If a process tries to write to a file that is being read by other processes, it may cause a read operation The process reads some corrupted or incomplete data. If two processes write to the same file concurrently, the file may be damaged. Therefore, in order to avoid this kind of problem, a mechanism must be adopted to solve the synchronization problem faced by multiple processes concurrently accessing the same file, resulting in file locking technology.
  • Asynchronous blocking lock means that the client initiates a lock request, the current thread is suspended, and if the file is occupied, it waits until the call returns, sending a Granged message to the client that sent the lock request to authorize the lock.
  • the client will wait forever, and the maintainability of file locks is poor.
  • the purpose of this application is to provide a file lock processing method and device, an electronic device, and a computer-readable storage medium to improve the maintainability of the file lock in the file system.
  • this application provides a file lock processing method applied to a server, including:
  • the blocking chain table includes all file lock requests currently suspended by the target file system
  • the file lock state includes a non-blocking lock state and a polling blocking lock state
  • the blocking state is returned to the client that initiated the target file lock request, so that the client initiates the target file lock request every preset time until the target file lock request is responded by the server, wherein the target file
  • the lock request is a file lock request whose file lock state is the polling blocking lock state.
  • the obtaining the blocking chain list of the target file system includes:
  • the file lock state corresponding to the file lock request is determined to be the non-blocking lock state; if If the file lock request includes a write request to the target file, the file lock state corresponding to the file lock request is determined to be an asynchronous blocking lock state.
  • the obtaining the blocking chain list of the target file system includes:
  • the determining the file lock status corresponding to each file lock request according to the request type of each file lock request includes:
  • the file lock request is a read request for the target file, determining the file lock state corresponding to the file lock request as the non-blocking lock state;
  • the file lock state corresponding to the file lock request is determined as the polling block lock state.
  • the determining the file lock status corresponding to each file lock request according to the request type of each file lock request includes:
  • a file lock processing device including:
  • An obtaining module configured to obtain a blocking chain list of the target file system; wherein the blocking chain table includes all file lock requests currently suspended by the target file system;
  • the judging module is used to judge whether the target file system supports asynchronous blocking lock; if not, start the work flow of the first determining module;
  • the first determining module is configured to determine the file lock state corresponding to each file lock request according to the request type of each file lock request; wherein, the file lock state includes a non-blocking lock state and a polling block Lock status
  • the return module is used to return the blocking state to the client that initiated the target file lock request, so that the client initiates the target file lock request every preset time until the target file lock request is responded by the server, wherein ,
  • the target file lock request is a file lock request whose file lock state is the polling block lock state.
  • the obtaining module is specifically a module that obtains the blocking chain list of the target file system when a file lock request of the target file in the target file system is received by the target client.
  • an electronic device including:
  • Memory used to store computer programs
  • the processor is used to implement the steps of the file lock processing method when the computer program is executed.
  • the present application provides a computer-readable storage medium having a computer program stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the file lock processing method described above are implemented.
  • the file lock processing method includes: obtaining a block chain list of the target file system; wherein the block chain list includes all file locks currently suspended in the target file system.
  • Request determine whether the target file system supports asynchronous blocking locks; if not, determine the file lock status corresponding to each file lock request according to the request type of each file lock request; wherein, the file lock status includes unblocked Block lock status and polling block lock status; return the blocking status to the client that initiated the target file lock request, so that the client initiates the target file lock request every preset time until the target file lock request is blocked
  • the server responds, wherein the target file lock request is a file lock request whose file lock state is the polling block lock state.
  • the file lock processing method when the target file system does not support asynchronous blocking locks, the corresponding file lock status is determined based on the request type of each file lock request, so that all file lock requests in the blocked lock chain are filed. Recognition of lock status.
  • the blocking state is returned to the client that initiated the file lock request polling the blocking lock state, and the client re-initiates the file lock request at a preset time after receiving the blocking state, until the file lock request is responded by the server. It can be seen that the file lock processing method provided by the present application improves the maintainability of file lock management in the file system by identifying the file lock status, and ensures the high consistency of files in concurrent services.
  • the application also discloses a file lock processing device, an electronic device and a computer-readable storage medium, which can also achieve the above technical effects.
  • Fig. 1 is a flow chart showing a file lock processing method according to an exemplary embodiment
  • Fig. 2 is a flowchart showing another file lock processing method according to an exemplary embodiment
  • Figure 3 is an architecture diagram of the NFS-Ganesha file lock request processing flow
  • Figure 4 is a process flow chart of the method for identifying asynchronous blocked file locks by polling
  • Fig. 5 is a structural diagram of a file lock processing device according to an exemplary embodiment
  • Fig. 6 is a structural diagram of an electronic device according to an exemplary embodiment.
  • the embodiment of the present application discloses a file lock processing method, which improves the maintainability of the file lock in the file system.
  • a flowchart of a method for processing a file lock according to an exemplary embodiment, as shown in Fig. 1, includes:
  • S101 Obtain a blocking chain list of the target file system; wherein the blocking chain table includes all file lock requests currently suspended by the target file system;
  • the target file system in this embodiment is a distributed file system, such as the NFS-Ganesha user-mode network file system, which can manage millions of data caches, avoiding the problem of blocking the underlying file system, and NFS-Ganesha has a flexible internal allocation mechanism , User mode program can allocate a large amount of memory for internal use of the program, effectively solving the problem of data caching.
  • NFS-Ganesha can interface with a variety of underlying distributed file systems.
  • the FSAL (File System Abstraction Layer) file system abstraction layer is a very important module.
  • FSAL itself provides a common interface for Inode Cache and File Content Cache, which will be called after receiving the request.
  • Specific FSAL such as virtual file system (VFS), distributed file system, etc.
  • the file lock request when a file lock request for a file in the target file system is received from the client, when the file lock is in the file lock state and the file lock is in a non-blocking lock state, the file lock request is suspended, that is, the file lock request is suspended.
  • the file lock request is added to the blocking chain list. In other words, the blocking chain list of the target file system stores all file lock requests that are currently suspended.
  • this embodiment does not limit the trigger condition of this step.
  • the block chain list of the target file system is acquired .
  • the block chain list of the target file system is obtained at preset time intervals.
  • S102 Determine whether the target file system supports asynchronous blocking lock; if not, go to S103;
  • Asynchronous blocking lock means that the client initiates a lock request, the current thread is suspended, and if the file is occupied, it waits until the call returns, sending a Granged message to the client that sent the lock request to authorize the lock.
  • S103 Determine the file lock state corresponding to each file lock request according to the request type of each file lock request; wherein, the file lock state includes a non-blocking lock state and a polling blocking lock state;
  • File lock status includes non-blocking lock status and polling blocking lock status.
  • Non-blocking lock status means that the client initiates a lock request. The current thread will not be suspended, but will immediately return to execute the next call. If the file is occupied, immediately return.
  • the blocking lock state means that the NFS client initiates a lock request, the current thread is suspended, and waits if the file is occupied.
  • Polling blocking lock status means that the client initiates a lock request every preset time until the lock request is responded.
  • this step includes: creating a thread pool, and using the target thread in the thread pool to traverse the blocking chain list, so as to determine the blocking chain list according to the request type of each file lock request
  • the polling thread is built, the thread pool is initialized, and the thread parameters are set.
  • set the maximum/minimum number of threads in the thread pool to 1, and set the polling thread Time interval, set the calling rules of the polling thread processing process.
  • the above polling thread time interval is a thread time interval variable, ranging from 0 to 180s, and the default polling time is 10s.
  • the polling thread calling rule means that the polling thread cyclically blocks the lock polling function.
  • the function of the blocking lock polling function is to poll all the blocking locks of type STATE_BLOCK_POLL, and loop through the blocking locks of type STATE_BLOCK_POLL in the double-linked list of blocking locks.
  • S104 Return a blocking state to the client that initiated the target file lock request, so that the client initiates the target file lock request every preset time until the target file lock request is responded to by the server, where the The target file lock request is a file lock request whose file lock state is the polling blocking lock state.
  • the blocking state is returned to the client that initiated the file lock request polling the blocking lock state, and the client re-initiates the file lock request every preset time after receiving the blocking state, until the file lock request is responded by the server. It can be seen that when the file system does not support asynchronous blocking locks and the client initiates an asynchronous blocking lock request, the return status is marked as blocked. The purpose is to prevent file lock conflicts from unclear recognition of the file lock status and confusion to prevent The file lock status is misjudged.
  • the file lock processing method when the target file system does not support asynchronous blocking locks, the corresponding file lock status is determined based on the request type of each file lock request, and all file lock requests in the blocked lock chain are realized. Perform file lock status recognition. The blocking state is returned to the client that initiated the file lock request polling the blocking lock state, and the client re-initiates the file lock request at a preset time after receiving the blocking state, until the file lock request is responded by the server. It can be seen that the file lock processing method provided by the embodiment of the present application improves the maintainability of file lock management in the file system by identifying the file lock status, and ensures the high consistency of files in concurrent services.
  • the embodiment of the application discloses a file lock processing method. Compared with the previous embodiment, this embodiment further illustrates and optimizes the technical solution. specific:
  • FIG. 2 a flowchart of another file lock processing method according to an exemplary embodiment, as shown in FIG. 2, includes:
  • S202 Determine whether the target file system supports asynchronous blocking locks; if yes, go to S203; if not, go to S204;
  • S203 If the file lock request is a read request for the target file, determine the file lock state corresponding to the file lock request as the non-blocking lock state; if the file lock request includes the target file For a file write request, the file lock state corresponding to the file lock request is determined to be an asynchronous blocking lock state;
  • S204 Create a thread pool, and use the target thread in the thread pool to traverse the blocking chain list;
  • S205 If the file lock request is a read request for the target file, determine the file lock state corresponding to the file lock request as the non-blocking lock state; if the file lock request includes the target file For a file write request, the file lock state corresponding to the file lock request is determined as the polling blocking lock state.
  • an exclusive lock needs to be allocated to the client due to operations such as modification of the target file. If the target file already has an exclusive lock of another client at this time, the file lock state corresponding to the file lock request needs to be marked as the polling blocking lock state, so that the client can poll and send the file lock request in the subsequent steps until it is responded.
  • S206 Return a blocking state to the client that initiated the target file lock request, so that the client initiates the target file lock request every preset time until the target file lock request is responded by the server.
  • the construction thread of this embodiment polls the blocking chain list, realizes the marking of the file lock status of the file lock request, improves the maintainability of the file lock management in the network file system, and ensures that the file is in the concurrent business. Is highly consistent.
  • FIG. 3 is an architecture diagram of an NFS-Ganesha file lock request processing flow
  • FIG. 4 is a processing flowchart of a method for identifying an asynchronously blocked file lock by polling.
  • the NFS file lock request is defined as a shared read lock. Since the client does not perform a write operation, the file lock state that marks the file lock request is a non-blocking lock state.
  • the NFS file lock request is defined as an exclusive write lock. Due to operations such as modifying the file, it is a blocking lock.
  • the server performs two processing: The first is that the underlying distributed file system supports asynchronous blocking locks. When the first client releases the lock, the server actively informs the client The end lock is released, and the second client in the blocked state can be authorized to lock.
  • the second type is that when the distributed file system does not support asynchronous blocking locks, the server performs polling and the client passively waits for authorization to realize the asynchronous blocking function of multiple clients.
  • the following describes a file lock processing device provided by an embodiment of the present application.
  • the file lock processing device described below and the file lock processing method described above can refer to each other.
  • FIG. 5 a structural diagram of a file lock processing device according to an exemplary embodiment, as shown in FIG. 5, includes:
  • the obtaining module 501 is configured to obtain the blocking chain list of the target file system; wherein the blocking chain table includes all file lock requests currently suspended by the target file system;
  • the judging module 502 is used to judge whether the target file system supports asynchronous blocking lock; if not, start the work flow of the first determining module 503;
  • the first determining module 503 is configured to determine the file lock state corresponding to each file lock request according to the request type of each file lock request; wherein, the file lock state includes non-blocking lock state and polling Blocking lock state;
  • the return module 504 is configured to return a blocking state to the client that initiated the target file lock request, so that the client initiates the target file lock request every preset time until the target file lock request is responded by the server,
  • the target file lock request is a file lock request whose file lock state is the polling block lock state.
  • the file lock processing device when the target file system does not support asynchronous blocking locks, the corresponding file lock status is determined based on the request type of each file lock request, so as to realize all file lock requests in the blocked lock chain. Perform file lock status recognition.
  • the blocking state is returned to the client that initiated the file lock request polling the blocking lock state, and the client re-initiates the file lock request at a preset time after receiving the blocking state, until the file lock request is responded by the server. It can be seen that the file lock processing device provided by the embodiment of the present application improves the maintainability of the file lock management in the file system by identifying the file lock status, and ensures the high consistency of files in concurrent services.
  • the acquiring module 501 is specifically configured to acquire the file lock request of the target file system from the target client when it receives a file lock request for the target file in the target file system. Block the module of the chain list.
  • the second determining module is configured to determine that the file lock status corresponding to the file lock request is the file lock status corresponding to the file lock request if the file lock request is a read request for the target file when the target file system supports asynchronous blocking locks.
  • the acquiring module 501 is specifically a module that acquires the blocking chain list of the target file system at predetermined time intervals.
  • the first determining module 503 includes:
  • a first determining unit configured to determine the file lock state corresponding to the file lock request as the non-blocking lock state if the file lock request is a read request for the target file;
  • the second determining unit is configured to, if the file lock request includes a write request to the target file, determine the file lock state corresponding to the file lock request as the polling block lock state.
  • the first determining module 503 specifically creates a thread pool, and uses the target thread in the thread pool to traverse the blocking chain list, so that according to each The request type of the file lock request determines the module of the file lock state corresponding to each file lock request in the blocked lock chain table.
  • the present application also provides an electronic device.
  • a structural diagram of an electronic device 600 provided in an embodiment of the present application, as shown in FIG. 6, may include a processor 11 and a memory 12.
  • the electronic device 600 may also include one or more of a multimedia component 13, an input/output (I/O) interface 14, and a communication component 15.
  • I/O input/output
  • the processor 11 is used to control the overall operation of the electronic device 600 to complete all or part of the steps in the file lock processing method described above.
  • the memory 12 is used to store various types of data to support operations on the electronic device 600. These data may include, for example, instructions for any application or method to operate on the electronic device 600, as well as application-related data. For example, contact data, messages sent and received, pictures, audio, video, etc.
  • the memory 12 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (Static Random Access Memory, SRAM for short), electrically erasable programmable read-only memory ( Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-only Memory (Read-Only Memory, ROM for short), magnetic memory, flash memory, magnetic disk or optical disk.
  • the multimedia component 13 may include a screen and an audio component.
  • the screen may be a touch screen, for example, and the audio component is used to output and/or input audio signals.
  • the audio component may include a microphone, which is used to receive external audio signals.
  • the received audio signal may be further stored in the memory 12 or transmitted through the communication module 15.
  • the audio component also includes at least one speaker for outputting audio signals.
  • the I/O interface 14 provides an interface between the processor 11 and other interface modules.
  • the above-mentioned other interface modules may be a keyboard, a mouse, a button, and the like. These buttons can be virtual buttons or physical buttons.
  • the communication component 15 is used for wired or wireless communication between the electronic device 600 and other devices. Wireless communication, such as Wi-Fi, Bluetooth, Near Field Communication (NFC), 2G, 3G, or 4G, or a combination of one or more of them, so the corresponding communication component 15 may include: Wi-Fi module, Bluetooth module, NFC module.
  • the electronic device 600 may be used by one or more application specific integrated circuits (Application Specific Integrated Circuit, ASIC for short), digital signal processor (Digital Signal Processor, DSP for short), and digital signal processing equipment (Digital Signal Processor for short).
  • ASIC Application Specific Integrated Circuit
  • DSP Digital Signal Processor
  • DSP Digital Signal Processor
  • Digital Signal Processor Digital Signal Processor for short
  • Signal Processing Device DSPD for short
  • PLD Programmable Logic Device
  • FPGA Field Programmable Gate Array
  • controller microcontroller, microprocessor or other electronic components Implementation, used to execute the above-mentioned file lock processing method.
  • a computer-readable storage medium including program instructions, which implement the steps of the file lock processing method described above when the program instructions are executed by a processor.
  • the computer-readable storage medium may be the foregoing memory 12 including program instructions, and the foregoing program instructions may be executed by the processor 11 of the electronic device 600 to complete the foregoing file lock processing method.

Landscapes

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

Abstract

Provided are a file lock processing method and apparatus, an electronic device, and a computer-readable storage medium. The method comprises: acquiring a blocking lock chain table of a target file system, wherein the blocking lock chain table comprises all file lock requests of the target file system that are suspended at present; determining whether the target file system supports an asynchronous blocking lock; if not, determining, according to the request type of each file lock request, a file lock state corresponding to each file lock request, wherein the file lock state comprises a non-blocking lock state and a blocking lock polling state; and returning a blocking state to a client initiating a target file lock request, so that the client initiates the target file lock request every preset time until the target file lock request is responded to by a server, wherein the target file lock request is a file lock request, the file lock state of which is the blocking lock polling state. By means of the file lock processing method provided in the present application, the maintainability of file lock management in a file system is improved.

Description

一种文件锁处理方法、装置及电子设备和存储介质File lock processing method, device, electronic equipment and storage medium
本申请要求于2020年2月20日提交中国专利局、申请号为202010105189.6、发明名称为“一种文件锁处理方法、装置及电子设备和存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of a Chinese patent application filed with the Chinese Patent Office, the application number is 202010105189.6, and the invention title is "a file lock processing method, device, electronic equipment and storage medium" on February 20, 2020, and its entire content Incorporated in this application by reference.
技术领域Technical field
本申请涉及计算机技术领域,更具体地说,涉及一种文件锁处理方法、装置及一种电子设备和一种计算机可读存储介质。This application relates to the field of computer technology, and more specifically, to a file lock processing method and device, an electronic device, and a computer-readable storage medium.
背景技术Background technique
海量存储业务中,用户对数据的传输性能和稳定性要求越来越高,存储服务器将拥有数目庞大的客户端,多个客户端同时对服务器文件进行访问操作,势必会造成文件冲突,各个客户端相互协同、保证文件数据一致性已经成为软件使用者和开发者关注的重点。In the mass storage business, users have higher and higher requirements for data transmission performance and stability. The storage server will have a huge number of clients, and multiple clients will access files on the server at the same time, which will inevitably cause file conflicts. Collaboration between terminals and ensuring the consistency of file data have become the focus of software users and developers.
文件锁是在多任务操作场景中实现文件同步的一种机制,保证了文件数据一致性防止冲突,如果一个进程尝试对正在被其他进程读取的文件进行写操作,可能会导致正在进行读操作的进程读取到一些被破坏或者不完整的数据,如果两个进程并发对同一个文件进行写操作,可能会导致该文件遭到破坏。因此,为了避免发生这种问题,必须要采用某种机制来解决多个进程并发访问同一个文件时所面临的同步问题,由此而产生了文件加锁方面的技术。File lock is a mechanism to achieve file synchronization in multitasking operation scenarios, ensuring file data consistency and preventing conflicts. If a process tries to write to a file that is being read by other processes, it may cause a read operation The process reads some corrupted or incomplete data. If two processes write to the same file concurrently, the file may be damaged. Therefore, in order to avoid this kind of problem, a mechanism must be adopted to solve the synchronization problem faced by multiple processes concurrently accessing the same file, resulting in file locking technology.
异步阻塞锁是指客户端发起锁请求,当前线程被挂起,如果文件被占用则等待,直到当调用返回的时候,向发送锁请求的客户端发送Granged消息,从而进行锁的授权。在分布式文件系统应用场景中,如果文件系统不支持异步阻塞锁,则客户端会进行一直等待,文件锁的可维护性较差。Asynchronous blocking lock means that the client initiates a lock request, the current thread is suspended, and if the file is occupied, it waits until the call returns, sending a Granged message to the client that sent the lock request to authorize the lock. In a distributed file system application scenario, if the file system does not support asynchronous blocking locks, the client will wait forever, and the maintainability of file locks is poor.
因此,如何提高文件系统中文件锁的可维护性是本领域技术人员需要解决的技术问题。Therefore, how to improve the maintainability of the file lock in the file system is a technical problem that needs to be solved by those skilled in the art.
发明内容Summary of the invention
本申请的目的在于提供一种文件锁处理方法、装置及一种电子设备和一种计算机可读存储介质,提高了文件系统中文件锁的可维护性。The purpose of this application is to provide a file lock processing method and device, an electronic device, and a computer-readable storage medium to improve the maintainability of the file lock in the file system.
为实现上述目的,本申请提供了一种文件锁处理方法,应用于服务器,包括:In order to achieve the above objective, this application provides a file lock processing method applied to a server, including:
获取所述目标文件系统的阻塞锁链表;其中,所述阻塞锁链表包括所述目标文件系统当前被挂起的所有文件锁请求;Acquiring a blocking chain list of the target file system; wherein the blocking chain table includes all file lock requests currently suspended by the target file system;
判断目标文件系统是否支持异步阻塞锁;Determine whether the target file system supports asynchronous blocking locks;
若否,则根据每个所述文件锁请求的请求类型确定每个所述文件锁请求对应的文件锁状态;其中,所述文件锁状态包括无阻塞锁状态和轮询阻塞锁状态;If not, determine the file lock state corresponding to each file lock request according to the request type of each file lock request; wherein, the file lock state includes a non-blocking lock state and a polling blocking lock state;
向发起目标文件锁请求的客户端返回阻塞状态,以便所述客户端每隔预设时间发起所述目标文件锁请求,直至所述目标文件锁请求被所述服务器响应,其中,所述目标文件锁请求为文件锁状态为所述轮询阻塞锁状态的文件锁请求。The blocking state is returned to the client that initiated the target file lock request, so that the client initiates the target file lock request every preset time until the target file lock request is responded by the server, wherein the target file The lock request is a file lock request whose file lock state is the polling blocking lock state.
其中,所述获取所述目标文件系统的阻塞锁链表,包括:Wherein, the obtaining the blocking chain list of the target file system includes:
当接收到目标客户端对所述目标文件系统中目标文件的文件锁请求时,获取所述目标文件系统的阻塞锁链表。When receiving a file lock request from the target client for the target file in the target file system, obtain the block chain list of the target file system.
其中,还包括:Among them, it also includes:
当所述目标文件系统支持异步阻塞锁时,若所述文件锁请求为对所述目标文件的读请求,则将所述文件锁请求对应的文件锁状态确定为所述无阻塞锁状态;若所述文件锁请求包括对所述目标文件的写请求,则将所述文件锁请求对应的文件锁状态确定为异步阻塞锁状态。When the target file system supports asynchronous blocking locks, if the file lock request is a read request for the target file, the file lock state corresponding to the file lock request is determined to be the non-blocking lock state; if If the file lock request includes a write request to the target file, the file lock state corresponding to the file lock request is determined to be an asynchronous blocking lock state.
其中,所述获取所述目标文件系统的阻塞锁链表,包括:Wherein, the obtaining the blocking chain list of the target file system includes:
每隔预设时间间隔获取所述目标文件系统的阻塞锁链表。Obtain the blocking chain list of the target file system every preset time interval.
其中,所述根据每个所述文件锁请求的请求类型确定每个所述文件锁请求对应的文件锁状态,包括:Wherein, the determining the file lock status corresponding to each file lock request according to the request type of each file lock request includes:
若所述文件锁请求为对所述目标文件的读请求,则将所述文件锁请求对应的文件锁状态确定为所述无阻塞锁状态;If the file lock request is a read request for the target file, determining the file lock state corresponding to the file lock request as the non-blocking lock state;
若所述文件锁请求包括对所述目标文件的写请求,则将所述文件锁请求对应的文件锁状态确定为所述轮询阻塞锁状态。If the file lock request includes a write request for the target file, the file lock state corresponding to the file lock request is determined as the polling block lock state.
其中,所述根据每个所述文件锁请求的请求类型确定每个所述文件锁请求对应的文件锁状态,包括:Wherein, the determining the file lock status corresponding to each file lock request according to the request type of each file lock request includes:
创建线程池,并利用所述线程池中的目标线程遍历所述阻塞锁链表,以便根据每个所述文件锁请求的请求类型确定所述阻塞锁链表中每个所述文件锁请求对应的文件锁状态。Create a thread pool, and use the target thread in the thread pool to traverse the blocking chain list, so as to determine the file corresponding to each file lock request in the blocking chain table according to the request type of each file lock request Lock state.
为实现上述目的,本申请提供了一种文件锁处理装置,包括:In order to achieve the above objective, the present application provides a file lock processing device, including:
获取模块,用于获取所述目标文件系统的阻塞锁链表;其中,所述阻塞锁链表包括所述目标文件系统当前被挂起的所有文件锁请求;An obtaining module, configured to obtain a blocking chain list of the target file system; wherein the blocking chain table includes all file lock requests currently suspended by the target file system;
判断模块,用于判断目标文件系统是否支持异步阻塞锁;若否,则启动第一确定模块的工作流程;The judging module is used to judge whether the target file system supports asynchronous blocking lock; if not, start the work flow of the first determining module;
所述第一确定模块,用于根据每个所述文件锁请求的请求类型确定每个所述文件锁请求对应的文件锁状态;其中,所述文件锁状态包括无阻塞锁状态和轮询阻塞锁状态;The first determining module is configured to determine the file lock state corresponding to each file lock request according to the request type of each file lock request; wherein, the file lock state includes a non-blocking lock state and a polling block Lock status
返回模块,用于向发起目标文件锁请求的客户端返回阻塞状态,以便所述客户端每隔预设时间发起所述目标文件锁请求,直至所述目标文件锁请求被所述服务器响应,其中,所述目标文件锁请求为文件锁状态为所述轮询阻塞锁状态的文件锁请求。The return module is used to return the blocking state to the client that initiated the target file lock request, so that the client initiates the target file lock request every preset time until the target file lock request is responded by the server, wherein , The target file lock request is a file lock request whose file lock state is the polling block lock state.
其中,所述获取模块具体为当接收到目标客户端对所述目标文件系统中目标文件的文件锁请求时,获取所述目标文件系统的阻塞锁链表的模块。Wherein, the obtaining module is specifically a module that obtains the blocking chain list of the target file system when a file lock request of the target file in the target file system is received by the target client.
为实现上述目的,本申请提供了一种电子设备,包括:In order to achieve the above objective, this application provides an electronic device, including:
存储器,用于存储计算机程序;Memory, used to store computer programs;
处理器,用于执行所述计算机程序时实现如上述文件锁处理方法的步骤。The processor is used to implement the steps of the file lock processing method when the computer program is executed.
为实现上述目的,本申请提供了一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时实现如上述文件锁处理方法的步骤。To achieve the foregoing objective, the present application provides a computer-readable storage medium having a computer program stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the file lock processing method described above are implemented.
通过以上方案可知,本申请提供的一种文件锁处理方法,包括:获取 所述目标文件系统的阻塞锁链表;其中,所述阻塞锁链表包括所述目标文件系统当前被挂起的所有文件锁请求;判断目标文件系统是否支持异步阻塞锁;若否,则根据每个所述文件锁请求的请求类型确定每个所述文件锁请求对应的文件锁状态;其中,所述文件锁状态包括无阻塞锁状态和轮询阻塞锁状态;向发起目标文件锁请求的客户端返回阻塞状态,以便所述客户端每隔预设时间发起所述目标文件锁请求,直至所述目标文件锁请求被所述服务器响应,其中,所述目标文件锁请求为文件锁状态为所述轮询阻塞锁状态的文件锁请求。It can be seen from the above solution that the file lock processing method provided by the present application includes: obtaining a block chain list of the target file system; wherein the block chain list includes all file locks currently suspended in the target file system. Request; determine whether the target file system supports asynchronous blocking locks; if not, determine the file lock status corresponding to each file lock request according to the request type of each file lock request; wherein, the file lock status includes unblocked Block lock status and polling block lock status; return the blocking status to the client that initiated the target file lock request, so that the client initiates the target file lock request every preset time until the target file lock request is blocked The server responds, wherein the target file lock request is a file lock request whose file lock state is the polling block lock state.
本申请提供的文件锁处理方法,当目标文件系统不支持异步阻塞锁时,基于每个文件锁请求的请求类型确定其对应的文件锁状态,实现对阻塞锁链表中的所有文件锁请求进行文件锁状态的识别。向发起轮询阻塞锁状态的文件锁请求的客户端返回阻塞状态,客户端接收到该阻塞状态后每隔预设时间重新发起文件锁请求,直至文件锁请求被服务器响应。由此可见,本申请提供的文件锁处理方法,通过标识文件锁状态,提高了文件系统中文件锁管理的可维护性,保证了在并发业务中文件的具有高度一致性。本申请还公开了一种文件锁处理装置及一种电子设备和一种计算机可读存储介质,同样能实现上述技术效果。In the file lock processing method provided by this application, when the target file system does not support asynchronous blocking locks, the corresponding file lock status is determined based on the request type of each file lock request, so that all file lock requests in the blocked lock chain are filed. Recognition of lock status. The blocking state is returned to the client that initiated the file lock request polling the blocking lock state, and the client re-initiates the file lock request at a preset time after receiving the blocking state, until the file lock request is responded by the server. It can be seen that the file lock processing method provided by the present application improves the maintainability of file lock management in the file system by identifying the file lock status, and ensures the high consistency of files in concurrent services. The application also discloses a file lock processing device, an electronic device and a computer-readable storage medium, which can also achieve the above technical effects.
应当理解的是,以上的一般描述和后文的细节描述仅是示例性的,并不能限制本申请。It should be understood that the above general description and the following detailed description are only exemplary and cannot limit the application.
附图说明Description of the drawings
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。附图是用来提供对本公开的进一步理解,并且构成说明书的一部分,与下面的具体实施方式一起用于解释本公开,但并不构成对本公开的限制。在附图中:In order to more clearly describe the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only These are some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work. The accompanying drawings are used to provide a further understanding of the present disclosure and constitute a part of the specification. Together with the following specific embodiments, they are used to explain the present disclosure, but do not constitute a limitation to the present disclosure. In the attached picture:
图1为根据一示例性实施例示出的一种文件锁处理方法的流程图;Fig. 1 is a flow chart showing a file lock processing method according to an exemplary embodiment;
图2为根据一示例性实施例示出的另一种文件锁处理方法的流程图;Fig. 2 is a flowchart showing another file lock processing method according to an exemplary embodiment;
图3为NFS-Ganesha文件锁请求处理流程架构图;Figure 3 is an architecture diagram of the NFS-Ganesha file lock request processing flow;
图4为通过轮询方式标识异步阻塞文件锁的方法处理流程图Figure 4 is a process flow chart of the method for identifying asynchronous blocked file locks by polling
图5为根据一示例性实施例示出的一种文件锁处理装置的结构图;Fig. 5 is a structural diagram of a file lock processing device according to an exemplary embodiment;
图6为根据一示例性实施例示出的一种电子设备的结构图。Fig. 6 is a structural diagram of an electronic device according to an exemplary embodiment.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative work shall fall within the protection scope of this application.
本申请实施例公开了一种文件锁处理方法,提高了文件系统中文件锁的可维护性。The embodiment of the present application discloses a file lock processing method, which improves the maintainability of the file lock in the file system.
参见图1,根据一示例性实施例示出的一种文件锁处理方法的流程图,如图1所示,包括:Referring to Fig. 1, a flowchart of a method for processing a file lock according to an exemplary embodiment, as shown in Fig. 1, includes:
S101:获取所述目标文件系统的阻塞锁链表;其中,所述阻塞锁链表包括所述目标文件系统当前被挂起的所有文件锁请求;S101: Obtain a blocking chain list of the target file system; wherein the blocking chain table includes all file lock requests currently suspended by the target file system;
本实施例中的目标文件系统为分布式文件系统,例如NFS-Ganesha用户态网络文件系统,可以管理百万级数据缓存,避免了底层文件系统阻塞的问题,NFS-Ganesha具有灵活的内分配机制,用户态程序可以分配大量内存来供程序内部使用,有效的解决数据缓存的问题。NFS-Ganesha可以对接多种底层分布式文件系统,FSAL(File System Abstraction Layer)文件系统抽象层是非常重要的模块,FSAL本身给Inode Cache和File Content Cache提供了通用接口,收到请求后会调用具体的FSAL,例如虚拟文件系统(VFS)、分布式文件系统等。The target file system in this embodiment is a distributed file system, such as the NFS-Ganesha user-mode network file system, which can manage millions of data caches, avoiding the problem of blocking the underlying file system, and NFS-Ganesha has a flexible internal allocation mechanism , User mode program can allocate a large amount of memory for internal use of the program, effectively solving the problem of data caching. NFS-Ganesha can interface with a variety of underlying distributed file systems. The FSAL (File System Abstraction Layer) file system abstraction layer is a very important module. FSAL itself provides a common interface for Inode Cache and File Content Cache, which will be called after receiving the request. Specific FSAL, such as virtual file system (VFS), distributed file system, etc.
在具体实施中,当接收到客户端对目标文件系统中某一文件的文件锁请求时,当该文件存在文件锁,文件锁为非无阻塞锁状态时,挂起该文件锁请求,即将该文件锁请求加入阻塞锁链表中。也就是说,目标文件系统 的阻塞锁链表存储当前被挂起的所有文件锁请求。In specific implementation, when a file lock request for a file in the target file system is received from the client, when the file lock is in the file lock state and the file lock is in a non-blocking lock state, the file lock request is suspended, that is, the file lock request is suspended. The file lock request is added to the blocking chain list. In other words, the blocking chain list of the target file system stores all file lock requests that are currently suspended.
需要说明的是,本实施例不对本步骤的触发条件进行限定,例如,当接收到目标客户端对所述目标文件系统中目标文件的文件锁请求时,获取所述目标文件系统的阻塞锁链表。又如,每隔预设时间间隔获取所述目标文件系统的阻塞锁链表。It should be noted that this embodiment does not limit the trigger condition of this step. For example, when a file lock request of a target file in the target file system is received by a target client, the block chain list of the target file system is acquired . For another example, the block chain list of the target file system is obtained at preset time intervals.
S102:判断目标文件系统是否支持异步阻塞锁;若否,则进入S103;S102: Determine whether the target file system supports asynchronous blocking lock; if not, go to S103;
当目标文件系统支持异步阻塞锁时,若客户端请求的文件已存在文件锁,且该文件锁位非阻塞锁状态时,直接响应客户端的文件锁请求,否则将该文件锁请求的阻塞锁状态标记位异步阻塞锁状态。异步阻塞锁是指客户端发起锁请求,当前线程被挂起,如果文件被占用则等待,直到当调用返回的时候,向发送锁请求的客户端发送Granged消息,从而进行锁的授权。When the target file system supports asynchronous blocking lock, if the file requested by the client already has a file lock and the file lock is in the non-blocking lock state, it directly responds to the file lock request of the client, otherwise the file lock request is in the blocking lock state The flag bit asynchronously blocks the lock state. Asynchronous blocking lock means that the client initiates a lock request, the current thread is suspended, and if the file is occupied, it waits until the call returns, sending a Granged message to the client that sent the lock request to authorize the lock.
S103:根据每个所述文件锁请求的请求类型确定每个所述文件锁请求对应的文件锁状态;其中,所述文件锁状态包括无阻塞锁状态和轮询阻塞锁状态;S103: Determine the file lock state corresponding to each file lock request according to the request type of each file lock request; wherein, the file lock state includes a non-blocking lock state and a polling blocking lock state;
当目标文件系统不支持异步阻塞锁时,可以根据文件锁请求的请求类型确定其对应的文件锁状态。文件锁状态包括无阻塞锁状态和轮询阻塞锁状态,无阻塞锁状态是指客户端发起锁请求,当前线程不会被挂起,而是立即返回执行下一个调用,如果文件被占用则立即返回。阻塞锁状态是指NFS客户端发起锁请求,当前线程被挂起,如果文件被占用则等待。轮询阻塞锁状态是指客户端每隔预设时间发起锁请求,直至该锁请求被响应。When the target file system does not support asynchronous blocking locks, the corresponding file lock status can be determined according to the request type of the file lock request. File lock status includes non-blocking lock status and polling blocking lock status. Non-blocking lock status means that the client initiates a lock request. The current thread will not be suspended, but will immediately return to execute the next call. If the file is occupied, immediately return. The blocking lock state means that the NFS client initiates a lock request, the current thread is suspended, and waits if the file is occupied. Polling blocking lock status means that the client initiates a lock request every preset time until the lock request is responded.
在本步骤中,可以定义阻塞锁轮询函数,首先,创建共用体标识四种阻塞锁状态,包括无阻塞锁状态STATE_BLOCK_NONE、阻塞锁状态STATE_BLOCK_INTERNAL,异步阻塞锁状态STATE_BLOCK_ASYNC,轮询阻塞锁状态STATE_BLOCK_POLL。具体结构如下:In this step, you can define the blocking lock polling function. First, create a union to identify four blocking lock states, including non-blocking lock state STATE_BLOCK_NONE, blocking lock state STATE_BLOCK_INTERNAL, asynchronous blocking lock state STATE_BLOCK_ASYNC, and polling blocking lock state STATE_BLOCK_POLL. The specific structure is as follows:
Figure PCTCN2020098005-appb-000001
Figure PCTCN2020098005-appb-000001
Figure PCTCN2020098005-appb-000002
Figure PCTCN2020098005-appb-000002
作为一种优选实施方式,本步骤包括:创建线程池,并利用所述线程池中的目标线程遍历所述阻塞锁链表,以便根据每个所述文件锁请求的请求类型确定所述阻塞锁链表中每个所述文件锁请求对应的文件锁状态。在具体实施中,建轮询线程,初始化线程池,并设置线程参数,在轮询场景中,为了避免系统资源浪费,设置线程池中的线程最大/最小个数为1,设置轮询线程的时间间隔,设置轮询线程处理过程的调用规则。上述轮询线程的时间间隔是线程时间间隔变量,范围为0到180s,默认10s轮询一次。轮询线程调用规则是指该轮询线程循环阻塞锁轮询函数。阻塞锁轮询函数的作用是轮询所有类型为STATE_BLOCK_POLL的阻塞锁,在状态为阻塞锁双链表中循环遍历类型为STATE_BLOCK_POLL的阻塞锁。As a preferred embodiment, this step includes: creating a thread pool, and using the target thread in the thread pool to traverse the blocking chain list, so as to determine the blocking chain list according to the request type of each file lock request The file lock status corresponding to each of the file lock requests in. In the specific implementation, the polling thread is built, the thread pool is initialized, and the thread parameters are set. In the polling scenario, in order to avoid wasting system resources, set the maximum/minimum number of threads in the thread pool to 1, and set the polling thread Time interval, set the calling rules of the polling thread processing process. The above polling thread time interval is a thread time interval variable, ranging from 0 to 180s, and the default polling time is 10s. The polling thread calling rule means that the polling thread cyclically blocks the lock polling function. The function of the blocking lock polling function is to poll all the blocking locks of type STATE_BLOCK_POLL, and loop through the blocking locks of type STATE_BLOCK_POLL in the double-linked list of blocking locks.
S104:向发起目标文件锁请求的客户端返回阻塞状态,以便所述客户端每隔预设时间发起所述目标文件锁请求,直至所述目标文件锁请求被所述服务器响应,其中,所述目标文件锁请求为文件锁状态为所述轮询阻塞锁状态的文件锁请求。S104: Return a blocking state to the client that initiated the target file lock request, so that the client initiates the target file lock request every preset time until the target file lock request is responded to by the server, where the The target file lock request is a file lock request whose file lock state is the polling blocking lock state.
在本步骤中,向发起轮询阻塞锁状态的文件锁请求的客户端返回阻塞状态,客户端接收到该阻塞状态后每隔预设时间重新发起文件锁请求,直至文件锁请求被服务器响应。可见,当文件系统不支持异步阻塞锁、客户端发起异步阻塞锁请求时,将返回状态标记为阻塞状态,目的是防止文件锁冲突的情况下,对文件锁状态识别不清晰,发生混淆,防止文件锁状态误判。In this step, the blocking state is returned to the client that initiated the file lock request polling the blocking lock state, and the client re-initiates the file lock request every preset time after receiving the blocking state, until the file lock request is responded by the server. It can be seen that when the file system does not support asynchronous blocking locks and the client initiates an asynchronous blocking lock request, the return status is marked as blocked. The purpose is to prevent file lock conflicts from unclear recognition of the file lock status and confusion to prevent The file lock status is misjudged.
本申请实施例提供的文件锁处理方法,当目标文件系统不支持异步阻塞锁时,基于每个文件锁请求的请求类型确定其对应的文件锁状态,实现对阻塞锁链表中的所有文件锁请求进行文件锁状态的识别。向发起轮询阻塞锁状态的文件锁请求的客户端返回阻塞状态,客户端接收到该阻塞状态后每隔预设时间重新发起文件锁请求,直至文件锁请求被服务器响应。由此可见,本申请实施例提供的文件锁处理方法,通过标识文件锁状态,提高了文件系统中文件锁管理的可维护性,保证了在并发业务中文件的具有 高度一致性。In the file lock processing method provided by the embodiments of the present application, when the target file system does not support asynchronous blocking locks, the corresponding file lock status is determined based on the request type of each file lock request, and all file lock requests in the blocked lock chain are realized. Perform file lock status recognition. The blocking state is returned to the client that initiated the file lock request polling the blocking lock state, and the client re-initiates the file lock request at a preset time after receiving the blocking state, until the file lock request is responded by the server. It can be seen that the file lock processing method provided by the embodiment of the present application improves the maintainability of file lock management in the file system by identifying the file lock status, and ensures the high consistency of files in concurrent services.
本申请实施例公开了一种文件锁处理方法,相对于上一实施例,本实施例对技术方案作了进一步的说明和优化。具体的:The embodiment of the application discloses a file lock processing method. Compared with the previous embodiment, this embodiment further illustrates and optimizes the technical solution. specific:
参见图2,根据一示例性实施例示出的另一种文件锁处理方法的流程图,如图2所示,包括:Referring to FIG. 2, a flowchart of another file lock processing method according to an exemplary embodiment, as shown in FIG. 2, includes:
S201:当接收到目标客户端对所述目标文件系统中目标文件的文件锁请求时,获取所述目标文件系统的阻塞锁链表;S201: When a file lock request of a target file in the target file system is received by a target client, acquire a block chain list of the target file system;
S202:判断目标文件系统是否支持异步阻塞锁;若是,则进入S203;若否,则进入S204;S202: Determine whether the target file system supports asynchronous blocking locks; if yes, go to S203; if not, go to S204;
S203:若所述文件锁请求为对所述目标文件的读请求,则将所述文件锁请求对应的文件锁状态确定为所述无阻塞锁状态;若所述文件锁请求包括对所述目标文件的写请求,则将所述文件锁请求对应的文件锁状态确定为异步阻塞锁状态;S203: If the file lock request is a read request for the target file, determine the file lock state corresponding to the file lock request as the non-blocking lock state; if the file lock request includes the target file For a file write request, the file lock state corresponding to the file lock request is determined to be an asynchronous blocking lock state;
S204:创建线程池,并利用所述线程池中的目标线程遍历所述阻塞锁链表;S204: Create a thread pool, and use the target thread in the thread pool to traverse the blocking chain list;
S205:若所述文件锁请求为对所述目标文件的读请求,则将所述文件锁请求对应的文件锁状态确定为所述无阻塞锁状态;若所述文件锁请求包括对所述目标文件的写请求,则将所述文件锁请求对应的文件锁状态确定为所述轮询阻塞锁状态。S205: If the file lock request is a read request for the target file, determine the file lock state corresponding to the file lock request as the non-blocking lock state; if the file lock request includes the target file For a file write request, the file lock state corresponding to the file lock request is determined as the polling blocking lock state.
在具体实施中,若客户端请求的位目标文件的写请求,由于需要对目标文件进行修改等操作,需要为该客户端分配独占锁。若此时目标文件已存在其他客户端的独占锁,需要将该文件锁请求对应的文件锁状态标记为轮询阻塞锁状态,以便后续步骤客户端轮询发送文件锁请求,直至被响应。In a specific implementation, if the client requests a write request for a target file, an exclusive lock needs to be allocated to the client due to operations such as modification of the target file. If the target file already has an exclusive lock of another client at this time, the file lock state corresponding to the file lock request needs to be marked as the polling blocking lock state, so that the client can poll and send the file lock request in the subsequent steps until it is responded.
S206:向发起目标文件锁请求的客户端返回阻塞状态,以便所述客户端每隔预设时间发起所述目标文件锁请求,直至所述目标文件锁请求被所述服务器响应。S206: Return a blocking state to the client that initiated the target file lock request, so that the client initiates the target file lock request every preset time until the target file lock request is responded by the server.
由此可见,本实施例构建线程对阻塞锁链表进行轮询,实现对文件锁请求的文件锁状态的标记,提高了网络文件系统中文件锁管理的可维护性, 保证了在并发业务中文件的具有高度一致性。It can be seen that the construction thread of this embodiment polls the blocking chain list, realizes the marking of the file lock status of the file lock request, improves the maintainability of the file lock management in the network file system, and ensures that the file is in the concurrent business. Is highly consistent.
下面介绍本申请提供的一种应用实施例,具体的,图3为NFS-Ganesha文件锁请求处理流程架构图,图4为通过轮询方式标识异步阻塞文件锁的方法处理流程图。The following introduces an application embodiment provided by the present application. Specifically, FIG. 3 is an architecture diagram of an NFS-Ganesha file lock request processing flow, and FIG. 4 is a processing flowchart of a method for identifying an asynchronously blocked file lock by polling.
对于不同客户端先后发起对同一文件的读操作的情况,NFS文件锁请求定义为共享读锁,由于客户端不进行写操作,标记文件锁请求的文件锁状态为无阻塞锁状态。For the case where different clients successively initiate read operations on the same file, the NFS file lock request is defined as a shared read lock. Since the client does not perform a write operation, the file lock state that marks the file lock request is a non-blocking lock state.
对于不同客户端先后发起对同一文件的写操作的情况,NFS文件锁请求定义为独占写锁,由于对文件进行修改等操作,属于阻塞锁,当一个客户端具有写锁时,另一个客户端等待,此时处于阻塞状态,服务端收到阻塞指令后,进行两种处理:第一种是底层分布式文件系统支持异步阻塞锁,当第一个客户端释放锁后,服务端主动通知客户端锁释放,处于阻塞状态的第二个客户端即可被授权锁。本第二种是分布式文件系统不支持异步阻塞锁时,服务端进行轮询,客户端被动等待授权,用以实现多客户端异步阻塞功能。For the case where different clients successively initiate write operations to the same file, the NFS file lock request is defined as an exclusive write lock. Due to operations such as modifying the file, it is a blocking lock. When one client has a write lock, the other client has a write lock. Waiting. At this time, it is in a blocking state. After receiving the blocking instruction, the server performs two processing: The first is that the underlying distributed file system supports asynchronous blocking locks. When the first client releases the lock, the server actively informs the client The end lock is released, and the second client in the blocked state can be authorized to lock. The second type is that when the distributed file system does not support asynchronous blocking locks, the server performs polling and the client passively waits for authorization to realize the asynchronous blocking function of multiple clients.
对于不同客户端先后发起对同一文件的读、写操作的情况,由于包含写操作,因此也属于独占锁,与上述情况类似,在此不再赘述。对于不同客户端先后发起对不同文件的读、写操作的情况,由于对不同文件的操作,互不影响。For the case where different clients successively initiate read and write operations on the same file, since it includes write operations, it is also an exclusive lock, which is similar to the above situation and will not be repeated here. In the case where different clients successively initiate read and write operations on different files, the operations on different files do not affect each other.
下面对本申请实施例提供的一种文件锁处理装置进行介绍,下文描述的一种文件锁处理装置与上文描述的一种文件锁处理方法可以相互参照。The following describes a file lock processing device provided by an embodiment of the present application. The file lock processing device described below and the file lock processing method described above can refer to each other.
参见图5,根据一示例性实施例示出的一种文件锁处理装置的结构图,如图5所示,包括:Referring to FIG. 5, a structural diagram of a file lock processing device according to an exemplary embodiment, as shown in FIG. 5, includes:
获取模块501,用于获取所述目标文件系统的阻塞锁链表;其中,所述阻塞锁链表包括所述目标文件系统当前被挂起的所有文件锁请求;The obtaining module 501 is configured to obtain the blocking chain list of the target file system; wherein the blocking chain table includes all file lock requests currently suspended by the target file system;
判断模块502,用于判断目标文件系统是否支持异步阻塞锁;若否,则启动第一确定模块503的工作流程;The judging module 502 is used to judge whether the target file system supports asynchronous blocking lock; if not, start the work flow of the first determining module 503;
所述第一确定模块503,用于根据每个所述文件锁请求的请求类型确定每个所述文件锁请求对应的文件锁状态;其中,所述文件锁状态包括无阻塞锁状态和轮询阻塞锁状态;The first determining module 503 is configured to determine the file lock state corresponding to each file lock request according to the request type of each file lock request; wherein, the file lock state includes non-blocking lock state and polling Blocking lock state;
返回模块504,用于向发起目标文件锁请求的客户端返回阻塞状态,以便所述客户端每隔预设时间发起所述目标文件锁请求,直至所述目标文件锁请求被所述服务器响应,其中,所述目标文件锁请求为文件锁状态为所述轮询阻塞锁状态的文件锁请求。The return module 504 is configured to return a blocking state to the client that initiated the target file lock request, so that the client initiates the target file lock request every preset time until the target file lock request is responded by the server, Wherein, the target file lock request is a file lock request whose file lock state is the polling block lock state.
本申请实施例提供的文件锁处理装置,当目标文件系统不支持异步阻塞锁时,基于每个文件锁请求的请求类型确定其对应的文件锁状态,实现对阻塞锁链表中的所有文件锁请求进行文件锁状态的识别。向发起轮询阻塞锁状态的文件锁请求的客户端返回阻塞状态,客户端接收到该阻塞状态后每隔预设时间重新发起文件锁请求,直至文件锁请求被服务器响应。由此可见,本申请实施例提供的文件锁处理装置,通过标识文件锁状态,提高了文件系统中文件锁管理的可维护性,保证了在并发业务中文件的具有高度一致性。In the file lock processing device provided by the embodiment of the present application, when the target file system does not support asynchronous blocking locks, the corresponding file lock status is determined based on the request type of each file lock request, so as to realize all file lock requests in the blocked lock chain. Perform file lock status recognition. The blocking state is returned to the client that initiated the file lock request polling the blocking lock state, and the client re-initiates the file lock request at a preset time after receiving the blocking state, until the file lock request is responded by the server. It can be seen that the file lock processing device provided by the embodiment of the present application improves the maintainability of the file lock management in the file system by identifying the file lock status, and ensures the high consistency of files in concurrent services.
在上述实施例的基础上,作为一种优选实施方式,所述获取模块501具体为当接收到目标客户端对所述目标文件系统中目标文件的文件锁请求时,获取所述目标文件系统的阻塞锁链表的模块。On the basis of the foregoing embodiment, as a preferred implementation, the acquiring module 501 is specifically configured to acquire the file lock request of the target file system from the target client when it receives a file lock request for the target file in the target file system. Block the module of the chain list.
在上述实施例的基础上,作为一种优选实施方式,还包括:On the basis of the foregoing embodiment, as a preferred implementation manner, it further includes:
第二确定模块,用于当所述目标文件系统支持异步阻塞锁时,若所述文件锁请求为对所述目标文件的读请求,则将所述文件锁请求对应的文件锁状态确定为所述无阻塞锁状态;若所述文件锁请求包括对所述目标文件的写请求,则将所述文件锁请求对应的文件锁状态确定为异步阻塞锁状态。The second determining module is configured to determine that the file lock status corresponding to the file lock request is the file lock status corresponding to the file lock request if the file lock request is a read request for the target file when the target file system supports asynchronous blocking locks. The non-blocking lock state; if the file lock request includes a write request to the target file, the file lock state corresponding to the file lock request is determined to be an asynchronous blocking lock state.
在上述实施例的基础上,作为一种优选实施方式,所述获取模块501具体为每隔预设时间间隔获取所述目标文件系统的阻塞锁链表的模块。On the basis of the foregoing embodiment, as a preferred implementation manner, the acquiring module 501 is specifically a module that acquires the blocking chain list of the target file system at predetermined time intervals.
在上述实施例的基础上,作为一种优选实施方式,所述第一确定模块503包括:On the basis of the foregoing embodiment, as a preferred implementation manner, the first determining module 503 includes:
第一确定单元,用于若所述文件锁请求为对所述目标文件的读请求, 则将所述文件锁请求对应的文件锁状态确定为所述无阻塞锁状态;A first determining unit, configured to determine the file lock state corresponding to the file lock request as the non-blocking lock state if the file lock request is a read request for the target file;
第二确定单元,用于若若所述文件锁请求包括对所述目标文件的写请求,则将所述文件锁请求对应的文件锁状态确定为所述轮询阻塞锁状态。The second determining unit is configured to, if the file lock request includes a write request to the target file, determine the file lock state corresponding to the file lock request as the polling block lock state.
在上述实施例的基础上,作为一种优选实施方式,所述第一确定模块503具体为创建线程池,并利用所述线程池中的目标线程遍历所述阻塞锁链表,以便根据每个所述文件锁请求的请求类型确定所述阻塞锁链表中每个所述文件锁请求对应的文件锁状态的模块。On the basis of the foregoing embodiment, as a preferred implementation manner, the first determining module 503 specifically creates a thread pool, and uses the target thread in the thread pool to traverse the blocking chain list, so that according to each The request type of the file lock request determines the module of the file lock state corresponding to each file lock request in the blocked lock chain table.
关于上述实施例中的装置,其中各个模块执行操作的具体方式已经在有关该方法的实施例中进行了详细描述,此处将不做详细阐述说明。Regarding the device in the foregoing embodiment, the specific manner in which each module performs operation has been described in detail in the embodiment of the method, and detailed description will not be given here.
本申请还提供了一种电子设备,参见图6,本申请实施例提供的一种电子设备600的结构图,如图6所示,可以包括处理器11和存储器12。该电子设备600还可以包括多媒体组件13,输入/输出(I/O)接口14,以及通信组件15中的一者或多者。The present application also provides an electronic device. Referring to FIG. 6, a structural diagram of an electronic device 600 provided in an embodiment of the present application, as shown in FIG. 6, may include a processor 11 and a memory 12. The electronic device 600 may also include one or more of a multimedia component 13, an input/output (I/O) interface 14, and a communication component 15.
其中,处理器11用于控制该电子设备600的整体操作,以完成上述的文件锁处理方法中的全部或部分步骤。存储器12用于存储各种类型的数据以支持在该电子设备600的操作,这些数据例如可以包括用于在该电子设备600上操作的任何应用程序或方法的指令,以及应用程序相关的数据,例如联系人数据、收发的消息、图片、音频、视频等等。该存储器12可以由任何类型的易失性或非易失性存储设备或者它们的组合实现,例如静态随机存取存储器(Static Random Access Memory,简称SRAM),电可擦除可编程只读存储器(Electrically Erasable Programmable Read-Only Memory,简称EEPROM),可擦除可编程只读存储器(Erasable Programmable Read-Only Memory,简称EPROM),可编程只读存储器(Programmable Read-Only Memory,简称PROM),只读存储器(Read-Only Memory,简称ROM),磁存储器,快闪存储器,磁盘或光盘。多媒体组件13可以包括屏幕和音频组件。其中屏幕例如可以是触摸屏,音频组件用于输出和/或输入音频信号。例如,音频组件可以包括一个麦克风,麦克风用于接收外部音频信号。所接收的音频信号可以被进一步存储在存储器12或通过通信组 件15发送。音频组件还包括至少一个扬声器,用于输出音频信号。I/O接口14为处理器11和其他接口模块之间提供接口,上述其他接口模块可以是键盘,鼠标,按钮等。这些按钮可以是虚拟按钮或者实体按钮。通信组件15用于该电子设备600与其他设备之间进行有线或无线通信。无线通信,例如Wi-Fi,蓝牙,近场通信(Near Field Communication,简称NFC),2G、3G或4G,或它们中的一种或几种的组合,因此相应的该通信组件15可以包括:Wi-Fi模块,蓝牙模块,NFC模块。The processor 11 is used to control the overall operation of the electronic device 600 to complete all or part of the steps in the file lock processing method described above. The memory 12 is used to store various types of data to support operations on the electronic device 600. These data may include, for example, instructions for any application or method to operate on the electronic device 600, as well as application-related data. For example, contact data, messages sent and received, pictures, audio, video, etc. The memory 12 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (Static Random Access Memory, SRAM for short), electrically erasable programmable read-only memory ( Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-only Memory (Read-Only Memory, ROM for short), magnetic memory, flash memory, magnetic disk or optical disk. The multimedia component 13 may include a screen and an audio component. The screen may be a touch screen, for example, and the audio component is used to output and/or input audio signals. For example, the audio component may include a microphone, which is used to receive external audio signals. The received audio signal may be further stored in the memory 12 or transmitted through the communication module 15. The audio component also includes at least one speaker for outputting audio signals. The I/O interface 14 provides an interface between the processor 11 and other interface modules. The above-mentioned other interface modules may be a keyboard, a mouse, a button, and the like. These buttons can be virtual buttons or physical buttons. The communication component 15 is used for wired or wireless communication between the electronic device 600 and other devices. Wireless communication, such as Wi-Fi, Bluetooth, Near Field Communication (NFC), 2G, 3G, or 4G, or a combination of one or more of them, so the corresponding communication component 15 may include: Wi-Fi module, Bluetooth module, NFC module.
在一示例性实施例中,电子设备600可以被一个或多个应用专用集成电路(Application Specific Integrated Circuit,简称ASIC)、数字信号处理器(Digital Signal Processor,简称DSP)、数字信号处理设备(Digital Signal Processing Device,简称DSPD)、可编程逻辑器件(Programmable Logic Device,简称PLD)、现场可编程门阵列(Field Programmable Gate Array,简称FPGA)、控制器、微控制器、微处理器或其他电子元件实现,用于执行上述的文件锁处理方法。In an exemplary embodiment, the electronic device 600 may be used by one or more application specific integrated circuits (Application Specific Integrated Circuit, ASIC for short), digital signal processor (Digital Signal Processor, DSP for short), and digital signal processing equipment (Digital Signal Processor for short). Signal Processing Device, DSPD for short), Programmable Logic Device (PLD for short), Field Programmable Gate Array (FPGA for short), controller, microcontroller, microprocessor or other electronic components Implementation, used to execute the above-mentioned file lock processing method.
在另一示例性实施例中,还提供了一种包括程序指令的计算机可读存储介质,该程序指令被处理器执行时实现上述文件锁处理方法的步骤。例如,该计算机可读存储介质可以为上述包括程序指令的存储器12,上述程序指令可由电子设备600的处理器11执行以完成上述的文件锁处理方法。In another exemplary embodiment, there is also provided a computer-readable storage medium including program instructions, which implement the steps of the file lock processing method described above when the program instructions are executed by a processor. For example, the computer-readable storage medium may be the foregoing memory 12 including program instructions, and the foregoing program instructions may be executed by the processor 11 of the electronic device 600 to complete the foregoing file lock processing method.
说明书中各个实施例采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似部分互相参见即可。对于实施例公开的装置而言,由于其与实施例公开的方法相对应,所以描述的比较简单,相关之处参见方法部分说明即可。应当指出,对于本技术领域的普通技术人员来说,在不脱离本申请原理的前提下,还可以对本申请进行若干改进和修饰,这些改进和修饰也落入本申请权利要求的保护范围内。The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the various embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the description of the method part. It should be pointed out that for those of ordinary skill in the art, without departing from the principles of this application, several improvements and modifications can be made to this application, and these improvements and modifications also fall within the protection scope of the claims of this application.
还需要说明的是,在本说明书中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而 使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。It should also be noted that in this specification, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply these entities or operations. There is any such actual relationship or sequence between operations. Moreover, the terms "include", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes those that are not explicitly listed Other elements of, or also include elements inherent to this process, method, article or equipment. If there are no more restrictions, the element defined by the sentence "including a..." does not exclude the existence of other same elements in the process, method, article, or equipment that includes the element.

Claims (10)

  1. 一种文件锁处理方法,其特征在于,应用于服务器,包括:A file lock processing method, which is characterized in that it is applied to a server and includes:
    获取所述目标文件系统的阻塞锁链表;其中,所述阻塞锁链表包括所述目标文件系统当前被挂起的所有文件锁请求;Acquiring a blocking chain list of the target file system; wherein the blocking chain table includes all file lock requests currently suspended by the target file system;
    判断目标文件系统是否支持异步阻塞锁;Determine whether the target file system supports asynchronous blocking locks;
    若否,则根据每个所述文件锁请求的请求类型确定每个所述文件锁请求对应的文件锁状态;其中,所述文件锁状态包括无阻塞锁状态和轮询阻塞锁状态;If not, determine the file lock state corresponding to each file lock request according to the request type of each file lock request; wherein, the file lock state includes a non-blocking lock state and a polling blocking lock state;
    向发起目标文件锁请求的客户端返回阻塞状态,以便所述客户端每隔预设时间发起所述目标文件锁请求,直至所述目标文件锁请求被所述服务器响应,其中,所述目标文件锁请求为文件锁状态为所述轮询阻塞锁状态的文件锁请求。The blocking state is returned to the client that initiated the target file lock request, so that the client initiates the target file lock request every preset time until the target file lock request is responded by the server, wherein the target file The lock request is a file lock request whose file lock state is the polling blocking lock state.
  2. 根据权利要求1所述文件锁处理方法,其特征在于,所述获取所述目标文件系统的阻塞锁链表,包括:The file lock processing method according to claim 1, wherein said obtaining the block chain list of the target file system comprises:
    当接收到目标客户端对所述目标文件系统中目标文件的文件锁请求时,获取所述目标文件系统的阻塞锁链表。When receiving a file lock request from the target client for the target file in the target file system, obtain the block chain list of the target file system.
  3. 根据权利要求2所述文件锁处理方法,其特征在于,还包括:The file lock processing method according to claim 2, further comprising:
    当所述目标文件系统支持异步阻塞锁时,若所述文件锁请求为对所述目标文件的读请求,则将所述文件锁请求对应的文件锁状态确定为所述无阻塞锁状态;若所述文件锁请求包括对所述目标文件的写请求,则将所述文件锁请求对应的文件锁状态确定为异步阻塞锁状态。When the target file system supports asynchronous blocking locks, if the file lock request is a read request for the target file, the file lock state corresponding to the file lock request is determined to be the non-blocking lock state; if If the file lock request includes a write request to the target file, the file lock state corresponding to the file lock request is determined to be an asynchronous blocking lock state.
  4. 根据权利要求1所述文件锁处理方法,其特征在于,所述获取所述目标文件系统的阻塞锁链表,包括:The file lock processing method according to claim 1, wherein said obtaining the block chain list of the target file system comprises:
    每隔预设时间间隔获取所述目标文件系统的阻塞锁链表。Obtain the blocking chain list of the target file system every preset time interval.
  5. 根据权利要求2所述文件锁处理方法,其特征在于,所述根据每个所述文件锁请求的请求类型确定每个所述文件锁请求对应的文件锁状态,包括:The file lock processing method according to claim 2, wherein the determining the file lock status corresponding to each file lock request according to the request type of each file lock request comprises:
    若所述文件锁请求为对所述目标文件的读请求,则将所述文件锁请求对应的文件锁状态确定为所述无阻塞锁状态;If the file lock request is a read request for the target file, determining the file lock state corresponding to the file lock request as the non-blocking lock state;
    若所述文件锁请求包括对所述目标文件的写请求,则将所述文件锁请求对应的文件锁状态确定为所述轮询阻塞锁状态。If the file lock request includes a write request for the target file, the file lock state corresponding to the file lock request is determined as the polling block lock state.
  6. 根据权利要求1所述文件锁处理方法,其特征在于,所述根据每个所述文件锁请求的请求类型确定每个所述文件锁请求对应的文件锁状态,包括:The file lock processing method according to claim 1, wherein the determining the file lock status corresponding to each file lock request according to the request type of each file lock request comprises:
    创建线程池,并利用所述线程池中的目标线程遍历所述阻塞锁链表,以便根据每个所述文件锁请求的请求类型确定所述阻塞锁链表中每个所述文件锁请求对应的文件锁状态。Create a thread pool, and use the target thread in the thread pool to traverse the blocking chain list, so as to determine the file corresponding to each file lock request in the blocking chain table according to the request type of each file lock request Lock state.
  7. 一种文件锁处理装置,其特征在于,应用于服务器,包括:A file lock processing device, which is characterized in that it is applied to a server and includes:
    获取模块,用于获取所述目标文件系统的阻塞锁链表;其中,所述阻塞锁链表包括所述目标文件系统当前被挂起的所有文件锁请求;An obtaining module, configured to obtain a blocking chain list of the target file system; wherein the blocking chain table includes all file lock requests currently suspended by the target file system;
    判断模块,用于判断目标文件系统是否支持异步阻塞锁;若否,则启动第一确定模块的工作流程;The judging module is used to judge whether the target file system supports asynchronous blocking lock; if not, start the work flow of the first determining module;
    所述第一确定模块,用于根据每个所述文件锁请求的请求类型确定每个所述文件锁请求对应的文件锁状态;其中,所述文件锁状态包括无阻塞锁状态和轮询阻塞锁状态;The first determining module is configured to determine the file lock state corresponding to each file lock request according to the request type of each file lock request; wherein, the file lock state includes a non-blocking lock state and a polling block Lock status
    返回模块,用于向发起目标文件锁请求的客户端返回阻塞状态,以便所述客户端每隔预设时间发起所述目标文件锁请求,直至所述目标文件锁请求被所述服务器响应,其中,所述目标文件锁请求为文件锁状态为所述轮询阻塞锁状态的文件锁请求。The return module is used to return the blocking state to the client that initiated the target file lock request, so that the client initiates the target file lock request every preset time until the target file lock request is responded by the server, wherein , The target file lock request is a file lock request whose file lock state is the polling block lock state.
  8. 根据权利要求7所述文件锁处理装置,其特征在于,所述获取模块具体为当接收到目标客户端对所述目标文件系统中目标文件的文件锁请求时,获取所述目标文件系统的阻塞锁链表的模块。7. The file lock processing device according to claim 7, wherein the acquiring module is specifically configured to acquire the blocking of the target file system when the target client receives a file lock request for the target file in the target file system. The module of the chain list.
  9. 一种电子设备,其特征在于,包括:An electronic device, characterized in that it comprises:
    存储器,用于存储计算机程序;Memory, used to store computer programs;
    处理器,用于执行所述计算机程序时实现如权利要求1至6任一项所述文件锁处理方法的步骤。The processor is configured to implement the steps of the file lock processing method according to any one of claims 1 to 6 when the computer program is executed.
  10. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时实现如权利要求 1至6任一项所述文件锁处理方法的步骤。A computer-readable storage medium, wherein a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the file lock processing method according to any one of claims 1 to 6 is realized A step of.
PCT/CN2020/098005 2020-02-20 2020-06-24 File lock processing method and apparatus, electronic device, and storage medium WO2021164165A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010105189.6A CN111274214B (en) 2020-02-20 2020-02-20 File lock processing method and device, electronic equipment and storage medium
CN202010105189.6 2020-02-20

Publications (1)

Publication Number Publication Date
WO2021164165A1 true WO2021164165A1 (en) 2021-08-26

Family

ID=71002200

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/098005 WO2021164165A1 (en) 2020-02-20 2020-06-24 File lock processing method and apparatus, electronic device, and storage medium

Country Status (2)

Country Link
CN (1) CN111274214B (en)
WO (1) WO2021164165A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117407182A (en) * 2023-12-14 2024-01-16 沐曦集成电路(南京)有限公司 Process synchronization method, system, equipment and medium based on Poll instruction

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111274214B (en) * 2020-02-20 2022-08-16 苏州浪潮智能科技有限公司 File lock processing method and device, electronic equipment and storage medium
CN112130936B (en) * 2020-09-23 2023-12-19 平安科技(深圳)有限公司 Data calling method, device, equipment and storage medium based on polling
CN114116639B (en) * 2022-01-27 2022-04-29 苏州浪潮智能科技有限公司 Method, device, equipment and medium for setting cluster file lock
CN115934743B (en) * 2023-03-13 2023-06-02 浪潮电子信息产业股份有限公司 File lock management method, system, equipment and computer readable storage medium
CN115951844B (en) * 2023-03-13 2023-06-06 浪潮电子信息产业股份有限公司 File lock management method, equipment and medium of distributed file system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030028695A1 (en) * 2001-05-07 2003-02-06 International Business Machines Corporation Producer/consumer locking system for efficient replication of file data
US20080140663A1 (en) * 2006-12-11 2008-06-12 Chad Frederick Jones File Operations with Multiple Level File Locking Techniques
CN107423454A (en) * 2017-09-22 2017-12-01 郑州云海信息技术有限公司 The processing method of file lock, device and equipment in a kind of distributed file system
CN107423403A (en) * 2017-07-27 2017-12-01 郑州云海信息技术有限公司 A kind of fusion lock management method and system based on distributed file system
CN111274214A (en) * 2020-02-20 2020-06-12 苏州浪潮智能科技有限公司 File lock processing method and device, electronic equipment and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109684285B (en) * 2018-12-13 2021-10-29 郑州云海信息技术有限公司 User mode network file system file locking method, device and equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030028695A1 (en) * 2001-05-07 2003-02-06 International Business Machines Corporation Producer/consumer locking system for efficient replication of file data
US20080140663A1 (en) * 2006-12-11 2008-06-12 Chad Frederick Jones File Operations with Multiple Level File Locking Techniques
CN107423403A (en) * 2017-07-27 2017-12-01 郑州云海信息技术有限公司 A kind of fusion lock management method and system based on distributed file system
CN107423454A (en) * 2017-09-22 2017-12-01 郑州云海信息技术有限公司 The processing method of file lock, device and equipment in a kind of distributed file system
CN111274214A (en) * 2020-02-20 2020-06-12 苏州浪潮智能科技有限公司 File lock processing method and device, electronic equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117407182A (en) * 2023-12-14 2024-01-16 沐曦集成电路(南京)有限公司 Process synchronization method, system, equipment and medium based on Poll instruction
CN117407182B (en) * 2023-12-14 2024-03-12 沐曦集成电路(南京)有限公司 Process synchronization method, system, equipment and medium based on Poll instruction

Also Published As

Publication number Publication date
CN111274214B (en) 2022-08-16
CN111274214A (en) 2020-06-12

Similar Documents

Publication Publication Date Title
WO2021164165A1 (en) File lock processing method and apparatus, electronic device, and storage medium
US10541945B2 (en) Systems and methods for storing message data
JP2544904B2 (en) Call management workstation and method in collaborative work network
JP2018531465A6 (en) System and method for storing message data
US9900275B2 (en) Tracking object across processes
CN109743411B (en) Method, device and storage medium for dynamically scheduling IP proxy pool in distributed environment
US11106345B2 (en) Integrating related third-party services using dynamically generated user interfaces
JP2019521576A (en) Maintaining Messaging System Persistence
TWI460659B (en) Lock windows for reducing contention
CN108667744B (en) Flow control method and device
US20140068165A1 (en) Splitting a real-time thread between the user and kernel space
WO2014183417A1 (en) Method, device, and system for memory management
CN114223177A (en) Access control method, device, server and computer readable medium
CN111371851A (en) Connection method, connection device, electronic equipment and storage medium
CN116955219B (en) Data mirroring method, device, host and storage medium
CN111200651A (en) Method, system, device and medium for timed calling of microservice
CN111385255A (en) Asynchronous call implementation method and device, server and server cluster
CN113704195A (en) Android system junk file cleaning method and device
CN107025257A (en) A kind of transaction methods and device
CN116723242A (en) Network request cache retransmission method, device, equipment and storage medium
CN112653736A (en) Parallel source returning method and device and electronic equipment
CN110120963B (en) Data processing method, device, equipment and machine readable medium
CN112187501A (en) Terminal grouping management method, device, equipment and storage medium
US10884766B2 (en) Integrating related third-party services for user interaction
CN113704274B (en) Data reading method and electronic equipment

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20919587

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20919587

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 20919587

Country of ref document: EP

Kind code of ref document: A1