File locking method, device, electronic device and storage medium

By analyzing and locking files to be locked in multiple recording channels in the video surveillance system, batch locking is achieved using file identification information and locking rules, solving the problem of inefficient file locking in the prior art, and improving locking efficiency and flexibility.

CN118672983BActive Publication Date: 2025-02-07ZHEJIANG DAHUA TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411155600.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-21
Publication Date
2025-02-07
Estimated Expiration
2044-08-21

AI Technical Summary

Technical Problem

The existing technology is inefficient in the inability to achieve batch file locking when the video surveillance system is combined with the cloud storage system.

Method used

By analyzing the files to be locked in multiple recording channels, obtaining file identification information, and determining their respective file locking rules based on these information, flexible batch locking of multiple files to be locked is achieved.

Benefits of technology

It improves the efficiency of file locking, supports file locking in single or multiple time periods, meets different business needs, and avoids the inefficiency problem of sending file locking requests one by one in the prior art.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118672983B_ABST
    Figure CN118672983B_ABST
Patent Text Reader

Abstract

The present application discloses a file locking method, device, electronic device and storage medium, and relates to the field of cloud storage technology. The method comprises: parsing the files to be locked of multiple video channels to obtain file identification information of multiple files to be locked; determining the file locking rules corresponding to each of the multiple files to be locked according to the file identification information of the multiple files to be locked; and locking the multiple files to be locked respectively according to the file locking rules corresponding to each of the multiple files to be locked, so as to improve the efficiency of file locking.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of cloud storage technology, and in particular to a file locking method, device, electronic device and storage medium. Background Art

[0002] When a video surveillance system is combined with a cloud storage system, the surveillance equipment in the video surveillance system (such as front-end cameras and back-end hard disk recorders, etc.) will store a large number of generated files (such as video files or image files) in the cloud storage system.

[0003] During the storage process, files need to be locked to facilitate subsequent organization, search and management of files. Currently, to lock a large number of generated files, after receiving a file lock request for a target locked file sent by a terminal, a lock notification carrying the storage address of each file unit storing the target locked file is sent to the storage node to lock the file.

[0004] However, the above file locking method needs to perform the above operation once for each file, and cannot perform batch file locking at one time, resulting in low efficiency in locking files. Summary of the invention

[0005] The present application provides a file locking method, device, electronic device and storage medium to improve the efficiency of locking files.

[0006] In a first aspect, a file locking method is provided, comprising:

[0007] Parsing the acquired files to be locked of the multiple video channels to obtain file identification information of the multiple files to be locked;

[0008] Determining, according to the file identification information of the multiple files to be locked, the file locking rules corresponding to each of the multiple files to be locked;

[0009] The multiple files to be locked are locked respectively according to the file locking rules corresponding to the multiple files to be locked.

[0010] In an embodiment of the present application, the files to be locked of the acquired multiple recording channels are parsed to obtain file identification information of the multiple files to be locked; the file locking rules corresponding to the multiple files to be locked are determined according to the file identification information of the multiple files to be locked; the multiple files to be locked are locked respectively according to the file locking rules corresponding to the multiple files to be locked, and the file identification information of the file naming can be associated with the respective file locking rules, so that files can be locked in batches very flexibly, for example, files of a single time period can be locked, files of multiple time periods can be locked, and files in units of years or months can be locked. The file locking range can range from all files of the recording channel at the hour level to all files of the entire recording channel, which can meet the file locking forms of various time periods in actual business. Compared with the prior art, there is no need to send file locking requests one by one to lock files, which improves the efficiency of file locking.

[0011] In some embodiments, determining the file locking rules corresponding to each of the plurality of files to be locked according to the file identification information of the plurality of files to be locked includes:

[0012] According to at least one of the channel identification, file name, and file creation time in the file identification information of the first file to be locked, a first file locking rule for the first file to be locked is obtained from a file locking rule library; wherein the first file to be locked is any one of the multiple files to be locked.

[0013] In the above manner, by associating the file identification information of different recording channels with their respective file locking rules, the file locking rules configured for different channels can be obtained from the file locking rule library based on the information.

[0014] In some embodiments, the locking of the plurality of files to be locked respectively according to the file locking rules corresponding to the plurality of files to be locked respectively includes:

[0015] If the first file locking rule includes a continuous time period for locking files, the files in the first files to be locked within the continuous time period are locked.

[0016] In the above manner, files of a continuous time period can be locked among the files to be locked.

[0017] In some embodiments, the locking of the plurality of files to be locked respectively according to the file locking rules corresponding to the plurality of files to be locked respectively includes:

[0018] If the first file locking rule includes a non-continuous time period for locking files, the files in the first files to be locked within the non-continuous time period are locked.

[0019] By using the above method, files in non-continuous time periods can be locked in the files to be locked.

[0020] In some embodiments, the method further comprises:

[0021] receiving a rule change request; wherein the rule change request carries a file lock change rule for a first video recording channel, the first video recording channel being any one of the multiple video recording channels;

[0022] According to the file locking change rule, the file locking rule of the first recording channel in the file locking rule library is updated.

[0023] Through the above method, based on the rule change request initiated by the user, the file lock change rule of a certain recording channel carried in the request can be intersected or subtracted with all the file lock rules of the recording channel included in the file lock rule library, thereby reducing the size of the file lock rule library and supporting flexible changes to the file lock rules in the file lock rule library, thereby meeting the needs of different users and improving the user experience.

[0024] In some embodiments, the method further comprises:

[0025] receiving a file cleaning request; wherein the file cleaning request carries file cleaning information of a second video recording channel, and the second video recording channel is any one of the multiple video recording channels;

[0026] According to the file cleaning information and the file locking rule corresponding to the second video recording channel, the files in the second video recording channel that meet the file cleaning information and are not locked are cleaned.

[0027] Through the above method, life cycle detection can be performed, and the configured locking file rules can be converted into file cleaning filter conditions. The useless files of each recording channel in the database can be regularly recycled, which improves the rationality and efficiency of cleaning and relieves the storage pressure of the server.

[0028] In a second aspect, a file locking device is provided, comprising:

[0029] The parsing module is used to parse the acquired files to be locked of the multiple video channels to obtain the file identification information of the multiple files to be locked;

[0030] A determination module, configured to determine the file locking rules corresponding to each of the plurality of files to be locked according to the file identification information of the plurality of files to be locked;

[0031] The locking module is used to lock the multiple files to be locked respectively according to the file locking rules corresponding to the multiple files to be locked.

[0032] In some embodiments, the determining module is specifically configured to:

[0033] According to at least one of the channel identification, file name, and file creation time in the file identification information of the first file to be locked, a first file locking rule for the first file to be locked is obtained from a file locking rule library; wherein the first file to be locked is any one of the multiple files to be locked.

[0034] According to a third aspect, an electronic device is provided, including:

[0035] A memory for storing a computer program; a processor for implementing any one of the methods described in the first aspect when executing the computer program stored in the memory.

[0036] According to a fourth aspect, a computer-readable storage medium is provided, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the method according to any one of the first aspects is implemented. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 A schematic diagram of an application scenario applicable to the implementation of this application is shown as an example;

[0038] Figure 2 A flowchart of a file locking method provided by an embodiment of the present application is exemplified;

[0039] Figure 3 A flowchart of a method for changing a file locking rule provided by an embodiment of the present application is exemplarily shown;

[0040] Figure 4 A flowchart of a file cleaning method provided by an embodiment of the present application is exemplified;

[0041] Figure 5 The following is a schematic diagram showing the structure of a file locking device provided by an embodiment of the present application;

[0042] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application is exemplarily shown. DETAILED DESCRIPTION

[0043] In order to make the purpose, technical scheme and advantages of the present application clearer, the technical scheme in the embodiment of the present application will be clearly and completely described below in conjunction with the drawings in the embodiment of the present application. Obviously, the described embodiment is only a part of the embodiment of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application. In the absence of conflict, the embodiments in the present application and the features in the embodiments can be arbitrarily combined with each other. In addition, although the logical order is shown in the flow chart, in some cases, the steps shown or described can be performed in an order different from that here.

[0044] The terms "first" and "second" in the specification and claims of the present application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the term "comprising" and any of their variations are intended to cover non-exclusive protection. For example, a process, method, system, product or device comprising a series of steps or units is not limited to the listed steps or units, but optionally also includes steps or units that are not listed, or optionally also includes other steps or units inherent to these processes, methods, products or devices. "Multiple" in the present application can mean at least two, for example, two, three or more, and the embodiments of the present application are not limited.

[0045] The following is a description of exemplary embodiments of the present application in conjunction with the accompanying drawings, including various details of the embodiments of the present application to facilitate understanding, which should be considered as merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope of the present application. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description. It should be noted that in the embodiments of the present application, certain software, components, models and other existing solutions in the industry may be mentioned, which should be considered as exemplary, and their purpose is only to illustrate the feasibility of the implementation of the technical solution of the present application, but it does not mean that the applicant has or will necessarily use the solution.

[0046] At present, in the process of file locking, the locking rules are relatively simple. The locking judgment is generally all files before a certain time node or a certain time interval. There are great limitations for batch locking of files in non-continuous time intervals. In addition, for file locking operations, the general method is to add lock marks to files one by one. When the data specifications are huge, this type of locking method is inefficient and cannot meet user experience.

[0047] In view of this, an embodiment of the present application provides a file locking method, which supports flexible configuration and batch locking of files in non-continuous time intervals for files from different recording channels, so as to improve the efficiency of locking files and meet user experience.

[0048] The following is a brief introduction to the application scenarios to which the technical solutions of the embodiments of the present application can be applied. It should be noted that the application scenarios introduced below are only used to illustrate the embodiments of the present application and are not limited. In specific implementation, the technical solutions provided by the embodiments of the present application can be flexibly applied according to actual needs.

[0049] Figure 1 The following is a schematic diagram of an application scenario to which the present application embodiment is applicable. Figure 1 As shown, the scenario includes recording devices (1, 2, 3, ..., N) and a server 100; wherein, the recording devices (1, 2, 3, ..., N) and the server can exchange information via a communication network, and the communication methods adopted by the communication network may include: wireless communication methods and wired communication methods.

[0050] The video recording devices (1, 2, 3, ..., N) can collect their own video data in real time, and package the collected video data into files and transmit them to the server 100 through their own video recording channels.

[0051] Server 100 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms.

[0052] Furthermore, in the embodiment of the present application, the server 100 may be equipped with a file locking device, which is used to batch lock the files uploaded by each of the video recording devices (1, 2, 3, ..., N).

[0053] To further illustrate the technical solution provided by the embodiment of the present application, this is described in detail below in conjunction with the accompanying drawings and specific implementation methods. Although the embodiment of the present application provides the method operation steps as shown in the following embodiments or drawings, more or fewer operation steps may be included in the method based on routine or no creative labor. In the steps where there is no necessary causal relationship logically, the execution order of these steps is not limited to the execution order provided by the embodiment of the present application. The method may be executed or executed in parallel in the actual processing process or when the device is executed in accordance with the method sequence shown in the embodiment or drawings.

[0054] Figure 2 The flowchart of a file locking method provided by an embodiment of the present application is exemplarily shown. The flowchart can be executed by a file locking device to improve the efficiency of file locking. Figure 2 As shown, the process includes the following steps:

[0055] 201: Parse the acquired files to be locked of the multiple video channels to obtain file identification information of the multiple files to be locked.

[0056] In an embodiment of the present application, a file naming format may be pre-set, such as [channel identifier] / [year] / [month] / [day] / [hour] / [file name]; wherein "year", "month", "day" and "hour" represent the file creation time, thereby recording some key information in the file identification information, reducing the record fields of the data table, and facilitating subsequent acquisition of file locking rules for different channel configurations from the file locking rule library based on this.

[0057] For example, taking any one of the multiple files to be locked as an example, the specific file identification information is Record_001 / 2024 / 5 / 24 / 11 / file_0001.txt; among them, "Record_001" is the channel identifier corresponding to the file to be locked, "2024 / 5 / 24 / 11" is the file creation time corresponding to the file to be locked, and "file_0001.txt" is the file name of the file to be locked.

[0058] In some embodiments, file locking rules for different video channels can be configured in the file locking rule library, and special identifiers (e.g., "*") can be introduced to support flexible batch locking of files in continuous or non-continuous time periods (e.g., if the four fields "year-month-day-hour" are set to "*", it means that all files in the corresponding time period are locked). Subsequent file locking and unlocking can be implemented based on the file locking rule library. Specifically, the file locking rule library may include at least the following rules:

[0059] Rule 1: A file locking rule for a non-continuous time period can be set for any channel. Further, the file locking rule for a non-continuous time period can include at least the following forms:

[0060] Form 1: multiple files in different time periods in the same recording channel can be locked, for example, “Record_001”: [{ “2024-05-22-01”, “2024-05-22-14”}, { “2024-05-22-17”, “2024-05-22-22”}, … ]; the specific meaning of the file locking rule is: for the files to be locked with the recording channel “Record_001”, the files in different time periods from “2024-05-22 01:00 to 2024-05-22 14:00” and “2024-05-22 17:00 to 22:00 on May 22, 2024” are locked.

[0061] Form 2 can lock files at a certain time every day in the same recording channel. For example, "Record_001": [{"2024-05-*-14","2024-05-*-15"}]; the specific meaning of this file locking rule is: lock the files to be locked from 14:00 to 15:00 every day in May 2024 in the recording channel "Record_001".

[0062] Rule 2: For any video channel, you can set a file lock rule for a continuous time period. Furthermore, by introducing a special identifier "*" to indicate the time limit of the locked file, {time node 1, "*"} indicates that all files after time node 1 are selected for locking; {*, time node 2} indicates that all files before time node 2 are selected for locking.

[0063] For example, “Record_002”: [ { “*”, “2024-05-22-14”}]; the specific meaning of the file locking rule is: lock all files to be locked in the recording channel “Record_002” before 14:00 on May 22, 2024.

[0064] It should be noted that the file locking rule exemplified above is only an example. File locking rules can also be configured for time nodes of different degrees such as year, month, and day. For example, files of one or more months of each year in a certain video channel can be locked, or all files No. 1 in a video channel can be locked. For another example, specific target objects (such as vehicles, pedestrians, etc.) in the file to be locked can be locked. For another example, images with blurred fragments in the file to be locked can be locked. The specific configuration can be flexibly performed according to actual needs and is not limited here.

[0065] 202: Determine the file locking rules corresponding to the multiple files to be locked according to the file identification information of the multiple files to be locked.

[0066] In some embodiments, determining the file locking rules corresponding to each of the multiple files to be locked may be:

[0067] According to at least one of the channel identification, file name, and file creation time in the file identification information of the first file to be locked, a first file locking rule for the first file to be locked is obtained from a file locking rule library; wherein the first file to be locked is any one of multiple files to be locked.

[0068] For example, assuming that the file identification information of the first file to be locked is "Record_001 / 2024 / 5 / 22 / 11 / file_0001.txt", the first file locking rule related to the channel identification (ecord_001) can be obtained from the file locking rule library based on the file identification information. Similarly, for other files to be locked, their respective file locking rules can also be obtained in the above manner, and examples are not given one by one here.

[0069] 203: Lock the multiple files to be locked respectively according to the file locking rules corresponding to the multiple files to be locked.

[0070] In some embodiments, if the first file locking rule includes a continuous time period for locking files, the files in the continuous time period among the first files to be locked are locked.

[0071] In some embodiments, if the first file locking rule includes a non-continuous time period for locking files, the files in the first file to be locked that are within the non-continuous time period are locked.

[0072] In an embodiment of the present application, the files to be locked of the acquired multiple recording channels are parsed to obtain file identification information of the multiple files to be locked; the file locking rules corresponding to the multiple files to be locked are determined according to the file identification information of the multiple files to be locked; the multiple files to be locked are locked respectively according to the file locking rules corresponding to the multiple files to be locked, and the file identification information of the file naming can be associated with the respective file locking rules, so that files can be locked in batches very flexibly, for example, files of a single time period can be locked, files of multiple time periods can be locked, and files in units of years or months can be locked. The file locking range can range from all files of the recording channel at the hour level to all files of the entire recording channel, which can meet the file locking forms of various time periods in actual business. Compared with the prior art, there is no need to send file locking requests one by one, which improves the efficiency of file locking.

[0073] In some embodiments, the file locking rule library may also support changing the file locking rules of different channels to meet the needs of different users. Figure 3 As shown, a flowchart of a method for changing file locking rules provided by an embodiment of the present application is exemplified. The process includes the following steps:

[0074] 301: Receive rule change request.

[0075] In this step, the rule change request may carry a file lock change rule for a first video channel, where the first video channel is any one of a plurality of video channels (for example, Figure 1 Further, the rule change request may be to add a file locking rule for a certain recording channel, or to delete a file locking rule for a certain recording channel, or to modify a file locking rule for a certain recording channel for a previously specified time period to a file locking rule for another time period.

[0076] 302: According to the file locking change rule, the file locking rule of the first recording channel in the file locking rule library is updated.

[0077] In this step, if the file lock change rule is to add a file lock rule for a certain time period of the first recording channel, all file lock rules related to the first recording channel are obtained from the file lock rule library, and then the file lock change rule is combined with all file lock rules, and then the combined file lock rules are updated to the file lock rule library.

[0078] For example, take "Record_001": [ { "2024-05-22-10", "2024-05-22-15"}] as an example, assuming that the file lock change rule is to add a lock time period ({ "2024-05-22-15", "2024-05-22-19"}) for the first recording channel (Record_001), at this time, { "2024-05-22-10", "2024-05-22-15"} and { "2024-05-22-15", "2024-05-22-19"} are combined, and the file lock rule updated to the file lock rule library is "Record_001": [ { "2024-05-22-10", "2024-05-22-19"}}].

[0079] In this step, if the file lock change rule is to reduce the file lock rule for a certain time period of the first recording channel, all file lock rules related to the first recording channel are obtained from the file lock rule library, and then, the file lock change rule is subjected to intersection set processing with all file lock rules, and then the file lock rule after the difference set processing is updated to the file lock rule library.

[0080] For example, take "Record_001": [ { "2024-05-22-10", "2024-05-22-19"}] as an example. Assume that the file lock change rule is to reduce the lock time period of the first recording channel (Record_001) ({ "2024-05-22-14", "2024-05-22-15"}). At this time, { "2024-05-22-10", "2024-05-22-19"} and { "2024-05-22-14", "2024-05-22-15"} are processed by difference set. Finally, the file lock rule updated to the file lock rule library is "Record_001": [ { "2024-05-22-10", "2024-05-22-13"}, { “2024-05-22-16”, “2024-05-22-19”}].

[0081] It should be noted that the above method for changing the file locking rule is only exemplified by one recording channel, and the method can also be used to change multiple recording channels at the same time.

[0082] In an embodiment of the present application, based on a rule change request initiated by a user, the file lock change rule of a certain recording channel carried in the request can be processed by intersection or difference with all the file lock rules of the recording channel included in the file lock rule library, thereby reducing the size of the file lock rule library and supporting flexible changes to the file lock rules in the file lock rule library, thereby meeting the needs of different users and improving user experience.

[0083] In some embodiments, a life cycle detection can be performed on the files in the database according to a set period to detect the files that need to be deleted, so as to achieve the purpose of regular file cleaning, thereby alleviating the storage pressure of the server. Figure 4 As shown, a flowchart of a file cleaning method provided by an embodiment of the present application is exemplified. The process may include the following steps:

[0084] 401: Received a request to clean up files.

[0085] In this step, the file cleaning request carries file cleaning information of the second recording channel, where the second recording channel is any one of the multiple recording channels. The file cleaning information may include time information for cleaning, a channel identifier of the second recording channel, and the like.

[0086] 402: According to the file cleaning information and the file locking rule corresponding to the second video recording channel, the files in the second video recording channel that meet the file cleaning information and are not locked are cleaned up.

[0087] In this step, the file locking rule related to the channel identifier in the file cleaning information can be obtained in the file locking rule library, and then the file locking rule can be converted into a file cleaning filter condition. Combined with the time information in the file cleaning information, the files in the second recording channel that meet the time information and are not locked are cleaned.

[0088] In other embodiments, if there is no file locking rule related to the channel identifier in the file locking rule library, the files matching the time information in the second video recording channel are directly cleared.

[0089] Furthermore, after finishing this round of file cleaning, you can record the end time of this round to determine whether the start time and end time of this round meet the set interval time threshold. If so, wait for the next round of file cleaning; if not, directly enter the next round of file cleaning.

[0090] In the embodiment of the present application, through the above-mentioned life cycle detection, the configured locking file rules can be converted into file cleaning filter conditions, and useless files of each recording channel in the database can be regularly recycled, which improves the rationality and efficiency of cleaning and alleviates the storage pressure of the server.

[0091] Based on the same technical concept, a file locking device is also provided in an embodiment of the present application, and the device can implement the above-mentioned file locking method process in the embodiment of the present application.

[0092] Figure 5 The schematic diagram of the structure of a file locking device provided by an embodiment of the present application is exemplarily shown. The device comprises: an analysis module 501, a determination module 502, a locking module 503; further, it may also comprise a rule changing module 504 and a file cleaning module 505.

[0093] The parsing module 501 is used to parse the acquired files to be locked of the multiple video channels to obtain the file identification information of the multiple files to be locked.

[0094] The determination module 502 is used to determine the file locking rules corresponding to each of the multiple files to be locked according to the file identification information of the multiple files to be locked.

[0095] The locking module 503 is used to lock the multiple files to be locked respectively according to the file locking rules corresponding to the multiple files to be locked.

[0096] The rule change module 504 is used to receive a rule change request; wherein the rule change request carries a file lock change rule for a first recording channel, and the first recording channel is any one of the multiple recording channels; according to the file lock change rule, the file lock rule for the first recording channel in the file lock rule library is updated.

[0097] The file cleaning module 505 is used to receive a file cleaning request; wherein the file cleaning request carries file cleaning information of a second recording channel, and the second recording channel is any one of the multiple recording channels; according to the file cleaning information and the file locking rule corresponding to the second recording channel, the files in the second recording channel that meet the file cleaning information and are not locked are cleaned.

[0098] In some embodiments, the determining module 502 is specifically configured to:

[0099] According to at least one of the channel identification, file name, and file creation time in the file identification information of the first file to be locked, a first file locking rule for the first file to be locked is obtained from a file locking rule library; wherein the first file to be locked is any one of the multiple files to be locked.

[0100] In some embodiments, the locking module 503 is specifically used to:

[0101] If the first file locking rule includes a continuous time period for locking files, the files in the first files to be locked within the continuous time period are locked.

[0102] In some embodiments, the locking module 503 is specifically used to:

[0103] If the first file locking rule includes a non-continuous time period for locking files, the files in the first files to be locked within the non-continuous time period are locked.

[0104] It should be noted here that the above-mentioned device provided in the embodiment of the present application can implement all the method steps in the above-mentioned method embodiment and can achieve the same technical effect. The parts and beneficial effects of this embodiment that are the same as the method embodiment will not be described in detail here.

[0105] Based on the same technical concept, an electronic device is also provided in an embodiment of the present application, and the electronic device can realize the function of the aforementioned file locking device.

[0106] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application is exemplarily shown.

[0107] At least one processor 601, and a memory 602 connected to the at least one processor 601. The specific connection medium between the processor 601 and the memory 602 is not limited in the embodiment of the present application. Figure 6 In the example, the processor 601 and the memory 602 are connected via a bus 600. Figure 6 The connection between other components is shown by bold lines, and is not intended to be limiting. The bus 600 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 6 Only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus. Alternatively, the processor 601 can also be called a controller, and there is no limitation on the name.

[0108] In the embodiment of the present application, the memory 602 stores instructions that can be executed by at least one processor 601. The at least one processor 601 can execute a file locking method discussed above by executing the instructions stored in the memory 602. The processor 601 can implement Figure 5 The functions of each module in the device shown.

[0109] Among them, the processor 601 is the control center of the device, and can use various interfaces and lines to connect the various parts of the entire control device. By running or executing instructions stored in the memory 602 and calling data stored in the memory 602, the various functions of the device and processing data, the device can be monitored as a whole.

[0110] In the embodiment of the present application, the processor 601 may include one or more processing units, and the processor 601 may integrate an application processor and a modem processor, wherein the application processor mainly processes an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the modem processor may not be integrated into the processor 601. In some embodiments, the processor 601 and the memory 602 may be implemented on the same chip, and in some embodiments, they may also be implemented separately on separate chips.

[0111] Processor 601 may be a general-purpose processor, such as a central processing unit (CPU), a digital signal processor, an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component, and may implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of the present application. A general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of a file locking method disclosed in the embodiments of the present application may be directly embodied as being executed by a hardware processor, or may be executed by a combination of hardware and software modules in the processor.

[0112] The memory 602 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules. The memory 602 may include at least one type of storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory, a random access memory (Random Access Memory, RAM), a static random access memory (Static Random Access Memory, SRAM), a programmable read-only memory (Programmable Read Only Memory, PROM), a read-only memory (Read Only Memory, ROM), an electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), a magnetic memory, a disk, an optical disk, etc. The memory 602 is any other medium that can be used to carry or store a desired program code in the form of an instruction or data structure and can be accessed by a computer, but is not limited thereto. The memory 602 in the embodiment of the present application can also be a circuit or any other device that can realize a storage function, for storing program instructions and / or data.

[0113] By programming the processor 601, the code corresponding to the file locking method described in the above embodiment can be fixed into the chip, so that the chip can execute the code when running. Figure 2 The embodiment shown is a file locking method. How to design and program the processor 601 is a technology well known to those skilled in the art and will not be described in detail here.

[0114] It should be noted here that the above-mentioned electronic device provided in the embodiment of the present application can implement all the method steps implemented in the above-mentioned method embodiment, and can achieve the same technical effect. The parts and beneficial effects of this embodiment that are the same as the method embodiment will not be described in detail here.

[0115] Based on the same technical concept, the embodiment of the present application provides a computer storage medium, which includes: computer program code, when the computer program code is executed on a computer, the computer executes any of the file locking methods discussed above. Since the principle of solving the problem by the above computer storage medium is similar to that of a file locking method, the implementation of the above computer storage medium can refer to the implementation of the method, and the repeated parts will not be repeated.

[0116] In a specific implementation process, computer storage media may include: Universal Serial Bus Flash Drive (USB), mobile hard disk, read-only memory (ROM), random access memory (RAM), magnetic disk or optical disk, and other storage media that can store program codes.

[0117] Based on the same technical concept, the embodiment of the present application also provides a computer program product, which includes: computer program code, when the computer program code is run on a computer, the computer executes any of the file locking methods discussed above. Since the principle of solving the problem by the above computer program product is similar to that of a file locking method, the implementation of the above computer program product can refer to the implementation of the method, and the repeated parts will not be repeated.

[0118] The computer program product can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, but not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0119] The method in the present application can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer programs or instructions. When the computer program or instruction is loaded and executed on a computer, the process or function described in the present application is executed in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, a network device, a user device, a core network device, an OAM or other programmable device.

[0120] The computer program or instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer program or instructions may be transmitted from one website, computer, server or data center to another website, computer, server or data center by wired or wireless means. The computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server or data center that integrates one or more available media. The available medium may be a magnetic medium, such as a floppy disk, a hard disk, or a magnetic tape; it may also be an optical medium, such as a digital video disk; it may also be a semiconductor medium, such as a solid-state drive. The computer-readable storage medium may be a volatile or non-volatile storage medium, or may include both volatile and non-volatile types of storage media.

[0121] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) containing computer-usable program codes.

[0122] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that has the functions specified in one or more boxes.

[0123] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0124] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0125] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A file locking method, characterized in that: include: Parsing the files to be locked of the acquired multiple video channels to obtain file identification information of the multiple files to be locked; wherein the file identification information includes a channel identification, a file name and a file creation time; Determining, according to the file identification information of the multiple files to be locked, the file locking rules corresponding to each of the multiple files to be locked; According to the file locking rules corresponding to the multiple files to be locked, the multiple files to be locked are locked respectively; The step of determining the file locking rules corresponding to each of the plurality of files to be locked according to the file identification information of the plurality of files to be locked includes: According to the channel identifier in the file identification information of the first file to be locked, a first file locking rule for the first file to be locked is obtained from a file locking rule library; wherein, the first file to be locked is any one of the multiple files to be locked, and the first file locking rule includes a continuous time period and / or a non-continuous time period for locking the file.

2. The method according to claim 1, characterized in that The locking of the plurality of files to be locked respectively according to the file locking rules corresponding to the plurality of files to be locked respectively comprises: If the first file locking rule includes a continuous time period for locking files, the files in the first files to be locked within the continuous time period are locked.

3. The method according to claim 1, characterized in that The locking of the plurality of files to be locked respectively according to the file locking rules corresponding to the plurality of files to be locked respectively comprises: If the first file locking rule includes a non-continuous time period for locking files, the files in the first files to be locked within the non-continuous time period are locked.

4. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: receiving a rule change request; wherein the rule change request carries a file lock change rule for a first video recording channel, the first video recording channel being any one of the multiple video recording channels; According to the file locking change rule, the file locking rule of the first recording channel in the file locking rule library is updated.

5. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: receiving a file cleaning request; wherein the file cleaning request carries file cleaning information of a second video recording channel, and the second video recording channel is any one of the multiple video recording channels; According to the file cleaning information and the file locking rule corresponding to the second video recording channel, the files in the second video recording channel that meet the file cleaning information and are not locked are cleaned.

6. A file locking device, characterized in that: include: A parsing module, used to parse the acquired files to be locked of the multiple video channels to obtain file identification information of the multiple files to be locked; wherein the file identification information includes a channel identification, a file name and a file creation time; A determination module, configured to determine the file locking rules corresponding to each of the plurality of files to be locked according to the file identification information of the plurality of files to be locked; A locking module, used to lock the multiple files to be locked respectively according to the file locking rules corresponding to the multiple files to be locked; Among them, the determination module is specifically used to: obtain the first file locking rule of the first file to be locked from the file locking rule library according to the channel identifier in the file identification information of the first file to be locked; wherein, the first file to be locked is any one of the multiple files to be locked, and the first file locking rule includes a continuous time period and / or a non-continuous time period for locking the file.

7. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, configured to implement the method according to any one of claims 1 to 5 when executing a computer program stored in the memory.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Method for protecting cloud storage video data and system thereof

    CN104700037A